text
stringlengths
454
608k
url
stringlengths
17
896
dump
stringclasses
91 values
source
stringclasses
1 value
word_count
int64
101
114k
flesch_reading_ease
float64
50
104
Feedback Getting Started Discussions Site operation discussions Recent Posts (new topic) Departments Courses Research Papers Design Docs Quotations Genealogical Diagrams Archives On the Revival of Dynamic Languages pdf The programming languages of today are stuck in a deep rut that has developed over the past 50 years... We argue the need for a new class of dynamic languages... features such as dynamic first-class namespaces, explicit meta-models, optional, pluggable type systems, and incremental compilation of running software systems. Some context for "Static Typing Where Possible, Dynamic Typing When Needed" OOPSLA'04 Workshop on Revival of Dynamic Languages (Papers) Isaac, why not become an editor and post items of this nature directly to the home page? While this paper is interesting, it also contains lots of claims to disagree with. Naturally, the worst part is about types. Here is my favorite: Furthermore, static type systems can produce a false sense of security. Run-time type-checks (i.e. "downcasts") in Java, for example, can hide a host of type-errors. I.e., they criticise holes in some type system - which are due to the presence of "dynamic typing" features like downcasts! - and then take that as an argument against static typing ... and for more dynamic typing (proposing to have dynamic languages with optional static typing). How self-contradictory is that? That they seem to completely miss the point of type systems becomes apparent with the following principle they propose: A type system should never be used to affect the operational semantics of a programming language. Of course, this makes it almost completely uninteresting, in particular in a dynamic language! When you have a typed dynamic language, then types will appear in the dynamic semantics (as opposed to mere tags), and surely you want these types to affect the operational semantics. Otherwise why bother with them? Of course, the usual confusion of typing vs. tagging is not missing: those who believe that dynamic languages are evil because they are untyped (not true - they are dynamically typed) Some other examples: In Section 4 we explore the theme of type systems for dynamic languages (an apparent non sequitur) It is not at all apparent to me. Static type systems, however, are the enemy of change. Even languages that sport state-of-the-art type systems, such as (different variants of) ML or Haskell, struggle with overloading, polymorphism and re ection in the context of type-safety [Mac93]. I take reflection, but polymorphism and overloading? Then citing Haskell? Extensions of polymorphism (such as first-class poly-morphism in ML [Rus00] or in Haskell [Jon97]) exist but do not always allow for separate compilation (unless the type-preservation rules are relaxed) [KS04]. Not always? So? Note that [KS04] is about C#, and problems with first-class polymorphism there are likely to be rooted in peculiarities of the language rather than in the feature as such (which the other references prove to be unproblematic). This is an obvious attempt of a tendentious spin. A much more reasonable, and interesting alternative, is to envisage a dynamic programming language into which various non-standard type systems could be plugged. It is folklore that it is at least very hard to retrofit a useful type system onto a language that has not been designed with it in mind. It seems very naive to believe that externally "plugging" arbitrary type systems onto a language isn't even harder. And so on. I'll stop here. There are some worthwhile points being made in the paper, but it shows where the authors are coming from. Altogether, I'm not even sure what their point is: In this paper we take the standpoint that: Inherently static languages will always pose an obstacle to the effective realization of real applications with essentially dynamic requirements. Inherently static languages will always pose an obstacle to the effective realization of real applications with essentially dynamic requirements. ... which seems like a rather vacuous statement to me. It is folklore that it is at least very hard to retrofit a useful type system onto a language that has not been designed with it in mind. Usually the language design itself poses few problems to grafting in a type system. The real problem comes from existing code written in the language, code that hasn't been written to work inside your type system. So... unless you come up with a good mechanism that restricts pluggable type systems in such a way that they all interoperate nicely, I'm a bit skeptical of the idea. I make that statement with a small caveat. Say you are writing some module that does something complicated, and you are paranoid about a certain type of error creeping into that code. In some cases, an internal typing discipline could prevent this... but I still see numerous problems with external dependencies of your module. proposing to have dynamic languages with optional static typing Yes, if a static language with runtime type checks "can produce a false sense of security" we might surely expect the same from a dynamic language with optional static typing. (Of course, "false sense of security" is pure FUD - we might as well say testing gives a false sense of security.) .) struggle with overloading, polymorphism and reflection Maybe they meant, we want all these to be supported in the same language before we're interested? What would be the application of reflection in a statically typed language? Surely we know all about the type of a value at compile time? Surely it only even makes sense when objects have identity, and it becomes a way to have the programmer manually deal with types dynamically? Isaac Gouy:. I think this is a particularly good formulation, and gets very close to where dynamic language and static language fans differ. My reaction to this is frank incredulity that anyone would even advance the argument that because a language's type system doesn't capture all possible nonsensical terms at compile time, a better idea is to capture zero nonsensical terms at compile time! frank incredulity All things being equal - your incredulity would be fully justified. From some viewpoints all things are not equal - as iirc you've previously stated - it's mostly about perceived cost-benefit. So let me ask: what benefit do I get from having zero constraints checked at compile time that justify whatever costs you perceive in having some, but admittedly never all, constraints checked at compile time? In fairness, I should warn you in advance that the stock dynamic typing answer, "faster development," won't fly with me given my direct experience with O'Caml and Tuareg Mode in EMACS. Tuareg mode? Tuareg Mode Google, my friend. Google. What I especially like about Tuareg Mode is the ability to type some source code into a buffer that I will eventually compile, but feed it to a running toplevel as if I were just using the toplevel interactively. There's also an option you can configure to have the cursor move to the next expression afterwards, so you can type N expressions, go the top of the buffer, then C-c C-e, C-c C-e, C-c C-e... There's also the support for O'Caml's excellent time-travel debugger. Of course, you also can indeed switch over to the running toplevel and noodle around with stuff you don't want to commit to a file. In other words, Tuareg Mode is roughly akin to SLIME for Common Lisp (which I also use), or OPI for Oz (which I also use). The combination of Tuareg Mode and O'Caml offers the combined benefits of exploratory, interactive development in the same fashion as the dynamic languages and static typing in the fashion of Hindley-Milner type inferred languages. It gets even better: there's a very nice make-like tool, OMake, that has an option, -P, that causes it to run forever, monitoring the filesystem with either FAM or kqueue, and to redo the build whenever it sees a change. So if you do this, and use Tuareg Mode to try things out in a buffer attached to a file being monitored, when you press C-x s, your program will automagically be rebuilt. How sweet is that? The question doesn't make sense to me: how could we use some benefit from zero checks to justify the cost of checks? Let's say that language S magically provides dynamic type checks equivalent to language D, and language S also provides static type checks. I think the question is - do the perceived benefits of these static type checks outweigh the perceived costs, to an interesting degree. And then of course, we complicate the whole comparison if we can't do the magic that provides equivalent dynamic type checks. Isaac Gouy: The question doesn't make sense to me: how could we use some benefit from zero checks to justify the cost of checks? Sorry, I don't think I was clear: I was asking what the benefit of having no compile-time checks on terms is relative to having some, but not all, nonsense terms rejected at compile time. Generally, the dynamic typing answer to this is "you can develop more rapidly in a dynamic language," which isn't necessarily true. Sometimes the counter is that there remain terms that are correct but not well-typed in any given type system, say HM. While that's true in principle, it doesn't tend to come up in practice; that is, HM system users seem to have no more difficulty coming up with ways to express what they wish to express than users of dynamic languages do. So it's an honest question: if I can develop interactively in an HM language and don't run into any more expressive issues in my HM language than I do in, say, Lisp or Scheme, what's the dynamic language benefit that justifies sacrificing the static typing benefits? Isaac: Let's say that language S magically provides dynamic type checks equivalent to language D, and language S also provides static type checks. I think the question is - do the perceived benefits of these static type checks outweigh the perceived costs, to an interesting degree. There isn't really enough information here to even be able to guess. Is S type-inferred? What's the type system, i.e. how expressive is it? But since you asked, OK: the more I think about it, and work through Practical Common Lisp using SBCL and SLIME to brush up on my Lisp, and continue working with O'Caml using the tutorials and Tuareg Mode, the more convinced I am that, in objective terms, static typing has irreproducible benefits over dynamic typing, with the only respect in which that isn't clear being reflection/introspection, which probably just means that we need to figure out what the metatheory behind not doing type erasure is. That probably means Monadic Reflection in one form or another. There isn't really enough information here to even be able to guess Which is to say, we aren't in a position to make universal statements about static languages and dynamic languages but we can start to ask questions about a particular static language and a particular dynamic language. Isaac Gouy: Which is to say, we aren't in a position to make universal statements about static languages and dynamic languages but we can start to ask questions about a particular static language and a particular dynamic language. But that's simply not true. I can make the universal statement that static languages guarantee me the absence of certain error classes at compile time that dynamic languages don't, otherwise, why bother? All I was saying was that I can't begin to guess what your "perceived costs" of static typing are. I can tell you precisely what the actual costs of dynamic typing relative to static typing are if we stipulate, as you did, that they were functionally equivalent apart from being in different phases: given the static language, the customer will never see them; given the dynamic language, the customer might. I've attempted to anticipate your line of argument by discussing two common ones: rapid development and correct terms that lack a type in any given type system that we care to reach consensus on, with HM being merely one of several options. I can argue from direct experience of approximately five years in O'Caml and approximately 20 in Common Lisp or Scheme that those arguments are entirely anecdotal. O'Caml development is as rapid, if not moreso, as Common Lisp or Scheme development. The correct-but-untypable term argument ends up being an educational one; a novice, e.g. ML programmer, especially coming from the Lisp tradition as I did, will likely run into this issue at first, but once they become familiar with the approach to the problem domain that works in the ML family, they'll equally likely, to a first approximation, never encounter the issue again, and when they do, they'll have the appropriate intellectual tools to contend with it. Frankly, even if static typing didn't confer a range of guarantees of preventing classes of errors from reaching the customer, the research on it would still be worthwhile, as it provides a set of principled underpinnings for understanding programming languages that prevents people from saying such things as "We aren't in a position to make universal statements about static languages and dynamic languages." Just because dynamic languages don't have such a set of defining principles, it doesn't mean that they don't exist! But that's simply not true. I can make the universal statement that static languages guarantee me the absence of certain error classes at compile time that dynamic languages don't, otherwise, why bother? iirc the context was perceived cost-benefit. As you said "There isn't really enough information here to even be able to guess". those arguments are entirely anecdotal Pardon me, but isn't you're testimony about O'Caml and Lisp also anecdotal? [Paul Snively] Generally, the dynamic typing answer to this is "you can develop more rapidly in a dynamic language," which isn't necessarily true. Totally. It is usually stated without evidence that static typing creates more work for the programmer. One of the pro-dynamic arguments I hear a lot is the "latent typing" argument. Java makes you create interfaces while Python lets you simply use the same method name across different classes. What they're really saying is that they'd prefer structural typing over nominal typing. It's not a static vs. dynamic thing (though structural type declarations can involve a lot of typing). The tranditional benefits of static typing are already well known (performance, compile-time checks). It would be useful to collect a list of ways in which static typing makes programmer faster/easier for a programmer. For example, C++-style overloaded methods are nice to have. Refactoring and code completion are more robust. Types are also a good form of documentation (and I've noticed that library documentation in dynamically-typed languages usually includes precise type information in the comments). for the same quality code. Oh, and faster debugging. This is an important- many dynamic language advocates seem to assume that unit testing is only usefull, or only done, in dynamic languages. Everyone benefits from test cases. This is, in fact, one valid way to look at static typing- it's a huge suite of automated unit tests. So, the question then becomes how many test cases do you need to write to acheive the same degree of quality confidence in the code? With static checking, whole suites of test cases are not needed, as the type checker "tests" the code for you. The other thing is speed of debugging. The nice thing about static type checkers is that 99% of the time they pinpoint the real location of the problem for you. Dynamic typing more often than not in my experience hides the problem, just to have it show up quite some time later. A classic example of this- accidentally putting a string into a list of integers. With static type checking, the error shows up when you try to put the string into the list of integers. With dynamic typing, the error doesn't show up until you are pulling integers out of the list, and hit the element that isn't an integer. With static type checking, I'm given the file and line the real error is at. Thirty second later, I'm back in business. With dynamic type checking, I'm now having to back track and try to find where the string is being put into the list, as the minutes pass by. Given everything you say about testing and debugging (which I agree with), why is it that we so often hear "dynamic languages" being touted as offering "faster development"? Do they really offer faster development, or does it just feel that way for some reason? I know you didn't ask me :-) but my experience is that interactive development gives us a very short path from concept to an implementation. Test-Driven Development and Agile Development methodologies such as Extreme Programming, which come to us from the Smalltalk world, tell us that then what you do is robustify the implementation until it meets the goals set forth in user stories and is reasonably, but not overly, future-proof. So I suspect that it does feel shorter because of that initial lack of distance between concept and initial implementation. Nor do I think that feeling is invalid. What I do question, however, is whether there isn't as much or more time in coming up with these near-100%-coverage test environments as there would be in developing in a good type-inferred static language, which, as I've already noted, can also be extremely interactive, and developing the somewhat smaller test harness for the results. The question in my mind is reinforced when I read, e.g. comments about how "mocking up and testing code is a lot easier without type checking getting in the way. I should think getting 100% coverage would be easier in a more dynamic language." Apart from being a searing self-indictment just on grounds of laziness, it clearly reveals that the programmer in question has never worked with a type-inferred language. And so it goes: generalizations about "static typing" are made on the basis of primitive type systems and/or systems lacking inference (I have to be careful here; one certainly can't justifiably call Java 1.5's type system "primitive", but the lack of inference hurts it tremendously). But someone can rightly argue that my single example of an agile statically-typed language is O'Caml. Why is that? O'Caml certainly demonstrates that a type-inferred language with a relatively rich type system needn't be batch compiled, so why don't more such languages offer nice interactive environments? You might think that it's because such features hinder optimal code generation, but O'Caml remains faster than current GHC, all in all, as well as SML/NJ. Only MLton produces competitive code, but MLton is a much slower compiler and doesn't offer a toplevel at all: you have to use a different SML, e.g. Moscow ML, for that. The argument seems similar to the one in which people used to think that the interactive nature of Lisp meant that it was interpreted—long past the point at which all commercial implementations, and several free ones, were compiling to native code. So there's clearly more work for most statically-typed language developers to do, and that work might be more cultural than technical. Maybe the big lesson of dynamic languages is that interactive development has real, tangible, measurable productivity benefits that so far, only O'Caml can reasonably claim to have adopted, and it's going to take some kind of revolution for the rest of the statically-typed world to catch up. That's an argument that I could wholeheartedly agree with. Thank you for your insightful response Paul.My own experience with dynamically typed languages is pretty limited, so it's good to get an opinion from someone who does have experience in that area (even if they weren't the target of the original question ;-) Even with good testing we are still used to seeing the occasional runtime errors that we need to fix in both kinds of languages. Therefore, when we see a function trying to pull a string out of an integer, we are used to blame ourselves: "Oh, I passed the wrong variable as the argument" instead of "oh dear byte code compiler, why haven't you warned me of this mismatch" because we know that there is no static type checking to begin with. So, (a plausible theory is that) every minute spent debugging a dynamically typed program goes in the "programmer made an error" column while every minute spent setting up interfaces, fixing compilation errors, etc. goes in the "evil statically checked language is slowing me down; dwim please, get out of my way, etc. ". This is not to say one is better (in terms of productivity) than the other in the aggregate, but it is easy to form false impressions going by the feeling of it. Do they really offer faster development... Faster development than what? Faster development than C? Faster development than Java? Faster development than OCaml? You tell me. I'm not the one claiming that development in a "dynamic language" is "faster" than development in a "static language". I'm not saying you are making that claim either. But I seem to have heard it from many proponents of "dynamic languages" as a rationale for preferring them to statically typed languages. When they say "faster", to what are they comparing? And are the purported speed benefits really due to the dynamic nature of the language, or are they simply the result of a combination of extensive libraries and a shorter interval between concept and initial coding? I seem to have heard it So when you really do hear it, ask which "dynamic language" is faster to develop with than which "static language" for what kind of project! Oh, and ask to see the project velocity measurements :-) First of all, most of the static/dynamic comparisons I've seen (including, it seems, this one) have been comparisons of Java/C# to Python/Ruby, effectively. And I wouldn't be at all surprised if Python/Ruby were faster/easier to develop in than Java/C#. It's when you throw Ocaml/Haskell into the mix that things become more interesting. Especially as you start realizing a lot of the productivity advantages of Python/Ruby have nothing what so ever to do with their dynamic typing. For example, having an interpreted environment for the language encourages a more interactive design- write a little code, play with it a little to make sure it works, and then move on to the next peice of code. While a compiled language encourages you to develop a larger hunk of code before compiling and testing. The more iterative the implementation is, the more likely you are to find the bugs sooner, and the easier it is to find the bug (find a bug in 20 lines of code 100 times being easier than finding 100 bugs in 2000 lines of code all simultaneous and interacting). Java/C#/C++ are generally compiled languages, while Python and Ruby are more generally interpreted languages. But this has absolutely nothing to do with their type systems- it is perfectly plausible to write an interpreter for a strictly compile time type checked language, as the Ocaml top level interpreter shows. There are other aspects that make a language easier to develop in- large available libraries, for example. UI code generators (like Visual Studio and Glade) also help with the illusion of productivity- I can generate megabytes of code in only a few hours with these tools without even touching a keyboard. But these too are not an effect of the type system. But it's often hard to seperate the effectiveness of the language and development environment as a whole from the effectiveness of a specific type system. The traditional benefits of static typing are already well known (performance, compile-time checks) Given your enthusiasm for evidence, you can provide evidence that compile-time checks result in fewer errors in the delivered software - can't you? Funny, I've been looking for something like this paper with little luck the last few days. I'd hate to see any discussion on this degrade into another static vs. dynamic type war though, since I believe there are quite a few nuggets of gold in there. What interests me about this paper are the ideas on reflection and how to limit or control it. I'd also like to find more information in the area of living or evolving software and various ways to approach the problem of multiple developers working on a dynamic system. Looking at Squeak, it seems the problem is just as much a social or political problem as it is a technical one. Linux and other file-based systems have loosely agreed upon (but well-understood and psychologically ingrained) standards for sharing, maintaining, and distributing software. It's second nature to organize software as files in subdirectories that are part of a larger (but self-contained) package. The open source CL community does this and I believe Genera did the same. Unfortunately, if you treat software at all multidimensionally (Squeak) then the scheme breaks down. When you can modify program behavior through a GUI, for example, there really is no corresponding source code file. I suppose generating the equivalent of a "patch" is possible, but would be meaningless. There would need to be a way to distinguish between architecture and mere user configuration. Unless you wish to relegate "architecture" changes to a source code file representation and every other dimension to the user's instance of that architecture. That might be one way of looking at it. Any pointers would be greatly appreciated. First, let me wholeheartedly agree that reflection is where the static and dynamic typing communities can most profitably meet. There's a lot of outstanding reading on my pile in that regard, to be honest. With respect to the upgrade problem, which is a big one for any live system, static or dynamic, I'm going to pull out one of my favorite poster children again :-) and refer to Acute. Most of the attention that has been paid to Acute has been for its efforts in type-safe distributed programming, but this time I'd like to refer to the points on the page that say "dynamic loading and controlled rebinding to local resources" and "versions and version constraints, integrated with type identity." This represents Peter Sewell and colleagues' current effort towards addressing the upgrade problem in a type-safe way, and is as fascinating, and promising, as the focus on type-safety in distributed programming. Of course, they're related, which is why you find them both in the Acute project. But that obviously doesn't address the question regarding dynamic languages. Units: Cool Modules for HOT Languages remains my primary source regarding module systems for either static or dynamic languages, and I just re-read it to see if they discuss versioning. They don't, but they do discuss dynamic linking, so hopefully there's an open door for future work on the relationship between dynamic linking and versioning. Good stuff there, thanks. I briefly read through the Acute paper and one of the first things that caught my eye was the versioning. Interesting stuff going on with the hashing to arrive at versions, version constraints, etc. Plenty of issues that I never noticed or thought about as well. The "Units" paper is interesting as well. I'll have to read both thoroughly when I get some more time. Just the stuff I'm looking for, though :-) From the David Unger position statement... Objects are live, code always runs. There is no difference between compile-time and run-time. In fact, we use every trick in our book to conceal compilation. The user makes a change, commits it, and in a fraction of a second, the change takes effect. Some systems, such as Magpie, commit changes after every keystroke. This immediate response mirrors the real world. Can anyone point me in the direction of Magpie? All of my searching has so far come up short. The project started out at Tek Labs and some of the folks migrated out to an adjunct of the MDP group at Walker Road to try to merge this into a CASE product (with an SASD-based visual editor, too!). After Tektronix decided they weren't interested in doing CASE tools after all, a lot of these folks got absorbed into Mentor Graphics in their pre-V8.0 ramp-up when MG thought they'd do combined hardware/firmware design tools. Most of them were subsequently laid off early in the first part of the V8.0 semi-collapse when MG decided it was better to finish V8.0 than to try to expand into other areas. Patrick Logan, as another old area alumnus, do you remember anything else about this? Thanks for the link. Being a former Tek employee myself (High Frequency Design), I'm always impressed at the stuff that was dreamed up (but seldom commercialized) by the folks in Building 50. Yes. A lot of interesting things did come out of there - the commercialization of LCD screens (Planar Systems, InFocus, and a couple other LCD-based companies are still here in the PDX area), a good Smalltalk implementation that was the basis of the 4066 AI workstation (it also had a Franz-bsed Lisp subsystem with Flavors), one of the first 1GHz production-grade transistor processes (actually done in Bldg. 59), mask-overlap chip production processes, CRC cards, and - of course - Ward Cunningham and Kent Beck. All-in-all, a phenominal hotbed of research activity for a (relatively) small company. But those were different days - when CEO's wre allowed to fund research. It is sad that our industry finds it difficult to hand over even a pittance to basic research these days. You forgot to mention the 11K scope, which ran Smalltalk for it's user interface ("real time" code was done in C, IIRC). Unfortunately, Tek Labs is no more; though Building 50 still stands. I'm sitting there now as I type... in C++. :| Back to work... I just wonder whether objects are the correct form of abstraction for the larger concept of software components. Although most OOP literature tries to paint objects as loosely coupled components that speak to each via messaging, that's not the way they seem to be implemented. Objects generally have to be written either in a common language (or in a common intermediate representation). And the messaging that takes place between them is usually just a function call aimed at a specific module via some VTable, or some form of delegation/forwarding. Perhaps instead of componetizing at the level of class, what we need is to have a better definition of the line of demarcation of where one application starts and another ends - and that interface between applications and subsytems. Loose coupling betwixt components is the name of the game, and I don't see objects as necessarily being the last word on plug and play components. Anyhow, just a thought. :-) Many software algorithms are coupled with more than one types. The mainstream object-oriented approach is that one type is coupled with one set of subroutines. Although this works in some cases, it does not work in others, and that's usually the reason why there is such strong coupling between objects. Do you mean - objects have failed to provide universal loose-coupling? And if that is what you mean, what programming style is "better" (results in more "loose-coupling")? ...is that inclusion polymorphism is wildly overused in practice and results in far too tight coupling in most cases. In C++, for example, the only coupling you have that's tighter than public inheritance is class friendship. By way of contrast, given a structural type system and ML-style module system, any implementation that implements a given interface will do, and then, with functors, i.e. modules parameterized by other modules, you can achieve even more loose coupling. Another mechanism that can be useful in some contexts are what are sometimes referred to as "virtual types." An excellent explanation, with several implementations in O'Caml, can be found in On the (un)reality of virtual types. The whole section entitled "The necessary ingredients for decoupling classes" is a must-read, IMHO. The paper claims that static typing is the enemy of change. My opinion is that it is not. In fact, the type system is irrelevant to change-ability of a system. An example of this is J2EE applications: although Java has a static type system, J2EE applications can be updated without currently active clients be interrupted. The current clients will continue to see the prev app, while the clients that log in after the new version is uploaded will use the new one. The problem is that systems are not a live collection of objects that can be easily be swapped in/out. In J2EE for example, the whole web app needs to be uploaded, instead of simply replacing a few classes. The situation is even worse for desktop applications: they need to be recompiled, instead of simply replacing some class with another. I believe that the usual reason for stating static typing as the enemy of change is that to changing the code involves respecifying the types of things. When you refactor Java/C++ you end up having to change a lot of class names and so on, where as in something like Python you just change the variable name. Haskell style type inference more or less makes that a moot issue, but hoping the dynamic languages fanbois to understand complex type theory is obviously stretching. </rant> type inferencing is hardly complex type theory, at least to the user although Java has a static type system, J2EE applications can be updated without currently active clients be interrupted. But note that this relies on the fact that at its core, Java is a dynamically checked language. Its type system breaks down as soon as you use dynamic features - it cannot guarantee absence of runtime errors like MethodNotUnderstood. So I don't think that Java is a valid counter-example - it's not properly typed. What language would be needed for a valid counter-example - one that guaranteed absence of divide-by-zero? (Where do you suggest we draw the line?) (Incidentally are you talking about Java 5, or Java 1.4?) The simplest is to just change the type of division: unsafe_div : number -> number -> number safe_div : number -> number -> number option Now, you reflect the fact that division may fail in the type of the function, and so you need to handle all possible divide-by-zero errors before you can claim an expression is of type number. Secondly, you can augment the type system with dependent types, and then you can write a division function that's only applicable to nonzero divisors. (Elements of the type Nonzero(d) are witnesses, or proofs, of the fact that d is not zero.) dependent_div : number -> d : number -> Nonzero(d) -> number This a rather more heavyweight solution, but you can scale it to state nearly arbitrary conditions. In fact, theorem provering environments like Coq, HOL or Twelf use a type language of dependent types as their mathematical metalanguage, and use lambda-terms as the representations of proofs. would it be possible to have not_zero : number -> nznumber option safe_div : number -> nznumber -> number a little clumsy but straightforward and fully static In general, you can encode a surprisingly large number of static constraints in a polymorphic type system. The question is whether the additional work is worth the effort.... The question is whether the additional work is worth the effort... Yes that is a really important question :-) The other (ignorant) question is can we have the "surprisingly large number of static constraints" in the same polymorphic type system at the same time. I always seem to read about a specific kind of constraint, and then wonder about bad feature interaction. See Figure 1 of Building Extensible Compilers in a Formal Framework, which is basically a graph, with the horizontal axis representing stages in compilation of the polymorphic lambda calculus (type inference, type checking, CPS conversion, closure conversion, and code generation) and the vertical axis representing various extensions to the language (from most basic to most complex going up: boolean values, arithmetic, integers, arrays, recursive functions). The graph clarifies that not all extensions affect all stages, e.g. recursive functions don't affect CPS conversion, but are the only extension that affects closure conversion. So here we have a principled mechanism for adding features to a language while avoiding bad interactions. Another take on this issue that unifies the traditional Action Semantics, or Structural Operational Semantics, approach to defining a language, with monads, which do an excellent job of isolating things like side-effects, is A Modular Monadic Action Semantics, previously discussed on LtU here, in which there's a priceless quote from Graydon Hoare about monads: "Monads are one of those things like pointers or closures. You bang your head against them for a year or two, then one day your brain's resistance to the concept just breaks, and in its new broken state they make perfect sense." What language would be needed for a valid counter-example - one that guaranteed absence of divide-by-zero? No, just any sane language with a type system that does not pretend to give guarantees it cannot hold. No practical language I know of lulls you into thinking that there cannot be division by 0. Java however, does something like that. When you use some object of class C, and call a method m on it, then the compiler checks that C has m. Unfortunately, this provides no guarantee that this is still the case at runtime, because the JVM performs no structural checks on classes, only names are compared. In other words, when Java's type system derives that something has class C, and class C has method m, then this analysis is just good guess and hope. The actual situation at runtime does not need to bear any relation to it. (Where do you suggest we draw the line?) (Incidentally are you talking about Java 5, or Java 1.4?) Both. As soon as you do real open-world programming, where you load or receive stuff at runtime that is not known statically (e.g. via RMI etc), all bets are off regarding meaningfulness of static types, in all versions of Java. Of course, in Java 5 it got worse: you can now even break the type system in a closed program without using any dynamic features. Unfortunately, this provides no guarantee that this is still the case at runtime, because the JVM performs no structural checks on classes, only names are compared. You mean the JVM checks that each actual parameter has a class that is assignable to a class of the corresponding formal parameter (which of course involves not only names but also classloaders), right? Yes, I probably should have mentioned class loaders. Excuse me for being pedantic or bringing JLS into discussion, but I just wanted to demonstrate how an absence of a formal model makes it very difficult to discuss even the most fundamental parts of the PL (such as invocation). The paper claims that static typing is the enemy of change. My opinion is that it is not. In fact, the type system is irrelevant to change-ability of a system. Oh, on the contrary, it is relevant--and helpful. When I change a function signature in a statically typed language, the compiler finds the callers for me. That's a huge benefit. And the knee-jerk response would be - we only need to find the callers because we need to fix-up source-code constraints, which aren't present in a dynamically typed language. ... if, e.g. the function's arity has changed, or a parameter has changed from being a number to being a string or symbol and your language doesn't do conversions automatically. Surely you aren't actually suggesting that all dynamic languages need to "just work" is the name of the function to call. I'm suggesting that one of the reasons we are stuck on this merry-go-round is - we exaggerate the benefits of doing things one way, and ignore the extent to which the same task can be accomplished by other means. Sometimes I wonder if this dispute continues simply because no-one has demonstrated an interesting cost-benefit difference. ...I absolutely agree. As I've written elsewhere, however, even being the free-market nuthatch that I am, I can't help but wonder if the market doesn't pursue tools like O'Caml because they don't know that they're possible, let alone that they exist. Certainly my experience in my current C++ job suggests a severe lack of familarity with the alternatives. But again, this isn't a forum in which we tend to talk about what the market decides, although there have been more postings that I need to follow up on regarding issues in software economics. I don't really want it to become that, otherwise I'd be reading the C++ User's Journal and/or Java Developer. I think several of us are making a good faith effort to talk through what our best understanding of the pluses and minuses of a variety of computer science and software engineering tools are while avoiding the bandwagon effects that tend to distort these valuation processes in other contexts. With that said, I remain curious as to your answer to my question. Smalltalk has its refactoring browser. Lisp development environments are famous for their ability to find definitions (meta-point) and call sites. Why bother if it isn't necessary? I actually think you just made a better case for static typing than dynamic typing! Why bother if it isn't necessary? As you surely know, Smalltalk and Lisp provide tools for browsing code, and being able to browse code effectively helps with many different tasks (not just this one). And of course the point of the refactoring browser is to automate (which is why it's caught on in the Java world). (I'm struggling to make this question fit with "making a good faith effort to talk through what our best understanding...") Isaac Gouy: (I'm struggling to make this question fit with "making a good faith effort to talk through what our best understanding...") I have exactly the same reaction to your entire "Assuming that it's necessary..." post. Here's the quote; please let me know if I've missed relevant context, etc. etc. etc. Emphasis is mine: Isaac: We only need to find the callers because we need to fix-up source-code constraints, which aren't present in a dynamically typed language. You still haven't answered how it is that dynamically-typed languages are magically immune to the need to change call-sites. That's because they aren't; arity changes and/or argument-type changes affect dynamic languages just as surely as they do static languages. I was trying to give you the benefit of the doubt as to what you actually meant, but suggesting that the refactoring browsers don't exist, at least in part, to address the need to change call-sites in dynamic languages is disingenuous as best, and dishonest at worst. Refactoring browsers and the like show that (some) static analysis is possible in d.t languages (so s.t. isn't required for static analysis). They also show that such static analysis can be useful and help productivity (so d.t doesn't remove the need for static analysis) Obviously the real question is whether the static properties in each of these cases (type sysyems vs. refactoring browsers and ilk) are the same, what are the cost/benefits etc. There are reasons why having the language dictate the static guarantees is important (i.e., tools know less because the language guarantees less), but I am not sure how important this is important as regards refactoring browsers and similar tools. Ehud Lamm: Why do discussions on this topic always end up beocming so heated? Obviously, I can't speak for Isaac, but I've noticed that my ire tends to get raised when specific questions come up and are either side-stepped or responded to with inaccuracies that a single Google search, nevermind any direct experience with the technologies in question, easily overcomes. In other words, there comes a point at which it becomes very difficult to maintain my belief that my interlocutor (and I really do mean generally; I'm not pointing a finger at Isaac here) is indeed being intellectually honest. And to me, that's what this is all about. As I wrote a short while ago, if all I were interested in were the socioeconomic factors in tool selection, I'd be reading the C++ Users' Journal and/or Java Developer, both of which are fine publications for their respective markets. I don't know what else to say. I've written repeatedly that there's a lot of stuff worth discussing around reflection and introspection, and I just tried, in my last post, to suggest that maybe a major source of difficulty is that there aren't enough counterexamples in statically-typed languages to overcome the myth that interactive development is the sole province of the dynamic language. So it seems to me that there's plenty of constructive ground to cover once we dispell some persistent myths, which seem to revolve around relative productivity and expressiveness. Having said that, nonsense like the "Static Typing When Possible, Dynamic Typing When Necessary" paper, at least as it stands, and "We only need to find the callers because we need to fix-up source-code constraints, which aren't present in a dynamically typed language" aren't going to get a let's-make-nice response from me. They're not matters of differing opinion; they're wrong, and the people who write them are in need of further education, that's all. On Edit: OK, I just re-read the thread from the top, and I see way too many instances of what seem like good interactions ending up at leaves, and more heat than light ending up in neverending nodes, no doubt prompting Ehud's question, with me as the most voluminous contributor. I think that's a clear sign that I need to take a break for a while. I'll see you all later, and thanks for your patience. missed relevant context "And the knee-jerk response would be -" Your "question": Surely you aren't actually suggesting that all dynamic languages need to "just work" is the name of the function to call. Sorry, no question mark, seemed like a rhetorical question to me. No, I'm not suggesting anything so blatantly stupid. suggesting that the refactoring browsers don't exist, at least in part, to address the need to change call-sites in dynamic languages is disingenuous as best, and dishonest at worst I said nothing of the kind! The refactoring browser exists to automate all kinds of source code changes (including call-site changes). My feeling is that you have chosen to interpret whatever ambiguity exists in a statement as the worse kind of mendacious spin, and then attack the writer for something they didn't affirmatively claim. But when Eclipse refactoring goes awry (or when merging changes with CVS), static type checking helps a lot. Does it help to say that the only difference between dynamic and static is partial evaluation. In other words we decide that certain variables such as configuration information will not change and “compile it in†instead of re-evaluating those variables every time we run the code. The real problem is deciding what we can “compile in†and what to leave open. If things are changing or may need to change it can be tough to push the compile button. However if we really understand a system it should be possible to express all the possibilities in a dynamic language an write in the one we want to use. I don't think that partial evaluation fully encapsulates the transition from dynamic to static. Performance is only part of the issue with static type safety; part of it is just knowing that certain things won't go wrong- ever. With dynamic typing you are "safe" at some level, but there are no guarantees that (in those same ways) the application won't fail. Obviously statically typed programs can still be incorrect, but there are fewer ways in which they can be incorrect. This is the essence of what dynamic typing, by definition, cannot do: provide static guarantees. The value of this is debatable. Sometimes dynamic guarantees are enough. As long as a program is stopped from trashing my data, that's good enough for me. But sometimes we a) want performance and b) want a certain level of reliability. Both of these can be increased (but of course, not guaranteed) through static checking. Also compilation and quick turnaround times aren't enemies, as any lisper will attest to. By definition, it's what dynamically type checked languages don't try to do - static type checking. Everytime I see the this dynamically checked language versus statically checked language dichotomy, I have to remind myself that the statically checked language may also use dynamic type checks. That's true, unless it employs type erasure across the board. But at least some static typing aficionados, like myself, seriously question the value of this, not so much because we want things like unsafe covariance (something that, contrary to "Static Typing Where Possible, Dynamic Typing When Needed" I emphatically don't want), but because it's difficult to conceive of a solution to the question of reflection/introspection in a fully type-erased system. unless it employs Hence may also use. question the value of this this being "type erasure"? I want ... unsafe covariance Section 2.5 seemed to translate as given a choice between - unsafe covariance, contagious parametric types, variance parameters with wildcards - we choose unsafe covariance. fully type-erased system Is C# fully type-erased? I may have misunderstood you not to be referring to type erasure in your "may also use," in which case I apologize. Isaac: this being "type erasure"? Yes, that's what I meant; thanks for clarifying! Isaac: Section 2.5 seemed to translate as given a choice between - unsafe covariance, contagious parametric types, variance parameters with wildcards - we choose unsafe covariance. I guess I'm not satisfied that those choices are: Isaac: Is C# fully type-erased? I don't know; I'm not a C# programmer. However, Java obviously isn't, so I doubt that C# is. Puzzling Through Erasure I especially like the last comment: "Migration isn't a real issue. Java Generics are horribly broken, you idiot." Clearly written by someone who's not had any Java jobs in a company of more than about fifteen people... Show this one to all the people who don't think that adding or changing a type system in an existing language is hard to do. Not to be picky, I note that I never mentioned language. I'm not under the illusion that static & dynamic typing are mutually exclusive. I was just saying that there is something that dynamic typing can't do that static typing can. I never mentioned language Sorry if I gave the impression you had - I was just taking the opportunity express something that I think causes much confusion for folk who don't read LtU :-)
http://lambda-the-ultimate.org/node/852
CC-MAIN-2019-09
refinedweb
8,777
59.33
Inversion of (Coupling) Control in Java Inversion of (Coupling) Control in Java Learn more about the inversion of control and dependency injections in Java. Join the DZone community and get the full member experience.Join For Free Java-based (JDBC) data connectivity to SaaS, NoSQL, and Big Data. Download Now. What is the inversion of control? And what is dependency injection? These types of questions are often met with code examples, vague explanations, and what has been identified on StackOverflow as 'low-quality answers.' We use inversion of control and dependency injection and often push it as the correct way to build applications. Yet, we can not clearly articulate why! The reason is we have not clearly identified what control is. Once we understand what we are inverting, the concept of inversion of control versus dependency injection is not actually the question to be asked. It actually becomes the following: Inversion of Control = Dependency (state) Injection + Thread Injection + Continuation (function) Injection To explain this, well, let's do some code. And yes, the apparent problem of using code to explain inversion of control is repeating, but bear with me, the answer has always been right before your eyes. One clear use of inversion of control/ dependency injection is the repository pattern to avoid passing around a connection. Instead of the following: public class NoDependencyInjectionRepository implements Repository<Entity> { public void save(Entity entity, Connection connection) throws SQLException { // Use connection to save entity to database } } Dependency injection allows the repository to be re-implemented as: public class DependencyInjectionRepository implements Repository<Entity> { @Inject Connection connection; public void save(Entity entity) throws SQLException { // Use injected connection to save entity to database } } Now, do you see the problem we just solved? If you are thinking "I can now change the connection to say REST calls," and this is all flexible to change, well, you would be close. To see if the problem has been resolved, do not look at the implementation. Instead, look at the interface. The client calling code has gone from: repository.save(entity, connection); to the following: repository.save(entity); We have removed the coupling of the client code to provide a connection on calling the method. By removing the coupling, we can substitute a different implementation of the repository (again, boring old news, but bear with me): public class WebServiceRepository implements Repository<Entity> { @Inject WebClient client; public void save(Entity entity) { // Use injected web client to save entity } } With the client able to continue to call the method just the same: repository.save(entity); The client is unaware that the repository is now calling a microservice to save the entity rather than talking directly to a database. (Actually, the client is aware but we will come to that shortly.) So, taking this to an abstract level regarding the method: R method(P1 p1, P2 p2) throws E1, E2 // with dependency injection becomes @Inject P1 p1; @Inject P2 p2; R method() throws E1, E2 The coupling of the client to provide arguments to the method is removed by dependency injection. Now, do you see the four other problems of coupling? At this point, I warn you that you will never look at the code the same again once I show you the coupling problems. This is the point in the Matrix where I ask you if you want to take the red or blue pill. There is no going back once I show you how far down the rabbit hole this problem really is — refactoring is actually not necessary and there are issues in the fundamentals of modeling logic and computer science (ok, big statement but read on — I can't put it any other way). So, you chose the red pill. Let's prepare you. To identify the four extra coupling problems, let's look at the abstract method again: @Inject P1 p1; @Inject P2 p2; R method() throws E1, E2 // and invoking it try { R result = object.method(); } catch (E1 | E2 ex) { // handle exception } What is coupled by the client code? The return type The method name The handling of exceptions The thread provided to the method Dependency injection allowed me to change the objects required by the method without changing the client code calling the method. However, if I want to change my implementing method by: Changing its return type Changing its name Throwing a new exception (in the above case of swapping to a micro-service repository, throwing an HTTP exception rather than a SQL exception) Using a different thread (pool) to execute the method than the thread provided by the client call This involves "refactoring" all client code for my method. Why should the caller dictate the coupling when the implementation has the hard job of actually doing the functionality? We should actually invert the coupling so that the implementation can dictate the method signature (not the caller). This is likely the point you look at me like Neo does in the Matrix going "huh"? Let implementations define their method signatures? But isn't the whole OO principle about overriding and implementing abstract method signature definitions? And that's just chaos because how do I call the method if it's return type, name, exceptions, arguments keep changing as the implementation evolves? Easy. You already know the patterns. You just have not seen them used together where their sum becomes a lot more powerful than their parts. So, let's walk through the five coupling points (return type, method name, arguments, exceptions, invoking thread) of the method and decouple them. We have already seen dependency injection remove the argument coupling by the client, so one down. Next, let's tackle the method name. Method Name Decoupling Many languages, including Java lambdas, allow or have functions as first class citizens of the language. By creating a function reference to a method, we no longer need to know the method name to invoke the method: Runnable f1 = () -> object.method(); // Client call now decoupled from method name f1.run() We can even now pass different implementations of the method around dependency injection: @Inject Runnable f1; void clientCode() { f1.run(); // to invoke the injected method } OK, this was a bit of extra code with not much additional value. But again, bear with me. We have decoupled the method's name from the caller. Next, let's tackle the exceptions from the method. Method Exceptions Decoupling By using the above technique of injecting functions, we inject functions to handle exceptions: Runnable f1 = () -> { @Inject Consumer<E1> h1; @Inject Consumer<E2> h2; try { object.method(); } catch (E1 e1) { h1.accept(e1); } catch (E2 e2) { h2.accept(e2); } } // Note: above is abstract pseudo code to identify the concept (and we will get to compiling code shortly) Now, exceptions are no longer the client caller's problem. Injected methods now handle the exceptions decoupling the caller from having to handle exceptions. Next, let's tackle the invoking thread. Method's Invoking Thread Decoupling By using an asynchronous function signature and injecting an Executor, we can decouple the thread invoking the implenting method from that provided by the caller: Runnable f1 = () -> { @Inject Executor executor; executor.execute(() -> { object.method(); }); } By injecting the appropriate Executor, we can have the implementing method invoked by any thread pool we require. To re-use the client's invoking thread, we just use a synchronous Exectutor: Executor synchronous = (runnable) -> runnable.run(); So now, we can decouple a thread to execute the implementing method from the calling code's thread. But with no return value, how do we pass state (objects) between methods? Let's combine it all together with dependency injection. Inversion of Control (Coupling) Let's combine the above patterns together with dependency injection to get the ManagedFunction: public interface ManagedFunction { void run(); } public class ManagedFunctionImpl implements ManagedFunction { @Inject P1 p1; @Inject P2 p2; @Inject ManagedFunction f1; // other method implementations to invoke @Inject ManagedFunction f2; @Inject Consumer<E1> h1; @Inject Consumer<E2> h2; @Inject Executor executor; @Override public void run() { executor.execute(() -> { try { implementation(p1, p2, f1, f2); } catch (E1 e1) { h1.accept(e1); } catch (E2 e2) { h2.accept(e2); }); } private void implementation( P1 p1, P2 p2, ManagedFunction f1, ManagedFunction f2 ) throws E1, E2 { // use dependency inject objects p1, p2 // invoke other methods via f1, f2 // allow throwing exceptions E1, E2 } } OK, there's a lot going on here but it's just the patterns above combined together. The client code is now completely decoupled from the method implementation, as it just runs: @Inject ManagedFunction function; public void clientCode() { function.run(); } The implementing method is now free to change without impacting the client calling code: - There is no return type from methods (slight restriction always being void, however necessary for asynchronous code) The implementing method name may change, as it is wrapped by the ManagedFunction.run() Parameters are no longer required by the ManagedFunction. These are dependency-injected, allowing the implementing method to select which parameters (objects) it requires Exceptions are handled by injected Consumers. The implementing method may now dictate what exceptions it throws, requiring only different Consumersinjected. The client calling code is unaware that the implementing method may now be throwing an HTTPExceptioninstead of an SQLException. Furthermore, Consumerscan actually be implemented by ManagedFunctionsinjecting the exception. The injection of the Executorallows the implementing method to dictate its thread of execution by specifying the Executorto inject. This could result in re-using the client's calling thread or have the implementation run by a separate thread or thread pool All five coupling points of the method by its caller are now decoupled. We have actually "Inverted Control of the Coupling." In other words, the client caller no longer dictates what the implementing method can be named, use as parameters, throw as exceptions, which thread to use, etc. Control of coupling is inverted so that the implementing method can dictate what it couples to by specifying it's a required injection. Furthermore, as there is no coupling by the caller, there is no need to refactor code. The implementation changes and then configures in it's coupling (injection) to the rest of the system. Client calling code no longer needs to be refactored. So, in effect, dependency injection only solved 1/5 of the method coupling problem. For something that is so successful for only solving 20 percent of the problem, it does show how much of a problem coupling of the method really is. Implementing the above patterns would create more code than it's worth in your systems. That's why open-source OfficeFloor is the "true" inversion of control framework and has been put together to lessen the burden of this code. This has been an experiment in the above concepts to see if real systems are easier to build and maintain with "true" inversion of control. Summary So, the next time you reach for the Refactor Button/Command, realize that this is brought on by the coupling of the method that has been staring us in the face everytime we write code. And really, why do we have the method signature? It is because of the thread stack. We need to load memory onto a thread stack, and the method signature follows the behavior of the computer. However, in the real world, the modeling of behavior between objects offers no thread stack. Objects are loosely coupled with very small touch points — not the five coupling aspects imposed by the method. Furthermore, in computing, we strive towards low coupling and high cohesion. One might possibly put forward a case that,in comparison to ManagedFunctions, methods are: High coupling: methods have five aspects of coupling to the client calling code Low cohesion: as the handling of exceptions and return types from methods starts blurring the responsibility of the methods over time, continuous change and shortcuts can quickly degrade the cohesiveness of the implementation of the method to start handling logic beyond its responsibility Since we strive for low coupling and high cohesion, our most fundamental building block (the method and the function) may actually go against our most core programming principles. Connect any Java based application to your SaaS data. Over 100+ Java-based data source connectors. Published at DZone with permission of Daniel Sagenschneider . See the original article here. Opinions expressed by DZone contributors are their own. {{ parent.title || parent.header.title}} {{ parent.tldr }} {{ parent.linkDescription }}{{ parent.urlSource.name }}
https://dzone.com/articles/inversion-of-coupling-control
CC-MAIN-2019-13
refinedweb
2,059
51.78
RE:DOM is a library for manipulating the DOM, and Svelte is a framework with routing and transitions. In this post, we’ll review their differences and establish which would be a better choice for different kinds of applications. Creating components with RE:DOM and Svelte RE:DOM and Svelte both let us create components to render content. Svelte In Svelte, we create components in individual files. For example, we can write: //App.svelte <script> import Button from "./Button.svelte"; </script> <style> main { font-family: sans-serif; text-align: center; } </style> <main> <h1>Hello</h1> <Button /> </main> //Button.svelte <script> let count = 0; function handleClick() { count += 1; } </script> <style> button { background: #ff3e00; color: white; border: none; padding: 8px 12px; border-radius: 2px; } </style> <button on:click={handleClick}> Clicked {count} {count === 1 ? 'time' : 'times'} </button> We created the Button component in Button.svelte, which we include in the App.svelte component file. The script tag has the logic, and style has the styles for each component. The remainder of the file has the HTML content we want to render. We embed JavaScript expressions in braces, and it has its own syntax for attaching event handlers. The on:click attribute lets us attach a click handler. Functions that are in the script tag can be referenced in the HTML template, as we did with the handleClick function. Any variables declared in the script tag can referenced and rendered in the template, as we have in the button element. Data binding is done automatically, so no need to do that ourselves. RE:DOM With RE:DOM, we install the redom package by running: npm i redom Then we can create a simple component by writing: //index.js import { el, mount } from "redom"; const hello = el("h1", "Hello world"); mount(document.body, hello); This assumes we’ll use a module bundler like Parcel to create our project. We create our component with the el function and pass in the tag and the HTML we want to show. Then, we call mount to mount the hello component to the body. We can create a text component with the text function: import { text, mount } from "redom"; const hello = text("hello"); mount(document.body, hello); hello.textContent = "hi!"; We pass in the initial textContent into the text function, and when we reassign its value, it’ll automatically be updated. If we want to add child elements, we write: import { el, setChildren } from "redom"; const a = el("h1", "foo"); const b = el("h2", "bar"); const c = el("h3", "baz"); setChildren(document.body, [a, b, c]); Then we add the elements in the same order as in the array. We can also create RE:DOM components with classes. This lets us set lifecycle methods to run code in various stages of the component lifecycle. For example, we can write: import { el, mount } from "redom"; class Hello { constructor() { this.el = el("h1", "Hello world"); } onmount() { console.log("mounted Hello"); } onremount() { console.log("remounted Hello"); } onunmount() { console.log("unmounted Hello"); } } class App { constructor() { this.el = el("app", (this.hello = new Hello())); } onmount() { console.log("mounted App"); } onremount() { console.log("remounted App"); } onunmount() { console.log("unmounted App"); } } const app = new App(); mount(document.body, app); Above, we have a Hello component that’s nested inside the App component. To do the nesting, we create a new instance of it and pass it as the second argument into el. In general, Svelte has many more options for creating components since it’s meant to be an app development framework. RE:DOM is much more limited since it should be used as a DOM manipulation library. Updating components Svelte In Svelte, we can update components in various ways. We update the variables in the script tag, and the new value will automatically be rendered. For example: //Button.svelte <script> let count = 0; function handleClick() { count += 1; } </script> <style> button { background: #ff3e00; color: white; border: none; padding: 8px 12px; border-radius: 2px; } </style> <button on:click={handleClick}> Clicked {count} {count === 1 ? 'time' : 'times'} </button> If we click the button, then the handleClick function is run, which increases count by one. count‘s latest value will then be rendered in the template. We just display it, and we also use it to render something else, as we can see from the expression. We can also add style bindings with Svelte. For example, we can write: <script> let size = 42; let{text}</span> </div> We have a range slider, which binds to the size variable. So, when we change the slider value, the size value will change with it. And in the span element, we use the size value to change the font-size style. Therefore, the slider will change the size of the edit me text. It also comes with a special syntax for setting classes. For example, we can write: <script> let active = true; </script> <style> .active { background-color: red; } </style> <div> <div class="{active ? 'active' : ''}" on: toggle </div> </div> We toggle the active class on and off when we click the button by toggling the active variable between true and false. We can also write something like this to do the same thing: <script> let active = true; </script> <style> .active { background-color: red; } </style> <div> <div class:active='{active}' on: toggle </div> </div> We have an expression that determines whether the active class is applied with the class:active attribute. RE:DOM With RE:DOM, updating components is more limited. We can set attributes of an element or set the style. For example, we can write something like this to create an h1 element and set its color to red: import { el, setAttr, mount } from "redom"; const hello = el("h1", "Hello world!"); setAttr(hello, { style: { color: "red" }, className: "hello" }); mount(document.body, hello); The setAttr function takes two arguments: the first is the element we created, and the second is an object, with the keys being the attribute names and the values being the attribute values. RE:DOM also comes with a setStyle method to let us set the styles of an element. For instance, we can use it by writing: import { el, setStyle, mount } from "redom"; const hello = el("h1", "Hello world!"); setStyle(hello, { color: "green" }); mount(document.body, hello); This sets the h1 element to green. These are the main ways to update components. Developer experience Svelte is a full app development framework, while RE:DOM is a library for DOM manipulation. They both make manipulating the DOM easy. Svelte lets us write code expressively and eliminate boilerplate. To quickly create a Svelte project, we have to clone the Svelte template repo, which is not terribly convenient. On the other hand, with RE:DOM, we just install the redom package with npm i redom. We can slso use the script from to add it to our app. This means we don’t need build tools to add RE:DOM to our app project. Both tools support the latest JavaScript syntax. Since RE:DOM is a library, it doesn’t have a CLI program to let us create apps. On the other hand, there’s no CLI program to create a Svelte project from scratch and build it, which isn’t very convenient. Performance According to many tests, RE:DOM is faster than Svelte. From AJ Meyghani’s benchmarks, we can see that Svelte is slower than RE:DOM in many respects. This plays out similarly in more recent benchmarks as well. However, the differences amount to only a few milliseconds, which may not be very noticeable in most cases. It’s worth reiterating that RE:DOM is a lightweight library, while Svelte is a full app development framework, so this makes sense. Routing RE:DOM comes with a router for mapping URLs to components to render, while Svelte doesn’t come with its own router. Svelte To add routing to our Svelte app, we need to install the svelte-routing package by running: npm i svelte-routing Then, we write: //routes/About.svelte <p>about</p> //routes/Blog.svelte <p>blog</p> //routes/BlogPost.svelte <script> export let id; </script> <p>blog post {id}</p> //routes/Home.svelte <p>home</p> //App.svelte <script> import { Router, Link, Route } from "svelte-routing"; import Home from "./routes/Home.svelte"; import About from "./routes/About.svelte"; import Blog from "./routes/Blog.svelte"; import BlogPost from "./routes/BlogPost.svelte"; export let <nav> <Link to="/">Home</Link> <Link to="about">About</Link> <Link to="blog">Blog</Link> <Link to="blog/1">Blog Post</Link> </nav> <div> <Route path="blog/:id" let:params> <BlogPost id="{params.id}" /> </Route> <Route path="blog" component="{Blog}" /> <Route path="about" component="{About}" /> <Route path="/"><Home /></Route> </div> </Router> We add the Router component to add the router, and Route adds the routes. We pass in URL parameters with the let:params attribute and the id prop to accept the id URL parameter. :id is the URL parameter placeholder. If there are any parameters, we can get them as props, as we did in BlogPost.svelte. If we have the export keyword in front of the variable declaration, then it’s a prop. RE:DOM To use RE:DOM’s router, we can write: //index.js import { el, router, mount } from "redom"; class Home { constructor() { this.el = el("h1"); } update(data) { this.el.textContent = `Hello ${data}`; } } class About { constructor() { this.el = el("about"); } update(data) { this.el.textContent = `About ${data}`; } } class Contact { constructor() { this.el = el("contact"); } update(data) { this.el.textContent = `Contact ${data}`; } } const app = router(".app", { home: Home, about: About, contact: Contact }); mount(document.body, app); const data = "world"; app.update("home", data); app.update("about", data); app.update("contact", data); We create the routes by using the router function. The keys in the object are the URLs for the routes. app.update goes to the route we want. We pass data into the routes, which we get from the update method’s parameter. Generally speaking, RE:DOM’s router is definitely less flexible than Svelte’s. Conclusion RE:DOM is a lightweight DOM manipulation library. Even though we can create components with it, it’s not very expressive for the purpose of creating complex components. As such, we should stick with just manipulating the DOM with it. Svelte, on the other hand, is a full app framework as long as we add the svelte-routing package to it for routing..
https://blog.logrocket.com/redom-vs-svelte/
CC-MAIN-2021-04
refinedweb
1,730
67.35
Odoo Help This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers. How to write test thats expect error Hi, I'm create a module to try and learn OpenERP. I want a res.partner to have points and for each sale he does he needs to get an extra point. When you create a res.partner you can give him an initial points value, but it can't be negative. class res_partner(osv.Model): _inherit = 'res.partner' _columns = { 'points': fields.integer(string = 'Collected points'), } _defaults = { 'points': 0, } def _check_points(self, cr, uid, ids, context=None): obj = self.browse(cr, uid, ids[0], context=context) if obj.points < 0: return False return True _constraints = [ (_check_points, 'Points must be 0 or above', ['points']), ] How do I write my test? def test_negative_points(self): cr, uid = self.cr, self.uid loyalty_id = self.partner_model.create(cr, uid, dict( ..., points=-10, )) Because this always gives me!
https://www.odoo.com/forum/help-1/question/how-to-write-test-thats-expect-error-39126
CC-MAIN-2016-50
refinedweb
171
70.6
Using Go in the Browser via Web Assembly. Putting the Structure in Place Thinking about a simple web page to build, I settled on a simple form to do addition. It would have 3 boxes, with the third box updating to show the sum of the first two boxes. I started by creating a simple directory structure: $ mkdir -p public/js $ touch public/index.html $ tree . └── public ├── index.html └── js 2 directories, 1 file tree $ Then in the index.html, I created a simple page: <!doctype html> <html class="no-js" lang=""> <head> <meta charset="utf-8"> <meta http- <title>Golang Calculator</title> </head> <body> <h1>Golang Calculator</h1> <form id="calc"> <input type="text" id="first-number" size="2" /> + <input type="text" id="second-number" size="2" /> = <input type="text" id="result" size="2" readonly /> </form> </body> </html> This gave me a starting point: Even though it’s an experiment, I want it to look good, so now I’ll add in a little bit of CSS: @import url(""); body { margin: 0px; padding: 0px; font-family: Roboto,Helvetica,Arial; background: #fbfbfb; color: #999; text-align: center; padding-top: 40px; } input { border: 1px solid #999; border-radius: 4px; padding: 2px 4px; color: #999; } .info { color: blue; border-color: blue; background: lightskyblue; } .success { color: green; border-color: green; background: palegreen; } .warning { color: goldenrod; border-color: goldenrod; background: lemonchiffon; } .error { color: red; border-color: red; background: pink; } form#calc, form#calc > input { font-size: 20pt; } form#calc > input { text-align: center; } Which gives me this: Finally, I want to open the page in a loading state, so I’ll add in a DIV with my loading text in it: <!doctype html> <html class="no-js" lang=""> <head> <meta charset="utf-8"> <meta http- <title>Golang Calculator</title> <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> </head> <body> <h1>Golang Calculator</h1> <div id="loading">Loading ...</div> <form id="calc"> <input type="text" id="first-number" size="2" /> + <input type="text" id="second-number" size="2" /> = <input type="text" id="result" size="2" readonly /> </form> </body> </html> And I’ll add a statement to my CSS to hide the form initially: form#calc { display: none; } This gives me my initial page, with the form hidden: Setting up a Web Server So far, I’ve just opened this file locally. What I need is a server to provide this content. For the purposes of this exercise, I will just create one in Go. I’ll create a src folder, and then put this file into it: package main import ( "log" "net/http" ) func main() { log.Println("Server listening on port 3000") http.ListenAndServe(":3000", http.FileServer(http.Dir("public/"))) } Now I can just run this server: $ go run src/server.go 2019/08/14 10:30:40 Server listening on port 3000 And I can now access my web page from an http address: Building my Browser-Based Go Program Now I have everything in place, I can move on to look at writing the Go code which will provide me the interactivity I need. I will create a file main.go in my src directory for this. The important thing I need is some way to interact with my web page, or more accurately with the DOM for my web page. For this, I need to import the syscall/js module, which gives me a variable js I can interact with: package main import ( "syscall/js" ) Using this, I can get access to the environment’s global variables (equivalent to window in the browser, or global in Node). And from there, I can get the browser’s document object: func main() { document := js.Global().Get("document") You can see in this example that I have used a Get() function, which is the way syscall/js lets me retrieve values from objects. It also has a Call() function which I can use to invoke methods on objects from the DOM. The standard way to find an element from a web page in Javascript, is to use the getElementById() method on the document. So, in Javascript, I can find my The equivalent in Go, using syscall/js is: document.Call("getElementById", "loading") By combining Call() and Get(), I can build up an expression to hide the In Go, this becomes: document.Call("getElementById", "loading").Get("style").Call("setProperty", "display", "none") I can do something similar to display the form, so I end up with this code: package main import ( "syscall/js" ) func main() { document := js.Global().Get("document") document.Call("getElementById", "loading").Get("style").Call("setProperty", "display", "none") document.Call("getElementById", "calc").Get("style").Call("setProperty", "display", "block") } Now I need to build this code into a web assembly executable (a .wasm file). Standard compilation would look like this: go build -o public/js/main.wasm src/main.go However, this will just give me a standard executable. What I need to do is set two environmental variables, so that it generates a WASM file. The first variable I need to set is the GOOS variable, which lets Go know which operating system I am targetting. In this case, I am targetting javascript as my operating system, so I need to set GOOS=js. The second variable is the GOARCH variable, which sets the architecture. I need this to be web assembly, so I need to set GOARCH=wasm. So, my build step is: GOOS=js GOARCH=wasm go build -o public/js/main.wasm src/main.go I will also need a standard Javascript wasm execution architecture for Go. This is shipped with Go itself, so I can just copy that: cp /usr/local/go/misc/wasm/wasm_exec.js public/js/ Now I have this set of files: $ tree . ├── public │ ├── index.html │ ├── js │ │ ├── main.wasm │ │ └── wasm_exec.js │ └── style.css └── src ├── main.go └── server.go 3 directories, 6 files tree Finally, I need to include my web assembly file in my HTML. The first part of this is including the wasm_exec.js file. This is simply Javascript, so I can include as usual: <script src="js/wasm_exec.js"></script> Including the code I’ve written is slightly more complicated, because I need to use the WebAssembly module to load and run my web assembly code (we can’t just include web assembly yet). The first step is to create an instance of the Go class, which is provided by wasm_exec.js: const go = new Go(); Now I need to do three things to run my web assembly: - Get my .wasmfile from the web server - Create a runnable instance of that file - Run that instance To get my .wasm file, I can use the standard fetch() call: fetch("js/main.wasm") I can then use WebAssembly’s instantiateStreaming() function to convert this to a runnable instance. This takes two arguments — wasm code, and a context to instantiate against. I already have the wasm code from fetch() (fortunately instantiateStreaming() accepts the promise that fetch() returns). I can get the context from my go object, where it is stored under importObject. This means my code looks like this: WebAssembly.instantiateStreaming(fetch("js/main.wasm"), go.importObject) This returns a promise, which resolves to two parts — module and instance. The module contains the compiled code, and I can use that if I need to instantiate again. The instance is what I am interested in here, since it contains the instance I need to run. I run this returned instance using the run() method from my go object: WebAssembly.instantiateStreaming(fetch("js/main.wasm"), go.importObject) .then(result => { go.run(result.instance); }); Adding all the above into my HTML file, I have this: <!doctype html> <html class="no-js" lang=""> <head> <meta charset="utf-8"> <meta http- <title>Golang Calculator</title> <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> <script src="js/wasm_exec.js"></script> <script> go = new Go(); WebAssembly.instantiateStreaming(fetch("js/main.wasm"), go.importObject) .then(result => { go.run(result.instance); }); </script> </head> <body> <h1>Golang Calculator</h1> <div id="loading">Loading ...</div> <form id="calc"> <input type="text" id="first-number" size="2" /> + <input type="text" id="second-number" size="2" /> = <input type="text" id="result" size="2" readonly /> </form> </body> </html> If I start my server and reload the page, I now get this: I know this looks the same as what I had earlier, but if you actually try this out, you’ll see the page open with the loading message which then disappears and is replaced by the form. So, I have functional code, but it’s not very readable. I’ll move the lower level DOM manipulation to its own package, then my main.go can deal in easier to understand high level concepts. To begin with, I’ll create a packages directory in my project, and create a dom folder in there to take my package: $ tree . ├── main ├── packages │ └── src │ └── dom │ └── dom.go ├── public │ ├── index.html │ ├── js │ │ ├── main.wasm │ │ └── wasm_exec.js │ └── style.css └── src ├── main.go └── server.go 6 directories, 8 files tree I’ll start the package by importing syscall/js and then initialising the document variable so I can useit throughout the package: package dom import ( "syscall/js" ) var document js.Value func init() { document = js.Global().Get("document") } Now I can use that document variable to define a getElementById() function: func getElementById(elem string) js.Value { return document.Call("getElementById", elem) } Building on that, I can now create a getElementValue() function, using getElementById(): func getElementValue(elem string, value string) js.Value { return getElementById(elem).Get(value) } Finally, I can define a Hide() and a Show() function built on top of that: func Hide(elem string) { getElementValue(elem, "style").Call("setProperty", "display", "none") } func Show(elem string) { getElementValue(elem, "style").Call("setProperty", "display", "block") } This allows me to write a much more easy to understand main.go: package main import ( "dom" ) func main() { dom.Hide("loading") dom.Show("calc") } To build this, I now need to add my packages directory into my GOPATH in my build command: GOOS=js GOARCH=wasm GOPATH=$PWD/packages go build src/main.go If I run my webserver again and load this new version, it works exactly as it did before — it’s just more understandable. Performing the calculation The way I want the web page to work, is that changing the number in either of the first two input fields automatically updates the third input field with the result. If something non-numeric is entered into either field, I want the ERR to be displayed in the result field, and I want that field to change colour to indicate an error (by assigning my .error CSS class to it). Correcting the error should clear the styling and display the correct sum result. So, I am going to create a performCalculation() function to actually do the addition, and I am going to then attach that via an event listener to the input fields, so it gets triggered every time an input value changes. Before I can do that, I need to add some more functionality to my dom package. I want to be able to get and set a value from a DOM element, so let’s add those in: func GetString(elem string, value string) string { return getElementValue(elem, value).String() } func SetValue(elem string, key string, value string) { getElementById(elem).Set(key, value) } And then I want to be able to add and remove CSS classes: func AddClass(elem string, class string) { getElementValue(elem, "classList").Call("add", class) } func RemoveClass(elem string, class string) { classList := getElementValue(elem, "classList") if (classList.Call("contains", class).Bool()) { classList.Call("remove", class) } } Going back to my main.go program, I can now write a performCalculation() function: func performCalculation() {") } } What this function does is get the values from the first two fields, and attempt to convert them to integer values (using strconv.Atoi()). As long as there are no errors, it adds together the two values, converts that to a string and puts it into the result field. If it does encounter a conversion error, it sets the result value to ERR and also adds the .error class to the result field. To check that everything is working as intended, I’ll set some values in the first two field in my main() function, then call performCalculation(): func main() { dom.Hide("loading") dom.Show("calc") dom.SetValue("first-number", "value", "7") dom.SetValue("second-number", "value", "5") dom.SetValue("result", "value", "0") performCalculation() } If I build and run this, I should now see the correct result in the browser: I can also change one of the values to not be valid (for example X), to test my error display: The final part is to add performCalculation() as an event listener, so I’ll add this capability to my dom package. This gets a bit fiddly, so strap in while I go through this. My function is simple — it takes no parameters and returns no result. So it has the signature: func() The function I need to call in syscall/js (which is called js.FuncOf()) needs a function with this signature: func(js.Value, []js.Value) interface {} So, I need to write a function to perform this conversion. It needs to accept a function of the first signature, and return one with the second. I’ll call this wrapGoFunction() and the declaration looks like this: func wrapGoFunction(fn func()) func(js.Value, []js.Value) interface {} { The actual body is quite straightforward, it just returns a function with the new signature, and in the body of that function it just calls our original function. It also needs to return a value, so it meets the required signature: func wrapGoFunction(fn func()) func(js.Value, []js.Value) interface {} { return func(_ js.Value, _ []js.Value) interface {} { fn() return nil } } I still need to wrap the result of that in a call to js.FuncOf(), so the full AddEventListener() function in my dom package looks like this: func AddEventListener(elem string, event string, fn func()) { getElementById(elem).Call("addEventListener", event, js.FuncOf(wrapGoFunction(fn))) } Now I can make use of this in main.go:) } This all looks good, but when I try it in the browser it doesn’t seem to work. Opening the console shows me the following error: Okay, looks like my program executes and exits, so when I try to invoke my event handler, there’s no process to do that. So, I need some way to keep the program running. I’ll do this by creating a channel, waiting for an event on it, but never sending one:) ch := make(chan struct{}) <-ch } Building this and running it in the browser, it now all works as expected: Reducing the Size of the WASM File Although this worked as I wanted, every now and again it would just not run when I reloaded the page. I could fix that by visiting another page and coming back, but it was a poor user experience. Opening up the console, I found this message about running out of memory: Digging around a bit more, I found that my .wasm file was 1.4M: I don’t know if these two facts are related, but one obvious area to look at is how to reduce the size of the .wasm file. Compression was my first port of call — that might help with transfer but I couldn’t see it helping with the memory issue. So I started looking for alternative ways to build Go into a smaller artefact. I found tinygo, which was developed for smaller devices (e.g. IoT) but also can produce Web Assembly output. So I tried that, but got an error: $ GOPATH=./packages tinygo build -o public/js/main.wasm -no-debug src/main.go error: async function dom.wrapGoFunction$1 used as function pointer After doing some reading, it looks like tinygo doesn’t support function pointers. So I need to take out my function which maps to the syscall/js event listener function signature. Within my dom package, this is quite simple — I just need to change the signature of the function I pass in: func AddEventListener(elem string, event string, fn func(js.Value, []js.Value) interface{}) { getElementById(elem).Call("addEventListener", event, js.FuncOf(fn)) } For main.go it is slightly more complicated. Because the js.Value type has now leaked into my event listener, I need to import syscall/js into main.go: import ( "dom" "strconv" "syscall/js" ) Now I need to update performCalculation() to match the function signature. Since I don’t need to do anything with the parameters, I can just use underscores instead of parameter names: func performCalculation(_ js.Value, _ []js.Value) interface{} {") } return nil } Note that I also needed to return a value, so I used nil since I am not doing anything with the result. Now when I try to build, it does so successfully and gives me a much smaller output file — down from 1.4M to 27K: $ ls -lh public/js/main.wasm -rw-r----- 1 ian ian 27.1K Aug 17 21:27 public/js/main.wasm Note that each Go implementation has its own wasm_exec.js, I can’t just keep using the one I had earlier. So I need to also copy the tinygo-specific version: cp /usr/local/tinygo/targets/wasm_exec.js public/js/wasm_exec.js Now if I start up my web server and go to my web page, I get the same display and functionality as before, except with a much smaller filesize: Conclusions In conclusion, this seems a promising way to build web frontends, but I’m not 100% convinced that I’d want to drop it into a large enterprise project right now. This is for a variety of reasons: File Size The file size is an obvious area of concern — either the standard Go compiler needs to produce smaller WASM files, or an alternative compiler needs to work with standard Go capabilities. Clearly this can be worked around as I did here, but for me this would be a fairly big limitation, since I tend to use function pointers and closures. Perhaps this is less of a constraint for other people (and perhaps my Go is not so idiomatic). Web Assembly as a Second Class Citizen Not a big deal, but it seems to me that Web Assembly would be more easily used if it could be added directly via SCRIPT tags, rather than needing a bit of Javascript to glue it into place. This is not specifically a Go issue, but more of a Web Assembly issue. Availability of Go Developers This may be a plus or a minus point. Generally, it is easier for me to find Javascript developers than Go developers. If I needed to staff a frontend team, then choosing Go as my language would add another hurdle for me. Where I can see this being a positive point, would be if the backend is already being developed in Go. Then I would already have a pool of developers to draw from, and I might also gain synergies by being able to use modules developed for the backend in the browser. I’ve put the code from this article into a repo at ianfinch/golang-wasm-calc
https://ian-says.com/articles/golang-in-the-browser-with-web-assembly/
CC-MAIN-2019-47
refinedweb
3,223
63.19
Encapsulation of a User Defined Function for performing stemming of individual words. More... #include <MarkLogic.h> Encapsulation of a User Defined Function for performing stemming of individual words. You must implement a subclass of this class. When you install a subclass of StemmerUDF as a native plugin, MarkLogic servers can apply your algorithm to perform stemming of individual words. To activate your stemming algorithm for a particular language, you will need to apply the appropriate language customization configuration. Your stemming algorithm will be applied automatically when content in the configured language is loaded into the database or searched. You can also see the effect of your algorithm from XQuery ( cts:stem) or JavaScript ( cts.stem). To use your algorithm to stem words in a particular language: markLogicPlugin. A stemmer should provide the preferred stem, if any, as the first item in the result sequence. This is the stem that basic stemming will use. If no stems are returned in the result array, an attempt will be made to ask the base stemmer, unless the delegate method returns false. Without delegation, the input word is assumed to stem to itself. Since the stemming and tokenization used for content must match that for query strings, it is advisable for stemmers to produce alternate stems for a given string rather than relying on the part of speech to be accurate as this is unlikely to be the case for short query strings. It is better to use the part of speech for ordering of preferred strings rather than for outright pruning, as it allows advanced stemming to provide matches even when part of speech information in query strings is wrong. Alternatively, use UNSPECIFIED_POS in query strings as a signal to return all alternative stems for all possible parts of speech. To indicate a contraction, use the character '=' at the contraction point. Example: "don't" => "do=not" To indicate a compound, use the character '#' at the compound break point. Example: "Kinderplatz" => "Kind#Platz" Upstream processing will automatically index the separate parts appropriately for the stemmed-searches setting. A word must not produce both contraction and compound stems. Stemmer UDF" in the Application Developer's Guide. Release a StemmerUDF instance. MarkLogic server calls this method when this object is no longer needed. Initialize a stemmer. This method is called once after the stemmer is constructed. Return true if the StemmerUDF instance can no longer be reused. StemmerUDF objects will be kept in a pool and reused when idle. If a stemmer should not be reused, isStale should return true. Advance to the next stem. Return true if the is another stem to fetch. Get stems for the input word. The input is a pointer to array of Unicode codepoints and its length. The result is a sequence of alternative stems, if any, with the preferred stem given first. If no stem is returned, the string is taken as its own stem. Start iteration of stems. Normal stemming operations may require the iteration to be performed more than once. Implementations should be prepared to do so. Return the current stem. If there is no current stem, a null pointer should be returned. The StemmerUDF is responsible for managing the deallocation of this pointer, if necessary.
http://docs.marklogic.com/cpp/udf/classmarklogic_1_1StemmerUDF.html
CC-MAIN-2018-09
refinedweb
539
57.67
Timeline. Oct 9, 2006: - 9:30 PM Ticket #784 (Hide ticket custom field in simpleticket view) closed by - fixed: Replying to coderanger: > It should work just fine. Just … - 9:07 PM ScrumBurndownPlugin edited by - (diff) - 9:05 PM ScrumBurndownPlugin edited by - (diff) - 9:02 PM Ticket #721 (Adding component after milestone started) closed by - duplicate: This is the same error that I fixed in defect #750 - 9:01 PM Ticket #750 (list indx out of range) closed by - fixed: (In [1366]) Fixed list index out of range error when a new component … - 9:01 PM Changeset [1366] by - scrumburndownplugin/burndown/burndown.py - scrumburndownplugin/deploy.bat - scrumburndownplugin/setup.py Fixed list index out of range error when a new component was added after a sprint was already started. - 8:21 PM Changeset [1365] by - timingandestimationplugin/trunk/setup.py - timingandestimationplugin/trunk/timingandestimationplugin/api.py - timingandestimationplugin/trunk/timingandestimationplugin/dbhelper.py - timingandestimationplugin/trunk/timingandestimationplugin/webui.py TimingAndEstimationPlugin: first attempt at postegres compatability (plugin version 0.1.7) - 8:10 PM Ticket #785 (Documentation is missing) closed by - worksforme: Its just a simple macro: […] - 7:59 PM WantedPagesMacro edited by - (diff) - 7:57 PM Changeset [1364] by - wantedpagesplugin/0.9/wanted_pages/wanted_pages.py merged [1362] into 0.9 release - 7:55 PM Changeset [1363] by - wantedpagesplugin/0.10 copying trunk for 0.10 stable branch - 7:54 PM Ticket #776 (!'d CamelCase words are picked up by macro) closed by - fixed: (In [1362]) fixed bug that added escaped CamelCase words to the list … - 7:54 PM Changeset [1362] by - wantedpagesplugin/trunk/wanted_pages/wanted_pages.py fixed bug that added escaped CamelCase words to the list of wanted pages, I think this was actually related to the newer versions of python. Closes #776 - 3:57 PM Ticket #779 (XsltMacro parameter passing with tracd) closed by - fixed: Fixed in [1360] (v 0.4). This was a problem with libxslt not liking … - 3:57 PM Changeset [1361] by - xsltmacro/0.9/xslt/Xslt.py Use encode('utf-8') to convert unicode to str. - 3:32 PM XsltMacro edited by - Adjusted instructions for version bump (diff) - 3:29 PM Changeset [1360] by - xsltmacro/0.9/setup.py - xsltmacro/0.9/xslt/Xslt.py Fixes for trac 0.10: - force xstylesheet params to 'str', as libxslt doesn't properly handle unicode strings. - formatting fixes in module comment Other fixes: - detect empty result doc and display as such. Bumped version to 0.4. - 3:07 PM Changeset [1359] by - Fixed a typo - 2:53 PM Changeset [1358] by Preparing for new release - 2:21 PM Ticket #785 (Documentation is missing) created by - There is no way to figure out how to use this plugin. - 2:19 PM Ticket #782 (does not work with trac 0.10) closed by - duplicate: Duplicate of #783 - 2:18 PM Ticket #782 (does not work with trac 0.10) reopened by - of course this is not fixed. it's duplicate - 2:18 PM Ticket #782 (does not work with trac 0.10) closed by - fixed: Duplicate of #783 - 2:16 PM Ticket #784 (Hide ticket custom field in simpleticket view) created by - When I create customized fields such as category, etc and choose to … - 2:15 PM Ticket #783 (does not work with trac 0.10) created by - After upgrading to 0.10, TicketBox does not work anymore: […] - 2:15 PM Ticket #782 (does not work with trac 0.10) created by - After upgrading to 0.10, TicketBox does not work anymore: […] - Added regex match functionallity + match_seperator - 10:17 AM Ticket #781 (Add filter dropdown empty and no tickets) created by - If I go to the custom query screen the dropdown "Add filter" is empty … Oct 8, 2006: - 11:52 PM Ticket #780 (Perform Doxygen-like name mangling) created by - The current version has problems finding named objects in namespaces, … - … -() …
http://trac-hacks.org/timeline?from=2006-10-12T04%3A32%3A27%2B02%3A00&precision=second
CC-MAIN-2015-06
refinedweb
633
53.21
Namespace with GLSL types. More... Namespace with GLSL types. The sf::Glsl namespace contains types that match their equivalents in GLSL, the OpenGL shading language. These types are exclusively used by the sf::Shader class. Types that already exist in SFML, such as sf::Vector2<T> and sf::Vector3<T>, are reused as typedefs, so you can use the types in this namespace as well as the original ones. Others are newly defined, such as Glsl::Vec4 or Glsl::Mat3. Their actual type is an implementation detail and should not be used. All vector types support a default constructor that initializes every component to zero, in addition to a constructor with one parameter for each component. The components are stored in member variables called x, y, z, and w. All matrix types support a constructor with a float* parameter that points to a float array of the appropriate size (that is, 9 in a 3x3 matrix, 16 in a 4x4 matrix). Furthermore, they can be converted from sf::Transform objects.
https://en.sfml-dev.org/documentation/2.4.2-fr/namespacesf_1_1Glsl.php
CC-MAIN-2019-39
refinedweb
170
65.12
SUMMARY: I’m working on a little project to parse relatively large (but not huge) Apache access log files, with the file this week weighing in at 9.2 GB and 33,444,922 lines. So I gave myself 90 minutes to goof around and try a few different ways to write a simple “line count” program in Scala. This isn’t my final goal, but it seemed like something I could do to measure file-reading speed before applying my algorithm.Back to top Performance summary I know there are a lot of problems with testing the performance of JVM algorithms, but this is a simple application that needs to (a) start, (b) read each line in a file, then (c) stop. So I don’t think issues like “warming up the JVM” apply here. I was also looking forward to seeing how much faster GraalVM was than the java JVM approach. I ran each algorithm three times, and the average runtimes of the algorithms to parse the file came in like this: 1. Scala BufferedSource 26.6 seconds 2. Java BufferedReader 21.1 3. Java NIO Files.lines 19.9 4. Java NIO Files.newBufferedReader 20.3 5. Apache CommonsIo FileUtils 22.3 6. Scanner <did not complete> 7. GraalVM native-image 56.0 8. wc -l 15.8 From a performance standpoint, the 19.9 seconds number equates to reading a text file at a clip of 0.46 GB/second and 1,680,649.3 lines/second. Some of those numbers probably aren’t statistically significant because there was some variation in each run, but I’ll be giving the “Java NIO Files.lines” approach a try. As you can see below, it’s file-reading algorithm looks like this: val stream: Stream[String] = Files.lines(Paths.get(filename)) val numLines = stream.count The biggest surprise was that creating a native image with GraalVM was so slow. Last week I saw how much faster GraalVM made a file-finding algorithm, but this week I found that it made a file-reading algorithm much slower. (I tried converting the first four approaches into a native executable before I gave up on it.) Also, I only tried the Scanner approach because I saw that someone mentioned it as a way to read files. I’ve only used it to read from the command line, and reading from a file in the manner shown below was so slow I eventually killed it; I have no idea how long it would have taken to complete. As a final note, I reported the GraalVM performance as a bug, so there may be some way to make it run faster that I don’t currently know. If you’re interested, the rest of this page shows the source code for the different approaches I used.Back to top 1. Scala BufferedSource This line-counting approach uses scala.io.BufferedSource: import java.io._ import scala.io.{Source, BufferedSource} object BufferedSource1 extends App { val filename = "access_log.big" val source: BufferedSource = io.Source.fromFile(filename) var newlineCount = 0L for (line <- source.getLines) { newlineCount += 1 } source.close println(newlineCount) } In all of these examples I created a JAR file with the SBT package command and then ran that JAR file with a simple java command, with no special command-line options. 2. Java BufferedReader This line-counting approach uses java.io.BufferedReader: import java.io._ object BufferedReader2 extends App { val filename = "access_log.big" val br = new BufferedReader(new FileReader(filename)) var newlineCount = 0L var line = "" while ({line = br.readLine; line != null}) { newlineCount += 1 } br.close println(newlineCount) } 3. Java NIO Files.lines This line-counting approach uses the lines method of java.nio.file.Files: import java.nio.file.{Files, Paths} import java.util.stream.Stream object JavaNioFiles extends App { val filename = "access_log.big" val stream: Stream[String] = Files.lines(Paths.get(filename)) val numLines = stream.count stream.close } 4. Java NIO Files.newBufferedReader This line-counting approach uses the lines method of java.nio.file.Files.newBufferedReader: import java.io.BufferedReader import java.nio.file.{Files,Paths} object Java8Files2 extends App { val filename = "access_log.big" val br = Files.newBufferedReader(Paths.get(filename)) val numLines = br.lines.count br.close } 5. Apache Commons-IO FileUtils This line-counting approach uses FileUtils.lineIterator from the Apache Commons-IO project: import org.apache.commons.io._ import java.io.File object CommonsIo extends App { val filename = "access_log.big" var numLines = 0L val it = FileUtils.lineIterator(new File(filename), "UTF-8") while (it.hasNext()) { numLines += 1 val junk = it.nextLine } } 6. Scanner This line-counting approach uses java.util.Scanner: import java.io.File import java.util.Scanner object ScannerTest extends App { val filename = "access_log.big" var numLines = 0L val scanner = new Scanner(new File(filename)) while (scanner.hasNext()) { numLines += 1 val junk = scanner.nextLine } } 7. GraalVM To test GraalVM, I first created a JAR file named FIND.jar from the first four algorithms, then used commands like these to create a native image: native-image --no-server -cp $SCALA_HOME/lib/scala-library.jar -jar FIND.jar native-image -cp $SCALA_HOME/lib/scala-library.jar:FIND.jar JavaNioFiles$delayedInit$body They consistently ran at about 56 seconds. Note to self: I first set up my Graal environment like this: export JAVA_HOME=/Users/al/bin/graalvm-ce-19.1.1/Contents/Home export PATH=/Users/al/bin/graalvm-ce-19.1.1/Contents/Home/bin:$PATH 8. wc -l The MacOS wc -l command ran in about 15.8 seconds. It’s worth mentioning again that my final purpose wasn’t to create a line-count algorithm. I just wanted to see which file-reading approach might be fastest before I started applying my Apache access log parsing for this project’s needs.Back to top General testing procedure As noted above, in all of the Java examples I created a JAR file with the SBT package command and then ran that JAR file with a simple java command, with no special command-line options. I wrapped that command in a time command, like this: time java -cp ".:FIND.jar:$SCALA_HOME/lib/scala-library.jar" BufferedReader1$delayedInit$body I then created a Graal native image from each JAR file and then ran it with the time command as well: time ./find I only gave myself 90 minutes for these tests, but I tried to do different things on the filesystem in between each test run. I didn’t know if any form of caching could come in to play here, so I tried to keep the SSD busy in between tests.Back to top That’s all I shared the summary of my findings at the beginning of this article, so there isn’t much else to say, other than I’ll try to work with the GraalVM people to see why Graal is so slow in this use-case. One more thing that seems worth mentioning is that I didn’t try to use Apache Spark on this project, mostly because it seemed like overkill for my needs.Back to top
https://alvinalexander.com/scala/different-ways-read-large-text-file-with-scala-performance
CC-MAIN-2020-10
refinedweb
1,184
68.97
>From Philippe Blain, Bordeaux, France. My computer: P133 - 8,4 Go - 32 Mo Red Hat Linux 7.0 Subject: Corrections for ncurses-5.3-20030823+ 1----------------------------------------------------------------------- File : ncurses/tty/lib_mvcur.c Using vpa/hpa in the function relative_move(), is a nonsense: Column_address (hpa) or row_address (vpa) must be OUTSIDE relative_move() and considered as a case in itself (tactic#6). The reason why is that they give VERY OFTEN (but not always) the best cost comparing with parm_down/parm_up , cursor_right/cursor_left, ... hiding them and then the tactics #2,#3,#4,#5 become nothing else than (special_case)+vpa/hpa where (special_case) is mostly useless (except increasing the cost) as we use the absolute cursor addressing capabilities of the terminal. Proof, for linux we have : hpa=\E[%i%p1%dG, vpa=\E[%i%p1%dd cub1=^H, cud1=^J, cuf1=\E[C, cuu1=\E[A ABSENT CAPS : cub, cud, cuf, cuu [parm_xxx_cursor] vpa/hpa is MOSTLY choosen by relative_move() (shortest sequence) except when the new point is close to the old one or the edges of screen. In these cases, relative_move() without vpa/hpa is sufficient. Moving to x=0,y=12 gives in most cases : (padding=2 or 0.2 msec) tactic#0 [ 1 3 ; 1 H (cup) real_cost: 14 tactic#1 [ 1 3 d [ 1 G (vpa/hpa) real_cost: 18 tactic#2 [ 1 3 d ^[ [ 1 G (cr + vpa/hpa) real_cost: 20 tactic#3 [ H [ 1 3 d ^[ [ 1 G (home + vpa/hpa) real_cost: 24 tactic#4 no capability real_cost: 1000000 tactic#5 no capability real_cost: 1000000 Useless to do an action (cr/home/...anything) before absolute addressing. That's why I suggest to put vpa/hpa outside relative_move() and use them as a tactic (like cup). Something like that : /* move via (vpa/hpa) only */ static int absolute_addressing (string_desc * target, int from_y, int from_x, int to_y, int to_x) { string_desc save; int vcost = 0, hcost = 0; if (row_address && column_address) { _nc_str_copy (&save, target); if (to_y != from_y) { vcost = INFINITY; if (_nc_safe_strcat (target, tparm (row_address, to_y))) { vcost = SP->_vpa_cost; } if (vcost == INFINITY) return (INFINITY); } save = *target; // same as _nc_str_copy (&save, target); if (to_x != from_x) { hcost = INFINITY; if (_nc_safe_strcat (_nc_str_copy (target, &save), tparm (column_address, to_x))) { hcost = SP->_hpa_cost; } if (hcost == INFINITY) return (INFINITY); } return (vcost + hcost); } else return (INFINITY); } ------------------------------------------------------------------------ - Philippe
https://lists.gnu.org/archive/html/bug-ncurses/2003-08/msg00042.html
CC-MAIN-2017-04
refinedweb
374
51.18
System Information Operating system: Windows 10 Home Graphics card: GTX 1070 8GB Blender Version Broken: 2.80, 11f2c65128dc, 2019-01-03 Worked: 2.79b release Short description of error A rigid body simulation does not bake to completion when the frame_change_pre handler is used to create and then immediately remove a mesh data object. The simulation only bakes the first two frames and then stops. Here is a short script that reproduces the issue: import bpy def frame_change_pre(scene): new_mesh_data = bpy.data.meshes.new("mesh_name") bpy.data.meshes.remove(new_mesh_data) bpy.app.handlers.frame_change_pre.append(frame_change_pre) I have also reported another issue related to unexpected behavior when using the frame_change_pre handler here: T60094 Exact steps for others to reproduce the error I have attached a .blend file that includes the script to reproduce this issue. To reproduce: - Open the .blend file - Press 'Run Script' - Playback animation or attempt to bake the rigid body cache To reproduce from a new .blend file: - Add default cube as a rigid body object - Run the script - Playback animation or attempt to bake the rigid body cache
https://developer.blender.org/T60136
CC-MAIN-2019-04
refinedweb
182
54.83
Summary Important This document describes the changes that have been made in MSXML 4.0 Service Pack 2 (SP2) that break with compatibility to earlier versions of MSXML 4.0. While the list has been reviewed for technical accuracy by the Microsoft XML team, do not interpret this list as a complete or final list of changes. Potentially, additional breaking changes might exist in some usage cases. If you suspect that you have experienced a breaking change in MSXML 4.0 that is not documented in this article, contact Microsoft Product Support Services (PSS) to report the breaking change, and to receive additional technical support. The following changes have been made in MSXML 4.0 SP2: The following changes have been made in MSXML 4.0 SP2: - XSD Validation Enforces Restriction That Is Defined on a Base SimpleType - DOM: SetAttribute() Raises an Error When the Attribute Value Contains Invalid XML Characters - Importing Schemas Are Imported in Included Schemas Is Not Permitted in an Extension When the Base Type Is Not Empty - XSD Uniqueness Identity Constraint Is Checked When Xsi:type Is Used to Change the Type of an Element - Security Is Tightened When You Post Data by Using the ServerXmlHttp Object More Information XSD Validation Enforces Restriction That Is Defined on a Base SimpleTypeIn the original released version of MSXML 4.0 and in MSXML 4.0 Service Pack 1 (SP1), the XML schema validator does not enforce restrictions that are defined on base simpleTypes. Validating the data in the following sample XML document (Restriction.xml) against the sample schema (Restriction.xsd) does not raise any errors in the original released versions of MSMXL 4.0 and MSXML 4.0 SP1 even though the value of the AlphaTestValue element contains a character (the "-" character) that is restricted by the AlphaType base simpleType:> Restriction.xml In MSXML 4.0 SP2, a fix has been implemented to enforce restrictions that are defined on base simpleTypes when validating XML data. This is a breaking change that has been implemented to enhance compliancy with the World Wide Web Consortium (W3C) XML Schema specification. XML data that violates restrictions that are defined on base simpleTypes fail validation in MSXML 4.0 SP2. <?xml version="1.0"?> <AlphaTestValue>ABCDE-</AlphaTestValue> back to the top DOM: SetAttribute() Raises an Error When the Attribute Value Contains Invalid XML CharactersThe IXMLDOMElement.setAttribute() method has been fixed to generate an error when a specified attribute value contains invalid XML characters. The following are the valid XML characters and character ranges (hexadecimal values) that are defined by the W3C XML language specifications 1.0: #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] |[#x10000-#x10FFFF]This is a breaking change that has been implemented to enhance compliancy with the W3C XML specification. You receive a runtime error message after you upgrade to MSXML 4.0 SP2 if you have code that uses the setAttribute DOM API method to assign values that contain invalid XML characters to XML attributes. To resolve this, you must change your code so that you do not use invalid XML characters in attribute values. back to the top Importing Schemas Are Imported in Included SchemasIn MSXML 4.0 SP2, you must explicitly import schemas that are imported in included schemas so that the including parent schema can use or can reference schema definitions that they contain. For example, this is true if the following dependencies between three separate XML schemas are in effect: - Schema A (a.xsd) uses an XSD include element to include Schema B (b.xsd). In the context of the explanation, Schema A is the including schema and Schema B is the included schema. - Schema B uses an XSD import element to import Schema C (c.xsd) '<Namespace URI>' is an invalid targetNamespace URI.The error occurs in MSXML 4.0 SP2 because Schema A does not explicitly import Schema C. Schema A should contain an explicit import element to explicitly import Schema C by specifying the corresponding namespace and schemaLocation attributes. It is not sufficient to only specify the namespace attribute. You must also specify the schemaLocation attribute of Schema C. This change was made in MSXML 4.0 SP2 to gain more compliancy with the W3C XML Schema specification. back to the top <all> Is Not Permitted in an Extension When the Base Type Is Not EmptyMSXML 4.0 SP2 prevents the use of the <all> particle in a complex type extension when the base type is not empty. When you try to use the XSD <all> particle in this context, you receive the following error message when the schema is compiled: <all> is not the only particle in a <group> or being used as an extensionThe following is a sample schema that illustrates an invalid use of the <all> particle in a complex type extension: The W3C XML Schema specification does not permit the use of the XSD all element when extending a non-empty base complexType. In this specific sample, you can use an XSD schema sequence element (<xs:sequence>) instead of using the all element (<xs:all>) to define the complex content extension. For more information about what is permitted in complexType extension rules, see the XML Schema specification. > back to the top XSD Uniqueness Identity Constraint Is Checked When Xsi:type Is Used to Change the Type of an ElementThe original release of MSXML 4.0 and MSXML 4.0 SP1 contained a bug where uniqueness identity constraints on elements were not validated when the types of the elements were changed by using the XML schema instance xsi:type attribute. This has been fixed in MSXML 4.0 SP2 so that a validation error message is generated. For example, when you try to validate the following Products.xml document against the Products.xsd schema, you receive a validation error message that indicates that there back to the top Is Tightened When You Post Data by Using the ServerXmlHttp ObjectSecurity in the implementation of the MSXML 4.0 SP2 ServerXmlHttp object has been enhanced to check the Internet Explorer security policy setting for submitting non-encrypted form data. When you set the Submit nonencrypted form data security policy to Disable or to Prompt, the following error message may be generated when you try to execute an HTTP POST by using the ServerXmlHttp object: Access DeniedThis is a change that can potentially break existing code that uses earlier versions of the ServerXmlHttp object (MSXML 3.0 and its current service packs, the original release of MSXML 4.0, and MSXML 4.0 SP1) to execute an HTTP POST when the Internet Explorer security policy setting for submitting non-encrypted form data is not enabled. To configure Internet Explorer security to allow the submitting of nonencrypted form data for all users on a computer, do the following in Microsoft Windows 2000 and later: - Click Start, click Run, type mmc, and then press ENTER. - On the File or the Actionmenu, click Add/Remove Snap-in. - In the Add/Remove Snap-in dialog box, click Add. - On the Standalone tab, click Add. In the Available Standalone Snap-indialog box, click Group Policy , and then click Add. The Group Policy Wizard appears. - In the Group Policy Wizard, Click Finish - Close the Add Standalone Snap-in window by clicking the Close button - Click OK in the Add/Remove Snap-in dialog box. - Under User Configuration, expand Windows Settings, expand Internet Explorer Maintenance, and then click Security. - In the right pane, double-click Security Zones and Content Ratings. - Under Security Zones and Privacy, click Import the current security zones and privacy settings, and then click Modify Settings. - Select the zone that you would like to modify, and click Custom Level - Modify the settings to enable the Submit nonencrypted form data option by selecting the enableradio. - Restart the process that is running ServerXMLHTTP. To do this, you may have to restart your computer. Access DeniedThis is caused by an additional security feature that is named “Enhanced Internet Explorer Settings”. On some computers, this is installed by default. On other computers, you can add it through Windows Components by using the Add/Remove Programs tool in Control Panel. If an additional security lock down on the account that runs the IIS6 process is in effect, use one of the following methods to work around the problem: - Method 1: Run the specified Web sites, or virtual directories in a separate IIS pool ,and then create a user that the pool will run under. - Method 2: Create a new DLL, write code to do ServerXMLHTTP calls, and then host the DLL in COM+ under a new user. - Method 3: Use WinHTTP by changing the Prog ID from MSXML2.ServerXMLHTTP.4.0 to WinHTTP.WinHTTPRequest.5.1. References For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base: back to the top Properties Article ID: 820882 - Last Review: Jun 20, 2014 - Revision: 1
https://support.microsoft.com/en-us/help/820882/conformance-and-security-changes-in-msxml-4.0-sp2
CC-MAIN-2017-17
refinedweb
1,487
53.41
Scanner class in Java ( java.util.Scanner) was introduced in Java 1.5 as a simple text scanner which can parse primitive types and strings using regular expressions. Table of Contents Scanner Class in Java Java Scanner class can be used to break the input into tokens with any regular expression delimiter and it’s good for parsing files also. Scanner class can be used to read file data into primitive. It also extends String split() method to return tokens as String, int, long, Integer and other wrapper classes. Java Scanner Example Here I am using Scanner to read a file line by line, parsing a CSV file to create java object easily and read from the user input. JavaFileScanner.java package com.journaldev.files; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Scanner; public class JavaFileScanner { public static void main(String[] args) throws IOException { /** * My Name is Pankaj * My website is journaldev.com * Phone : 1234567890 */ String fileName = "/Users/pankaj/source.txt"; Path path = Paths.get(fileName); Scanner scanner = new Scanner(path); //read file line by line scanner.useDelimiter(System.getProperty("line.separator")); while(scanner.hasNext()){ System.out.println("Lines: "+scanner.next()); } scanner.close(); //read CSV Files and parse it to object array /** * Pankaj,28,Male * Lisa,30,Female * Mike,25,Male */ scanner = new Scanner(Paths.get("/Users/pankaj/data.csv")); scanner.useDelimiter(System.getProperty("line.separator")); while(scanner.hasNext()){ //parse line to get Emp Object Employee emp = parseCSVLine(scanner.next()); System.out.println(emp.toString()); } scanner.close(); //read from system input System.out.println("Read from system input:"); scanner = new Scanner(System.in); System.out.println("Input first word: "+scanner.next()); } private static Employee parseCSVLine(String line) { Scanner scanner = new Scanner(line); scanner.useDelimiter("\\s*,\\s*"); String name = scanner.next(); int age = scanner.nextInt(); String gender = scanner.next(); JavaFileScanner jfs = new JavaFileScanner(); return jfs.new Employee(name, age, gender); } public class Employee{ private String name; private int age; private String gender; public Employee(String n, int a, String gen){ this.name = n; this.age = a; this.gender = gen; } @Override public String toString(){ return "Name="+this.name+"::Age="+this.age+"::Gender="+this.gender; } } } Output of the above program is: Lines: My Name is Pankaj Lines: My website is journaldev.com Lines: Phone : 1234567890 Name=Pankaj::Age=28::Gender=Male Name=Lisa::Age=30::Gender=Female Name=Mike::Age=25::Gender=Male Read from system input: Pankaj Kumar Input first word: Pankaj We can use java Scanner class to parse the input into specific datatype tokens. Read this post to learn how to read CSV File using Scanner. Useful tutorial even after four years. i need a simple program that it should take text as input using parser and analyse the text as output then it should perform AST using the output of parser Nice article. Where is the Path class? Path class is added in Java-7. I think you are using older version. I want to read a method of java class line by line and do the analysis of each statement. Any idea how i can achieve it? how to use scanner class with servlet?? it will work???? sir iam writing a program to extract email headers like From,to,Subject etc,how do i write it so that i can extract only lines followed by From: , To: and not the remaining text i tried Pattern.compile with scanner but not working i could not understand what is java File Scanner in line 54,i know Scanner but JavaFile Scanner JavaFileScanner is the class name of the program you are looking. 🙂
https://www.journaldev.com/872/scanner-class-in-java
CC-MAIN-2019-39
refinedweb
602
51.85
> Basically I want to open a scene whenever the user is in the editor, and then close that scene whenever the user is in playmode. Opening the scene works by using: EditorSceneManager.OpenScene("Assets/Scenes/scenename.unity", OpenSceneMode.Additive); However, it seems impossible to unload/close the scene whenever the user presses play. Currently I can listen to the user pressing play through: EditorApplication.hierarchyWindowChanged And: EditorApplication.isPlayingOrWillChangePlaymode I tried using the following calls to unload/close the scene before the game starts, but none of them works: UnityEngine.SceneManagement.SceneManager.UnloadScene(scenename); UnityEngine.SceneManagement.SceneManager.UnloadScene("Assets/Scenes/scenename.unity"); Scene s = EditorSceneManager.GetSceneByName(scenename); EditorSceneManager.CloseScene(s, true); To me it seems as if the SceneManagement in Unity is completeley broken, but maybe I'm just missing something? Any ideas/tips/help? Answer by TruffelsAndOranges · Jan 28, 2016 at 07:35 PM Very interestingly those code lines work when the game IS running: Scene s = EditorSceneManager.GetSceneByName(scenename); EditorSceneManager.CloseScene(s, true); But I want to close the scene BEFORE the game starts. So it's kind of broken right now since there doesn't seem to be a way to do that. Answer by kblood · Mar 13, 2017 at 12:28 AM This is annoying, that is sure, but its not exactly broken though, is it @TruffelsAndOranges? You can right click each scene you have opened in the editor and unload them manually, before you actually hit play. Its meant to make it easier to work with multiple scenes in the editor, but right now, if you play while they are loaded and you have a system that loads these scenes then they will be loaded double. I think there could be some different workarounds though. One would be to not load these scenes if you are in the editor, in the scripts. Like this: #if !UNITY_EDITOR Load("Player&UI"); Load("Scene2"); Load("Scene2.1"); #endif This will make sure that you do not load these scenes if you are in the editor. But then you have to make sure that you have loaded these scenes in the editor, and that you do not unload them, or at least if you unload them, then load them again before you hit play. Those loads use the regular SceneManager. Another way to unload all the scenes is you can do a: // Check if in editor and do this #if !UNITY_EDITOR SceneManager.UnloadSceneAsync("insert scene name"); SceneManager.UnloadSceneAsync("insert scene name"); SceneManager.UnloadSceneAsync("insert scene name"); #endif That will unload all these scenes, and you can put this in an awake command, but I am guessing that will not be good enough for you because you need these scenes to not load in the first place, and this would then be too late? I have a similar problem, and my only solution seems to be to just unload all the scenes that I have open in the editor except the scene manager scene that loads all the other scenes. They will still be in the editor though, they just become grayed out., and you can load them again after running the test by right clicking them in the hierarchy view and load them. They will only stop being in the hierarchy view if you remove them with that right right click menu. EDIT: Hmmm... not sure here. Seems like you cannot unload the. Well, I have played around with this some more. The scenes just cannot be found on Awake because they are all still loading. So you can unload them after the updates begin. I made a lot of things that are in "#if UNITY_EDITOR" making a variable that is told what the Time.time is during Awake, and then in update I look for a time between 0.2f after awake and 2f after awake, and redo all the scene loading and variables and such. Pretty annoying... I guess it is still easier to just select the levels in the editor and unload them before you hit play. Answer by Alexander-Fedoseev · Oct 11, 2018 at 11:02 AM Just add this script anywhere in your Assets folder (not inside Editor folder) and it will making what you want. No need to add it to gameobject as a component. using UnityEditor; using UnityEditor.SceneManagement; using UnityEngine.SceneManagement; [InitializeOnLoadAttribute] // Unload scenes except active scene before Play Mode // Load them back when enter Editor Mode public static class EditorScenes { static EditorScenes() { EditorApplication.playModeStateChanged += OnPlayModeStateChanged; } private static void OnPlayModeStateChanged(PlayModeStateChange state) { if (state == PlayModeStateChange.EnteredEditMode) OpenScenes(); if (state == PlayModeStateChange.ExitingEditMode) CloseScenes(); } // ----------------------------------------------------- private static void OpenScenes() { for (int i = 0; i < SceneManager.sceneCount; i++) { Scene scene = SceneManager.GetSceneAt(i); if (!IsActiveScene(scene)) OpenScene(scene); } } private static void CloseScenes() { for (int i = 0; i < SceneManager.sceneCount; i++) { Scene scene = SceneManager.GetSceneAt(i); if (!IsActiveScene(scene)) CloseScene(scene); } } // ----------------------------------------------------- private static void OpenScene(Scene scene) { EditorSceneManager.OpenScene(scene.path, OpenSceneMode.Additive); } private static void CloseScene(Scene scene) { EditorSceneManager.CloseScene(scene, false); } // ----------------------------------------------------- private static Scene activeScene { get { return SceneManager.GetActiveScene(); } } private static bool IsActiveScene(Scene scene) { return scene == activeSc. Get the currently open scene name or file name 8 Answers 'Resource file has already been unloaded' error when exiting application in Editor 1 Answer Is it possible to ensure that certain game objects don't get saved in the scene or otherwise hook into the default save scene to run custom editor code? 2 Answers How can I make a separate scene that is managed in an editor script? 0 Answers Particular scene loads fine in the Unity Editor, but unable to load in the executable? 0 Answers
https://answers.unity.com/questions/1134925/cannot-closeunload-a-scene-that-is-open-in-editor.html
CC-MAIN-2019-30
refinedweb
932
55.95
PyCharm 2019.1 is out now: all-new Jupyter Notebook support, ‘recent location’ for navigation, custom theme plugins, and much more. Download now New in PyCharm - Jupyter Notebooks support has been completely redesigned. Direct editing of Notebooks is now available in PyCharm 2019.1, with a convenient side-by-side view that helps you get a better overview of your Notebook’s source code while seeing the output right next to it. You can run and debug cells straight from the IDE. - Quick documentation for HTML and CSS has been improved. Quick question: when writing a ‘padding’ property in CSS, what comes first? Left and right, or top and bottom? Just write ‘padding’ in a CSS file and press Ctrl-Q (or Ctrl-J on macOS) to find the answer! - Navigate quickly to recent locations, rather than files. When you’re making quick edits, you frequently need to go back and forth between locations. The recent files popup (Ctrl-E, or Cmd-E on macOS) has always been there to quickly move between files you’re editing, but now we’ve also got the new and improved recent locations popup. Try it now: just press Ctrl-Shift-E (or Cmd-Shift-E on macOS). - We’ve ending support for two Python versions: 2.6 (that has been end-of-life since 2013), and 3.4 (which just reached end-of-life). If you’re still using these versions, you’ll receive a warning that these versions are no longer supported. Some PyCharm functionality might no longer work, and we won’t fix any bugs related to these Python versions anymore. Many more features, like better performance when debugging large collections, type checks on variable assignments, multiprocess test runners for pytest. Learn more about PyCharm 2019.1 on our website You can also find the details about our release, in the release notes.. Keyboard shortcuts did not work in the RCs. Is this fixed? We had some issues that 2019.1.1 addressed. Can you give that a try? If it doesn’t fix it, could you describe the issue better and I’ll look for a ticket? There is no the 32bit launcher after updated to 2019.1 version. Same reinstall. (Win10 32bit) Correct, Java 9 deprecated 32-bit JDK. PyCharm 2019.1 is the first release to use an OpenJDK > 8. I do like the side-by-side view of Jupyter notebooks, I must say! The surprising feature quickly has turned into a convenient one. Previous version worked fine. Upgraded using the inbuilt upgrade and now I get: Cannot start PyCharm No JDK found. Please validate either PYCHARM_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation. Tried reinstalling from the download page. Same issue. Can you try the 2019.1.1 that we released today? How did you install PyCharm and what OS? where is the pycharm32.exe ?! Wow awesome, just tried it but I can’t find a “Run all cells until breakpoint” feature, nor a “Run all cells and clear output” or “Clear all output” as in jupyter lab. It’s very useful to remove the output before committing the file to the git repo. Is there such feature and I didn’t look properly? Thanks! We have an open issue targeted for the next release for Run All. If you get a chance, take a look and add any comments. Thanks! Thank you very much for this release. The new features look great! Can’t wait to give them a try. Where can I download the zip version of this new release (for portable installations)? It is usually just a matter of changing the file extension but does not work This release is pretty broken. On OSX it won’t launch through toolbox (nothing happens when it’s clicked). On WIndows, I’ve managed to get it to work but HTTP requests are broken. Really disappointing. (I’ve raised both issues but until they are fixed I have to stay on 2018) Yes, our upgrade to OpenJDK 11 caused some issues that weren’t reported during EAP. We just released 2019.1.1. Can you give it a try for your reported issues? So this version removes Jupyter notebook support from community edition entirely? ?? How to disable focusing on pop ups and fayding of background? I cannot find this option in Preferences. Installed 2019.1.1. (Python 3.6) So far everything works as before except Jupyter. I’m getting module not found error for: from src.my_module import MyModule Please help.
https://blog.jetbrains.com/pycharm/2019/03/pycharm-2019-1-out-now/?replytocom=391408
CC-MAIN-2019-51
refinedweb
758
76.52
Cloud computing services that run customer code in short-lived processes are often called "serverless". But under the hood, virtual machines (VMs) are usually launched to run that isolated code on demand. The boot times for these VMs can be slow. This is the cause of noticeable start-up latency in a serverless platform like Amazon Web Services (AWS) Lambda. To address the start-up latency, AWS developed Firecracker, a lightweight virtual machine monitor (VMM), which it recently released as open-source software. Firecracker emulates a minimal device model to launch Linux guest VMs more quickly. It's an interesting exploration of improving security and hardware utilization by using a minimal VMM built with almost no legacy emulation. A pared-down VMM Firecracker began as a fork of Google's crosvm from ChromeOS. It runs Linux guest VMs using the Kernel-based Virtual Machine (KVM) API and emulates a minimal set of devices. Currently, it supports only Intel processors, but AMD and Arm are planned to follow. In contrast to the QEMU code base of well over one million lines of C, which supports much more than just qemu-kvm, Firecracker is around 50 thousand lines of Rust. The small size lets Firecracker meet its specifications for minimal overhead and fast startup times. Serverless workloads can be significantly delayed by slow cold boots, so integration tests are used to enforce the specifications. The VMM process starts up in around 12ms on AWS EC2 I3.metal instances. Though this time varies, it stays under 60ms. Once the guest VM is configured, it takes a further 125ms to launch the init process in the guest. Firecracker spawns a thread for each VM vCPU to use via the KVM API along with a separate management thread. The memory overhead of each thread (excluding guest memory) is less than 5MB. Performance aside, paring down the VMM emulation reduces the attack surface exposed to untrusted guest virtual machines. Though there were notable VM emulation bugs [PDF] before it, qemu-kvm has demonstrated this risk well. Nelson Elhage published a qemu-kvm guest-to-host breakout [PDF] in 2011. It exploited a quirk in the PCI device hotplugging emulation, which would always act on unplug requests for guest hardware devices — even if the device didn't support being unplugged. Back then, Elhage correctly expected more vulnerabilities to come in the KVM user-space emulation. There have been other exploits since then, but perhaps the clearest example of the risk from obsolete device emulation is the vulnerability Jason Geffner discovered in the QEMU virtual floppy disk controller in 2015. Running Firecracker Freed from the need to support lots of legacy devices, Firecracker ships as a single static binary linked against the musl C library. Each run of Firecracker is a one-shot launch of a single VM. Firecracker VMs aren't rebooted. The VM either shuts down or ends when its Firecracker process is killed. Re-launching a VM is as simple as killing the Firecracker process and running Firecracker again. Multiple VMs are launched by running separate instances of Firecracker, each running one VM. Firecracker can be run without arguments. The VM is configured after Firecracker starts via a RESTful API over a Unix socket. The guest kernel, its boot arguments, and the root filesystem are configured over this API. The root filesystem is a raw disk image. Multiple disks can be attached to the VM, but only before the VM is started. These curl commands from the Getting Started guide configure a VM with the provided demo kernel and an Alpine Linux root filesystem image: curl --unix-socket /tmp/firecracker.socket -i \ -X PUT '' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "kernel_image_path": "./hello-vmlinux.bin", "boot_args": "console=ttyS0 reboot=k panic=1 pci=off" }' curl --unix-socket /tmp/firecracker.socket -i \ -X PUT '' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "drive_id": "rootfs", "path_on_host": "./hello-rootfs.ext4", "is_root_device": true, "is_read_only": false }' The configured VM can then be started with a final call: curl --unix-socket /tmp/firecracker.socket -i \ -X PUT '' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{"action_type": "InstanceStart"}' Each such Firecracker process runs a single KVM instance (a "microVM" in the documentation). The serial console of the guest VM is mapped to Firecracker's standard input/output. Networking can be configured for the guest via a TAP interface on the host. As an example for host-only networking, create a TAP interface on the host with: # ip tuntap add dev tap0 mode tap # ip addr add 172.17.0.1/16 dev tap0 # ip link set tap0 up Then configure the VM to use the TAP interface before starting the VM: curl --unix-socket /tmp/firecracker.socket -i \ -X PUT '' \ -H 'Content-Type: application/json' \ -d '{ "iface_id": "eth0", "host_dev_name": "tap0", "state": "Attached" }' Finally, start the VM and configure networking inside the guest as needed: # ip addr add 172.17.100.1/16 dev eth0 # ip link set eth0 up # ping -c 3 172.17.0.1 Emulation for networking and block devices uses Virtio. The only other emulated device is an i8042 PS/2 keyboard controller supporting a single key for the guest to request a reset. No BIOS is emulated as the VMM boots a Linux kernel directly, loading the kernel into guest VM memory and starting the vCPU at the kernel's entry point. The Firecracker demo runs 4000 such microVMs on an AWS EC2 I3.metal instance with 72 vCPUs (on 36 physical cores) and 512 GB of memory. As shown by the demo, Firecracker will gladly oversubscribe host CPU and memory to maximize hardware utilization. Once a microVM has started, the API supports almost no actions. Unlike a more general purpose VMM, there's intentionally no support for live migration or VM snapshots since serverless workloads are short lived. The main supported action is triggering a block device rescan. This is useful since Firecracker doesn't support hotplugging disks; they need to be attached before the VM starts. If the disk contents are not known at boot, a secondary empty disk can be attached. Later the disk can be resized and filled on the host. A block device rescan will then let the Linux guest pick up the changes to the disk. The Firecracker VMM can rate-limit its guest VM I/O to contain misbehaving workloads. This limits bytes per second and I/O operations per second on the disk and over the network. Firecracker doesn't enforce this as a static maximum I/O rate per second. Instead, token buckets are used to bound usage. This lets guest VMs do I/O as fast as needed until the token bucket for bytes or operations empties. The buckets are continuously replenished at a fixed rate. The bucket size and replenishment rate are configurable depending on how large of bursts should be allowed in guest VM usage. This particular token bucket implementation also allows for a large initial burst on startup. Cloud computing services typically provide a metadata HTTP service reachable from inside the VM. Often it's available at the well-known non-routable IP address 169.254.169.254, like it is for AWS, Google Cloud, and Azure. The metadata HTTP service offers details specific to the cloud provider and the service on which the code is run. Typical examples are the host networking configuration and temporary credentials the virtualized code can use. The Firecracker VMM supports emulating a metadata HTTP service for its guest VM. The VMM handles traffic to the metadata IP itself, rather than via the TAP interface. This is supported by a small user-mode TCP stack and a tiny HTTP server built into Firecracker. The metadata available is entirely configurable. Deploying Firecracker in production In 2007 Tavis Ormandy studied [PDF] the security exposure of hosts running hostile virtualized code. He recommended treating VMMs as services that could be compromised. Firecracker's guide for safe production deployment shows what that looks like a decade later. Being written in Rust mitigates some risk to the Firecracker VMM process from malicious guests. But Firecracker also ships with a separate jailer used to reduce the blast radius of a compromised VMM process. The jailer isolates the VMM in a chroot, in its own namespaces, and imposes a tight seccomp filter. The filter whitelists system calls by number and optionally limits system-call arguments, such as limiting ioctl() commands to the necessary KVM calls. Control groups version 1 are used to prevent PID exhaustion and to prevent workloads sharing CPU cores and NUMA nodes to reduce the likelihood of exploitable side channels. The recommendations include a list of host security configurations. These are meant to mitigate side channels enabled by CPU features, host kernel features, and recent hardware vulnerabilities. Possible future as a container runtime Originally, Firecracker was intended to be a faster way to run serverless workloads while keeping the isolation of VMs, but there are other possible uses for it. An actively developed prototype in Go uses Firecracker as a container runtime. The goal is a drop-in containerd replacement with the needed interfaces to meet the Open Container Initiative (OCI) and Container Network Interface (CNI) standards. Though there are already containerd shims like Kata Containers that can run containers in VMs, Firecracker's unusually pared-down design is hoped to be more lightweight and trustworthy. Currently, each container runs in a single VM, but the project plans to batch multiple containers into single VMs as well. Commands to manage containers get sent from front-end tools (like ctr). In the prototype's architecture, the runtime passes the commands to an agent inside the Firecracker guest VM using Firecracker's experimental vsock support. Inside the guest VM, the agent in turn proxies the commands to runc to spawn containers. The prototype also implements a snapshotter for creating and restoring container images as disk images. The initial goal of Firecracker was a faster serverless platform running code isolated in VMs. But Firecracker's use as a container runtime might prove its design more versatile than that. As an open-source project, it's a useful public exploration of what minimal application-specific KVM implementations can achieve when built without the need for legacy emulation. (Log in to post comments)
https://www.tefter.io/bookmarks/66834/readable
CC-MAIN-2021-04
refinedweb
1,721
54.93
This article deals with installing RTLinux, and creating a sample real-time module that can be loaded in it. An operating system is responsible for managing, accessing, controlling and interacting with the computer hardware for general and special purposes. Most common PC operating systems (Windows, Macintosh, Linux and UNIX) are general-purpose operating systems (GPOS), but some tasks require special-purpose operating systems that provide specific services that are not available in GPOS. One such task is to obtain outputs from process execution in deterministic time frames. Such execution within a specific time bracket is known as real-time processing, for which you need a real-time operating system (RTOS). In an RTOS, the basic idea is to assign the complete hardware resources to the application, and successfully execute it within a deterministic time. In GPOS, a process might be starved of CPU resources if a higher-priority process is scheduled. For example, your music file, playing in a media player, might be kicked off from the processor if the OS needs to service an interrupt. In GPOS, it’s hard to avoid random elements; execution doesn’t actually work on real-time deadlines. RTOS take into consideration various mathematical formulas in order to execute the task; thus random elements in service availability, initialisation time and input parameters must be avoided, since they can seriously affect the real-time deadline of applications. Many companies have worked on the development of different RTOS, including VxWorks, Windows CE, RTLinux and QNX. RTLinux (Real-Time Linux) is what I will be discussing in the course of this article, because it incorporates a beginner-friendly, fast and flexible architecture for providing hard real-time capabilities. RTLinux, developed by Wind River, is available in two variants: - Open RTLinux (under the GPL) - Wind River real-time core.. Let’s discuss the architecture of RTLinux. Figure 1 shows the traditional architecture of the general-purpose Linux system, where the kernel directly interacts with the hardware. All the interrupts are intercepted by the kernel itself. Figure 2 depicts the design of the RTLinux system. Three important aspects are displayed by the figure: - RTLinux sits between the real hardware and the kernel. - It acts as the hardware for the kernel. - It treats the kernel as a single big process. The RT scheduler schedules the kernel on the processor. The priority of the kernel is lower compared to real-time tasks, and it can be pre-empted. All hardware interrupts are intercepted by the RTLinux layer, and if it’s not for an RT task, then the interrupt is passed to the Linux kernel as a software interrupt, when RTLinux is sitting idle. Thus, two features are provided: - All RT tasks will get a real-time response whenever they need resources. - All non-RT tasks can be executed by the kernel when the RTLinux system is idle. Configuring your system for RTLinux Let’s now set about getting RTLinux running on a system. To test RTLinux, I have configured my system as follows: - Pentium 4 machine running CentOS 3 (Linux 2.4.21 as the base kernel). - ext2 for the root filesystem. - 2 GB of RAM Prerequisites Download the Linux kernel source, and the RTLinux patch. Here’s the link for my chosen kernel version, and rtlinux-3.2-wr.tar.bz2 from here. Organise the source Move these compressed files to the /usr/src directory and uncompress them (as root, but you already knew that!), as follows: mv linux-2.4.21.tar.bz2 /usr/src mv rtlinux-3.2-wr.tar.bz2 /usr/src cd /usr/src tar -jxvf linux-2.4.21.tar.bz2 tar -jxvf rtlinux-3.2-wr.tar.bz2 Let’s give these extracted directories shorter, easier-to-use aliases by creating soft links to them: ln -s linux-2.4.21 linux ln -s rtlinux-3.2-wr rtlinux Patch it up Apply the RTLinux patch to the vanilla kernel source, using the following steps: cd linux patch -p1 < ../rtlinux/patches/kernel-patch-2.4.21-rtl3.2-pre3 You may see this error during patching: patch: **** malformed patch at line 1047: *+/ If so, then edit ./rtlinux/patches/kernel_patch-2.4.21-rtl3.2-pre3 in an editor. Go to line 1047 and change the following text: (*+/ ) to: (+*/ ) Once again, extract the Linux source code (to revert to the original source) and then apply the modified patch, with the same commands given above. Compile and install Linux After the RTL patch is applied, proceed through the following steps to compile the kernel: cd /usr/src/linux make menuconfig In the configuration menu, choose the exact processor type. You can find the name of the processor on your machine by running the cat /proc/cpuinfo command. Disable SMP support, and set the version information on all module symbols. Then proceed with the following code: make dep make modules make modules_install make install Reboot your system. In the GRUB menu, you will find a new entry for the newly compiled kernel. Compiling and installing RTLinux Issue the following commands: cd /usr/src/rtlinux make menuconfig make make devices make install Post installation After this, run the commands to check the status of the RTLinux modules. First of all, you should run the regression test: ./scripts/regression.sh You should get [OK] for all the tests. If you get a [Failed], then it’s a fatal error; if you start RTLinux, it might crash the kernel. Something has gone wrong during the compilation and installation of the kernel. If all tests return [OK], then run the following commands: rtlinux status rtlinux start These will install all the modules present in the /usr/src/rtlinux/modules directory. Our own module will use only the symbols that are present in these modules. Let’s get our hands dirty Once RTLinux is set up, it’s ready to run a test module. To understand it better, there are a lot of examples provided along with the RTLinux patch, which you will find in the examples subdirectory. Let’s say “Hello” to RTLinux using the hello module. - To compile, go to the examplesdirectory, and execute the makecommand. The Makefilethat should be already there will be used to create the object file. - Now run the command insmod filename.o, where filenameis the module name you want to load into the running kernel. For example, insmod hello.o. - To view a list of loaded modules, use the lsmodcommand. - To view the messages output by the newly loaded module, use the dmesgcommand. A code fragment decoded This program can be found in examples/hello. The aim of the module is to execute twice a second; during each execution, it will print the message “I’m here, my arg is 0”. #include <rtl.h> #include <time.h> #include <pthread.h> pthread_t thread; void * start_routine(void *arg) { struct sched_param p; p.sched_priority = 1; pthread_setschedparam (pthread_self(), SCHED_FIFO, &p); pthread_make_periodic_np (pthread_self(), gethrtime(), 500000000); while (1) { pthread_wait_np(); rtl_printf("I'm here; my arg is %x\n", (unsigned) arg); } return 0; } int init_module(void) { return pthread_create (&thread, NULL, start_routine, 0); } void cleanup_module(void) { pthread_cancel (thread); pthread_join (thread, NULL); } Now let me explain what each part of this code does. init_module()— The module is initialised using this function. It executes pthread_createto create a thread, and returns its success status. On successful execution of pthread_create, the start_routinefunction is called, with 0as its argument. start_routine()— This comprises three components: initialisation, run-time and termination. Initialisation Executed when the code is run the first time after loading, the section of code written before the while loop tells the scheduler to assign this thread scheduling a priority of one, using p.sched_priority. It then sets the scheduler’s behaviour to be SCHED_FIFO for all subsequent executions, using pthread setschedparam. Finally, it calls the function pthread_make_periodic_np to run this thread after the given time period of 500 milliseconds. Run-time The block of code inside the while loop blocks all further execution of the thread using pthread_wait_np(). Once the thread is called again, after 500 milliseconds, it executes the rest of the code inside the while loop. However, since this is an infinite loop, with no exit condition, unless the module is unloaded using the rmmod command, it will keep executing the thread every 500 milliseconds. Termination The function *cleanup_module()* is called when the module is unloaded using rmmod command. *# rmmod hello* Then it calls pthread_cancel() to cancel the thread and pthread_join() to wait for the thread termination. This helps in freeing up any resources being used by the module. Nice article How to then copy this created operating system to another system ? As indicated by the struck-out link, the RTlInuxFree site is down. I searched for the rtlinux-3.2-wr.tar.bz2 file, but only got a pointer to a dodgy-sounding Chinese site. Do you have (a) a good link for the file, or (b) a copy you could share? Regards & thanks Thanks for your easy-to-understand words to RT-Linux. And I wonder how the RT-Linux delays the interrupt for GP Linux kernel? The software interrupt? Do you mean a system call or sth else? I hope it can be more specific :-) Thanks for your easy-to-understand words to RT-Linux. And I wonder how the RT-Linux delays the interrupt for GP Linux kernel? The software interrupt? Do you mean a system call or sth else? I hope it can be more specific :-)
https://www.opensourceforu.com/2010/12/getting-started-with-rtlinux/
CC-MAIN-2020-45
refinedweb
1,577
56.45
NetBeans Platform JavaFX Porting Tutorial - Examining the Swing Interop Sample - Setting Up the Application - Embedding a JavaFX Chart in a TopComponent - Splitting the Table from the Chart - Plugging in New Charts This tutorial provides step-by-step instructions for integrating JavaFX features into a NetBeans Platform application. Since the NetBeans Platform is typically used as a basis for corporate applications, the JavaFX chart components are ideal candidates for integration into NetBeans Platform applications. JavaFX, as a whole, is focused on bringing special effects to Java. In the context of charts, JavaFX provides a set of predefined charts, each of which can be animated, which is particularly useful to show changes in values presented in a chart. At the end of this tutorial, you will have various JavaFX charts in a NetBeans Platform application, as can be seen above, together with instructions and an API for plugging in additional charts. For troubleshooting purposes, you are welcome to download the completed tutorial source code. Examining the Swing Interop Sample We begin by looking at a sample that comes with NetBeans IDE. It provides all the JavaFX code we’ll need. In the following sections, we’ll port the code to a NetBeans Platform application. Choose File > New Project (Ctrl+Shift+N). Under Categories, select Samples | JavaFX. Under Projects, select SwingInterop. image::images/swinginterop-1.png[] Click Next. In the Name and Location panel, specify where the project should be stored: image::images/swinginterop-2.png[] Click Finish. Browse through the structure of your new application: image::images/swinginterop-3.png[] Right-click the application and choose Run. You should now see the following: image::images/swinginterop-4.png[] Change the first value in the 2008 table and press Enter. Notice that the chart is animated while the value changes. For the application we’re going to create, we don’t need the "Web Browser" tab. Let’s modify the sample application so that we have exactly the code we need. All the changes below apply to the class SwingInterop.java, because we can use SampleTableModelunchanged. Delete the createBrowser()method. Delete all references to browserFxPanel, which is the JFXPanelthat embeds the JavaFX web view, which we do not need. Replace the JTabbedPaneand JSplitPanewith a JPanel.. Setting Up the Application Let’s imagine that we’re creating a stock trader application. That provides a desktop client scenario where JavaFX charts would be useful to integrate. Choose File > New Project (Ctrl+Shift+N). Under Categories, select NetBeans Modules. Under Projects, select NetBeans Platform Application: image::images/new-app-1.png[] Click Next. In the Name and Location panel: In the Project Name field, type StockTraderClient. In the Project Location field, change the value to any directory on your computer where the application will be stored. Click Finish. The IDE creates the StockTraderClient project: You’re now ready to create a module where you’ll embed the JavaFX chart into a TopComponent . Embedding a JavaFX Chart in a TopComponent We begin by creating a new module. Then we use the New Window wizard to create a new TopComponent . We round off the section by moving the code from the Swing Interop sample into the TopComponent . Create the Module In this section, you use the New Module wizard to create a new module. Right-click the Modules node and choose Add New. The module we’re creating is going to contain the core functionality of the application. Ultimately, there’ll be many modules that will be optional, such as a range of charting windows, while this module will always remain essential to the application. Hence, we will name this module Core: image::images/new-module-2.png[] Click Next. We imagine that we own a URL stocktrader.org, which means that that URL is unique. Turning the URL around, we arrive at the prefix of the code base for all our functionality modules. Next, in this particular case, we add core, since that is the name of our module and so we have org.stocktrader.coreas the unique identifier of our module: image::images/new-module-3.png[] Click Finish. We now have a new module in our application, named Core . Create the TopComponent In this section, you use the New Window wizard to create a new window. Right-click the org.stocktrader.corepackage and choose New | Other. In the Module Development category, choose Window: image::images/new-window-1.png[] Click Next. In the Window Position drop-down, choose "editor". Select "Open on Application Start": image::images/new-window-2.png[] Click Next. Type "Core" as class name prefix: image::images/new-window-3.png[] Click Finish. We now have a new window in our application, named CoreTopComponent , together with libraries that are the dependencies required by CoreTopComponent . Port the JavaFX Chart In this section, you move the useful parts of the Swing Interop sample into your Core module. Copy the SampleTableModel.javafile into the org.stocktrader.corepackage. Do so by copying the class, right-clicking on the package where you want to copy it to, and choosing Paste | Refactor Copy and then clicking the Refactor button. Copy the fields at the top of the SwingInterop.javafile to the top of the TopComponent. Copy the methods createScene, createBarChart, and DecimalFormatRendererinto the body of the TopComponent. Copy the initmethod into the TopComponentand change SwingInterop.DecimalFormatRendererto DecimalFormatRenderer. Change the constructor of the TopComponentto set the layout and to call the initmetod, as follows, that is, by adding the two highlighted lines below: public CoreTopComponent() { initComponents(); setName(Bundle.CTL_CoreTopComponent()); setToolTipText(Bundle.HINT_CoreTopComponent()); *setLayout(new BorderLayout()); init();* } Right-click the application, choose Run, and the application starts up, showing the JavaFX chart, together with the JTablethat controls it: image::images/result-1.png[]. Splitting the Table from the Chart. Create the Stock Trader API Module In this section, you create a new module for the SampleTableModel class. You expose the package containing the class and you set a dependency on it in the Core module. Right-click on the StockTraderClient’s Modules node and choose Add New. Create a new module, named StockTraderAPI. When you click Next, set org.stocktrader.apias the code name base for the module. Click Finish and you will have a new module, named StockTraderAPI. In the Core module, right-click on SampleTableModeland choose Cut. Next, in the StockTraderAPI module, right-click on the org.stocktrader.apipackage and choose Paste | Refactor Copy and then click Refactor. The class is moved into the new package, while it’s package statement has been updated. Create a new Java class named StockTraderUtilitiesin the org.stocktrader.apipackage. In this class, create a method that will ensure that only one instance of SampleTableModelis made available: package org.stocktrader.api; public class StockTraderUtilities { private static SampleTableModel stm = null; public static SampleTableModel getSampleTableModel() { if (stm == null){ return stm = new SampleTableModel(); } else { return stm; } } } Right-click on the StockTraderAPI project node and choose Properties. In the Project Properties dialog, click the API Versioning tab. Then put a checkmark next to the package containing the classes that you want to expose to the rest of the application, as shown below: Click OK. Now the package containing our classes has been exposed to the rest of the application. In the Core module, right-click on Libraries node and choose Add Module Dependency. Set a dependency on the StockTraderAPI. Create the Bar Chart Module. Right-click on the StockTraderClient’s Modules node and choose Add New. Create a new module, named BarChart. When you click Next, set org.stocktrader.chart.baras the code name base and "Chart - Bar" as the display name. Click Finish and you will have a new module, named "Chart - Bar", which we will refer to below as the "bar chart module". Right-click on the bar chart module’s Libraries node and choose Add Module Dependency. Set a dependency on the StockTraderAPI module, so that the bar chart module will have access to the table model. In the bar chart module, use the New Window wizard to create a new window in the editor position, which should open at start up, with BarChartas the class name prefix. Open CoreTopComponentand BarChartTopComponentand do the following: Move the methods createSceneand createBarChartinto the BarChartTopComponent. DecimalFormatRendererand all references to it. We’ll not use it at the moment, since it’s not directly relevant to the application we’re creating. Move the fields chartFxPaneland chartinto the BarChartTopComponent. Copy the field tableModelinto the BarChartTopComponentbecause both TopComponentswill need to have access to this class. In CoreTopComponent, clean up the initmethod, so that it only contains the code that you actually need:(); } }); } `` link:. In BarChartTopComponent, add these lines to the end of the constructor, to set the layout and call the initmethod: setLayout(new BorderLayout()); init(); In CoreTopComponent, change the @TopComponent.Registrationso that "mode" is set to "output", instead of "editor". That way, our table will be displayed at the bottom of the application frame, while the chart will be displayed in the editor area, which makes for a better appearance. Right-click the application, choose Run, and the application starts up, showing the JavaFX chart, together with the JTablethat controls it. This time, however, the table and the chart are in separate windows, though they’re able to interact because they share a common table model: image::images/result-2.png[]. Plugging in New Charts. Create the Pie Chart Module In this section, you create a module containing a TopComponent where you will embed the JavaFX pie chart. The module will need to have access to the JavaFX classes, as well as to the Stock Trader API. Right-click on the StockTraderClient’s Modules node and choose Add New. Create a new module, named PieChart. When you click Next, set org.stocktrader.chart.pieas the code name base and "Chart - Pie" as the display name. Click Finish and you will have a new module, named "Chart - Pie", which we will refer to below as the "pie chart module". Right-click on the bar chart module’s Libraries node and choose Add Module Dependency. Set a dependency on the StockTraderAPI module, so that the pie chart module will have access to the table model. 1. In the pie chart module, use the New Window wizard to create a new window in the explorer position, which is the left-most window in the NetBeans Platform, which should open at start up: Click Next and set PieChart as the class name prefix. Click Finish. Copy the code you added to the BarChartTopComponentinto the PieChartTopComponent. However, instead of a bar chart, you now want to create a pie chart:; } Run the application and notice that you now have a pie chart and that, when you make changes to the table, the pie chart animates together with the bar chart: image::images/result-4.png[] Create the Area Chart Module In this section, you create a module containing a TopComponent where you will embed the JavaFX area chart. Follow all the steps in the previous section, using "AreaChart" as the project name, org.stocktrader.chart.areaas the code name base, and "Chart - Area" as the display name. Add dependencies on the Stock Trader API. Use the New Window wizard to create a new TopComponent, in the properties position, which should open at start up. Copy the code you added to the BarChartTopComponentinto the AreaChartTopComponent. However, instead of a bar chart, you now want to create an; } Run the application and notice that you now have three charts that, when you make changes to the table, all change simultaneously: image::images/result-5.png[] The tutorial is complete. You have created a modular application on the NetBeans Platform, while making use of JavaFX chart technology.
https://netbeans.apache.org/tutorials/nbm-javafx.html
CC-MAIN-2021-17
refinedweb
1,949
57.87
31 August 2011 23:18 [Source: ICIS news] HOUSTON (ICIS)--US propylene inventories rose by 2.6% in the fourth week of August despite a drop in operating rates at US refineries, Energy Information Administration (EIA) data revealed on Wednesday. Refinery-sourced propylene inventories stood at 2.347m bbl in the week ended 26 August, up from 2.288m bbl a week earlier, according to EIA data. US refineries operated at 89.2% of capacity last week, down from 90.3% in the week ended 19 August, the government said. EIA figures refer to non-fuel use propylene, which is intended for petrochemical manufacturing. Refinery-grade propylene (RGP) for September traded at 68.375 cents/lb ($1,507/tonne, €1,040/tonne) on Tuesday, unchanged from a week earlier. ?xml:namespace> ($1 = €0
http://www.icis.com/Articles/2011/08/31/9489276/us-propylene-stocks-rise-by-2.6-despite-slower-refinery-rates.html
CC-MAIN-2014-52
refinedweb
133
53.17
Archive for January 2009 An introduction to WPF with IronPython I was wondering how easy it would be to create a simple WPF app that was written in IronPython. I found this article that made it look simple. Then I found this series on DevHawk that goes into more detail. Having scanned a few pages, I decided to create a very simple app that included databinding and an event handler. Armed with Notepad++, XamlPad and a command prompt I set out. First step was a little C#. I created a class as detailed here that adds a little dynamic-ness to WPF. More info on that magic here. The class is simple enough: using System; using System.Windows; using Microsoft.Scripting.Runtime; [assembly: ExtensionType( typeof(FrameworkElement), typeof(Sample.Scripting.FrameworkElementExtension))] namespace Sample.Scripting { public static class FrameworkElementExtension { [System.Runtime.CompilerServices.SpecialName] public static object GetBoundMember(FrameworkElement e, string n) { object result = e.FindName(n); if (result == null) { return OperationFailed.Value; } return result; } } } References to WindowsBase, PresentationFramework, PresentationCore, Microsoft.Scripting, Microsoft.Scripting.Core and Microsoft.Scripting.ExtensionAttribute were required to compile it. Once compiled I dropped it (and the other dlls in the bin folder) into a subfolder called lib of the folder I’d created for my Python files. Next step was to create a simple UI in XAML. Here it is: <Window xmlns="" xmlns: <StackPanel> <Label>Iron Python and WPF</Label> <ListBox Grid. <ListBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Path=title}" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </StackPanel> </Window> With the XAML created – and saved as Main.xaml – I wrote a simple class to hold data (you can spot from the XAML that it’s going to have a title attribute.) Here’s the first bit of Python code: class Entry(object): def __init__(self, title, description): self.title = title self.description = description The key thing here is to make the class inherit from object – without it the databinding will fail to find the title attribute. I unimaginatively called this file Entry.py. Time to tie it all together. Here’s the Python code that does just that: import clr from Entry import Entry clr.AddReferenceToFileAndPath("lib/WpfExtension.dll") clr.AddReferenceByPartialName("PresentationCore") clr.AddReferenceByPartialName("PresentationFramework") clr.AddReferenceByPartialName("WindowsBase") clr.AddReferenceByPartialName("IronPython") clr.AddReferenceByPartialName("Microsoft.Scripting") from System.IO import File from System.Windows.Markup import XamlReader from System.Windows import Application def listbox1_OnSelectionChanged(self, event): for item in event.AddedItems: print item.title titles = [Entry("Book", "Great For reading"), Entry("Shelf", "Ideal for storing stuff"), Entry("Cupboard", "Store and hide stuff")] file = File.OpenRead('Main.xaml') window = XamlReader.Load(file) window.listbox1.SelectionChanged += listbox1_OnSelectionChanged window.listbox1.ItemsSource = titles Application().Run(window) You can see I called the C# code I compiled WpfExtension.dll. The interesting stuff here is the event handler and the way it’s hooked up – looks familiar if you’ve done any .NET development. I called this file main.py. To run it, type ipy main.py at a command prompt in the folder where the python code (and XAML) is saved. So, it doesn’t do anything useful, but I can see the potential here. It feels like a very natural extension of WPF to the dynamic world – there are no clunky workarounds or bodges, it’s as you’d think it should be. Looking forward to trying some more stuff out now I’ve got the basics covered. Who are you? Over the last month or so I’ve been intrigued at how there seems to be a surge of interest in Twitter, which has been accompanied by an influx of celebrities and pretend celebrities. The ensuing, predictable twaffic trying to establish if each of the neweeters is who they claim to be is interesting as it demostrates just how tricky a subject identity can be. What is also interesting is the way this problem has been resolved: Jonathan Ross, having established his identity (with photographs on Twitpic) beyond the doubt of most of the tweeple, has been acting as a trusted third party who verifies the claims of the new entrants to the twitterverse by ringing them or emailing them directly. Oh, and for those interested in twerminology take a look here, here and here. Ruby Tuesday #25 : Automating Office OK, so technically it’s not Tuesday. But I took Monday off, so today feels like Tuesday. Getting back to Ruby, I wondered if you could use it to script tasks in Office. A quick search not only revealed that you can, but there’s a blog that covers using Ruby on Windows that has a lot of examples and information about automating Office with Ruby. Unfortunately, I haven’t had a chance to try any of the code out yet. I’ll have to remedy that.
https://remark.wordpress.com/2009/01/
CC-MAIN-2020-29
refinedweb
792
50.63
Data Types in C++. Different data types have different size in memory depending on the machine and compilers. These also affect the way they are displayed. The ‘cout’ knows how to display a digit and a character. There are few data types in C++ language. These data types are reserved words of C++ language. The reserve words can not be used as a variable name. Let’s take a look into different data types that the C++ language provides us to deal with whole numbers, real numbers and character data. Whole Numbers The C++ language provides three data types to handle whole numbers. - int - short - long int Data Type The data type int is used to store whole numbers (integers). The integer type has a space of 4 bytes (32 bits for windows operating system) in memory. And it is mentioned as ‘int’ which is a reserved word of C++, so we can not use it as a variable name. In programming before using any variable name we have to declare that variable with its data type. If we are using an integer variable named as ‘i’, we have to declare it as int i ; The above line is known as declaration statement. When we declare a variable in this way, it reserves some space in memory depending on the size of data type and labels it with the variable name. The declaration statement int i ; reserves 4 bytes of memory and labels it as ‘i’. This happens at the execution time. Example Program # 01 Let’s consider a simple example to explain int data type. In this example we take two integers, add them and display the answer on the screen. The code of the program is written below. #include <iostream.h> main() { int x; int y; int z; x = 5; y = 10; z = x + y; cout << "x = "; cout << x; cout << " y="; cout << y; cout << " z = x + y = "; cout << z; } The first three lines declare three variables x, y and z as following. int x; int y; int z; These three declarations can also be written on one line. C++ provides us the comma separator (,). The above three lines can be written in a single line as below int x, y, z; As we know that semicolon (;) indicates the end of the statement. So we can write many statements on a single line. In this way we can also write the above declarations in the following form int x; int y; int z; For good programming practice, write a single statement on a single line. Now we assign values to variables x and y by using assignment operator. The lines x = 5; and y = 10 assign the values 5 and 10 to the variables x and y, respectively. These statements put the values 5 and 10 to the memory locations labeled as x and y. The next statement z = x + y; evaluates the expression on right hand side. It takes values stored in variables x and y (which are 5 and 10 respectively), adds them and by using the assignment operator (=), puts the value of the result, which is 15 in this case, to the memory location labeled as z. Here a thing to be noted is that the values of x and y remains the same after this operation. In arithmetic operations the values of variables used in expression on the right hand side are not affected. They remain the same. But a statement like x = x + 1; is an exceptional case. In this case the value of x is changed. The next line cout << “ x = “ ; is simple it just displays ‘ x = ‘ on the screen. Now we want to display the value of x after ‘x =’. For this we write the statement cout << x ; Here comes the affect of data type on cout. The previous statement cout << “x = “ ; has a character string after << sign and cout simply displays the string. In the statement cout << x; there is a variable name x. Now cout will not display ‘x’ but the value of x. The cout interprets that x is a variable of integer type, it goes to the location x in the memory and takes its value and displays it in integer form, on the screen. The next line cout<< ”y =”; displays ‘ y = ‘ on the screen. And line cout << y; displays the value of y on the screen. Thus we see that when we write something in quotation marks it is displayed as it is but when we use a variable name it displays the value of the variable not name of the variable. The next two lines cout << “z = x + y = ”; and cout << z; are written to display ‘z = x + y = ’ and the value of z that is 15. Now when we execute the program after compiling, we get the following output. x = 5 y = 10 z = x + y = 15 short Data type We noted that the integer occupies four bytes in memory. So if we have to store a small integer like 5, 10 or 20 four bytes would be used. The C++ provides another data type for storing small whole numbers which is called short. The size of short is two bytes and it can store numbers in range of -32768 to 32767. So if we are going to use a variable for which we know that it will not increase from 32767, for example the age of different people, then we use the data type short for age. We can write the above sample program by using short instead of int. Example Program # 02 #include <iostream.h> main() { short x; short y; short z; x = 5; y = 10; z = x + y; cout << "x = "; cout << x; cout << " y="; cout << y; cout << " z = x + y = "; cout << z; } long Data Type On the other side if we have a very large whole number that can not be stored in an int then we use the data type long provided by C++. So when we are going to deal with very big whole numbers in our program, we use long data type. We use it in program as: long x = 300500200; Real Numbers The C++ language provides two data types to deal with real numbers (numbers with decimal points e.g. 1.35, 735.251). The real numbers are also known as floating point numbers. - float - double float Data Type To store real numbers, float data type is used. The float data type uses four bytes to store a real number. Here is program that uses float data types. Example Program # 03 #include <iostream.h> main() { float x; float y; float z; x = 12.35; y = 25.57; z = x + y; cout << " x = "; cout << x; cout << " y = "; cout << y; cout << " z = x + y = "; cout << z; } double Data Type If we need to store a large real number which cannot be store in four bytes, then we use double data type. Normally the size of double is twice the size of float. In program we use it as: double x = 345624.769123; char Data Type So far we have been looking on data types to store numbers, In programming we do need to store characters like a,b,c etc. For storing the character data C++ language provides char data type. By using char data type we can store characters in variables. While assigning a character value to a char type variable single quotes are used around the character as ‘a’. Example Program # 04 #include <iostream.h> main() { char x; x = 'a'; cout << "The character value in x = "; cout << x; }
https://tutorialstown.com/data-types-in-cpp/
CC-MAIN-2018-17
refinedweb
1,260
79.8
Code. Collaborate. Organize. No Limits. Try it Today. This article presents a little tool that we made for maintenance of native console applications, DLLs, device drivers and other non-GUI program components. Developers often have to add a resource script (.rc) to these components, only because of a version info resource. Text strings in the version resource often need to be changed, and the version number has to be kept in sync. All this is boring and error prone - especially these days, when the version info resources are created automatically for Visual C# apps. This utility allows adding or modifying the version information whenever needed - in the process of building components, or anytime later. The build process can be simplified, because modules that are common to multiple products, OEM versions and are customized only in the version information, can be built only once. More to this patching of the version information and some other resource data can be done without access to the code and build environment, so this task can be delayed to the post-build release and packaging steps. For example, marketing or field engineering can easily edit information visible in Windows Explorer and certain resources (such as manifests), without requesting help from developers. This saves time and eliminates possible errors. The example below modifies file version information of foo.dll in one simple command: verpatch foo.dll "1.2.3.4 my special build" A sample scripts included in the source show how to set version information on many files at once, and how to specify all version info elements. Since the tool is provided in source form, you can easily tweak it to the specific requirements of your products and build procedures. The code also demonstrates use of Win32 API for native resources and PE image manipulations. The Version Information resource contains the information visible in the Windows Explorer when you view properties of program files. As shown on the pictures above, Explorer of WinXP displays all strings in the version info; in newer Windows versions, only few elements are displayed for the same file. However, all the data in the version resource still can be accessed via the Win32 API (GetFileVersionInfo, GetFileVersionInfoEx, VerQueryValue). GetFileVersionInfo GetFileVersionInfoEx VerQueryValue The traditional way of providing this data for native modules is adding a native resource script (.rc file) to the project, adding a VS_VERSION_INFO resource to the .rc file, compiling it with the Resource Compiler and linking to the binary. This method requires providing all the details of the version info: the file version number, the final name of the file, product name and version, etc. - which may not be known at the build time yet. A .RC file often requires complicated C macros and additional include files. VS_VERSION_INFO Anyway, writing version resources by hand is not the best way to spend developer's time, and can be avoided. The version resource data consists of a "binary" data structure, and array of text string pairs (key and value). In other words, it is kind of a manifest from a pre-.NET, pre-XML era. Executables produced by some .NET compilers have a version info attribute AssemblyVersion. This is a 4-part number, like File Version and Product Version, but it is not duplicated in the binary part of the version resource, and can differ from the actual assembly version, as .NET tools see it. AssemblyVersion We could not find a formal schema for string attributes data in the version resource, however. Some of the elements are "well known" (such as created by Visual Studio and recognized by Windows Explorer). One notorious thing about the version info resource is that two string attributes, FileVersion and ProductVersion, should be text representation of same fields in the binary part. In reality, they may differ, causing confusion. FileVersion ProductVersion In Vista and Windows 7, Windows Explorer displays only few of these attributes; others are not visible to end user. The displayed file version number is taken from the binary part of version structure. Comments, Private Build, Special Build attributes, created by Visual Studio are not displayed. If information in these strings should be visible to the end user, consider moving it to elements that remain visible (File description, Product name). You can modify this tool to automatically reformat version information on your program files, without rebuilding them, so that the version information appears in the best way on the latest Windows OS. The version info can possibly depend on contents of the file itself, or various manifests attached to the file, or it's debug information (the .pdb file) - but we'll leave this as an exercise for the reader. Some installers, self-extracting archives and other applications are known to append extra data to executable files. Such data is not a resource, but simply appended to the PE file, for example as by command copy /b file.exe + data file2.exe. The program detects such extra data, saves it and appends again after modifying resources. However, the way the data is restored may be not compatible with all these applications. Please, verify that executable files that contain extra data work correctly after modification. copy /b file.exe + data file2.exe The code to save the extra data (pExtras.c,h) has been contributed by reader Rob from UK, for executables created with BBC Basic (BB4W). Note that any modification of a PE file breaks its checksum or other integrity envelope, such as digital signature. The tool will automatically fix the checksum (which is required for kernel drivers and protected DLLs), but will not repair signatures. It should be used as the last touch before signing the application files and building packages for deployment. The code is provided as a Visual C++ 2008 (or Express) project. We don't provide a precompiled executable, because it can be easily built from the source. You can just compile the utility and run - it is quite useful, even with the limitations mentioned below. The command line options and usage instructions are described in the readme.txt file with the sources. The tool "as is" supports two main usage scenarios: In the first case, all version info details can be provided as command line arguments, and the missing details will be filled by defaults. In the second case, the version resource is attached to the binary at build time. Some version info details (file version, special build description) are set later, using this tool. Since the command line for a complete version info may be too long, it is better to run verpatch from a batch file, or your favorite script language. The script can contain all the version details, or get them from somewhere else, for example, as described here. rem Example 2: run verpatch to create version info for foodll.dll set VERSION="1.2.3.4 (%date%)" set FILEDESCR=/s desc "sample foodll description" set BUILDINFO=/s pb "Built by %USERNAME%" set COMPINFO=/s company "sample company" /s (c) "(c) Sample copyleft 2009" set PRODINFO=/s product "sample product" /pv "1.0.22.33" verpatch /va foodll.dll %VERSION% %FILEDESCR% %COMPINFO% %PRODINFO% %BUILDINFO% Of course, using a script, you can update many files at once. Below is the "classic" RC source of version resource created by verpatch with options above (to produce this output, run verpatch on the sample DLL file again, with switches /vo /xi ). It even can be compiled with RC. 1 VERSIONINFO FILEVERSION 1,2,3,4 PRODUCTVERSION 1,0,22,33 FILEFLAGSMASK 0X3FL FILEFLAGS 0L FILEOS 0X40004L FILETYPE 0X2 FILESUBTYPE 0 BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "FileVersion", "1.2.3.4 (10-Jun-2009)" VALUE "ProductVersion", "1.0.22.33" VALUE "OriginalFilename", "foodll.dll" VALUE "InternalName", "foodll.dll" VALUE "FileDescription", "sample foodll description" VALUE "CompanyName", "sample company" VALUE "LegalCopyright", "(c) Sample copyleft 2009" VALUE "ProductName", "sample product" VALUE "PrivateBuild", "Built by username" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x0409, 0x04B0 END END The program is written in very simple C++. It can be compiled with Visual C++ 2005 or 2008 Express, does not depend on MFC, ATL or anything else. The UpdateResource API allows adding or replacing native resources of a program file, without recompiling or re-linking. This is what we use to accomplish the task. Since the format of VS_VERSION structure is not likely to change, and is documented in MSDN, we do our own parsing of this structure and do not depend on the Resource compiler. UpdateResource VS_VERSION The program ensures that the file and product version numbers are identical in the binary part of the version structure and in the strings. You only need to specify the numbers once. Other capabilities, besides of import and export of version resources, that are worth mentioning: imagehlp Some adjustments in this utlity have been made to support the Semantic Versioning (), just because it seems interesting. According to this spec, a version number has three parts (not four) and optional string suffix separated by '-' or '+' character (a space is not a valid separator). Example: 1.2.3-some.thing.1234 Verpatch accepts file and product version in this format, if a new swith /high is specified. Then, the three parts of the version number are interpreted properly, and the version string is preserved in the string part of the version resource (however, users will not see this text in the Windows Explorer, as explained above). If /high not specified, verpatch behaves as before v.1.0.9, for compatibility. Please see the readme file for syntax details. The most serious limitation is the lack of support for languages in the version parsing and generating code, but this should be easy to fix. I have not done this, because this was not needed for my kind of projects. Old (non-Unicode) or strange formats of version resources are not handled properly and will probably break the parser. Please note that cool C++ coding style, strings or memory management are not subjects of this article. We'd like to port this utility to C# for easier integration for modern .NET build tools, Powershell and so on. This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL) $filename = "c:\path\my-dotnet.dll" $Myasm = [System.Reflection.Assembly]::Loadfile($filename) $Aname = $Myasm.GetName() $Aver = $Aname.version # Display result: "Assembly name: {0} Assembly version: {1}" -f $Aname.name, $aver using namespace System; using namespace System::IO; using namespace System::Reflection; int main(array<System::String ^> ^args) { if(args->Length <= 0) return 1; String^ filename = Path::GetFullPath(args[0]); Assembly^ a = Assembly::LoadFile(filename); AssemblyName^ aname = a->GetName(); Console::WriteLine(aname->Version->ToString()); return 0; } // Add in CERTIFICATE data if it exists. // It comes at the end of the file if there isn't a .debug section. if (im.FileHeader->OptionalHeader.NumberOfRvaAndSizes > 5) { PIMAGE_OPTIONAL_HEADER pOptionalHeader = &im.FileHeader->OptionalHeader; if (pOptionalHeader->NumberOfRvaAndSizes > 5 && endOfImage < pOptionalHeader->DataDirectory[4].VirtualAddress + pOptionalHeader->DataDirectory[4].Size) { // TODO: Warn about invalidating CERTIFICATE data if we're updating the file endOfImage = pOptionalHeader->DataDirectory[4].VirtualAddress + pOptionalHeader->DataDirectory[4].Size; } } if ( _tcsicmp( pdot_ext, _T(".exe") )) fvd->dwFileType = VFT_APP; if ( _tcsicmp( pdot_ext, _T(".sys") )) fvd->dwFileType = VFT_DRV; if ( _tcsicmp( pdot_ext, _T(".dll") )) fvd->dwFileType = VFT_DLL; if ( 0 == _tcsicmp( pdot_ext, _T(".exe") )) fvd->dwFileType = VFT_APP; if ( 0 == _tcsicmp( pdot_ext, _T(".sys") )) fvd->dwFileType = VFT_DRV; if ( 0 == _tcsicmp( pdot_ext, _T(".dll") )) fvd->dwFileType = VFT_DLL; General News Suggestion Question Bug Answer Joke Rant Admin Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages. C# 6: First reactions
http://www.codeproject.com/Articles/37133/Simple-Version-Resource-Tool-for-Windows?msg=4076068
CC-MAIN-2014-15
refinedweb
1,933
55.64
Music, Haskell... and Westeros Music Music is a recurring theme on my blog. Quod Libet takes up a fair bit of spare time, but the more abstract intersection of music and programming is fun, and it turns out functional programming has a lot to offer in this space. I assume some basic knowledge of Haskell / Elm (or ML-like languages perhaps), but a minimal amount of music knowledge. Enter Euterpea Euterpea is a great music DSL for Haskell, with a long lineage based at Yale and around the late Paul Hudak’s Haskell School Of Music. I won’t try to explain its wide remit and concepts, but definitely worth reading some introductions. We’ll be focusing on the composition (music) rather than synthesis (audio) side. There are a few other projects around (even in Haskell alone). One that looks particularly interesting, for more electronic / sample / dance-based work is Tidal Cycles, but we’re going to concentrate on Euterpea here. Where now? Rather than algorithmic generation of music, I became interested in how far this library could be used to create or recreate, say, Western popular music (for a start) by hand, but in a concise and readable way. The ability to use General MIDI seemed of limited value, but having set up Timidity it became clear bog-standard software synths have come a long way since, err, the late 90s, and this is a quick, free solution for creating passable music without specialist hardware or software. Interesting… The history of trackers Talking of the late 90s, some readers will be too young to remember Trackers on the Amiga / ST / DOS from then, so a quick recap! These were nearly all: • non-notated (i.e. no traditional music score) • sample-based (you could provide your own lo-fi instrument sounds) • tabular based on discrete time-steps, like a spreadsheet of sorts with channels as columns and time steps (1/8th of a note) as … Playback would going down the screen • declarative (not recorded, or err, generative maybe). Entries (notes) looked like C 4 A0, or similar, meaning C in the 4th octave with a volume of 0xA0 or 160/256 • embedded metadata (such as BPM, vibrato, dynamics) into individual notes Some of this experience is simply outdated by newer GUIs and advanced MIDI Sequencers, though for dance music / drum machines, similar interface persist. ...and some drawbacks The ability to replicate entire sections in trackers was usually available in some way, but without any variation. What was completely lacking was the ability to re-use individual channels or phrases, or apply transformations (transpose, make louder or quieter, change instrument) to pre-existing parts. In fact, this problem is sounding a lot like bad codebases, especially ones that don’t employ DRY. As developers, we’ll usually try to refactor: extracting common code to methods, building abstractions (even just functions that operate on data) and using generic types to write algorithms that can be independent of the data structure. In functional programming these are even more important, and generic datatypes, type classes, higher-order functions and lazy evaluation allow us to do take these principles further. Could these somehow be applied to music? Euterpea basics The Euterpea quick reference guide is a very useful one-pager, and the SimpleMusic examples was helpful to get started. But here’s a very quick summary from the high level: Music a = Prim (Primitive a) -- primitive value | Music a :+: Music a -- sequential composition | Music a :=: Music a -- parallel composition | Modify Control (Music a) -- modifier deriving (Show, Eq, Ord) And the Primitive datatype is defined: Primitive a = Note Dur a | Rest Dur deriving (Show, Eq, Ord) • Dur, the duration for notes / rests is a Rational alias, so you’re not restricted to any particular quantisation of notes. Yes, this means it’s easy to do all sorts of polyrhythms, but more on that later (or not – we’re aiming for simple timing here). • Control is to apply transformations (dynamics, tempo adjustments) to other music sections, a powerful concept modelled very simply. • Both Music and Primitive are Functors, though this isn’t important right now. Getting started Well, it’s no fun just talking about this. How about we make some noise? Setting up the project Most of the snippets below should be run interactively in GHCI (using stack repl), but it’s best to have a Stack project set up already, so do that now (or use my euterpea-sandbox one). Here’s the interesting bits from my stack.yaml to get you started: - Euterpea-2.0.2 - PortMidi-0.1.5.2 - Stream-0.4.7.2 - arrows-0.4.4.1 - heap-0.6.0 - lazysmallcheck-0.6 - stm-2.4.2 resolver: lts-9.0 The Cabal file just needs Euterpea > 2.0.0 && < 2.1.0. I’ve put the full source on Github if you’re feeling lazy. Set up MIDI The Euterpea guide to MIDI output is as good as any. If you’re on Linux I strongly recommend Timidity unless you have hardware synths of course. The FreePats samples are a good start (but don’t cover all GM instruments). For detailed setup, the Arch Linux Timidity page is good too, especially if you want to set Timitidy to run by default. For OS X users, SimpleSynth is recommended, but I haven’t tried it myself. Windows users shouldn’t have too many problems with the default setup I believe. Run your MIDI synth Make sure your synth (see above) is running. FYI, I use timidity -iA -Os -f -A 210 –verbose=2 in a separate shell. Note what channel your MIDI synth now running on (mine is usually 4). Make some noise! If we load GHCI (with stack repl), we can play around live: import Euterpea λ> devices Input devices: InputDeviceID 1 Midi Through Port-0 InputDeviceID 3 Scarlett 2i4 USB MIDI 1 Output devices: OutputDeviceID 0 Midi Through Port-0 OutputDeviceID 2 Scarlett 2i4 USB MIDI 1 OutputDeviceID 4 TiMidity port 0 OutputDeviceID 5 TiMidity port 1 OutputDeviceID 6 TiMidity port 2 OutputDeviceID 7 TiMidity port 3 λ> channel = 4 -- Or whatever works for you λ> playDev channel $ c 4 wn Woah – some sound! More precisely, an acoustic grand piano playing middle C for a whole note ( wn)… in 4/4 at 120bpm, assuming the usual defaults. Remember to choose the right output channel for your setup for that playDev. Writing music Composing partsThe two fundamental operations for composing (in the FP sense) sounds are • :=:, which plays them in parallel, i.e. together. • :+:, which plays them in sequence, i.e. one thing after another. Wait… :=: means lots of notes played together? Even the non-musicians will recognise this one – that’s a chord. And yes, there’s a list helper function for that: chord, as lists are generally easier to type or manipulate. Try this in your REPL: cMinor = chord [c 3 qn, ef 3 qn, g 3 qn] λ> cMinor' = c 3 qn :=: ef 3 qn :=: g 3 qn λ> print cMinor Prim (Note (1 % 4) (C,3)) :=: (Prim (Note (1 % 4) (Ef,3)) :=: (Prim (Note (1 % 4) (G,3)) :=: Prim (Rest (0 % 1)))) λ> playDev channel cMinor Cool! So we can see the internal representation of this, noting the zero-length rest at the end, and how it mirrors list construction where x : [] == [x]. This is why cMinor ≠ cMinor' even though it probably should. Let’s try some more. The line function is the equivalent helper for :+: – it takes a list and composes the elements sequentially, like moving right in piece of notated music (or down in a tracker). playDev channel $ line [c 3 qn, e 3 qn, g 3 qn, bf 3 qn] A nice C7 arpeggio – note that we’re using qn for quarter notes (aka a crotchet in music theory). Infinite music Just to spice things up a bit, what if we make… an infinite piece of music? I mean, Haskell is a non-strict (≅“lazy”) language, right? So we can use the line operator on infinite lists as well, and we’ll have some infinite Music a. Let’s use the standard cycle list function to repeat our arpeggio forever and see what we get. For display we can avoid printing the infinite list by using Euterpea’s cut function, which limits a piece of Music to the specified number of beats. arpeggio = line $ cycle [c 3 qn, e 3 qn, g 3 qn, bf 3 qn] λ> print (cut 2 arpeggio) Prim (Note (1 % 4) (C,3)) :+: (Prim (Note (1 % 4) (E,3)) :+: (Prim (Note (1 % 4) (G,3)) :+: (Prim (Note (1 % 4) (Bf,3)) :+: (Prim (Note (1 % 4) (C,3)) :+: (Prim ( Note (1 % 4) (E,3)) :+: (Prim (Note (1 % 4) (G,3)) :+: (Prim (Note (1 % 4) (Bf,3) ) :+: Prim (Rest (0 % 1))))))))) If you squint a bit (or are used to LISPs…) you can see this is a series of Note Primitives, all of a 1/4 time, composed together with the :+: operator. Again, the empty element3 is visible here. Westeros Taking these basic operators, we can now easily create pieces of music. Now here’s one I made earlier (you’ll need to put this in your .hs source file, getting too big for a REPL session) It's in 3-time (3/4 or 6/8) -- so each bar lasts one dotted half note (@dhn@) melody = line [ g 3 dhn, c 3 hn, rest qn, ef 3 en, f 3 en, g 3 hn, c 3 hn, ef 3 en, f 3 en, d 3 (dwn + dhn), rest dhn, f 3 dhn, bf 2 hn, rest qn, d 3 en, ef 3 en, f 3 hn, bf 2 dhn, ef 3 en, d 3 en, c 3 dwn, rest dhn ] -- Convenient wrapper inst :: InstrumentName -> Volume -> Music Pitch -> Music (Pitch, Volume) inst i v = addVolume v . instrument i -- Repeat each element four times quadruplicate :: [a] -> [a] quadruplicate = concatMap (replicate 4) -- I always find this useful bpm = tempo . (/ 120.0) The layout for melody is slightly non-conventional, but I find spacing it like this, whilst not linear in time (like trackers), allows us to compare notes and phrases easier. The line spacing separates 4 bar sections (if you can read music, see this simplified score which helped with the above). Try reloading your REPL and doing playDev channel $ bpm 170 . inst Cello 70 $ melody! Note also because Dur is just a Rational (i.e. a Num), we can use normal arithmetic on note durations! So yes, (dwn + dhn) is a thing, and it’s, erm, 9 quarter notes (or 3 bars here) I reckon. This allows for some nice maths / shorthand in your music (and in fact pitches have similar opportunity). Add some harmony Remember, harmony is just two or more different notes playing at once, so we already have the tools to do that, Euterpea’s :=: operator. So we’ll just add a very simple sequence of bass notes changing every four bars as per the melody. chordSeq = [c 1, g 1, bf 1, f 1] -- Just the notes λ> contraBass = line $ map ($ 3) chordSeq -- 3 is 4 whole bars in 3/4 λ> song = inst Cello 70 melody :=: inst TremoloStrings 70 contraBass λ> playDev channel $ bpm 170 song ...and some rhythm That bass is pretty boring though. Really, we want some percussion, but for a quick fix, let’s try adding a little rhythm to that bass. For each bar we can repeat the one note but in a particular rhythm. rhythmFor note = [note dqn, rest en, note en, note en] λ> bass2 = line $ concatMap rhythmFor $ quadruplicate chordSeq λ> song = inst Cello 60 melody :=: inst AcouticBass 80 bass2 λ> playDev channel $ bpm 170 song Note we use concatMap to flatten, as each note in the chord sequence is mapped to a list of Music Pitch by our rhythmFor function. Summing up Hopefully lots to think about and play with there for newcomers. You should be able to see the quick turnaround that using a REPL for (simple) music can bring, just as programmers often enjoy for code, as well as the potential advantages for quickly building music pieces from smaller parts… just like with functional programming itself. I’ve definitely become very taken by the library even at this basic level. Next up Next post we’ll see investigate creating drum patterns, pushing the use of MIDI further and allowing DRY to help us create more realistic sounds from even a basic synth setup. More reading Euterpea has also been used for music students (without necessarily any programming experience) as presented in this paper. If you are interested in working with Haskell and other FP languages, check out our job-board! Originally published on declension
https://functional.works-hub.com/learn/Music-Haskell...-and-Westeros?utm_source=rss&utm_medium=automation&utm_content=teros
CC-MAIN-2020-16
refinedweb
2,129
57.4
public class BufferChangedEvent extends EventObject IBufferChangedListenernotifications. For text insertions, getOffset is the offset of the first inserted character, getText is the inserted text, and getLength is 0. For text removals, getOffset is the offset of the first removed character, getText is null, and getLength is the length of the text that was removed. For replacements (including IBuffer.setContents), getOffset is the offset of the first replaced character, getText is the replacement text, and getLength is the length of the original text that was replaced. When a buffer is closed, getOffset is 0, getLength is 0, and getText is null. IBuffer, Serialized Form source getSource, toString clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait public BufferChangedEvent(IBuffer buffer, int offset, int length, String text) buffer- the given buffer offset- the given offset length- the given length text- the given text public IBuffer getBuffer() public int getLength() 0in case of insertion). public int getOffset() public String getText() nullif text has been removed. nullin case of deletion). Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.
https://help.eclipse.org/mars/topic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/BufferChangedEvent.html
CC-MAIN-2019-51
refinedweb
182
56.35
This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project. > Ok. So either we want to disallow invariant addresses as gimple value > altogether or > do more elaborate checks, to rule out such bogus cases. At least the > transformation > PRE is doing doesn't make sense -- and I know other optimization passes > that treat is_gimple_min_invariant() values as "as cheap as constants", > which in this case surely is not true. Yes, is_gimple_min_invariant seems to be mostly used for this purpose. Note that TREE_INVARIANT is not going to be useful in an IPA world anyway for these users, if it really means that different calls to the function could produce different results. (Because it will mean it's not "constant enough" to rematerialize wherever we want, only wherever we want *inside that function*) > So maybe you can try reworking is_gimple_min_invariant to restrict this > case to where the address computation is indeed as cheap as a constant or > register value? I think that you're implicitly assuming that is_gimple_min_invariant is not a formal predicate of the GIMPLE grammar, which I agree is an interpretation of the sparse documentation. The other one is that is_gimple_min_invariant is a formal predicate of the GIMPLE grammar, for example because it is invoked in It originally was such a formal predicate. Whether it is anymore is a good question :) /* Return true if T is a GIMPLE rvalue, i.e. an identifier or a constant. */ bool is_gimple_val (tree t) { /* Make loads from volatiles and memory vars explicit. */ if (is_gimple_variable (t) && is_gimple_reg_type (TREE_TYPE (t)) && !is_gimple_reg (t)) return false; /* FIXME make these decls. That can happen only when we expose the entire landing-pad construct at the tree level. */ if (TREE_CODE (t) == EXC_PTR_EXPR || TREE_CODE (t) == FILTER_EXPR) return true; return (is_gimple_variable (t) || is_gimple_min_invariant (t)); } and is_gimple_val is a formal predicate IIUC. In this latter case, we wouldn't have much leeway and is_gimple_min_invariant should simply implement the GIMPLE grammar, i.e the CONST in val : ID | CONST This would make sense to me. Again, the fact that it catches things *other* than true constants is just by accident to most users. They certainly don't expect it :) I'm also not surprised your force_gimple_operand didn't work, since we call force_gimple_operand on the expressions we produce already :)
https://gcc.gnu.org/legacy-ml/gcc/2007-07/msg00094.html
CC-MAIN-2020-16
refinedweb
381
52.8
If you’re moving your app’s interface from under the keyboard when it appears, you’re probably doing the following: 1. Get a reference to the relevant text field in the UITextFieldDelegate‘s textFieldDidBeginEditing method. 2. Listen to a relevant keyboard notification (possibly UIKeyboardWillShow or UIKeyboardWillHide but probably the best to use is UIKeyboardWillChangeFrame, as this covers all your bases). Get the size of the keyboard from the userInfo property and move the textField up out of the way. Great, this works because when the user taps on a text field, the events occur in this order: 1. textFieldDidBeginEditing 2. UIKeyboardWillChangeFrame But then when you happen to implement a text view you’ll discover that the events occur in the opposite order: 1. UIKeyboardWillChangeFrame 2. textViewDidBeginEditing Whaaa? Well, that messes up the steps we were following – when we get the UIKeyboardWillChangeFrame notification, we don’t yet have a reference to the relevant text view to move it! How to solve this? Here are three approaches: 1. Use UIKeyboardDidChangeFrame (Did, not Will) instead, to be sure we get it in the right order. Problem – we can no longer animate interface changes simultaneously with the keyboard, rather animations will happen in sequence. 2. Store the keyboard size in a property in the UIKeyboardWillHide selector. Call a method (let’s call it moveInterface() ) after both steps that will move the interface out of the way. The moveInterface() method will only work when it has references to both the keyboard size, and the relevant text field / text view. 3. Here’s another option, thinking outside the box: The reason why we need to get a reference to the text field/view in the …didBeginEditing method, is that Apple hasn’t given us a simple way to get a reference to the current field/view being edited (also known as the firstResponder). However, Apple has given us an isFirstResponder() method that will tell you if a view is currently the fist responder. Great! We can use that method to recursively iterative through a view’s subviews and determine the current first responder. If we know the first responder, we don’t need the …didBeginEditing methods at all, and can skip straight to dealing with moving the interface when we receive the UIKeyboardWillChangeFrame notification. Here’s a UIView extension to add a computed property that returns the first responder from a view’s subviews: import UIKit extension UIView { var firstResponder:UIView? { if self.isFirstResponder() { return self } for view in self.subviews { if let firstResponder = view.firstResponder { return firstResponder } } return nil } } And here’s a UIViewController extension to get the scene’s first responder: extension UIViewController { var firstResponder:UIView? { return view.firstResponder } } […] Keyboards, text views and first responders […]
https://craiggrummitt.com/2016/07/18/keyboards-text-views-and-first-responders/?shared=email&msg=fail
CC-MAIN-2020-29
refinedweb
452
52.49
isbot 🤖/ 👨🦰 Detect bots/crawlers/spiders using the user agent string. UsageUsage import isbot from 'isbot' // Nodejs HTTP isbot(request.getHeader('User-Agent')) // ExpressJS isbot(req.get('user-agent')) // Browser isbot(navigator.userAgent) // User Agent string isbot('Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 (compatible; Googlebot/2.1; +)') // true isbot('Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36') // false Additional functionalityAdditional functionality Extend: Add user agent patternsExtend: Add user agent patterns Add rules to user agent match RegExp: Array of strings isbot('Mozilla/5.0') // false isbot.extend([ 'istat', '^mozilla/\\d\\.\\d$' ]) isbot('Mozilla/5.0') // true Exclude: Remove matches of known crawlersExclude: Remove matches of known crawlers Remove rules to user agent match RegExp (see existing rules in src/list.json file) isbot('Chrome-Lighthouse') // true isbot.exclude(['chrome-lighthouse']) // pattern is case insensitive isbot('Chrome-Lighthouse') // false Find: Verbose resultFind: Verbose result Return the respective match for bot user agent rule isbot.find('Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 DejaClick/2.9.7.2') // 'DejaClick' Matches: Get patternsMatches: Get patterns Return all patterns that match the user agent string isbot.matches('Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 SearchRobot/1.0') // ['bot', 'search'] Clear:Clear: Remove all matching patterns so this user agent string will pass const ua = 'Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 SearchRobot/1.0'; isbot(ua) // true isbot.clear(ua) isbot(ua) // false Spawn: Create new instancesSpawn: Create new instances Create new instances of isbot. Instance is spawned using spawner's list as base const one = isbot.spawn() const two = isbot.spawn() two.exclude(['chrome-lighthouse']) one('Chrome-Lighthouse') // true two('Chrome-Lighthouse') // false Create isbot using custom list (instead of the maintained list) const lean = isbot.spawn([ 'bot' ]) lean('Googlebot') // true lean('Chrome-Lighthouse') // false DefinitionsDefinitions - Bot. Autonomous program imitating or replacing some aspect of a human behaviour, performing repetitive tasks much faster than human users could. - Good bot. Automated programs who visit websites in order to collect useful information. Web crawlers, site scrapers, stress testers, preview builders and other programs are welcomed on most websites because they serve purposes of mutual benefits. - Bad bot. Programs which are designed to perform malicious actions, ultimately hurting businesses. Testing credential databases, DDoS attacks, spam bots. ClarificationsClarifications What does "isbot" do?What does "isbot" do? This package aims to identify "Good bots". Those who voluntarily identify themselves by setting a unique, preferably descriptive, user agent, usually by setting a dedicated request header. What doesn't "isbot" do?What doesn't "isbot" do? It does not try to recognise malicious bots or programs disguising themselves as real users. Why would I want to identify good bots?Why would I want to identify good bots? Recognising good bots such as web crawlers is useful for multiple purposes. Although it is not recommended to serve different content to web crawlers like Googlebot, you can still elect to - Flag pageviews to consider with business analysis. - Prefer to serve cached content and relieve service load. - Omit third party solutions' code (tags, pixels) and reduce costs. It is not recommended to whitelist requests for any reason based on user agent header only. Instead other methods of identification can be added such as reverse dns lookup. Data sourcesData sources We use external data sources on top of our own lists to keep up to date Crawlers user agents:Crawlers user agents: - user-agents.net - crawler-user-agents repo - myip.ms - matomo.org - A Manual list Non bot user agents:Non bot user agents: - user-agents npm package - A Manual list Missing something? Please open an issue full changelog)Major releases breaking changes ( Version 3 Remove testing for node 6 and 8 Version 2 Change return value for isbot: true instead of matched string Version 1 No functional change
https://www.npmjs.com/package/isbot
CC-MAIN-2022-05
refinedweb
678
52.97
note Fletch <p> I had this problem come up a while back (in fact I think it was my question that prompted the thread on fwp about it . . .). At any rate, this was something I had lying around from it that benchmarks three solutions. You can decide for yourself if the first is cheating or if you really, really care about speed. :) </p> <p> Also, note that these are returning the length of the common string not the string itself. </p> <code> #!/usr/bin/perl use Benchmark qw( cmpthese ); use Inline C => <<EOF; int comlen(char *p, char *q) { int i = 0; while( *p && (*p++ == *q++) ) i++; return i; } EOF sub comlen_or { length((($_[0]^$_[1])=~m/^(\0+)/)[0]); } sub comlen_tr { my( $t ); return ($t=$_[0]^$_[1])=~ y/\0/\0/; } $a = "abcdefghijk"; $b = "abcdefg"; cmpthese( shift || 2_000_000, { inline_c => sub { comlen( $a, $b ) }, comlen_or => sub { comlen_or( $a, $b ) }, comlen_tr => sub { comlen_tr( $a, $b ) }, }, ); exit 0; </code> 140538 140538
http://www.perlmonks.org/?displaytype=xml;node_id=140581
CC-MAIN-2015-22
refinedweb
160
67.62
remove - remove a file or directory #include <stdio.h> int remove(const char * pathname); remove() deletes a name from the filesystem.. On success, zero is returned. On error, -1 is returned, and errno is set appropriately. For an explanation of the terms used in this section, see attributes(7). POSIX.1-2001, POSIX.1-2008, C89, C99, 4.3BSD. Infelicities in the protocol underlying NFS can cause the unexpected disappearance of files which are still being used. This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at.
https://manual.cs50.io/3/remove
CC-MAIN-2021-04
refinedweb
111
61.22
RationalWiki:Articles for deletion/Archive 2015 This is a list of old deletion discussions. Newest at the top. Contents - 1 December 2015 - 1.1 Xenogender | Result: Merged with non-binary gender - 1.2 Joy of Satan (español) | Result: Deleted - 1.3 Juan Andrés Salfate (español) | Result: Deleted - 1.4 Fun:Ray Comfort | Result: Redirected - 1.5 Angela Merkel | Result: Redirect to Germany for now - 1.6 Andrea Yates | Result: Deleted - 1.7 All non-English articles | Result: Leave them be for now (some articles deleted or put up for AfD) - 1.8 RationalWiki:Articles_for_deletion/My_Little_Pony:_Friendship_Is_Magic (2nd nomination) | Result: Kept - 1.9 Timeline of Gamergate | Result: Kept (snowball clause) - 1.10 Category:Victims of medical woo | Result: Deader than the victims themselves - 1.11 Fun:Kurt Wise | Result: Wisely dead - 1.12 Rapa Nui | Result: Keep - 2 November 2015 - 2.1 Kwanzaa | Result: Keep - 2.2 Yi Deokil | Result: Deleted - 2.3 Vaccine911 | Result: Deleted - 2.4 Motte and bailey doctrine | Result: Deleted - 2.5 Chinese robber fallacy | Result: Deleted - 2.6 Frankenstein fallacy | Result: Deleted - 2.7 Sorkatonaság | Result: delete - 2.8 No platforming | Result: No consensus - 2.9 RationalWiki:Articles for deletion/EvoWiki/RationalWiki | Result: Deleted - 2.10 Chomsky rule | Result: Redirected - 2.11 Lee Siegel | Result: Deleted - 2.12 Anders Björkman | Result: Deleted - 2.13 Creation Museum Visitor's Guide | Result: Seems dead - 2.14 Oliver Canby | Result: Kept after rewrite - 2.15 Ameriwiki | Result: Merged into Wiki - 2.16 Transitioning neckbeard | Result: deleted - 2.17 Doxing | Result: Snowkeep - 2.18 Truscum | Result: Merged with Transphobia - 2.19 User:Aneris/SJWMedia | Result: Keep - 3 October 2015 - 3.1 List of scientists who became creationists after studying the evidence | Result: Keep - 3.2 My Little Pony: Friendship Is Magic | Result: Keep - 3.3 Neolithic Revolution | Result: Keep - 3.4 Scott Barnes | Result: Deleted - 3.5 Angus King | Result: Deleted - 3.6 Susan Collins | Result: Deleted - 3.7 Kim Davis | Result: Moved to Conscientious objector to same-sex marriage Same-sex marriage resistance - 3.8 Twelve-step program | Result: Redirect to Alcoholics Anonymous - 3.9 John Grant | Result: Deleted - 3.10 Biola University | Result: Keep - 3.11 Botany | Result: Merged with Biology - 3.12 Hanne Tolg Parminter | Result: Keep - 3.13 Open source | Result: Keep - 3.14 Zen and the Art of Motorcycle Maintenance | Result: Keep - 3.15 RationalWiki:Internet relay chat | Result: Deader than ARPA - 3.16 Building permit | Result: Deader than the dinosaurs - 3.17 Fun:Media | Result: Deader than traditional journalism - 3.18 Poetry | Result: Deader than Hemmingway - 3.19 Conservapedia:LA Times article of June 19, 2007 | Result: Kept as a historical artifact - 3.20 Niche | Result: Keep - 3.21 FBI biometrics database | Result: Deleted - 4 September 2015 - 4.1 Basic science | Result: Deleted, Unanimous vote. - 4.2 Ban Bossy | Result: Deleted with extreme prejudice - 4.3 Fallacy misidentification | Result: Redirected - 4.4 Science programs at Young Earth Creationist colleges | Result: - 4.5 Al Quds day | Result: deleted 10-4 - 4.6 David Blunkett | Result: Kept after expansion - 4.7 Sargon Of Akkad | Result: Deleted - 4.8 New Apologetics | Result: Keep - 4.9 Black Lives Matter | Result: Reversing course on my own reverse course: Kept 16 - 3 - 4.10 Stupidity | Result: Dead and stupid - 4.11 Takedownman | Result: Keep - 5 August 2015 - 5.1 Kristen Luman | Result: redirect to Ghost Mine - 5.2 Bat shit crazy | Result: put to sleep - 5.3 Feminist video games, now renamed | Result: Deleted - 5.4 Doug Stanhope | Result: deleted - 5.5 Oil, Smoke & Mirrors | Result: Keep - 5.6 A Crude Awakening: The Oil Crash | Result: Keep - 6 July 2015 - 6.1 Deep ecology | Result: Speedy close - even the proposer isn't proposing deletion - 6.2 Category:Extreme wingnuttery & Category:Extreme moonbattery | Result: Closed - no consensus - 6.3 EvoWiki/Terms of use | Result: deleted - 6.4 EvoWiki/Permissions | Result: deleted - 6.5 EvoWiki/Suggested uses of EvoWiki | Result: deleted - 6.6 EvoWiki/How to start using EvoWiki | Result: deleted - 6.7 EvoWiki/History | Result: deleted - 6.8 EvoWiki/Goals | Result: deleted - 6.9 EvoWiki/Help | Result: deleted - 6.10 EvoWiki/Featured articles | Result: deleted - 6.11 EvoWiki/Feedback | Result: deleted - 6.12 EvoWiki/About | Result: deleted - 6.13 EvoWiki/Editorial philosophy | Result: deleted - 6.14 EvoWiki/Community portal | Result: deleted - 6.15 EvoWiki/Vandalism | Result: deleted - 6.16 EvoWiki/Main Page | Result: deleted - 6.17 Bill Cosby | Result: deleted as trashy/dubious stub - 7 June 2015 - 7.1 Animal companions | Result: Roasted and served with a side of potatoes - 7.2 Social Justice Warrior | Result: Keep - 7.3 Gay-themed films | Result: Deleted - 7.4 Daryush Valizadeh | Result: Keep, 6-1 - 7.5 Mount Rushmore | Result: Burned to ash. - 7.6 Da moon | Result: Deleted - 7.7 College Conspiracy | Result: Keep - 7.8 Category:Woo-meisters | Result: Keep - 7.9 Nothing to hide argument | Result: keep - 8 May 2015 - 8.1 Rebuttals of Gamergate | Result: keepity keep - 8.2 Category:Pseudohistorians | Result: Moved to Category:Pseudohistory promoters - 8.3 Personality disorder | Result: Keep - 8.4 Peru | Result: Keep - 8.5 Mitochondria | Result: Kept - 8.6 H-1B Visa | Result: Delete by 4:1 (without redirect) 6:1 (with redirect) (redirected) - 8.7 Champagne socialist | Result: Kept - 9 April 2015 - 9.1 RationalWiki:Articles for deletion/Debate:Should People who make bad medical descisions be given treatment | Result: Kept - 9.2 Debate:Should People who make bad medical descisions be given treatment | Result: Kept - 9.3 Farsight | Result: Keep - 9.4 Fun:Subway diet | Result: has been rewritten to be funnier - 9.5 RationalWiki:Articles_for_deletion/Reputation.com | Result: moved to reputation management - 9.6 Wiki (português) | Result: Deleted - 9.7 RationalWiki:Chicken coop | Result: It stays, even if ruffles Weaseloid's jimmies - 9.8 Wikipédia (português) | Result: - 9.9 Rome Viharo | Result: Kept, by 10 votes to 1 - 9.9.1 - 9.9.2 Keep - 9.9.3 Goat - 9.9.4 How does Rational Wiki determine a 'crank' idea? - 9.9.5 I edited the page and reverted. Here is the context of what you're writing about as reference - 9.9.6 About Rome Viharo (by Rome Viharo) - 9.10 Request to delete, 2018 - 9.11 UNICE Global Brain Project | Result: Deleted - 9.12 Romney | Result: Deceased - 9.13 Scott Ludlam | Result: Keep - 9.14 Comedy Central - 9.15 Jack the Ripper | Result: keeper - 9.16 Disagreeing by deleting | Result: it's a joke, kids. also: moved - 9.17 Farman Nawaz | Result: Took a long walk off a short pier - 10 March 2015 - 10.1 Vagina woo | Result: Keep - 10.2 Training with Hinako | Result: Deleted - 10.3 Perpetual Motion As Its Own Science | Result: Deleted - 10.4 Ronald Levinsohn | Result: Deleted - 10.5 Hans Eysenck | Result: Keep - 10.6 Age of consent | Result: ? - 10.7 Conservation of government | Result: Deleted - 11 February 2015 - 11.1 Olavo de Carvalho (portugês) | Result: deleted at creator request - 11.2 Conservative bias | Result: Keep - 11.3 Andrew Brown | Result: Keep - 11.4 Con artist | Result: Redirected - 11.5 Category:Headbangers | Result: No need for discussion, deleted. - 11.6 Prem Rawat | Result: Severely trimmed the page - 11.7 2014 Longitude Prize | Result: Deleted - 11.8 Tom Ruffles | Result: Merged - 11.9 Identity politics | Result: SNOW keep - 11.10 Not actually a list of magic tricks | Result: Deleted - 11.11 List of minor cranks | Result: Deleted - 11.12 Rage Against the Machine | Result: delete - 11.13 Dubstep | Result: Speedily vaporized - 11.14 Life Giving Moments | Result: redirected to push poll - 12 January 2015 - 12.1 John Pack Lambert | Result: Deleted - 12.2 Caiden Cowger | Result: Deleted - 12.3 Newsmonster.co.uk | Result: Deleted - 12.4 Carly Fiorina | Result: Redirect to 2016 Republican Party presidential nomination#May run for now - 12.5 Job | Result: Redirect to Book of Job - 12.6 Scholarpedia | Result: Redirected - 12.7 Coyote | Result: Deleted - 12.8 UNTITLED | Result: ? - 12.9 Sudden outbreak of common sense | Result: Merged - 12.10 Orion's Arm | Result: Deleted - 12.11 Orangutan | Result: Merged into Primate - 12.12 Power set | Result: Deleted - 12.13 Fred Karger | Result: Keep - 12.14 Thallium | Result: Deleted - 12.15 Comparative advantage | Result: Deleted - 12.16 Quora | Result: Deleted - 12.17 Mixed economy | Result: deleted - 12.18 Anne Rice | Result: deleted - 12.19 Deceit | Result: Keep - 12.20 Pantera | Result: Keep - 12.21 Category:Slaveholders | Result: Deleted - 12.22 Non-binary gender | Result: Deleted - 12.23 Communpedia | Result: Merged - 12.24 John Duffield | Result: Deleted - 12.25 Ann McElhinney | Result: Speedy deletion - 12.26 Robot | result: DELETED - 12.27 Sluthate.com | Result: redirected December 2015[edit] Xenogender | Result: Merged with non-binary gender[edit] Delete[edit] - Strange neologism with no science to back it up. If we take the description "genders which aren't accurately described by a 'human' understanding of gender" and replace "gender" with "science", we get a description of pseudoscience. If I go here I read things like "Having a gender which is bright, celestial, and radial." wut?! Carpetsmoker (talk) 13:07, 25 December 2015 (UTC) - Pseudoscience is within our missions, yeah? Wéáśéĺóíď Methinks it is a Weasel 15:04, 25 December 2015 (UTC) - Well, my point was more that this is a bunch of nonsense, rather than a serious thing that this page tried to sell. Carpetsmoker (talk) 00:21, 26 December 2015 (UTC) - Delete: within mission but not widespread nor likely to ever be. Take a look at [1] to see where this is leading. Bongolian (talk) 18:55, 25 December 2015 (UTC) Keep[edit] - Keep it as a separate concept. Merging it with non-binary genders is a bad idea since it seems to include otherkin and other odd neoglisms which could stigmatize the idea of non-binary genders.--Owlman (talk) 18:42, 25 December 2015 (UTC) Merge/redirect[edit] - Merge with non-binary gender. |₹Λ¥$€₦₦ Masturbation masturbation pies pies Brian Cox 15:22, 25 December 2015 (UTC) - What Ray said. FuzzyCatPotato!™ (talk/stalk) 17:07, 25 December 2015 (UTC) - What Ray and Fuzzy said Hertzy (talk) 17:23, 25 December 2015 (UTC) - What, Ray, Fuzzy and Hertzy said. Bicyclewheel 17:40, 25 December 2015 (UTC) - What Bicycle, Hertzy, Fuzzy and ray said. Haha, just kidding, it's backwards get it, I just disrupted the whole chain (lol), trolled, lmfao, XD, so funny, get it? I'm dead, lol. 8/10 gr8 b8 m8. 𐌈FedoraTippingSkeptic𐌈 (talk) 17:46, 25 December 2015 (UTC) - What Bicycle, Hertzy, Fuzzy and Ray said. It's forward again [because no two of us have done it!] Anyhoo, merge and can describe as pseudoscience in context of other stuff that's not.---Mona- (talk) 19:00, 25 December 2015 (UTC) Goat[edit] - How widespread is this phrase? If it's just something a handle of Tumblr users use I think a passing mention in our non-binary gender article is probably all that's needed. Weaseloid Methinks it is a Weasel 15:10, 25 December 2015 (UTC) - ↑ Wot the mustelid sed. Pippa (talk) 17:23, 25 December 2015 (UTC) - That's 6 for redirect and 0 for keep. Snowball clause? Herr FüzzyCätPötätö (talk/stalk) 17:46, 25 December 2015 (UTC) Joy of Satan (español) | Result: Deleted[edit] Delete[edit] - No references at all, contains some strong accusations about Nazism, and sort of doubles as a BLP. Difficult for me to judge if this is a "very obscure small cult" (which would be okay) or "not a cult at all and just some hit-piece" (NOT okay). Spud mentioned in the Saloon that "tried looking for reliable sources that backed up the claims made in the Spanish article. I couldn't find any. I could only find those claims repeated on a couple of websites that looked even shittier than the Joy of Satan one."... (translate) Carpetsmoker (talk) 13:23, 6 December 2015 (UTC) - Since I'm quoted above, I have to say "delete" too. Spud (talk) 13:29, 6 December 2015 (UTC) - Yee, outright hit piece with absolutely no references. |₹Λ¥$€₦₦ You know who else exercises leeks? MY MOM! 13:31, 6 December 2015 (UTC) - Like they said ^^--TheroadtoWiganPier (talk) 14:39, 6 December 2015 (UTC) - Delete delete delete, no references and if they can't be back ed up, why keep the article?--Pokefrazer (talk) 15:05, 6 December 2015 (UTC) - [joke about sacrificing this article to the dark god Satan] oʇɐʇoԀʇɐϽʎzznℲ (talk/stalk) 15:13, 6 December 2015 (UTC) - Our dark lord deserves something better. Reverend Black Percy (talk) 17:44, 19 December 2015 (UTC) Keep[edit] Merge/redirect[edit] Goat[edit] - I would hold off a little while for the author to respond - David Gerard (talk) 15:38, 6 December 2015 (UTC) - Or anyone else, for that matter. IMHO pages with only referencing problems and such can sit in AfD for a few weeks in the hope that someone fixes up the article enough so that the AfD can go away. Carpetsmoker (talk) 15:42, 6 December 2015 (UTC) Juan Andrés Salfate (español) | Result: Deleted[edit] Delete[edit] - Living person with no references at all. Someone should probably ref this up or remove this (I would do it myself, but I don't speak Spanish). translate Carpetsmoker (talk) 13:18, 6 December 2015 (UTC) - I can't find any reliable references that say anything meaningful about him in Spanish or English. The Spanish Wikipedia article about him is a total piece of shit. It's only got three references. One is about Chilean celebs being busted for drugs. One just lists his name and doesn't say anything else about him. The other is a broken link to a sodding YouTube video. If there aren't any good sources for an article about a living person, it's not worth having. Spud (talk) 12:49, 7 December 2015 (UTC) - Balete. Reverend Black Percy (talk) 17:43, 19 December 2015 (UTC) Keep[edit] Merge/redirect[edit] Goat[edit] *He's got a Spanish Wikipedia article. Mind you, that seems a bit crap. No, make that total crap. It's only got 3 references and the external links are Facebook and Twitter for fuck's sake. I'll look into him tomorrow. Spud (talk) 13:25, 6 December 2015 (UTC) - Worth pinging the author - David Gerard (talk) 15:36, 6 December 2015 (UTC) Fun:Ray Comfort | Result: Redirected[edit] Delete[edit] - Not funny. FuzzyCatPotato!™ (talk/stalk) 00:44, 19 December 2015 (UTC) - Again, I can't disagree with the reason given for deletion. Spud (talk) 09:03, 19 December 2015 (UTC) - Unfunny. Besides, his regular page is plenty fun. Reverend Black Percy (talk) 17:43, 19 December 2015 (UTC) Keep[edit] Merge/redirect[edit] Goat[edit] - Would be an embarrassment to Uncyclopedia. (And links to a wiki that appears to be such an embarrassment.) That said, funspace is a bit of a dump anyway - David Gerard (talk) 01:02, 19 December 2015 (UTC) - Calling it snowball clause, 4:0. Herr FüzzyCätPötätö (talk/stalk) 19:39, 19 December 2015 (UTC) Angela Merkel | Result: Redirect to Germany for now[edit] Delete[edit] - She's Germany's chancellor. Whoopie-doo. I removed almost all of this page (that a single user wrote in 2012) as it was nothing more than a boring bio (and unreferenced at that). Unless someone wants to take the time to actually write something useful here (and there's plenty of stuff to write, like Merkel's handling of the eurocrisis, although that's maybe better off on the Euro crisis page). I see no reason to keep this particular version as it's useful to nobody Carpetsmoker (talk) 04:12, 2 December 2015 (UTC) - She's only missional as she relates to extremism, which would be better covered in articles on neo-Nazis or on the European migrant crisis. Sir ℱ℧ℤℤϒℂᗩℑᑭƠℑᗩℑƠ (talk/stalk) 04:25, 2 December 2015 (UTC) - |₹Λ¥$€₦₦ For no man is an island of tat 13:31, 6 December 2015 (UTC) Keep[edit] - Right in your neighborhood!--Arisboch ☞✍☜☞✉☜ 04:13, 2 December 2015 (UTC) - If she ain't on mission, Jeremy Corbyn ain't either... I dislike the woman, but she does on occasion make good policy decisions... Usually after exhausting all alternatives... Given that she is now attacked from the right in the refugee crisis, my respect for her has risen somewhat, though... Avengerofthe BoN (talk) 23:42, 3 December 2015 (UTC) - I never said she isn't on-mission, just that he current page is useful for anyone and will waste anyone's time clicking on it. Carpetsmoker (talk) 23:54, 3 December 2015 (UTC) - There are already several conspiracy theories about her and the EU, like how she's apparently the daughter of Adolf Hitler. I'm not joking. ℕoir LeSable (talk) 17:45, 5 December 2015 (UTC) - Put that in the page in a meaningful manner and make the page worth clicking on. Carpetsmoker (talk) 13:51, 6 December 2015 (UTC) - David Gerard (talk) 21:22, 7 December 2015 (UTC) Merge/redirect[edit] Goat[edit] Andrea Yates | Result: Deleted[edit] Delete[edit] - This is about a person who committed a terrible crime while suffering from a severe psychosis and depression. The "religious angle" here seems coincidental to me; she could have had delusions about any number of subjects. Carpetsmoker (talk) 07:54, 30 November 2015 (UTC) - I have to agree. This seems like a pretty pathetic attempt to make out that Christians are evil. Plenty of people who commit crimes while mentally ill say, "God told me to do it", and not all of those people come from religious backgrounds. Spud (talk) 14:10, 30 November 2015 (UTC) - |₹Λ¥$€₦₦ That's why our council tax is so high 12:40, 3 December 2015 (UTC) Keep[edit] Useful for showing impact of religion on children. Make the religious angle clear from the psychotic angle. The FCP Foundation (talk/stalk) 13:07, 30 November 2015 (UTC) - All this article needs is a tune-up. Even if one was to argue that the psychotic and religious parts were 100% NOMA (which isn't entirely clear to me that they are), even in that case, the article is still useful against mental illness denial. There are sure to be cranks who think she's a lizard or was a satanist or whatever - worthy of a debunking from us. The article could use more analysis and generally a revamping, but it should stay. Reverend Black Percy (talk) 14:18, 30 November 2015 (UTC) - It seems like less an implication of all Christians, just the power of faith in a fragile family which can be abused to tragic ends. This seems mission related in that is explores fundamentalism and the anti-science movements which had a direct part of her "going natural" and choosing to ignore doctors advice. Then ignoring the warning signs, and a forced hospitalization, because of suggestions for prayer and tough love by the families religious authorities. -EmeraldCityWanderer (talk) 15:06, 7 December 2015 (UTC) Merge/redirect[edit] Goat[edit] - Particular examples seem a bit of a departure for us, unless we like the idea in principle of having a host of similar articles. I'd prefer that this be merged into a single article 'Infanticide featuring religious mania' or somesuch, where we can give each case a single line entry summarising the various factors in each case. That could then be cross-linked to mental illness and abortion (specifically the parts debunking the 'termination is bad for the mental health' canard by providing concrete examples to underline the fact that carrying a pregnancy to term is on average worse for mental health) Queexchthonic murmurings 14:27, 30 November 2015 (UTC) - Ok, wow. This. And this suggestion should totally count as a "Keep" vote. Reverend Black Percy (talk) 14:37, 30 November 2015 (UTC) - I had a think about this, and it doesn't really address the core problem, which is that it's highly doubtful that religion played a large part in this particular case. The entire argument comes of as a sort of "internet atheist" who tries to "score points" by pointing out at all the bad things religion did. For example if you look at Andrea Yates it says "While in prison, Yates stated she had considered killing the children for two years". It's certainly possible that the religious influence "topped her over the edge", so to speak, but I would consider the evidence for this to be very weak... Carpetsmoker (talk) 15:01, 7 December 2015 (UTC) - Do what Queex said. 32℉uzzy; 0℃atPotato (talk/stalk) 14:52, 7 December 2015 (UTC) All non-English articles | Result: Leave them be for now (some articles deleted or put up for AfD)[edit] Delete[edit] - We've just dumped two Hungarian-language articles that were created years ago and the abandoned. How about we get rid of the other scrappy foreign stubs that were created various single long-ago users and ignored ever since? (they can be found in Category:Babel. Bicyclewheel 20:55, 26 November 2015 (UTC) - Do you want to scrap ALL non-English stuff, or just the crappy ones? I thought that at least the Russian and French sites were sorta active? Carpetsmoker (talk) 21:21, 26 November 2015 (UTC) - Also, is there a way to get a list of non-English articles? Carpetsmoker (talk) 21:40, 26 November 2015 (UTC) - what good is leaving one or two random non-english article? Also Russian has its own wiki and doesn't need us.--"Paravant" Talk & Contribs 22:00, 26 November 2015 (UTC) - Even if they aren't stubs, the fact that most of these are random articles with no real effort put into making an actual foreign-language article base means we really have no reason to keep this going. If somebody really wants to make a spanish or arabic RW offshot, they can either put in the effort and get a spinoff like russionalwiki or just make their own wiki.--"Paravant" Talk & Contribs 21:09, 26 November 2015 (UTC) - We've currently got 46 articles in languages other than English (34 in French, 6 in Spanish, 3 in Portuguese, 2 in Greek and 1 in Italian). To see the lists, go to Category:Babel and click on the sub-categories. Spud (talk) 06:03, 27 November 2015 (UTC) - While I stand by Gerard's goat (see below) regarding taking our time to discuss before making any sudden moves; in principle I agree with Paravant and Bicycle. I think there are good reasons for us to codify english-only in the articles (meaning that non-english sources must "simply" be translated - and not merely machine translated - as they are used). Reverend Black Percy (talk) 06:10, 27 November 2015 (UTC) - Plays the ballad of LeandroTellesRocha |₹Λ¥$€₦₦ I AM VERY DISGUSTED WITH THE TRASHY MAN 12:59, 27 November 2015 (UTC) - Drop all of them. If there's enough material and editor interest then we should start a new wiki in that language. The current system is just weird. Aleksandra96 (talk) 23:06, 30 November 2015 (UTC) - Yep. Reverend Black Percy (talk) 04:24, 1 December 2015 (UTC) Keep all[edit] - This sweeps with too broad a brush. - Smerdis of Tlön, LOAD "*", 8, 1. 15:56, 1 December 2015 (UTC) - Crappy pages should be deleted on account of being crappy pages, regardless of language (as I did with Sceptycyzm yesterday). I see no reason to delete any non-English page only on account of being non-English. Carpetsmoker (talk) 14:57, 27 November 2015 (UTC) Keep some[edit] - Even if we have a moratorium on further non-English entries & delete the stubby/crappy ones, I think some of the early articles, especially the French ones, are good quality & worth keeping. Loi de Poe, for example, shits on the equivalent Wikipedia page. Wéáśéĺóíď Methinks it is a Weasel 22:42, 26 November 2015 (UTC) - What Weaseloid said. If the articles are above average quality then it would be ridiculous to delete them, no matter what language. Typhoon (talk) 10:56, 27 November 2015 (UTC) - This is a rather larger issue than something to put through in an AFD and warrants actual discussion e.g. on the Saloon Bar - David Gerard (talk) 21:35, 26 November 2015 (UTC) - My only reason to vote for a blanket deletion would be brand, and I don't think there's enough of an issue there at all. That said, this idea of a moratorium, might, as per Raysenn, be prudent. WalkerWalkerWalker 23:00, 30 November 2015 (UTC) - Agreed on warranting an actual discussion rather than a flat purge. ℕoir LeSable (talk) 16:16, 1 December 2015 (UTC) - What is there to say against creating language versions? You know, like Wikipedia? Or half of all crappy second rate wikis there are? Avengerofthe BoN (talk) 23:46, 3 December 2015 (UTC) - Narky Sawtooth (Nyarnyar~) 04:35, 10 December 2015 (UTC) - 141.134.75.236 (talk) 04:51, 10 December 2015 (UTC) Goat[edit] - Scope clarification: does articles mean mainspace only? WalkerWalkerWalker 23:14, 30 November 2015 (UTC) - I think that non English articles should be made by people who have some degree of regular and effective communication with the English part of the wiki, if only because it'd be much easier to audit their contents. |₹Λ¥$€₦₦ By the way, 2 divided into 666 is 333 12:50, 2 December 2015 (UTC) - I certainly approve of that idea, although I think it would probably be impossible to enforce. Mind you, I think LTR was highly unusual in being an editor who didn't have much of a grasp of English and who almost always wrote in his native language on talk pages, in the Bar and everywhere else. Spud (talk) 13:02, 2 December 2015 (UTC) - Of great concern for me is how we can know what it is we are hosting? It's so fucking provincial to insist on English-only, but how can the community control quality if we literally permit Babel? (I could reasonably read French articles, tho I'd not want to edit them -- my French is just too rusty, having divorced the man I regularly spoke it with almost 20 years ago.)---Mona- (talk) 13:50, 2 December 2015 (UTC) - It's pretty arrogant to insist on an English-only Wiki, but we need a way to make sure it can be read by native speakers coherently? (I can read German articles to a degree but I'm nowhere near fluent so I don't dare edit them)--Pokefrazer (talk) 15:09, 6 December 2015 (UTC) Jerboa[edit] Jerboa x Goat[edit] - Yes plz. Narky Sawtooth (Nyarnyar~) 04:34, 10 December 2015 (UTC) Ferret[edit] Mowse[edit] RationalWiki:Articles_for_deletion/My_Little_Pony:_Friendship_Is_Magic (2nd nomination) | Result: Kept[edit] - My Little Pony: Friendship Is Magic (edit|talk|history|protect|delete|links|watch|logs) – (View AfD) Delete[edit] - Continued fighting over this page is an embarrassment to this site. Does this really relate to RW:MISSION? No "pseudoscience" or "Anti-science" involved; I've seen very little real "crank" ideas involved, and it doesn't relate to either "authoritarianism" or "fundamentalism". Aren't we better off bashing each other's head in over something that actually matters? Carpetsmoker (talk) 14:29, 1 December 2015 (UTC) - Well, it's certainly seen some moral panicking, has it not?---Mona- (talk) 19:56, 1 December 2015 (UTC) - No, that's a persecution complex and your own shitty research on pop culture.—Ryulong (talk) 20:20, 1 December 2015 (UTC) - What? What on earth would I be being "persecuted" for? And if you deny that moral panics occur, well, that would be as reasonable as your usual offerings.---Mona- (talk) 20:41, 1 December 2015 (UTC) - Bronies have a persecution complex and your there is no "moral panic" over Bronies. It's feminists, LGBT activists, and others pointing out the pervasive toxic nature of this particular fandom.—Ryulong (talk) 22:48, 1 December 2015 (UTC) - Moral panics are not alien to feminists. They've participated in them before. Not the sensible among us, but some have.---Mona- (talk) 00:35, 2 December 2015 (UTC) - That may be, but that's not the case here.—Ryulong (talk) 00:54, 2 December 2015 (UTC) - You are among the last people credible on a claim like that. The more you pound the table denying it, the more I'm inclined to suspect it is, indeed, a moral panic.---Mona- (talk) 01:08, 2 December 2015 (UTC) - So what logical fallacy would you be guilty of for believing something simply because I'm the one telling you it's not the case? Because myself, and plenty of other people across the internet, don't hate Bronies for their sexual proclivities, alleged or otherwise. It's because they're an extremely toxic group of people like every other libertarian/objectivist group borne of 4chan assholes.—Ryulong (talk) 10:34, 2 December 2015 (UTC) - You consider this community to be "toxic", so your judgement record here is not exactly great. And "libertarian/objectivist group borne of 4chan assholes" is just laughable. You go around accusing other people of "snarl words" and "dog whistles" and here you do exactly the same thing. You're no better. All you've said here borders on hatred, and you've probably hurt your own "cause" (to get this article deleted) more than anyone else. Congratulations. Carpetsmoker (talk) 01:25, 3 December 2015 (UTC) - Oh no I've been outed as a bronyphobe. Whatever shall I do? /s Just because I'm saying these things doesn't make them false. Multiple people (a lot more from WHtm) have made these conclusions. The Brony community is overwhelmingly associated with the 4channer MRA/libertarian/"baby's first Ayn Rand book" type. And y'all still are toxic.—Ryulong (talk) 01:33, 3 December 2015 (UTC) - K, Im maybe not mad with you (Ryulong), Put did found video [from one depressed Youtuber point of view] that Bronies are just could be hypocritical of their own subculture and seemly link to MRA's, Just maybe [true]. 98.27.29.192 (talk) 01:47, 3 December 2015 (UTC) - It really has no place outside of the odd obsession with one episode that was justified for its inclusion last time and a vague association with Internet assholes. The page's existence locally is nothing more than fans of the show who have an odd insistence that it must be included wherever possible even on the barest of justifications like the "oh in this episode it teaches viewers that you should just accept supernatural faith instead of science based reasoning" when it's magical cartoon horses and its odd fandom amongst MRAs and such.—Ryulong (talk) 20:20, 1 December 2015 (UTC) - Love is wise, hatred is foolish. Let go of the hatred. Carpetsmoker (talk) 21:58, 1 December 2015 (UTC) - Wine is sweet, gin is bitter. Wèàšèìòìď Methinks it is a Weasel 00:04, 2 December 2015 (UTC) - This article is just a battleground for assertions that belong in other articles. Mostly it just boils sown to snark at a group of people we already have a page on. The only RWish part is where it gets criticised by the usual right wing blonks, which wouldn't normally be enough to justify an article on any other show. The Brony subculture may be weird, but is writing about it missional? I don't see that part. Bicyclewheel 21:02, 1 December 2015 (UTC) - I say we get rid of it. It's barely on-mission, and it's become embarrassingly polarizing for such a petty subject. At least the fighting over the Israel-Palestine conflict's coverage made some sense in that regard. Blitz (Complaints Box) 21:13, 1 December 2015 (UTC) - Exactly! That is about something important, this is about some TV show (and one single episode, at that) with an unexpected fanbase. Everyone involved in edit warring about it should get a fucking life. Bicyclewheel 21:19, 1 December 2015 (UTC) - Well maybe put my idea of put some parts like Pornography or "But it's a show for little girls!" section that seems likely successful deleted page could merged to Furry fandom page as "Subgenre section" to be reminder that some bronies are maybe unintenional closeted furries??? 70.61.121.86 (talk) 21:26, 1 December 2015 (UTC) - Does anyone give a flying one if they are or not? and is picking on furries because "eeeuuurgh furries LOLZORS" still a thing anymore? And even if the answer is yes, how does it fit the mission? Bicyclewheel 21:35, 1 December 2015 (UTC) - Well person who sound or try doing same thing nine years later are try picking on flaw section in Brony/MLP:FIM page to ultmately favoring on deleted page because its weird and cant fit "the mission of wiki". 70.61.121.86 (talk) 21:43, 1 December 2015 (UTC) - Not on mission (oh, it endorses magic instead of science? It's a fucking cartoon!) and it's just an extremely unimportant topic. I mean, there really isn't a reason it should be on RationalWiki at all. If you're gonna rip on cloppers or anything, there's already a page on furries.- Shouniaisha (talk) 21:28, 1 December 2015 (UTC) - Put if delete that page with some more words editing, It just only said one word (Name of show itself with was only link to page)... ...Its Wikifur counterpart shows more unintentional simliares bewteen two arent ignore with some few things are try avoided with 'minor' success. 70.61.121.86 (talk) 21:35, 1 December 2015 (UTC) - Delete. Trying to write something bronies won't get upset about is like ramming your head into a brick wall. If we can't be critical about the fandom, it does not deserve to be on rationalwiki, as that makes the article a waste. And in my experience, even the most minor critical assertion is fought over. - Kitsunelaine 「Beware. The foxgirls are coming.」 22:31, 1 December 2015 (UTC) - no really wtf why is this even here |₹Λ¥$€₦₦ This isn't 'Nam. This is exercising. There are rules. 01:15, 2 December 2015 (UTC) - My opinion hasn't changed. Not really missional. Vulpius (talk) 02:36, 2 December 2015 (UTC) - There is no relevance to the mission. Aleksandra96 (talk) 03:24, 2 December 2015 (UTC) - Just horrible trash. Typhoon (talk) 15:26, 2 December 2015 (UTC) - The key point being that whatever dubious relevance this has to the mission is over-shadowed by a whole bunch of poorly thought out arguments in favour, and in criticism of the fandom. One cartoon episode with a poor epistemoligical message is the extent of the relevance; I can't help but feel many of the keep votes are doing it for reasons other than mission relevance, perhaps because they feel that certain users have been able to push the site around through sheer volume and persistence. This may be true, but goddamn, it doesn't make the article any more missional. Tielec01 (talk) 04:32, 3 December 2015 (UTC) - FFS. I hate having to line up with that bed-wetting hand-down-the-nappy weeaboo fuckwit Ryulong, but this is just not what we're about. MtDNotorious Sodomite 05:47, 5 December 2015 (UTC) - Jesus Effing fuck why is this even a question? rpeh •T•C•E• 22:22, 5 December 2015 (UTC) - Kill it with a razor-edged fedoratrilby - David Gerard (talk) 21:24, 7 December 2015 (UTC) - Why the ehck is this article relevant to the wiki. It has some moral panick-related value at best, but in that case we might as well write an article about anything that ever caused moral panic. I demand an article about Catullus ! JorisEnter (talk) 09:01, 14 December 2015 (UTC) Keep[edit] - Repetitive nomination, was kept towards the end of October. - Smerdis of Tlön, LOAD "*", 8, 1. 16:56, 1 December 2015 (UTC) - Was kept, why is this up for nomination again? Why is deleting this few kilobits so important? -EmeraldCityWanderer (talk) 17:11, 1 December 2015 (UTC) - (Comment) Honesty I feel they like guy for was this deleted again are ether Psychologically Anti-Bronies (Like user Blitz) or Super Mentally Anti-Bronies (Like users Kitsunelaine and [very likely] Ryulong) that try make other excuse to deletion this again? 70.61.121.86 (talk) 19:42, 1 December 2015 (UTC) - Excuse you, but I happen to be a member of the MLP fandom. I just happen to agree that this article is barely on-mission, and as of now has become an edit war between bronies and anti-bronies.Blitz (Complaints Box) 19:28, 4 December 2015 (UTC) - I don't think this is "an edit war between bronies and anti-bronies" at all. I don't give a flying hoot about MLP (I watched two episodes and found it to be profoundly boring, sorry), but I sure as hell don't want this site be hosting some hateful unfair hitpiece (on any topic). I believe this is how almost everyone feels. The battle is between Bronyphobes (Ryulong, Kitsunelaine) and the rest of the site. Carpetsmoker (talk) 20:12, 4 December 2015 (UTC) - Tell that to everyone else who thinks the article should be deleted, bruh. - Kitsunelaine 「Beware. The foxgirls are coming.」 02:32, 5 December 2015 (UTC) - "Think this article should be deleted" does not equate to "think that Ryulong and Kitsunelaine are right about MLP". Carpetsmoker (talk) 08:12, 5 December 2015 (UTC) - "This battle is between bronyphobes and the rest of the site" - Carpetsmoker, 2015, one day ago - Kitsunelaine 「Beware. The foxgirls are coming.」 08:37, 5 December 2015 (UTC) - You know very well that I was referring to the edit wars and such concerning this article, just as Blitz was, and not the AfD. Go play your word games somewhere else. Carpetsmoker (talk) 08:40, 5 December 2015 (UTC) - We're on the AFD page. You, uh. You realize that, right? "this battle" is incredibly vague and contains ~*implications*~. also i'm not a bronyphobe, all fandoms are shit, but bronies and their behavior are up there among the worst as a special case of awful. ciao~ - Kitsunelaine 「Beware. The foxgirls are coming.」 08:52, 5 December 2015 (UTC) but bronies and their behavior are up there among the worst as a special case of awful.- Kitsunelaine [citation needed] --Arisboch ☞✍☜☞✉☜ ∈)☼(∋ 17:35, 5 December 2015 (UTC) - here you go bro - Kitsunelaine 「Beware. The foxgirls are coming.」 17:45, 5 December 2015 (UTC) - So basically a Do your own research? That's fucking pathetic, even for you.--Arisboch ☞✍☜☞✉☜ ∈)☼(∋ 17:48, 5 December 2015 (UTC) - "this is blatantly obvious to everyone who isn't a part of the herd and a simple google search is literally all you need" but i guess you can't read between the lines - Kitsunelaine 「Beware. The foxgirls are coming.」 17:49, 5 December 2015 (UTC) - A Google search link, especially such a ridiculously broad one, is not a goddamn source.--Arisboch ☞✍☜☞✉☜ ∈)☼(∋ 18:10, 5 December 2015 (UTC) - bruh, no source I add is ever gonna be enough for you because you're a part of the herd. Why should I even try? :) - Kitsunelaine 「Beware. The foxgirls are coming.」 18:19, 5 December 2015 (UTC) - "no source I add is ever gonna be enough for you" What omniscient crystal bowl told you that?? --Arisboch ☞✍☜☞✉☜ ∈)☼(∋ 18:22, 5 December 2015 (UTC) - It's deductive reasoning based on your prior behavior towards criticism aimed at bronies. :) - Kitsunelaine 「Beware. The foxgirls are coming.」 18:24, 5 December 2015 (UTC) - Also I didn't know crystal dinnerware was a thing in fortune telling. - Kitsunelaine 「Beware. The foxgirls are coming.」 23:48, 5 December 2015 (UTC) - Kitsunelaine, lmgtfy has it's uses, but not when you don't narrow the search to include terms that should yield documentation -- if it exists -- that Bronies are vile freaks baby rapersunsavory, and you did not supply such terms. Merely directing someone to Google results for "Bronies" is just stupid.---Mona- (talk) 18:01, 5 December 2015 (UTC) - Whatever you say. :) - Kitsunelaine 「Beware. The foxgirls are coming.」 18:05, 5 December 2015 (UTC) - Sure, but has anyone really been far even as decided to use even go want to do look more like? Wëäŝëïöïď Methinks it is a Weasel 19:57, 1 December 2015 (UTC) - Ok Wēāŝēīōīď Methinks it is a Weasel for that maybe good theory, If this happen again third time?, If second deletion failed again?, I dont know put some made list of Users with there special template who likely Anti-Brony? Put if this or third attempted successfully deleted, I could just put some of Brony concept aka But it's a show for little girls! section into Furry page as probable "Subgenre" section with completely renamed as Possible "Closeted Furry" fandoms??? (Also found couple links that somewhat proves that Bronies are (Unintentional) semi-independent group of furries: All Bronies Are Diet Furries and ARE BRONIES FURRIES? from their own followers of MLP:FIM). 70.61.121.86 (talk) 20:14, 1 December 2015 (UTC) - People that crusade against some random sexual preference seem to be trying to validate Haggard's Law. -EmeraldCityWanderer (talk) 20:34, 1 December 2015 (UTC) - What, You sould put into merged section since it got most ironic Haggard's Law thing I did, And first all, That Im majority Bi-romantic Asexual (Im serious, Not trolling) and Two Im having nothing against LGBT subculture at all? 70.61.121.86 (talk) 20:42, 1 December 2015 (UTC) - I thought you were championing keeping it since you called several people out for being anti-Brony. -EmeraldCityWanderer (talk) 20:47, 1 December 2015 (UTC) - But who is it to the end? Why to make the thing? |₹Λ¥$€₦₦ By the way, 2 divided into 666 is 333 03:51, 2 December 2015 (UTC) I very now keep this until if Majority favoring to delete the page. 70.61.121.86 (talk) 20:58, 1 December 2015 (UTC) - I vote we keep this page. It's already being nominated for a second time! How is this possible? Ɀexcoiler Кingbolt: hablale a este hijo de la verga! Look! 22:00, 1 December 2015 (UTC) - I retract what I said earlier. The reason the we're fighting over the MLP page now is because Ryulong, Kitsunelaine, et al. are on their crusade to revise it as a hit piece or delete it. I vote we keep it and have compromise on it, but seeing as this is the second AfD nomination, I am just dumbstruck as to what to do further to stop more shitfests from occurring... Ɀexcoiler Кingbolt: hablale a este hijo de la verga! Look! 00:08, 3 December 2015 (UTC) - [citation needed] Adding sourced criticism of toxic behavior does not a hit piece make, brorse. Also don't double vote.—Ryulong (talk) 00:13, 3 December 2015 (UTC) - My apologies (forgot I already voted, and thanks for deleting), but you pretty much tried to paint a real broooooaaaaaad stroke of tar on the entire fandom and claim it as a neutral and balanced article. Ɀexcoiler Кingbolt: hablale a este hijo de la verga! Look! 00:31, 3 December 2015 (UTC) - I haven't introduced that to the article. The current edit war is over criticising an amateur documentary that is seen as propagandist by multiple reviewers (even though some aren't professionals either). And my stance isn't unfounded.—Ryulong (talk) 00:34, 3 December 2015 (UTC) - I remember that there was one documentary that did try to portray the fandom as that (I think it was the first major one that came out), but the majority just adopt this stance of "Where did these fans come from?" And, while your stance isn't unfounded, per se, that is only one small (yet kind of loud) portion of the fandom. Ɀexcoiler Кingbolt: hablale a este hijo de la verga! Look! 00:43, 3 December 2015 (UTC) - Ah yes, the No true Scotsmaning, aka #NotAll MenBronies. Criticism of the worst of the fandom (because they are a loud group) should be included rather than endlessly fought over as turning the page into a hit piece. Although my attempts at this were stymied because of the original view that I was doing that (because I had done it all as snarkily as possible).—Ryulong (talk) 00:54, 3 December 2015 (UTC) - I never ever excluded them from the fandom. That's no No True Scotsmaning. Although my attempts at this were stymied because of the original view that I was doing that (because I had done it all as snarky as possible). Really? RW:MISSION explicitly says that use of snark should be at a minimum, and you tried to make it as lolzy as possible? How about we move this article into Funspace? Ɀexcoiler Кingbolt: hablale a este hijo de la verga! Look! 16:19, 3 December 2015 (UTC) - Oh not again, Celestiadamnit!--Arisboch ☞✍☜☞✉☜ 22:13, 1 December 2015 (UTC) - It's on mission, with all sorts of moral panic stuff surrounding it.---Mona- (talk) 22:17, 1 December 2015 (UTC) - There's no fucking moral panic, Mona. Someone's school essay posted to DeviantArt isn't proof of a moral panic.—Ryulong (talk) 22:47, 1 December 2015 (UTC) - There's no fucking moral panic, Mona. Someone's school essay posted to DeviantArt isn't proof of a moral panic.—RyulongDo You Believe That? Wha-how-huh? Ɀexcoiler Кingbolt: hablale a este hijo de la verga! Look! 23:06, 1 December 2015 (UTC) - It was a reference she added to the article to suggest the moral panic was an aspect of backlash against the fans.—Ryulong (talk) 00:53, 2 December 2015 (UTC) - Huh? Could you show me where I added a reference to the article about a "moral panic?" (But I probably will.)---Mona- (talk) 02:28, 3 December 2015 (UTC) - sweatie (:—Ryulong (talk) 06:58, 3 December 2015 (UTC) - Ah. I guess I did already add that salient point. Good on me!---Mona- (talk) 14:49, 3 December 2015 (UTC) - But the reference is shit (particularly because if I was chastised for using a wiki you should have been chastised for using deviantart of all places) and the reasoning is shit. It's not a moral panic. It's because a large portion of the fandom has its origins in the misogynistic and racist parts of 4chan and that behavior still lingers.—Ryulong (talk) 17:17, 3 December 2015 (UTC) - This is the second time I have seen you use that non-word. Are you misspelling "sweaty" or "sweetie."? Peace. AgingHippie (talk) 07:07, 3 December 2015 (UTC) - Lol, is Ryu trying to say Sweetie Belle? Or sweaty? Ɀexcoiler Кingbolt: hablale a este hijo de la verga! Look! 07:20, 3 December 2015 (UTC) - Ryo, there's no basis for rejecting deviantart as a source. That you don't like it is wholly insufficient. The article I used as a source is intelligent and well-reasoned.---Mona- (talk) 06:20, 5 December 2015 (UTC) - Some kid's shitty essay that he put up on DeviantArt because he was tired of being kinkshamed for being a Brony isn't a good reference when Paravant et al. berated me for using blogs written by feminists and other cultural critics.—Ryulong (talk) 07:08, 5 December 2015 (UTC) - Non sequitur. Your issues with Paravant have nothing to do with devianart being a reputable site or with the fact that that article is sociologically sound.---Mona- (talk) 07:16, 5 December 2015 (UTC) - Also Ryu, here's a couple of ethnographers discussing the Brony fandom, including the moral panic about them.---Mona- (talk) 07:27, 5 December 2015 (UTC) - No because DeviantArt is not a reputable site and if I was berated for using someone's essay posted to Tumblr or Wordpress, you should be berated for using someone's school essay posted to dA. And criticism of Bronies for their deleterious behavior on the Internet which isn't focused on whatever fetishes they have is not a moral panic. And the words "moral panic" only appear once in that whole thing and even reading further it doesn't expound on that either.—Ryulong (talk) 07:32, 5 December 2015 (UTC) - Ryu, I don't give a shit about your imagined persecution and attempts to create some bizarre parity due to some battle over sources you've had with others. The fact remains that the paper I cite is intelligent and sound, as well as sourced. the second piece is an interview with 2 ethnographers where they explain Bronies from a proper ethnographic perspective and assume a moral panic in the entire approach, as they explicitly say at one point. You are wrong, unreasonable and utterly wrong. But that is usual.---Mona- (talk) 07:41, 5 December 2015 (UTC) - If I got called out for using sources that weren't up to par then I can call you out for citing a fucking kid's high school class essay that he posted onto deviantArt. And the phrase "moral panic" only shows up once in that entire website you linked and there's no valid answer to the question posed.—Ryulong (talk) 07:49, 5 December 2015 (UTC) - 1. It is likely a college paper for a social deviance class (a sourced one), and 2. the ethnographers take it as a given that moral panic surrounds the Brony phenomenon. That's a big part of what they explore in that exchange, explicitly saying so to begin the discussion. You just don't like it. Anyhoo, if the article stays I'll add that reference.---Mona- (talk) 08:37, 5 December 2015 (UTC) - ₩€₳$€£ΘĪÐ Methinks it is a Weasel 23:13, 1 December 2015 (UTC) - I like ze drifting mission, iiit is güd. WalkerWalkerWalker 23:50, 1 December 2015 (UTC) - Keep per my previous reason. 142.124.55.236 (talk) 01:51, 2 December 42015 AQD (UTC) - Just keep it, There are just ironic kept Captain Planet here even despite is cartoon. 98.27.29.192 (talk) 20:33, 2 December 2015 (UTC) - Maybe that should be ditched, too.—Ryulong (talk) 22:56, 2 December 2015 (UTC) - So you just hate Cartoons even despite some them have politically left morals with some dark elements that cant fit for small kids demographic, Thus means can fit for adults demographic instead with serious issues in based ether real or fictional. I start finally thinking you (Ryulong and possibly other Anti-bronies) got likely case of beliving in Animated Age Ghetto myth. 98.27.29.192 (talk) 23:08, 2 December 2015 (UTC) - Nice persecution complex there. That and I don't think you get to vote here.—Ryulong (talk) 00:05, 3 December 2015 (UTC) - Wait what? No dude, You just asking you are probably just love denied all you want, Put proof (One source, Until found article like this maybe sound proof my point that are psychologically Ageist) are sound point to there, And instead you write almost sound irrational-like put there in top is try attempted to giving "good" justify to ignored, That almost people in this wiki are rather being unintentionally regressive or ironic ageist by deleting pages like this (Again). 98.27.29.192 (talk) 00:24, 3 December 2015 (UTC) - I do not think animation is just for children. I just think RationalWiki shouldn't have a page on My Little Pony because it's a vague stretch to say that the one anti-science episode in a fantasy cartoon for little girls that was usurped by adult men justifies its inclusion on RationalWiki, particularly if the rest of the page is used to praise a community known for its toxicity and anti-feminist rhetoric. The same can be said for Captain Planet because it just seems to be poorly written but maybe it just needs some work. Looking through Category:Television programmes shows that there's only one other cartoon on RationalWiki and that's Veggie Tales, but that can stay because it's existence here is to mostly mock Christian fundamentalism (but the page is also kinda crap looking).—Ryulong (talk) 00:32, 3 December 2015 (UTC) - Ok than, Put someday that real Progressive/"Left Libertarian" shows that have real mortal like Legend of Korra, Steven Universe or Gravity Falls for examples sould replace "Bad ones". 98.27.29.192 (talk) 00:37, 3 December 2015 (UTC) - You need to understand what RW:MISSION is.—Ryulong (talk) 00:50, 3 December 2015 (UTC) - What's wrong with the last vote? Just keep it ... MarmotHead (talk) 23:48, 2 December 2015 (UTC) - There is plenty about MLP (good, bad, ugly) that makes it worth keeping. Indeed, the fact that there are some bronies who also use MLP to subscribe MRA nonsense makes it worth keeping. That being said, MLP is certainly not a topic worth all the goddamn edit wars over it. Gooniepunk (talk) 00:34, 3 December 2015 (UTC) - The amount of energy that's been expended in flame wars over this particular topic is truly amazing. Nevertheless, there are elements of this peculiar culture that are missional. --Cosmikdebris (talk) 01:41, 3 December 2015 (UTC) - Keep, just to piss off the people who get annoyed by this... Avengerofthe BoN (talk) 23:44, 3 December 2015 (UTC) - Pop culture with a hint of sexual morality, and thus as missional as Gamergate or furries. Peace. AgingHippie (talk) 07:28, 4 December 2015 (UTC) - Which is to say, not missional at all. Wiki would be improved by fucking off those articles too. Tielec01 (talk) 07:46, 4 December 2015 (UTC) - I don't disagree, but a world without those articles is not a world we're ever gonna live in. Peace. AgingHippie (talk) 08:20, 4 December 2015 (UTC) - Gamergate's missional because it's a clusterfuck of conservatism and Internet assholatry. Furry fandom doesn't look missional at all though.—Ryulong (talk) 11:20, 4 December 2015 (UTC) - "Internet assholatry" is not missional, and neither is "conservatism" as such. Interestingly, "it's just Internet assholatry" is pretty much the reason you've stated on why you think this article should be deleted. Carpetsmoker (talk) 11:31, 4 December 2015 (UTC) - If conservatism isn't missional then you might as well nuke everything about Conservapedia from the website.—Ryulong (talk) 07:37, 5 December 2015 (UTC) - Will you stop fucking whining? You sound like a god-damn petulant 12-year old. Get over yourself. Peace. AgingHippie (talk) 07:44, 5 December 2015 (UTC) - So I can't refute people's bullshit arguments?—Ryulong (talk) 07:57, 5 December 2015 (UTC) - You can do whatever you want. But why you would want to bitch, moan and cry like a child over a bloody cartoon show is beyond me. Peace. AgingHippie (talk) 08:04, 5 December 2015 (UTC) - Keep per previous reason. ℕoir LeSable (talk) 17:42, 5 December 2015 (UTC) - Keep. We dealt with all this as recently as October and it is nuts that the article has been AFD'd again so soon.--TheroadtoWiganPier (talk) 16:05, 6 December 2015 (UTC) - --"Paravant" Talk & Contribs 16:10, 7 December 2015 (UTC) - Throw in some more focus on the "accepting and tolerating others means accepting and tolerating neo-nazis" nonsense that exists in the fandom. Narky Sawtooth (Nyarnyar~) 04:30, 10 December 2015 (UTC) - Oh, uhh, and... More locks on the article. Maybe appoint some kind of overseer to filter out anything too apologetic or too... Ryulong. Narky Sawtooth (Nyarnyar~) 04:32, 10 December 2015 (UTC) Merge/redirect[edit] - I feel leading Maybe merged some of most ideas into Furry fandom page like Pornography and Brony sections as under new name as Mostly likely "Closeted subgenre to Furry fandom" if this attempt successfully deleted (Again). (Almost face palm?) 70.61.121.86 (talk) 20:29, 1 December 2015 (UTC) - That works too. ClickerClock (talk) 07:24, 14 December 2015 (UTC) Give it to another wiki[edit] - Someone at SJwiki should put it in Social Justice Wiki instead of here. They already have a page on Bronies. Just copy and paste; ok some editing is needed to ensure it fits the tone of SJwiki but it's still good material that shouldn't be wasted. ClickerClock (talk) 07:27, 14 December 2015 (UTC) - I say we move the article over to our buddies over at that other site. JorisEnter (talk) 08:59, 14 December 2015 (UTC) - Good joke! Love it. Those hyper conservative nutjobs will hate it. Why will they hate it? It is because... of this. ClickerClock (talk) 04:51, 15 December 2015 (UTC) Goat[edit] - AFD-ed less than two months ago already, so too early for a new AFD IMO. But really, I think deleting it and moving the relevant bits to other articles would be better. The MRA-ish sub-segment of the brony subculture is fascinatingly bewildering... Dendlai (talk) 17:01, 1 December 2015 (UTC) - The previous AfD was tainted as it was in the middle of Ryulong being a gigantic shithead over MLP and putting it up for deletion because he couldn't have his way. Certainly my "keep" vote then was because I didn't want Ryulong terrorizing the wiki into getting his way. I don't know how many other people feel this way, but I think it's worthwhile doing the AfD again. Carpetsmoker (talk) 17:06, 1 December 2015 (UTC) - "I voted the wrong way last time in order to make a petty point, and would therefore like a do-over." Peace. AgingHippie (talk) 20:19, 1 December 2015 (UTC) - I suppose that's one way of phrasing it, which is perhaps not entirely unfair. Yet, I suspect more people feel like me (apologies if I'm wrong). Carpetsmoker (talk) 21:10, 1 December 2015 (UTC) - I see that you moved the existing AFD page & created a new one rather than reviving the existing discussion/vote. What's your basis for doing that? It seems like you're arbitrarily discounting all the comments & votes that were made only just over a week ago& making everyone post their opinions over again if they want their vote to count which they shouldn't have to do. Wèàšèìòìď Methinks it is a Weasel 21:16, 1 December 2015 (UTC) - My mistake: it was a month & a week ago. Still, I think the smart thing to do would have been to add your vote to the existing AFD & put it back on the AFD page for further comment rather than starting over & making everyone retread their thoughts on the subject. Weaseloid Methinks it is a Weasel 21:31, 1 December 2015 (UTC) - It seemed more useful to me to start with a "clean" page as I suspect that a reasonable number of people will vote different. My apologies if I turn out to be wrong, in which case I will owe everyone a beer. Carpetsmoker (talk) 22:01, 1 December 2015 (UTC) - The thing is, it is on mission. And I don't know that we should go down the road of deleting articles just because they cause controversy.---Mona- (talk) 22:07, 1 December 2015 (UTC) - If I squint just so, I can perhaps slightly see the vague outlines of missionality. Normally I wouldn't object to articles that are only vaguely on-mission, but when it kicks up a shitfest every month we're better off without it. I don't care a flying hoot about MLP, but I also don't want RW to be hosting pages that call entire fandoms a bunch of demented horsefuckers. So good people, like you and me, have to spend time "protecting" this article from the likes of Ryulong). We both have more important matters to attend to, both on this wiki, and outside it. Carpetsmoker (talk) 22:11, 1 December 2015 (UTC) - It's not missional. It's Brony puffery about their favorite TV show made to look missional. "This episode teaches girls I mean Bronies to accept non-science based faith" is as much of a fucking stretch as one can get, as can the original wording of several parts that amounted to the usual libertarian/objectivist obsession with "censorship" because a background animation error in joke at the production company turned into a completely different demeaning joke by the fans.—Ryulong (talk) 22:52, 1 December 2015 (UTC) - @Carpetsmoker: It wasn't Ryulong who started the previous AfD, it was me. Admittedly, I did it in order to stir more shit and see if I could cause a flame war or two in the AfD, so I'd say it was tainted. |₹Λ¥$€₦₦ Your memes end here! 03:30, 2 December 2015 (UTC) - Keep it and topic-ban everyone who's edited the page from touching it, to stop the shitfits over it. (Yeah yeah, "topic ban" is Wikipedia jargon, sue me.) I don't care that much one way or the other about keeping the page, but I don't like the idea of deleting something just because some people can't discuss it like rational adults. --Ymir (talk) 23:03, 1 December 2015 (UTC) - Looking at the history, this article wasn't exactly a hotbed of conflict and was stable (no pun intended) for months until two users decided to wage jihad on it, and you'll notice that both of the belligerent parties that caused the fracas to begin with have voted to outright delete it here. Why should the entire article be destroyed rather than taking a more surgical approach such as applying protection to prevent their edit warring from continuing? Razing it to the ground and salting the earth because two people seem to have a vendetta against the subject matter and can't leave it alone seems like overkill to say the least. (Which isn't to say that their complaints are completely without merit (I spent some time earlier today and easily found sources to elaborate on the brony documentary section most of this drama has been about), but behaving like l337 3d17 w4rr10r5 about My Little Pony of all things is certainly not going to win support/gather consensus for changes) As far as I know the series is still ongoing, and I'd rather read the RationalWiki analysis than end up at Horse News or Equestria Daily or similar nonsense. Lightning Dust (talk) 02:01, 2 December 2015 (UTC) - Speaking from my own experience, it can become difficult not to reflexively oppose any edits made by a user who's been a totally unreasonable asshat vis-a-vis an article one is working on. It's often a good rule of thumb to assume they're behaving true to form, but one can make errors and need to be called back by those not so invested in the acrimonious dynamic. One might process the same text differently (but not necessarily) when made by a neutral party. This is just human and best resolved by reining in the asshat(s). But I do agree with your basic point -- to delete because of fighting is to give unreasonable parties a heckler's veto over the site. Not a good idea.---Mona- (talk) 02:31, 2 December 2015 (UTC) - That's using Jihad wrong. A Jihad is a crusade against UNbelievers. Which is me and Ryulong, (and about 7 others right now) in this case. :) - Kitsunelaine 「Beware. The foxgirls are coming.」 03:31, 2 December 2015 (UTC) - From RW:MISSION: - Trim hard back to missional content, mod-lock forever, slap Ryulong and his little friends with a wet fish. Anyone who gives a shit about this cartoon is a fucking muppet. Bicyclewheel 15:53, 5 December 2015 (UTC) - Finally, someone who speaks my language! Reverend Black Percy (talk) 16:08, 5 December 2015 (UTC) - I wholeheartedly agree, although I hope to be forgiven for entertaining a nasty suspicion that yet another shitstorm will break out over the definition of which bits of the current content are "missional"... ScepticWombat (talk) 16:42, 6 December 2015 (UTC) Timeline of Gamergate | Result: Kept (snowball clause)[edit] Delete[edit] - Tl;Dr We already have a timeline on the main GG article, this articles existence is redundant besides to catalog every minute event, something we do not do to other much more wiki-elevant topics or even CP these days "Paravant" Talk & Contribs 23:27, 9 December 2015 (UTC) Keep[edit] - Actually, this is one of the best articles on GG on the internet. It's (apparently) widely used by anti-Gamergaters. It's even been (sometimes) praised by KotakuInAction for how completely it documents events (albeit from the wrong perspective, according to them). The FCP Foundation (talk/stalk) 23:43, 9 December 2015 (UTC) - It is too detailed and well referenced an account to get rid of. If it is as widely used as FCP says then it is especially valuable to keep. As for its missionalality it seems to me to be a part of refuting the (relatively recent) pseudo history pushed by the GGer's (about their own movement and their opponents). I do not see it as redundant. SolPyre (talk) 00:39, 10 December 2015 (UTC) - It is ridiculously (a) well referenced (b) useful (c) missional: refuting a right-wing reactionary crank movement trying to use media lies. It is part of the detailed backing material on the subject. 7513 hits in November and 6816 in October, it's clearly useful to someone - David Gerard (talk) 00:41, 10 December 2015 (UTC) - Clearly, this article is important outside of RationalWiki. As such, it would be penny-wise and pound foolish to get rid of it. Gooniepunk (talk) 01:02, 10 December 2015 (UTC) - It is something that is needed to combat Gamergaters when they try to spin the truth and engage in history revisionism, which is incredibly common. As such, the site needs to keep it. I 100% agree with a point David made about the topic (albeit over a different article) here, and that kind of argument style is much easier to work with when you have a fully cited, extensive list of factual events at your disposal.- Kitsunelaine 「Beware. The foxgirls are coming.」 01:07, 10 December 2015 (UTC) - The Gamergate articles are good as long as many reasonable people also edit them. I find them impressive.---Mona- (talk) 01:10, 10 December 2015 (UTC) - I like it, it's comprehensive. Reverend Black Percy (talk) 01:11, 10 December 2015 (UTC) - Very good reference; one of the best on the 'net. --Cosmikdebris (talk) 01:13, 10 December 2015 (UTC) - No substitute. Narky Sawtooth (Nyar~) 01:41, 10 December 2015 (UTC) - If for no other reason than to keep the main Gamergate article semi-readable. - Smerdis of Tlön, LOAD "*", 8, 1. 01:46, 10 December 2015 (UTC) Merge/redirect[edit] Goat[edit] - Technically, this could just be moved to a WIGO:Gamergate archive page. Also, I'm surprised no one's nommed this before. 141.134.75.236 (talk) 23:32, 9 December 2015 (UTC) - It's 'cuz we didn't want the ensuing war with a certain somebody. Gooniepunk (talk) 23:40, 9 December 2015 (UTC) - A WIGO gamergate would just get everything downvoted by the GG trolls. Bicyclewheel 00:11, 10 December 2015 (UTC) - Well, as I said, at this point it would just be an archive page. Adding those rating thingies to it all this time after the events occurred would just be silly anyway. 142.124.55.236 (talk) 00:45, 10 December 42015 AQD (UTC) - Ambivalent, is certainly not a good article, but it seems like a lot of work to just throw away. Reserve the right to change my vote if people make a good argument. Tielec01 (talk) 00:02, 10 December 2015 (UTC) - 8:1. Can we call snowball clause? Mʀ. Wʜɪsᴋᴇʀs, Esϙᴜɪʀᴇ (talk/stalk) 01:29, 10 December 2015 (UTC) - 10:1 now. And probably. 142.124.55.236 (talk) 01:43, 10 December 42015 AQD (UTC) - Wait! Can't we at least get to HCM3 first? This has been no fun.---Mona- (talk) 01:53, 10 December 2015 (UTC) - Give me something to yell at you about! We can't keep agreeing with each other, it's unnatural! - Kitsunelaine 「Beware. The foxgirls are coming.」 01:54, 10 December 2015 (UTC) - I'm afraid we must endure the tragedy of agreement because you are too much of an asshole to change your mind. (How's that?)---Mona- (talk) 02:20, 10 December 2015 (UTC) - BUWHAAAAAAAAAAT?! ME! AN ASSHOLE?! YOU KNAVE! YOU AND I MUST DUEL TO DECIDE THE TRUTH ON THE MATTER. LETHAL COMBAT IS THE ONLY OPTION. - Kitsunelaine 「Beware. The foxgirls are coming.」 02:24, 10 December 2015 (UTC) - I see no reason not to close this vote. Gooniepunk (talk) 01:59, 10 December 2015 (UTC) Category:Victims of medical woo | Result: Deader than the victims themselves[edit] Delete[edit] - In anecdotes, one can never be absolutely sure about what caused a person's demise. Кřěĵ (ṫåɬк) 11:53, 7 December 2015 (UTC) - I don't think we need an AfD for an empty category. So I just went ahead and deleted it. Carpetsmoker (talk) 11:55, 7 December 2015 (UTC) Keep[edit] Merge/redirect[edit] Goat[edit] Fun:Kurt Wise | Result: Wisely dead[edit] Delete[edit] - Not funny. Herr FüzzyCätPötätö (talk/stalk) 16:49, 6 December 2015 (UTC) - The template text "Tired of laughing?" just fits that article too well. Reverend Black Percy (talk) 22:57, 6 December 2015 (UTC) - I can't disagree with our feline friend's reason for deletion. Spud (talk) 05:23, 7 December 2015 (UTC) - IMHO we can remove at least half of funspace btw. Some of it is nice, the rest ... meh ... Carpetsmoker (talk) 08:27, 7 December 2015 (UTC) Keep[edit] Merge/redirect[edit] Goat[edit] Rapa Nui | Result: Keep[edit] Delete[edit] - Highly unclear if missional, lacks sources almost entirely. Reverend Black Percy (talk) 03:14, 5 December 2015 (UTC) - Let me clarify right now, also: I'm kinda really going for a vote on rewriting the page from scratch here to focus on the woo. Currently it's just an appaling, unsourced high school essay on Rapa Nui that attempts to stylistically ape a general encyclopedic article (which is off mission). The woo musn't be missed, but I suspect a brand new article would literally be best. That, or we slice the fat off of the current one - leaving about 15% of it standing, mind you. Reverend Black Percy (talk) 03:36, 5 December 2015 (UTC) - The page could be better, yeah (mostly lack of citations); but I don't think there are any fundamental problems with it, as such. Why do you want to trim it to 15%? Carpetsmoker (talk) 06:39, 5 December 2015 (UTC) - Well, I was under the impression that the article had perhaps strayed further from the mission than the mob actually considers it to have done - and I don't disagree with what's been said below. I was mostly struck by the length of an article lacking sources, the apparent lack of snark, the encyclopedic tone, topped off by the lack of template to quickly indicate what the woo was. Thus; I've updated my views on what constitutes an article worth keeping. Someone who knows how to set the result to Keep and conclude this AfD would be a dear to do so. But I still mean that the article will need a rewrite; never mind the inherent trouble in having a tall article with basically no sources. Having brought it to the attention of the mob has hope fully accomplished something in and of itself. Reverend Black Percy (talk) 12:22, 5 December 2015 (UTC) - Sure, this page could be a lot better, but "slice the fat off of the current one - leaving about 15%" is too fanatical IMHO. Not everything needs a pin-point focus on the woo, describing some history is useful for context, and describing other curiosities (like the writing) is just interesting (and why not?) ;-) Carpetsmoker (talk) 08:20, 6 December 2015 (UTC) Keep[edit] - Rapa Nui is a wellspring of pseudo-archaeological woo. "The states were built by aliens!" "The statues are of aliens!" "The islanders are aliens!" There's also the typical history of Western imperialism and its impact on the indigenous inhabitants. Definitely missional, I would say. --Ymir (talk) 03:31, 5 December 2015 (UTC) - Keep. It just needs more references. Besides the outright pseudo-archaeology associated with Rapa Nui, Heyerdahl's hypotheses remain controversial. Heyerdahl was a real zoologist/geographer who helped popularize the study of ancient civilizations, but his hypotheses are for the most part one of 1) not widely accepted 2) wrong or 3) possibly partly correct. Bongolian (talk) 03:36, 5 December 2015 (UTC) - @Ymir and Bongolian: Can we atleast agree on a "keep under the condition of fixing it up"? Reverend Black Percy (talk) 03:41, 5 December 2015 (UTC) - Come on. We actually need an article about Rongo-rongo . There's a lot of interesting real history, with ecological lessons that are also missional. The statues, of course, were built by little green men from Uranus. - Smerdis of Tlön, LOAD "*", 8, 1. 06:32, 5 December 2015 (UTC) - This was actually one of my very first introductions to woo; as a kid I read this "science" magazine which, in hindsight, promoted all sorts of wootastic views. The Easter island "mystery" (as it was presented there) fascinated me for years until I learned (not that long ago, actually) that it's all bullshit. Very keep. Carpetsmoker (talk) 06:36, 5 December 2015 (UTC) - relevant re: ancient aliens and Von Daniken. Acei9 06:38, 5 December 2015 (UTC) - If you're in no doubt that an article is about a mission-worthy subject but think that the current article is crap, don't nominate it for deletion. If you're sufficiently interested in the subject, start editing the page to improve it. Be bold! If you're not, leave a comment on the talk page, appealing for interested editors to make the page better. You could also leave a message in the Bar in order to get more eyes on the page. We all know that Easter island is a truly wootastic place and there's really no question of deleting the page. Starting it again from scratch, maybe. Spud (talk) 07:10, 5 December 2015 (UTC) - Does the wiki generally delete articles that are about woo if they're overwhelmingly unsourced and poorly written? Sincerely asking, as I'm still learning the Magnificent and Mysterious Ways of RW.---Mona- (talk) 07:32, 5 December 2015 (UTC) - Typically, only if it's truly terrible (which this isn't) or if it may cause legal problems (obviously). Carpetsmoker (talk) 07:51, 5 December 2015 (UTC) - We have a few articles like this - prose popularisations that the main author never really got around to peppering with little blue numbers. Occasionally an article is so terrible that no article is an improvement on what's there, but I wouldn't say this is one - David Gerard (talk) 11:09, 5 December 2015 (UTC) - I could've mirrored Mona's question - I'm still learning, too. So; good to get these replies from the community. As far as my own edumacation is concerned, you didn't all reply to this in vain. Reverend Black Percy (talk) 12:26, 5 December 2015 (UTC) - Keep, missional - David Gerard (talk) 11:09, 5 December 2015 (UTC) - Keep. Clearly missional. I have noticed a tendency to aFD articles here because they could be better. Surely that is not the purpose of an AFD?--TheroadtoWiganPier (talk) 11:32, 5 December 2015 (UTC) - 32℉uzzy; 0℃atPotato (talk/stalk) 14:49, 7 December 2015 (UTC) - More in-depth than most articles, but missional. -EmeraldCityWanderer (talk) 14:52, 7 December 2015 (UTC) Merge/redirect[edit] Goat[edit] November 2015[edit] Kwanzaa | Result: Keep[edit] Delete[edit] - Why do we have a page on this? I see nothing fishy/missional Carpetsmoker (talk) 17:00, 1 December 2015 (UTC) Keep[edit] - The article as is isn't very good, but the ammount of people claiming it's a "made up" holiday and the rage it incites in certain quarters pushes it into "missional" for me. Ann Coulter hates Kwanzaa which means it can definitely be made into a fun article. ("Kwanzaa was invented in 1966 by a black radical FBI stooge") you go, Ann. Dendlai (talk) 17:36, 1 December 2015 (UTC) - Per Dendlai. There's also hay to be made about the resort to Swahili, a very accessible sub-Saharan African language that has about as much to do with the roots of Africans in the New World as Italian does. (Swahili is spoken on the opposite side of the continent.) - Smerdis of Tlön, LOAD "*", 8, 1. 18:11, 1 December 2015 (UTC) - What Dendlai said, I agree with it. SolPyre (talk) 19:05, 1 December 2015 (UTC) - Dendlai&Smerdis+1. ScepticWombat (talk) 19:08, 1 December 2015 (UTC) - Щєазєюіδ Methinks it is a Weasel 20:10, 1 December 2015 (UTC) - What they said. "Kwanzaa is dumb, now let's go kill people at Big Box Mart over Black Friday sales!" --Ymir (talk) 00:28, 2 December 2015 (UTC) Merge/redirect[edit] Goat[edit] Yi Deokil | Result: Deleted[edit] Delete[edit] - Based on 2 refs to "nafar.com", which seems like a Yahoo! Answers-like Q&A site. One of these refs has since been deleted from this site (with no reason given, but makes me wonder why), and the Google translation of the other ref is hard to follow. I can't really find any English resources on this guy at all except us. Unless someone finds more (at least vaguely reliable) references we should probably remove this. I, for one, am not convinced we're not hosting an undeserved hitpiece here on some obscure Korean guy... Carpetsmoker (talk) 08:19, 28 November 2015 (UTC) - We wouldn't accept Yahoo! Answers as the sole reference on a living person article. We shouldn't have an article that relies solely on a similar site in Korean. This probably means the subject of the article wouldn't pass any kind of notability test. Spud (talk) 10:34, 28 November 2015 (UTC) - Current refs insufficient for a bio of a living person. If he's as sue-happy as the article claims, we should consider that before using a 404 page to attack him. Herr FuzzyKatzenPotato (talk/stalk) 11:43, 28 November 2015 (UTC) - As it's also unclear where on the random/interesting nutball scale he falls, but as he seems to be more the former than the latter and with the added problem of bad ref.s, I'll vote delete. ScepticWombat (talk) 16:54, 28 November 2015 (UTC) Keep[edit] Merge/redirect[edit] Goat[edit] - While the cites fail both our BLP tests and our emerging non-English sources test, he's used as a reference in this Wikipedia article. Bicyclewheel 10:47, 28 November 2015 (UTC) Vaccine911 | Result: Deleted[edit] Delete[edit] - This is about a single page with videos that don't load and a link to a PDF that returns a 404. In addition, there is no content on our page that actually refutes anything on this website. Carpetsmoker (talk) 07:47, 28 November 2015 (UTC) - That's true. The web page itself is little more than a broken link. It's really not worth commenting on. Spud (talk) 10:27, 28 November 2015 (UTC) - Doesn't really do or say anything about what is really just an obscure webpage. Looks like someone came across it, wrote about it here, then moved on to something else. Bicyclewheel 10:39, 28 November 2015 (UTC) - Inactive AF. Twitter account last updated in 2010. Herr FuzzyKatzenPotato (talk/stalk) 11:38, 28 November 2015 (UTC) Keep[edit] Merge/redirect[edit] Goat[edit] Motte and bailey doctrine | Result: Deleted[edit] Delete[edit] - "terrible article about a bad neologism for "equivocation" that has any currency almost nowhere Aneris ✻ (talk) 23:23, 22 November 2015 (UTC) - All these obscure, new fallacies could be collected in one article, but do not merit their own stubs.---Mona- (talk) 23:27, 22 November 2015 (UTC) - Scott Alexander/Slate Star Codex, where they would be in the list of local neologisms that no sensible person wants to write. Google ""motte and bailey" -site:slatestarcodex.com" and you'll find nothing except articles on actual castles - David Gerard (talk) 00:30, 23 November 2015 (UTC) - Aneris realising how shit his own terrible articles are? Excellent! - David Gerard (talk) 00:30, 23 November 2015 (UTC) - Reason given: Nicolas Shakel explained: "Some people have spoken of a Motte and Bailey Doctrine as being a fallacy and others of it being a matter of strategic equivocation. Strictly speaking, neither is correct". Sokal: "these texts are often ambiguous and can be read in at least two distinct ways". An equivocation by contrast is a fairly limited trick, "different meanings of a word". Anyway, it's redefined now, made falsely identical, so this doublicate should be deleted from your wiki. — Aneris ✻ (talk) 13:57, 23 November 2015 (UTC) - Щєазєюіδ Methinks it is a Weasel 13:30, 30 November 2015 (UTC) - I was on the fence about this one for a while. Then something occurred to me: The biggest problem is not the rebranding of garden variety equivocation, it's the introduction of the word 'doctrine' in the coinage. Adding 'doctrine' creates the false impression that this is formal aspect of the point being argued, dictated from above. Pointing out a bad argument would be laudable, but introducing this coinage also includes an attempt at straw manning, pretending that there's some formal endorsement of that poor argumentation inherent in that person's standpoint. So, in essence, 'Motte and Bailey Doctrine' is a dishonest rhetorical technique masquerading as unmaking a dishonest rhetorical technique. At best, it should be a footnote on equivocation. Queexchthonic murmurings 12:49, 3 December 2015 (UTC) Keep[edit] - So it's a junior synonym to equivocation. I get that. It's also a frequently encountered form of equivocation. The Sokal quote was a worthwhile example as well. - Smerdis of Tlön, LOAD "*", 8, 1. 05:41, 23 November 2015 (UTC) - Perhaps, but this is still a neologism of no currency. Its presence here is only as propaganda for the LessWrongsphere. "Bait and switch" is closer to a term with any currency - David Gerard (talk) 10:11, 23 November 2015 (UTC) - Given that we have an article on that Alexander guy, why not stick all of the LW neologisms there? - I don't see a problem with this page; sure, it's a neologism that's not often used, but I like it! I don't oppose merge & redirect, either. Certainly the lead paragraphs and perhaps the examples are worth keeping somewhere. Carpetsmoker (talk) 14:13, 24 November 2015 (UTC) - Someone directed my attention to this. Not sure you'll be interested in what I have to say but as the originator of the idea I'd like to mention a couple of things. Contrary to the definition with which you start your entry, a Motte and Bailey Doctrine is not a kind of equivocation *at all*. A doctrine is a body of propositions, not an argument. The whole point of my describing a Motte and Bailey Doctrine was to describe a distinctive kind of corruption that a *doctrine* (or theory, or belief system etc.) may fall into--not to describe a kind of fallacy. (For some reason, you cut off your quotation of me at exactly the point I give the description of the doctrine, leaving only the description of the castle. Perhaps that is part of the reason that the discussion on this page is not about Motte and Bailey Doctrines but confined to a way they can be exploited, namely, equivocation.) What is both clever and bad about a Motte and Bailey Doctrine is that once such once a doctrine is in place, it offers extensive opportunities for deceitful trickery in argument, of which equivocation is only one. But again, part of the point of the description is to identify the root of that trickery in the structure of the doctrine. This is why it is no defence to the diagnosis to say that one particular interlocutor has not promulgated both Motte and Bailey. That would be a defence if they were accused of a fallacy, but no defence if they are accused of making use of this corrupt structure. Of course, people have picked up the term and applied it both to the doctrines and to the argumentative trickery. Nevertheless, the central idea is all about the structure of doctrines, belief systems, theories etc and how, if set up in this way, they are the ground and opportunity for argumentative trickery, not the trickery itself. I tried to give a memorable name to the particular kind of intellectual cheating that a Motte and Bailey Doctrine is, but the cheating itself is messy, which is why it required 7 or 8 paragraphs to lay out the idea on the practical ethics blog and in the original paper in Metaphilosophy. And that takes me to my second point, which is that, quite independently of whatever you want to do with my idea, you should certainly take on board for your policy David Stove's point (in ‘What is Wrong with Our Thoughts?’) that there are indefinitely many ways of cheating intellectually and for most there is no simple way to put one’s finger on how the cheat is effected. There is just the hard work of describing the species in detail. It seems to me that the tenor of your conversation on this page is wanting to wrap things up in tidy bundles. His point is precisely that a great deal of what goes wrong with our thoughts can't be wrapped up like that. n. shackel Merge/redirect[edit] - Add a single paragraph subsection to the Equivocation page, plus redirect. CorruptUser (talk) 01:43, 23 November 2015 (UTC) - As my goat entry says: Create an article on bait-and-switch and merge not only motte and bailey, but also milk before meat into it. Just an idea. ScepticWombat (talk) 03:23, 23 November 2015 (UTC) - Those aren't the same thing. Wēāŝēīōīď Methinks it is a Weasel 19:33, 28 November 2015 (UTC) - I like SW's idea. Herr FuzzyKatzenPotato (talk/stalk) 15:10, 23 November 2015 (UTC) - It belongs somewhere, if not on a page that includes that Scott Alexander guy then some page where these obscure fallacies are aggregated. What page doesn't especially concern me since we can use redirect for various appropriate pages.---Mona- (talk) 20:50, 28 November 2015 (UTC) - To the extent that this needs to stay at all, merge it into the equivocation article with a redirect. Reverend Black Percy (talk) 13:17, 3 December 2015 (UTC) Goat[edit] - i like the concept behind this - "spout bullshit, retreat to vague statements when challenged, Return to spouting bullshit when they leave", but it feels like this has a different name to cover it. --"Paravant" Talk & Contribs 23:42, 22 November 2015 (UTC) - In rhetoric, this has been called "equivocation" for a long time. It is possible the particular subspecies needs a name, but this is unlikely to be it - David Gerard (talk) 00:31, 23 November 2015 (UTC) - As indicated by my edits, I think that motte and bailey (m&b) bears more than a passing resemblance to bait-and-switch (b&s), a far more common term (though it doesn't have an RW article yet). While some of the examples are of equivocation as well, the point is that m&b/b&s doesn't necessarily involve equivocation, but simply a switch from one argument to another. Of the existing RW articles, I'd say it falls somewhere in between equivocation, moving the goalposts and milk before meat (mbm). Personally, I'd prefer a bait-and-switch article (since it also encompasses all kinds of sleazy business practices) and merging m&b and mbm into it as specific variants. ScepticWombat (talk) 03:21, 23 November 2015 (UTC) - We definitely could do with a good article on bait and switch - David Gerard (talk) 10:11, 23 November 2015 (UTC) - Not a bait-and-switch, either, Wikipedia, Urban Dict. What you are doing is called rationalisation. David Gerard has redefined the term to mean "equivocation" (falsely, see above), made it identical and this is of course a good reason to delete it. I think you should pull it through and kill it off, and document once more the postmodernist bent here (also see: DG: "cut out cite to Sokal's non-use" confusing explanation with naming). — Aneris ✻ (talk) 14:22, 23 November 2015 (UTC) - Note the above comment is a good example of "spout bullshit, retreat to vague statements when challenged, Return to spouting bullshit when they leave" but without being "motte and bailey" in the SSC usage - David Gerard (talk) 15:15, 23 November 2015 (UTC) - Whatever man. Cutting out an earlier description and redefining the terms, on a wiki, with everything documented en detail, is far from "vague". I pointed you to the direct quotations from Sokal and Shakel, which were already in the original article, to begin with. You are free to reject what these people say, but then say so. — Aneris ✻ (talk) 17:06, 23 November 2015 (UTC) - Hmmm, why am I suddenly reminded of argumentum ad dictionarium...? - Anyway, consulting Merriam-Webster yields a wider use of b&s, i.e. "2: the ploy of offering a person something desirable to gain favor (as political support) then thwarting expectations with something less desirable" and Wiktionary has a similar extended meaning: "2. (by extension) Any similar deceptive behavior, especially in politics and romantic relationships". Oh, and we also need to keep in mind that dictionaries are descriptive not prescriptive and are thus tricky to use as a clinching argument (especially since the obscure m&b term doesn't even figure in any of these dictionaries in the first place...). - I'm pretty sure I've encountered the wider notion of bait-and-switch elsewhere where it was used to indicate not simply its original meaning of fraudulent advertising, but other instances where an audience or a person is cynically tempted with one thing only to see it replaced by a less desirable alternative when convenient by the one making the initial offer. That seems to me to be the same mechanism at work in the more obscure motte and bailey doctrine too (cynically retreating to the motte when the bailey can't be defended or, conversely, moving into the more pleasant bailey when not pressed too hard). As b&s seems to be a far more well-known concept than m&b, I'd prefer to make the latter a section in an article on the former. Of course, if you think that the meanings of b&s and m&b are completely at odds, feel free to argue why (so far you've provided links, but little in terms of explanations). ScepticWombat (talk) 21:25, 23 November 2015 (UTC) - Like it is with fallacies and similar figures, everything seems broadly mapped out. There are now fallacies for special subsets of strawmans (hollow man, weak man/nutpicking) and there are special terms for rhetorical tricks where the meaning or some other hidden property changes (hidden behind the words or labels, e.g. mental representations). The bait-and-switch would be a form where something desirable to the addressee is promoted, which then gets replaced once the addressee has swallowed it. This might be a case with Scientology and their religious compatiblity claim, which gradually is revealed to be false. I.e. the "attractive", easy version is front and visible first. The motte and bailey, already by metaphor, is about promoting the eccentric version (not necessary attractive one) because this is what proponents actually believe and want to spread. What is similar is that something is switched out, as in the equivocation, but the tactics and circumstances seem inverse. I have to stress that I have no objection to delete it, though. — Aneris ✻ (talk) 04:26, 24 November 2015 (UTC) - Come to think of it, I wouldn't object to merging nutpicking into association fallacy as a subsection either, so... ScepticWombat (talk) 07:19, 24 November 2015 (UTC) - There could be a meta article that describes the switching out of some property, with child-sections for (1) bait-and-switch, (2) motte-and-bailey doctrine and (3) equivocation. Another meta article would describe a family of fallacies such as nut-picking (weak-man), hollow man and straw man. They are also paired that way in Aikin's paper. — Aneris ✻ (talk) 19:41, 28 November 2015 (UTC) Chinese robber fallacy | Result: Deleted[edit] Delete[edit] - Your fourth Anerisism of the day. Neologism from the LessWrong-sphere with no currency outside it; there may be a fallacy something like this, but this won't be its proper name and this text won't be a good article on it. Part of Aneris's SSC fan club membership application - David Gerard (talk) 21:22, 22 November 2015 (UTC) - You missed a great "Anerysm" pun there |₹Λ¥$€₦₦ I like... being punched in the face. 02:58, 23 November 2015 (UTC) - Quite similar to Overgeneralization, isn't it? Dendlai (talk) 21:34, 22 November 2015 (UTC) - I've never been convinced this needed its own term. If it's a product of LW NIH mindset, that explains it. Doesn't help that the examples are laughable. Queexchthonic murmurings 21:59, 22 November 2015 (UTC) - I didn't know there was a conflict of "spheres". I actually hope you delete. — Aneris ✻ (talk) 23:15, 22 November 2015 (UTC) - The only conflict is that LW/Scott's habit of neologism is pretty much always terrible - David Gerard (talk) 00:10, 23 November 2015 (UTC) - Maybe we could have an article collecting all these "obscure new fallacies Some Guys use," but not a separate article for each.---Mona- (talk) 23:24, 22 November 2015 (UTC) - Scott Alexander. Someone suggested an LW Jargon Translator on to do, but nobody who could write it wants to - David Gerard (talk) 00:10, 23 November 2015 (UTC) - Axe it. ScepticWombat (talk) 03:30, 23 November 2015 (UTC) Keep[edit] - Nothing wrong with this page. Who says we can't we document (on-mission) neologisms? "Anerisism" or "from the LessWrong-sphere" are not valid arguments for chucking content people spent their free time writing (although the content could possibly be copied/merged in another page; not sure which from the top of my head, though). Carpetsmoker (talk) 19:49, 26 November 2015 (UTC) Merge/redirect[edit] - Anything useful can go to overgeneralization. αδελφός ΓυζζγςατΡοτατο (talk/stalk) 15:12, 23 November 2015 (UTC) - It's not an overgeneralization. — Aneris ✻ (talk) 01:11, 27 November 2015 (UTC) Goat[edit] Frankenstein fallacy | Result: Deleted[edit] Delete[edit] - Third Aneris special on this page! Bad article about a local neologism created by Aneris to prop up his other bad articles about his favoured neologisms. If this thing has a proper name put it there, if not kill it until someone comes up with an article that's an improvement on a red link David Gerard (talk) 21:19, 22 November 2015 (UTC) - He's also trying to get it onto TVTropes. He's definitely on some kind of... weird mission. Dendlai (talk) 21:26, 22 November 2015 (UTC) - I don't really know who Aneris is or why there seems to be conflict surrounding him (care to enlighten me?), but just for the sake of your discussion: he's also furthered his neologism on Slymepit, here. I'm moving for deletion since the main problem with this fallacy - aside from it not having been fleshed out even to the point of properly defining itself - is that the fallacy itself is literally an invention, and the article made by the "inventor" - meaning that we will never find any sources for our article, except for ones from other pages, looping back to Aneris. Though I suppose if the article was made into a masterly exposition on it, I'd reconsider. But for now? Meh. Reverend Black Percy (talk) 21:37, 22 November 2015 (UTC) - He appears to be a fan of Scott Alexander here to show us the error of his ways. When he describes himself as "left-liberal", that's the sense he appears to mean it in, i.e. about what Gamergate mean when they say the same - David Gerard (talk) 21:48, 22 November 2015 (UTC) - The Slymepit? Oh, my. Queexchthonic murmurings 22:11, 22 November 2015 (UTC) - A Slymepitter indeed. Though the posts are simply post-LessWrong jargon. So, the MRA end of the Rationalist subculture - David Gerard (talk) 00:08, 23 November 2015 (UTC) - This has gone nowhere other than to circle the drain. Queexchthonic murmurings 22:07, 22 November 2015 (UTC) - If not found useful, it can be deleted. I personally don't care. What is useful is not a name, or an entry, but spotting the fallacious use. I'm not poorer when it is deleted, go ahead (count my vote always as delete in case of doubt). — Aneris ✻ (talk) 23:08, 22 November 2015 (UTC) - There's no such animal.---Mona- (talk) 23:15, 22 November 2015 (UTC) - ωεαşεζøίɗ Methinks it is a Weasel 19:29, 28 November 2015 (UTC) Keep[edit] - Neologism, yes. Useful concept, also yes. 32℉uzzy; 0℃atPotato (talk/stalk) 22:03, 22 November 2015 (UTC) - Again, if the article is fleshed out in a qualitative and quantitative sense, and the fallacy istelf is demonstrably novel in what it describes, then I'm all for keeping it. Reverend Black Percy (talk) 22:22, 22 November 2015 (UTC) - The problem here is that the title is bad, and the text is also bad. Neither is worth keeping - David Gerard (talk) 00:09, 23 November 2015 (UTC) - You may not like it, which is okay, but I don't see how it's "bad". It explains the concept, is neutral, etc. What's "bad" about it? Carpetsmoker (talk) 19:53, 26 November 2015 (UTC) - I see no reason to delete this. Carpetsmoker (talk) 19:53, 26 November 2015 (UTC) - Mr. Gerard cites ideological reasons, namely that he (falsely) believes that it is connected to LessWrong (which for a reason known only to Mr. Gerard is very bad). I haven't the faintest idea whether what he says about LessWrong is true, but his reasons aren't rational. Orthodox rationality holds that a statement is independent from the person saying it. The ad hominem is therefore valid as a rhetorical device only, but not always a rational one. It can persuade an audience that a person is unreliable and thus their information is likely unreliable, too. That's why it was fashionable in the Days of Yore, but is today typically a fallacy since information can be independently checked and there is no need to trust or like someone. In addition, I have nothing to do with the LessWrong site, never introduced the fallacy there (for the excellent reason that I don't frequent that site) and since I've found it missing here, I simply proposed it as a new idea. I also wrote then on it's talk page: "I'm not mad when the established people don't find this one useful or fitting, but I thought I propose it." David Gerard used these various delete instances as a way to propagate falsehoods about me and to make the usual histrionic specatcle typical for SJWs to achieve a chilling effect. This is of course very different from "constructive dialogue" as falsely asserted the front page. But I recognize that it's Mr. Gerard's wiki that adheres to the SPOVGPOV, therefore the article should be deleted. — Aneris ✻ (talk) 19:26, 28 November 2015 (UTC) Merge/redirect[edit] Goat[edit] - There's nothing wrong with us making neologisms, but they really ought to be evidenced. This one isn't, yet. Bicyclewheel 23:05, 22 November 2015 (UTC) - But there is the issue of stubs, and a lot of wacky bullsit all from the same editor. For now, it seems to me we should collect all the obscure and new fallacies into one article. Then give them their own page when and if the text on that fallacy grows so large that it's indicated.---Mona- (talk) 00:16, 23 November 2015 (UTC) - Yes, a whole lot of ill-thought-out stubs is a bad thing. I like your list idea. Bicyclewheel 11:25, 23 November 2015 (UTC) - We can SJW the hell out of this by filling it to the brim with those horrible "dish ish sexist but dish ishn't 'cause ahm a hypercrit" comics! Narky Sawtooth (Nyar?~) 21:37, 25 November 2015 (UTC) Sorkatonaság | Result: delete[edit] Delete[edit] - Appears to be plagiarized from elsewhere. The parts that aren't plagiarized have poor grammar and are personal rants. Narky Sawtooth (BoN is paranoid!) 19:29, 26 November 2015 (UTC) - Also, it's from 2011 and was added entirely by one person. Said person doesn't edit here anymore. I'll have to comb through their other pages, it might be a good idea to nuke 'em. Narky Sawtooth (BoN is paranoid!) 19:32, 26 November 2015 (UTC) Keep[edit] Merge/redirect[edit] Goat[edit] No platforming | Result: No consensus[edit] - I'm closing and locking this AfD as it's just got derailed into arguing about particular cases, rather than sticking to "should this article exist or not" and I've had enough. Bicyclewheel 09:29, 25 November 2015 (UTC) Delete[edit] - Delete: As the original creator, please DELETE. Aneris ✻ (talk) 02:50, 22 November 2015 (UTC) - Off-mission, as it's not even tangentially related to any of our mission subjects. It's also a relatively recent phenomenon to make a fuss about it, so it strikes me as too minor tobother with. Plus, as it stands, it is monumentally badly-written: "Therefore, no platforming typically violates Article 19 of the Universal Human Rights (freedom of expression, and freedom to receive information without interference)" I mean, come on. Queexchthonic murmurings 12:09, 20 November 2015 (UTC) - This is a new reactionary snarl word when people with exteme right-wing views (of which Aneris's examples are wingnut Islamophobes and TERFs, as well as an oblique reference I bet to Christina Hoff Sommers) have their planned university talks protested to where the talks are cancelled at the request of the students who aren't redpilelrs. It's more "political correctness gone mad" and "coddled liberal safe spaces".—Ryulong (talk) 12:23, 20 November 2015 (UTC) - It doesn't matter if she's floridly wrong about something; a world in which people aren't interested in what Germaine Greer has to say is one that would seem to have lost its sense of history. - Smerdis of Tlön, LOAD "*", 8, 1. 16:35, 20 November 2015 (UTC) - People don't like her because she incites hate against the transgender community.—Ryulong (talk) 21:12, 20 November 2015 (UTC) - I very much doubt Greer "incites hate" against anyone. The god Google has revealed to me that the "no platforming thing" seems largely confined to the UK and Oz. It's mostly about feminists whose views on transgendered people are disapproved of, near as I can tell.---Mona- (talk) 22:27, 20 November 2015 (UTC) - I've read of it being used in the context of denying racists a platform (eg this article from 2014). It's not just something that sprang up around this Germaine Greer story. Bicyclewheel 23:01, 20 November 2015 (UTC) - Having finished doing bizarre things with Bicycle Wheel's comment and then rectifying it, I now add: Yes, I did see a few articles about "no platforming" racists. But the top results were almost all about how it's spreading to feminists who hold views on trans people that many find unacceptable.---Mona- (talk) 23:12, 20 November 2015 (UTC) - It's because women like Greer are assholes and behind the times. "No platforming" is just an extension of the "outrage" against safe spaces and the like.—Ryulong (talk) 00:03, 21 November 2015 (UTC) - Generally, I take a dim view of the "safe space" phenomenon, especially on campus. That said, I don't have a quarrel with refusing to host Greer. No one is entitled to a hosted venue.---Mona- (talk) 00:20, 21 November 2015 (UTC) - People don't like her because she incites hate against the transgender community. So she's wrong about something. She's an old time feminist, so I probably think she's wrong about more than just that. On the other hand, she wrote an important book and participated in a major social movement at a key point in its history, and led an interesting life back in the day. These things merit abiding respect and interest, at least for me, even if she's badly wrong about something. I don't agree with her about trans people. But I think a lot of the unease at what she says -- just like the Rachel Dolezal incident -- is because she uncomfortably reminds everybody that identity politics necessarily raises issues of authentication and authenticity that become nastier the closer you look at them. That's an inherent problem with identity politics. What I don't get is why it becomes acceptable to seek to drive her from the podium just because she does not tick all the boxes of approved opinions. - Smerdis of Tlön, LOAD "*", 8, 1. 02:29, 21 November 2015 (UTC) - Greer's talk wasn't ultimately cancelled. The relevance she brings to the table now is questionable when she denies the gender of women because of how they were born.—Ryulong (talk) 03:41, 21 November 2015 (UTC) - No, her talk wasn't cancelled; it's still somewhat troubling that anyone would want to. And relevance is overrated. And I find her opinion plausible, if wrong. My personal conclusion is that the state of being transgendered appears to be bred in the bone; human sexualities are complicated biochemical phenomena. I agree with Greer that sexualities are a biological fact; it's just somewhat more complicated than she imagines. What's really telling about the Greer incident is that she thinks that, despite what the Big Book of Cant says about cis/male/het privilege, the supposedly undesirable category of "woman" is something that needs policing to exclude interlopers. This too suggests the presence of heretical nuances, and is the most interesting thing about the whole argument. And this is beside the major point, which is that lobbying to withdraw an invited speaker on the basis of their unpopular opinions is beyond the pale. The window of allowable opinions seems dangerously small. It seems faintly ridiculous to label Greer a 'reactionary'. - Smerdis of Tlön, LOAD "*", 8, 1. 04:32, 21 November 2015 (UTC) - TERFs are considered to be bigots for advocating against transgender rights. Greer is a TERF. Therefore, Greer is a bigot (towards the transgender community). Simply because she was a seminal feminist author doesn't mean she isn't a horrible person when it comes to transgender people. The rest of your comment seems to be the "I'm too old to understand these coddled liberal hippie teenagers" type of response to these sitations.—Ryulong (talk) 08:11, 21 November 2015 (UTC) - Delete or change it to be something other than ramblings. Narky Sawtooth (Floof!~) 12:46, 20 November 2015 (UTC) - Typhoon (talk) 13:07, 20 November 2015 (UTC) - Delete. Nothing here salvagable about the snarl word. Hipocrite (talk) 13:20, 20 November 2015 (UTC) - Delete: Examples and wording sound the BS alarm of the false equivalencing between "We don't want your hate speech at our venue" and "IT'S A CONSPIRACY TO SILENCE ME!!!!11!!". ScepticWombat (talk) 14:30, 20 November 2015 (UTC) - To say I hold an opinion about keep-or-delete would be lie. But if it is kept, couldn't a buncha reasonable people just do the editing the current tripe screams for? If this "no platforming" is a thing with reactionaries shouldn't we cover that? I dunno. As I say, it's hard for me to really care.---Mona- (talk) 22:11, 20 November 2015 (UTC) - If the examples used are typical of the use of the word and we keep the article, then "no platforming" is apparently a snarl word used whenever some wingnut, TERF or whatever doesn't get invited or gets "uninvited" due to an outcry from the regular attendees of whatever forum/venue it is that rejected said wingnut/TERF/whatever; thus any kept article should reflect that. PS. I would not be surprised at all to see examples of moonbats or their supporters using the same claims as they tend to have similar persecution complexes. - Yes, I have heard the argument that "We shouldn't give X a platform for her/his views", but the subtext here is actually "a(nother) platform", since it's absurd to claim that the "uninviting" of the examples mentioned means that they'll have no platform at all, simply that they won't get this particular platform. - Hell, I'll happily admit that I've made the same argument when a certain Dutch Trump lookalike was invited to the Danish "People's Meeting" (a sort of democracy and debating festival where "the people", the politicians, the lobbyists and the media can hobnob and drink beer together); first off, Mr. Crazy hairdo has jack shit to do with Danish politics, secondly, his wingnuttery shouldn't be given the implicit approval such an appearance carries, and third, I resent my tax money being spent on the heavy police protection necessary to protect this douche bag who had no business showing up in the first place. The icing on the cake was that he wasn't event the most wingnutty foreign guest: a member of freaking Golden Dawn was offered a speaking slot too, as well as a charming French dude who was too wingnutty for Front National, oh, and a bona fide Italian fascist too... (Un)Surprisingly, the latter three were all invited by a minuscule far right Danish political party called "The Party of the Danes" which apparently got a free hand to invite all kinds of crazy wingnuts, despite not having managed to win a single seat at any level of political office in Denmark, not even on local councils. ScepticWombat (talk) 04:24, 21 November 2015 (UTC) - Well, I changed my vote cuz with you and other sensible people now editing the page it's turning into something useful. And, when I googled Motte and Bailey, RW came up on the first page of results. So, we could make a difference here.---Mona- (talk) 04:30, 22 November 2015 (UTC) - Eh, this is about no platforming, so what has motte and baily got to do with it? ScepticWombat (talk) 04:53, 22 November 2015 (UTC) - Not an improvement on a red link - David Gerard (talk) 15:39, 20 November 2015 (UTC) - Delete, if only to encourage Ruylong to get out of the basement for a while. Peace. AgingHippie (talk) 03:07, 22 November 2015 (UTC) - |₹Λ¥$€₦₦ Hahaha, what a story Anonymous user 05:03, 22 November 2015 (UTC) Seeing that Ryo is now editing it and takes this to be another of "his" pages, I say delete to avoid endless bullshit.---Mona- (talk) 03:47, 21 November 2015 (UTC) - Geez, Bubbe. That's harsh.—Ryulong (talk) 08:06, 21 November 2015 (UTC) - It's hilarious to hear this from someone who started such a huge drama the moment he edited stuff related to Israel. Typhoon (talk) 08:49, 21 November 2015 (UTC) - The name "Mona" is female, and I am female. In any event, I didn't found any of the I/P articles (except for Steven Salaita) and my point of view is the majority one among interested editors. The ruckus was not caused by my, but rather, primarily by two people who are currently blocked. While I may substantively often agree on an issue with Ryo (tho when I do not, I really do not), he is very unreasonable. Dealing with those "other two" as often as I do is far, far more than enough for me.--[User:-Mona-|-Mona-]] (talk) 03:15, 22 November 2015 (UTC) Keep[edit] - Keep but improve/rewrite. This is basically the same as Cordon sanitaire , which is a common tactic to exclude some of the populist and nutty parties out of the political debate. I would also support moving it to Cordon sanitaire, as this is the more common term AFAIK. The SJ stuff can be a section in this. Carpetsmoker (talk) 12:19, 20 November 2015 (UTC) - The SJ stuff is just right wingnuttery considering his examples of people who were no-platformed are atheist Islamophobes (Ayaan Hirsi Ali and Maryam Namazie ) and TERFs (Germaine Greer and Julie Bindel ).—Ryulong (talk) 12:31, 20 November 2015 (UTC) - ? I don't see the wingnuttery here. It's mostly (though not entirely) a neutral description. Carpetsmoker (talk) 12:43, 20 November 2015 (UTC) - It's only reactionaries who get "no platformed". Ali and Namazie spread anti-Islamic sentiment, Greer and Bindel are infamously opposed to transgender rights, Milo Yiannopoulos was going to talk with Bindel and he's the biggest right wing personality out there right now. Most of his sources concern the TERFs being "no platformed" outside of the two instances of Ali (who we have an article on that goes into detail about her wingnuttery) and Namazie (who apparently gets a pass for her anti-Islamic sentiment because she's an atheist like Richard Dawkins does every so often).—Ryulong (talk) 12:47, 20 November 2015 (UTC) - I fail to see how your reply answered the question. So what if it only happens to cranks? Doesn't mean we can't have a page about it. Carpetsmoker (talk) 12:50, 20 November 2015 (UTC) - Cordon sanitaire would be a good article, but it might as well be a ground-up rewrite. The only salvageable parts would be the examples and their references, and even then we'd need to expand them to include some older examples.Queexchthonic murmurings 12:33, 20 November 2015 (UTC) - All of his examples are just TERFs (and Milo Yiannopoulos considering he was going to speak with Bindel) or Islamophobic people being uninvited from speaking at campuses.—Ryulong (talk) 12:39, 20 November 2015 (UTC) - So? The examples are still valid, no? Carpetsmoker (talk) 12:50, 20 November 2015 (UTC) - Cordon sanitaire would appear to be about something entirely different: the refusal to consider coalition governments with a political party based on its history or ideology, something that only comes up in Westminster style parliaments. - Smerdis of Tlön, LOAD "*", 8, 1. 16:32, 20 November 2015 (UTC) - Actually, no, it's broader than that. Although it does seem to refer to specific action by the political establishment rather than by private bodies, no it's still not the same thing. On the other hand, that makes 'no platforming' an even more pathetic complaint, as it then means nothing more than preventing groups institutions from exercising autonomy. Queexchthonic murmurings 16:38, 20 November 2015 (UTC) - It seems to me that it's effectively the same concept/idea; have two pages seems unnecessary to me, it's a choice between "No platforming" with a section on "Cordon sanitaire", or "Cordon sanitaire" with a section on "no platforming"... Carpetsmoker (talk) 17:01, 20 November 2015 (UTC) Keep. An increasingly prevalent form of authoritarian bullying.Please, not that asinine XKCD cartoon again. - Smerdis of Tlön, LOAD "*", 8, 1. 13:18, 20 November 2015 (UTC) - Obviously a contentious issue, rightly or not. It would be remiss not to cover it. The present article is weak & one-sided so will need a fair amount of work. Wẽãšẽĩõĩď Methinks it is a Weasel 13:24, 20 November 2015 (UTC) - It's weak and one sided because it only affects reactionaries.—Ryulong (talk) 13:50, 20 November 2015 (UTC) - Is it? It seems like feminists & LGBT campaigners have said quite a lot about silencing techniques over the years. Plus haven't Gamergaters been pressuring event organisers & media to deny a platform to Sarkeesian & other critics? Wěǎšěǐǒǐď Methinks it is a Weasel 19:30, 20 November 2015 (UTC) - Thanks Ryulong, for exposing your authoritatian thinking so frankly. Of course the situation is that the ideology that does this isn't the "good people" who block some cretins. Some no-platformed were new atheist ex-muslims, and it's precisely unimportant who someone is. This is where Ryulong and gang expose themselves as anti-democrats and anti-pluralists. They're even against the universial human rights (which is not surprising to me). If someone wants to attend an event, they can do so without interference, whether our thoughtpolice here believe they know better what's good for everyone or not. Other people in the article list may be cretins, but I only have superficial understanding about the intra-SJW-wars (which also ripped FTB apart), there are surely experts on the TERF war. I merely reported on what is true and recorded recent instances I found and went for primary sources when I could find them, not whether I like some people. So, what's broken RW, that you have a bunch of anti-science, anti-democratic, creepy thoughtpolice people stalking around who revert and flak everything that is critical of their postmodern identitity politics intersectionality racism, then claim there was "nothing" because they themselves scrub everything squeaky clean? How can you maintain your stated SPOV goals. Has science lost the science war against postmodernist ideologues somewhere and I haven't received the update? I'm fine with that, but then please. Do everyone a favour and stop lying about your alleged SPOV. In case with SJWs, there is usually only a false balance. They are a fairly unique anti-democratic lot. Aneris ✻ (talk) 13:34, 20 November 2015 (UTC) - Do you ever listen to yourself, Aneris? We could write essays on all the buzzwords that you just used in your rant. Typhoon (talk) 13:39, 20 November 2015 (UTC) - The article was rewritten and now begins with "No platforming is a snarl word used by n[e]o-reactionaries". You can see it in real time. The mere act of naming the practice, which obviously and evidently exist, is already making someone by definition "right wing". Maryam Namazie was removed, presumably, because she's one of the more liked people on the list. This is just crazy, just as your continued denial. Aneris ✻ (talk) 13:42, 20 November 2015 (UTC) - You realize you're complaining that people weren't given a platform to spread what people considered hate speech and bigotry right? Just because that bigotry comes from the left and to people on the left doesn't mean it's political correctness gone mad or "intra-SJW wars".—Ryulong (talk) 13:58, 20 November 2015 (UTC) - Could do with a hefty rewrite, but "no platform" is a longstanding position within the left (see here for example) and warrants examination. When decent people like Maryam Namazie get lumped in with white nationalists, something's gone wrong with the idea. Tallulah (talk) 13:43, 20 November 2015 (UTC) - It might be because her stance is singularly focused on a single religion that isn't Christianity. We call out Richard Dawkins on his Islamophobic statements. Why is Namazie different?—Ryulong (talk) 13:52, 20 November 2015 (UTC) - She is an ex-Muslim. She was brought up in Iran. When it comes to Islam, she knows what she's talking about. I don't keep up with Dawkins so I can't comment on his views. Tallulah (talk) 14:02, 20 November 2015 (UTC) - Most atheists are ex-whatever religion their parents were. All I know about her is what Wikipedia has and that a search engine brought up enough results with regards to her name and the term "Islamophobia". Perhaps someone should write a better page about her locally so I can be better educated on her point of view.—Ryulong (talk) 14:18, 20 November 2015 (UTC) - Keep, but yes it needs improvement. Rename to Cordon sanitaire, widen scope and include historical perspective. This is by no means a current issue only. --TheroadtoWiganPier (talk) 13:49, 20 November 2015 (UTC) - I'm astonished by the editing process. It now lists only two names of TERFs. Gone are the other sourced recent cases, like in fascist propaganda, just remove and hide what doesn't work and spin a new story. How is this acceptable for a halfway sane, rational, person? Amazing. The project is fucked. You can't do anything about it at this point, since every inclusion of information that is not liked by authoritarians is reverted and flakked immediately. And there is no sound reason either, since Namazie and others were evidently no-platformed. Kiss the SPOV goodbye already. Aneris ✻ (talk) 14:47, 20 November 2015 (UTC) - You weren't even snarky when writing this shit so how can you even be incensed that your grand vision of pointing out battles in the SJW wars is going unnoticed?—Ryulong (talk) 14:51, 20 November 2015 (UTC) - Also I see the entry on Hirsi Ali was not "not platform" but "we're not giving her an honorary degree" and you neglected to post the full title of the footnote on Namazie. You do love being disingenuous, don't you?—Ryulong (talk) 14:59, 20 November 2015 (UTC) - Aneris, your continuous intentional misusing of words like 'fascism' and 'authoritarians' is not making you look sane at all. Typhoon (talk) 15:05, 20 November 2015 (UTC) - Altemayer, The Authoritarians, The New Totalitarians Are Here, Fascism at Yale, Entartete Kunst and so on and so on. You can also have a detailled critique. It's obviousy a highly dubious practice to hide half of the cases, leave the few persona non gratas, then rewrite the story that only bad people were no platformed. Splendid. So it's basically correct what I wrote the whole time. Aneris ✻ (talk) 15:27, 20 November 2015 (UTC) - Yes, keep telling yourself how you're correct while you call everyone and their dog a fascist and authoritarian. Typhoon (talk) 15:35, 20 November 2015 (UTC) - I very much doubt, Aneris, that you understand Altemeyer's fine book. While he does document some strain of Authoritarianism coming from the left, his work overwhelmingly exposes that the trait is very largely found on the right.---Mona- (talk) 17:37, 20 November 2015 (UTC) - The parts that talk about the left are the only parts that matter to Aneris. Typhoon (talk) 18:00, 20 November 2015 (UTC) - Damn, that Fascism at Yale opinion piece is either a facepalmingly inept analysis or an example of how pathetically perfidious sniping between Ivy League institutions can be (or possibly both...). That someone able to get into Harvard Law School is, apparently in all seriousness, equating spitting on someone with fascism illustrates a stupendous lack of understanding of ideologies, let alone a sense of historical proportions. Sure, spitting on someone you disagree with isn't a proper way of discourse or communication, but labelling it fascism shows that the one doing the labelling is either ignorant about fascism's content and lineage, or, possibly, the extent to which, in some circles of U.S. public discourse, "fascism" has joined "Nazism", "communism" and "socialism" as essentially terms devoid of content beyond being derogatory slurs against one's opponents. One wonders what Mr. Barlow would do if confronted with an actual fascist, having already emptied "fascism" of its prior ideological and historical content... ScepticWombat (talk) 18:28, 20 November 2015 (UTC) - I believe that free speech does require, to some extent, a platform. It's as possible to functionally silence people by preventing people from listening as preventing people from speaking. This article should present the use of silencing by authoritarian governments, the massive number of instances from the right, and the significantly smaller number of instances from the left. FuzzyCatPotato of the Big Persons (talk/stalk) 02:45, 21 November 2015 (UTC) - The issue is that "no platforming" is just "We don't want you to talk at our school now" and not at all like the concept of cordon sanitaire. It's the actions of private entities to decide that they don't want a particular guest speaker and not a government imposing mass censorship. Unless "no platforming" in the sense that Aneris intended it to be about says it's complete bullshit based on the concept of freedom of speech being misinterpreted as right to an audience to hear them (as has been the result of heavy editing by myself and Hipocrite) then the page should go.—Ryulong (talk) 03:41, 21 November 2015 (UTC) - The problem is that the fame of the examples used clearly illustrates that they do have a platform and the ire is simply that they're rejected from some particular platforms whose regular attendees find them distasteful and don't want their platform to help spread the views expressed by, say, Ayaan Hirsi Ali. I'd agree with the hairy feline tuber if: A) The platform rejecting these people was the only platform available, or, B) All platforms uniformly rejected these people. Since neither is the case in any of the examples used, I'd say the XKCD cartoon and its conclusions wholly applies here. ScepticWombat (talk) 04:34, 21 November 2015 (UTC) - If I had to dig up some slightly better examples of "no platforming", it might be the selective reporting documented in Oreskes & Conway's Merchants of Doubt (2011) in which, for instance, free rein was given by the Wall Street Journal to well-known expert for hire, Frederick Seitz, to accuse Benjamin D. Santer and the IPCC of fraud or at least unwarranted alarmism, while the responses to (read: debunkings of) Seitz's accusations by actual climate scientists involved with drafting the IPCC report were either rejected out of hand or heavily edited to remove their most salient points (pp. 208-211). ScepticWombat (talk) 05:02, 21 November 2015 (UTC) - KOMF 03:26, 21 November 2015 (UTC) - The attitude that many people have nowadays - that if I don't like what you have to say, I should do my upmost to prevent you from saying it - is very concerning. It is the attitude, that if I don't agree with your opinions, rather than rationally addressing/deconstructing your arguments for them, I'm going to stand outside your function (or inside if security will let me) screaming. It fits in with point 3 of the mission statement ("Explorations of authoritarianism and fundamentalism"), since it is a form of authoritarianism - a mostly powerless one, but help us if these people ever get real power. (((Zack Martin)))™ 22:02, 22 November 2015 (UTC) - Zack is right. As long as this article isn't hijacked as raving about teh evul SJWs it should stay. The topic is missional and pertains to a serious issue in the UK and apparently also in Australia. Certain sectors are bound to pick it up in the U.S. as well. And there's no reason the editors here would let a hijacking occur.---Mona- (talk) 22:19, 22 November 2015 (UTC) A buncha smart editors are now having at the article. Also, when I google it our entry comes up on the 1st page, and we do want to be famous, amirite? Having now caused the entire wiki to assume I'm drunk to the point of incoherence, I shall take my leave. G'nite.---Mona- (talk) 04:26, 22 November 2015 (UTC) Merge/redirect[edit] Goat[edit] - Moved to Forum:No Platforming RationalWiki:Articles for deletion/EvoWiki/RationalWiki | Result: Deleted[edit] Delete[edit] - FFS, yet another pointless Evowiki port. Do we really need a page for Evowiki's bland, dull article about ourselves? Bicyclewheel 23:11, 22 November 2015 (UTC) - You finally got the AFD right! "Recent Changes" looked funny there for a while. Dendlai (talk) 23:36, 22 November 2015 (UTC) - another example of "porting over everything" and not anything useful if there's anything worth covering in ews article on us, put it in our own article--"Paravant" Talk & Contribs 23:38, 22 November 2015 (UTC) - Doesn't do anything, and doesn't need to be preserved as a redirect - David Gerard (talk) 00:12, 23 November 2015 (UTC) - Compulsive hoarding? ΨΣΔξΣΓΩΙÐ Methinks it is a Weasel 00:16, 23 November 2015 (UTC) - Pointless shit. Get rid of it. Spud (talk) 03:21, 23 November 2015 (UTC) Keep[edit] - The article itself obviously doesn't add anything new, which the template is clear about on the other hand. If the argument is made that this is preservation for posterity and that it can be seen as a part of a larger body of such, then there's no reason to delete. I'd like to hear FCP's reasoning regarding it. Reverend Black Percy (talk) 00:10, 23 November 2015 (UTC) - His argument back in July, when we did loads of these, was "where's the harm?" Bicyclewheel 00:16, 23 November 2015 (UTC) - 1: There is no harm. BW's page link would make sense if there was a risk of harm. It's a fucking webpage and its contents pretty much cannot hurt people. 2: I think this is comparable to preserving parts of RWW -- documenting how RW was seen by other skeptics at the time seems a somewhat useful goal. If the page isn't preserved here, it will exist nowhere and will be forgotten. αδελφός ΓυζζγςατΡοτατο (talk/stalk) 04:10, 23 November 2015 (UTC) Merge/redirect[edit] Goat[edit] Chomsky rule | Result: Redirected[edit] Delete[edit] - Duplicate of Typhoon (talk) 21:32, 18 November 2015 (UTC) Keep[edit] Merge/redirect[edit] - Just Merge it with the Chomsky page.--Owlman (talk) 21:45, 18 November 2015 (UTC) - Merge with Noam Chomsky is probably best. Carpetsmoker (talk) 21:48, 18 November 2015 (UTC) - Yes. That's the smart thing to do. No little articles that are exactly the same as bits of bigger articles, please. Spud (talk) 02:17, 19 November 2015 (UTC) - Agree. Bongolian (talk) 03:43, 19 November 2015 (UTC) - This should've been marked as a duplicate, not for deletion. So; let's merge it with the main article. Reverend Black Percy (talk) 13:03, 19 November 2015 (UTC) - Merge with Noam Chomsky. Sir ℱ℧ℤℤϒℂᗩℑᑭƠℑᗩℑƠ (talk/stalk) 16:26, 19 November 2015 (UTC) - Merge with Noam Chomsky. If I am following the page correctly, this rule says that political action directed at your own government is likelier to be more effective than activity directed at foreign governments. This is a classic Miss Anne Elk theory. - Smerdis of Tlön, LOAD "*", 8, 1. 17:33, 19 November 2015 (UTC) - Typhoon has a bit of a problem with me, hence he went for delete. But I guess the consensus is merge. I'll do that tomorrow then, unless you tell me not to. :) Aneris ✻ (talk) 00:41, 20 November 2015 (UTC) DONE[edit] Is merged, as requested. The chomsky rule article can be deleted. Aneris ✻ (talk) 16:12, 20 November 2015 (UTC) Aneris[edit] - Delete: User Typhoon has marked this article for deletion and pointed to the Noam Chomsky article. I believe it's useful to record the principle (or rule) somewhere, but it mustn't be an own article. - Merge: I could copy it to the Noam Chomsky article, under politics, right above everything else, delete the double quote (mine is better sourced), and incorporate the Guardian quote. It would be indeed also a good place, since the Rule is apparently one of the chief principles Chomsky adheres to. - Keep: The downside of merging it is that it cannot be expanded in a detached manner. And the Chomsky Rule is actually more useful as a separate ethical principle that can be applied outside of the narrow context of Chomsky himself. I don't know how you resolve this, please duke it out and let me know. Aneris ✻ (talk) 16:03, 19 November 2015 (UTC) - Even after merging, it could still be expanded, and split out into its own article again, if some editor found/generated enough content to justify a separate page for it. This a wiki, you see. CamelCasePragmatist (talk) 16:47, 19 November 2015 (UTC) Goat[edit] Lee Siegel | Result: Deleted[edit] Delete[edit] - talk page discussion leans towards deletion. what say you? Bicyclewheel 19:31, 15 November 2015 (UTC) Keep[edit] Merge/redirect[edit] Goat[edit] Anders Björkman | Result: Deleted[edit] Delete[edit] - Similar to AH's nomination of Oliver Canby (i.e. why should we care about this particular crank?), but exacerbated by the fact that, in contrast to the OC article, this one is badly reffed. ScepticWombat (talk) 15:23, 14 November 2015 (UTC) ScepticWombat (talk) 15:23, 14 November 2015 (UTC) - Yeah it can go. A non-notable nut job.--TheroadtoWiganPier (talk) 15:31, 14 November 2015 (UTC) - Notability may not be a thing we do here, but we also don't have articles on every unimportant nutjob who ever uttered bullshit because that would be both completely stupid and turn the wiki into a sea of "and this person said x stupid thing. that is all" stubs. --"Paravant" Talk & Contribs 18:41, 14 November 2015 (UTC) Keep[edit] - Why not have a page? Seems missional enough, page isn't complete shit, any "notability" is stupid. Carpetsmoker (talk) 17:56, 14 November 2015 (UTC) - I'd like to see it polished if only ever so slightly. In that condition, and assuming any sources can be raked up to bolster the article, I say we keep. Reverend Black Percy (talk) 18:38, 14 November 2015 (UTC) Merge/redirect[edit] Goat[edit] - Looking at the site linked in the intro, I think this guy could certainly use a page. But the one we have now is really way too stubby. 142.124.55.236 (talk) 18:44, 14 November 42015 AQD (UTC) - Needs both to answer "yes but why do I care?" and "this is a living person article, you need to reference the darn thing" - David Gerard (talk) 16:36, 15 November 2015 (UTC) Creation Museum Visitor's Guide | Result: Seems dead[edit] Delete[edit] - This will never amount to anything but an embarrassment. KOMF 17:37, 21 November 2015 (UTC) - "We're waiting for someone to go there and write up here" is no way to write an article. Bicyclewheel 19:56, 21 November 2015 (UTC) - WTF. Fuzzy "Cat" Potato, Jr. (talk/stalk) 20:03, 21 November 2015 (UTC) Keep[edit] Merge/redirect[edit] Goat[edit] Oliver Canby | Result: Kept after rewrite[edit] Delete[edit] - I'm not sure the article should be deleted, but I need someone to convince me that this isn't just an excuse to point at a guy who obviously has some issues and laugh. Just because he has a blog and says stuff doesn't mean we need to be talking about his personal life/sex life/wacko beliefs. Please advise. Peace. AgingHippie (talk) 06:46, 14 November 2015 (UTC) - FWIW - it's about four death threats, media coverage of a court loss, the madness of the curebie movement (as I mentioned below) and not about laughing at him. He's dead serious in what he has said, and frankly that's not worth laughing at. It's worth exposing for what it is. Delusion on the levels that has much content on RationalWiki - homophobia and religion for a couple. BankBox (talk) 03:52, 15 November 2015 (UTC) - If this article is about someone prominent in the "curebie movement," then I should not have been able to spend an hour editing it and never encounter that term until we get to a discussion about deleting the article. That is not how writing works. Peace. AgingHippie (talk) 04:01, 15 November 2015 (UTC) - Author has LANCB. I doubt anybody else is interested enough to work on it. Weaseloid Methinks it is a Weasel 08:12, 16 November 2015 (UTC) - This seems like a bad reason for deletion. AH and me (but mostly AH) worked on it. The current article is substantially different from what it was 2 days ago when the author left. Carpetsmoker (talk) 08:28, 16 November 2015 (UTC) Keep[edit] - I'm going to vote "keep", on the basis that I have a peeve with the obsession on "notability", especially since we are often dealing with people and suggestions that are inherently of low notability, in a general sense. To pull an example, the article on Stars are Souls demonstrates that even nutty people can add significantly to the rich rapestry of crankery; indeed they must, in my opinion. But I'm going to direct everyone's attention to this exchange on the matter; the existence of an anonymous blog specifically targeting this Oliver Canby, and using some of the same legal jargon against him as this article does. There appears to be a tiny crusade underway against Mr. Canby, and all we know is that atleast one physical person is involved in it. I already asked BankBox if he is in fact this "The Officer" character, but he pleaded not guilty to that. But again, I'm going to toss the presence of "The Officer" and his blog into this discussion for you fine people, since you are all apparently queasy about this whole situation. All I'm really saying is that; we should figure out if there is more to this (per the link) - and just generally, I don't think we should delete on the basis of lacking notability. Besides that specific reason however, I'm quite receptive to other motivations. Reverend Black Percy (talk) 18:51, 14 November 2015 (UTC) - I am comfortable with the current version. Carpetsmoker (talk) 08:26, 16 November 2015 (UTC) Merge/redirect[edit] Goat[edit] - Unsure myself. The guy says terrible things, but has he been noticed much outside his own blog? This slightly sets off my "making fun of the crazy person" alarm - David Gerard (talk) 14:25, 14 November 2015 (UTC) - My main concern here is one of fairness. We're already the 6th result when you enter this person's name on Google. Being on the first page in a Google result for a person's name is a kind of responsibility... Much of the material in our page is based on posts from 2010/2011, when he was 17/18 years old... Not necessarily saying we can't have a page on this guy, but the current page makes me feel uneasy... Carpetsmoker (talk) 18:26, 14 November 2015 (UTC) - The core section is the 28th Amendment - that's the last few months. BankBox (talk) 03:48, 15 November 2015 (UTC) - Yeah, but there is (was?) also a lot of stuff from earlier... Note that I didn't say we should delete this, just that we should think about being fair, and that in 2010 he was quite young ;-) Carpetsmoker (talk) 05:29, 15 November 2015 (UTC) - What David and Carpet said. ClothCoat (talk) 19:02, 14 November 2015 (UTC) - As much as Reverend wants to rant about Notability not mattering, it clearly does because we don't cover every possible person who says dumb things - is Canby notable outside his own world and now us?--"Paravant" Talk & Contribs 19:04, 14 November 2015 (UTC) - All I'm implying is that I'm personally very much open to being convinced of the virtues of deleting said article. I just suggest that a notability claim not be the sole basis of any possible attempts to rally my vote, and I point out diligently that I'm very much in favor of entertaining the nuances of this discussion. Writing that off as "me ranting" is unconvincing, never mind uninclusive towards FCP. That being said, atleast Mr Canby is noticable enough to gain coverage from atleast one editor here (had anyone heard of this Canby fellow before?), let alone having a blog dedicated to destroying him. If that's enough, I can't say. But my vote stands for the time being. Reverend Black Percy (talk) 22:38, 14 November 2015 (UTC) - My problem is less the notability and more the rather personal nature of much of the material and in making hay out of the things saud by a potentially struggling individual. Peace. AgingHippie (talk) 00:11, 15 November 2015 (UTC) - I must say I'm a little concerned with that "Officer" figure and his blog. What's your two cents on comparing the style and contents of that blog and the style and contents of the article, prior to your revisions to it? Reverend Black Percy (talk) 01:03, 15 November 2015 (UTC) - Hippie, if you were to say to him (and this has been done by many on his blog) that he is struggling he will totally deny it. Here's something to consider. He can be seen as a poster boy of the curebie movement (ie - those who demand autism be cured) and reflects the delusion of said movement. Just a thought. BankBox (talk) 03:48, 15 November 2015 (UTC) - Okay, but the article does shit-all to say anything like that or to link him to any sort of broader context/debate/discourse about Aspies/ausitsm/neurodiversity, or anything. Not a fucking word. Instead, it's just a catalog of mean-spirited/stupid/misguided things that some rando on the internet has said. Peace. AgingHippie (talk) 03:52, 15 November 2015 (UTC) - Some of the stuff in the article might be relevant for the cross-over between anti-vaxxers and mental illness denial, but that larger context needs to be made clear. Otherwise, we just get a(n apparently wholly justified) denunciation of a crank who rants on his blog and responds aggressively when challenged, a phenomenon which is a dime a dozen on the web. There does seem to be some rather unique crankery (and crank magnetism) involved, but apart from offhand references to Wakefield and John Best, Canby's relation to/place within the larger anti-vaxx movement is never made clear and that vis-a-vis the mental illness denial crowd seems to be left entirely unexplored. Possibly, there's connection between these kinds of denialism and what seems to be a branch of fundamentalist Christian conservatism, considering his attitudes to homosexuality, the death penalty, and "liberal bias". If so, that could be the theme that ties the article together, both in terms of its internal narrative and Canby's place in the context of these larger trends. ScepticWombat (talk) 06:52, 15 November 2015 (UTC) Ameriwiki | Result: Merged into Wiki[edit] Delete[edit] - An out of date article on a defunct minor wiki which never went anywhere or mattered, and only has a RW article because it was a CP offshot that some of us visited. The act that so much of it is dedicated to the details of a single troll should explain the problems of covering this wiki. "Paravant" Talk & Contribs 03:11, 10 November 2015 (UTC) Keep[edit] - If it warranted an article at one point then it should be worth keeping. Do we not want to give them the attention? Aleksandra96 (talk) 04:18, 10 November 2015 (UTC) - Please, go resurrect every deleted article the wiki has ever had and see how well your inclusion criteria works--"Paravant" Talk & Contribs 04:24, 10 November 2015 (UTC) Merge/redirect[edit] - It could be merged into the wiki section with the other crank wikis. --Colonel Sanders (talk) 03:12, 10 November 2015 (UTC) - I second this. Aleksandra96 (talk) 05:00, 10 November 2015 (UTC) - I'd say merge this content into something else, if there's no option to just polish up this page and let it sit. Reverend Black Percy (talk) 03:36, 10 November 2015 (UTC) - Merge into wiki. Herr FuzzyKatzenPotato (talk/stalk) 05:05, 10 November 2015 (UTC) - Merge as above, prune back the office politics. Bicyclewheel 08:54, 10 November 2015 (UTC) - +1 — Carpetsmoker (talk) 09:06, 10 November 2015 (UTC) Goat[edit] Transitioning neckbeard | Result: deleted[edit] Delete[edit] - Definition of a narrow term, best suited as a section in a larger article. Peace. AgingHippie (talk) 19:02, 2 November 2015 (UTC) - A sentence or two in a larger article, if even that. Alec Sanderson (talk) 19:12, 2 November 2015 (UTC) - Worth keeping, but as part of either TERF or a transgender glossary if we have one. Bicyclewheel 22:46, 4 November 2015 (UTC) - ^^What they said. SolPyre (talk) 05:06, 5 November 2015 (UTC) - I suggest something about this myth (men becoming trans to get closer to women) be added to Transsexualism#Misconceptions. I don't think the "neckbeard" aspect is particularly noteworthy. Wèàšèìòìď Methinks it is a Weasel 20:45, 9 November 2015 (UTC) Keep[edit] - A thing claimed by TERFs apparently, but not really suited to TERF. Explain the jargon more - David Gerard (talk) 20:24, 2 November 2015 (UTC) Goat[edit] If you decide to delete it can you tell me so I can paste it as a section to the correct article? Aleksandra96 (talk) 19:04, 2 November 2015 (UTC) I don't even understand this article ... It's like one of EvoWiki ports: full of terminology that a laymen doesn't understand. Carpetsmoker (talk) 19:12, 2 November 2015 (UTC) Move to funspace and make it about badly layered facial hair. WalkerWalkerWalker 22:21, 2 November 2015 (UTC) Doxing | Result: Snowkeep[edit] Delete[edit] - This is called "conversation" in ordinary circles. This is nothing remarkable or missional; just talking about someone. WalkerWalkerWalker 04:47, 5 November 2015 (UTC) - Normal conversation doesn't typically involve name dropping private information about somebody to incite things against them, which is what doxxing is. --"Paravant" Talk & Contribs 04:49, 5 November 2015 (UTC) - So is the intention to incite st00f the distinguishing factor? Because discussing people's past/present/c. is pretty normal... and honestly, trying to make people mad at others is too, so I'm confused. WalkerWalkerWalker 04:52, 5 November 2015 (UTC) - It also involves private information which has not been freely given. Just because I might discuss that you live at blah blah blah street in real life or work at location y doesn't mean I should be the one to reveal said information online, usually in the effort to make sure bad things happen somehow. --"Paravant" Talk & Contribs 04:55, 5 November 2015 (UTC) Keep[edit] - This is called "a crime" in ordinary circles, this is on mission. Only someone who believes that "I know where you live" isn't a threat would call it "just talking about someone". SolPyre (talk) 04:55, 5 November 2015 (UTC) - Deletion argument shows a complete misunderstanding of what doxing is, so even if it isn't missional that shouldn't be the reason to delete it. --"Paravant" Talk & Contribs 04:57, 5 November 2015 (UTC) - A bleeding obvious keep. I am not sure the VFD originator knows what doxing is.--TheroadtoWiganPier (talk) 05:17, 5 November 2015 (UTC) - A lot of this wiki is about politics, which is similarly "conversation". Hertzy (talk) 05:50, 5 November 2015 (UTC) - It's very often used as a tool of oppression and for silencing dissent, which makes it missional. Gooniepunk (talk) 09:05, 5 November 2015 (UTC) - FFS, this one stays. Doxys Midnight Runner (talk) 09:19, 5 November 2015 (UTC) - SNOW keep. Bicyclewheel 19:39, 5 November 2015 (UTC) - If I'm allowed to vote, then keep, with the caveat that the article needs to be held to a higher standard and focus on condemning bad behavior from a rational standpoint, rather than leaving itself open for factionalism.KrytenKoro (talk) 15:53, 7 November 2015 (UTC) Goat[edit] - Only, if it's ensured, that no-one will delete information about doxxers he likes (yes, I'm looking at you, Ryulong).--Arisboch ☞✍☜☞✉☜ ∈)☼(∋ 16:23, 5 November 2015 (UTC) - You do realize the reason I had removed them because they were added in a shitty bad faith attempt at tu quoque right?—Ryulong (talk) 20:00, 6 November 2015 (UTC) - Really? Can you prove that? And even if you can, why should I even give a fuck?--Arisboch ☞✍☜☞✉☜ ∈)☼(∋ 18:17, 7 November 2015 (UTC) - From the horse's mouth, sooo...yeah, Aneris has admitted he was adding them as a "you do it too!" at his hated, Pharyngula-loving, SJW opponents, which he has accused everyone who disagrees with his edits of being. Why anyone is humoring incredibly, blatantly, bad faith edits is beyond me. (Humoring him and debating him, fine, but pretending that his edits were anything but trolling intended to disrupt the article? WTF).KrytenKoro (talk) 19:29, 9 November 2015 (UTC) - Were they accurate? If so, I can't be bothered to care why they were added. WalkerWalkerWalker 22:45, 6 November 2015 (UTC) - They were added to the effect of the message "YOU SJWS DO BAD THINGS TOO" because PZ Myers and Rebecca Watson outed someone who was slandering them pseudonymously.—Ryulong (talk) 22:54, 6 November 2015 (UTC) - I can honestly say I don't see why that isn't called doxxing. WalkerWalkerWalker 04:30, 7 November 2015 (UTC) - The entire rest of the list was people or sites who make a habit of doxing. The only way it makes sense to include four links to a single one-off cases of someone who admitted to doxing but did not encourage a climate of continuing it is if we're including several links to every single instance of doxing. Which...if you guys want to do that, fine, I hate doxers more than the next guy, but...as someone who edits wikis, I'll tell you now it's gonna turn into a more gigantic page ten times the size of gamergate. The criteria you're setting up for inclusion is unlikely to exclude a single one of the 451,000 results that google brings up for doxing. - Honestly, and with all due respect to him, despite the fact that I thought Ryulong's specific arguments (though not actions) were made extremely poorly on that page, the counter-argument to keep all instances so long as they include doxing is pants-on-head stupidity clearly meant as pointy editing to spite Ryulong. Y'all's whole "don't feed the troll, instead debate with them so that you can develop better arguments to put in the articles" doesn't fucking work if you just let the trolls have free reign to write the pages...or to make demands about what should be kept on the pages.KrytenKoro (talk) 15:16, 7 November 2015 (UTC) - how about that WHOLE discussion is had at Talk:Doxing where it belongs? This is a VFD.--TheroadtoWiganPier (talk) 15:44, 7 November 2015 (UTC) Truscum | Result: Merged with Transphobia[edit] Delete[edit] - Definition of a narrow term, best suited as a section in a larger article. Peace. AgingHippie (talk) 19:05, 2 November 2015 (UTC) - This is not SJWiki. Alec Sanderson (talk) 19:22, 2 November 2015 (UTC) - What Alec said. Carpetsmoker (talk) 21:58, 2 November 2015 (UTC) - Yee |₹Λ¥$€₦₦ I suppose there is no fantasy like power fantasy 22:26, 2 November 2015 (UTC) - KOMF 22:49, 2 November 2015 (UTC) - Done Transphobia#Transgender people Aleksandra96 (talk) 22:42, 2 November 2015 (UTC) Keep[edit] - As a redirect to somewhere. αδελφός ΓυζζγςατΡοτατο (talk/stalk) 21:58, 2 November 2015 (UTC) Goat[edit] User:Aneris/SJWMedia | Result: Keep[edit] Delete[edit] - Crude, humourless vandalism, regardless of namespace, should be deleted, and that is precisely what this is. Anerwax (talk) 03:37, 24 November 2015 (UTC) Keep[edit] - The orthodoxy here is so strong that we're deleting userspace material? Seriously? - Smerdis of Tlön, LOAD "*", 8, 1. 03:41, 24 November 2015 (UTC) - To provide some context: this form of "flak" is perfectly normal for the subject and comes with the territory. You could alternatively tell me what I need to remove to make it "conform". So far nobody has triedm you know, just ask me. The method so far was wholly unconstructive, aggressive and irrational (I'm sure someone will complain/mock that I mention this, too, another trick in the book) — Aneris ✻ (talk) 03:57, 24 November 2015 (UTC) - There's nothing illegal or grossly bigoted on that page. No reason at all to disallow the user to post what he wants there.---Mona- (talk) 04:08, 24 November 2015 (UTC) - User space. oʇɐʇoԀʇɐϽʎzznℲ (talk/stalk) 04:47, 24 November 2015 (UTC) - User space. Also a good source of lulz. Typhoon (talk) 07:28, 24 November 2015 (UTC) - It's in Aneris's sandbox, where it belongs. There is no need for action on our part. Blitz (Complaints Box) 07:56, 24 November 2015 (UTC) - Yuzr Spess. Queexchthonic murmurings 10:44, 24 November 2015 (UTC) - Aneris' sandbox, duh... ScepticWombat (talk) 09:53, 24 November 2015 (UTC) - Is this a joke? Carpetsmoker (talk) 14:06, 24 November 2015 (UTC) Merge/redirect[edit] Goat[edit] - Strangely fascinating watching Aneris obsessive behaviour, and him linking to a YouTuber who considers Encyclopedia Dramatica a good source on GamerGate is hilarious, though I'm sure unintentional. OTOH, nothing of value will ever come from this. Dendlai (talk) 06:22, 24 November 2015 (UTC) - I share your fascination. I'm certain that this silly request to delete will only increase Aneris' persecution complex. Typhoon (talk) 07:30, 24 November 2015 (UTC) - What if that was secretly the point, so that this his complaints of persecution could be used as future material with which to persecute him? Double mobius reacharound persecution complex! Dave Bernard (talk) 07:32, 24 November 2015 (UTC) October 2015[edit] List of scientists who became creationists after studying the evidence | Result: Keep[edit] - List of scientists who became creationists after studying the evidence (edit|talk|history|protect|delete|links|watch|logs) – (View AfD) Delete[edit] - This is essentially us No true Scotsman-ing what "studying the evidence" means, and it's been linked to only twice in the last year. Sir ℱ℧ℤℤϒℂᗩℑᑭƠℑᗩℑƠ (talk/stalk) 15:46, 26 October 2015 (UTC) - Delete as it stands as it's simply disingenuous (I actually wanted to put it up for deletion myself but you beat me). I'm not against an actual list of scientists who became creationists and pointing out their reasoning flaws (including the non-scientists that are on creationist sites, and labeling them as such). Carpetsmoker (talk) 15:48, 26 October 2015 (UTC) - Agreed completely with Carpetsmoker. – AOAPJM (talk) 15:59, 26 October 2015 (UTC) - Agree with the above comments. -gmk7 Keep[edit] - Save the snark!--Arisboch ☞✍☜☞✉☜ ∈)☼(∋ 16:00, 26 October 2015 (UTC) - Tentatively. Who is excluded from this list, if it were re-conceptualized as "list of natural scientists who became creationists after they got their PhD? Hipocrite (talk) 16:18, 26 October 2015 (UTC) - No idea. But then again, how many natural scientists "became" evolutionists after they got their PhD? oʇɐʇoԀʇɐϽʎzznℲ (talk/stalk) 16:23, 26 October 2015 (UTC) - Creationists have lists (see the talk page). Not sure how much is true (SkepticWombat did some digging and most turned out not to be actual scientists), but even if it's all false this page could be a good debunking of such lists. Carpetsmoker (talk) 16:27, 26 October 2015 (UTC) - Agree. Keep and re-conceptualize. Hipocrite (talk) 16:29, 26 October 2015 (UTC) - For the record, the two that were edit warred over that led to this - Charlie Liebert (B.S., M.B.A.)and Gary Parker (B.A., M.S., Ed.D) do not have PhD's. Hipocrite (talk) 16:33, 26 October 2015 (UTC) - Mm, I could support this renamed page. Cømяade FυzzчCαтPøтαтø (talk/stalk) 16:41, 26 October 2015 (UTC) - Keep - David Gerard (talk) 21:48, 26 October 2015 (UTC) - Tasty snark is tasty. Come now. Reverend Black Percy (talk) 04:13, 27 October 2015 (UTC) - --TheroadtoWiganPier (talk) 04:24, 27 October 2015 (UTC) - Keep, but I agree that the criteria are a bit unclear - what exactly does it mean to study (especially considering the rather sloppy and wide definition of study and research used by creationists, i.e. including rummaging around on creationist websites and simply regurgitating their PRATTs) and which evidence (once again, creationists have very different standards here) are we referring to, not to mention evidence for what (actual evolution, or the various inept definitions used by creationists)? However, I disagree with the hairy feline tuber that it's essentially a No True Scotsman, because it does offer the possibility of someone building a coherent argument, based on rigorous research/study of the mountains of evidence underpinning evolution etc., for creationism without cherrypicking or similar creationist tactics. Granted, I'm sceptical about the possibility of doing this and haven't seen any such arguments that don't involve such ridiculous tactics as Rube Goldberg'ish scenarios to avoid accepting evolution (i.e. violating Occam's Razor) or outright conspiracy theories to discard unwanted evidence, but keeping the option open for creationists to actually put such an argument together is part of what critical enquiry is all about (and the signal failure of creationists to actually do so is oh so telling...). ScepticWombat (talk) 04:44, 27 October 2015 (UTC) - Keep, maybe bud off a separate article going through common creationist lists with exacting criteria. Categorise by 'not working in scientific research', 'was a creationist and stayed a creationist', 'became a creationist after giving up on a scientific career' and so forth. If that article turns out to be particularly worthwhile, copy it back over this one once we're happy with it. Queexchthonic murmurings 16:10, 28 October 2015 (UTC) - Keep, and I feel like I should pre-emptively mirror this on my own blog in case it's deleted. Goat[edit] My Little Pony: Friendship Is Magic | Result: Keep[edit] - My Little Pony: Friendship Is Magic (edit|talk|history|protect|delete|links|watch|logs) – (View AfD) Delete[edit] - As it stands, it is a vacuous and pointless article about a children's cartoon. As it stood some time before this, it was a vacuous and pointless hit piece on a fanbase. Neither are particularly relevant to the mission. |₹Λ¥$€₦₦ Anonymous user, the truth is... 03:55, 23 October 2015 (UTC) - It was only a vacuous and pointless hit piece on a fanbase for less than 24 hours. For the past 3 years it has been a vacuous and pointless article about a children's cartoon.—Ryūlóng (琉竜) 03:57, 23 October 2015 (UTC) - I don't get the superscript bit addressed to me with your sig? Wassat mean?---Mona- (talk) 04:02, 23 October 2015 (UTC) - It's a lame little feature that some users persist with Mona. It picks up the user name of whoever is reading it. Just ignore. --TheroadtoWiganPier (talk) 04:05, 23 October 2015 (UTC) - —Ryūlóng (琉竜) 03:57, 23 October 2015 (UTC) - If you could give a reason for your vote, that'd be grrrrrreat... Avengerofthe BoN (talk) 20:01, 23 October 2015 (UTC) - It's off mission promotional bullshit for yet another group of Internet assholes.—Ryūlóng (琉竜) 21:16, 23 October 2015 (UTC) - Remember folks, all bronys are assholes who wanna fuck underage horses while shooting the disabled. All of them. Why are they all terrible people? Because the start of the group came from 4chan, and thus it never, ever, ever moved on and any fans regardless of where they come from became 4channers. Also I ind your deletion argument of "it's off mission!" amusing as you only think so because you got slapped down for bad writing. --"Paravant" Talk & Contribs 22:31, 23 October 2015 (UTC) - first you spend significant amount of time editing the page and defending the edits, and then, when you don't get your way, it should be deleted because it's off mission ... "If I can't have my way, just destroy it so no one can have their way" 82.95.88.48 (talk) 22:46, 23 October 2015 (UTC) - I'd rather the page be gone entirely than have it exist as some shit piece of praise for a shitty TV show and its god awful fans. Particularly when multiple members of this website treat my distaste for people who fanatically watch a chilren's cartoon as equivalent to actual reactionary bigotry.—Ryūlóng (琉竜) 00:49, 24 October 2015 (UTC) - This article is a prime example of where we have over-reached. Apart from one episode with a dubious epistemological message to children, there is nothing here that is missional. Does the show promote pseudo-science? Authoritarianism? Is it part of the media that discusses these topics? I think we are mistaking "things that interest me" for "things that we should have an article on". This article will never be more than a collection of opinions - and will always, no matter how well crafted, reflect poorly on the wiki (barring some new development that I am unaware of). Tielec01 (talk) 08:10, 23 October 2015 (UTC) - As Tielec01 said, its relevance is questionable at best. The world is full of cartoons that are just as qualified for inclusion. Vulpius (talk) 16:29, 23 October 2015 (UTC) Why was it ever created in the first place? Teletubbies next?Scream!! (talk) 16:33, 23 October 2015 (UTC) See Jerboa below Scream!! (talk) - Why did you vote if you don't know anything about the subject in the first place? What's next, a bullshit vote that tries to handwave all the missional stuff away? - Who sayeth that I don't know anything about it? Scream!! (talk) 02:42, 24 October 2015 (UTC)141.134.75.236 (talk) 22:00, 23 October 2015 (UTC) - If you think we might as well have an article on the Teletubbies if we have an article about this show, then that conclusion does seem plausible. 142.124.55.236 (talk) 02:47, 24 October 42015 AQD (UTC) - No connection to the RW mission, hand-waving in the lead ("attracted discussion and controversy about other topics that relate to rational and skeptical arguments") notwithstanding. CamelCasePragmatist (talk) 21:26, 23 October 2015 (UTC) Keep[edit] - Keep. It is hardly an especially important article, nor I suspect, can it ever be. But there are missional aspects as is very clear from even a cursory glance the article. Certainly there are not grounds for deletion. --TheroadtoWiganPier (talk) 04:03, 23 October 2015 (UTC) - If we can cover more about how the fandom faces issues due to their like of the show without going towards Ryus extreme while mostly keeping the article about problem issue episodes and also discuss how the show is treating little children (girls, no less) like they are capable of handling subjects more complex than cookies taste good and the sun is fucking yellow, i'd love to see it kept. --"Paravant" Talk & Contribs 04:15, 23 October 2015 (UTC) - Has some missional aspects to it, the current lead section described this fairly well. Carpetsmoker (talk) 04:20, 23 October 2015 (UTC) - Keepity keep. 142.124.55.236 (talk) 04:44, 23 October 42015 AQD (UTC) - Caveat: Long as it doesn't devolve into drama often. Flooding the Recent Changes page makes it easier for edits to other articles to be missed. ℕoir LeSable (talk) 07:04, 23 October 2015 (UTC) - I used to think this was one of our better articles but, I guess, I'm out of step with the zeitgeist. It's already been butchered beyond belief in the name of RW purity so, my "keep" is half hearted. I guess because it's not about Gamergate or Zionism it has to go. Doxys Midnight Runner (talk) 08:47, 23 October 2015 (UTC) - Keep it. --Castaigne (talk) 14:19, 23 October 2015 (UTC) - Don't delete. Anypony can see it's missional.--Arisboch ☞✍☜☞✉☜ ∈)☼(∋ 14:53, 23 October 2015 (UTC) - Very leading to Keep it, For who someone (Aka Clueless/Native/Immature/Walking living Sterotypical Bronies cant accepted facts there fanbase is still unintended flaw and semi-irrational (And also thanks to David Genard to undo this deletion insanity).--70.61.121.86 (talk) 19:38, 23 October 2015 (UTC) - Keep. It covers some of the BS over the show and the BS over the fanbase. Sir ℱ℧ℤℤϒℂᗩℑᑭƠℑᗩℑƠ (talk/stalk) 23:43, 23 October 2015 (UTC) - "Radically" keep, People in this site who are acting self-claiming Anti-bronies are almost oblivously closted self hating bronies need to stop this just because it have flaws and STRONGLY HYPOCRITICAL (Being extremely irrationally immature) to cant accepted what they are if they better to Exspelled Ryūlóng (琉竜) and other Self hating bronies out this site for few month and block them from ever touching that page, Just please...--98.27.29.192(talk) 01:45, 24 October 2015 (UTC) - Keep it. We need articles around here whenever we can get them. I just skimmed through it, and I think it's alright. Addressing cultish/conspiracies, whatever is a good thing, and this, ahem, particular topic fits the bill quite nicely. You need a really good reason to delete something, and this isn't one of those cases. Pbfreespace3 (talk) 01:50, 24 October 2015 (UTC) - The word "cult" as colloquially used is very pejorative. Sociologically the fandom could be a species of cult and also be entirely benign. The core of the substantive dispute seems to be about benign v. malevolent. Documentation is necessary either way, but especially for any sexual deviancy claims---Mona- (talk) 04:22, 24 October 2015 (UTC) - Keep. The show considered just as itself probably wouldn't support an article. The cultural phenomena surrounding the show, and the barmy, doctrinaire stuff that's been read into it as a result turn it into something missional. And fortunately, that's what the article is about. - Smerdis of Tlön, LOAD "*", 8, 1. 04:21, 24 October 2015 (UTC) - Yeah, keep. Smerdis of Tlön is right that there is a sociological aspect to the whole fandom thing that makes it worthwhile, and Pbfreespace3 is correct that we do need articles around here. Documentation is key, however, and claims of depravity must absolutely be credibly sourced.---Mona- (talk) 04:26, 24 October 2015 (UTC) Goat[edit] - If we could cover more about how the show is treating children like they can actually handle concepts more complex than yellow is the color of the sun and deal with issues like when it supports wooish concepts, i'd be happy with just a small section on the fandom controversy. I have no idea how to write that and so just worked with this version.--"Paravant" Talk & Contribs 03:58, 23 October 2015 (UTC) I'm undecided and somewhat apathetic. But if forced to comment I'd say the triviality of the topic combined with dubious missionality, and then adding the shitfest factor, all points to deleting. Having this much sturm und drang over a goddam cartoon show is just not worth it. But I'll watch the arguments pro and con.---Mona- (talk) 04:07, 23 October 2015 (UTC) - Seconded. Though I'm currently leaning towards keep (as argued here and elsewhere by Paravant and CarpetSmoker). Reverend Black Percy (talk) 10:21, 23 October 2015 (UTC) - I'd like to note the inherent flaw in the show. It's not titled "My Little Goat" ikanreed You probably didn't deserve that 14:46, 23 October 2015 (UTC) Jerboa[edit] - Here comes the most inane proposal yet: How about we have a bare to the facts article and link to one "all hail the almighty brony" essay and one "unabashed hit piece" essay written by our trusty Ryu? I know this proposal is stupid, but someone had to make it... Avengerofthe BoN (talk) 19:59, 23 October 2015 (UTC) - This one actually makes sense. KOMF 01:12, 24 October 2015 (UTC) - HATE to agree with Avenger but ... Scream!! (talk) 02:40, 24 October 2015 (UTC) - I completely do not care, unless all warring parties think it's the best idea ever and would end all editing disputes; in which case I am militantly in favor.---Mona- (talk) 03:28, 24 October 2015 (UTC) - I don't care that the vote is settled. I just had to pet this Jerboa anyways. And besides, Avenger and Mona under the same banner? Peace in our time! Reverend Black Percy (talk) 14:05, 25 October 2015 (UTC) Alicorn![edit] - Alicorn privilege is actually a serious issue in Equestria, or so I've heard. >.> 142.124.55.236 (talk) 02:44, 24 October 42015 AQD (UTC) Neolithic Revolution | Result: Keep[edit] Delete[edit] - Such a gigantic hit piece that verges so close to going "agriculture evil", only a full burn might fix it "Paravant" Talk & Contribs 18:44, 6 October 2015 (UTC) - Presents one fringy side of an alleged debate as fact. Peace. AgingHippie (talk) 17:26, 8 October 2015 (UTC) Keep[edit] - The fact that the invention of agriculture led to a huge increase in the scope of inequality in human society and had an adverse impact on human health is mainstream archeology. This relates to just about everything from global warming to "patriarchy". It does give the lie to the meta-narrative of Progress and the notion that technology improves the human condition, but that can't be helped. - Smerdis of Tlön, LOAD "*", 8, 1. 19:34, 6 October 2015 (UTC) - I vote for keep. The neolithic revolution is important for so many reasons. First of all, it occurs before the low end of the young earth timeframe. It is an example of how adaptability and technology drives change, not deities. It is the beginning of us genetically modifying animals and plants around us en masse via artificial selection. It also marks the beginning of evolutionary selection for cross-species pathogens (intelligent design, indeed). It marks the birth of the temple cultures, in which there was more food being produced than being eaten, leading to the invention of the "ordained minister", able to manipulate those around him for his and their mutal reward. It also marks a point in time where heaven arguably had enough of a civilization to work with somewhere on earth that waiting another 5-8000 years to communicate its lessons via human sacrifice looks even crueler still. It is also a period brought up revisionistically by various cranks, from stone age diet pushers to global warming denialists. And so on. It needs work right now, yes, but this is a clear keeper to me. Reverend Black Percy (talk) 11:12, 7 October 2015 (UTC) - I'd like the article to say things more like "here's what experts say about this" and less "this is how it happened", but overall I agree with much of it. Agricultural civilizations obviously have their advantages—How else would we ever have gotten to modern levels of technological advancement?—but they have notable downsides too and I think pointing those out is relevant to our mission. Though perhaps the article could say a bit more about the positive effects. 142.124.55.236 (talk) 16:13, 7 October 42015 AQD (UTC) - Could be improved, but not shitty enough to delete. Carpetsmoker (talk) 04:39, 11 October 2015 (UTC) Goat[edit] - I must say, this article failed to convince me of its thesis that all this was a terrible idea. Essayspace? - David Gerard (talk) 19:23, 6 October 2015 (UTC) - Essayspace. FU22YC47P07470 (talk/stalk) 21:52, 6 October 2015 (UTC) - It's a shit essay, not a shit article. Peace. AgingHippie (talk) 16:34, 7 October 2015 (UTC) - The denialism is strong with this one, I think. It is quite mainstream anthropology and archeology that the adoption of agriculture during the Neolithic led to the rise of very different societies, much more divided by wealth, rank, and class. It is mainstream science that these societies produced a class of priests and a different kind of god. It is mainstream science that these much more hierarchical societies gave rise to a caste whose profession is violence. They expanded male social prominence at the expense of women. They gave rise to our firstsecond (First was the collapse of the big game hunting cultures such as the European Cro-Magnons and the North American Clovis culture after the mass extinctions they caused) crisis of ecological sustainability, and historically we've never handled those really well. These bits of mainstream science all strongly implicate core concerns of the website's mission. Unfortunately, they also paint an unflattering portrait of human nature, and I suspect that's the actual problem. - Smerdis of Tlön, LOAD "*", 8, 1. 03:54, 8 October 2015 (UTC) Scott Barnes | Result: Deleted[edit] Delete[edit] - Needs sources, bad. Asserts conspiracy theories. Herr FuzzyKatzenPotato (talk/stalk) 04:39, 19 October 2015 (UTC) - This has numbers where footnotes should be but no footnotes. A clear sign it's been badly copied from another wiki (I can't imagine which one). Spud (talk) 04:45, 19 October 2015 (UTC) - Source or destroy Carpetsmoker (talk) 06:41, 19 October 2015 (UTC) Keep[edit] Goat[edit] - I thought I recognized the name, it's some dude whose elaborate plan to make Perot win in 1992 backfired. Maybe not worth an article but I think there's potential. 99.46.25.47 (talk) 06:54, 19 October 2015 (UTC) Angus King | Result: Deleted[edit] Delete[edit] - not missional, stub Bongolian (talk) 07:03, 20 October 2015 (UTC) - OK, anonymous user. We don't want articles on every single US senator that are each one six word sentence long. Don't make any more. Spud (talk) 07:18, 20 October 2015 (UTC) Keep[edit] Goat[edit] Susan Collins | Result: Deleted[edit] Delete[edit] - not missional, stub Bongolian (talk) 07:02, 20 October 2015 (UTC) - At six words long, it wasn't even worthy of the name "stub". No indication of missionality, I;ve nuked it already. Spud (talk) 07:12, 20 October 2015 (UTC) Keep[edit] Goat[edit] Kim Davis | Result: Moved to Conscientious objector to same-sex marriage Same-sex marriage resistance[edit] Delete[edit] - Literally 15 minutes of shame. in a year or two this article will be just as stubby and few will remember she exists, just like what happened to our Joe the Plumber article. At best a mention in our Gay Marriage articles US section for post-ruling resistance would be required for her. "Paravant" Talk & Contribs 23:38, 25 September 2015 (UTC) - I created this article because I thought it was relevant, and I think there's a chance she's gonna be more than just 15 minutes. Nevertheless, I would support moving the article text to the article about same-sex marriage. Spaceboyjosh (talk) 00:50, 28 September 2015 (UTC) - Yes. Herr FüzzyCätPötätö (talk/stalk) 14:50, 2 October 2015 (UTC) Keep[edit] - I highly support working on this article and making it into a snark goldmine. There's more than plenty of news sources on this woman and her antics (perhaps oddly). I mean, come on. She acted injustly and beyond moronical for the sole reason that the woman is so religious, she can't even tell the difference between her ass and a hole in the ground. Though it's possible she could be baked into a gay rights article without problem, which I'd also support. Reverend Black Percy (talk) 23:51, 25 September 2015 (UTC) - Move to a suitable name. From the to-do list, there's at least slight interest. Also, she's still looking for stuff to fuck up, this isn't over - David Gerard (talk) 09:14, 26 September 2015 (UTC) - <-𐌈FedoraTippingSkeptic𐌈-> (pretentious, unwarranted self importance) (talk) 21:52, 28 September 2015 (UTC) - Agree with David. Not over, still ongoing - keep for now. --Castaigne (talk) 16:54, 30 September 2015 (UTC) - Keep for now, we do this kind of stuff - Cliven Bundy is another example. Whether the topic has legs is a matter for the future. Bicyclewheel 18:15, 2 October 2015 (UTC) - Keep. She's a religious fanatic who think her religious views should exempt her from certain regular duties of a public official. That's exactly the sort of thing this wiki should cover.---Mona- (talk) 23:17, 5 October 2015 (UTC) Goat[edit] - I think we should probably have an article about the specific controversy that made her momentarily famous, though. 142.124.55.236 (talk) 23:41, 25 September 42015 AQD (UTC) - I'd not be opposed to that either--"Paravant" Talk & Contribs 23:43, 25 September 2015 (UTC) - ^ That. This has also happened in other countries by the way (although in a less ... crazy way, AFAIK) Carpetsmoker (talk) 04:02, 27 September 2015 (UTC) - I'm with this idea. --Castaigne (talk) 22:05, 28 September 2015 (UTC) - Or, an article about people refusing to do their optional job, when accommodation should be made, and when it shouldn't. Merged with the ideas of pharmacist and cashier who have to scan pork. —The Great and Humble Shawn (the Humanist)Talk to me 12:04, 29 September 2015 (UTC) - I agree with this. She isn't the only one, not even the only one in Kentucky. In Kentucky, there's also clerks Casey Davis (unrelated) and Kay Schwartz. — Unsigned, by: Bongolian / talk / contribs - Can anyone think of a good name for such a page? Conscientious objector to gay marriage or Conscientious objections to gay marriage is a bit of a mouthful, but the best I can think of... Carpetsmoker (talk) 05:42, 18 October 2015 (UTC) - Gay Marriage opposition? Gay Marriage Reactionary?--"Paravant" Talk & Contribs 05:45, 18 October 2015 (UTC) - Should be rewritten without liberal bias. She's just practicing her religious beliefs, I support gays but they could go elsewhere. <-𐌈FedoraTippingSkeptic𐌈-> (pretentious, unwarranted self importance) (talk) 22:12, 28 September 2015 (UTC) - Much of the content on this site has a "liberal bias"... Carpetsmoker (talk) 22:35, 28 September 2015 (UTC) - Which is why I prefer Conservapedia. <-𐌈FedoraTippingSkeptic𐌈-> (administrator) (system operator) (talk) 22:52, 28 September 2015 (UTC) Twelve-step program | Result: Redirect to Alcoholics Anonymous[edit] Delete[edit] - Is there enough material to cover this separately from Alcoholics Anonymous? Based on a glance at the WP page, I think we can just direct to AA? Carpetsmoker (talk) 07:30, 14 October 2015 (UTC) Keep[edit] - I vote for merging any and all useful content from Twelve-Step Program into AA, and then making it a redirect to AA. Reverend Black Percy (talk) 09:14, 14 October 2015 (UTC) - The AA article already has all the content in the current 12-step article. Carpetsmoker (talk) 09:20, 15 October 2015 (UTC) - In that case, I vote to axe this article. Reverend Black Percy (talk) 11:19, 16 October 2015 (UTC) Goat[edit] John Grant | Result: Deleted[edit] Delete[edit] - Expand or remove Carpetsmoker (talk) 00:54, 8 October 2015 (UTC) - This was about the stubbiest stub I've seen so far. You could say: this article needs to actually be written before it can stay. Reverend Black Percy (talk) 01:13, 8 October 2015 (UTC) - In four years no one has seen fit to expand on this, so delete until somebody comes along and wants to --"Paravant" Talk & Contribs 01:51, 8 October 2015 (UTC) Keep[edit] - Missional, might have some good quotes Mʀ. Wʜɪsᴋᴇʀs, Esϙᴜɪʀᴇ (talk/stalk) 05:28, 8 October 2015 (UTC) - Keep. Pretty damned missional, no reason not to note - David Gerard (talk) 20:50, 8 October 2015 (UTC) Goat[edit] Biola University | Result: Keep[edit] Delete[edit] Meh --Cosmikdebris (talk) 07:33, 2 October 2015 (UTC) Keep[edit] - In the situation that the below goats are all adressed, and within a reasonable timeframe, I vote keep. If not, baaaaaah! Reverend Black Percy (talk) 20:27, 4 October 2015 (UTC) - I suggest waiting a fortnight. If nothing is done to improve the content, axe it, but put a note about its potential missionality on its talk page first, so it's there if and when a proper article is (re)created. ScepticWombat (talk) 00:35, 6 October 2015 (UTC) - Missional. FU22YC47P07470 (talk/stalk) 17:03, 7 October 2015 (UTC) - It deals with the themes of the mission, just needs expansion. Tuxer (talk) 10:44, 8 October 2015 (UTC) Goat[edit] - While possibly missional, it's not there yet.--TiaC (talk) 07:36, 2 October 2015 (UTC) - Definitely missional as it's the den of William Lane Craig and thus the base of his credentialist claims about being "a professional philosopher" (though he has now also become a colleague of Lee Strobel at Houston Baptist University, HBU, a fundie school of a similar cut to Biola). However, if the article is not expanded, this stub can and probably should be deleted. If fleshed out, and especially including references to Craig, I'd definitely vote for a keep. This is one of Rationalzombie94's spree of fundie school stubs that actually has special (if currently only potential) merit as would an entry on HBU. ScepticWombat (talk) 08:48, 2 October 2015 (UTC) - A resounding "meh" - David Gerard (talk) 13:32, 2 October 2015 (UTC) - Missional: probably, like this: meh ... Carpetsmoker (talk) 17:39, 4 October 2015 (UTC) - I rewrote this article, starting with the basic sourced material. I think it is now a nice stub that can be expanded. Can we close the AFD? --Cosmikdebris (talk) 01:02, 16 October 2015 (UTC) Botany | Result: Merged with Biology[edit] Delete[edit] - Non-missional and fairly uninformative Carpetsmoker (talk) 16:05, 7 October 2015 (UTC) Keep[edit] - Keep and improve. Plant taxonomy and genetics support the modern view of evolution. Alec Sanderson (talk) 16:28, 7 October 2015 (UTC) - Which is IMHO more appropriate in either Evolutionary biology or Evolution of plants, rather than a Botany page Carpetsmoker (talk) 18:48, 7 October 2015 (UTC) Is missional. 32℉uzzy; 0℃atPotato (talk/stalk) 17:02, 7 October 2015 (UTC) - Support structure for evolutionary articles - David Gerard (talk) 21:15, 7 October 2015 (UTC) - Keep'n'expand, yo. Reverend Black Percy (talk) 23:24, 7 October 2015 (UTC) Goat[edit] - Whatever the fate of this, the zoology article should get the same. Flannan Isle (talk) 18:20, 7 October 2015 (UTC) - Merge botany, zoology, ecology, physiology, taxonomy, biophysics into the biology article. Many stubs may create something useful. αδελφός ΓυζζγςατΡοτατο (talk/stalk) 03:56, 9 October 2015 (UTC) - +1 Carpetsmoker (talk) 03:47, 11 October 2015 (UTC) Hanne Tolg Parminter | Result: Keep[edit] Delete[edit] - Non-public, non-notable person. Does not deserve to have the first of the few Google results on her name return an encyclopedia-like entry calling her "batshit crazy", "islamophobe", "crank", "anti-immigration advocate", "racist", "authoritarian wingnut" and "nationalist". RW is being used as an attack site. Slimy goop (talk) 16:37, 8 October 2015 (UTC) Keep[edit] - Keep. She has been a subject of a high profile controversy (eg. [2]) and is one of the most active and one of three highlighted/staff bloggers (now full time apparently) on the well known anti-Muslim/anti-immigrant blog Document.no. There she writes about all the crimes that Muslims and other "immigrants" commit and so on. She has a high profile, under her own name, in the Norwegian blogosphere, with numerous articles by her on Document.no, the largest Norwegian anti-immigrant website/blog/forum. Millicent (talk) 16:46, 8 October 2015 (UTC) - Daily Post is not a high-profile newspaper. Besides, the article doesn't even mention her name, so you're drawing your own conclusions. Document.no is critical of Islam, but can hardly be called islamophobic in the same way as Gates of Vienna or Fjordman. You're welcome to provide specific quotes of what she has said or written (with citations) that you deem to be islamophobic. --Slimy goop (talk) 17:07, 8 October 2015 (UTC) - Document.no is considered to be Islamophobic by countless sources, several of which are cited in the article, and is also high profile with extensive media coverage in Norwegian and international media, and a significant readership. It's not simply "critical of Islam" (in the sense I and other non-racists and atheists may be when it comes to certain aspects or religion itself), it's specifically anti-Muslim. While the Daily Post didn't mention her name, she has outed herself as the person in question in an article on Document.no (per the references section). Millicent (talk) 17:14, 8 October 2015 (UTC) - Please provide references here to reliable and easily accessible sources that deem Document.no to be islamophobic. References to obscure books by obscure authors are not sufficient. Anyway, she is not Document.no, she's simply a writer on the website. Different people hold different views. She doesn't necessarily agree with everything that has ever been written there. --Slimy goop (talk) 17:29, 8 October 2015 (UTC) - Just read the Wikipedia article on document.no. Anders Breivik went to some "Friends of Document.no" party. It's very clear our article is missional and relevant.---Mona- (talk) 17:40, 8 October 2015 (UTC) - Fair enough, Mona. Norwegian Centre Against Racism deems Document.no to be borderline islamophobic. I trust that organization, so I'll agree with them. Still, the article here on Hanne Tolg (and on many others) is going overboard with nasty labels, and it has an impact on someone's life. For heaven's sake, the article comes out top on Google search on her name! --Slimy goop (talk) 18:07, 8 October 2015 (UTC) - That particular article has been heavily edited by supporters of the website who naturally try to whitewash it as much as possible, and the history shows much back and forth. Norwegian newspapers have written about Islamophobes waging a war on Wikipedia in articles like that one to portray racist Islamophobia as legitimate [3]. Millicent (talk) 18:13, 8 October 2015 (UTC) - It is an "anti-immigrant forum which has evolved into a hotbed of galloping Islamophobia" Aftenposten). It is "a website rife with anti-Muslim and hard right rhetoric". (Financial Times) "There are also citizens' websites like Document.no, where Anders Behring Breivik left racist, extremist right-wing comments along with fellow anti-Muslims, and there were attempts to start up Norwegian satellite groups in support of the English Defence League" (BBC) And according to Norway's most prominent humanist, Lars Gule, it is "a far-right web forum" that is "dominated by Islamophobic and anti-immigration commentary" (per ref section of the article on the site). An official report of the Norwegian Police University College cites it as an example of an "extremist website" alongside Stormfront and Gates of Vienna (the report here on the website of the Norwegian central government[4], p. 28). Millicent (talk) 17:50, 8 October 2015 (UTC) - Keep. She's certainly something of a deal in Norway and a good example of the Islamophobic crank. No reason at all to delete.---Mona- (talk) 17:19, 8 October 2015 (UTC) - Keepity keep. 142.124.55.236 (talk) 17:26, 8 October 42015 AQD (UTC) - Deletion argument is unconvincing. --"Paravant" Talk & Contribs 18:07, 8 October 2015 (UTC) - An underreasearched tabloid opinion piece in Norway doesn't really warrant an iota of change here at RW. Reverend Black Percy (talk) 01:49, 9 October 2015 (UTC) - Carpetsmoker (talk) 03:18, 9 October 2015 (UTC) Goat[edit] I'm a bit aprehensive about some of these articles created by Millicent. This morning I (coindicentally) stumbled on Mona Levin with some pretty strong claims and no real references to back it up, and I couldn't really find any references, either. The article's a bit toned down now, but I still see few references and fairly strong claims (also see talk page). For Document.no, we write that it's "Islamophobic and extremist" and that it "strongly promotes racism", but on the other wiki I read that "the Norwegian Centre Against Racism considers it only borderline"... So, meh ... Since almost all resources (if any) for these claims are in Norwegian, it's very difficult for me (non-Norwegian) to vet these claims, but I fear we're (and by "we", I mean Millicent , since he/she is the only one writing these articles) going a bit over the-top here. It smells too political. Carpetsmoker (talk) 21:31, 8 October 2015 (UTC) - "these articles created by Millicent"? I did not create this article. The Wikipedia article on Document.no has been the subject of constant attempts to whitewash the website as its history shows, and is some sort of compromise now between Islamophobic editors and normal editors, but RW is not Wikipedia, not NPOV, and not an encyclopedia, and I don't see the point of selectively citing the quotes in Wikipedia that the website's supporters have added to the article. The Wikipedia article also includes many other opinions which clearly describe it as Islamophobic. Also, for the record, Millicent is a female name. Millicent (talk) 21:48, 8 October 2015 (UTC) - "RW is not wikipedia" doesn't mean anyone can just say anything we want on any article. It has to somehow, you know, reflect reality in a vaguely reasonable ("rational") way. Slapping "islamophobia!" (or similar terms) on everything is just damn silly. Again, I'm not saying these people aren't Islamophobes, just that it's hard to judge (for me), and in at least 2 cases it seems it's rather exaggerated. Criticism of Islam (even hash criticism) is not the same as islamophobia. Same with (strong) Israel opponents: these people are not necessarily racist. This actually hurts our cause, by the way, since people who don't agree with us will probably just dismiss a page out-of-hand if it starts with erroneous or dubious snarl words... Carpetsmoker (talk) 03:12, 9 October 2015 (UTC) - The article on Document.no, and the article on Hanne Tolg Parminter (which I did not create), both include several solid references, quite a few of them in English, that clearly show that Document.no is a large and well known (or rather notorious) Islamophobic website, mainly concerned with writing negatively about Muslims and immigration. Where have I said criticism of Islam is the same as islamophobia? I've said the exact opposite. I can't see that either of those articles exaggerate anything or contain anything "erroneous", on the contrary they are well sourced and fact-based. The criticism of Document.no has been very harsh in mainstream media and scholarship for many years, and it would easy to find a whole bunch of other references that describe them as racist and Islamophobic, but it wouldn't really add much to the articles in question since that has already been established quite thoroughly. Millicent (talk) 03:32, 9 October 2015 (UTC) - Just tossing in that: 1. It's generally best not to use references in a foreign language not accessible to the vast majority of English speakers, and 2. I don't care if WP thinks a site is "borderline." They go thru the same political tugs of war we do here and all that may mean is that this "compromise" language won out. Based on what is documented at the RW article, I'm reasonably persuaded Document.no qualifies as Islamophnobic, even excluding the Norwegian references.---Mona- (talk) 05:53, 9 October 2015 (UTC) It stands at 6-1 to keep the article. What happens now? Can we remove the call for deletion at the article page?---Mona- (talk) 17:32, 10 October 2015 (UTC) - It should be noted, to those who do not read Norwegian, that Millicient and Mona represent quite extreme positions and seem to use RationalWiki for their own personal vendettas. Both Mona Levin and Hanne Tolg are respected writers. Writers with views, but nothing that warrants the vitriolic language used in these articles. I still support deleting the articles. At least, this page should be kept to document that someone asked some questions Megad (talk) 17:25, 2 January 2017 (UTC) Open source | Result: Keep[edit] Delete[edit] - Do we really need this? The missionality is doubtful, and this article is just plain boring... Carpetsmoker (talk) 16:01, 7 October 2015 (UTC) Keep[edit] - Nah, there are many cases of corporate hijinks against open software, open software is, at least partly, a matter of consumer rights, so keep the article, rewrite it, perhaps.--Arisboch ☞✍☜☞✉☜ 16:11, 7 October 2015 (UTC) - Corporate hijinks indeed. Open source has its own set of problems, but it is a countervailing force against centrally planned bureaucratic cluster fucks. Alec Sanderson (talk) 16:22, 7 October 2015 (UTC) - Needs fun! The FCP Foundation (talk/stalk) 16:59, 7 October 2015 (UTC) - Assuming someone fun remodels it in his own image - keep. Reverend Black Percy (talk) 23:24, 7 October 2015 (UTC) Goat[edit] Zen and the Art of Motorcycle Maintenance | Result: Keep[edit] - Zen and the Art of Motorcycle Maintenance (edit|talk|history|protect|delete|links|watch|logs) – (View AfD) Delete[edit] - Off-mission fancruft stub. Deletion was discussed previously & supported by most editors apart from the article's author (see talk page). Nothing has been done to expand, improve or make it relevant in the eighteen months since. ωεαşεζøίɗ Methinks it is a Weasel 20:34, 6 October 2015 (UTC) May perhaps be missional. I haven't read it. But the current stub doesn't add much ... Carpetsmoker (talk) 20:46, 6 October 2015 (UTC) No debunking present.32℉uzzy; 0℃atPotato (talk/stalk) Yeah, hard to find a truly missional reason to keep this one (as FCP put it above), even in the event that the article wasn't a stub. Which it is.Reverend Black Percy (talk) 01:29, 7 October 2015 (UTC) Keep[edit] - Well, I'll be. That revision dug up by Alec Sanderson seems like something we could salvage. Never mind that it's being tossed around as "the world's most widely read book on philosophy". Reverend Black Percy (talk) 01:45, 7 October 2015 (UTC) - ^ That. The reason the older version got removed is because there were no references and the author threw a fit when this was pointed out ... :-/ Carpetsmoker (talk) 13:57, 7 October 2015 (UTC) - See RBS above. The FCP Foundation (talk/stalk) - Revert to Sanderson's version. Peace. AgingHippie (talk) 16:35, 7 October 2015 (UTC) - I'd like to see the current "See also" kept. Alec Sanderson (talk) 16:37, 7 October 2015 (UTC) - Go nuts. Peace. AgingHippie (talk) 19:50, 7 October 2015 (UTC) - Looks like Paravant took care of it. Alec Sanderson (talk) 20:00, 7 October 2015 (UTC) - One of, if not the most influential New Age book. We definitely need an article on it, and it looks like the most glaring issues have been resolved. --Ymir (talk) 04:08, 8 October 2015 (UTC) - I believe that part of the point of the page is that it's not a new-age book but often perceived as such by people who haven't read it :-) Carpetsmoker (talk) 04:12, 8 October 2015 (UTC) - That's the case even among quite a few people who have read it but didn't quite pick up on what it's saying, as the article says. Personally I've seen numerous people, often sympathetic to some kinds of woo, talking about how the book changed their lives. Maybe my comment would have been more accurately worded as, "A book that has had a strong influence on the New Age movement even though it doesn't really advocate New Age ideas, something a lot of readers didn't pick up on." --Ymir (talk) 04:31, 8 October 2015 (UTC) Goat[edit] - There is an older version with some more missional bits. Alec Sanderson (talk) 01:41, 7 October 2015 (UTC) RationalWiki:Internet relay chat | Result: Deader than ARPA[edit] Delete[edit] - It's an IRC technical manual, and not on-mission. Carpetsmoker (talk) 14:22, 7 October 2015 (UTC) - Stuff in RW space isn't necessarily missional the way mainspace should be, this objection doesn't hold - David Gerard (talk) 15:30, 7 October 2015 (UTC) - Not used. αδελφός ΓυζζγςατΡοτατο (talk/stalk) 15:25, 7 October 2015 (UTC) Keep[edit] Goat[edit] - Is the RW IRC still used by anyone here? - David Gerard (talk) 15:30, 7 October 2015 (UTC) - I would imagine not.--"Paravant" Talk & Contribs 15:32, 7 October 2015 (UTC) - I would hope) 16:54, 7 October 2015 (UTC) - Rewrite so it's about how this site's IRC is/was used, rather than a write-up of what IRC is in all its detail. Flannan Isle (talk) 18:23, 7 October 2015 (UTC) - Would that be that interesting or useful of an article...?--"Paravant" Talk & Contribs 18:31, 7 October 2015 (UTC) - It's not in the article section, it's in the Rationalwiki section. Flannan Isle (talk) 16:44, 8 October 2015 (UTC) - That doesn't man people would be interested in it --"Paravant" Talk & Contribs 18:48, 8 October 2015 (UTC) - Sorry, I meant that there may be different standards for inclusion. Flannan Isle (talk) 19:41, 8 October 2015 (UTC) - Death death death? Mʀ. Wʜɪsᴋᴇʀs, Esϙᴜɪʀᴇ (talk/stalk) 14:21, 9 October 2015 (UTC) Building permit | Result: Deader than the dinosaurs[edit] Delete[edit] - Stupid. Barely missional. Without the DAL stuff, a stub. The FCP Foundation (talk/stalk) 03:34, 10 October 2015 (UTC) - Merge DAL stuff into Kent Hovind, then delete - David Gerard (talk) 19:45, 10 October 2015 (UTC) Keep[edit] Goat[edit] Fun:Media | Result: Deader than traditional journalism[edit] Delete[edit] - Bad humor. αδελφός ΓυζζγςατΡοτατο (talk/stalk) 03:48, 9 October 2015 (UTC) - Yep. Boring as all hell. Reverend Black Percy (talk) 05:24, 9 October 2015 (UTC) - Move to redspace - David Gerard (talk) 10:53, 9 October 2015 (UTC) - This was created by someone called StupidIdiot, who looks like he lived up to his name. Flannan Isle (talk) 11:03, 9 October 2015 (UTC) Keep[edit] Goat[edit] Poetry | Result: Deader than Hemmingway[edit] Delete[edit] - Dictionary definition, and doubtful misionality Carpetsmoker (talk) 16:32, 7 October 2015 (UTC) - Die. αδελφός ΓυζζγςατΡοτατο (talk/stalk) 16:53, 7 October 2015 (UTC) Keep[edit] - Ugh, poetry. I think there's plenty of bad stuff to say about it. 142.124.55.236 (talk) 16:49, 7 October 42015 AQD (UTC) Goat[edit] Conservapedia:LA Times article of June 19, 2007 | Result: Kept as a historical artifact[edit] - Conservapedia:LA Times article of June 19, 2007 (edit|talk|history|protect|delete|links|watch|logs) – (View AfD) Delete[edit] - This is a badly formatted, stalkeresque piece of shit that will never help anyone in any way. FuzzyCatPotato of the Fanatical Wiis (talk/stalk) 00:28, 27 September 2015 (UTC) - It even links back to itself in Wikipedia style Carpetsmoker (talk) 04:03, 27 September 2015 (UTC) - That's because there were once two articles on the subject which were merged & somebody obviously forgot to remove the link between them. I've removed it now. Weaseloid Methinks it is a Weasel 10:08, 27 September 2015 (UTC) Unless we plan to make it better, yah. At the least get rid of our commentary, which is just pointless horn-touting for some users.--"Paravant" Talk & Contribs 04:05, 27 September 2015 (UTC) Keep[edit] - An important piece of Conservapedia's & RationalWiki's early history. ₩€₳$€£ΘĪÐ Methinks it is a Weasel 10:04, 27 September 2015 (UTC) - Then put it as a section I said articles' pages, rather than as its current incarnation -- a shitty intro followed by a creey list of people mentioned. FuzzyCatPotato!™ (talk/stalk) 13:52, 27 September 2015 (UTC) - I cannot see how we can make this article "better," given that it appears to have been some sort of forum page. However, that being said, this article is vital to understanding the earliest roots of RationalWiki and our link to CONservapedia back in the day. With that being said, I strongly favor "keeping" it regardless of whether or not improving it is possible. Gooniepunk (talk) 10:11, 27 September 2015 (UTC) - this is a big part of CP and RW's early history. It wasn't even mentioned at the Great CP Article Purge, though. Bicyclewheel 13:04, 27 September 2015 (UTC) - To me, unless it's made extra obvious it's being kept around as a museum piece, the best solution would be to keep it in the sense that we merge and absorb it into the larger Conservapedia (or RationalWiki) article. (And/or keep a Fun or Archive or something version around as a museum piece...?) Reverend Black Percy (talk) 16:35, 30 September 2015 (UTC) - Of historical interest for the wiki. Keep. --Castaigne (talk) 16:53, 30 September 2015 (UTC) Goat[edit] - This article is literally one of the few pieces of press RationalWiki itself has ever got ... so it might be something to keep around for history. I dunno - David Gerard (talk) 16:29, 30 September 2015 (UTC) - I'd be happy with it being written better, mostly. Being an ancient article with importance to our history is no excuse for shoddy writing. Even more that it's one of our few mentions. --"Paravant" Talk & Contribs 16:32, 30 September 2015 (UTC) - Having trouble telling how many people here want the article preserved and incorporated into the RW/CP articles or preserved as is. FuzzyCatPotato!™ (talk/stalk) 20:47, 30 September 2015 (UTC) Niche | Result: Keep[edit] Delete[edit] Off Mission, one (dictionary) reference. <-𐌈FedoraTippingSkeptic𐌈-> (administrator) (system operator) (talk) 07:24, 25 September 2015 (UTC) This seems to be missionless. Bicyclewheel 09:29, 25 September 2015 (UTC) Keep[edit] - Was a nice read. Could use more content. 142.124.55.236 (talk) 10:50, 25 September 42015 AQD (UTC) - Ecological niches are actually something worth covering. They are one of the specific drivers of evolutionary change, as when the same species splits to different niches (as was the case with the one kind of finches that blew to the galapagos islands) they begin their beak size selection and eventually ended up with as different species. This was quite literally because they mated within their niches - branching out as the galapagos finches. So, important, though stub and could easily be moved to an article on ecology, on evolution, etc. It doesn't need to be stand-alone afaik. Could easily just be a redirect with the text merged to the proper main article. Reverend Black Percy (talk) 11:29, 25 September 2015 (UTC) - Articles discussing basic concepts of evolutionary biology are missional, especially if our mission includes preserving and curating material from EvoWiki. - Smerdis of Tlön, LOAD "*", 8, 1. 03:33, 27 September 2015 (UTC) - Expand it a bit, but otherwise ok. --Castaigne (talk) 16:55, 30 September 2015 (UTC) Goat[edit] - Part of the general scientific backup stuff we have on evolution, so not irrelevant - David Gerard (talk) 10:37, 25 September 2015 (UTC) - I'm sure we can find a place for this. Bicyclewheel 16:53, 30 September 2015 (UTC) FBI biometrics database | Result: Deleted[edit] Delete[edit] - Woefully out-of-date stub. Unless someone takes the time to update this we should probably just remove it. Carpetsmoker (talk) 14:47, 24 September 2015 (UTC) - Delete it as is. Or expand/rewrite if anyone is interested in doing so. Wẽãšẽĩõĩď Methinks it is a Weasel 17:26, 24 September 2015 (UTC) - Don't see the missionality. Kill. --Castaigne (talk) 16:55, 30 September 2015 (UTC) Keep[edit] Goat[edit] - Expand and update it or kill it.--Arisboch ☞✍☜☞✉☜ ∈)☼(∋ 17:28, 24 September 2015 (UTC) - Perhaps merge the admittedly very stub contents into the DNA article, the FBI article, or something of that kind? If no use can be found and no user willing to input work can be found either, I'd say axe it. Reverend Black Percy (talk) 17:30, 24 September 2015 (UTC) - Note that this article is about *plans* for some database. It's not at all clear to me if this actually got implemented, and if so, what. Carpetsmoker (talk) 22:41, 24 September 2015 (UTC) - Doesn't deserve its own article, unless there are conspiracy theories about it or something. If not, a sentence in FBI will do. I wonder how Conservapedia's FBI case is getting on? Bicyclewheel 19:31, 24 September 2015 (UTC) - Merge with some other FBI article, expand, update with new conspiracies, userfy, or just nuke it from high Earth orbit. --Sockpuppet of localhost (talk) 22:33, 24 September 2015 (UTC) September 2015[edit] Basic science | Result: Deleted, Unanimous vote.[edit] Delete[edit] - It's a dictionary definition, and has been for many years ... Unless someone makes this page worthwhile I see no reason in keeping it... Carpetsmoker (talk) 14:42, 24 September 2015 (UTC) - ωεαşεζøίɗ Methinks it is a Weasel 17:28, 24 September 2015 (UTC) - Off with its head! Reverend Black Percy (talk) 17:31, 24 September 2015 (UTC) - Redirecting to science is the only logical solution. That's just basic science! Bicyclewheel 19:33, 24 September 2015 (UTC) - I support making it a redirect to Science. Reverend Black Percy (talk) 22:16, 24 September 2015 (UTC) - How did this survive for so long? O.o 142.124.55.236 (talk) 19:37, 24 September 42015 AQD (UTC) - There are loads of crappy stubs flying under the radar. Eventually one gets randomarticled by someone who cares enough to do something about it. Bicyclewheel 19:43, 24 September 2015 (UTC) - Check Special:ShortPages if you want to blitz a few microstubs. A lot of what shows up on there are fork pages, though. Wëäŝëïöïď Methinks it is a Weasel 22:22, 24 September 2015 (UTC) - Content is just a basic description that has a low chance of improving and should be killed. --Sockpuppet of localhost (talk) 22:36, 24 September 2015 (UTC) - Very informative. Now, how many feet make two meters? Spud (talk) 11:09, 25 September 2015 (UTC) Keep[edit] Goat[edit] Ban Bossy | Result: Deleted with extreme prejudice[edit] Delete[edit] - It's shit. <-𐌈FedoraTippingSkeptic𐌈-> (talk) 19:43, 24 September 2015 (UTC) - It's an interesting topic to discuss, perhaps even say some missional stuff about in an article. Just not this current article. 142.124.55.236 (talk) 19:47, 24 September 42015 AQD (UTC) - If it's true as the article claims that [this] has "recieved enormous amounts of criticism", it should be easily beefed up to full size. If that is true. Reverend Black Percy (talk) 19:51, 24 September 2015 (UTC) - It received a moderate amount of right wing criticism. Not like "trigger warning" or "politically correct" levels of losing their heads, but... really only hitting a few actual publications. ikanreed You probably didn't deserve that 19:57, 24 September 2015 (UTC) - Still worth to have a page on IMHO. But obviously not this turd. Carpetsmoker (talk) 21:10, 24 September 2015 (UTC) - ΨΣΔξΣΓΩΙÐ Methinks it is a Weasel 20:03, 24 September 2015 (UTC) Keep[edit] Goat[edit] Fallacy misidentification | Result: Redirected[edit] Delete[edit] - Stub entry retreading fallacy fallacy with a rather weak & awkward example ωεαşεζøίɗ Methinks it is a Weasel 17:49, 24 September 2015 (UTC) - What Weasel said. Reverend Black Percy (talk) 18:05, 24 September 2015 (UTC) - Pretty much redundant to Fallacy fallacy as above, and deserves only to be a sentence or two in that article. Bicyclewheel 19:28, 24 September 2015 (UTC) - Either redirect (I'm not sure it's identical) or kill - David Gerard (talk) 19:31, 24 September 2015 (UTC) - Nuke from high Earth orbit; just a few cryptic examples of fallacy fallacy, which I've never heard of. --Sockpuppet of localhost (talk) 22:29, 24 September 2015 (UTC) Keep[edit] Goat[edit] - Merge. Fuzzy "Cat" Potato, Jr. (talk/stalk) 22:35, 24 September 2015 (UTC) - So wait, how exactly does this relate to fallacy fallacy? 142.124.55.236 (talk) 22:48, 24 September 42015 AQD (UTC) Science programs at Young Earth Creationist colleges | Result: Delete[edit] - Science programs at Young Earth Creationist colleges (edit|talk|history|protect|delete|links|watch|logs) – (View AfD) Delete[edit] - The article, as written, appears to be copypasted from internet sources with no sources or attributions at all. The material relevant to RW's mission is adequately covered (more or less) in the linked articles. This page reads like a college essay and should be moved to the essay space or deleted as superfluous. Cosmikdebris (talk) 02:14, 18 September 2015 (UTC) - I have tried my best to make this guy's stuff readable, but for a guy whose only role here is to crap on sub-par educational institutions, he cannot write at anything near a decent level. I would shed no tears over this article, or any of his others, being nuked until somebody with an interest and basic writing skills comes by. Peace. AgingHippie (talk) 05:49, 18 September 2015 (UTC) - Yeah. Get rid of this crap. Spud (talk) 11:13, 18 September 2015 (UTC) Keep[edit] Goat[edit] RW needs an article (at least silver quality) on this subject. The leg work needed to bring it up to that standard is perhaps beyond the reach of our current staffing level. For example, Patrick Henry College does not appear in the article. Their catalog is available online, but it is cagey about what the few biology and geology courses actually cover. I knew a family who was proud of the fact that their daughter was going there— not foaming loonies, but apparently decent folk raising a brood of smart accomplished kids. I don't think I will be grilling that one about how much baraminology she had to read, or how the fountains of the deep fit into her stratigraphy studies. Without that kind of specific info, this article is doomed DOOMED, I say to trickle along as a list of superficial pointings and supposings. Alec Sanderson (talk) 13:39, 20 September 2015 (UTC) Al Quds day | Result: deleted 10-4[edit] Please see Jeremy Corbyn talk page[edit] Especially beginning with the section "Al Quds Day videos" and then the section about something or other being "Bowlderized." Avenger has had his sysop status removed and cannot cirumvent the block on the Corbyn article. So, he's trying to get what he wants embedded in a link to an al Quds page he just created today and then asked an UNinvolved, innocent user to embed it for him. This is bullshit antics. Read the Corbyn talk page to see why. If the al Quds article isn't deleted, well, we can just start having an edit war over that! (But I won't do it until I've finished the Zionism draft.) ---Mona- (talk) 21:53, 19 September 2015 (UTC) Delete[edit] - Axe-grinding without relevance to mission. MaillardFillmore (talk) 20:03, 19 September 2015 (UTC) - The article is Avenger's attmept to have his rejected edits linked to on the Jeremy Corbyn article. His sysop status was removed for reason and he so can't make the edits on the Corbyn page. A consensus -- or near consensus -- rejecting Avenger's edits and antics is all reflected on the Corbyn talk page. So, today he created the al Quds page and asked an uninvolved user to embed his tendentious al Quds link on the Corbyn page (which the user did and I promptly removed). tl;dr: The al Quds article was founded in bad faith and should be deleted.---Mona- (talk) 21:32, 19 September 2015 (UTC - Mona first of all your contribution was in the wrong section (thanks for correcting that). Second of all the faith in which an article was created is not grounds for its deletion. And thirdly would you please kindly refrain from dragging one discussion across myriads of pages. It has gotten people angry at you in the past. Avengerofthe BoN (talk) 21:38, 19 September 2015 (UTC) - Words do not describe how black you are calling the kettle right now.--"Paravant" Talk & Contribs 22:12, 19 September 2015 (UTC) - Mona is constantly dragging a discussion across multiple pages which makes it impossible to follow for all but a few people, usually those that are most involved. I don't really know why she does it, but she should refrain from doing so. I don't know what the kettle thing is supposed to mean though. Avengerofthe BoN (talk) 22:17, 19 September 2015 (UTC) - It's a well known idiom that means you are accusing somebody of something that you are also guilty of. Weaseloid Methinks it is a Weasel 22:24, 19 September 2015 (UTC) - (EC) Google "pot kettle black idiom" and be amazed. 142.124.55.236 (talk) 22:25, 19 September 42015 AQD (UTC) - Well for reasons passing understanding I don't know all idioms in the English language. Also, when did I drag a discussion of something entirely unrelated into Afd? Avengerofthe BoN (talk) 22:52, 19 September 2015 (UTC) - ΨΣΔξΣΓΩΙÐ Methinks it is a Weasel 22:04, 19 September 2015 (UTC) - Could you please provide even a semblance of a reason for your opinion? Avengerofthe BoN (talk) 22:13, 19 September 2015 (UTC) - .--"Paravant" Talk & Contribs 22:12, 19 September 2015 (UTC) - If there is no policy that prohibits votes on Afd without any reason provided, there should be. Avengerofthe BoN (talk) 22:14, 19 September 2015 (UTC) - There indeed is no such policy. If you wish to change that, feel free to make a proper proposal on a more appropriate page. 142.124.55.236 (talk) 22:18, 19 September 42015 AQD (UTC) - Redo from scratch. While the topic is relevant to RW (as an example of officially sponsored anti-Israel activities with strong anti-Semitic strains, the latter being the missional bit), the current incarnation reads like a wingnut view of the Middle East with Iran being Ze Evulz Maztermind behind everything, replete with Munich-style suggestions of Western appeasement & betrayal as the reason the Tehran regime didn't collapse in 2009 (as if Western support would've done anything beyond discrediting the opposition as collaborators and foreign agents). It's also kind of hilarious to see the Shi'a being touted as the bogeymen of the Middle East when those fundamentalist Muslims that pose the greatest threat to everyone not sharing their particular faith are actually the extreme Sunnis. Even more bizarre is trotting out the Houthi rebels in that shell shocked crater, Yemen, as anything but one of numerous warring factions in that hopeless country which is now being bombed back beyond the stone aged and blockaded into starvation, courtesy of what has for decades been a far more destabilising force in Islam and the Middle East: Saudi Arabia. The Shi'ites' major black mark at the moment is their short sighted and vindictive Baghdad regime whose marginalisation and persecution of the Sunni minority for its support for Saddam's decades of dictatorship helped prepare the ground for the likes of ISIS. ScepticWombat (talk) 23:19, 19 September 2015 (UTC) Blacke (talk) 23:34, 19 September 2015 (UTC) - Delete and start over, preferably written by absolutely anyone else - David Gerard (talk) 23:39, 19 September 2015 (UTC) - Lemme on the bandwagon, will ya? <-𐌈FedoraTippingSkeptic𐌈-> (talk) 23:41, 19 September 2015 (UTC) - Tiresomely equates support of Palestinian rights with anti-Semitism. - Smerdis of Tlön, LOAD "*", 8, 1. 00:52, 20 September 2015 (UTC) - You do know who created the Al Quds day and when, right? Avengerofthe BoN (talk) 01:14, 20 September 2015 (UTC) - Genetic fallacy? 142.124.55.236 (talk) 13:34, 20 September 42015 AQD (UTC) - I think the WP:TNT approach which David cited is the right approach here. I do think there is a missional article to be had, but cannot see any way the current article can be re-written to achieve that in an acceptable manner. Delete and start again.--TheroadtoWiganPier (talk) 00:58, 20 September 2015 (UTC) Keep[edit] - Is a gathering of all kinds of wingnuts and moonbats and relevant in terms of Antisemitism and antisemitic dog whistles. Have yet to hear a serious reason for deletion. Avengerofthe BoN (talk) 20:12, 19 September 2015 (UTC) - The subject is appropriate for an article. The language should be freer of emotion. Tone it down. Sorte Slyngel (talk) 20:45, 19 September 2015 (UTC) - I read it again. The subject is no different than a multitude of other RW-articles. There are only two things wrong, and one of them will be corrected with growth, that is sources. The second thing is just a matter of style - an English speaking satirist might do wonders. Neither the author nor I are qualified for that job. So, again keep but improve. Sorte Slyngel (talk) 20:59, 19 September 2015 (UTC) - PS: Sources and content. I'd like to see more. Sorte Slyngel (talk) 21:00, 19 September 2015 (UTC) - "Other stuff exists" is not a reason to keep an article. MaillardFillmore (talk) 21:12, 19 September 2015 (UTC) - I'd say it is on-mission, but improvable.--Arisboch ☞✍☜☞✉☜ ∈)☼(∋ 21:08, 19 September 2015 (UTC) - Seems on-mission. Carpetsmoker (talk) 22:59, 19 September 2015 (UTC) Goat[edit] - I'm pretty sure there's missional stuff to be said about it, though I'm skeptical if the current article is that stuff. It's currently also rather lacking in the content department, so I dunno if it's worth keeping at this point. 142.124.55.236 (talk) 20:11, 19 September 42015 AQD (UTC) - There is a saying on WP: Deletion is no cure for content. If your issue is with the content of the article, please be so kind as to add content Avengerofthe BoN (talk) 20:13, 19 September 2015 (UTC) - [Removed comment and put it in delete section]---Mona- (talk) 21:42, 19 September 2015 (UTC) - Mona, vote for delete then. <-𐌈FedoraTippingSkeptic𐌈-> (talk) 21:39, 19 September 2015 (UTC) - There really isn't. What there is, is WP:TNT, which definitely applies here: demolish and start over - David Gerard (talk) 23:40, 19 September 2015 (UTC) - If you're going to start an article with controversial content, you should properly cite every statement with a reputable source. Add the snark later, after you've got all the facts right. --Cosmikdebris (talk) 02:54, 20 September 2015 (UTC) Jerboa[edit] - Rawr! — Unsigned, by: long-eared bipedal rodent So what's the consensus now?[edit] I know that the delete side won. But there were more votes for "on mission thus recreate" and "keep on mission" combined thaen for "delete off mission". Hence the article should recreated in due time, shouldn't it? Avengerofthe BoN (talk) 16:19, 20 September 2015 (UTC) - By anyone who isn't you. I note it's currently at -6 on the "to do" list, which is pretty much "to don't" - David Gerard (talk) 23:45, 21 September 2015 (UTC) David Blunkett | Result: Kept after expansion[edit] Delete[edit] - off mission article about a minor UK politician TheroadtoWiganPier (talk) 10:34, 8 September 2015 (UTC) - An on-mission article is possible but this stub doesn't say anything worthwhile & has been that way virtually unchanged for 7½ years. Unless big things happen to it in the next few days, I say get rid of it. Wéáśéĺóíď Methinks it is a Weasel 00:32, 16 September 2015 (UTC) - I don't think that being home Secretary classifies as being a "minor politician", but the current page offers nothing of substance. I learned nothing from reading it. Not saying we can't have a page on this guy, but it needs to offer at least *something* of substance. Carpetsmoker (talk) 00:33, 16 September 2015 (UTC) Keep[edit] - Bad nomination from ignorance. Ridiculously authoritarian politician in the Blair government - David Gerard (talk) 15:34, 8 September 2015 (UTC) - It might be a bad nomination, at least in your world David, but it is not born of ignorance. I could roll off the names of 100 British ministers who were every bit as authoritarian as Blunkett. Do we want an article on all of them? The fact this article sits as a very unimpressive stub says much. Blunkett does represent the gone wrong period of the Blair government which certainly did become very authoritarian and he could be mentioned in that respect in the New Labour article. He is neither notable enough nor notably different enough to warrant his own RW article. --TheroadtoWiganPier (talk) 15:50, 8 September 2015 (UTC) - Is that really a good argument, though? I can list a bunch of authoritarian Republicans, but that doesn't make Dick Cheney non-notable, does it? 142.124.55.236 (talk) 19:48, 8 September 42015 AQD (UTC) - Weak keep (we do that here, right?). It needs expansion, particularly is authoritarian words and deeds need detailing. If not, redirect to New Labour. Bicyclewheel 10:53, 11 September 2015 (UTC) - I hate to agree with David Gerard on anything, but I actually agree with his arguments here. Blacke (talk) 09:06, 19 September 2015 (UTC) - a crap load of work has been done by me on the article since the AFD. --TheroadtoWiganPier (talk) 10:28, 19 September 2015 (UTC) Goat[edit] - He's held some very important positions and he's big on authoritarianism, from what the article tells me, so it at least seems missional. 142.124.55.236 (talk) 11:12, 8 September 42015 AQD (UTC) - This is one of those situations that might be hard to evaluate if you don't live there. A British politician who apparently is dismissive of civil libertarians and their concerns. I don't think that every US politician who has ever said something critical about the ACLU warrants an article without more. I'd like to see the article make a better case as to why his statement is a bigger deal than that. - Smerdis of Tlön, LOAD "*", 8, 1. 14:25, 11 September 2015 (UTC) - OK, this might sound a bit odd as I nominated the article for deletion. There are some good points made in this AFD on all sides and it seems unlikely we will reach consensus. So, let me have a go at the article over the next few days. I still believe that Blunkett's authoritarianism would be better dealt with in the New Labour article as it was a symptom of that administration. But let me see if I can make this article stand up.--TheroadtoWiganPier (talk) 00:53, 16 September 2015 (UTC) - I had a go at the article. It is dry and dreary but so is the subject matter. And I am just not invested in writing about this man. But I suspect the AFD can now go?--TheroadtoWiganPier (talk) 11:09, 16 September 2015 (UTC) Sargon Of Akkad | Result: Deleted[edit] Delete[edit] - Some random twat on the Internet. Obviously a really nasty piece of work. But he doesn't seem to have said anything that millions of other people haven't sprinkled across comments sections all over the web. What makes him notable? Spud (talk) 07:26, 15 September 2015 (UTC) - All his subscribers and support, as well as his positions? The article is incredibly poorly written, but it should simply be rewritten. <-𐌈FedoraTippingSkeptic𐌈-> (talk) 07:30, 15 September 2015 (UTC) - If NephilimFree get's an article, why not this guy? He dwarfs Nasty Neph in subscribers and makes equally counterfactual claims. — Unsigned, by: 101.190.13.161 / talk / contribs - 'Cos it's shit. A non-shit article would be worth keeping - David Gerard (talk) 10:46, 15 September 2015 (UTC) - His only real relevance to the site is his status as a Gamergate figurehead.Oh yeah, and this also looks like something straight out of Encyclopedia Dramatica. It's not even original; it's a ripoff of the long-running trolling of Ben Garrison. Blitz (Complaints Box) 07:32, 15 September 2015 (UTC) - Delete, unless someone can find some notability and worthy content (unlikely). Otherwise he is just yet another noisy troll.--TheroadtoWiganPier (talk) 07:44, 15 September 2015 (UTC) - Delete as it stands - David Gerard (talk) 10:45, 15 September 2015 (UTC) - Worst article ever Doxys Midnight Runner (talk) 12:27, 15 September 2015 (UTC) - This is too much of a hit piece, with way too loaded a framing even for us. ikanreed You probably didn't deserve that 14:42, 15 September 2015 (UTC) - Not notable. Kill it. --Castaigne (talk) 17:05, 15 September 2015 (UTC) Keep[edit] - An article on a person with millions of video views about atheism and social justice is needed. If you don't like the current article, improve it. Herr FüzzyCätPötätö (talk/stalk) 16:52, 15 September 2015 (UTC) Goat[edit] New Apologetics | Result: Keep[edit] Delete[edit] - Until cites, not worth it. Mʀ. Wʜɪsᴋᴇʀs, Esϙᴜɪʀᴇ (talk/stalk) 07:47, 30 August 2015 (UTC) - Die die die die die die die die Blacke (talk) 07:48, 30 August 2015 (UTC) Keep[edit] - Seems to be a valid, vaguely missional subject. Just need cites and snark.--TheroadtoWiganPier (talk) 07:51, 30 August 2015 (UTC) - As the Orwellite above says, it's missional, it just needs expansion. Cites and examples especially. Bicyclewheel 08:56, 30 August 2015 (UTC) - Orwellite? Uncertain if compliment. Sir ℱ℧ℤℤϒℂᗩℑᑭƠℑᗩℑƠ (talk/stalk) 09:05, 30 August 2015 (UTC) - WP:The Road to Wigan Pier. Bicyclewheel 09:20, 30 August 2015 (UTC) - Be thankful I am not Keeping Aspidistras Flying (much).--TheroadtoWiganPier (talk) 09:25, 30 August 2015 (UTC) - Just as long as you Come Up For Air once in a while. - A trivial Google search for "new apologetics" shows the applicability and missionality. Mediocre stub, but clearly on-mission - David Gerard (talk) 12:10, 2 September 2015 (UTC) - Google easily provides sources for this article. This is exactly the type of group we mean to cover. This article just needs moar work. Reverend Black Percy (talk) 12:26, 2 September 2015 (UTC) - This is the type of group that RationalWiki was created to expose. Just needs expansion with sources. Tuxer (talk) 00:00, 7 September 2015 (UTC) - For the reasons listed above. Carpetsmoker (talk) 21:31, 7 September 2015 (UTC) Goat[edit] - I would like to plead for a two-day stay of execution. It's a phrase that doesn't really describe a well-unified movement, and I'll admit that what's there now is crap, BUT it's a missional subject that can be salvaged/written for real. I meant to the other day but life plus other RW stoofs of interest. WalkerWalkerWalker 08:19, 30 August 2015 (UTC) - Agree. Sometimes articles take time to develop. - Smerdis of Tlön, LOAD "*", 8, 1. 02:13, 31 August 2015 (UTC) Jerboa[edit] - Shouldn't we generally have a longer interval between the nomination for deletion and the actual wiping off the face off the wiki of a certain topic? Avengerofthe BoN (talk) 18:37, 30 August 2015 (UTC) - I think it's supposed to be a week? Herr FüzzyCätPötätö (talk/stalk) 03:54, 31 August 2015 (UTC) - There's a divide between nominal and actual. It tends to be defined by everyone going "Seriously? This is garbage" dogpiling the first day. ikanreed You probably didn't deserve that 18:28, 2 September 2015 (UTC) - Dogpiling is basically RW's speedy delete template. Heh. Mʀ. Wʜɪsᴋᴇʀs, Esϙᴜɪʀᴇ (talk/stalk) 22:43, 2 September 2015 (UTC) Black Lives Matter | Result: Reversing course on my own reverse course: Kept 16 - 3[edit] Delete[edit] - Off mission. Poorly written (huge blockquote from random Redditor - really?) and extremely one-sided. Edit war bait. Shtrominer (talk) 19:18, 6 September 2015 (UTC) - Biased article to present these guys as a "human rights group", in fact they're mostly racist thugs. Should be deleted since the truth isn' being posted. I provided evidence for this on BLM talk page: (1) video evidence shows entire crowds of BLM activists shouting for the killing of cops, (2) many members of BLM were on camera saying their crowd would not accept anyone who is not "black" or "African descent" (they turned away some "white" guy) and (3) the fact BLM invite black supremacists to their conferences or organized events.Krom (talk) 23:33, 6 September 2015 (UTC) - "I don't like that the articles tone does not agree with me" is not a valid reason for deleting it any more than "it causes edit wars!" is--"Paravant" Talk & Contribs 23:35, 6 September 2015 (UTC) - Why then aren't we saying Stormfront is a "human rights" group? This is why most people think RW is a place for self-hating "white" liberals -- there's a double standard here that stinks on most race articles.Krom (talk) 23:42, 6 September 2015 (UTC) - Because it isn't.--"Paravant" Talk & Contribs 23:44, 6 September 2015 (UTC) - Stormfront: cop haters, white separatists, white supremacist = racist extremists. Black Lives Matter: cop haters, black separatists, black supremacists = anti-racist human rights group??? Ok. Thanks for proving my point. Krom (talk) 23:56, 6 September 2015 (UTC) - I never said one thing about BLM, I said your reason is not a valid reason to go around wanting articles deleted and I would summarily close any AFD's you started with such a reason.. --"Paravant" Talk & Contribs 23:59, 6 September 2015 (UTC) - So Krom, watched any Fox News lately? 142.124.55.236 (talk) 00:13, 7 September 42015 AQD (UTC) - Although the cure for a shitty article is not deletion there is nothing in this article that is on-mission. Tielec01 (talk) 06:28, 7 September 2015 (UTC) Keep[edit] - <-𐌈FedoraTippingSkeptic𐌈-> (talk) 19:22, 6 September 2015 (UTC) - On-mission. Not horribly written compared to RW's general standards. RW covers controversial issues, so yes, edit wars may occur. 142.124.55.236 (talk) 19:24, 6 September 42015 AQD (UTC) - Edit war bait? You mean like most of the articles here? --Akira (talk) 19:25, 6 September 2015 (UTC) - Easily on-mission, and "people may edit war about it" is a crap reason to propose deletion. Bicyclewheel 19:32, 6 September 2015 (UTC) - Might as well be arguing for deleting Occupy Wall Street. CorruptUser (talk) 19:51, 6 September 2015 (UTC) - Solving edit wars by deleting articles is a shit way to do. This article is clearly on-mission (is about a more or less notable civil rights organization ).--Arisboch ☞✍☜☞✉☜ ∈)☼(∋ 19:53, 6 September 2015 (UTC) - Why in the world would this article be deleted? Reverend Black Percy (talk) 21:44, 6 September 2015 (UTC) - On-Mission? Of course! Edit war bait? Most of the articles here are. Might as well argue about the feminism article being deleted. It's been improved enough that it doesn't look poorly written at all. So, why should this article be deleted?--Pokefrazer (talk) 23:20, 6 September 2015 (UTC) - BLM is patently a response to a pattern of authoritarian systemic abuse, and so sits squarely in RW's wheelhouse. Alec Sanderson (talk) 23:23, 6 September 2015 (UTC) - Spurious reasoning is Spurious --"Paravant" Talk & Contribs 23:25, 6 September 2015 (UTC) - If this article is off mission, so are Gamergate, Anonymous, Rape Culture and a whole host more. No, the problem is editors not demanding that Avenger and Arisboch refrain from inserting factually false footnotes. They are not even required to engage it on the talk page. Make them document and do so accurately or omit note altogether, and leave the article alone.---Mona- (talk) 21:41, 6 September 2015 (UTC) - Deletion discussions ain't the place to bitch about other users or their edits, that's what user- and article-talkpages are there for.--Arisboch ☞✍☜☞✉☜ ∈)☼(∋ 14:08, 7 September 2015 (UTC) - You could have done without all the stuff after "a whole host more" up in the keep section--"Paravant" Talk & Contribs 22:31, 6 September 2015 (UTC) - I should have put it under Keep -- you're right. But I stand by my entire comment. But then, you've been wholly unwilling to admit the problem and I don't know what to do about that. It seems a form of denial -- no snark. I find it incredibly frustrating.---Mona- (talk) 23:24, 6 September 2015 (UTC) - I fully understand the issues here - they have no relevance on voting whether the article should be kept or deleted , in particular when neither person was advocating for it's deletion. Don't drag fights into other pages. --"Paravant" Talk & Contribs 23:27, 6 September 2015 (UTC) - As the creator of the page, I stand that it needs to be expanded, with actual sources. Just because the content is controversial and some people don't like it that doesn't mean it's off-topic. Tuxer (talk) 23:57, 6 September 2015 (UTC) - --Owlman (talk) 00:49, 7 September 2015 (UTC) - ????? - Smerdis of Tlön, LOAD "*", 8, 1. 02:48, 7 September 2015 (UTC) - This is daft. I can't see 12 people suddenly coming along to vote for delete. Can't we declare this a keep already? Spud (talk) 15:54, 7 September 2015 (UTC) - The edit war is being caused by particular people, not the subject. This nomination is inane - David Gerard (talk) 18:20, 7 September 2015 (UTC) Close this now?[edit] It's currently 16-3 in favour of keeping. Barring a comeback greater than Wales vs Scotland in 1988, this one's over. Bicyclewheel 18:43, 7 September 2015 (UTC) Goat[edit] - If we delete this rather tame edit war due to edit warring, the only article that would stay on this wiki would be the one on Neptune Avengerofthe BoN (talk) 20:41, 6 September 2015 (UTC) - No, it's off mission. So according to some of the more rigid editors here, including the one who started this whole thing, it should be deleted as well. <-𐌈FedoraTippingSkeptic𐌈-> (talk) 20:59, 6 September 2015 (UTC) Keep some discussions at one point[edit] Whether BDS should be mentioned (and how) is now discussed at four or more different places. This is enough. Please discuss the BDS question at the BLM talk page where it first arose... Avengerofthe BoN (talk) 22:03, 6 September 2015 (UTC) - Okay. So why are you raising it here? ΨΣΔξΣΓΩΙÐ Methinks it is a Weasel 22:50, 6 September 2015 (UTC) - Mona raised it above. Or at least I understood her words in that way. Avengerofthe BoN (talk) 22:52, 6 September 2015 (UTC) - No. I didn't say that. The problem of your behavior extends far beyond the article unders discussion, but your behavior will continue to raise this problem and/or others. All of which is to say, this is not a discussion going on about BDS "in four or more different places. " Your behavior, and your comrade's, is the larger problem.---Mona- (talk) 23:29, 6 September 2015 (UTC) - Talk about this elsewhere--"Paravant" Talk & Contribs 23:31, 6 September 2015 (UTC) Stupidity | Result: Dead and stupid[edit] Delete[edit] - Not really an article about anything & certainly not analysing & refuting anything; just a few random quotes & other scraps of trivia thrown together. Ŵêâŝêîôîď Methinks it is a Weasel 07:17, 25 August 2015 (UTC) - Nope. Fuzzy. Cat. Potato! (talk/stalk) 07:48, 30 August 2015 (UTC) - Nuke from orbit Blacke (talk) 07:49, 30 August 2015 (UTC) - It's more like an overgrown fork page than an actual article, but if you trimmed it back, would it still be worth having? Bicyclewheel 09:00, 30 August 2015 (UTC) - I'd argue we could keep it around as a Fun article. But keeping it as it is now, as much as I like the quotes in it, seems not great. The only downside is that we now have to clean up internal links to this page from a zillion articles. Still seems worth it, though. Reverend Black Percy (talk) 12:31, 2 September 2015 (UTC) - Kill it with fire. --Castaigne (talk) 23:02, 4 September 2015 (UTC) Keep[edit] - Deleting this article would be stupid.--Arisboch ☞✍☜☞✉☜ ∈)☼(∋ 16:35, 25 August 2015 (UTC) - Why? How does it serve any of the site missions? Wēāŝēīōīď Methinks it is a Weasel 16:54, 25 August 2015 (UTC) Goat[edit] Takedownman | Result: Keep[edit] Delete[edit] - What this page amounts to is "Somebody is wrong on the internet". And this particular person is wrong about the topic of human trafficking and the dark web, which are not really within our area of speciality. He doesn't seem to be very notable, a Google search doesn't turn up any quality third party material about him. The two references on the page aren't even about him. Spud (talk) 08:07, 30 August 2015 (UTC) Delete for reasons expressed above by Spud. I should have raised this yesterday rather than placing a note on the article page.--TheroadtoWiganPier (talk) 08:10, 30 August 2015 (UTC) Authors saving throw failed - We aren't the place to go when Wikipedia doesn't want to cover your topic.--"Paravant" Talk & Contribs 14:14, 30 August 2015 (UTC) Keep[edit] - Right, so I'm researching about urban legends on the Dark Web. I write things like this and this to these ends. One of the key sources of misinformation about this topic comes from misleading infographics like this, the other source is the emerging set of Youtubers who mix fact and fiction into their reporting about deep web sites, spreading urban legends, confusion and misinformation. I find this new phenomenon very damaging to the understanding of the actual Dark Web, often creating moral panics from nothing. I edit Wikipedia heavily to seperate fact from fiction in these areas but Takedownman is not yet Wikipedia-notable so unsuitable for inclusion. I was seeking to build up a portfolio of Takedownman's misinformation and I assumed Rational Wiki would be a suitable place to do so. Obviously the article is not yet in any kind of finished state yet. I hope understanding my goals will help. 13:58, 30 August 2015 (UTC)— Unsigned, by: Deku-shrub / talk / contribs - Give it a few more days. If shrubby over here can make it decent, then it can keep. Mʀ. Wʜɪsᴋᴇʀs, Esϙᴜɪʀᴇ (talk/stalk) 17:50, 30 August 2015 (UTC) - We do have to do this eventually. KOMF 18:59, 30 August 2015 (UTC) - Keep for now, pending improvements. Dark Web is something we should cover better. Bicyclewheel 09:18, 31 August 2015 (UTC) - This article has potential. Keep it.--Arisboch ☞✍☜☞✉☜ ∈)☼(∋ 16:43, 31 August 2015 (UTC) - Definite change of mind after recent work by Deku-shrub. The potential is there. --TheroadtoWiganPier (talk) 16:47, 31 August 2015 (UTC) - The list at the end could do with a trim, but otherwise I guess it works out.--"Paravant" Talk & Contribs 17:59, 31 August 2015 (UTC) - I certainly think this article can and should stay, though I do mean that with a significant rewrite, where his wall of text of video links is replaced with actual text, analysis and refutation as per the mission statement. So the current article is crap, but there's a ton of sources that can be used for a rewrite already in it. So deletion is not needed. Also, this guy is atleast as notable as Stars are Souls. I find this guy notable. Reverend Black Percy (talk) 22:53, 31 August 2015 (UTC) Goat[edit] - Give the author a while to answer "so what?" but it does need to be answered really - David Gerard (talk) 08:59, 30 August 2015 (UTC) August 2015[edit] Kristen Luman | Result: redirect to Ghost Mine[edit] Delete[edit] - About half this page isn't even about Kristen Luman, It's about the show she hosts, Ghost Mine, which we've already got an article about. Most of the rest of it is made up of tabloid-style gossip (all unsourced gossip about a living person) which seems to be suggesting that she's been with blokes and might have got her tits out on camera. Big fucking deal! It doesn't sound like she's a genuine pseudoscience promoter, just someone who happens to host a stupid TV show. Spud (talk) 08:40, 25 August 2015 (UTC) - Zapped as a stupendous BLP hazard. Appears to be a complete driveby. Redirected to Ghost Mine - David Gerard (talk) 11:14, 25 August 2015 (UTC) Keep[edit] - Why there was an article on Kristen Luman at all eludes me. Though since I'm being redirected to Ghost Mine now, I'm going to say that I don't think we should delete the article for the show Ghost Mine (although it needs a lot of improvement). So if this vote is to remove the Kristen Luman article entirely - the one that's currently a redirect - then I'm with you. If the vote is to remove all mention of Ghost Mine, I'm not with you. Reverend Black Percy (talk) 11:54, 25 August 2015 (UTC) - I don't suppose it much matters a month later. But for the record, I did not mean delete all references to Ghost Mine. I just meant get rid of a page of tabloid gossip, which did nothing but vaguely suggested that the subject had shagged a few guys and got her boobs out on camera. Spud (talk) 08:17, 26 September 2015 (UTC) Goat[edit] Bat shit crazy | Result: put to sleep[edit] Delete[edit] - This is absolute crap and an utter waste of space. This has got fuck all to do with "batshit crazy" as we use the term here/ What the fuck have Spanish-accented party animals got to do with our mission? Spud (talk) 13:58, 24 August 2015 (UTC) - Delete. It's a badly written and very silly definition of a term. Slippery slope, et cetera.--TheroadtoWiganPier (talk) 14:03, 24 August 2015 (UTC) - Delete. Off-mission, twisting of words in regards to how this word is used here, anyway.--Arisboch ☞✍☜☞✉☜ 14:10, 24 August 2015 (UTC) - You know what rationalwiki needs? More vague articles that become a natural place to dump your hatred du jour. More moderate opinion: many things covered on rationalwiki are indeed batshit crazy and explaining that could be helpful, but the article would have a very hard time living up to that standard. ikanreed You probably didn't deserve that 14:19, 24 August 2015 (UTC) - Balete it. And just as an FYI, regardless of the fate of this article, it's not even using the "right" name - which is "batshit", not "bat shit" - the latter is an alternate form that exists only as a footnote to the former. In the unlikely event that this article even stays, "bat shit" is a redirect at best. These aren't the grounds for deleting it, but just saying. Source: Reverend Black Percy (talk) 14:24, 24 August 2015 (UTC) Keep[edit] Goat[edit] - Maybe copypaste a bit into Category:Batshit crazy, but otherwise, yeah we don't need an article on this. 142.124.55.236 (talk) 14:05, 24 August 42015 AQD (UTC) Feminist video games, now renamed | Result: Deleted[edit] - Video games featuring positive female characters (edit|talk|history|protect|delete|links|watch|logs) – (View AfD) Delete[edit] - Inaccurate, poorly written, and it isn't even the right way to approach the topic. I could help make it more accurate by adding examples, but soon enough it would become clear that there are a lot of games out there that treat both genders fairly. The article could explain that these games aren't a majority, but people are going to take home the opposite message. Player 03 (talk) 02:05, 19 August 2015 (UTC) - While I'm at it, let's take a look at RationalWiki's mission statement: - Analyzing and refuting pseudoscience and the anti-science movement. - Neither feminism nor video games are pseudoscience or anti-science. - Documenting the full range of crank ideas. - There are cranks arguing over feminism and/or video games, but this article doesn't mention them. Nor does it argue against ideas commonly held by cranks, nor does it explain things that are commonly misunderstood by cranks. - Explorations of authoritarianism and fundamentalism. - Neither feminism nor video games fall under these categories, except perhaps for fringe groups in the feminist movement. - Analysis and criticism of how these subjects are handled in the media. - Video games may be "media," but the policy is referring to the news media. - I realize that there are other articles that don't seem to match these criteria. However, most of those articles fall under the category of "explaining things that are commonly misunderstood by cranks," which as I said above, does not apply to this article. Player 03 (talk) 02:40, 19 August 2015 (UTC) - Amen to that.--Arisboch ☞✍☜☞✉☜ 02:11, 19 August 2015 (UTC) - It's possible to argue forever about what makes a video game "feminist". Is the newest Tomb Raider feminist? What of the several that make Wonder Woman a playable character? Any game where you can choose a female protagonist? (This vastly improves the Mass Effect series.) And so forth. - Smerdis of Tlön, LOAD "*", 8, 1. 03:35, 19 August 2015 (UTC) - Many feminism related things are on mission for RW, an article about games that are feminist are not --"Paravant" Talk & Contribs 04:00, 19 August 2015 (UTC) - Wěǎšěǐǒǐď Methinks it is a Weasel 07:49, 19 August 2015 (UTC) - --TheroadtoWiganPier (talk) 08:20, 19 August 2015 (UTC) - Balete it. Reverend Black Percy (talk) 09:24, 19 August 2015 (UTC) - The article, in its current state, is irreparably terrible. The topic of the article is already covered in dozens of other articles. On top of that, what makes something a "feminist video game" is a poorly defined, subjective concept that would likely 1) add to mission creep on RationalWiki and 2) wind up with a definition that is so vague it will be subjected to debate on RationalWiki for years on end. For these reasons, I find this article unsuitable for RationalWiki and worthy of deletion. Gooniepunk (talk) 12:10, 19 August 2015 (UTC) - Per Gooniepunk's "subjective concept" argument. —Bilorv (smells) 12:17, 19 August 2015 (UTC) - Cruft magnet. Alec Sanderson (talk) 12:48, 19 August 2015 (UTC) - Cruft magnet is an excellent way to describe the primary problem here. ikanreed You probably didn't deserve that 13:17, 19 August 2015 (UTC) Keep[edit] - Keep and expand. --Castaigne (talk) 02:43, 19 August 2015 (UTC) - Keep, expand, change the definition of feminist video games, and maybe change the title to "Positive representations of females" instead so we can avoid an unproductive argument. I've already started working on it by inserting specific examples and sources, and also rewriting the poor prose, since deleting the article altogether is a terrible idea. Also, feminism is not in fact a pseudoscience but an "-ism", one in which we increasingly study due to their misrepresentation in the news media and media in general. Let me add that in one of the video games in Mass Effect the protagonist enters into an intense love scene with an alien. Media outlets such as Fox News decided to commit a straw man and say that the alien sex scenes were purely for pornographic purposes rather than artistic choices made by both the player and the developer. An editor made a wise move by putting it in the Media Category is it news, showing that it is in fact relevant to Rational Wiki.--Dandtiks69 (talk) 07:00, 19 August 2015 (UTC) - Clues to how to prevent viewers form taking home the opposite message include graphical representations of the quantity of these kinds of games versus more traditional ones and an emphasis on tokenism. Like I said I will emphasize the definition of a feminist video game more so that games like Tomb Raider or Bayonetta don't get included, as choosing a female playable character isn't enough. I put down from Feminist Frequency "Jade" as a reliable character for feminism because she has relatable problems to those of both genders and because her attire emphasizes practicality, a lot. This is how we can get the article to fit in "Positive Female Character archetypes" or "Feminist Video Games", whichever title is preferable. That's why I say change the title instead. Dandtiks69 (talk) 07:23, 19 August 2015 (UTC) Goat[edit] - I think this is just the wrong place for this article. We have list articles about music of a particular persuasion, why not stuff this into the same namespace? Zero (talk - contributions) 07:29, 19 August 2015 (UTC) Doug Stanhope | Result: deleted[edit] Delete[edit] - I wasn't the one who put the Delete template on the page. But I think it was the right thing to do. Some comedian tells rude jokes about religion while drinking and smoking. So bloody what? Spud (talk) 03:47, 10 August 2015 (UTC) - Fails the "so what" test in its present state - David Gerard (talk) 10:42, 10 August 2015 (UTC) - Shoot to kill.--Arisboch ☞✍☜☞✉☜ 10:44, 10 August 2015 (UTC) - Wẽãšẽĩõĩď Methinks it is a Weasel 12:59, 10 August 2015 (UTC) - I thought it was a bit of a poser when it first appeared, but was hopeful it would flesh out. Apparently not. Queexchthonic murmurings 13:09, 10 August 2015 (UTC) - Doug who? ScepticWombat (talk) 13:54, 10 August 2015 (UTC) - Snowball's chance in August north of the equator. CamelCasePragmatist (talk) 15:02, 10 August 2015 (UTC) Keep[edit] Goat[edit] Oil, Smoke & Mirrors | Result: Keep[edit] Delete[edit] - Okay, unlike A Crude Awakening: The Oilcrash this film at least ticks the apocalyptic FUD boxes, but why does RW actually need this? Unless someone wants to slog through it and write a critical and snarky review of it (my edits being only a snarkification of a rather happy-clappy review), I suggest it gets the chop. I don't even know if it's interesting enough to be here in the first place. ScepticWombat (talk) 23:56, 3 July 2015 (UTC) Keep[edit] - Improve not delete. 32℉uzzy, 0℃atPotato (talk/stalk) 00:19, 4 July 2015 (UTC) - This looks entirely on-mission - David Gerard (talk) 07:20, 4 July 2015 (UTC) - ^ What the ladies before me said. Carpetsmoker (talk) 08:30, 7 July 2015 (UTC) Goat[edit] - Considering the initial response I've received, I suggest that both this and A Crude Awakening:49, 4 July 2015 (UTC) - I'm starting to feel like some kind of spambot here, but I phrased myself so agreeably on the talk page for this movie (and the one for "A Crude Awakening")) A Crude Awakening: The Oil Crash | Result: Keep[edit] Delete[edit] - Why do we need this film mentioned on RW? It doesn't sound like the fearmongering peak oil doomcrying of Oil Smoke and Mirrors and pointing out that our current economic system would be in trouble without oil is kind of a "duh"-message. Axe it. ScepticWombat (talk) 23:49, 3 July 2015 (UTC) Keep[edit] - Improve not delete. Also, "running out of" uranium? Debunk this stupid film. Herr FüzzyCätPötätö (talk/stalk) 00:20, 4 July 2015 (UTC) - No reason to delete - David Gerard (talk) 07:19, 4 July 2015 (UTC) - Haven't seen the film, but even if it isn't a "fearmongering peak oil doomcrying", then it would still make sense to have an article on it, to explain *why* it's not one, and expand on why the points made in the film are true. Explaining *good* science is an important part of "Analyzing and refuting pseudoscience and the anti-science movement.". Carpetsmoker (talk) 08:32, 7 July 2015 (UTC) Goat[edit] - Considering the initial response I've received, I suggest that both this and Oil Smoke and Mirrors:50, 4 July 2015 (UTC) - I'm starting to feel like some kind of spambot here, but I phrased myself so agreeably on the talk page for this movie (and the one for "Oil, Smoke and Mirrors")) July 2015[edit] Deep ecology | Result: Speedy close - even the proposer isn't proposing deletion[edit] Delete[edit] - The extreme versions can easily be merged into hard green and the vague wishy-washy Næss version promoted on the talk page is hardly worth mentioning as it smacks of Sunday school environmentalism. ScepticWombat (talk) 08:59, 20 July 2015 (UTC) Keep[edit] - Wéáśéĺóíď Methinks it is a Weasel 07:03, 21 July 2015 (UTC) - Hi Weaseloid, any specifics about what's "keepworthy"? Or is it just on "general mission relevance" grounds? ScepticWombat (talk) 07:43, 21 July 2015 (UTC) - I haven't read it start to finish, but it appears to be a mission-relevant topic & is long enough for a RW article on a minor topic. What I don't see here is a rationale for deletion: only "can be merged", which isn't an argument. If that's what you want to propose, it should be on RationalWiki:Duplicate articles rather than AfD. Wēāŝēīōīď Methinks it is a Weasel 08:08, 21 July 2015 (UTC) - Ah, my bad, but how often do editors actually check the duplicate articles section and should I move it there instead? - Anyway, I'm arguing for a merge with hard green (and perhaps a fork pointing to hard green and environmentalism for the differing strains of deep ecology) and making deep ecology a subsection of that article since the RW-relevant bits (depopulation and Luddite factions) are probably better covered there. By contrast, the vague over-hedging Næss version with its huge escape hatches as to what may constitute "vital necessities" for humans really don't seem very relevant to RW as, in practice, it dovetails with rather mainstream attitudes about environmental "stewardship" (i.e. not carelessly fucking up the environment). For instance, aiming for population decline, but only recommending voluntary family planning is simply advocating practices wholly incommensurate with your goals. This "Næssist" strain might tag on some spiritual woo à la the Gaia hypothesis to general environmentalism, but not much beyond that. ScepticWombat (talk) 12:27, 21 July 2015 (UTC) Goat[edit] - Merge as a section in hard green - David Gerard (talk) 10:02, 20 July 2015 (UTC) - ^ Herr FuzzyKatzenPotato (talk/stalk) 11:46, 20 July 2015 (UTC) - Agree. - Smerdis of Tlön, LOAD "*", 8, 1. 02:42, 21 July 2015 (UTC) - Done. ScepticWombat (talk) 20:00, 29 July 2015 (UTC) Category:Extreme wingnuttery & Category:Extreme moonbattery | Result: Closed - no consensus[edit] - Category:Extreme wingnuttery (edit|talk|history|protect|delete|links|watch|logs) & Category:Extreme moonbattery (edit|talk|history|protect|delete|links|watch|logs) – (View AfD). Wėąṣėḷőįď. Щєазєюіδ. Wëäŝëïöïď. Wēāŝēīōīď. ΨΣΔξΣΓΩΙ. Weaseloid. Щєазєюіδ Methinks it is a Weasel 23:43, 2 July 2015 (UTC) EvoWiki/Terms of use | Result: deleted[edit] Delete[edit] - No relevance to RW's mission:14, 18 July 2015 (UTC) - This is a canonical example of cruft. Alec Sanderson (talk) 19:20, 18 July 2015 (UTC) - Delete all EvoWiki pages of a non-article nature. We didn't keep RationalWikiWiki's policy pages etc, why keep EvoWiki's? We're not the Dead Wiki Museum. Bicyclewheel 21:46, 19 July 2015 (UTC) - Redundant ωεαşεζøίɗ Methinks it is a Weasel 21:59, 19 July 2015 (UTC) - For crying out loud, why is there any discussion. DELETE.Scream!! (talk) 22:44, 19 July 2015 (UTC) Keep[edit] - This vote applies to all other EW articles. (A) I think plenty of the pages are relevant to RW's mission -- many contain content or discussion of ideas that's relevant to RW's goals. They also document a skeptic website; to me, this is akin to keeping copies of some of talkorigins's pages if the archive ever went down. (B) RW isn't maintaining a copy of every document -- only these project-related ones. Mʀ. Wʜɪsᴋᴇʀs, Esϙᴜɪʀᴇ (talk/stalk) 18:27, 18 July 2015 (UTC) - We already -have- a page documenting evowiki though. Why is evowiki so special it gets it's entire policy page catalog also brought over to be perused and not, say, conservpaedias policy pages or wikipedias? Citizendium doesn't have large quantities of it's articles sitting on RW servers because it isn't relevant to host the actual policyp ages here, it suffices to talk about them on the citizendium page. And it isn't our job to maintain talk.origin archives either.--"Paravant" Talk & Contribs 18:30, 18 July 2015 (UTC) - "We already -have- a page documenting evowiki though" -- and does it document EW's policies in full? - "Why is evowiki so special it gets it's entire policy page catalog also brought over to be perused and not, say, conservpaedias policy pages or wikipedias?" -- Not least because it's ours, and because its goals mostly align with RW's; WP's and CP's are significantly different. - On citizendium -- if it ever falls, and if the RMF buys it, then why not copy over (some of) the policy pages, if only to show why it fell? Cømяade FυzzчCαтPøтαтø (talk/stalk) 18:33, 18 July 2015 (UTC) - "Do we cover evowikis relevant policies in full? No" Well then we should get working on that evowiki article. " Not least because it's ours, and because its goals mostly align with RW's; WP's and CP's are significantly different Yes, and? Just because we own the domain now doesn't mean it's still important we forever maintain snapshots of policy pages, nor does the fact it aligns with our own goals. --"Paravant" Talk & Contribs 18:44, 18 July 2015 (UTC) - As to your "show -how- it fell- point, we don't need to actually show people the policy pages of citizendium (or any website) to tell them why those policies led to it falling. That's just stupid. --"Paravant" Talk & Contribs 18:44, 18 July 2015 (UTC) - "Well then we should get working on that evowiki article." Or just keep the project pages and let people see for themselves. Again, where's the harm? - "Yes, and? Just because we own the domain now doesn't mean it's still important we forever maintain snapshots of policy pages, nor does the fact it aligns with our own goals." (A) Preserving lost info and making it accurate and easily accessible (as opposed to web-archiving or guessing from viewing other wikis) seems important, (B) preserving the policy of a similar-minded wiki for review or incorporation seems important, (C) maintaining their project pages seems intellectually honest when incorporating their project into ours. - "we don't need to actually show people the policy pages of citizendium (or any website) to tell them why those policies led to it falling. That's just stupid." We don't. We could summarize their policies and the effects those policies had in excruciating detail. But there's (a) no harm in letting people view the original policies and (b) no substitute for the original.:00,. - "(B) preserving the policy of a similar-minded wiki for review or incorporation seems important, (C) maintaining their project pages seems intellectually honest when incorporating their project into ours." We dont need to keep carbon copies of Evowiki policy pages to cannibalize some of their policies.!.--"Paravant" Talk & Contribs 19:09,." - "We dont need to keep carbon copies of Evowiki policy pages to cannibalize some of their policies." Would anyone see them otherwise? - " (A) the page in question says the opposite (B) that's not why I support having the EW articles -!" Cømяade FυzzчCαтPøтαтø (talk/stalk) 19:15, 18 July 2015 (UTC) - I would respond but you didn't make any points for me to respond to. Or how what i suggested i do at the end is any different from what you're doing now. If the policy pages at evowiki directly improve my ability to understand evowiki, regardless of having any commentary on them, then doing the same for a failed country will do the same right? Whats the difference?--"Paravant" Talk & Contribs 19:17, 18 July 2015 (UTC) - Besides the middle, but it was largely lost in you just copy pasting what i said back. "Would anyone see them otherwise? If there's any evowiki policies we should put in RW, suggest them. Don't nebulously maintain the policy pages incase in the future we decide we want some of them. That's a shit reason to keep them. --"Paravant" Talk & Contribs 19:22, 18 July 2015 (UTC) - Maybe because failed states aren't wikis and aren't quite as relevant to maintaining a successful wiki? FU22YC47P07470 (talk/stalk) 19:24, 18 July 2015 (UTC) - But they are relevant to our mission, which is to document Authoritarianism. The soviet union was authoritarian, and a commentaryless, plain text copy of it's constitution will clearly improve our coverage of the soviet union and soviet style communism. What's the difference? --"Paravant" Talk & Contribs 19:31, 18 July 2015 (UTC) Goat[edit] EvoWiki/Permissions |:17, 18 July 2015 (UTC) - Delete all EvoWiki pages of a non-article nature. We didn't keep RationalWikiWiki's policy pages etc, why keep EvoWiki's? We're not the Dead Wiki Museum. Bicyclewheel 21:48, 19 July 2015 (UTC) - This was a two line stub of no value. I've gone ahead & deleted it. ₩€₳$€£ΘĪÐ Methinks it is a Weasel 22:02, 19 July 2015 (UTC) Keep[edit] Goat[edit] EvoWiki/Suggested uses of EvoWiki | Result: deleted[edit] Delete[edit] - First suggested use of Evowiki: Don't, because you) - This is just pie-eyed brainstorming. Ŵêâŝêîôîď Methinks it is a Weasel 22:28, 19 July 2015 (UTC) Keep[edit] Goat[edit] EvoWiki/How to start using EvoWiki | Result: deleted[edit] Delete[edit] - Step 1) Don;t, because you cannot Step 2) Go to Ratwiki) - Lame Щєазєюіδ Methinks it is a Weasel 22:24, 19 July 2015 (UTC) Keep[edit] Goat[edit] EvoWiki/History |) - Nothing useful that isn't already covered on the main EvoWiki article. Щєазєюіδ Methinks it is a Weasel 22:06, 19 July 2015 (UTC) Keep[edit] Goat[edit] EvoWiki/Goals |) Keep[edit] - This one I can kind of see the value of as an overview of what the site was about. It could be retained as a sub-page of the EvoWiki article or key points from it merged into that. Wěǎšěǐǒǐď Methinks it is a Weasel 22:26, 19 July 2015 (UTC) Goat[edit] EvoWiki/Help |) - Fuck no. Our own help pages are enough of an ill-curated confusing mess without throwing other wikis' own help pages into the mix. Wèàšèìòìď Methinks it is a Weasel 22:08, 19 July 2015 (UTC) Keep[edit] Goat[edit] EvoWiki/Featured articles |) - I guess bored time travellers could follow these instructions to cover-nominate EvoWiki articles in the past. To anyone else they're really not very useful. Wëäŝëïöïď Methinks it is a Weasel 22:11, 19 July 2015 (UTC) Keep[edit] Goat[edit] EvoWiki/Feedback |) - Looks like an idea that didn't take off even at the time. Kill it. Wèàšèìòìď Methinks it is a Weasel 22:12, 19 July 2015 (UTC) Keep[edit] Goat[edit] EvoWiki/About |) - This is more ancient help/instructional content which serves no purpose for us. Wéáśéĺóíď Methinks it is a Weasel 22:13, 19 July 2015 (UTC) Keep[edit] Goat[edit] EvoWiki/Editorial philosophy |) - Nothing here that isn't better covered in our own Community standards & FAQ etc. Wēāŝēīōīď Methinks it is a Weasel 22:23, 19 July 2015 (UTC) Keep[edit] Goat[edit] EvoWiki/Community portal |) - A portal full of dead links for a dead community. Wẽãšẽĩõĩď Methinks it is a Weasel 22:16, 19 July 2015 (UTC) Keep[edit] Goat[edit] EvoWiki/Vandalism | Result: deleted[edit] Delete[edit] - what possible reason do we need a copy of another wiki's policy page on vandalism for? It neither improves our coverage of Evowiki nor our own articles. "Paravant" Talk & Contribs 17:47,) - More old instructional stuff from another site, most of which won't work at RW. Wėąṣėḷőįď Methinks it is a Weasel 22:17, 19 July 2015 (UTC) Keep[edit] Goat[edit] EvoWiki/Main Page | Result: deleted[edit] Delete[edit] - having evowiki articles is good, but having its main page is pointless. Bicyclewheel 17:26, 18 July 2015 (UTC) - We gain nothing from having it here. "No harm in keeping it" doesn't outweigh there's no benefits or relevance to RW either. As for "but it'll be lost." Oh no, what a shame that some dead wiki mainpage will not live on forever. --"Paravant" Talk & Contribs 17:44, 18 July 2015 (UTC) - No harm in keeping it means no benefit from removing it means no obligation to do so. And is it unfeasible that someone might want to see what EvoWiki looked like before it was burnt? Herr FüzzyCätPötätö (talk/stalk) 18:22, 18 July 2015 (UTC) - By that logic we need to host copies of every website we talk about, in the event they also go under and somebody someday wants to have a vague idea of what they looked like. also, it's a wiki, if they really want to know what evowiki "looked like" they can look at 99% of any other wikis page and get the same thing. and there isn't any harm in not deleting off mission articles, and yet we still do.--"Paravant" Talk & Contribs 18:27, 18 July 2015 (UTC) - This website has already gone under and is essentially RW property. And the "no harm" objection is unanswered. Cømяade FυzzчCαтPøтαтø (talk/stalk) 18:29, 18 July 2015 (UTC) - It has been answered - We still gain no benefit from them and We don't have to keep stuff just because it doesn't hurt us to keep it. Nobody is going to look at one of the Evowiki articles we ported over, which ideally will eventually be totally Rwized, know they came from evowiki and go "man i wonder how this website was run!". A person looking at the evowiki article itself, which is where we are supposed to be "documenting" evowiki, isn't going to go "man i really wish i could see what their VANDALISM page looked like!". Any useful information from their vandalism page will be mentioned -on- the evowiki article. --"Paravant" Talk & Contribs 18:34, 18 July 2015 (UTC) - Some of the articles may merit deletion -- Suggested uses of EvoWiki, How to start using EvoWiki, Help, and Vandalism. But the others document EvoWiki or its project. Cømяade FυzzчCαтPøтαтø (talk/stalk) 18:37, 18 July 2015 (UTC) - No. They dont. All of them are in the same boat - Useless policy or community pages you ported over without even fucking asking RW if we thought they should be here, and now defending them being here because "they are already here". And if there is any relevant information in them, it should go in the Evowiki article, not on seperate pages, Nobody needs to see the actual Evowiki about page to know what we are talking about when we say "Evowiki was a anti-creationism, pro-evolution/science wiki". In that line i just summed up pretty much the only relevant information about Evowkis about page.--"Paravant" Talk & Contribs 18:47, 18 July 2015 (UTC) - Yeah, I'm not defending the articles under "Useless policy or community pages you ported over without even fucking asking RW if we thought they should be here, and now defending them being here because "they are already here" and it's ridiculous to claim so. I've defended them as useful for understanding EW, as useful for maintaining EW's project now that it's ours, and as (at worst) harmless additions with possible benefits.:05, 18 July 2015 (UTC) - We aren't "maintaining" Evowiki's project now though, we're subsuming it into our own project. That's part of why we are porting and then editing the articles to look like RW articles: Evowiki is dead and it's identity only exists as a redirect to Rationalwiki. --"Paravant" Talk & Contribs 19:12, 18 July 2015 (UTC) - Incorporating their articles feels a lot like "maintaining" their goals of spreading evidence for evolution and against creationism. Yes, we are editing them -- again, "maintaining" the wiki spirit of both projects. 32℉uzzy; 0℃atPotato (talk/stalk) 19:17, 18 July 2015 (UTC) - Only we aren't Evowiki, we are Rationalwiki. The articles are being put here because the separate identity of Evowiki is considered irrelevant to maintain. The goal of the porting was to take the useful evowiki material, bring it here, and make it a Rationalwiki article. Not just maintain Evowiki on rationalwiki. If we were doing that, maybe the policy pages would be relevant still for understanding Evowiki or' it's articles in a way just mentioning relevant policies on the evowiki article can't show. Since we're stripping the actual part that makes it "evowiki" off, i don't see why we need to keep evowiki policies going forward.--"Paravant" Talk & Contribs 19:28, 18 July 2015 (UTC) - Check the thought I blocked you with. Fuzzy "Cat" Potato, Jr. (talk/stalk) 19:30, 18 July 2015 (UTC) - Delete - crap! Scream!! (talk) 19:05, 18 July 2015 (UTC) - Delete.--Bob"I think you'll find it's more complicated than that." 21:28, 19 July 2015 (UTC) Keep[edit] - No harm in having it. Further, having it preserves something that would be lost. The FCP Foundation (talk/stalk) 17:29, 18 July 2015 (UTC) Goat[edit] - Could maybe be repurposed as a portal for the ported EvoWiki articles, but it would need overhauling so that it links to those pages rather than regular RW pages as it does currently, which is confusing. ₩€₳$€£ΘĪÐ Methinks it is a Weasel 22:20, 19 July 2015 (UTC) Bill Cosby | Result: deleted as trashy/dubious stub[edit] Delete[edit] - The article is a hit piece created by a BON and is of questionable value to RW. Cosmikdebris (talk) 17:14, 9 July 2015 (UTC)
https://rationalwiki.org/wiki/RationalWiki:Articles_for_deletion/Archive_2015
CC-MAIN-2020-40
refinedweb
45,311
61.56
Code. Collaborate. Organize. No Limits. Try it Today. The application acts as an Alarm, Reminder, Mailer and Command Line executor all packed into one. You can set the timer to start an alarm after some specified time. You can also add a Message to pop up at that time to remind of something to be done. Or you could execute any commands from the command prompt or even better you can compose a mail that will be sent at the predetermined time. Now in case you want to send mail alone or execute a command without using the Timer then that too is possible. It all started as a simple Scheduler and then I started adding on these extra features when I came across difficulties faced by others on the Net with regard to: First we'll start off with the code related to the Timer: The implementation for this application has made some use of the Timer alarm code taken from the article Use a timer to create a simple alarm application by Andrew Boisen. My complements to you, Andrew Boisen. So you can refer to that article for detailed comments and the whole code that he has used. The additional input made was for the sound by using Kernel32.dll.You will have to use the System.Runtime.InteropServices namespace. Kernel32.dll System.Runtime.InteropServices //For Sound using System.Runtime.InteropServices; //For Sound [DllImport("Kernel32.dll")] public static extern bool Beep(int freq, int duration); Beep(1000,500); System.Web System.Web.Mail //For Mail using System.Web; using System.Web.Mail; // Construct a new mail message and fill it // with information from the form MailMessage msgMail = new MailMessage(); msgMail.From = txtFrom.Text; //From Textbox msgMail.To = txtTo.Text; //To Textbox msgMail.Cc = txtCC.Text; //CC Textbox msgMail.Bcc = txtBCC.Text; //BCC Textbox msgMail.Subject = txtSubject.Text; //Subject Textbox msgMail.Body = txtMessage.Text; //Message Textbox // if an attachment file is indicated, create it and add it to the message if (txtAttachment.Text.Length > 0) msgMail.Attachments.Add(new MailAttachment( txtAttachment.Text, MailEncoding.Base64)); // Now send the message SmtpMail.Send(msgMail); // Indicate that the message has been sent string strSentMail=""; strSentMail = "Message Sent to " + txtTo.Text; if(txtCC.Text!="") strSentMail+= " Carbon Copy Sent to " + txtCC.Text; if(txtBCC.Text!="") strSentMail+= " Blind Carbon Copy Sent to " + txtBCC.Text; MessageBox.Show(strSentMail); System.Diagnostics //For Command Line " + txtCmd.Text.Trim(); //txtCmd is the text box where we enter the commands System.Diagnostics.Process.Start("CMD.exe",strCmdLine); process1.Close(); The only nutty thing that I did was to have the mailing program and the command line executor added into the timer. So when the predetermined time was over you could send mail and execute commands. And you could execute the commands for any number of times depending on the number you inputted in the textbox with instances. (These options do work independent of the timer also.) Its so easy to make a simple application really "un-simple??". Let me end with this quote - "If confusion is the first step to knowledge, I must be a
http://www.codeproject.com/Articles/7172/AlarmTimer
CC-MAIN-2014-15
refinedweb
514
59.09
In this post, we will implement the functionality to call an Apex method from Process to send an Email from Apex. We can use Email Alert with Process to send an Email with only Configuration but there are some restrictions with Email Alerts like: - If we use Email Alert to send an Email, we have to create and manage Email Alert for every Email Template that we create. In this post, we wil create a Dynamic Apex Class that will send emails based on the parameters sent by Process. In this way, we can have multiple Processes based on Business requirement that will call the same Apex Class. Single Apex class will take care of sending all the Emails. Let’s get into the implementation. Implementation In this implementation, we will create an Email Template. Once the Contact record is created, we will call the Apex method from Process that will send an Email. First, create a Custom Email Template. - Type Email Template in Quick Find box and click on Classical Email Templates. - Select the Type of Email Template and click Next. - Enter the required fields and click Next. - Enter the Subject and Html Body for your Email Template and click Next. - Keep the Text Body as blank and click Save. Below is the preview of Welcome Email Template created. Welcome Email Subject: Welcome to Niks Developer Blog Hi {!Account.Name}, <br/><br/> Welcome to the Niks Developer Blog. I hope you learnt something today. <br/><br/> Thanks, <br/> Niks Developer Send Email from Apex Next step is to create a Dynamic Apex Class. To call a Apex method from Process, we have to declare a method as Invocable by adding @InvocableMethod annotation. We can only pass the one parameter to this method. The type of parameter must be List of either Primitive, SObjets or user defined type. The Class should be either Public or Global. Please check this link to know more about Invocable Method. First, we have to create a Wrapper class EmailWrapper to send the parameters from the Process. The variables in the wrapper must be annotated with @InvocableVariable annotation. public class EmailWrapper { @InvocableVariable public String strEmailTemplate; @InvocableVariable public String strRecipientId; @InvocableVariable public String strRecipientEmail; } Then, Create Apex class EmailController and add sendWelcomeEmail Invocable Method which accepts the list of EmailWrapper. - Create an instance of Messaging.SingleEmailMessage and use setToAddresses() to set To Address. - Use setTemplateId() method to set Template Id that can be queried by using the strEmailTemplate passed from Process. - Use setTargetObjectId() method to provide the Contact Id that will be used to provide the values for Merge Fields. For Example, Hi {!Contact.Name} in the Email Templaet will be replaced by Hi Nikhil Palekar if the Name of Contact provided is Nikhil Palekar. - Use setTreatTargetObjectAsRecipient(false) with false parameter as we are not using Target Object i.e, Contact as a Recipient. We can set it as true if we want to send the Email to Email field of the Contact provided. We are keeping it false becasue we want to pass the To address from Process to make it more dynamic. - You can also use setOrgWideEmailAddressId(emailAddressId) to set the From Address. - Use Messaging.sendEmail() to send the Email. Pass SingleEmailMessage instance we created earlier as a parameter to this method. public class EmailController { @InvocableMethod public static void sendWelcomeEmail(list<EmailWrapper> lstEmailWrapper){ Messaging.SingleEmailMessage objEmail = new Messaging.SingleEmailMessage(); // Set the Email of the Recipient. objEmail.setToAddresses(new list<String>{lstEmailWrapper[0].strRecipientEmail}); // Set the Template Id objEmail.setTemplateId([SELECT Name FROM EmailTemplate WHERE Name = :lstEmailWrapper[0].strEmailTemplate LIMIT 1].Id); // To set the context and ensures that merge fields in the template contain the correct data. objEmail.setTargetObjectId(lstEmailWrapper[0].strRecipientId); objEmail.setTreatTargetObjectAsRecipient(false); Messaging.SendEmailResult[] emailResult = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {objEmail}); if(!emailResult[0].isSuccess()){ System.debug('Error :' +emailResult[0].getErrors()); } else{ System.debug('Success'); } } } Call Apex Method from Process Finally, we have to create a Process. - Type Process Builder in Quick Find box and click on Process Builder. - Click on New. Enter Process Name. For The process starts when, select A record changes. - Then, click on Add Object and select Contact. For Start the Process, select only when a record is created and click Save. - Click on Add Criteria, and enter Criteria Name. Enter the Criteria to check if Email of the Contact is not Null. Add the Immediate Action for this Criteria. - Click on Add Action and select Apex as Action Type. - Enter the Action Name and Select EmailController as Apex Class. - Click on Add Row. Select strRecipientId Field and pass Id of the Contact. For strRecipientEmail, pass Email of the Contact. For strEmailTemplate, pass name of the Email Template we created earlier. - Click on Save and Activate the Process. Call Apex Method from Process to Send an Email This is pretty much it. To test this, Create a Contact and provide an Email address. A Welcome Email will be sent to the Email address provided. You can create multiple Processes based on the requirement to send Emails. You just need to pass the To Address, Email Template Name and Id of the Target Object to fill the Merge fields. This is how we can Call Apex Method from Process to Send an Email. If you want to check more such implementaions by Configuration, you can check it here. If you don’t want to miss new implementations, please Subscribe here. 2 thoughts on “Call Apex Method from Process to Send an Email” Hi Nikhil Can you clarify the below statement We can use Email Alert with Process to send an Email with only Configuration but there are some restrictions with Email Alerts like Do you meant to say send email alert with WORKFLOW RULES as I think we cannot send alerts using process builder. is the above code holds good for bulk contacts insert through Data Import Wizard. Say it has 100 contacts is it going to run 100 instances of process builder which in turn will run Apex. If my understanding is correct, then is it really needed to pass list of EmailWrapper? 1. We can use Email Alerts as Immediate Action in Process using Process Builder as well. 2. For Bulk operations, Process Builder is already optimized and bulkified. It’s better to keep batch size low in case of bulk creation to avoid any governor limits. 3. Invocable Method only accepts list of records as its “only” parameter.
https://niksdeveloper.com/salesforce/call-apex-method-from-process-to-send-an-email/
CC-MAIN-2022-27
refinedweb
1,073
67.35
Second part First part can be found here: Click me Hi all, I have been practising with the gg function that you guys help me create -- see part one. Now, I realized that the output of the function are not unique series, yet a sum: for instance, a series of 3 positives in a row is also shown as 2 series of two positives in a row and as 3 single positives. Let's say I got this: df = pd.DataFrame(np.random.rand(15, 2), columns=["open", "close"]) df['test'] = df.close-df.open > 0 open close test 0 0.769829 0.261478 False 1 0.770246 0.128516 False 2 0.266448 0.346099 True 3 0.302941 0.065790 False 4 0.747712 0.730082 False 5 0.382923 0.751792 True 6 0.028505 0.083543 True 7 0.137558 0.243148 True 8 0.456349 0.649780 True 9 0.041046 0.163488 True 10 0.291495 0.617486 True 11 0.046561 0.038747 False 12 0.782994 0.150166 False 13 0.435168 0.080925 False 14 0.679253 0.478050 False df.test Out[113]: 0 False 1 False 2 True 3 False 4 False 5 True 6 True 7 True 8 True 9 True 10 True 11 False 12 False 13 False 14 False 1: 1 2: 0 3: 0 4: 0 5: 0 6: 1 7: 0 8: 0 (green.rolling(x).sum()>x-1).sum() #gives me how many times there is a series of x True in a row; yet, this is not unique as explained beforehand What you are looking for are the groupby function from itertools and Counter from collections. Here is how to achieve what you want : import pandas as pd import numpy as np df = pd.DataFrame(np.random.rand(15, 2), columns=["open", "close"]) df['test'] = df.close-df.open > 0 from itertools import groupby from collections import Counter #we group each sequence of True and False seq_len=[(k,len(list(g))) for k, g in groupby(list(df['test']))] #we filter to keep only True sequence lenght true_seq_len= [n for k,n in seq if k == True] #we count each length true_seq_count = Counter(true_seq_len) Output : >>> print(df['test']) 0 True 1 True 2 False 3 True 4 True 5 False 6 True 7 False 8 True 9 True 10 True 11 True 12 False 13 False 14 True >>>print(seq_len) [(True, 2), (False, 1), (True, 2), (False, 1), (True, 1), (False, 1), (True, 4), (False, 2), (True, 1)] >>>print(true_seq_count) Counter({1: 2, 2: 2, 4: 1})
https://codedump.io/share/27NHg4fNCJS7/1/part-ii-counting-how-many-times-in-a-row-the-result-of-a-sum-is-positive-or-negative
CC-MAIN-2017-34
refinedweb
435
90.6
The key to ISA's HTTP filtering functionality revolves around the Web Server Publishing Rule. What this type of rule does is enable an ISA Server to "pretend" to be the web server itself, while secretly passing the packets back to the server via a separate process. This has the added advantage of securing the traffic by not exposing the web servers to direct attack and by forcing them to first overcome the ISA server before they can overcome the web server. NOTE Unlike the other types of server publishing rules, ISA does not need to be installed as a multi-homed (multiple NICs) server to take advantage of web publishing rules. Instead, ISA allows for the creation of web-based publishing rules when it is set up as a uni-homed server, sometimes set up in the DMZ of an existing packet filter firewall. In fact, this setup is a very common deployment model for ISA because there is a strong demand for systems to provide this type of secured reverse proxy capabilities. For more information on this deployment model, see Chapter 7, "Deploying ISA Server as a Reverse Proxy in an Existing Firewall DMZ." All the HTTP-based filtering and functionality is stored within the web publishing rule options, and it is therefore critical to become intimately aware of its capabilities. To secure a web server through ISA Server 2004, a basic web server publishing rule must be set up and configured. When this rule is created, it can be modified as necessary to provide for additional filter capabilities and other options. To create a simple rule, follow the instructions outlined in the following steps. These instructions apply to a specific scenario, where a company's public web server, using simple HTTP, is published through ISA. 1. From the ISA Server Management Console, click on the Firewall Policy node in the console tree. 2. From the Tasks tab in the Tasks pane, click the link titled Publish a Web Server. 3. Enter a descriptive name for the rule and click Next to continue. 4. Under Action to Take, select Allow and click Next to continue. 5. Under Computer Name or IP Address, enter the Fully Qualified Domain Name (FQDN) or IP address of the server, using an IP address or name that ISA can use to contact it. It is important to note that the ISA server must be able to address the web server directly via the name or IP address entered, which almost always resolves to a separate IP address than the one that is publicly addressable. In certain cases, it may be necessary to "fool" ISA into resolving a Fully Qualified Domain Name into an internal IP address with a hosts file, so as to preserve the host header information for the connection from end to end. This is particularly the case with SSL-encrypted websites, which fail if the host header is not exactly the same. 6. Under Path, enter /*, as shown in Figure 14.1, so that the entire site will be published, and click Next to continue. 7. Under Public Name Details, choose to accept requests for This Domain Name, and type it into the Public Name field (for example,). Leave the Path as /* and click Next to continue. 8. Under Select Web Listener, click the New button to create a Listener for the website traffic. 9. Enter a name for the Listener, such as HTTP-WWW-Listener 10. Select to listen for requests from the external network by checking the box next to it and clicking Next. 11. Check the Enable HTTP box, set the HTTP port to 80 (as shown in Figure 14.2), and click Next to continue. 12. Click Finish to finish creating the Web Listener. 13. From the next dialog box, review the Listener properties, and click Next to continue. 14. Under User Sets, accept the default of All Users and click Next to continue. 15. Click Finish to create the rule. It is important to note that after the server publishing rule is in place, all HTTP requests sent to the website should point to the IP address of the HTTP Listener on the ISA server itself. This includes publicly accessible websites, which must register the DNS namespace with an IP address on the external interface of the ISA Server. After it is created, the rule itself should be viewed and the administrator should become aware of the different settings and options available for HTTP filtering, as described in the following sections. Double-clicking on the web publishing rule that was created brings up the Properties dialog box, which allows for the configuration of the HTTP filtering settings. The first tab displayed is the General tab, as shown in Figure 14.3. The General tab enables the rule to be enabled or disabled with the check box, as well as for the name to be changed and a description added, if necessary. Under the Action tab of the web publishing rule, the rule can be set up to either allow or deny traffic. For web publishing rules, this is always set to Allow; there is no reason to create a web publishing rule just to deny access to a web server. In addition, a check box exists on this tab to allow specific log requests to be generated that match the rule. The From tab of a web publishing rule enables an administrator to limit the scope of locations from which the traffic will be allowed to come. For example, a rule could be limited to only those users on a particular subnet, or only a specified list of servers. The Add button can be used to apply specific limitations for the rule. In addition to specifying where the traffic can originate, this tab also enables specific exceptions to be made. For example, if an entire subnet is restricted, specific exceptions can be made. The To tab of a web publishing rule, as shown in Figure 14.4, enables input of information about the particular server that is being published. This includes the FQDN of the server itself, as well as the option to forward the original host header, if necessary. It may be advantageous to forward the original host header (which takes the form of the FQDN) in cases where specific websites are being restricted by host headers or when a web-based application is expecting host header traffic. Another very important option is displayed on this tab: the option determining whether the web traffic sees the traffic as originating on the original client or on the ISA Server computer itself. The option to make the traffic appear to come from the original client can help with auditing the traffic and making sure that user access is properly documented. Changing to make all requests come from ISA makes the web server think that the traffic originates from ISA instead. This option is typically more inclusive, and works in multiple scenarios. CAUTION If the ISA Server is deployed in uni-homed NIC mode in a firewall's DMZ, the only option that will work properly is to have the requests appear to come from the ISA Server console. Most firewalls do not allow the ISA server to mimic the packets from an untrusted network, and block the traffic itself. The Traffic tab looks relatively innocuous, but is actually a launching point to the advanced HTTP filtering options. The basic tab itself shows to what type of traffic the rule applies (HTTP or HTTPS) and provides for the option to inform users to use HTTPS if it is enforced. When using SSL, it also gives the option to require the stronger 128-bit encryption to the traffic, a recommended move in most cases. To filter the HTTP traffic, click on the Filtering tab and choose Configure HTTP, which allows for the following HTTP filtering options: Maximum Header Length Request Payload Length Maximum ULR Length Maximum Query Length Verify Normalization Block High Bit Characters Block Responses Containing Windows Executable Content In addition to these options, the filter definitions also enable specific HTTP methods (such as GET and POST) to be allowed in the particular rule. If specific HTTP methods are restricted, a web server can be made even more secure because many of the exploits take advantage of little-used HTTP methods to gain control of a system. To restrict by a specific HTTP method, take the following steps while in the Methods tab: Under specific the action taken for HTTP methods, use the drop-down box to specify to Allow Only Specific Methods. Click the Add button. Enter a name for the HTTP method that will be allowed. For example, enter GET (the method is case-sensitive) and click OK. From the dialog box shown in Figure 14.5, click OK to save the changes. The Extensions tab of the Filtering Rules setting allows only specific types of message attachments to be displayed, such as .mpg files, .exe files, or any other ones defined in this rule. It also allows for the reverse, where all attachments except for specific defined ones are. To accomplish this, choose the option Block Specified Extensions (Allow All Others). For additional security, the box on this page can be checked to block ambiguous or ill-defined extensions, which can pose a security risk to an ISA Server. Specific HTTP headers can be blocked on the Headers tab of the filtering options. This allows for HTTP Request headers or Response headers to be blocked, which can be useful in denying certain types of HTTP headers, such as User-Agent or Server, that define what type of HTTP traffic is being used. The Signature Restriction tab is one of the most important. It is "ground zero" for filtering of HTTP traffic to scan for specific exploits and viruses, such as the signature that is defined to block the Kazaa file-sharing application, shown in Figure 14.6. This dialog box is where the majority of the custom filters can be created and applied. Because so many applications and exploits use the HTTP port to tunnel their traffic, it is extremely useful to configure these settings to block malware, scumware, and any other applications that are not approved by the organization. This allows for blocking of signatures from such applications as Instant Messaging, Gnutella, Kazaa, Morpheus, and many more. For a list of signatures that can be blocked, see the following Microsoft URL: The Listener tab of the web publishing tool, shown in Figure 14.7, allows for the customization and creation of various web listeners. A Listener is an ISA construct that "listens" for requests made to a specific IP port combination. As soon as the Listener receives the traffic, it then processes that traffic back into ISA. Listeners are required for web server publishing rules, and are what enable the ISA server to act as a web server to the requesting client. The existing Listener that was created in the Publishing Rule Wizard can be directly modified if the rule is selected from the drop-down box and the Properties button is clicked. This allows for various settings to be applied, such as the following: Rule name and description Which IP address(es) the Listener will listen to Whether SSL or HTTP or both are enabled What type(s) of authentication methods are available, such as Basic, Integrated, and OWA forms-based authentication Whether RADIUS servers are needed Number of connections allowed and connection timeout RSA SecureID settings as necessary The most important thing to remember about Listeners in ISA Server 2004 is that you can have only a single Listener on each IP:Port combination. In cases where additional IP addresses are not a problem, this is a relatively small issue. The Public Name tab on the web server publishing rule, shown in Figure 14.8, enables an administrator to dictate that the traffic to the ISA Server travels with a specific public name. For example, it could be stipulated that access to a website such as is granted only to requests made to that website, rather than requests to an internal server such as \\server20. If a user tries to access that site from an IP address, that request fails because the web publishing rule is allowing only traffic sent to the website in this case. In the Paths tab, specific external paths can be mapped to different locations on a web server. For example, it may be helpful to send requests sent to to automatically. The Paths tab offers this type of functionality. To add a path to accomplish what this model illustrates, for example, do the following: On the Paths tab of the web publishing rule, click the Add button. Under Path Mapping, enter /public/*. Under External Path, select The Following Folder and enter /*, as shown in Figure 14.9. Click OK, Apply, and OK to save the changes. The Bridging tab of an ISA web publishing rule, shown in Figure 14.10, gives an administrator the flexibility to send HTTP and/or SSL traffic to different ports on a web server. This concept can help to support those environments that have non-standard ports set up for their web environments. For example, an organization may have set up multiple web servers on an internal web server that has a single IP address. Rather than assign multiple IP addresses to that server, the administrators chose to set up different ports for each virtual server and each website. So, internally, users would have to point to and, and so on. The Bridging option in ISA Server 2004 enables end users to not have to enter in strange port combinations to access websites, and instead relies on the Bridging tab of the rule to direct port 80 traffic to the appropriate ports, such as port 8020 or any other defined port. The Users tab on a web publishing rule is useful only if the full firewall client is deployed throughout the organization; otherwise rules always are set to All Users. If the Firewall client is installed, however, per-userbased access control can be realized, enabling an administrator to monitor and adjust to traffic and security on a per-user basis. The Schedule tab of a web publishing rule, shown in Figure 14.11, does not require much explanation. Using this tab, an organization can decide at exactly what times the rule will be in effect. The Link Translation tab allows for a great deal of flexibility in searching for unique bits of contents and replacing those bits of content with something else. More information on this is included in the section of this chapter titled "Securing Access to SharePoint 2003 Sites with ISA 2004."
https://flylib.com/books/en/4.128.1.134/1/
CC-MAIN-2020-34
refinedweb
2,463
58.21
Use this procedure to mirror the root (/) file system. Become superuser on the node. Place the root slice in a single-slice (one-way) concatenation. Specify the physical disk name of the root-disk slice (cNtXdY sZ). Create a second concatenation. Create a one-way mirror with one submirror. If the device is a local device to be used to mount a global-devices file system, /global/.devices/node@nodeid, the metadevice or volume name for the mirror must be unique throughout the cluster. Run the metaroot(1M) command. This command edits the /etc/vfstab and /etc/system files so the system can be booted with the root (/) file system on a metadevice or volume. Run the lockfs(1M) command. This command flushes all transactions out of the log and writes the transactions to the master file system on all mounted UFS file systems. Move any resource groups or device groups from the node. Moves all resource groups and device groups Specifies the name of the node from which to move resource or device groups Reboot the node. This command remounts the newly mirrored root (/) file system. Use the metattach(1M) command to attach the second submirror to the mirror. If the disk that is used to mirror the root disk is physically connected to more than one node (multihosted), enable the localonly property. Perform the following steps to enable the localonly property of the raw-disk device group for the disk that is used to mirror the root disk. You must enable the localonly property to prevent unintentional fencing of a node from its boot device if the boot device is connected to multiple nodes. If necessary, use the scdidadm Use the scconf(1M) command to. Record the alternate boot path for possible future use. If the primary boot device fails, you can then boot from this alternate boot device. See Chapter 7, Troubleshooting the System, in Solstice DiskSuite 4.2.1 User’s Guide, Special Considerations for Mirroring root (/) in Solaris Volume Manager Administration Guide, or Creating a RAID-1 Volume in Solaris Volume Manager Administration Guide for more information about alternate boot devices. Repeat Step 1 through Step 11 on each remaining node of the cluster. Ensure that each metadevice or. To mirror the global namespace, /global/.devices/node@nodeid, go to How to Mirror the Global.
http://docs.oracle.com/cd/E19528-01/819-0420/babbfbaf/index.html
CC-MAIN-2015-48
refinedweb
390
66.64
A few important things have happened in the Firefox world since my article "XML). The most basic thing you can do with Firefox and XML is to load an XML file in an unknown vocabulary with no associated stylesheet. Listing 1 is such a file. Listing 1 (listing1.xml). Simple XML file example Viewing this file with Firefox yields the display in Figure 1. Figure 1. View Listing 1 in Firefox Pay close attention to the message at the top of the browser area. In particular "The document tree is shown below." This underscores that you should not consider this a source view of the XML. It is simply a logical layout of the parts of the document Firefox cares about. It does omit details that might matter to you, though not to Firefox, and it does introduce some distortion of the document. For an example of distortion, notice that Firefox puts each element on a new line, even though it is not so in the source document. For a document such as this one, which uses mixed content, this is a significant rearrangement of the content. As an example of Firefox's omitting details, try to view Listing 2 in the browser. Listing 2 (listing2.xml). Simple XML file example with namespaces and more The display of Listing 2 is precisely the same as that of Listing 1, so the XML declaration, document type declaration and namespace declarations are all omitted from the display. If you do want to see the original XML in all its glory, use the view-source function. From the menu bar, select View, then Page Source. The usual shortcut is Ctrl+U. You can also use the context menu (right click) from the main browser pane. The view-source display is shown in Figure 2, a perfect match to the source listing. Figure 2. View-source display of Listing 2 in Firefox Go back to the display in Figure 1 and notice the minus sign next to the memo element's opening tag. Each container element has such a marker, and you can click on it to collapse or fold that element. This can be useful when debugging, if you want to pack away parts of the XML file that do not interest you at the moment. To demonstrate Firefox's treatment of ill-formed documents I added a bogus character entity (some characters are illegal in XML, even if expressed as entities) just before the date element of Listing 2 and viewed it in Firefox. Figure 3 shows the Firefox output, reporting the error and the location at which it was detected. Figure 3. Firefox display of ill-formed XML. Notice how just enough of the source file is displayed to pin-point the error. You can always see the full source document again using the view-source feature. XML is just a base format with which you can build more specific formats, and Firefox uses special processing and rendering for prominent XML formats it happens to support. I touched on some of these in the previous article, including XHTML, Scalable Vector Graphics (SVG), and XSLT. The primary means. For files opened from your local file system, the browser guesses the MIME type based on the file's extension. Table 1 summarizes the XML-related MIME types that are recognized by a clean Firefox install. Table 1. XML MIME types handled by Firefox Some Firefox extensions allow Firefox to recognize additional media types. You can also add an application handler for some XML format. For example, if you want to handle VoiceXML with a voice browser, you register that application with the MIME type application/voicexml+xml. You can always check the MIME type that Firefox associates with a page once it loads the page. Right click on the page, and select View page info from the context menu. Firefox uses text/xml for files with a .xml extension, although according to current best practice it should use application/xml. A series of unfortunate limitations Firefox does not support a few XML facilities you might use. When you design pages with Firefox in mind, you want to know its limitations in basic XML processing. Many of these limitations are acknowledged in bug reports and enhancement requests ("bugzilla"). You'll find links to many of these in Resources. You can vote for a bug or enhancement request to be given higher priority by Mozilla developers, so if these limitations affect you, please consider getting a Mozilla bug tracker account (very simple to obtain) and vote for resolution. The first limitation to mention is that whenever Firefox parses an XML file, it pretty much hangs up that thread of processing until the parse is complete. This means that if you send Firefox a very large XML file, your users might have a long wait before they see anything happen. If you send Firefox a large HTML file, it uses incremental rendering to display the HTML bit by bit as it reads it. It would be nice to have the equivalent capability for XML, but for now, just consider the size of XML files that you send the browser. Firefox does not support DTD validation. It doesn't read DTDs in external files, but it also doesn't use any declarations within the document (called the internal subset) for validation. As far as reading external files, Firefox does not read any external entities at all, whether parameter entities (such as DTDs and DTD fragments) or general entities (external, well-formed XML fragments). This means that Listing 3 is logically processed by Firefox the same way as Listing 4 regardless of the contents of extFile.ent. Listing 3. XML file that uses an external parsed entity Listing 4. XML without entities that is logically treated by Firefox identically to Listing 3 Support of such external entities does have possible security implications, and possible performance implications, but both have workarounds, and I hope Firefox addresses these limitations soon. If you happen to use RDF/XML, be aware that Firefox does not employ well-formedness checks when parsing RDF. As a consequence, the fact that Firefox processes RSS 1.0 Web feeds (which are RDF) without regard to well-formedness, which is unfortunate because the Web community is trying to increase the enforcement of well-formed Web feeds. The easiest way to get Firefox to render arbitrary XML in a non-generic way is to use a stylesheet. Firefox supports cascading stylesheets and XSLT. I won't dwell too much on the use of these technologies in Firefox because IBM developerWorks already offers a set of in-depth tutorials on the topic. See Resources for more details. One thing I shall mention here is that you must ensure that any stylesheets are loaded from the same Internet domain as the source XML document, otherwise Firefox will not load and apply the stylesheets. This security restriction is to avoid cross-site scripting attacks (XSS). For Firefox-specific XSLT Even in an established standard such as XSLT, precise behavior can differ across engines. If you need to specify a section of XSLT to execute only under Mozilla and thus Firefox, or indeed under any form of Transformiix, which is the XSLT engine bundled with Mozilla, use a conditional block such as in Listing 5. Listing 5. Example of a Mozilla-specfic code block in XSLT Each XSLT engine will have a different value for system-property, and if necessary you can use xsl:choose instead to provide sections specific to each one. As you can see, Firefox has a lot of capabilities. You can view XML in a simplified logical view or in original source form. You are notified of any well-formedness errors. You can tailor the display using CSS or XSLT. Firefox recognizes several important XML vocabularies based on MIME type, and handles them accordingly. Firefox does have some limitations when you process XML with it. All the major browsers could use some work in their XML support, and so understanding such abilities and limitations is important. As XML-based technologies such as Web feeds, SVG and XSLT become more important, one can expect better XML support in browsers. Meanwhile you can do a lot with XML in Firefox today. Look for future articles in this series on IBM developerWorks to learn more. So to summarize, the internal subset of a DTD is checked for internal general entities, which are correctly processed. All other non-character entity types are ignored, and no validation is performed, even for declarations within the internal subset. Learn - "XML in Firefox 1.5, Part 1: Overview of XML features:" Review the first article in this series and look at the different XML-related facilities in Firefox (September 2005, developerWorks). - A survey of XML standards: Part 4: In this detailed cross-reference of the most important XML standards by Uche Ogbuji, explore many of the XML technologies mentioned in this article (developerWorks, March 2004). - Get the basics of CSS and CSS with XML in the "Display XML with Cascading Stylesheets" tutorial series on developerWorks: - "Use Cascading Stylesheets to display XML, Part 1" features basic techniques to present XML in Web browsers (November 2004) - "Use Cascading Stylesheets to display XML, Part 2" covers advanced topics for the use of CSS to style XML in browsers (February 2005) - "Use Cascading Stylesheets to display XML, Part 3" discusses how to apply XSLT to XML source, including XSLT techniques that work with CSS for HTML or XML output (June 2005) Several Mozilla bugs and feature requests relate to XML, which only underscores some of the limitations you'll find working with the software. - 18333: "XML Content Sink should be incremental". This request is very important, because it leads to unfriendly behavior of the browser when dealing with large XML documents. - 69799: "External entities are not included in XML document". This covers the fact that Mozilla ignores external entities. Presumably Mozilla should support at least entities served from the same Internet domain. - 22942: "Load external DTDs (entity/entities) (local and remote) if a pref is set". This request covers loading the external subset of the DTD independently of whether validation is actually performed. - 196355: "Implement validating XML parser (validate with DTDs)". This request covers validation with DTD, internal or external. - 98413: "Implement XML Catalogs" would allow more flexible management of external entities for performance, security, versioning or other reasons. - developerWorks XML zone: Find more XML resources here, including articles, tutorials, tips, and standards. - IBM Certified Solution Developer -- XML and related technologies: Learn how to get certified. Free developerWorks tutorials, IBM XML certification success, help you prepare for the exam. Get products and technologies - Firefox: Get the Mozilla-based Web browser that offers standards compliance, performance, security, and solid XML features. The current version is 1.5.0.1. >>IMAGE.
http://www.ibm.com/developerworks/xml/library/x-ffox2/index.html
crawl-002
refinedweb
1,809
53.21
Are you getting validation errors when you try to filter a DateTimeField by today’s date? It can be a huge pain, when, you can’t for the life of you get Django to filter correctly on today’s date. There is one, simple way of solving this problem. Once you understand how to do this, you’ll laugh at how easy it was to implement. Let’s say, for example, that you have a column in a model called post_date. class MyModel(models.Model): post_date = models.DateTimeField(auto_add_now=True) # ... additional fields ... How do you filter DateTimeField by today’s date? The problem is that you have is that you need today’s posts, but it’s tough because, you’re model is implemented as a DateTimeField. You need to match the actual date. In order to do that you need to match the year, month and day explicitly. from datetime import date today = date.today() today_filter = MyModel.filter(post_date__year=today.year, post_date__month=today.month, post_date__day=today.day) But that’s too much typing! You might think this is way to much to type every time you want want to filter records by date. Are there some things that you can do to make this easier? Sure! You can create a helper function. def filter_by_date(date): return MyModel.filter(post_date__year=date.year, post_date__month=date.month, post_date__day=date.day) Or, you can upgrade your instance of Django to 1.9 where there is a filter specifically for dates. from datetime import date MyModel.filter(post_date__date=date.today()) The choice is yours! But, now you know exactly what you need to do to filter by Help! My Models feel Bloated! Why you should write a custom Manager
https://chrisbartos.com/articles/how-to-filter-a-datetimefield-by-todays-date-in-django/
CC-MAIN-2018-13
refinedweb
285
61.02
Vertex buffer interface. More... #include <StelVertexBuffer.hpp> Vertex buffer interface. Each StelRenderer backend might have a different vertex buffer buffer implementation. StelVertexBuffer, created by the StelRenderer's createVertexBuffer() function wraps this backend. StelVertexBuffer supports basic operations such as adding, getting and modifying vertices. It can be locked to allow uploading the data to the GPU, and unlocked to modify the buffer. For drawing (by a StelRenderer), the vertex buffer must be locked. To access/modify vertices, it must be unlocked. A newly created vertex buffer is always unlocked. The vertex type is defined by the user. Some commonly used vertex types are in the file GenericVertexTypes.hpp. Example vertex type: Currently, vertices must be accessed individually through functions that might have considerable overhead (at least due to indirect call through the virtual function table). If vertex processing turns out to be too slow, the solution is not to allow direct access to data through the pointer, as that ties us to a particular implementation (array in memory) and might be completely unusable with e.g. VBO based backends. Rather, considerable speedup could be achieved by adding member functions to add, get and set ranges of vertices. E.g.: Note that end might be unnecessary in setVertexRange. This is still not the same speedup as direct access (due to copying in get/set), but should allow for considerably faster implementations than accessing vertices individually, without forcing backends to store vertices in a particular way. An alternative, possibly better (especially with C++11) option for modifying vertices would be to use a function pointer / function object to process each vertex. VertexBuffer is currently separated into frontend (StelVertexBuffer), which allows type-safe vertex buffer construction thanks to templates, and backend, which doesn't know the vertex type and works on raw data described by metadata generated by the VERTEX_ATTRIBUTES macro in the vertex type. This is because virtual methods can't be templated. There might be a workaround for this, but I'm not aware of any at the moment. Definition at line 171 of file StelVertexBuffer.hpp. Destroy the vertex buffer. StelVertexBuffer is deleted by the user, not StelRenderer. Definition at line 179 of file StelVertexBuffer.hpp. Add a new vertex to the end of the buffer. The buffer must not be locked. Definition at line 189 of file StelVertexBuffer.hpp. Clear the buffer, removing all vertices. The buffer must not be locked. The backend implementation might reuse previously allocated storage after clearing, so calling clear() might be more efficient than destroying a buffer and then constructing a new one. Definition at line 271 of file StelVertexBuffer.hpp. Return vertex at specified index in the buffer. The buffer must not be locked. Definition at line 203 of file StelVertexBuffer.hpp. Returns the number of vertices in the buffer. Definition at line 253 of file StelVertexBuffer.hpp. Lock the buffer. Must be called before drawing. Definition at line 233 of file StelVertexBuffer.hpp. Is this buffer locked? Definition at line 247 of file StelVertexBuffer.hpp. Return the type of graphics primitives drawn with this vertex buffer. Definition at line 259 of file StelVertexBuffer.hpp. Set vertex at specified index in the buffer. The buffer must not be locked. Definition at line 224 of file StelVertexBuffer.hpp. Unlock the buffer. This is needed to modify the buffer after drawing. Definition at line 240 of file StelVertexBuffer.hpp.
http://stellarium.org/doc/0.12.1/classStelVertexBuffer.html
CC-MAIN-2016-26
refinedweb
563
52.05
What will we cover in this tutorial Selection sort is one of the simplest sorting algorithms, which is a good algorithm to start with. While the algorithm is considered to be slow, it has the advantage of not using auxiliary space. Step 1: Understand the Selection Sort algorithm The goal of sorting is to take an unsorted array of integers and sort it. Example given below. [97, 29, 53, 92, 42, 36, 12, 57, 90, 76, 85, 81, 12, 61, 45, 3, 83, 34, 7, 48] to [3, 7, 12, 12, 29, 34, 36, 42, 45, 48, 53, 57, 61, 76, 81, 83, 85, 90, 92, 97] The algorithm is the most intuitive way of sorting a list. It works as follows. - Go through the list to be sorted and find the smallest element. - Switch the smallest element with the first position. If you started with the following list. [97, 29, 53, 92, 42, 36, 12, 57, 90, 76, 85, 81, 12, 61, 45, 3, 83, 34, 7, 48] You would now have this list. [3, 29, 53, 92, 42, 36, 12, 57, 90, 76, 85, 81, 12, 61, 45, 97, 83, 34, 7, 48] Notice, that now we have the smallest element in the front of the list, we know that the second smallest element must be somewhere in the list starting from the second position all the way to the end. Hence, you can repeat step the above 2 steps on the list excluding the first element. This will give you the following list. [3, 7, 53, 92, 42, 36, 12, 57, 90, 76, 85, 81, 12, 61, 45, 97, 83, 34, 29, 48] Now we have that the first two elements are sorted, while the rest of the list is not sorted. Hence, we can repeat the two steps again on the unsorted part of the list. If we continue this until the we reach the end of the list. This should give us a sorted list. Step 2: Implementation of Selection Sort A beautiful thing about Selection Sort is that it does not use any auxiliary memory. If you are new to sorting, then this can be a big advantage if sorting large data sets. The disadvantage of Selection Sort is the time complexity. We will come back to that later. The code of Selection Sort can be done in the following manner. def selection_sort(list_to_sort): for i in range(len(list_to_sort)): index_of_min_value = i for j in range(i + 1, len(list_to_sort)): if list_to_sort[j] < list_to_sort[index_of_min_value]: index_of_min_value = j list_to_sort[i], list_to_sort[index_of_min_value] = list_to_sort[index_of_min_value], list_to_sort[i] list_to_sort = [97, 29, 53, 92, 42, 36, 12, 57, 90, 76, 85, 81, 12, 61, 45, 3, 83, 34, 7, 48] selection_sort(list_to_sort) print(list_to_sort) This will produce the correct output. [3, 7, 12, 12, 29, 34, 36, 42, 45, 48, 53, 57, 61, 76, 81, 83, 85, 90, 92, 97] Step 3: The time complexity of Selection Sort algorithm Now this is the sad part of this simple algorithm. It does not perform good. A sorting algorithm is considered efficient if it runs in O(n log(n)), which Selection Sort does not. The simple time complexity analysis is as follows. Assume we have a list of n unsorted integers. Then the first iteration of the list will make n – 1 comparisons, the second iteration will make n – 2 comparisons, and so forth all the way down to 1 comparison. This is the sum of 1 to n – 1, which is found by this formula (n – 1)(n – 2)/2, which is O(n^2). Other than that the algorithm does n swapping of numbers. This is O(n). This combines the algorithm to O(n + n^2) = O(n^2). Next Step This should wake your appetite to understand how you can make more efficient sorting. Another good example of a simple sorting algorithm is the Insertion Sort algorithm. For more efficient algorithm you should check out the Merge Sort algorithm. If you want to be serious about sorting, check out my online course on the subject.
https://www.learnpythonwithrune.org/category/sorting/
CC-MAIN-2021-04
refinedweb
680
70.43
Custom ToolTip to heigh Custom ToolTip to heigh (Beta 2) I'm trying to customize a tooltip, but the tooltip gets to heigh. It looks like this. tipNotOk.PNG But should look like this tipOk.PNG TestCase: Code: public class ToolTipTest { public interface Renderer extends ToolTipConfig.ToolTipRenderer<String>, XTemplates { @Override @XTemplate("<div>TEST</div>") public SafeHtml renderToolTip(String data); } public void setup() { TextButton button = new TextButton("test"); ToolTipConfig ttc = new ToolTipConfig(); Renderer renderer = GWT.create(Renderer.class); ttc.setRenderer(renderer); ttc.setCloseable(true); button.setToolTipConfig(ttc); RootPanel.get().add(button); } } Thanks for the responce. The problem is my custom tip is more complex than the one in the testcase. It contains some nested divs. (I used <span> to produce the "correct" screenshot) The problme is also visible in the explorer demo for the custom toolip I got this working now. My workaround was to create a custom TipAppearence with my own template where the span is replaced by a div. I still think it's a bug that should be corrected. Thank you for reporting this bug. We will make it our priority to review this report.
http://www.sencha.com/forum/showthread.php?179145-Custom-ToolTip-to-heigh
CC-MAIN-2015-14
refinedweb
187
58.69
Odoo Help Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps: CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc. calculated field in form hello, trivial question came to me, but - shame on me - I was not able to provide simple answer; considering I have two fields in form: <group col="2"> <field name="x_po"/><newline/> <field name="x_sz"/><newline/> </group> is there a simple way to add third field, which will show sum of above? something like "x_po+x_sz"? regards Tomasz Make the third field as compute field in your script just compute the total of two fields and return the value if you need to display the total sum you just need to give sum="thirdfield" in your tree view @api.one def _get_total(self): try: self.thirdfield = self.first + self.second except: raise "here add your exceptions" thirdfield = fields.Float(compute='_get_total', string="") don't forget to close try Have an upvote hello, thank you for answers; I had hope it is to be done inside form view - but I guess code as above is to be added somewhere else, am I right? if yes - sorry for asking - where to insert code as above: --- @api.one def _get_total(self): try: self.thirdfield = self.first + self.second thirdfield = fields.Float(compute='_get_total', string="") --- regards Tomasz Hi Tomasz You need to add a calculated field that compute the calculation and if you wanna make it more dynamically you could add also an onchange for the source field for the sum to provide the result without the need of saving the form Read more about it in the docs About This Community Odoo Training Center Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
https://www.odoo.com/forum/help-1/question/calculated-field-in-form-110499
CC-MAIN-2018-17
refinedweb
304
66.98
BASIC runtime error Hi. I am not an expert Libre Office Base, but I am trying to do some basic macro, and for some reason I am getting an error every time I click on the only form I have saying that I have a BASIC runtime error. Despite that, the MACRO seems to be doing its job anyhow. I would appreciate if somebody could give me some advise here This is the exact error message - BASIC runtime error. An exception occurred Type: com.sun.star.container.NoSuchElementException Message: There is no element named 'Citacion'.. * A this is the code sub S_SelectFile oform = thiscomponent.drawpage.forms.MainForm.SubFormCitaciones ofpkSelectFile = oform.getbyname("FileSelection") sUrl = converttourl(ofpkSelectFile.Text) for i = len(sUrl) to 1 step -1 if mid(sUrl,i,1) = "/" then sFile = mid(sUrl, i+1, len(sUrl)) exit for endif next i rem oform.updatestring(3,sFile) oform.updatestring(5,sUrl) if oform.isnew then oform.insertrow else oform.updaterow endif end sub Sub S_insert_url_to_Button oform = thiscomponent.drawpage.forms.MainForm.getbyname("SubFormCitaciones") oButton = oform.PushButtonCitacion oButton.TargetUrl = oform.Columns.getbyname("Citacion").getstring end sub By the way. There is a fiels named "Citacion" on the table called "Citaciones" Regards Just from a quick glance at this, I think oform.Columnsis in the recordset, not the form control. It's the data in your datasource, not how it is displayed on the screen. And depending on other factors, a recorset might not exist, even when it's associated control does. Other that that I have no idea what the code is trying to do. A bunch of embedded comments to say what's going on are sorely lacking. Pls, add code comments and re-submit.
https://ask.libreoffice.org/en/question/83742/basic-runtime-error/?sort=latest
CC-MAIN-2019-51
refinedweb
284
52.46
CodePlexProject Hosting for Open Source Software Hello. I need to build remote script console for client-server program. How I can use classes in Microsoft.Scripting.Hosting.Shell.Remote and Microsoft.Scripting.Hosting.Shell namespaces to do that? I can't find documentation for this classes. Thanks. We don't have any documentation or samples for these APIs except for the comments that are in the source code. The APIs are not quite ready for consumption. That's the reason why they are not in Microsoft.Scripting.dll along with the rest of the Hosting API. You might also need to customize the functionality in ways that the APIs don't allow. I would recommend to copy the parts of the source code that you find useful to your application and change it as you need. Are you sure you want to delete this post? You will not be able to recover it later. Are you sure you want to delete this thread? You will not be able to recover it later.
http://dlr.codeplex.com/discussions/76505
CC-MAIN-2017-39
refinedweb
172
78.35
News MIX07: Inside Microsoft's radical vision for cross-platform Web development. The biggest bombshell dropped at the Las Vegas conference in late April was the news that Silverlight, Microsoft's new cross-platform browser plug-in for rich media and content, will include the Common Language Runtime (CLR) native to .NET. The capability will allow developers to program against Silverlight for both Windows and Mac environments -- though not Linux -- using any .NET-supported languages as well as tools like Visual Studio and Expression Studio. In other words, .NET-based apps can be piped through browsers almost everywhere. The newly announced capabilities, along with support for Microsoft's Language Integrated Query (LINQ) and cross-platform debugging capabilities, are featured in Silverlight 1.1, now in alpha release. But there was much more. Microsoft also eased up on the terms of use for its Windows Live hosted-service APIs and announced a new Dynamic Language Runtime that will sit atop the CLR with support for Python, JavaScript, Visual Basic and Ruby. To back up the dynamic language support, Microsoft showed off its work on projects code-named "Jasper" and "Astoria" to create new, agile databases and to make data easily accessible to Web apps with standard HTTP commands. Redmond has created a new back-end support system as well, through its Silverlight Streaming service, which will provide free hosting and delivery of media for Silverlight apps. Microsoft also gave a nod to the open source community -- where dynamic languages find some of their most avid adherents -- by announcing an implementation of Ruby for .NET, dubbed IronRuby. Like the previously released IronPython, the source code will be released to the open source community. It's uncertain whether this support will lure open source advocates into the .NET fold, however. (See "Open Source Community Skeptical About Silverlight.") Taken together, the flurry of MIX announcements represents a major push into the RIA space, where Microsoft faces a formidable and entrenched competitor in Adobe Systems Inc. "I think Microsoft doesn't move into an area until they can slaughter it," says .NET developer and blogger Robert McLaws. "This is the first step in a long-term plan." Ray Ozzie offered a suitably sweeping take on Microsoft's Web development strategy during his keynote. "Back in the '80s, at the dawn of the PC revolution, the explosion in PC demand was fueled by the ability to create documents, words, numbers, charts, presentations," Ozzie said. "We're delivering a complete family of tools and framework for the design, development and deployment of media-rich applications from Silverlight on the Web to the full .NET Framework in Windows, from Visual Studio for developers to Expression Studio for designers." Driving Adoption It's one thing to unveil new technologies and shower them with hype and another to get developers to actually use them. Part of Microsoft's plan to drive adoption is to bridge the gap between developers and designers with its Expression suite of design tools. According to Microsoft, projects designed in Expression or developed in Visual Studio can be easily passed back and forth between the two toolsets via the Extensible Application Markup Language (XAML). Despite a designer-heavy crowd at MIX07, which left some keynote revelations about new development technologies greeted by uncomprehending silence rather than applause, O'Kelly says breakout sessions were packed with .NET developers looking to wring value out of the new technologies. That value will be in Silverlight's more advanced capabilities, says Forrester Research Inc. analyst Jeffrey Hammond. "For enterprise and applications developers looking to do these rich Internet applications, they're looking to the 1.1 version [of Silverlight]," he says. "If you're not already a JavaScript expert, do you really want to take the time to learn all the AJAX it takes to do these RIAs?" MIX07 attendee Rick Garibay, a program manager with an ASP.NET shop in Phoenix, certainly doesn't. "As an enterprise developer, as an architect, the big news is really having a rich Internet application experience that's perhaps comparable to a smart client to the Windows form that's actually doable. I'm not wasting hundreds of man hours debugging JavaScript or AJAX." Hammond also expects the 1.1 release's support of ASP.NET, VisualBasic (VB) and C# to launch Silverlight into the enterprise and drive rapid adoption. Judging from the enterprise clients he works with, Hammond says, "I think enterprise IT is looking at this Silverlight and Apollo technology as the successor to the 4GL and Visual Basics of the world, which they used to build client-server apps in the '80s and '90s. There's a whole class of enterprise apps that have yet to migrate onto the Web because they require this kind of rich user interface." But corporate cultures may slow that move. Raj Kaimal, a systems analyst in Texas, says he's excited but has concerns about the browser plug-in for Silverlight. "Installing a plug-in is a question mark right now," he says. "We have to first convince IT that this is a great product developed by Microsoft, it's going through a software development lifecycle, etc." Familiarity with established ASP.NET and AJAX technology, which don't require a browser plug-in, could also slow Silverlight adoption, he suggests. Microsoft says any type of back-end Web system or technology can be used with Silverlight, but the company is clearly hoping developers will instead turn to Silverlight Streaming. The new media-hosting service will enable developers to stream into their Silverlight apps high-quality video and other media stored for free on Redmond's servers. Key Limitations The CLR included in Silverlight is a scaled-down version, meaning it won't be possible to mix and match existing .NET assemblies in Silverlight apps, says Keith Smith, group product manager for Silverlight. "Because we have a subset of the .NET Framework and a subset of the Windows Presentation Foundation [WPF], assemblies that are targeting one of the CLR versions won't work with the assemblies targeting another," he says. "The full WPF experience will be its own project type, its own assemblies, its own namespaces." Also, Silverlight contains only a subset of WPF's capabilities, omitting functionality such as hardware acceleration and access to active devices -- a move the company calls an intentional tradeoff of power for security. A third, more immediate shortcoming is a lack of tool support. Third-party vendor Telerik Inc. beat Microsoft to the punch by unveiling a set of Silverlight controls before Redmond. "What we're going to do is have an out-of-band release for the Silverlight capabilities as soon as Visual Studio 'Orcas' releases," says Smith. "You'll get Visual Studio Orcas and then you'll have the ability to download the Silverlight authoring capability." Brad Becker, group product manager for Expression Studio, suggests the precise shape of Microsoft's Silverlight tools strategy hasn't been nailed down: "I can't elaborate, since we're still perfecting what we're going to do." It's also unclear whether Microsoft will ever introduce support for Linux and related browsers like Opera. Smith provides only a party-line answer. "We're going to go with the demands that our customers are saying are hugely important to them," he says. All About Adobe The MIX07 news fuels Microsoft's competition with rival Adobe for mindshare among RIA developers. Microsoft is unquestionably late to the fight with Silverlight. But the company has a massive user base in place through its browser and operating systems that it can leverage to distribute and foster the new technology. Adobe's Flash technology, meanwhile, is already a ubiquitous part of the Web experience, enjoying penetration often estimated in the 90-plus percent range. O'Kelly says Microsoft should not underestimate Adobe. "[Adobe is] the incumbent in the space. [Microsoft has] nascent products going into a space where Adobe has been dominant for about a decade." Smith, the Silverlight product manager, downplays the idea that Microsoft is directly competing with Adobe, saying any implication Silverlight and the other new Microsoft tools are clones of Adobe's offerings is "categorically false." Smith says Microsoft is simply building on its previous history in Web and client development, citing ASP.NET, IIS and WPF. "One of the commonalities is the .NET Framework," he says. "We have millions of developers here today building business on the .NET Framework who are coming to us and saying, 'Hey, we want to start building solutions that work cross-platform.' That's what Silverlight is about." Delivering Data You can't have RIAs without robust support for data retrieval and manipulation. And here, too, Microsoft is promising to deliver. Microsoft held a MIX07 breakout session to highlight its work on the project code-named "Astoria," the company's experimental Web data services initiative. Microsoft bills Astoria as a way for application developers to access and publish data across the Web more easily and directly than via SOAP-based programming. Astoria allows programmers to pull data from a SQL server into their applications over the Internet or a corporate network using standard HTTP commands, the company says. RedMonk analyst Michael Cote says he expects Astoria eventually to become the RIA back-end to Silverlight. "Once you put Silverlight and Astoria together, you can see that Microsoft is building out a new development platform targeting a Web-minded way of development," Cote says, adding that rival Adobe is doing the same. Another new Microsoft data-access initiative also saw daylight at MIX07. Code-named project "Jasper," the effort aims to bring agile development to databases. Microsoft says Jasper allows developers to start interacting with data in a database before they've even created mapping files or defined classes. Despite its agility, Jasper, like Astoria, is built on top of the ADO.NET Entity Framework and therefore supports rich queries and complex mapping, according to the company. Printable Format > More TechLibrary I agree to this site's Privacy Policy. > More Webcasts
https://visualstudiomagazine.com/articles/2007/05/15/conquering-the-cloud.aspx
CC-MAIN-2018-13
refinedweb
1,675
54.63
In-Depth: Support Vector Machines Support vector machines (SVMs) are a particularly powerful and flexible class of supervised algorithms for both classification and regression. In this section, we will develop the intuition behind support vector machines and their use in classification problems. We begin with the standard imports: %matplotlib inline import numpy as np import matplotlib.pyplot as plt from scipy import stats # use seaborn plotting defaults import seaborn as sns; sns.set() As part of our disussion of Bayesian classification (see In Depth: Naive Bayes Classification), we learned a simple model describing the distribution of each underlying class, and used these generative models to probabilistically determine labels for new points. That was an example of generative classification; here we will consider instead discriminative classification: rather than modeling each class, we simply find a line or curve (in two dimensions) or manifold (in multiple dimensions) that divides the classes from each other. As an example of this, consider the simple case of a classification task, in which the two classes of points are well separated: from sklearn.datasets.samples_generator import make_blobs X, y = make_blobs(n_samples=50, centers=2, random_state=0, cluster_std=0.60) plt.scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='autumn'); A linear discriminative classifier would attempt to draw a straight line separating the two sets of data, and thereby create a model for classification. For two dimensional data like that shown here, this is a task we could do by hand. But immediately we see a problem: there is more than one possible dividing line that can perfectly discriminate between the two classes! We can draw them as follows: xfit = np.linspace(-1, 3.5) plt.scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='autumn') plt.plot([0.6], [2.1], 'x', color='red', markeredgewidth=2, markersize=10) for m, b in [(1, 0.65), (0.5, 1.6), (-0.2, 2.9)]: plt.plot(xfit, m * xfit + b, '-k') plt.xlim(-1, 3.5); These are three very different separators which, nevertheless, perfectly discriminate between these samples. Depending on which you choose, a new data point (e.g., the one marked by the "X" in this plot) will be assigned a different label! Evidently our simple intuition of "drawing a line between classes" is not enough, and we need to think a bit deeper. Support Vector Machines: Maximizing the Margin¶ Support vector machines offer one way to improve on this. The intuition is this: rather than simply drawing a zero-width line between the classes, we can draw around each line a margin of some width, up to the nearest point. Here is an example of how this might look: xfit = np.linspace(-1, 3.5) plt.scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='autumn')); In support vector machines, the line that maximizes this margin is the one we will choose as the optimal model. Support vector machines are an example of such a maximum margin estimator. Fitting a support vector machine¶ Let's see the result of an actual fit to this data: we will use Scikit-Learn's support vector classifier to train an SVM model on this data. For the time being, we will use a linear kernel and set the C parameter to a very large number (we'll discuss the meaning of these in more depth momentarily). from sklearn.svm import SVC # "Support vector classifier" model = SVC(kernel='linear', C=1E10) model.fit(X, y) SVC(C=10000000000.0, cache_size=200, class_weight=None, coef0=0.0, decision_function_shape=None, degree=3, gamma='auto', kernel='linear', max_iter=-1, probability=False, random_state=None, shrinking=True, tol=0.001, verbose=False) To better visualize what's happening here, let's create a quick convenience function that will plot SVM decision boundaries for us: def plot_svc_decision_function(model, ax=None, plot_support=True): """Plot the decision function for a 2D SVC""" if ax is None: ax = plt.gca() xlim = ax.get_xlim() ylim = ax.get_ylim() # create grid to evaluate model x = np.linspace(xlim[0], xlim[1], 30) y = np.linspace(ylim[0], ylim[1], 30) Y, X = np.meshgrid(y, x) xy = np.vstack([X.ravel(), Y.ravel()]).T P = model.decision_function(xy).reshape(X.shape) # plot decision boundary and margins ax.contour(X, Y, P, colors='k', levels=[-1, 0, 1], alpha=0.5, linestyles=['--', '-', '--']) # plot support vectors if plot_support: ax.scatter(model.support_vectors_[:, 0], model.support_vectors_[:, 1], s=300, linewidth=1, facecolors='none'); ax.set_xlim(xlim) ax.set_ylim(ylim) plt.scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='autumn') plot_svc_decision_function(model); This is the dividing line that maximizes the margin between the two sets of points. Notice that a few of the training points just touch the margin: they are indicated by the black circles in this figure. These points are the pivotal elements of this fit, and are known as the support vectors, and give the algorithm its name. In Scikit-Learn, the identity of these points are stored in the support_vectors_ attribute of the classifier: model.support_vectors_ array([[ 0.44359863, 3.11530945], [ 2.33812285, 3.43116792], [ 2.06156753, 1.96918596]]) A key to this classifier's success is that for the fit, only the position of the support vectors matter; any points further from the margin which are on the correct side do not modify the fit! Technically, this is because these points do not contribute to the loss function used to fit the model, so their position and number do not matter so long as they do not cross the margin. We can see this, for example, if we plot the model learned from the first 60 points and first 120 points of this dataset: def plot_svm(N=10, ax=None): X, y = make_blobs(n_samples=200, centers=2, random_state=0, cluster_std=0.60) X = X[:N] y = y[:N] model = SVC(kernel='linear', C=1E10) model.fit(X, y) ax = ax or plt.gca() ax.scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='autumn') ax.set_xlim(-1, 4) ax.set_ylim(-1, 6) plot_svc_decision_function(model, ax) fig, ax = plt.subplots(1, 2, figsize=(16, 6)) fig.subplots_adjust(left=0.0625, right=0.95, wspace=0.1) for axi, N in zip(ax, [60, 120]): plot_svm(N, axi) axi.set_title('N = {0}'.format(N)) In the left panel, we see the model and the support vectors for 60 training points. In the right panel, we have doubled the number of training points, but the model has not changed: the three support vectors from the left panel are still the support vectors from the right panel. This insensitivity to the exact behavior of distant points is one of the strengths of the SVM model. If you are running this notebook live, you can use IPython's interactive widgets to view this feature of the SVM model interactively: from ipywidgets import interact, fixed interact(plot_svm, N=[10, 200], ax=fixed(None)); Beyond linear boundaries: Kernel SVM¶ Where SVM becomes extremely powerful is when it is combined with kernels. We have seen a version of kernels before, in the basis function regressions of In Depth: Linear Regression. There we projected our data into higher-dimensional space defined by polynomials and Gaussian basis functions, and thereby were able to fit for nonlinear relationships with a linear classifier. In SVM models, we can use a version of the same idea. To motivate the need for kernels, let's look at some data that is not linearly separable: from sklearn.datasets.samples_generator import make_circles X, y = make_circles(100, factor=.1, noise=.1) clf = SVC(kernel='linear').fit(X, y) plt.scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='autumn') plot_svc_decision_function(clf, plot_support=False); It is clear that no linear discrimination will ever be able to separate this data. But we can draw a lesson from the basis function regressions in In Depth: Linear Regression, and think about how we might project the data into a higher dimension such that a linear separator would be sufficient. For example, one simple projection we could use would be to compute a radial basis function centered on the middle clump: r = np.exp(-(X ** 2).sum(1)) We can visualize this extra data dimension using a three-dimensional plot—if you are running this notebook live, you will be able to use the sliders to rotate the plot: from mpl_toolkits import mplot3d def plot_3D(elev=30, azim=30, X=X, y=y): ax = plt.subplot(projection='3d') ax.scatter3D(X[:, 0], X[:, 1], r, c=y, s=50, cmap='autumn') ax.view_init(elev=elev, azim=azim) ax.set_xlabel('x') ax.set_ylabel('y') ax.set_zlabel('r') interact(plot_3D, elev=[-90, 90], azip=(-180, 180), X=fixed(X), y=fixed(y)); We can see that with this additional dimension, the data becomes trivially linearly separable, by drawing a separating plane at, say, r=0.7. Here we had to choose and carefully tune our projection: if we had not centered our radial basis function in the right location, we would not have seen such clean, linearly separable results. In general, the need to make such a choice is a problem: we would like to somehow automatically find the best basis functions to use. One strategy to this end is to compute a basis function centered at every point in the dataset, and let the SVM algorithm sift through the results. This type of basis function transformation is known as a kernel transformation, as it is based on a similarity relationship (or kernel) between each pair of points. A potential problem with this strategy—projecting $N$ points into $N$ dimensions—is that it might become very computationally intensive as $N$ grows large. However, because of a neat little procedure known as the kernel trick, a fit on kernel-transformed data can be done implicitly—that is, without ever building the full $N$-dimensional representation of the kernel projection! This kernel trick is built into the SVM, and is one of the reasons the method is so powerful. In Scikit-Learn, we can apply kernelized SVM simply by changing our linear kernel to an RBF (radial basis function) kernel, using the kernel model hyperparameter: clf = SVC(kernel='rbf', C=1E6) clf.fit(X, y) SVC(C=1000000.0, cache_size=200, class_weight=None, coef0=0.0, decision_function_shape=None, degree=3, gamma='auto', kernel='rbf', max_iter=-1, probability=False, random_state=None, shrinking=True, tol=0.001, verbose=False) plt.scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='autumn') plot_svc_decision_function(clf) plt.scatter(clf.support_vectors_[:, 0], clf.support_vectors_[:, 1], s=300, lw=1, facecolors='none'); Using this kernelized support vector machine, we learn a suitable nonlinear decision boundary. This kernel transformation strategy is used often in machine learning to turn fast linear methods into fast nonlinear methods, especially for models in which the kernel trick can be used. X, y = make_blobs(n_samples=100, centers=2, random_state=0, cluster_std=1.2) plt.scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='autumn'); To handle this case, the SVM implementation has a bit of a fudge-factor which "softens" the margin: that is, it allows some of the points to creep into the margin if that allows a better fit. The hardness of the margin is controlled by a tuning parameter, most often known as $C$. For very large $C$, the margin is hard, and points cannot lie in it. For smaller $C$, the margin is softer, and can grow to encompass some points. The plot shown below gives a visual picture of how a changing $C$ parameter affects the final fit, via the softening of the margin: X, y = make_blobs(n_samples=100, centers=2, random_state=0, cluster_std=0.8) fig, ax = plt.subplots(1, 2, figsize=(16, 6)) fig.subplots_adjust(left=0.0625, right=0.95, wspace=0.1) for axi, C in zip(ax, [10.0, 0.1]): model = SVC(kernel='linear', C=C).fit(X, y) axi.scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='autumn') plot_svc_decision_function(model, axi) axi.scatter(model.support_vectors_[:, 0], model.support_vectors_[:, 1], s=300, lw=1, facecolors='none'); axi.set_title('C = {0:.1f}'.format(C), size=14) The optimal value of the $C$ parameter will depend on your dataset, and should be tuned using cross-validation or a similar procedure (refer back to Hyperparameters and Model Validation). Example: Face Recognition¶ As an example of support vector machines in action, let's take a look at the facial recognition problem. We will use the Labeled Faces in the Wild dataset, which consists of several thousand collated photos of various public figures. A fetcher for the dataset is built into plot a few of these faces to see what we're working with: fig, ax = plt.subplots(3, 5) for i, axi in enumerate(ax.flat): axi.imshow(faces.images[i], cmap='bone') axi.set(xticks=[], yticks=[], xlabel=faces.target_names[faces.target[i]]) Each image contains [62×47] or nearly 3,000 pixels. We could proceed by simply using each pixel value as a feature, but often it is more effective to use some sort of preprocessor to extract more meaningful features; here we will use a principal component analysis (see In Depth: Principal Component Analysis) to extract 150 fundamental components to feed into our support vector machine classifier. We can do this most straightforwardly by packaging the preprocessor and the classifier into a single pipeline: from sklearn.svm import SVC from sklearn.decomposition import RandomizedPCA from sklearn.pipeline import make_pipeline pca = RandomizedPCA(n_components=150, whiten=True, random_state=42) svc = SVC(kernel='rbf', class_weight='balanced') model = make_pipeline(pca, svc) For the sake of testing our classifier output, we will split the data into a training and testing set: from sklearn.cross_validation import train_test_split Xtrain, Xtest, ytrain, ytest = train_test_split(faces.data, faces.target, random_state=42) Finally, we can use a grid search cross-validation to explore combinations of parameters. Here we will adjust C (which controls the margin hardness) and gamma (which controls the size of the radial basis function kernel), and determine the best model: from sklearn.grid_search import GridSearchCV param_grid = {'svc__C': [1, 5, 10, 50], 'svc__gamma': [0.0001, 0.0005, 0.001, 0.005]} grid = GridSearchCV(model, param_grid) %time grid.fit(Xtrain, ytrain) print(grid.best_params_) CPU times: user 47.8 s, sys: 4.08 s, total: 51.8 s Wall time: 26 s {'svc__gamma': 0.001, 'svc__C': 10} The optimal values fall toward the middle of our grid; if they fell at the edges, we would want to expand the grid to make sure we have found the true optimum. Now with this cross-validated model, we can predict the labels for the test data, which the model has not yet seen: model = grid.best_estimator_ yfit = model.predict(Xtest) Let's take a look at a few of the test images along with their predicted values: fig, ax = plt.subplots(4, 6) for i, axi in enumerate(ax.flat): axi.imshow(Xtest[i].reshape(62, 47), cmap='bone') axi.set(xticks=[], yticks=[]) axi.set_ylabel(faces.target_names[yfit[i]].split()[-1], color='black' if yfit[i] == ytest[i] else 'red') fig.suptitle('Predicted Names; Incorrect Labels in Red', size=14);
https://jakevdp.github.io/PythonDataScienceHandbook/05.07-support-vector-machines.html
CC-MAIN-2019-18
refinedweb
2,531
55.95
BindingContext = new RegistrationPageViewModel(); public class PickDataClass { public string Name { get; set; } public string Address { get; set; } } public class RegistrationPageViewModel : INotifyPropertyChanged { List<string> countries = new List<string> { "Afghanistan", "Albania", "Algeria", "Andorra", "Angola" }; public List<string> Countries => countries; public event PropertyChangedEventHandler PropertyChanged; } picker list can not populated inside the listview .if i taking picker outside the listview then data has come .plz help me in this regards .Thanks in Advance. Answers @REJAH Please share code of picker where you bind this or something @REJAH Since you have static data in picker you can specfy it in Xaml itself Like this < Picker x: < Picker.ItemsSource > < x:Array < x:String>Afghanistan < x:String>Albania < x:String>Algeria < x:String>Andorra < x:String>Angola </ x:Array > </ Picker.ItemsSource > </ Picker > I have dynamic data binding from database here xaml code inside the listview. for dynamic binding write this code protected async override void OnAppearing() { ExpenseCatMaster this is model from where u have to bind your picker with items ExCategory is item to be displayed in listview can't access x:name of picker to code behind. @REJAH i didn't get you this code inside the listview. this code inside the listview. Could you please post a basic demo so that we can test with it ?
https://forums.xamarin.com/discussion/comment/368482/
CC-MAIN-2019-51
refinedweb
210
53.92
The function int fgetc(FILE *stream); gets the next character from the input stream from the current position(pointed by the internal file position indicator) and increment the current position indicator. The character is read as unsigned char and type casted to an integer before returning. Function prototype of fgetc int fgetc(FILE *stream); - stream : A pointer to a FILE object which identifies a stream. Return value of fgetc This function fgetc returns the character read(type casted to an int value) or EOF on end of file or error. C program using fgetc function The following program shows the use of fgetc function to read the content of a file. Let file "textFile.txt" contains "fgetc C Standard Library function" string. The content of this file will get printed by the following program. #include <stdio.h> int main(){ FILE *file; int c; file = fopen("textFile.txt", "r"); if(file == NULL){ perror("Error: Unable to open a file"); } else { /* Read characters from a file using fgetc */ while(!feof(file)){ c = fgetc(file); printf("%c", c); } fclose(file); } return(0); } Output fgetc C Standard Library function
https://www.techcrashcourse.com/2015/08/fgetc-stdio-c-library-function.html
CC-MAIN-2020-16
refinedweb
185
64.3
Assume you have the following sample json data stored in a file as pandas_sample.json { "employee": { "name": "emp1", "salary": 50000, "age": 31 } } The result for after converting to csv as, ,employee age,31 name,emp1 salary,50000 To solve this, we will follow the steps given below − Create pandas_sample.json file and store the JSON data. Read json data from the file and store it as data. data = pd.read_json('pandas_sample.json') Convert the data into dataframe df = pd.DataFrame(data) Apple df.to_csv function to convert the data as csv file format, df.to_csv('pandas_json.csv') Let’s see the below implementation to get a better understanding − import pandas as pd data = pd.read_json('pandas_sample.json') df = pd.DataFrame(data) df.to_csv('pandas_json.csv') employee age 31 name emp1 salary 50000
https://www.tutorialspoint.com/write-a-python-code-to-read-json-data-from-a-file-and-convert-it-to-dataframe-csv-files
CC-MAIN-2021-31
refinedweb
132
51.95
In this codelab, you'll learn to use CNNs to improve your image classification models. Prerequisites This codelab builds on work completed in two previous installments, Build a computer vision model, where we introduce some of the code that you'll use here, and the Build convolutions and perform pooling codelab, where we introduce convolutions and pooling. What you'll learn - How to improve computer vision and accuracy with convolutions What you'll build - Layers to enhance your neural network What you'll need You can find the code for the rest of the codelab running in Colab. You'll also need TensorFlow installed, and the libraries you installed in the previous codelab. You now know how to do fashion image recognition using a Deep Neural Network (DNN) containing three layers— the input layer (in the shape of the input data), the output layer (in the shape of the desired output) and a hidden layer. You experimented with several parameters that influence the final accuracy, such as different sizes of hidden layers and number of training epochs. For convenience, here's the entire code again. Run it and take a note of the test accuracy that is printed out at the end. import tensorflow as tf(128, activation='relu'), tf.keras.layers.Dense(10, activation='softmax') ]) model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy']) model.fit(training_images, training_labels, epochs=5) test_loss, test_accuracy = model.evaluate(test_images, test_labels) print ('Test loss: {}, Test accuracy: {}'.format(test_loss, test_accuracy*100)) Your accuracy is probably about 89% on training and 87% on validation. You can make that even better using convolutions, which narrows down the content of the image to focus on specific, distinct details. If you've ever done image processing using a filter, then convolutions will look very familiar. In short, you take an array (usually 3x3 or 5x5) and pass it over the image. By changing the underlying pixels based on the formula within that matrix, you can perform operations like edge detection. For example, typically a 3x3 is defined for edge detection where the middle cell is 8, and all of its neighbors are -1. In this case, for each pixel, you would multiply its value by 8, then subtract the value of each neighbor. Do this for every pixel, and you'll end up with a new image that has its edges enhanced. This is perfect for computer vision, because enhancing features like edges helps the computer distinguish one item from another. Better still, the amount of information needed is much less, because you'll train only on the highlighted features. That's the concept of Convolutional Neural Networks. Add some layers to do convolution before you have the dense layers, and then the information going to the dense layers becomes more focused and possibly more accurate. Run the following code. It's the same neural network as earlier, but this time with convolutional layers added first. It will take longer, but look at the impact on the accuracy: import tensorflow as tf print(tf.__version__)') ]) model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy']) model.summary() model.fit(training_images, training_labels, epochs=5) test_loss, test_accuracy = model.evaluate(test_images, test_labels) print ('Test loss: {}, Test accuracy: {}'.format(test_loss, test_accuracy*100)) It's likely gone up to about 93% on the training data and 91% on the validation data. Now try running it for more epochs—say about 20—and explore the results. While the training results might seem really good, the validation results may actually go down due to a phenomenon called overfitting. Overfitting occurs when the network learns the data from the training set too well, so it's specialised to recognize only that data, and as a result is less effective at seeing other data in more general situations. For example, if you trained only on heels, then the network might be very good at identifying heels, but sneakers might confuse it. Look at the code again, and see step-by-step how the convolutions were built. The first step is to gather the data. You'll notice that there's a change here and the training data needed to be reshaped. That's because the first convolution expects a single tensor containing everything, so instead of 60,000 28x28x1 items in a list, you have a single 4D list that is 60,000x28x28x1, and the same for the test images. If you don't do that, then you'll get an error when training because the convolutions do not recognize the shape. import tensorflow as tf Next, define your model. Instead of the input layer at the top, you're going to add a convolutional layer. The parameters are: - The number of convolutions you want to generate. A value like 32 is a good starting point. - The size of the convolutional matrix, in this case a 3x3 grid. - The activation function to use, in this case use relu. - In the first layer, the shape of the input data. You'll follow the convolution with a max pooling layer, which is designed to compress the image while maintaining the content of the features that were highlighted by the convolution. By specifying (2,2) for the max pooling, the effect is to reduce the size of the image by a factor of 4. It creates a 2x2 array of pixels and picks the largest pixel value, turning 4 pixels into 1. It repeats this computation across the image, and in so doing halves the number of horizontal pixels and halves the number of vertical pixels. You can call model.summary() to see the size and shape of the network. Notice that after every max pooling layer, the image size is reduced in the following way: _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= conv2d_2 (Conv2D) (None, 26, 26, 64) 640 _________________________________________________________________ max_pooling2d_2 (MaxPooling2 (None, 13, 13, 64) 0 _________________________________________________________________ conv2d_3 (Conv2D) (None, 11, 11, 64) 36928 _________________________________________________________________ max_pooling2d_3 (MaxPooling2 (None, 5, 5, 64) 0 _________________________________________________________________ flatten_2 (Flatten) (None, 1600) 0 _________________________________________________________________ dense_4 (Dense) (None, 128) 204928 _________________________________________________________________ dense_5 (Dense) (None, 10) 1290 ================================================================= Here's the full code for the CNN: model = tf.keras.models.Sequential([ tf.keras.layers.Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)), tf.keras.layers.MaxPooling2D(2, 2), #Add another convolution tf.keras.layers.Conv2D(64, (3,3), activation='relu'), tf.keras.layers.MaxPooling2D(2,2) #Now flatten the output. After this you'll just have the same DNN structure as the non convolutional version tf.keras.layers.Flatten(), #The same 128 dense layers, and 10 output layers as in the pre-convolution example: tf.keras.layers.Dense(128, activation='relu'), tf.keras.layers.Dense(10, activation='softmax') ]) Compile the model, call the fit method to do the training, and evaluate the loss and accuracy from the test set. model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy']) model.fit(training_images, training_labels, epochs=5) test_loss, test_acc = model.evaluate(test_images, test_labels) print (‘Test loss: {}, Test accuracy: {}'.format(test_loss, test_acc*100)) This code shows you the convolutions graphically. The print (test_labels[:100]) shows the first 100 labels in the test set, and you can see that the ones at index 0, index 23 and index 28 are all the same value (9). They're all shoes. Take a look at the result of running the convolution on each and you'll begin to see common features between them emerge. Now, when the DNN is training on that data, it's working with a lot less information, and it's perhaps finding a commonality between shoes based on that convolution and pooling combination. print(test_labels[:100]) [9 2 1 1 6 1 4 6 5 7 4 5 7 3 4 1 2 4 8 0 2 5 7 9 1 4 6 0 9 3 8 8 3 3 8 0 7 5 7 9 6 1 3 7 6 7 2 1 2 2 4 4 5 8 2 2 8 4 8 0 7 7 8 5 1 1 2 3 9 8 7 0 2 6 2 3 1 2 8 4 1 8 5 9 5 0 3 2 0 6 5 3 6 7 1 8 0 1 4 2] Now you can select some of the corresponding images for those labels and render what they look like going through the convolutions. So, in the following code, FIRST_IMAGE, SECOND_IMAGE and THIRD_IMAGE are all the indexes for value 9, an ankle boot. import matplotlib.pyplot as plt f, axarr = plt.subplots(3,4) FIRST_IMAGE=0 SECOND_IMAGE=23 THIRD_IMAGE=28 CONVOLUTION_NUMBER = 6) f2 = activation_model.predict(test_images[SECOND_IMAGE].reshape(1, 28, 28, 1))[x] axarr[1,x].imshow(f2[0, : , :, CONVOLUTION_NUMBER], cmap='inferno') axarr[1,x].grid(False) f3 = activation_model.predict(test_images[THIRD_IMAGE].reshape(1, 28, 28, 1))[x] axarr[2,x].imshow(f3[0, : , :, CONVOLUTION_NUMBER], cmap='inferno') axarr[2,x].grid(False) And you should see something like the following, where the convolution is taking the essence of the sole of the shoe, effectively spotting that as a common feature across all shoes. Exercise 1 Try editing the convolutions. Change the number of convolutions from 32 to either 16 or 64. What impact does that have on accuracy and training time? Exercise 2 Remove the final convolution. What impact does that have on accuracy or training time? Exercise 3 Add more convolutions. What impact does that have? Exercise 4 Remove all convolutions but the first. What impact does that have? Experiment with it. You've built your first CNN! To learn how to further enhance your computer vision models, proceed to Use convolutional neural networks (CNNs) with complex images.
https://codelabs.developers.google.com/codelabs/tensorflow-lab4-cnns
CC-MAIN-2020-50
refinedweb
1,600
55.74
Todd Uhl BizTalk/WSE/Indigo Todd Uhl Subtext 2006-06-06T10:58:33Z Installing the new '06 SharePoint Adapter 2006-06-06T10:59:00-05:00:00 2006-06-06T10:59:00Z <P><FONT face=Verdana size=2>The.</FONT></P> <P><FONT face=Verdana size=2></FONT> </P> <P><FONT face=Verdana size=2>Cheers,</FONT></P> <P><FONT face=Verdana size=2>Todd</FONT></P><img src="" width="1" height="1" /> 0 Installing BTS 2006 - Sharepoint 1057 system error 2006-04-20T10:52:00-05:00:00 2006-04-20T10:52:00Z <P><FONT face=Verdana>When setting up WSS so you can do a full install of BizTalk, you may get an error similar to <FONT color=#ffa500>“System Error 1057 while trying to query service SPTimer”</FONT>..</FONT></P> <P><FONT face=Verdana></FONT> </P> <P><FONT face=Verdana>Cheers,</FONT></P> <P><FONT face=Verdana>Todd</FONT></P><img src="" width="1" height="1" /> 3 BAM Export error in Excel 2003 2006-04-12T13:31:00-05:00:00 2006-04-12T13:35:00Z <P><FONT face=Verdana>So, I figured it was finally time I broke down and started to really figure out what BAM was all about, partly inspired by <A href=""><FONT color=#ffa500>Richard Seroter's</FONT></A> posting on the subject (everyone should read <A href=""><FONT color=#ffa500>his</FONT><.</FONT></P> <P><FONT face=Verdana) -</FONT></P> <P><FONT face=Verdana> </FONT><FONT face="Courier New" color=#008000>bm deploy-all -DefinitionFile:MyWorkbook.xls</FONT></P> <P><FONT face=Verdana>Using this syntax will default to the local server for SQL Server, and the BAMPrimaryImport database. You can optionally supply parameters to specify a different server or database. To view help on deploying with bm, type the following command - </FONT></P> <P><FONT face=Verdana> </FONT><FONT face="Courier New" color=#008000>bm help -Command:deploy-all</FONT></P> <P><FONT face=Verdana>Ok, I'm off to go BAMing now.</FONT></P><FONT face=Verdana> <P><BR>Cheers,</P> <P>Todd</FONT></P><img src="" width="1" height="1" /> 0 More on MSI Deployments - Launch Conditions.... 2005-10-11T14:39:00-05:00:00 2005-10-11T14:39:00Z <P><FONT face=Verdana size=2>In talking with others, it appears that the NAnt vs. MSI deployment camps are pretty much split down the middle. I tend to lean towards MSI deployments for several reasons.</FONT></P> <P><FONT face=Verdana size=2.</FONT></P> <P><FONT face=Verdana size=2>Luckily, it's pretty easy to handle both of this situations following the steps below - </FONT></P> <P><FONT face=Verdana size=2><STRONG>Determining the BizTalk install directory</STRONG></FONT></P> <P><FONT face=Verdana size=2>This one turns out to be pretty easy as the BTS install directory gets stored in the registry. And, the MSI install project gives us the ability to search the registry, so we just need to know what to search for.</FONT></P> <OL> <LI><FONT face=Verdana size=2>In the install project, right click and choose <STRONG>View|Launch Conditions</STRONG>.</FONT></LI> <LI><FONT face=Verdana size=2>Name the launch condition BizTalk Install Path.</FONT></LI> <LI><FONT face=Verdana size=2>Enter <STRONG>BIZTALKINSTALLPATH</STRONG> for the Property property. We will use this property later.</FONT></LI> <LI><FONT face=Verdana size=2>For the <STRONG>RegKey</STRONG> property, enter <STRONG>SOFTWARE\Microsoft\BizTalk Server\3.0</STRONG>.</FONT></LI> <LI><FONT face=Verdana size=2>For the <STRONG>Root</STRONG> property, choose vsdrrHKLM from the dropdown.</FONT></LI> <LI><FONT face=Verdana size=2>For the <STRONG>Value</STRONG> property, enter <STRONG>InstallPath</STRONG>.</FONT></LI></OL> <P><FONT face=Verdana size <STRONG>DefaultLocation</STRONG> property of that folder, enter [BIZTALKINSTALLPATH]\Pipeline Components as the value. You will notice [BIZTALKINSTALLPATH] is how we get to our properties of the install project. It's that easy.</FONT></P> <P><FONT face=Verdana size=2><STRONG>Determining install path chosen during install process</STRONG></FONT></P> <P><FONT face=Verdana size=2.</FONT></P> <P><FONT face=Verdana size=2>Two properties to take particular note in are the <STRONG>AdapterMgmtAssemblyPath</STRONG> and the <STRONG>InboundAssemblyPath</STRONG>. These properties point to specific paths of your components (generally the same component). So, we need to somehow capture where the installer has chosen to install our components, and then make use of this value.</FONT></P> <OL> <LI><FONT face=Verdana size=2>Right click on the installer project, and choose <STRONG>View|File System</STRONG>.</FONT></LI> <LI><FONT face=Verdana size=2>Select the Application Folder folder on the left side. Notice that the property (which is read only in this section) is set to TARGETDIR. This is similar to our BIZTALKINSTALLPATH property that we created.</FONT></LI> <LI><FONT face=Verdana size=2>Right click on the installer project, and choose <STRONG>View|Registry</STRONG>. This is where you will enter all the keys and values you need for your custom adapters. When you get to the AdapterMgmtAssemblyPath and the InboundAssemblyPath properties, you will prepend you assembly name with <STRONG>[TARGETDIR]</STRONG> and enter that for the value of the key.</FONT></LI></OL> <P><FONT face=Verdana size=2.</FONT></P> <P><FONT face=Verdana size=2>Cheers,</FONT></P> <P><FONT face=Verdana size=2>Todd</FONT></P><img src="" width="1" height="1" /> 0 Where does WSE 2.0 fit into BizTalk 2004? 2005-09-04T15:39:00-05:00:00 2005-09-04T15:47:00Z <p><font face=Verdana size=2... <b>BUT<.</font></p> <p><font face="Verdana" size="2".</font></p> <p><font face="Verdana" size="2">Stay tuned as I post my findings!!</font></p> <p><font face="Verdana" size="2">Cheers,</font></p> <p><font face="Verdana" size="2">Todd</font></p><img src="" width="1" height="1" /> 5 Our friend BTSSubscriptionViewer.exe..... 2005-03-09T03:46:00-06:00:00 2005-09-02T18:50:00Z <P><FONT face=Verdana size=2.</FONT></P> <P><FONT face=Verdana size).</FONT></P><IMG alt=SC<FONT face=Verdana color=#deb887 size=2></FONT></A><FONT face=Verdana size!!!).</FONT></P> <P><FONT face=Verdana size=2>So, remember, when your subscriptions are not found, launch the BTSSubscriptionViewer tool to find out what's going on under the covers.</FONT></P> <P> </P><img src="" width="1" height="1" /> 4 Exception occurred when persisting state to the database..... 2005-06-07T14:30:00-05:00:00 2005-06-07T14:32:00Z <P><FONT face=Verdana size=2 <A href="">Subscription Viewer</A>..</FONT></P> <P><FONT face=Verdana size=2></FONT> </P> <P><FONT face=Verdana size=2>Cheers,</FONT></P> <P><FONT face=Verdana size=2>Todd</FONT></P><img src="" width="1" height="1" /> 3 I'm still here..... 2005-05-11T04:51:00-05:00:00 2005-05-11T04:51:00Z <P><FONT face=Tahoma size=2>So, I'm looking at my blog today, and I see I haven't posted anything in 2 months and a day. Shameful!!! Anyway, I'm climbing back in the saddle.</FONT></P> <P><FONT face=Tahoma size=2.</FONT></P> <P><FONT face=Tahoma size=2>The question came up at work today about debatching in Orchestrations. This is a very common scenario in business processing, or at least the issue of dealing with batch style messages is. Stephen Thomas has done a great job in writing up <A href="">some examples</A> of how to deal with this. So good, that I won't bother to recap. Anyway, there are a couple of important things to keep in mind when considering your options.</FONT></P> <OL> <LI><FONT face=Tahoma size=2>Is it important that “good“ messages must be processesed, and “bad“ messages be dealt with?</FONT></LI> <LI><FONT face=Tahoma size=2>Are the file sizes significant?</FONT></LI> <LI><FONT face=Tahoma size=2>Does the service level agreement have specific time constraints?</FONT></LI> <LI><FONT face=Tahoma size=2>Does the trailer and header (if flat file messages) of the message have to be dealt with?</FONT></LI></OL> <P><FONT face=Tahoma size=2.</FONT></P> <P><FONT face=Tahoma size=2 <A href="">information</A> to see if it might work for you.</FONT></P> <P><FONT face=Tahoma size=2>There are still a couple of other options that may be available to you. I will start to post some more thoughts and examples on this topic in the next several weeks.</FONT></P> <P><FONT face=Tahoma size=2>Cheers,</FONT></P> <P><FONT face=Tahoma size=2>Todd</FONT></P><img src="" width="1" height="1" /> 1 Quick Tip - Deploying other's projects.... 2004-12-06T22:51:00-06:00:00 2004-12-06T22:51:00Z <P><FONT face=Tahoma size=2>Ever get someones project out of source safe (or any other way), go to deploy it and get a 'SQL exception: SQL Server does not exist or access denied' error?</FONT></P> <P><FONT face=Tahoma size=2>Go to the project properties, configuration properties, deploy, and make sure it's pointing to your database (typically (local) ).</FONT></P> <P><FONT face=Tahoma size=2></FONT> </P> <P><FONT face=Tahoma size=2>Todd</FONT></P><img src="" width="1" height="1" /> 3 Atomic Scope "Batch" property... 2004-11-24T03:31:00-06:00:00 2004-11-24T03:31:00Z <P><FONT face=Tahoma><FONT size=2>Charles Young has a great post on </FONT><A href=""><FONT size=2>transactions</FONT></A><FONT size=2> </FONT><A href=""><FONT size=2>blog</FONT></A><FONT size=2>), it has become apparent that the property acts just as Charles suspects.</FONT></FONT></P> <P><FONT face=Tahoma size=2>Our particular scenario - </FONT></P> <P><FONT face=Tahoma size=2.</FONT></P> <P><FONT face=Tahoma size=2>After we changed the property to be False (the proprety for some reason defaults to True, which seems a bit dangerous), redeployed and rean the test again, the much smaller messages completed ahead of the slower, larger batch of messages (our expected outcome originally).</FONT></P> <P><FONT face=Tahoma size=2>So, keep in mind when using the Atomic transaction that this property defaults to True, and may have ill effects on your message processing.</FONT></P> <P><FONT face=Tahoma size=2>Cheers!!</FONT></P><img src="" width="1" height="1" /> 5 More on deployment... 2004-11-09T02:26:00-06:00:00 2004-11-09T02:26:00Z <P class=MsoNormal<FONT face=Tahoma size=2>Ok, sorry for the short hiatus….very busy times on my current project.<SPAN style="mso-spacerun: yes"> </SPAN>Anyway, I previously mentioned some points around deployment.<SPAN style="mso-spacerun: yes"> </SPAN>It turns out that using BTS Installer doesn’t work well when utilizing roles and parties.<SPAN style="mso-spacerun: yes"> </SPAN>This doesn’t mean we have to scrap the BTSInstaller all together, we just have to do a little extra work in creating scripts that do the deployment as well as the undeployment, and then call those scripts from our MSI package.</FONT></P> <P class=MsoNormal<?xml:namespace prefix = o<o:p><FONT face=Tahoma size=2> </FONT></o:p></P> <P class=MsoNormal<FONT face=Tahoma size=2>In the zip file (get it <A href="">here</A>), I’ve included some sample scripts that may give you a head start in the deployment process.<SPAN style="mso-spacerun: yes"> </SPAN>Keep in mind that if you are NOT using roles and parties, BTSInstaller will get you about 80% of the way there, and you will not need all of the scripts.<SPAN style="mso-spacerun: yes"> </SPAN>You will still need some scripts to go ahead and enlist and start everything, and some work is needed to automagically undeploy everything using Add or Remove Programs.<SPAN style="mso-spacerun: yes"> </SPAN>With everything included in the zip file, you should be able to gleam something that will help.</FONT></P> <P class=MsoNormal<o:p><FONT face=Tahoma size=2> </FONT></o:p></P> <P class=MsoNormal<FONT face=Tahoma size=2>A few key points – </FONT></P> <P class=MsoNormal<o:p><FONT face=Tahoma size=2> </FONT></o:p></P> <UL style="MARGIN-TOP: 0in" type=disc> <LI class=MsoNormal<FONT face=Tahoma size=2>Binding files – everything is driven by the binding file.<SPAN style="mso-spacerun: yes"> </SPAN>Make sure it is correct, or you will have issues.<SPAN style="mso-spacerun: yes"> </SPAN>One thing to watch out for is your binding file contains the PublicTokenKey of the assembly it is derived from.<SPAN style="mso-spacerun: yes"> </SPAN>If during multi-developer development these somehow get out of sync, when you deploy you won’t get any errors, but nothing gets deployed either.</FONT></LI> <LI class=MsoNormal<FONT face=Tahoma size=2>Deleting parties – if you are implementing parties and roles, you will have to un-enlist the parties and delete them prior to un-deploying the assemblies that contain the orchestrations.<SPAN style="mso-spacerun: yes"> </SPAN>Included in the SDK are 2 sample projects that when compiled create one exe to un-enlist the parties, and one exe to delete the parties.<SPAN style="mso-spacerun: yes"> </SPAN>These are coded assuming that the SQL database where your management database resides is local to BizTalk.<SPAN style="mso-spacerun: yes"> </SPAN>This is most likely not the case, so you will have to edit this code to determine what server the database is on, and supply that in the connection string.<SPAN style="mso-spacerun: yes"> </SPAN>It’s quite simple using MSI, and if you need some code snippets just send me a comment.</FONT></LI> <LI class=MsoNormal<FONT face=Tahoma size=2>Removing orchestrations – running the MSI to delete orchestrations (if using the default BTSInstaller) won’t remove your Orchestrations since they are in the running state.<SPAN style="mso-spacerun: yes"> </SPAN>Chances are if you’re testing they are even in the active state.<SPAN style="mso-spacerun: yes"> </SPAN>In the supplied StopOrchestrations script, there is a flag you can pass into the Unenlist method that will terminate any active instances.<SPAN style="mso-spacerun: yes"> </SPAN>Pay attention to this if this is not your intended actions.</FONT></LI> <LI class=MsoNormal<FONT face=Tahoma size=2>Write to the event log – you will notice in my scripts I have added some code to shell out and use the LogEvent method to write errors to the Application Log.<SPAN style="mso-spacerun: yes"> </SPAN>With the nature of VBScript, if you don’t do this and run into errors, you will never figure out where to start looking.</FONT></LI></UL> <P class=MsoNormal<o:p><FONT face=Tahoma size=2> </FONT></o:p></P> <P class=MsoNormal<FONT face=Tahoma size=2><FONT color=#ff0000>Use the scripts at your own risk</FONT>.<SPAN style="mso-spacerun: yes"> </SPAN>They are commented, so you should be able to read along and see what’s going on.<SPAN style="mso-spacerun: yes"> </SPAN>Remember, if you are not using roles, you won’t need half the stuff in the Install.bat file, and some of the stuff in Cleanup.bat, but read through those to see the order things are called, and you will need some of the other scripts regardless.</FONT></P> <P class=MsoNormal<FONT face=Tahoma size=2></FONT> </P> <P class=MsoNormal<FONT face=Tahoma size=2>Cheers!!</FONT></P><img src="" width="1" height="1" /> 5 BTSInstaller "bug" 2004-10-13T04:40:00-05:00:00 2004-10-13T04:40:00Z <P><FONT face=Tahoma size=2.</FONT></P> <P><FONT face=Tahoma size=2>I plan on posting all my deployment scripts here in the next few days as the BTSInstaller gets you about 85% there, and you're required to script the rest.</FONT></P> <P><FONT face=Tahoma size=2>Take a look at <A href="">Scott Colestock's</A> blog for a different option <FONT color=#ffa500>(Nant)</FONT> to the BTSInstaller.</FONT></P> <P><FONT face=Tahoma size=2>Cheers,<BR>Todd</FONT></P><img src="" width="1" height="1" /> 0 Shared Config Files........ 2004-10-08T15:41:00-05:00:00 2004-10-08T16:03:00Z <P><FONT face=Tahoma size=2>BizTalk server relies on a config file to store certain application information. This config file is located in \Program Files\Microsoft BizTalk Server 2004 and is named BTSNTSvc.Exe.Config. View your file </FONT><A href=" Files/Microsoft BizTalk Server 2004/BTSNTSvc.exe.config"><FONT face=Tahoma size=2>here</FONT></A><FONT face=Tahoma size=2> (DO NOT CHANGE THIS FILE WITHOUT BACKING UP!!!).</FONT></P> <P><FONT face=Tahoma size.!!!</FONT></P> <P><FONT face=Tahoma size=2>Take a look at my </FONT><A href=""><FONT face=Tahoma size=2>sample</FONT></A><FONT face=Tahoma size=2>.</FONT></P> <P><FONT face=Tahoma size=2>The key to making this work is the <XLANGS>section. To make this section "available", you will have to add the following under the <CONFIGURATIONS>section of your config file - </FONT></P> <P><FONT face=Tahoma size=2><SECTION type="Microsoft.XLANGs.BizTalk.CrossProcess.XmlSerializationConfigurationSectionHandler, Microsoft.XLANGs.BizTalk.CrossProcess" name="xlangs" /></FONT></P> <P><FONT face=Tahoma size=2>Now that we have this in the config file, we can add the section <XLANGS>. I won't copy it here to save space, so look at the example. This section is where all the magic happens. Some of the attributes like AssembliesPerDomain, etc you can find information about in the help documentation. The key sections to be aware of are the <APPDOMAINSPECS>section, <CONFIGURATIONFILE>section, and the <PATTERNASSIGNMENTRULE>section.</FONT></P> <P><FONT face=Tahoma size=2><APPDOMAINSPECS><BR.</FONT></P> <P><FONT face=Tahoma size=2><CONFIGURATIONFILE><BR>This section defines where the called components config file resides. You can use absolute paths, or I believe you can use relative paths also.</FONT></P> <P><FONT face=Tahoma size=2><PATTERNASSIGNMENTRULE><BR.</FONT></P> <P><FONT face=Tahoma size=2.</FONT></P> <P><FONT face=Tahoma size=2>DON'T FORGET...BACK UP YOUR CURRENT CONFIG FILE BEFORE MAKING CHANGES. This will save a lot of headaches.</FONT></P> <P><FONT face=Tahoma size=2 - </FONT></P> <P><FONT face=Tahoma size=2><SECTION type="<component name>, Version=<version>, Culture=<culture>, PublicKeyToken=<token>" name="" /></FONT></P> <P><FONT face=Tahoma size=2>The values for component name, version, culture and token you can get out of .NET Framework Configuration admin tool. Just look for you component, and make note of the values listed. The only one that should change would be the version.</FONT></P><img src="" width="1" height="1" /> 6 Role Link Sample.....better late than never..... 2004-10-05T04:23:00-05:00:00 2004-10-05T04:23:00Z <P><FONT face=Tahoma size=2>I applogize for being anything but prompt on this. </FONT></P> <P><FONT face=Tahoma size=2>The zip file can be found </FONT><A href=""><FONT face=Tahoma size=2>here</FONT></A><FONT face=Tahoma size=2>.</FONT></P> <P><FONT face=Tahoma size=2>Steps for setting up Role Link Sample - </FONT></P> <P><FONT face=Tahoma size=2>1. Create a receive port in BTS Explorer<BR>2. Create 2 send ports - RoleLinkTest_Approver1 and RoleLinkTest_Approver2<BR>3. Set your transports, send or receive locations, etc for your ports<BR>4. Create a party called Approver1. Choose RoleLinkTest_Approver1 as their send port.<BR>5. Create a party called Approver2. Choose RoleLinkTest_Approver2 as their send port.</FONT></P> <P><FONT face=Tahoma size=2>At this point you should be able to deploy the project. Once the project has been successfully </FONT></P> <P><FONT face=Tahoma size=2>deployed, you should now have a new Role listed in BTS Explorer called </FONT></P> <P><FONT face=Tahoma size=2>RoleLinkSample.RoleLinkTestOrchestration.Purchasing.Approver. This is from the role link type we </FONT></P> <P><FONT face=Tahoma size=2>created earlier.</FONT></P> <P><FONT face=Tahoma size=2>6. Right click on the new Role and select "Enlist Party". Choose are 2 parties. From this point </FONT></P> <P><FONT face=Tahoma size=2>forward, if you wanted to add new parties (for new trading partners perhaps), you would just repeat </FONT></P> <P><FONT face=Tahoma size=2>steps 4,5 and 6...it's that easy!!!</FONT></P> <P><FONT face=Tahoma size=2>Now you can run the test files through. Read back through the previous post on role links, and </FONT></P> <P><FONT face=Tahoma size=2>follow along this example (pay attention to the expression shape that initializes the ports). </FONT></P> <P><FONT face=Tahoma size=2>Hopefully it will make a little more sense.</FONT></P> <P><FONT face=Tahoma size=2>Please let me know if you have any questions, or if the setup instructions are lacking.</FONT></P> <P><FONT face=Tahoma size=2>ooops, almost forgot..take a look at the 2 files you'll be submitting, and don't forget to point the project to a keyfile.</FONT></P> <P><FONT face=Tahoma size=2>Todd</FONT></P><img src="" width="1" height="1" /> 17 Hosts and Host Instances 2004-10-02T15:59:00-05:00:00 2004-10-02T16:00:00Z <P><FONT face=Verdana size=2>Before I begin, I promise I am working on getting my role link example up here. There was some confusion with server space to upload the example to.</FONT></P> <P><FONT face=Verdana size=2>Ok....I know when I first started with BTS'04, it was slightly confusing to me what the whole host/host instance thing was. A fairly new concept from the previous versions. But, once the concept sinks in (things take longer for me ;-) ), it's actually extremely useful.</FONT></P> <P><FONT face=Verdana size=2.</FONT></P> <P><FONT face=Verdana size.</FONT></P> <P><FONT face=Verdana size=2>Another good reason to create different hosts is for security reason. I won't go into detail here, but remember that hosts can be associated with different windows groups, and host instances can be configured to run as specific accounts.</FONT></P> <P><FONT face=Verdana size=2.</FONT></P> <P><FONT face=Verdana size=2>So, remember to seriously think about your hosts early on. Think in terms of performance, functionality and scalability. Read the paper on </FONT><A href=""><FONT face=Verdana size=2>High Availability</FONT></A><FONT face=Verdana size=2> for BizTalk '04.</FONT></P><img src="" width="1" height="1" /> 0
http://geekswithblogs.net/toddu/Atom.aspx
crawl-002
refinedweb
3,857
56.45
by Matthew Ford 12th October 2013 (original1st September 2013) © Forward Computing and Control Pty. Ltd. NSW Australia This page follows on from Arduino for Beginners, controlled by Android, and explains a simple Arduino sketch that lets you switch a digital output on and off from your Android mobile phone. This page also covers debugging your sketch while connected to your mobile. Once you understand this basic sketch you can use it a basis for your own projects. No Android programming is required, but using pfodApp you can easily customize the mobiile's display by changing text strings in your Arduino sketch. This project uses the same parts as Arduino for Beginners, controlled by Android and assumes you have already built that project install it following the instructions on that page. NOTE: remove the bluetooth shield before uploading the sketch because the bluetooth shield uses the same pins the USB connection does and the programming get confused. #include <EEPROM.h> // include the EEPROM library #include <pfodParser.h> // include the library pfodParser parser; // create the cmd } }. Click on the connection to connect and the sketch above will return the menu below. Clicking the “Toggle Led” menu turns the Uno led on and off. (The led is near the USB connection and partially hidden by the bluetooth shield.)} Here is what the menu and debug view looks like:- There are lots of other screens you can specify in your sketch, like slider menu items, multi-selection lists etc, but many projects just need a few buttons to control them and this sketch will serve as a good starting point.. To learn more about coding Arduino see To learn more about pfod check out the pfod Specification and the projects
https://www.forward.com.au/pfod/ArduinoProgramming/UnoStarter_Rev0/switchOutput.html
CC-MAIN-2018-05
refinedweb
286
67.99
(For more resources related to this topic, see here.) Patterns in programming mean a concrete and standard solution to a given problem. Usually, programming patterns are the result of people gathering experience, analyzing the common problems, and providing solutions to these problems. Since parallel programming has existed for quite a long time, there are many different patterns for programming parallel applications. There are even special programming languages to make programming of specific parallel algorithms easier. However, this is where things start to become increasingly complicated. In this article, I will provide a starting point from where you will be able to study parallel programming further. We will review very basic, yet very useful, patterns that are quite helpful for many common situations in parallel programming. First is about using a shared-state object from multiple threads. I would like to emphasize that you should avoid it as much as possible. A shared state is really bad when you write parallel algorithms, but in many occasions it is inevitable. We will find out how to delay an actual computation of an object until it is needed, and how to implement different scenarios to achieve thread safety. The next two recipes will show how to create a structured parallel data flow. We will review a concrete case of a producer/consumer pattern, which is called as Parallel Pipeline. We are going to implement it by just blocking the collection first, and then see how helpful is another library from Microsoft for parallel programming—TPL DataFlow. The last pattern that we will study is the Map/Reduce pattern. In the modern world, this name could mean very different things. Some people consider map/reduce not as a common approach to any problem but as a concrete implementation for large, distributed cluster computations. We will find out the meaning behind the name of this pattern and review some examples of how it might work in case of small parallel applications. Implementing Lazy-evaluated shared states This recipe shows how to program a Lazy-evaluated thread-safe shared state object. Getting ready To start with this recipe, you will need a running Visual Studio 2012. There are no other prerequisites. The source code for this recipe can be found at Packt site. How to do it... For implementing Lazy-evaluated shared states, perform the following steps: - Start Visual Studio 2012. Create a new C# Console Application project. - In the Program.cs file, add the following using directives: using System; using System.Threading; using System.Threading.Tasks; - Add the following code snippet below the Main method: static async Task ProcessAsynchronously() { var unsafeState = new UnsafeState(); Task[] tasks = new Task[4]; for (int i = 0; i < 4; i++) { tasks[i] = Task.Run(() => Worker(unsafeState)); } await Task.WhenAll(tasks); Console.WriteLine(" --------------------------- "); var firstState = new DoubleCheckedLocking(); for (int i = 0; i < 4; i++) { tasks[i] = Task.Run(() => Worker(firstState)); } await Task.WhenAll(tasks); Console.WriteLine(" --------------------------- "); var secondState = new BCLDoubleChecked(); for (int i = 0; i < 4; i++) { tasks[i] = Task.Run(() => Worker(secondState)); } await Task.WhenAll(tasks); Console.WriteLine(" --------------------------- "); var thirdState = new Lazy<ValueToAccess>(Compute); for (int i = 0; i < 4; i++) { tasks[i] = Task.Run(() => Worker(thirdState)); } await Task.WhenAll(tasks); Console.WriteLine(" --------------------------- "); var fourthState = new BCLThreadSafeFactory(); for (int i = 0; i < 4; i++) { tasks[i] = Task.Run(() => Worker(fourthState)); } await Task.WhenAll(tasks); Console.WriteLine(" --------------------------- "); } static void Worker(IHasValue state) { Console.WriteLine("Worker runs on thread id {0}",Thread .CurrentThread.ManagedThreadId); Console.WriteLine("State value: {0}", state.Value.Text); } static void Worker(Lazy<ValueToAccess> state) { Console.WriteLine("Worker runs on thread id {0}",Thread .CurrentThread.ManagedThreadId); Console.WriteLine("State value: {0}", state.Value.Text); } static ValueToAccess Compute() { Console.WriteLine("The value is being constructed on athread id {0}", Thread.CurrentThread.ManagedThreadId); Thread.Sleep(TimeSpan.FromSeconds(1)); return new ValueToAccess(string.Format("Constructed on thread id {0}", Thread.CurrentThread.ManagedThreadId)); } class ValueToAccess { private readonly string _text; public ValueToAccess(string text) { _text = text; } public string Text { get { return _text; } } } class UnsafeState : IHasValue { private ValueToAccess _value; public ValueToAccess Value { get { if (_value == null) { _value = Compute(); } return _value; } } } class DoubleCheckedLocking : IHasValue { private object _syncRoot = new object(); private volatile ValueToAccess _value; public ValueToAccess Value { get { if (_value == null) { lock (_syncRoot) { if (_value == null) _value = Compute(); } } return _value; } } } class BCLDoubleChecked : IHasValue { private object _syncRoot = new object(); private ValueToAccess _value; private bool _initialized = false; public ValueToAccess Value { get { return LazyInitializer.EnsureInitialized( ref _value, ref _initialized, ref _syncRoot,Compute); } } } class BCLThreadSafeFactory : IHasValue { private ValueToAccess _value; public ValueToAccess Value { get { return LazyInitializer.EnsureInitialized(ref _value,Compute); } } } interface IHasValue { ValueToAccess Value { get; } } - Add the following code snippet inside the Main method: var t = ProcessAsynchronously(); t.GetAwaiter().GetResult(); Console.WriteLine("Press ENTER to exit"); Console.ReadLine(); - Run the program. How it works... The first example show why it is not safe to use the UnsafeState object with multiple accessing threads. We see that the Construct method was called several times, and different threads use different values, which is obviously not right. To fix this, we can use a lock when reading the value, and if it is not initialized, create it first. It will work, but using a lock with every read operation is not efficient. To avoid using locks every time, there is a traditional approach called the double-checked locking pattern. We check the value for the first time, and if is not null, we avoid unnecessary locking and just use the shared object. However, if it was not constructed yet, we use the lock and then check the value for the second time, because it could be initialized between our first check and the lock operation. If it is still not initialized, only then we compute the value. We can clearly see that this approach works with the second example—there is only one call to the Construct method, and the first-called thread defines the shared object state. Please note that if the lazy- evaluated object implementation is thread-safe, it does not automatically mean that all its properties are thread-safe as well. If you add, for example, an int public property to the ValueToAccess object, it will not be thread-safe; you still have to use interlocked constructs or locking to ensure thread safety. This pattern is very common, and that is why there are several classes in the Base Class Library to help us. First, we can use the LazyInitializer.EnsureInitialized method, which implements the double-checked locking pattern inside. However, the most comfortable option is to use the Lazy<T> class that allows us to have thread-safe Lazy-evaluated, shared state, out of the box. The next two examples show us that they are equivalent to the second one, and the program behaves the same. The only difference is that since LazyInitializer is a static class, we do not have to create a new instance of a class as we do in the case of Lazy<T>, and therefore the performance in the first case will be better in some scenarios. The last option is to avoid locking at all, if we do not care about the Construct method. If it is thread-safe and has no side effects and/or serious performance impacts, we can just run it several times but use only the first constructed value. The last example shows the described behavior, and we can achieve this result by using another LazyInitializer.EnsureInitialized method overload. Implementing Parallel Pipeline with BlockingCollection This recipe will describe how to implement a specific scenario of a producer/consumer pattern, which is called Parallel Pipeline, using the standard BlockingCollection data structure. Getting ready To begin this recipe, you will need a running Visual Studio 2012. There are no other prerequisites. The source code for this recipe can be found at Packt site. How to do it... To understand how to implement Parallel Pipeline using BlockingCollection, perform the following steps: - Start Visual Studio 2012. Create a new C# Console Application project. - In the Program.cs file, add the following using directives: using System; using System.Collections.Concurrent; using System.Linq; using System.Threading; using System.Threading.Tasks; - Add the following code snippet below the Main method: private const int CollectionsNumber = 4; private const int Count = 10; class PipelineWorker<TInput, TOutput> { Func<TInput, TOutput> _processor = null; Action<TInput> _outputProcessor = null; BlockingCollection<TInput>[] _input; CancellationToken _token; public PipelineWorker( BlockingCollection<TInput>[] input, Func<TInput, TOutput> processor, CancellationToken token, string name) { _input = input; Output = new BlockingCollection<TOutput>[_input.Length]; for (int i = 0; i < Output.Length; i++) Output[i] = null == input[i] ? null : new BlockingCollection<TOutput>(Count); _processor = processor; _token = token; Name = name; } public PipelineWorker( BlockingCollection<TInput>[] input, Action<TInput> renderer, CancellationToken token, string name) { _input = input; _outputProcessor = renderer; _token = token; Name = name; Output = null; } public BlockingCollection<TOutput>[] Output { get; private set; } public string Name { get; private set; } public void Run() { Console.WriteLine("{0} is running", this.Name); while (!_input.All(bc => bc.IsCompleted) && !_token.IsCancellationRequested) { TInput receivedItem; int i = BlockingCollection<TInput>.TryTakeFromAny( _input, out receivedItem, 50, _token); if (i >= 0) { if (Output != null) { TOutput outputItem = _processor(receivedItem); BlockingCollection<TOutput>.AddToAny(Output,outputItem); Console.WriteLine("{0} sent {1} to next,on thread id {2}", Name, outputItem,Thread.CurrentThread.ManagedThreadId); Thread.Sleep(TimeSpan.FromMilliseconds(100)); } else { _outputProcessor(receivedItem); } } else { Thread.Sleep(TimeSpan.FromMilliseconds(50)); } } if (Output != null) { foreach (var bc in Output) bc.CompleteAdding(); } } } - Add the following code snippet inside the Main method: var cts = new CancellationTokenSource(); Task.Run(() => { if (Console.ReadKey().KeyChar == 'c') cts.Cancel(); }); var sourceArrays = new BlockingCollection<int>[CollectionsNumber]; for (int i = 0; i < sourceArrays.Length; i++) { sourceArrays[i] = new BlockingCollection<int>(Count); } var filter1 = new PipelineWorker<int, decimal> (sourceArrays, (n) => Convert.ToDecimal(n * 0.97), cts.Token, "filter1" ); var filter2 = new PipelineWorker<decimal, string> (filter1.Output, (s) => String.Format("--{0}--", s), cts.Token, "filter2" ); var filter3 = new PipelineWorker<string, string> (filter2.Output, (s) => Console.WriteLine("The final result is {0} onthread id {1}", s, Thread.CurrentThread.ManagedThreadId), cts.Token,"filter3"); try { Parallel.Invoke( () => { Parallel.For(0, sourceArrays.Length * Count,(j, state) => { if (cts.Token.IsCancellationRequested) { state.Stop(); } int k = BlockingCollection<int>.TryAddToAny(sourceArrays, j); if (k >= 0) { Console.WriteLine("added {0} to source data onthread id {1}", j, Thread.CurrentThread.ManagedThreadId); Thread.Sleep(TimeSpan.FromMilliseconds(100)); } }); foreach (var arr in sourceArrays) { arr.CompleteAdding(); } }, () => filter1.Run(), () => filter2.Run(), () => filter3.Run() ); } catch (AggregateException ae) { foreach (var ex in ae.InnerExceptions) Console.WriteLine(ex.Message + ex.StackTrace); } if (cts.Token.IsCancellationRequested) { Console.WriteLine("Operation has been canceled!Press ENTER to exit."); } else { Console.WriteLine("Press ENTER to exit."); } Console.ReadLine(); - Run the program. How it works... In the preceding example, we implement one of the most common parallel programming scenarios. Imagine that we have some data that has to pass through several computation stages, which take a significant amount of time. The latter computation requires the results of the former, so we cannot run them in parallel. If we had only one item to process, there would not be many possibilities to enhance the performance. However, if we run many items through the set of same computation stages, we can use a Parallel Pipeline technique. This means that we do not have to wait until all items pass through the first computation stage to go to the next one. It is enough to have just one item that finishes the stage, we move it to the next stage, and meanwhile the next item is being processed by the previous stage, and so on. As a result, we almost have parallel processing shifted by a time required for the first item to pass through the first computation stage. Here, we use four collections for each processing stage, illustrating that we can process every stage in parallel as well. The first step that we do is to provide a possibility to cancel the whole process by pressing the C key. We create a cancellation token and run a separate task to monitor the C key. Then, we define our pipeline. It consists of three main stages. The first stage is where we put the initial numbers on the first four collections that serve as the item source to the latter pipeline. This code is inside the Parallel.For loop, which in turn is inside the Parallel.Invoke statement, as we run all the stages in parallel; the initial stage runs in parallel as well. The next stage is defining our pipeline elements. The logic is defined inside the PipelineWorker class. We initialize the worker with the input collection, provide a transformation function, and then run the worker in parallel with the other workers. This way we define two workers, or filters, because they filter the initial sequence. One of them turns an integer into a decimal value, and the second one turns a decimal to a string. Finally, the last worker just prints every incoming string to the console. Everywhere we provide a running thread ID to see how everything works. Besides this, we added artificial delays, so the items processing will be more natural, as we really use heavy computations. As a result, we see the exact expected behavior. First, some items are being created on the initial collections. Then, we see that the first filter starts to process them, and as they are being processed, the second filter starts to work, and finally the item goes to the last worker that prints it to the console. Implementing Parallel Pipeline with TPL DataFlow This recipe shows how to implement a Parallel Pipeline pattern with the help of TPL DataFlow library. Getting ready To start with this recipe, you will need a running Visual Studio 2012. There are no other prerequisites. The source code for this recipe could be found at Packt site. How to do it... To understand how to implement Parallel Pipeline with TPL DataFlow, perform the following steps: - Start Visual Studio 2012. Create a new C# Console Application project. - Add references to the Microsoft TPL DataFlow NuGet package. - Right-click on the References folder in the project and select the Manage NuGet Packages... menu option. - Now add your preferred references to the Microsoft TPL DataFlow NuGet package. You can use the search option in the Manage NuGet Packages dialog as follows: - In the Program.cs file, add the following using directives: using System; using System.Threading; using System.Threading.Tasks; using System.Threading.Tasks.Dataflow; - Add the following code snippet below the Main method: async static Task ProcessAsynchronously() { var cts = new CancellationTokenSource(); Task.Run(() => { if (Console.ReadKey().KeyChar == 'c') cts.Cancel(); }); var inputBlock = new BufferBlock<int>( new DataflowBlockOptions { BoundedCapacity = 5, CancellationToken = cts.Token }); var filter1Block = new TransformBlock<int, decimal>( n => { decimal result = Convert.ToDecimal(n * 0.97); Console.WriteLine("Filter 1 sent {0} to the nextstage on thread id {1}", result, Thread.CurrentThread.ManagedThreadId); Thread.Sleep(TimeSpan.FromMilliseconds(100)); return result; }, new ExecutionDataflowBlockOptions {MaxDegreeOfParallelism = 4, CancellationToken =cts.Token }); var filter2Block = new TransformBlock<decimal, string>( n => { string result = string.Format("--{0}--", n); Console.WriteLine("Filter 2 sent {0} to the nextstage on thread id {1}", result, Thread.CurrentThread.ManagedThreadId); Thread.Sleep(TimeSpan.FromMilliseconds(100)); return result; }, new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 4, CancellationToken =cts.Token }); var outputBlock = new ActionBlock<string>( s => { Console.WriteLine("The final result is {0} on threadid {1}", s, Thread.CurrentThread.ManagedThreadId); }, new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 4, CancellationToken =cts.Token }); inputBlock.LinkTo(filter1Block, new DataflowLinkOptions {PropagateCompletion = true }); filter1Block.LinkTo(filter2Block, new DataflowLinkOptions { PropagateCompletion = true }); filter2Block.LinkTo(outputBlock, new DataflowLinkOptions { PropagateCompletion = true }); try { Parallel.For(0, 20, new ParallelOptions {MaxDegreeOfParallelism = 4, CancellationToken =cts.Token }, i => { Console.WriteLine("added {0} to source data on threadid {1}", i, Thread.CurrentThread.ManagedThreadId); inputBlock.SendAsync(i).GetAwaiter().GetResult(); }); inputBlock.Complete(); await outputBlock.Completion; Console.WriteLine("Press ENTER to exit."); } catch (OperationCanceledException) { Console.WriteLine("Operation has been canceled!Press ENTER to exit."); } Console.ReadLine(); } - Add the following code snippet inside the Main method: var t = ProcessAsynchronously(); t.GetAwaiter().GetResult(); - Run the program. How it works... In the previous recipe, we have implemented a Parallel Pipeline pattern to process items through sequential stages. It is quite a common problem, and one of the proposed ways to program such algorithms is using a TPL DataFlow library from Microsoft. It is distributed via NuGet, and is easy to install and use in your application. The TPL DataFlow library contains different type of blocks that can be connected with each other in different ways and form complicated processes that can be partially parallel and sequential where needed. To see some of the available infrastructure, let's implement the previous scenario with the help of the TPL DataFlow library. First, we define the different blocks that will be processing our data. Please note that these blocks have different options that can be specified during their construction; they can be very important. For example, we pass the cancellation token into every block we define, and when we signal the cancellation, all of them will stop working. We start our process with BufferBlock. This block holds items to pass it to the next blocks in the flow. We restrict it to the five-items capacity, specifying the BoundedCapacity option value. This means that when there will be five items in this block, it will stop accepting new items until one of the existing items pass to the next blocks. The next block type is TransformBlock. This block is intended for a data transformation step. Here we define two transformation blocks, one of them creates decimals from integers, and the second one creates a string from a decimal value. There is a MaxDegreeOfParallelism option for this block, specifying the maximum simultaneous worker threads. The last block is the ActionBlock type. This block will run a specified action on every incoming item. We use this block to print our items to the console. Now, we link these blocks together with the help of the LinkTo methods. Here we have an easy sequential data flow, but it is possible to create schemes that are more complicated. Here we also provide DataflowLinkOptions with the PropagateCompletion property set to true. This means that when the step completes, it will automatically propagate its results and exceptions to the next stage. Then we start adding items to the buffer block in parallel, calling the block's Complete method, when we finish adding new items. Then we wait for the last block to complete. In case of a cancellation, we handle OperationCancelledException and cancel the whole process. Implementing Map/Reduce with PLINQ This recipe will describe how to implement the Map/Reduce pattern while using PLINQ. Getting ready To begin with this recipe, you will need a running Visual Studio 2012. There are no other prerequisites. The source code for this recipe can be found at Packt site. How to do it... To understand how to implement Map/Reduce with PLINQ, perform the following steps: - Start Visual Studio 2012. Create a new C# Console Application project. - In the Program.cs file, add the following using directives: using System; using System.Collections.Generic; using System.IO; using System.Linq; - Add the following code snippet below the Main method: private static readonly char[] delimiters =Enumerable.Range(0, 256). Select(i => (char)i).Where(c =>!char.IsLetterOrDigit(c)).ToArray(); private const string textToParse = @". ― Herman Melville, Moby Dick. "; - Add the following code snippet inside the Main method: var q = textToParse.Split(delimiters) .AsParallel() .MapReduce( s => s.ToLower().ToCharArray() , c => c , g => new[] {new {Char = g.Key, Count = g.Count()}}) .Where(c => char.IsLetterOrDigit(c.Char)) .OrderByDescending( c => c.Count); foreach (var info in q) { Console.WriteLine("Character {0} occured in the text {1}{2}", info.Char, info.Count, info.Count == 1 ? "time" : "times"); } Console.WriteLine(" -------------------------------------------"); const string searchPattern = "en"; var q2 = textToParse.Split(delimiters) .AsParallel() .Where(s => s.Contains(searchPattern)) .MapReduce( s => new [] {s} , s => s , g => new[] {new {Word = g.Key, Count = g.Count()}}) .OrderByDescending(s => s.Count); Console.WriteLine("Words with search pattern '{0}':",searchPattern); foreach (var info in q2) { Console.WriteLine("{0} occured in the text {1} {2}",info.Word, info.Count, info.Count == 1 ? "time" : "times"); } int halfLengthWordIndex = textToParse.IndexOf(' ',textToParse.Length/2); using(var sw = File.CreateText("1.txt")) { sw.Write(textToParse.Substring(0, halfLengthWordIndex)); } using(var sw = File.CreateText("2.txt")) { sw.Write(textToParse.Substring(halfLengthWordIndex)); } string[] paths = new[] { ".\\" }; Console.WriteLine(" ------------------------------------------------"); var q3 = paths .SelectMany(p => Directory.EnumerateFiles(p, "*.txt")) .AsParallel() .MapReduce( path => File.ReadLines(path).SelectMany(line =>line.Trim(delimiters).Split (delimiters)),word => string.IsNullOrWhiteSpace(word) ? '\t' :word.ToLower()[0], g => new [] { new {FirstLetter = g.Key, Count = g.Count()}}) .Where(s => char.IsLetterOrDigit(s.FirstLetter)) .OrderByDescending(s => s.Count); Console.WriteLine("Words from text files"); foreach (var info in q3) { Console.WriteLine("Words starting with letter '{0}'occured in the text {1} {2}", info.FirstLetter,info.Count, info.Count == 1 ? "time" : "times"); } - Add the following code snippet after the Program class definition: static class PLINQExtensions {); } } - Run the program. How it works... The Map/Reduce functions are another important parallel programming pattern. It is suitable for a small program and large multi-server computations. The meaning of this pattern is that you have two special functions to apply to your data. The first of them is the Map function. It takes a set of initial data in a key/value list form and produces another key/value sequence, transforming the data to the comfortable format for further processing. Then we use another function called Reduce. The Reduce function takes the result of the Map function and transforms it to a smallest possible set of data that we actually need. To understand how this algorithm works, let's look through the recipe. First, we define a relatively large text in the string variable: textToParse. We need this text to run our queries on. Then we define our Map/Reduce implementation as a PLINQ extension method in the PLINQExtensions class. We use SelectMany to transform the initial sequence to the sequence we need by applying the Map function. This function produces several new elements from one sequence element. Then we choose how we group the new sequence with the keySelector function, and we use GroupBy with this key to produce an intermediate key/value sequence. The last thing we do is applying Reduce to the resulting grouped sequence to get the result. In our first example, we split the text into separate words, and then we chop each word into character sequences with the help of the Map function, and group the result by the character value. The Reduce function finally transforms the sequence into a key value pair, where we have a character and a number for the times it was used in the text ordered by the usage. Therefore, we are able to count each character appearance in the text in parallel (since we use PLINQ to query the initial data). The next example is quite similar, but now we use PLINQ to filter the sequence leaving only the words containing our search pattern, and we then get all those words sorted by their usage in the text. Finally, the last example uses file I/O. We save the sample text on the disk, splitting it into two files. Then we define the Map function as producing a number of strings from the directory name, which are all the words from all the lines in all text files in the initial directory. Then we group those words by the first letter (filtering out the empty strings) and use reduce to see which letter is most often used as the first word letter in the text. What is nice is that we can easily change this program to be distributed by just using other implementations of map and reduce functions, and we still are able to use PLINQ with them to make our program easy to read and maintain. Summary In this article we covered implementing lazy-evaluated shared states, implementing Parallel Pipeline using BlockingCollection and TPL DataFlow, and finally we covered the implementation of Map/Reduce with PLINQ. Resources for Article: Further resources on this subject: - Simplifying Parallelism Complexity in C# [Article] - Watching Multiple Threads in C# [Article] - Low-level C# Practices [Article]
https://www.packtpub.com/books/content/parallel-programming-patterns
CC-MAIN-2015-18
refinedweb
3,996
50.33
'); const Rectin tests. sharemethod inside a Shareclass. example/README.md Demonstrates how to use the share plugin. For help getting started with Flutter, view our online documentation. Add this to your package's pubspec.yaml file: dependencies: share: ^0.6.1+1 You can install packages from the command line: with Flutter: $ flutter pub get Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more. Now in your Dart code, you can use: import 'package:share/share.dart'; We analyzed this package on Jun 12, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using: Detected platforms: Flutter References Flutter, and has no conflicting libraries.
https://pub.dev/packages/share
CC-MAIN-2019-26
refinedweb
118
61.53
Odoo Help Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps: CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc. How defined display name in custom many2one I created custom object from Setting->Technical->Database Structure. And I can't defined field name in 'name' must be 'x_name'. When I called this in view it show 'object_name, object_id' like below image. How i can fix this? I read some topic in this forum. It said to defined '_rec_name' but my workflow not follow those. How I can do in my workflow. in your new object you need the result of _name_get method. by default _name_get will show field name if some other field shoud be used for representing name, then you define it in _rec_name = 'other_field' and if you want name to be shown as combination of few field values then you need to define _name_get method all this should be done in py file defining the object.... hope it helps... Hello Gobman, @Bole is 100 % correct,here we use name_get method for custom many2one field here i give one example of name get_method hope this code is very help full class hobbies_hobbies(osv.osv): _name = 'hobbies.hobbies' _columns = { 'name' : fields.char('Hobby Name'), 'place' : fields.char('Place'), 'code' : fields.char('Code'), } def name_get(self, cr, uid, ids, context=None): res = super(hobbies_hobbies, self).name_get(cr, uid, ids, context=context) final_result = [] if ids: for hobbies in self.browse(cr, uid, ids,context=context): hobbies_data = hobbies.name or "" hobbies_data += " [" hobbies_data += hobbies.code or "" hobbies_data += "] " final_result.append((hobbies.id, hobbies_data)) return final_result else: return res if you find this answer helpful, please give me a thumbs up vote Regards, Ankit H Gandhi About This Community Odoo Training Center Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
https://www.odoo.com/forum/help-1/question/how-defined-display-name-in-custom-many2one-75620
CC-MAIN-2018-26
refinedweb
315
68.06
Reinstall old qt 4.4.0 - MCondarelli last edited by Hi All, I have a very old (GPL) program developed with qt4.4.0/MinGW needing some small tweaks. I completely lost in the years the development environment and I am stuck. I tried reinstalling qt-win-opensource-4.4.0-mingw.exe, but it fails to fetch MinGW (unable to contact server). Installing a current version of MinGW doesn't work either because of library mismatch. I also tried to install current version of Qt, but that also fails due to change in Qt API (I would like to touch the old code as little as possible). Can someone suggest what should I do? TiA Mauro - sierdzio Moderators last edited by I think updating Qt version (and fixing incompatibility problems) is the best option: Qt should be source-compatible, so it is likely that all is needed are some minor tweaks. And you will be left with a fresh code that can be recompiled any time, without having to prepare a very special setup. Or you can compile Qt 4.4 from source and then compile your project without any changes. - MCondarelli last edited by Uhm... that doesn't look really true. As said I already tried that route. Using latest Qt5.2.1 I see MAJOR API changes (unless I did some very large mistake somewhere); @D:\mcon\Documents\devel\Reader2>mingw32-make D:/opt/Qt/Qt5.2.1/Tools/mingw48_32/bin/mingw32-make.EXE -f Makefile.Release mingw32-make.EXE[1]: Entering directory 'D:/mcon/Documents/devel/Reader2' g++ -c -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -I"........\opt\Qt\Qt5.2.1\5.2.1\mingw48_32\include" -I"........\opt\Qt\Qt5.2.1\5.2.1\mingw48_32\include\QtGui" -I"........\opt\Qt\Qt5.2.1\5.2.1\mingw48_32\include\QtCore" -I"release" -I"........\opt\Qt\Qt5.2.1\5.2.1\mingw48_32\mkspecs\win32-g++" -o release\setup.o setup.cpp In file included from setup.cpp:24:0: setup.h:23:25: fatal error: QtGui/QDialog: No such file or directory #include <QtGui/QDialog> ^ compilation terminated. Makefile.Release:519: recipe for target 'release/setup.o' failed mingw32-make.EXE[1]: *** [release/setup.o] Error 1 mingw32-make.EXE[1]: Leaving directory 'D:/mcon/Documents/devel/Reader2' makefile:34: recipe for target 'release' failed mingw32-make.EXE: *** [release] Error 2 @ I checked; the header is NOT in the release. Having to code around QDialog missing does not seem a "minor tweak" to me. What am I doing wrong? TiA Mauro - sierdzio Moderators last edited by I was not talking about Qt 5... use Qt 4.8.5, it should compile without any code changes. Migration to Qt 5 will be a bit more tricky, but usually can be done easily, too. There is a perl script that automatically ports most of the code. All widgets in Qt5 are now in QtWidgets module. Best include <QDialog> and it will remain valid in all Qt versions.
https://forum.qt.io/topic/38658/reinstall-old-qt-4-4-0
CC-MAIN-2022-27
refinedweb
509
52.66
RFID Connections from the Top Last time I talked about decomposing moderately complicated programs into simpler blocks and drilling down to smaller blocks with more complexity. A few years back I was approached to redesign a piece of gear. The exact details aren't important, so I'm going to change the details to protect the guilty. The basic idea was the machine could produce one of several objects like a 3D printer. The user would take an existing object and put it in a slot. The machine would recognize which part it was and print a copy of that part. Simple, right? Apparently the people who designed the complex machine thought so. They had wired reed switches to a conventional PC keyboard and put magnets on the model objects. If the user put the object in just right, the machine would see a keypress on the keyboard and get to work. The chances of that, however, were pretty slim and the machine was often surrounded by angry users. When I first saw this, I thought about using RFID, which was a pretty new thing at the time. I was afraid it might be cost prohibitive, but I found a line of very neat sensors from a company called Phidgets. The inexpensive boards connect via USB and one of them provides an RFID sensor. You've probably seen RFID tag systems in stores. The tags can be in a credit card form or in a little button about the size of a quarter. The simple tags supported by the Phidget board have to be close to the receiver and they each have a unique number that identifies them. If the tag gets close to the reader, the reader will detect it and report is unique number. The API to read the RFID isn't very difficult to use, but it is a bit baroque. In other words, it isn't as simple as just calling get_rfid_tag(). You have to open the device and connect to it. There are a variety of callbacks (but you don't have to use them) and a little logic to determine if you have a new tag or you are still reading a previous tag. This is a good example of how you can get a program rolling by using the top down method I discussed last time. Here's a simple program that meets the requirements: #include "auto3dp.h" int main(int argc, char *argv[]) { init(); while (1) { int tag=read_rfid(); if (tag) do_3d_print_job(get_obj_id(tag)); } return 0; // not reached } That's easy, right? Well, if you already have the get_rfid and do_3d_print_job functions, it is. I'm going to leave the do_3d_print_job function as an exercise for the reader (although, it is easy enough to stream G-Code to the printer or call an external program to do it). That's another advantage of this technique. For debugging purposes, it is very easy to replace the simple function with a debugging stub. For example: #include <stdio.h> char *objects[]= { "None", "Robot", "Cup", "Ring", "Money Clip" }; void do_3d_print_job(int id) { assert(id<sizeof(objects)/sizeof(objects[0])); printf("Printing object %s\n",objects[id]); } This lets me put that function off until I'm ready to work on it for real. The Phidgets RFID reader API requires you to do the following steps: - Create a handle to the device - Connect callbacks for various events (optional) - Open the device - Connect the device - Turn on the antenna - Either wait for events or wait for callbacks The events can be that a tag was acquired or lost, an interface board being inserted or removed, or some sort of error. For this simple program I decided to do the simplest thing and just wait for a tag to appear. Without the callbacks, the easiest way to do that seems to be to make a call to see if the reader is currently in contact with an RFID tag. If so, you can read the "last" tag (which is, of course, the one it is contact with). The program stores the tag number so that it doesn't report the same tag repeatedly. It will, however, report the same tag if the readers sees the tag, loses contact with the tag, and then the tag is placed next to the reader again. The only other complication is that the tag is long enough to need a 64-bit integer. In the code, you’ll see the use of long long data types and the rarely used strtoull function (the two l's at the end are not a typo). Here's my actual implementation of the RFID code: #include "auto3dp.h" #include <stdlib.h> static CPhidgetRFIDHandle rfid=0; static unsigned long long lastid=0; static int open_rfid() { int result; if (!rfid) { CPhidgetRFID_create(&rfid); CPhidget_open((CPhidgetHandle)rfid,-1); return 1; } return rfid!=0; } static void close_rfid() { lastid=0; if (rfid) { CPhidget_close((CPhidgetHandle)rfid); CPhidget_delete((CPhidgetHandle)rfid); rfid=0; } } unsigned long long read_rfid(void) { unsigned long long rv=0; int stat=0; char *tag; CPhidgetRFID_Protocol proto; open_rfid(); // does nothing if already open CPhidgetRFID_setAntennaOn(rfid,PTRUE); // check to see if tag active CPhidgetRFID_getTagStatus(rfid,&stat); if (stat!=1) { lastid=0; return rv; } CPhidgetRFID_getLastTag2(rfid,&tag,&proto); rv=strtoull(tag,NULL,16); if (rv==lastid) return 0; lastid=rv; return rv; } You can find all the code online if you want to try it for yourself. You'll also need the Phidgets C API from their web site to compile and run the program. Or, you can replace the RFID module with a debugging stub, if you prefer. I used C because the Phidgets API is C-oriented (although they have other APIs for many other languages, and there are some third-party C++ wrappers on the Internet). However, the general idea is applicable to just about any language.
http://www.drdobbs.com/embedded-systems/rfid-connections-from-the-top/240168584?cid=SBX_ddj_related_commentary_default_embedded_systems&itc=SBX_ddj_related_commentary_default_embedded_systems
CC-MAIN-2015-35
refinedweb
976
69.21
Output Window The Output window can display status messages for various features in the integrated development environment (IDE). To open the Output window, on the View menu, click Output (or press CTRL + ALT + O). To display the Output window whenever you build a project, in the General, Projects and Solutions, Options Dialog Box, select Show Output window when build starts., which is typically displayed in the Command Prompt window, is routed to an Output pane when you select the Use Output Window option in the External Tools dialog box. Many other kinds of messages can be displayed in Output panes as well. For example, when Transact-SQL syntax in a stored procedure is checked against a target database, the results are displayed in the Output window. You can also program your own applications to write diagnostic messages at run time to an Output pane. To do this, use members of the Debug class or Trace class in the System.Diagnostics namespace of the .NET Framework Class Library. Members of the Debug class display output when you build Debug configurations of your solution or project; members of the Trace class display output when you build either Debug or Release configurations. For more information, see Diagnostic Messages in the Output Window. In Visual C++, you can create custom build steps and build events whose warnings and errors are displayed and counted in the Output pane. By pressing F1 on a line of output, you can display an appropriate help topic. For more information, see Formatting the Output of a Custom Build Step or Build Event.
https://msdn.microsoft.com/en-us/library/3hk6fby3(v=vs.100).aspx
CC-MAIN-2018-05
refinedweb
263
62.27
say 1.0 supplements or replaces Python’s print statement/function, format function/method, and % string interpolation operator with simpler, higher-level facilities. For example: from say import say x = 12 nums = list(range(4)) say("There are {x} things.") say("Nums has {len(nums)} items: {nums}") yields: There are 12 things. Nums has 4 items: [0, 1, 2, 3] At this level, say is basically a simpler, nicer recasting of: from __future__ import print_function print("There are {0} things.".format(x)) print("Nums has {0} items: {1}".format(len(nums), nums)) The more items being printed, and the more complicated the format invocation, the more valuable this simple inline specification becomes. Beyond DRY, Pythonic templates that piggyback the Python’s well-proven format() method, syntax, and underlying engine, say’s virtues include: - A single output mechanism identical and compatible across Python 2.x and Python 3.x. - A companion fmt() object for string formatting. - Higher-order line formatting such as indentation and wrapping built in. - Convenient methods for common formatting items such as titles, horizontal separators, and vertical whitespace. - Super-duper template/text aggregator objects for easily building, reading, and writing multi-line texts. Take it for a test drive today! See also the full documentation at Read the Docs. - :: Libraries :: Python Modules - Package Index Owner: Jonathan.Eunice - DOAP record: say-1.0.5.xml
https://pypi.python.org/pypi/say/1.0.5
CC-MAIN-2017-04
refinedweb
226
50.63
If the reader is familiar with Paint.Net, you will notice that we cannot really write a functional AddIn without referencing Paint.Net’s library. There are data types that are only available in Paint.Net. Many CLR AddIn adopters will soon come up with the same questions how to use data types in the Host without referencing the Host (for versioning reasons). The answer is simple “CONTRACT”. Contract is the isolation boundary that calls can flow in and out. Types in Contract can be passed from Host to AddIn or vice versa. The Contract assembly should have very clearly defined for both sides to function correctly. Here is a list of things that could be used in the contract. - Other IContract - Serializable value types defined in the contract assembly - Common serializable value types in mscorlib (Not 100% guaranteed yet, don’t quote on me) - Sealed serilizable reference types in the mscorlib (Not 100% guaranteed yet, don’t quote on me) - AddInToken - Arrays of above items To enable Paint.Net support AddIn model, we need to define new Contracts. The code will look like this. namespace PaintDotNetAddInContract { [AddInContract] public interface IPDNEffectContract : IContract { void Render(IAddInRenderArgsContract dstArgs, IAddInRenderArgsContract srcArgs, Rectangle[] rois, int startIndex, int length); } public interface IAddInRenderArgsContract : IContract { IAddInSurfaceContract GetSurface(); } public interface IAddInSurfaceContract : IContract { int GetWidth(); int GetHeight(); IAddInColorBgraContract GetPointAddress(int x, int y); } public interface IAddInColorBgraContract : IContract { byte GetIntensityByte(); byte GetR(); byte GetG(); byte GetB(); byte GetA(); IAddInColorBgraContract Next(); IAddInColorBgraContract FromBgra(byte b, byte g, byte r, byte a); } } This is not a complete contract definition. The more APIs that the AddIn side need to use, the more contracts and methods we need to expose in the contract assembly. With the contract defined we can route the calls from Host to AddIn through adapters. Next topic will be about data type adapters.
https://blogs.msdn.microsoft.com/zifengh/2007/01/24/clr-addin-model-in-paint-net-10-data-type-contract/
CC-MAIN-2016-44
refinedweb
303
52.9
This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project. As demonstrated by the failures FAIL: gcc.c-torture/execute/frame-address.c execution, -O0 FAIL: gcc.c-torture/execute/frame-address.c execution, -O1 FAIL: gcc.c-torture/execute/frame-address.c execution, -O2 FAIL: gcc.c-torture/execute/frame-address.c execution, -O3 -fomit-frame-pointer FAIL: gcc.c-torture/execute/frame-address.c execution, -O3 -g FAIL: gcc.c-torture/execute/frame-address.c execution, -Os __builtin_frame_address is not functional on SPARC 64-bit because it overlooks the famous stack bias (so the returned address is not even aligned). Although expand_builtin_return_addr already uses 4 macros, this is not fixable using only this set unless DYNAMIC_CHAIN_ADDRESS is changed. Hence the need for a 5th macro, namely FRAME_ADDR_RTX. Tested on SPARC 32-bit and 64-bit. OK for mainline? 2006-10-01 Eric Botcazou <ebotcazou@libertysurf.fr> * builtins.c (expand_builtin_return_addr): Deal with FRAME_ADDR_RTX. * config/sparc/sparc.h (FRAME_ADDR_RTX): Define. * doc/tm.texi (Basic Stack Layout): Document FRAME_ADDR_RTX. -- Eric Botcazou Index: builtins.c =================================================================== --- builtins.c (revision 117300) +++ builtins.c (working copy) @@ -558,14 +558,14 @@ expand_builtin_return_addr (enum built_i #endif /* Some machines need special handling before we can access - arbitrary frames. For example, on the sparc, we must first flush + arbitrary frames. For example, on the SPARC, we must first flush all register windows to the stack. */ #ifdef SETUP_FRAME_ADDRESSES if (count > 0) SETUP_FRAME_ADDRESSES (); #endif - /* On the sparc, the return address is not in the frame, it is in a + /* On the SPARC, the return address is not in the frame, it is in a register. There is no way to access it off of the current frame pointer, but it can be accessed off the previous frame pointer by reading the value from the register window save area. */ @@ -587,12 +587,16 @@ expand_builtin_return_addr (enum built_i tem = copy_to_reg (tem); } - /* For __builtin_frame_address, return what we've got. */ + /* For __builtin_frame_address, return what we've got. But, on + the SPARC for example, we may have to add a bias. */ if (fndecl_code == BUILT_IN_FRAME_ADDRESS) +#ifdef FRAME_ADDR_RTX + return FRAME_ADDR_RTX (tem); +#else return tem; +#endif - /* For __builtin_return_address, Get the return address from that - frame. */ + /* For __builtin_return_address, get the return address from that frame. */ #ifdef RETURN_ADDR_RTX tem = RETURN_ADDR_RTX (count, tem); #else Index: config/sparc/sparc.h =================================================================== --- config/sparc/sparc.h (revision 117300) +++ config/sparc/sparc.h (working copy) @@ -1701,6 +1701,10 @@ do { \ #define DYNAMIC_CHAIN_ADDRESS(frame) \ plus_constant (frame, 14 * UNITS_PER_WORD + SPARC_STACK_BIAS) +/* Given an rtx for the frame pointer, + return an rtx for the address of the frame. */ +#define FRAME_ADDR_RTX(frame) plus_constant (frame, SPARC_STACK_BIAS) + /* The return address isn't on the stack, it is in a register, so we can't access it from the current frame pointer. We can access it from the previous frame pointer though by reading a value from the register window Index: doc/tm.texi =================================================================== --- doc/tm.texi (revision 117300) +++ doc/tm.texi (working copy) @@ -2995,6 +2995,12 @@ machines. One reason you may need to de . +@end defmac + @defmac RETURN_ADDR_RTX (@var{count}, @var{frameaddr}) A C expression whose value is RTL representing the value of the return address for the frame @var{count} steps up from the current frame, after
https://gcc.gnu.org/legacy-ml/gcc-patches/2006-10/msg00006.html
CC-MAIN-2020-16
refinedweb
533
51.14
You can federate NIS+ or NIS to a global naming service like DNS and X.500. To federate an NIS+ or NIS namespace under DNS or X.500, you first need to obtain the root reference for the NIS+ hierarchy or NIS domain. From the point of view of the global name service, the root reference is known as the next naming system reference because it refers to the next naming system beneath the DNS domain or X.500 entry. To federate NIS+ or NIS with a global name service, you add the root reference information to that global service. Once you have added the root reference information to the global service, clients outside of your NIS+ hierarchy or NIS domain can access and perform operations on the contexts in the NIS+ hierarchy or NIS domain. Foreign NIS+ clients access the hierarchy as unauthenticated NIS+ clients. For example: If NIS+ is federated underneath the DNS domain doc.com., you can now list the root of the NIS+ enterprise using the command If NIS+ is federated underneath the X.500 entry /c=us/o=doc, you can list the root of the NIS+ enterprise using the command: Note the mandatory trailing slash in both examples.
http://docs.oracle.com/cd/E19455-01/806-1387/6jam692d8/index.html
CC-MAIN-2016-44
refinedweb
204
60.04
This tutorial is part 5 of 5 in this series. Node + Express + MongoDB is a powerful tech stack for backend applications to offer CRUD operations. It gives you everything to expose an API (Express routes), to add business logic (Express middleware and logic within Express routes), and to use real data with a database (MongoDB). It's perfect for establishing a MERN (MongoDB, Express, React, Node), MEAN (MongoDB, Express, Angular, Node), or MEVN (MongoDB, Express, Vue, Node) tech stack. Everything that would be missing is the frontend application with React, Angular, Vue or something else. But that's up to another section. This section focuses first on connecting MongoDB to Express for our REST API. Previously we have set up MongoDB in our Express.js application and seeded the database with initial data, but didn't use it in Express for the RESTful API yet. Now we want to make sure that every CRUD operation going through this REST API reads or writes from/to the MongoDB database rather than using sample data as we did before for our Express routes. That's why we need to wire our Express routes to MongoDB via Mongoose to marry both worlds. In our src/index.js where we set up and start the Express application with the MongoDB database, we already have a Express middleware in place which passes the models as context to all of our Express routes. Previously, these models have been sample data. Now we are using the Mongoose models that connect us to the MongoDB MongoDB MongoDB Mongoose -- to interact with the database now. In the src/routes/session.js change the following lines of code: import { Router } from 'express';const router = Router();router.get('/', async (req, res) => {const user = await req.context.models.User.findById(req.context.me.id,);return res.send(user);});export default router; The route function becomes an asynchronous function, because we are dealing with an asynchronous request to the MongoDB MongoDB MongoDB database: import { Router } from 'express';const router = Router();router.get('/', async (req, res) => {const users = await req.context.models.User.find();return res.send(users);});router.get('/:userId', async (req, res) => {const user = await req.context.models.User.findById(req.params.userId,);return res.send(user);});export default router; The first API endpoint that fetches a list of users doesn't get any input parameters from the request. But the second API endpoint has access to the user identifier to read the correct user from the MongoDB database. Last but not least, the message routes in the src/routes/message.js file. Apart from reading messages and a single message by identifier, we also have API endpoints for creating a message and deleting a message. Both operations should lead to write operations for the MongoDB database: import { Router } from 'express';const router = Router();router.get('/', async (req, res) => {const messages = await req.context.models.Message.find();return res.send(messages);});router.get('/:messageId', async (req, res) => {const message = await req.context.models.Message.findById(req.params.messageId,);return res.send(message);});router.post('/', async (req, res) => {const message = await req.context.models.Message.create({text: req.body.text,user: req.context.me.id,});return res.send(message);});router.delete('/:messageId', async (req, res) => {const message = await req.context.models.Message.findById(req.params.messageId,);let result = null;if (message) {result = await message.remove();}return res.send(result);});export default router; There are shorter ways to accomplish the remove of a message in the database with Mongoose. However, by going this way, you make sure to trigger the database hooks which can be set up in the models. You have set up one of these hooks, a remove hook, in the src/models/user.js file previously: ...userSchema.pre('remove', function(next) {this.model('Message').deleteMany({ user: this._id }, next);});... Every time a user is deleted, this hook makes sure that all messages that belong to this user are deleted as well. That's how you don't have to deal to clean up the database properly on every delete operation of an entity. Basically that's it for connecting MongoDB to Express routes with Mongoose. All the models set up with Mongoose can be used as interface to your MongoDB database. Once a user hits your REST API, you can do read or write operations in the Express routes to your MongoDB database. Exercises - Confirm your source code - Check the source code of the alternative PostgreSQL with Sequelize implementation - Experiment with your REST API with CURL operations.
https://www.robinwieruch.de/mongodb-express-node-rest-api/
CC-MAIN-2020-05
refinedweb
756
56.55
Key Binding in Tkinter is a valuable still that will help you in creating complex GUI applications. The concept is simple. You “bind” a specific Key, or type of key to a functions that executes when that key is pressed. Form The below code demonstrates how to use almost all of the main key bindings in Tkinter. We have a small breakdown and code explanation here in this tutorial, but I do recommend you check out our Video Tutorial for Tkinter Key Bindings. In it, we recreate the below code from scratch, explaining each step in detail along the way. import tkinter as tk class MainWindow: def __init__(self, master): self.master = master self.usernames = ["Player1", "CodersLegacy", "Knight"] self.frame = tk.Frame(self.master, width = 300, height = 300) self.frame.pack() self.label = tk.Label(self.frame, text = "This is some sample text") self.label.place( x = 80, y = 20) self.button = tk.Button(self.frame, text = "Button") self.button.place( x = 120, y = 80) self.entry = tk.Entry(self.frame) self.entry.place( x = 80, y = 160) self.entry2 = tk.Entry(self.frame) self.entry2.place( x = 80, y = 200) self.bindings() def bindings(self): self.master.bind('a', lambda event: print("A was pressed")) self.frame.bind('<Enter>', lambda event: print("Entered Frame")) self.label.bind('<Button-1>', lambda event: print("Mouse clicked the label")) self.button.bind('<Enter>', lambda event: self.color_change(self.button, "green")) self.button.bind('<Leave>', lambda event: self.color_change(self.button, "black")) self.entry.bind('<Key>', lambda event: self.pass_check()) self.entry.bind('<FocusIn>', lambda event: self.Focused_entry()) self.entry.bind('<FocusOut>', lambda event: self.UnFocused_entry()) def color_change(self, widget, color): widget.config(foreground = color) def pass_check(self): text = self.entry.get() for username in self.usernames: if text == username: print("Username taken") def Focused_entry(self): print("Focused (Entered) the entry widget") def UnFocused_entry(self): print("UnFocused (Left) the entry widget") Explanation In this section, we’ll explain each of the key bindings we used in the code above. Note: The reason we use lambdas, is so that we can pass parameters into the function that gets called. The function that you pass into the second parameter of bind() should not have any brackets. Hence the lambdas is a way to work around this limitation. (This issue arises because you need a function name in bind(), not a function call. print(value) is a call, while self.master.bind('a', lambda event: print("A was pressed")) The above code will print out “A was pressed” to the screen, if the “a” key is pressed. We can bind any key in this manner, such as “b”, “c”, “1” etc. self.frame.bind('<Enter>', lambda event: print("Entered Frame")) In the above code, we print out “Entered Frame”, if the mouse cursor moves over the frame. Try running the code to see it properly. self.label.bind('<Button-1>', lambda event: print("Mouse clicked the label")) The above code will cause Tkinter to print out a message, if we click on the label with the mouse. self.button.bind('<Enter>',lambda event: self.color_change(self.button,"green")) self.button.bind('<Leave>',lambda event: self.color_change(self.button,"black")) The above code creates the hover effect. If you “enter” the button with your cursor, then it will change color to green. If to leaves the button, it will change the color back to black. self.entry.bind('<Key>', lambda event: self.pass_check()) self.entry.bind('<FocusIn>', lambda event: self.Focused_entry()) self.entry.bind('<FocusOut>', lambda event: self.UnFocused_entry()) This code has two purposes. The <Key> bind, keeps checking to see if the username already exists. Each time you enter a new key, it checks the entered username with the list of existing usernames by calling the pass_check() function. The other two bindings check to see if the entry widget is under focus or not. If you click on the Entry widget, the Focused_entry() function will call. If you select some other widget like another entry, then it will become defocused and call the UnFocused_entry() function. List of Key Bindings Here is a list of key bindings in Tkinter. Remember, you can attach these to any widget, not just the Tkinter window. Video Another really interesting use of the Key binding feature, is in this video of ours. Here we made a Syntax highlighter using the Text Widget, which relies on Key bindings to actually call the function responsible for coloring the special keywords and commands. This marks the end of the Tkinter Key Binding Tutorial. Any suggestions or contributions for CodersLegacy are more than welcome. Questions regarding the tutorial content can be asked in the comments section below.
https://coderslegacy.com/python/tkinter-key-binding/
CC-MAIN-2022-40
refinedweb
782
52.26
Opened 6 years ago Closed 4 years ago #15562 closed New feature (wontfix) include_patterns in staticfiles finder Description For completeness and also to be able to include only files like *.gif or the like, I've added include_patterns to the list() method in the staticfiles finders. I'm attaching a patch for that. Attachments (2) Change History (11) Changed 6 years ago by comment:1 Changed 6 years ago by comment:2 Changed 6 years ago by comment:3 Changed 6 years ago by comment:4 Changed 6 years ago by Closing needsinfo -- there might be an interesting idea in here, but as Jannis points out, it isn't obvious. The proposed change adds features to an undocumented private API without any obvious public benefit. Feel free to reopen and elaborate if you feel we have missed something. comment:5 Changed 6 years ago by Changed 6 years ago by Patch updated for 1.4 comment:6 Changed 6 years ago by I'll elaborate a bit about what I use this for and reopen the ticket as I believe it could be useful for other things as well and it's also elegant and brings symmetry in the code. I'm using the template system to produce my CSS files, some CSS files I keep in the database with a personalized template loader, some others are in the filesystem. Nonetheless, I also use a CSS compiler (pyScss) to process the produced CSS files. The way I use the include_patterns is in a function I call finder(), which I use to request some given template file(s) in a glob (no matter if it's in the database or the filesystem), finder() returns all the templates that match the given glob, returning the path (if available) and the storage, the same I later use to consistently open and read each file: from django.contrib.staticfiles import finders def finder(glob): for finder in finders.get_finders(): for path, storage in finder.list([], [glob]): yield path, storage comment:7 Changed 6 years ago by comment:8 Changed 4 years ago by comment:9 Changed 4 years ago by I'm sorry, but this doesn't sound like a common use case for Django, and you're using the API for something that's quite far from its goals. The finder API is currently considered private API, so can you elaborate on the use of this feature? From what I can see it isn't hooked up with any user facing feature.
https://code.djangoproject.com/ticket/15562
CC-MAIN-2017-34
refinedweb
419
63.63
25 April 2012 09:18 [Source: ICIS news] SINGAPORE (ICIS)--?xml:namespace> The fall in the industrial conglomerate’s net profit in January-March this year was “attributed to the trough in chemicals margins from the global excess supply and global demand weakness”, the company said in a statement. The company’s overall earnings before interest, tax, depreciation and amortisation (EBITDA) fell by 24% year on year to Bt10.3bn, despite an 11% growth in sales to Bt102.9bn, it said. Its overall sales were boosted by higher volume growth and higher product prices in most business units, the firm added. The net profit for its chemicals business fell by 74% year on year to Bt1.24bn in the first quarter, with EBITDA down by 82% at Bt894m, SCG said. The sales from its chemicals unit – the largest revenue generator group – rose by 9% year on year to Bt52.9bn, it said. ($1 = Bt30
http://www.icis.com/Articles/2012/04/25/9553353/thailands-scg-q1-net-profit-down-35-on-weak-chemical-margins.html
CC-MAIN-2015-11
refinedweb
154
73.78
This detail. We will see how the spaCy library can be used to perform these two tasks. Parts of Speech (POS) Tagging Parts of speech tagging simply refers to assigning parts of speech to individual words in a sentence, which means that, unlike phrase matching, which is performed at the sentence or multi-word level, parts of speech tagging is performed at the token level. Let's take a very simple example of parts of speech tagging. import spacy sp = spacy.load('en_core_web_sm') As usual, in the script above we import the core spaCy English model. Next, we need to create a spaCy document that we will be using to perform parts of speech tagging. sen = sp(u"I like to play football. I hated it in my childhood though") The spaCy document object has several attributes that can be used to perform a variety of tasks. For instance, to print the text of the document, the text attribute is used. Similarly, the pos_ attribute returns the coarse-grained POS tag. To obtain fine-grained POS tags, we could use the tag_ attribute. And finally, to get the explanation of a tag, we can use the spacy.explain() method and pass it the tag name. Let's see this in action: print(sen.text) The above script simply prints the text of the sentence. The output looks like this: I like to play football. I hated it in my childhood though Next, let's see pos_ attribute. We will print the POS tag of the word "hated", which is actually the seventh token in the sentence. print(sen[7].pos_) Output: VERB You can see that POS tag returned for "hated" is a "VERB" since "hated" is a verb. Now let's print the fine-grained POS tag for the word "hated". print(sen[7].tag_) Output: VBD To see what VBD means, we can use spacy.explain() method as shown below: print(spacy.explain(sen[7].tag_)) Output: verb, past tense The output shows that VBD is a verb in the past tense. Let's print the text, coarse-grained POS tags, fine-grained POS tags, and the explanation for the tags for all the words in the sentence. for word in sen: print(f'{word.text:{12}} {word.pos_:{10}} {word.tag_:{8}} {spacy.explain(word.tag_)}') In the script above we improve the readability and formatting by adding 12 spaces between the text and coarse-grained POS tag and then another 10 spaces between the coarse-grained POS tags and fine-grained POS tags. Output: I PRON PRP pronoun, personal like VERB VBP verb, non-3rd person singular present to PART TO infinitival to play VERB VB verb, base form football NOUN NN noun, singular or mass . PUNCT . punctuation mark, sentence closer I PRON PRP pronoun, personal hated VERB VBD verb, past tense it PRON PRP pronoun, personal in ADP IN conjunction, subordinating or preposition my ADJ PRP$ pronoun, possessive childhood NOUN NN noun, singular or mass though ADP IN conjunction, subordinating or preposition A complete tag list for the parts of speech and the fine-grained tags, along with their explanation, is available at spaCy official documentation. Why POS Tagging is Useful? POS tagging can be really useful, particularly if you have words or tokens that can have multiple POS tags. For instance, the word "google" can be used as both a noun and verb, depending upon the context. While processing natural language, it is important to identify this difference. Fortunately, the spaCy library comes pre-built with machine learning algorithms that, depending upon the context (surrounding words), it is capable of returning the correct POS tag for the word. Let's see this in action. Execute the following script: sen = sp(u'Can you google it?') word = sen[2] print(f'{word.text:{12}} {word.pos_:{10}} {word.tag_:{8}} {spacy.explain(word.tag_)}') In the script above we create spaCy document with the text "Can you google it?" Here the word "google" is being used as a verb. Next, we print the POS tag for the word "google" along with the explanation of the tag. The output looks like this: google VERB VB verb, base form From the output, you can see that the word "google" has been correctly identified as a verb. Let's now see another example: sen = sp(u'Can you search it on google?') word = sen[5] print(f'{word.text:{12}} {word.pos_:{10}} {word.tag_:{8}} {spacy.explain(word.tag_)}') Here in the above script the word "google" is being used as a noun as shown by the output: google PROPN NNP noun, proper singular Finding the Number of POS Tags You can find the number of occurrences of each POS tag by calling the count_by on the spaCy document object. The method takes spacy.attrs.POS as a parameter value. sen = sp(u"I like to play football. I hated it in my childhood though") num_pos = sen.count_by(spacy.attrs.POS) num_pos Output: {96: 1, 99: 3, 84: 2, 83: 1, 91: 2, 93: 1, 94: 3} In the output, you can see the ID of the POS tags along with their frequencies of occurrence. The text of the POS tag can be displayed by passing the ID of the tag to the vocabulary of the actual spaCy document. for k,v in sorted(num_pos.items()): print(f'{k}. {sen.vocab[k].text:{8}}: {v}') Now in the output, you will see the ID, the text, and the frequency of each tag as shown below: 83. ADJ : 1 84. ADP : 2 91. NOUN : 2 93. PART : 1 94. PRON : 3 96. PUNCT : 1 99. VERB : 3 Visualizing Parts of Speech Tags Visualizing POS tags in a graphical way is extremely easy. The displacy module from the spacy library is used for this purpose. To visualize the POS tags inside the Jupyter notebook, you need to call the render method from the displacy module and pass it the spacy document, the style of the visualization, and set the jupyter attribute to True as shown below: from spacy import displacy sen = sp(u"I like to play football. I hated it in my childhood though") displacy.render(sen, style='dep', jupyter=True, options={'distance': 85}) In the output, you should see the following dependency tree for POS tags. You can clearly see the dependency of each token on another along with the POS tag. If you want to visualize the POS tags outside the Jupyter notebook, then you need to call the serve method. The plot for POS tags will be printed in the HTML form inside your default browser. Execute the following script: displacy.serve(sen, style='dep', options={'distance': 120}) Once you execute the above script, you will see the following message: Serving on port 5000... Using the 'dep' visualizer To view the dependency tree, type the following address in your browser:. You will see the following dependency tree: Named Entity Recognition Named entity recognition refers to the identification of words in a sentence as an entity e.g. the name of a person, place, organization, etc. Let's see how the spaCy library performs named entity recognition. Look at the following script: import spacy sp = spacy.load('en_core_web_sm') sen = sp(u'Manchester United is looking to sign Harry Kane for $90 million') In the script above we created a simple spaCy document with some text. To find the named entity we can use the ents attribute, which returns the list of all the named entities in the document. print(sen.ents) Output: (Manchester United, Harry Kane, $90 million) You can see that three named entities were identified. To see the detail of each named entity, you can use the text, label, and the spacy.explain method which takes the entity object as a parameter. for entity in sen.ents: print(entity.text + ' - ' + entity.label_ + ' - ' + str(spacy.explain(entity.label_))) In the output, you will see the name of the entity along with the entity type and a small description of the entity as shown below: Manchester United - ORG - Companies, agencies, institutions, etc. Harry Kane - PERSON - People, including fictional $90 million - MONEY - Monetary values, including unit You can see that "Manchester United" has been correctly identified as an organization, company, etc. Similarly, "Harry Kane" has been identified as a person and finally, "$90 million" has been correctly identified as an entity of type Money. Adding New Entities You can also add new entities to an existing document. For instance in the following example, "Nesfruita" is not identified as a company by the spaCy library. sen = sp(u'Nesfruita is setting up a new company in India') for entity in sen.ents: print(entity.text + ' - ' + entity.label_ + ' - ' + str(spacy.explain(entity.label_))) Output: India - GPE - Countries, cities, states From the output, you can see that only India has been identified as an entity. Now to add "Nesfruita" as an entity of type "ORG" to our document, we need to execute the following steps: from spacy.tokens import Span ORG = sen.vocab.strings[u'ORG'] new_entity = Span(sen, 0, 1, label=ORG) sen.ents = list(sen.ents) + [new_entity] First, we need to import the Span class from the spacy.tokens module. Next, we need to get the hash value of the ORG entity type from our document. After that, we need to assign the hash value of ORG to the span. Since "Nesfruita" is the first word in the document, the span is 0-1. Finally, we need to add the new entity span to the list of entities. Now if you execute the following script, you will see "Nesfruita" in the list of entities. for entity in sen.ents: print(entity.text + ' - ' + entity.label_ + ' - ' + str(spacy.explain(entity.label_))) The output of the script above looks like this: Nesfruita - ORG - Companies, agencies, institutions, etc. India - GPE - Countries, cities, states Counting Entities In the case of POS tags, we could count the frequency of each POS tag in a document using a special method sen.count_by. However, for named entities, no such method exists. We can manually count the frequency of each entity type. Suppose we have the following document along with its entities: sen = sp(u'Manchester United is looking to sign Harry Kane for $90 million. David demand 100 Million Dollars') for entity in sen.ents: print(entity.text + ' - ' + entity.label_ + ' - ' + str(spacy.explain(entity.label_))) Output: Manchester United - ORG - Companies, agencies, institutions, etc. Harry Kane - PERSON - People, including fictional $90 million - MONEY - Monetary values, including unit David - PERSON - People, including fictional 100 Million Dollars - MONEY - Monetary values, including unit To count the person type entities in the above document, we can use the following script: len([ent for ent in sen.ents if ent.label_=='PERSON']) In the output, you will see 2 since there are 2 entities of type PERSON in the document. Visualizing Named Entities Like the POS tags, we can also view named entities inside the Jupyter notebook as well as in the browser. To do so, we will again use the displacy object. Look at the following example: from spacy import displacy sen = sp(u'Manchester United is looking to sign Harry Kane for $90 million. David demand 100 Million Dollars') displacy.render(sen, style='ent', jupyter=True) You can see that the only difference between visualizing named entities and POS tags is that here in case of named entities we passed ent as the value for the style parameter. The output of the script above looks like this: You can see from the output that the named entities have been highlighted in different colors along with their entity types. You can also filter which entity types to display. To do so, you need to pass the type of the entities to display in a list, which is then passed as a value to the ents key of a dictionary. The dictionary is then passed to the options parameter of the render method of the displacy module as shown below: filter = {'ents': ['ORG']} displacy.render(sen, style='ent', jupyter=True, options=filter) In the script above, we specified that only the entities of type ORG should be displayed in the output. The output of the script above looks like this: Finally, you can also display named entities outside the Jupyter notebook. The following script will display the named entities in your default browser. Execute the following script: displacy.serve(sen, style='ent') Now if you go to the address in your browser, you should see the named entities. Conclusion Parts of speech tagging and named entity recognition are crucial to the success of any NLP task. In this article, we saw how Python's spaCy library can be used to perform POS tagging and named entity recognition with the help of different examples.
https://stackabuse.com/python-for-nlp-parts-of-speech-tagging-and-named-entity-recognition/
CC-MAIN-2019-43
refinedweb
2,141
63.49
Talk:Pacman/Package signing. —This unsigned comment is by Myshkin (talk) 11:15, 10 October 2012. Please sign your posts with ~~~~! Web of Trust - [Moved from Talk:PacmanWoT -- Alad (talk) 15:21, 2 October 2015 (UTC)] Now we have three articles describing the "Web of trust": the (outdated) DeveloperWiki:Package_signing, pacman-key, and PacmanWoT. As Developer is a separate namespace (which seems largely abandoned), I've added a merge request with pacman-key. -- Alad (talk) 03:39, 1 September 2014 (UTC) - I didn't want to pollute more "stable" pages with what I got from the board discussion until people had a chance to make sure I wasn't entirely off-base. I agree it can be merged, as long as some of the "higher-level" (why?) discussion doesn't completely get mixed up with the command-level discussion. Jernst (talk) 17:02, 1 September 2014 (UTC) - Yes, pacman-key and PacmanWoT must be unconditionally merged soon, before more work is done on this page: if there are specific ideas to improve the structure of pacman-key, they are very welcome in Talk:pacman-key. - We may also take the chance to use a better title, like pacman web of trust, Arch web of trust, Arch Linux web of trust... (share more ideas if you have some): "pacman-key" doesn't represent well the intended scope of the article, while "PacmanWoT" is a compressed/abbreviated form which is not appropriate at all on the wiki; we may also discuss the capitalization of "web of trust", which is found also as "Web of Trust" (and with the "WOT" and "WoT" acronyms). - -- Kynikos (talk) 15:06, 2 September 2014 (UTC) - I have removed some content which is already described in pacman-key. To complete the merge: - PacmanWoT#Outline of implementation is already covered by pacman-key, but it mentions that the initialization should be done also after installation, which is not mentioned in neither Installation guide, Beginners' guide and General recommendations. - Is it necessary to transfer PacmanWoT#FAQ at all? It is all about understanding the web of trust (linked from pacman-key#Introduction) and forums are here exactly for the purpose of asking questions... - I take it that pacman-key should be moved to the better, yet-unknown title? What about pacman/Package signing? - -- Lahwaacz (talk) 15:28, 10 September 2014 (UTC) - +1 to a subpage. PacmanWoT#Outline of implementation, this is not needed: it is run on pacstrap, see [1]. Re FAQ, I've moved the section and this discussion to Talk:pacman-key#FAQ. -- Alad (talk) 15:19, 2 October 2015 (UTC) - Moved to pacman/Package signing. -- Alad (talk) 15:29, 15 October 2015 (UTC) - Couldn't the initial WoT be pre-generated as part of some package, so the pacman-keycommands (which include the relatively expensive generation of a gpg key pair) won't have to be executed when the system boots? - No. To pre-generate them, all Arch installations would have to end up with the same gpg key pair. That would enable malicious Arch user Alice (who has access to the same private key as victim Bob does) to sign a malicious package that Bob's pacman would accept because the Bob necessarily must trust his root key pair. (See also discussion on this post.) - Why do we need a root key pair at all? Can't Arch just simply install the public keys of the maintainers in some directory? - Actually, Arch does have the public keys of the maintainers in a gpg keyring in /usr/share/pacman/keyrings(part of package archlinux-keyring). If pacman uses gpg's Web of Trust mechanism, that means those public keys must be signed; otherwise some other WoT implementation would have to be used.
https://wiki.archlinux.org/index.php/Talk:Pacman-key
CC-MAIN-2017-04
refinedweb
625
59.33
Hi, <?xml:namespace prefix = o I’m using Aspose.Cells to create bill of materials extracts. Therefore, a user chooses a list of relevant columns. Based on these details the system creates a table header and writes all entries of the choosen bom. To populate each cell with an appropriate value I’m using the Cells.PutValue() method (ws.Cells[zeile, spalte].PutValue(wert);). On the basis of the resulting file, a user try’s do set data filters. If you open the filter menu on a date column, you can pick each distinct date from a list. If I create a new excel file and enter some dates, I’m able to filter the date in a more hierarchical way (Year-Month-Day). How can I achieve this behavior in Aspose.Cells. Thanks in advance Erik
https://forum.aspose.com/t/date-autofilter-excel/110640
CC-MAIN-2022-40
refinedweb
137
68.57
#include <stdint.h> #include <avr/io.h> #include <util/delay.h> Go to the source code of this file. SPI access. read a single byte from SPI Write byte b to SPI, return byte read write a single byte to SPI Write a single byte to SPI without waiting for completion control of SS Control SPI SS line. When selecting it is assumed that no transmission was ongoing. When deselecting the function waits for the last transmission to complete. { if (!ss_enable) /* when selecting, we expect the previous transmission to * be complete (we already waited at de-select time) */ while (0 && !(SPSR & _BV(SPIF))); if (ss_enable) { PORT_SPI &= ~_BV(PORT_SPI_SS); } else PORT_SPI |= _BV(PORT_SPI_SS); } initialize SPI interface set SPI speed divider transfer one byte via SPI it is expected that wait and read are constants so the compiler can optimize out the loop and the register read when not needed { uint8_t spsr; SPDR = b; if (wait && (spsr = SPSR) & _BV(WCOL)) { /* after write collision just wait for SPIF */ while (!(spsr & _BV(SPIF))) spsr = SPSR; SPDR = b; } /* at this point, we started the transfer */ if (read) { /* wait for completion */ if (!wait) spsr = SPSR; while (!(spsr & _BV(SPIF))) spsr = SPSR; return SPDR; } else { /* we don't care when the transfer finishes */ return 0xff; } }
http://doc.explorerspal.org/spi_8h.html
CC-MAIN-2022-27
refinedweb
208
61.97
Currently --disable-xlib-xrender only causes the cflags/libs for xrender to not be included. This makes the code not build, not surprisingly. We need to #if/endif out the xrender stuff in cairo-xlib-*.c, to allow building without xrender. Donno how hard that change is. (In reply to comment #0) > Currently --disable-xlib-xrender only causes the cflags/libs for xrender to not > be included. Side-effect number 2: Calls to XRender*-functions are bound into the libs, so when the next application tries to ./configure against cairo (ex. pango) configure fails. Not because cairo ain't installed, but because Xrender-functions don't link. ---------------- rrrrrrrrrrrrrrrrrrip -------------- config log of pango looks like this: configure:21412: checking for CAIRO configure:21420: $PKG_CONFIG --exists --print-errors "cairo >= 1.2.2" configure:21423: $? = 0 configure:21438: $PKG_CONFIG --exists --print-errors "cairo >= 1.2.2" configure:21441: $? = 0 configure:21475: result: yes configure:21487: checking for cairo_surface_write_to_png in -lcairo configure:21517: gcc -o conftest -g -O2 -Wall -L/package/gpe/lib -lcairo conftest.c -lcairo >&5 /package/gpe/lib/libcairo.so: undefined reference to `XRenderQueryExtension' /package/gpe/lib/libcairo.so: undefined reference to `XRenderFreePicture' [...] collect2: ld returned 1 exit status configure:21523: $? = 1 configure: failed program was: | /* confdefs.h. */ [...] ---------------- rrrrrrrrrrrrrrrrrrip -------------- probably out-deffing will help as suggested. cheers, Peter I'm getting bitten by this when trying to compile cairo (both 1.2.x and 1.4.x) on AIX 5.3 which doesn't have Xrender. configure correctly understands the situation: Xlib: yes Xlib Xrender: no (requires Xrender However, the build fails on cairo-xlib-surface.c. It includes cairo-xlib-xrender.h which tries to include Xrender.h, which of course fails. It would be nice if the code could be fixed to follow what configure says. From what I have gathered the thing should work without Xrender, it's just that the code always gets compiled in... I'm rather unclued on what needs changing though, so I've been unable to whip up a patch for it. At the very least, fix configure to disable the xlib-stuff altogether if it doesn't find xrender, if that's the recommended workaround. This is still present with cairo 1.4.10 on Solaris 8 (there is no X11/extensions/Xrender.h). It does compile with --disable-xlib. Just using --disable-xlib-xrender behaves as described here. Fixed now in git master. Should go in 1.6 Created attachment 13712 [details] [review] Fixup ./configure --disable-xlib-xrender Hmm, make check is failing with ./configure --disable-xlib-xrender (cairo_xlib_surface_create_with_xrender_format() still remains in the public API and the boilerplate code needs fixup as well). Most of the patch resolves around removing the indirect «#include "cairoint.h"» from the boilerplate code, I think the most contentious chunk is the change in the public API (cairo-xlib-xrender.h) to use CAIRO_HAS_XLIB_XRENDER_SURFACE instead of CAIRO_HAS_XLIB_SURFACE. Looks good. Please push Chris. Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
https://bugs.freedesktop.org/show_bug.cgi?id=7424
CC-MAIN-2022-21
refinedweb
512
62.14
NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab. Microcontroller Programming » Wrong results on Screen (Using arrays): NaN Now... I'm well familiar with C/C++ programming, but this is too weird, I guess it is avr-gcc specific data types problem? Consider the following: int main(){ float temps[7][2] = { {19.9,0.0 }, {20.0,21.9}, {22.0,23.9}, {24.0,26.9}, {27.0,28.9}, {29.0,29.9}, {30.0,0.0 } }; for(i=0; i<7; i++){ for(j=0; j<2; j++){ fprintf_P(&lcd_stream, PSTR("%.2f,"), temps[i][j] ); } } } I get on my screen: NaN,NaN,NaN,NaN,NaN,NaN...etc but when I do this: fprintf_P(&lcd_stream, PSTR("%.2f,"), temps[0][0] ); fprintf_P(&lcd_stream, PSTR("%.2f,"), temps[0][1] ); ... ... fprintf_P(&lcd_stream, PSTR("%.2f,"), temps[6][1] ) it does print the data on the screen.. what gives?! :-) Hi Shanytc, The problem you are experiencing stems from a quirk in embedded programming regarding statically initialized arrays. There is a pretty good discussion about it in this thread. The basic issue is that an MCU is not like a computer, on a computer both the program and the local variables on the stack are held on RAM. On an MCU there is a separate memory space for the program (flash) and your stack and heap (RAM). You need to explicitly put your static arrays in the flash memory space and read from them by using PROGMEM. Or you can just build the array element by element in RAM using local variables. Why it works as expected in the second case you described is actually a neat problem. It shouldn't work. I'm going to give you and others a little bit to think about it. See if you can come up with the answer. Humberto (I don't mean to side-track the discussion, but saying the MCU is not like a computer seems a bit misleading. It absolutely is a computer. It's just this kind of computer instead of this kind.) Back on track--a third option which that thread mentions (instead of PROGMEM or using local variables) is to make sure the array data actually makes it into RAM in the first place, by adding "-j .data" to the avr-objcopy command in the makefile. But RAM is a much more limited commodity on Atmegas, and the compiler will add code to copy the array from program memory to data memory during initialization, so your array actually ends up in program memory AND data memory. So avoiding PROGMEM doesn't buy you much unless the values in the array will be changing during program execution. Humberto, Thanks. Well, I guess, at compile the address of temps[0][0] is known, and since the .data (if i'm correct) is also included during compile time (linker adds the address) than jumping to the .data section where the initialized array reside can be done. However, when using temps[i][j], there is no known address using compile time, the MCU will just try to access &temps array but its address is unknown during run time. I have tried: float temps[7][2] PROGMEM = { {19.9,0.0 }, {20.0,21.9}, {22.0,23.9}, {24.0,26.9}, {27.0,28.9}, {29.0,29.9}, {30.0,0.0 } }; However that did not work either. adding the -j .data switch to the avr-objcopy, did do the trick in the end. Ooops, I was trying to discourage -j .data. :-) In addition to PROGMEM you have to use pgm_read_float(&temps[i][j]) to get the data back out of the array. Yep, you got the right idea. You were seeing the behaviour when you hard coded the numbers because of a compiler optimization. When you hard coded temps[0][0], at compile time the compiler knows what that value is. Since it sees that it is a local variable, and doesn't see it changing within the function, it just relpaces temps[0][0] with 19.9. So in the compiled code there was no lookup into the array, it just fprintf_P(&lcd_stream, PSTR("%.2f,"), 19.9 ); It is always a good thing to keep in mind that the compilers can take some freedoms while optimizing your code, and while they do a great job most of the time it can sometimes lead to some unexpected results. I would also like to echo bretm's point. In an environment where memory is scarce you want to be aware of where your data is and where you are pulling it from. Explicitly using PROGMEM nad pgm_read good practice. Happy coding! I look forward to reading more about your projects on the forums. Humberto, Yeah everything is looking good now, however, it seems that when defining as a global (outside the main() ) as all PROGMEM variables should, they automatically become CONSTANTS ??? that means I can't change their values?! eh? #include <avr/pgmspace.h> double temps [7][2] PROGMEM = { {0.0 ,19.9}, {20.0,21.9}, {22.0,23.9}, {24.0,26.9}, {27.0,28.9}, {29.0,29.9}, {0.0 ,30.0 } }; in main(){ int select=1; double x; x=pgm_read_float(&(temps[(select-1)][0])); // works great! *(&(temps[(select-1)][1]))+=0.1; // **this for some reason hangs the cpu** } I don't remember reading in the docs () that global progmem variables become const PROGMEM data is stored in Flash memory which is only updatable a page at a time, and only a limited number of times (at least 10,000). The compiler does not generate any code to write to it, and pgmspace.h only contains read functions. If you want to update memory frequently you need to use SRAM, and use "-j .data", and omit PROGMEM, and don't use pgm_read_xxxx. SRAM can be updated a byte at a time and an unlimited number of times. Thanks bretm, I guess than that there isn't much use for a PROGMEM array if it can't be written to it normally :-) The best would to create a local array and copy from the PROGREM array into the local array for the first initialization (in case those bytes never change). that seems to be working just fine! You don't have to write any extra code to copy from Flash to SRAM on initialization. The compiler automatically includes the code to do that if you don't use PROGMEM. You just have to use "-j .data" to get it into the .hex file first. There are many cases where you want read-only arrays. For example, the font data that turns characters into shapes for the LED scroller project, or sound samples, or conversion tables that would be too slow to calculate at run-time, etc. I know there is something simple I'm missing here. I declare a variable like this int lookup[5][4] PROGMEM = { {0,0,512,1024}, {0,30,60,90}, {500,50,80,110}, {1500,70,100,130}, {2000,90,115,170} and I was trying to call it with something like this lookupvalue = pgm_read_float(&(lookup[row][col])); nothing returns that is correct or useful. I have tried removing -j .text as well as adding -j .text -j .data before I go creating a headache for myself and changing more I thought I'd let someone else try to line me out. You are using pgm_read_float which expects the address of a float. You have an array with int values so you need pgm_read_word or whatever the correct funtion is for two-byte integers. thanks bretm! Please log in to post a reply.
http://www.nerdkits.com/forum/thread/610/
CC-MAIN-2020-29
refinedweb
1,288
73.07
iPcNeuralNet Struct Reference A property class implementing a feed-forward neural network. More... #include <propclass/neuralnet.h> Detailed Description A property class implementing a feed-forward neural network. The property class holds the following properties (add prefix "cel.property." to get a property ID): - "inputs" (long) The number of inputs in the neural network. - "outputs" (long) The number of outputs in the neural network. - "layers" (long) The number of hidden layers in the neural network. - "dispatch" (bool) If true, pcneuralnet_outputs messages will be sent. And the following actions (add prefix "cel.action." or "cel.parameter." to get the ID of an action or parameter respectively): - "SetComplexity" Sets the method to use to set the sizes of the layers. Add prefix "cel.complexity." to the heuristic name to get the param. - "SetLayerSizes" Instead of SetComplexity, this sets the sizes of the layers manually. Parameters: "layer0"..."layerN" (longs). - "SetActivationFunc" Sets the activation function in the neural network. Parameter: "func" (string). See iCelNNActivationFunc and its subclasses. This also sets the datatype of the inputs and outputs. - "SetInputs" Sets the values of the inputs. Parameters: "input0"..."inputN" the values (N = "cel.property.inputs" - 1). - "Process" Runs one iteration through the neural network, reading the inputs and setting the outputs. May send "pcneuralnet_outputs" message. - "SaveCache" Saves the weightings to VFS path /cellib/cache/pcneuralnet. Parameters: "scope" (string), "id" (long). See iCacheManager in CS. - "LoadCache" Loads the weightings from VFS path /cellib/cache/pcneuralnet. Parameters: "scope" (string), "id" (long). See iCacheManager in CS. And can send the following message to the behaviour: - "pcneuralnet_outputs" Sent after every call to "cel.action.process". Parameters: "output0"..."outputN" the output values from the neural network (N - "cel.property.outputs" - 1). Definition at line 96 of file neuralnet.h. Member Function Documentation Saves the weightings to cache with an iCacheManager. Returns a new weights structure with the same size as the current one. Returns the value of one of the outputs. Retrieves all the output values in one go. Copies the weightings of the neural network into the structure provided. Loads the weightings from cache with an iCacheManager. Runs one iteration through the network, reading the inputs and setting the outputs. Sets the activation function of the neural network. Sets the heuristic that will be used to set the sizes of each layer. Alternatively you can call SetLayerSizes to set the sizes manually. Acceptable values for the name parameter are: - "linear" (default) sizes progress linearly from inputs to outputs. - "halfLinear" like linear but first layer is 50% of the number of inputs. - "addHalfLinear" line linear but first layer is 150% the number of inputs. Sets the value of one of the inputs. Sets all the input values in one go. Manually set the number of nodes in each hidden layer. Alternatively you can call SetComplexity to have the sizes set automatically according to the selected heuristic. Sets the size of the neural network (number of inputs, outputs and hidden layers). Copies the weightings into the neural network from the given structure. Returns true if the neural network is initialized and ready to use. If it is not, then an attempt is made to initialize it, and the return value signifies success or failure of that attempt. The documentation for this struct was generated from the following file: - propclass/neuralnet.h Generated for CEL: Crystal Entity Layer 1.4.1 by doxygen 1.7.1
http://crystalspace3d.org/cel/docs/online/api-1.4.1/structiPcNeuralNet.html
CC-MAIN-2015-18
refinedweb
563
52.76
How do you assign an image dynamically? This Article Covers Win Development Resources I am a user control developer. I use the ToolBoxBitMap attribute to assign an image to my control. But all the examples need hard coding of the image path. This is creating problems if the user deploys the DLL to a different location. Could you please tell me how to assign the image dynamically? I am using VB.NET. Instead of assigning the toolbox bitmap manually, simply do the. - Rename the bitmap to the same first name as the control. - Add the toolbar bitmap to the solution. - Select the bitmap in the solution. - In the bitmap properties, set the Build Action to Embedded Resource. - In the bitmap properties, set the Custom Tool Namespace to the same namespace your control uses. Visual Studio .NET will automatically find the bitmap when you add your control to the toolbox.
http://searchwindevelopment.techtarget.com/answer/How-do-you-assign-an-image-dynamically
CC-MAIN-2017-34
refinedweb
149
60.72
Redux: Refactoring the Reducers We will learn how to remove the duplication in our reducer files and how to keep the knowledge about the state shape colocated with the newly extracted reducers. We will learn how to remove the duplication in our reducer files and how to keep the knowledge about the state shape colocated with the newly extracted reducers. Access all courses and lessons, track your progress, gain confidence and expertise. Earlier, we removed the visibility filter reducer, and so the root reducer in the app now combines only a single todos reducer. Since index.js acts effectively as a proxy to the todos reducer, I will just remove index.js completely, and I will rename todos.js to index.js, thereby making the todos my new root reducer. The root reducer file now contains ById, all IDs, active IDs, and completed IDs, and I'm going to extract some of them into separate files. I'm starting with ById reducer, and I'm creating the file called ById.js, where I paste this reducer and export it as a default export. I'm also adding a named export for a selector called get todo, that takes the state and ID, where the state corresponds to the state of ById reducer. Now I'm going back to my index.js file, and I can import the reducer as a default import, and I can import any associated selectors in a single object with a namespace import. If we take a look at the reducers managing the IDs, we will notice that their code is almost exactly the same except for the filter value which they compare action filter to. I will create a new function called create list that takes filter as an argument. It returns another function, a reducer that handles the IDs for the specified filter, so its state shape is an array, and I can copy-paste the implementation from all IDs. I just need to change the all literal here to the filter argument to the create list function, so that we can create it for any filter. Now I can remove the all IDs, active IDs, and completed IDs reducer code completely. Instead, I will generate the reducers using the new create list function I wrote, and passing the filter as an argument to it. Next, I will extract the create list function into a separate file, just like I extracted the ById reducer. I added a new file called create list. I pasted my create list function there, and I will export it as a default export. Now that it's in a separate file, I'm adding a public API for accessing the state in form of a selector. That is called get IDs, and for now, it just returns the state of the list, but this may change in the future. Now I will go back to my index.js file, and I will import create list just like I usually import reducers, and I will import any named selectors from this file, as well. I'm renaming the IDs by filter reducer to list by filter, because now that the list implementation is in a separate file, I'll consider its state structure to be opaque, and to get the list of IDs, I will use the get IDs selector that it exports. Since I also moved the ById reducer into a separate file, I also don't want to make an assumption that it's just a lookup table, and I will use from ById, get todo selector that it exports and pass its state and the corresponding ID. This lets me change the state shape of any reducer in the future without rippling changes across the code base. Let's recap how we refactored the reducers. First of all, the todos reducer is now the root reducer of the application, and its file has been renamed to index.js. We extracted the ById reducer into a separate file. The ById reducer is now declared here, and it is exported from this module as a default export. To encapsulate the knowledge about the state shape in this file, we export a new selector that just gets the todo by its ID from the lookup table. We also created a new function called create list that we use to generate the reducers, managing the lists of fetched todos for any given filter. Inside createlist.js, we have a create list function that takes filter as an argument, and it returns a reducer that manages the fetched IDs for this filter. The generated reducers will handle the received todos action, but they will keep any action that has the filter different from the one they were created with. Create list is the default export from this file, but we also export a selector that gets the IDs from the current state. Right now, the IDs are the current state, but we are free to change this in the future. In index.js, we use the namespace import syntax to grab all selectors from the corresponding file into an object. The list by filter reducer combines the reducers generated by create list, and it uses the filters as the keys. Because list by filter is defined in this file, the get visible todo selector can make assumptions about its state shape and access it directly. However, the implementation of create list is in a separate file, so this is why it uses the from list get ID selector to get the IDs from it. Now that we have the IDs, we want to map them to the todos inside the state by ID. But now that it's in a separate file, rather than reach into it directly, we use the selector that it exports to access the inaudible todo. Redux does not enforce that you encapsulate the knowledge about the state shape in particular reducer files. However, it's a nice pattern, because it lets you change the state that is stored by reducers without having to change your components or your tests if you use selectors together with reducers in your tests.
https://egghead.io/lessons/javascript-redux-refactoring-the-reducers
CC-MAIN-2019-51
refinedweb
1,032
67.08
Summary: Chris Whitehead, Microsoft Certified Master (SharePoint 2010) and Premier Field Engineer based in the UK provides us with pointers to the best content and additional information that IT Pros need which is not well documented in one place. It serves as an end-to-end guide and reference point to all the information you need in order to configure SharePoint on-premise deployments for Apps. A great and comprehensive read. Enjoy! So now that you know what SharePoint Apps are, you will likely want to configure your own on-premises deployment(s) to provide support for Apps. Of course if you are using Office 365, a lot of this is already done for you. There are a number of configuration steps that you’ll need to complete, along with a number of additional considerations to be aware of. This article will speak through these. Configuration Steps for Deploying SharePoint Apps Rather than provide a step-by-step guide for each of these steps (and repeat much of TechNet and what is already blogged about out there), I am going to provide you with pointers to the best content and additional information that you may need which is not well documented in one place. This will hopefully serve as an end-to-end guide and reference point to all the information you need in order to configure SharePoint on-premises deployments for Apps. Infrastructure Configuration Part 1 of this post covered the architectural design decisions implemented in SharePoint 2013 to support Apps, and ensure that each App instance is self-contained with a unique URL in order to enforce isolation and prevent cross domain JavaScript calls through same origin policy in Web browsers. It also covered the format of this URL. As a reminder, the App domain shown in red below is the domain name portion of the URL that we must configure along with the App Prefix (shown in orange): Determine your App Domain One App domain is used per farm and, once configured in DNS, it is configured in the App Settings for the farm. When choosing your App domain for each farm, you have 2 options: - Create a new unique domain to host your SharePoint-hosted Apps in, or - Create a sub-domain of the existing domain. The recommendation is to create a new unique domain such as contosoapps.com rather than a sub-domain such as apps.contoso.com. The reason for this is that use of a sub-domain could lead to cookie attacks (depending on the browser in use) on other non-SharePoint Web based applications in the same domain namespace. A malicious SharePoint App developer could write an App that could read or set cookies across other websites such as a PHP site hosted at portal.contoso.com, provided the developer of that site hasn’t protected the cookies correctly. Therefore the recommendation to create a new unique domain is a ‘belt and braces’ approach to prevent other websites from potentially being attacked by using a SharePoint App as the attack vector. If you have audited all other websites in the domain and are happy that they are suitably secure, then you may choose to take the sub-domain approach. Configure domain name in DNS Once you have determined your App domain, it will need creating in DNS (obviously if your farm is externally facing, you will also need to purchase and register this domain name). Since all App webs have a unique host name (App prefix and App ID above), a wildcard DNS entry is required. Without this, you would need a new entry in DNS for every App instance, this would not scale and is not a feasible solution. There is also no way of determining what the App ID would be in advance of creating an App. Create a new wildcard SSL certificate Further to this, you will of course need a wildcard SSL certificate for your app domain if you are using SSL for your SharePoint environment. Which of course you should be, especially when implementing Apps since OAuth access tokens for Apps will be in plain text otherwise and could be replayed by a malicious user or code. If you have multiple farms that you would like to configure to host and consume Apps, then yes you will need to do this for each one, along with all the steps below. Farm Configuration Before you can use Apps in your farm, you will need to complete some farm configuration steps, the first of which is creating Subscription Settings and App Management service applications, and enabling the relevant services. Create SharePoint Service Applications and enable services The Subscription Settings service application is historically only relevant for multi-tenancy scenarios, but it is a prerequisite when implementing Apps because it is used to generate and keep track of the App IDs (shown in green above). The internals of how this is generated is not important, but without this service application, the steps required to generate these App IDs cannot occur. The App Management service application is largely responsible for licensing information, for example its database is accessed each time an app is used to verify the validity of the request. One key thing to note is that both service applications must be in the same service application proxy group, otherwise the Apps infrastructure will fail to work. Configure App settings in SharePoint Finally, you must configure some App settings in Central Administration or via Windows PowerShell cmdlets. These include specifying the App prefix and App domain for the farm; specifying the location of the App Catalog, which is the site used to distribute Apps in our environment; and configuring Store settings such as whether users can install Apps from the Office Marketplace. Note: TechNet has a good article on configuring all of the above: Configure an environment for apps for SharePoint (SharePoint 2013). Mirjam van Olst also has a step-by-step guide on her blog here: Setting up your App domain for SharePoint 2013. Additional Considerations There are of course a number of key additional considerations that you should be aware of when it comes to SharePoint Apps: Note: A few of these additional considerations are extrapolated from Steve Peschka’s post here: Planning the Infrastructure Required for the new App Model in SharePoint 2013 and simplified for the sake of this post, go take a look if you need more context and detail. - Apps do not support Kerberos – since each App runs in its own isolated domain, for Kerberos to work we would need to configure SPNs for every App – which is not feasible! Therefore even with Kerberos enabled for your Web Applications, SharePoint Apps rely on being able to fall back to NTLM. - SharePoint-hosted Apps do not support SAML auth – currently SharePoint-hosted Apps will not be redirected to correctly when using SAML auth. This is because most identity providers (ADFS 2.0 included), do not support wildcards for return URLs – which would be needed due to the isolated domain model implemented for SharePoint-hosted Apps. However, Azure hosted, or provider-hosted Apps will work when SharePoint is configured to use SAML auth – but there is some configuration required, which Steve Peschka covers off in quite some detail here: Using SharePoint Apps with SAML and FBA Sites in SharePoint 2013. - Apps do not support multiple zones – all requests will only ever be served out of the default zone. If you need multiple URLs for SharePoint, you should consider using host header site collections with multiples URLs – a new feature in SharePoint 2013 – rather than multiple zones and Alternate Access Mappings (AAMs). Check out the Set-SPSiteUrl cmdlet for more detail. - A routing Web Application may be needed – imagine the multiple Web application scenario and remember that we have 1 App domain per farm. If we install Apps in each Web application, bearing in mind the separate App domain that will host App Webs for these Apps, how is the request to our App Web going to be routed to the correct hosting Web application? How does SharePoint differentiate between an instance of an App Web that lives in the ‘my sites’ Web application, and an instance that lives in the ‘intranet’ Web Application? The section below explains this in more depth. - Update:. More information about configuring apps in AAM or host-header environments can be found at:. Routing Web Application Consider the scenario where a request is made to. The App Web itself lives in the ‘intranet’ Web application, but how does SharePoint determine that? In the above diagram, the request for the App Web comes in from a client and a DNS lookup is performed. DNS resolves contosoapps.com to our NLB device which in turn routes to our SP farm. However, the host header for this request is not matched to any of our Web applications so SharePoint won’t know how to handle this. To get around this we could try to configure SharePoint and IIS so that application requests go to one of our existing Web applications (and in theory this may work because SharePoint will do some clever routing which is covered in more detail in a second). But when using SSL, it will break because we can’t have an SSL certificate that contains multiple wildcards such as *.contoso.com and *.contosoapps.com, and we can’t bind two to the same site. So to get around this we need an additional Web application that will act as a catch all routing Web application. This Web application must either have its own dedicated IP address, or must have no host header if sharing an IP address – that way it will serve all requests that don’t match host headers for the IIS sites of the existing Web applications. Internally the SharePoint HTTP module will know where to route this request by using the App Management Service Application to work out which Web Application hosts the App Web. This can be seen below: This approach allows us to bind our App Domain wildcard certificate to the IIS site for our catch all routing Web Application, and also bind wildcard certificates to IIS sites for our existing Web Applications. As ever, there is an additional caveat. The identity that the application pool for the routing Web Application is using, must have rights to all the content databases for all of the Web Applications that are being routed to. The easiest way to achieve this is to use the same application pool for all Web applications, or use the same identity for all application pools. App Auth Configuration The topic of App authorisation and authentication is a vast one, so I will only touch on a few key points here at quite a high level, and provide additional reading for those that want to know more. In general as an IT Pro, you need to be aware that cloud-hosted Apps (those outside of SharePoint) won’t just work out-of-the-box with an on-premise SharePoint 2013 deployment. When you think about it, this kind of makes sense, our externally hosted Apps need to be able to call into SharePoint to request data, by default no trust is going to be in place to allow this – so we need to hook that trust up somehow. In SharePoint 2013, OAuth is used to establish this ‘trust’ – OAuth enables users to grant a third-party site access to information that is stored with another service provider (in this case, SharePoint), without sharing their user name and password and without sharing all the data that they have in SharePoint. At a really high level, this looks something like the following: A user signs in to SharePoint 2013 and is authenticated. The authenticated user then uses a cloud-hosted App which uses the SharePoint client object model (CSOM) or REST endpoints with CSOM to make calls to SharePoint. The App is granted permission by the user to access SharePoint resources on the user's behalf. When the App launches, it loads from another location and calls back to SharePoint to access the resources on behalf of the user by using an access token. You can read more on OAuth in SharePoint 2013 on MSDN. The method of generating the access token mentioned above is a key differentiator to the auth flow. In SharePoint 2013, OAuth is used for Apps that fall in two differing scenarios which are known as “low-trust” and “high-trust.” Configure SharePoint for low-trust Apps Low-trust Apps are those that use an authentication provider to act as a common authentication broker or trust broker between SharePoint and the App. This will be Windows Azure Access Control Services (ACS), and as such will of course require an Office 365 subscription. ACS is where SharePoint requests a context token that it can send to the location hosting the App. The App then uses the context token to request an access token from ACS. Once received, this is used by the App to talk back to SharePoint. Y ou can read more about the detail of the OAuth flow for low-trust Apps here: OAuth authentication and authorization flow for cloud-hosted apps in SharePoint 2013. There is a fair amount of configuration required to allow SharePoint on-premises farms to communicate with ACS. Josh Gavant (a fellow PFE), has a great post detailing all of the steps, along with some handy PowerShell helper functions here: SharePoint Low-Trust Apps for On-Premises. Configure SharePoint for high-trust Apps High-trust Apps are those where you are not using ACS as the trust broker, so there is no context token. Instead, you are using a certificate to establish trust and generating your own access token by using the server-to-server security token service that is part of SharePoint 2013. This type of trust is known as a server-to-server trust relationship and is between the SharePoint farm and the App, therefore it must be done for each high-trust App that uses different certificates which a SharePoint farm must trust. High-trust does not mean "full trust", a high-trust app must still request App permissions. The app is considered high-trust because it is trusted to use any user identity that the App needs, because the App is responsible for creating the user portion of the access token. When an App is not SharePoint-hosted and requires some server-side processing logic, this is the approach in-house apps should take most of the time. Configuration of this trust is performed primarily via Windows PowerShell for on-premise deployments and is detailed at length on MSDN: How to: Create high-trust apps for SharePoint 2013 using the server-to-server protocol (advanced topic). Steve Peschka’s blog is another great resource here if you run into any issues: More TroubleShooting Tips for High Trust Apps on SharePoint 2013. Summary The new App model for SharePoint is a big paradigm shift that not only affects developers, but also affects IT Pros that manage and maintain SharePoint 2013 on-premise. Having an understanding of all the working parts and how to configure them will become more and more important as the App model becomes more prevalent. Hopefully this blog series (including the first post on Understanding SharePoint Apps as an IT Pro) helps you on the way with this – best of luck! Written by Chris Whitehead. Posted by Frank Battiston, MSPFE Editor Thanks for sharing the link, Devendra. Note that credit for authoring this particular post belongs to Chris Whitehead, one of our ever-so-esteemed Microsoft Premier Field Engineers and Microsoft Certified Master on SharePoint. Note: there are some changes coming that enable apps in AAM or host-header environments. Additionally the requirement for a routing Web application will be removed. This post will be updated shortly to reflect this new change! Excellent information Nice post Frank. Recently i too posted on <a href="">Apps configuration</a> on my blog. If I understand you correctly, it means that a SharePoint hosted app can get by without server-to-Server authentication or OAuth. I believe that under the Hood this is dealt with using an "internal" Principal. However, I haven't been able to Access data outside of the App or Host web neither in another SharePoint list/library nor in a custom SharePoint WCF Data Service. Such calls (made using Client side script e.g. JavaScript or CSOM) never get authorized. Since I've granted the App as well as the user enough permissions, I feel that the internal principal is lacking sufficient permissions (even though i would have guessed it would do some Kind of impersonation – even though this might proof difficult using client-side techniques). Any ideas on this? I am a SharePoint admin for the University of Colorado and saw your presentation at SPC2012 regarding SharePoint Apps. At that time I had not done much work in SP13 but am now very deep into it and have a question. I have setup SharePoint Apps as you outline and as I saw in some tech net articles and am getting a simple app to display on a page, however; I am having an issue that I hope you can help me with. I am being prompted for a login for each app occurring on the page. If I login they display if I do not login they do not display. I started an MSDN ticket to see if I have misconfigured. The tech told me that this is expected behavior and I can change settings in IE to do automatic login with windows credentials. I am having a hard time believing that this is correct. So my question to you is, Is this in fact expected behavior?? If it is, is there a work around?? @Steven: If their proposed solution works, it's probably because you're using multiple hostnames (for eg, one per app?) which IE perceives as being non-local. There are a few KB articles on how IE resolves which zone to put something in, but ideally, you want anything within your organization (and thus eligible for transparent authentication) to be included in the Local Intranet Zone. Anything with dots in it won't be considered internal, by default. So any FQDN is treated by IE as being an Internet site. This is by far the most common reason for prompts being seen when they're not intuitively expected. If you use a PAC file (or WPAD), anything which goes DIRECT is considered internal (again, by default) and anything which uses a Proxy is considered Internet Zone. If you're using a manual proxy setup and the hostnames you're connecting to don't appear in the Bypass list, again, prompting. If you've edited your Local Intranet Zone settings and disabled the default inclusion options, again, that's a problem. For testing purposes, I'd suggest explicitly adding the site names to the Local Intranet Zone. Note also that a common knee-jerk reaction is to put things in Trusted Sites, but by default it doesn't allow automatic logons either – Local Intranet Zone is where the automatic transparent authentication is at! Now, I've rambled on for a bit, and I didn't check whether this is actually your problem – so if this doesn't address your problem, I'd suggest continuing with the MSDN ticket! Cheers, Tristan @Marco – sorry Marco, I have been on leave for a long time and have just noticed your question. Have you now resolved this? @Steven @TristanK – good advice there Tristan, you explained that well! Steven, let us know how you get on with this. While creating “Microsoft SharePoint Foundation Subscription Service Application” service using SharePoint 2013 power shell, I received the following Error: New-SPSubscriptionSettingsServiceApplication : The timer job did not complete running within the allotted time. I had executed the process in following steps. But it hanged at step 4, later it throws an error “timer job did not complete running within the allotted time” (Please find attachment below): 1. add-pssnapin "Microsoft.Sharepoint.Powershell" 2. $account = Get-SPManagedAccount saudienayaadministrator 3. $appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account 4. $appSubSvc = New-SPSubscriptionSettingsServiceApplication -ApplicationPool $appPoolSubSvc -Name SettingsServiceApp -DatabaseName SettingsServiceDB 5. $proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $appSubSvc Hi Chris (or anyone!) Great post – you mentioned “The app is considered high-trust because it is trusted to use any user identity that the App needs…” How does one actually do this? I mean, I’m using managed CSOM, and I have a Principal object for an arbitrary user – how do I then convert that to a ClientContext to allow me to execute on behalf of that user? The TokenHelper file is a bit confusing, because it seems to mix the terms ‘access token’ and ‘context token’ and I’m a bit lost. Thanks a lot! Jonathan > must either have its own dedicated IP address Could you provide more info on this? What happens when you have 3 WFEs? Each needs its own IP address? So then, what is the configuration in DNS? Can’t we use our same Domain name as APPs domain? Like my Domain is SSA.com and i want to use same SSA.com domain for APPs is it allowed? what different problem can i face? What if i want to use same domain in Internet site or Intranet site? This was/is a very helpful article and it helped me get on the right track for adding apps into my environment. One spot where I ran into issues was that I have a physical load balancer and this required me to make sure I was using a separate IP address so I could handle/manage the NAT requirements for a separate domain. Is it possible to configure app store without domain name. we are using local intranet site. ex: Has anyone configured apps in a load balanced environment? We’re currently configured with F5 load balancers doing port redirections for SSL. I know the articles on configuring apps note that the apps web app needs to be listening on 443, but we currently have it set up on 8449. When adding an app to a site, the app site is being created on the apps web app, but the configuration looks incomplete – the ribbon renders as text and none of the admin pages for the app are available. Has anyone encountered this before? Is it possible this is related to the port redirections, or is something else going on? This post is very helpful. what are the hardware and software required to setup single server enviorment as lastest technology. How do you setup workflow manager as a part of Provider host? what do I do to change on-premise provider hosted app to Clound Provider hosted apps? thanks. we are going to extend the web application externally. we will also have same web application available internally. Do we need to purchase and register domain name? According to the following TechNet article Kerberos is supported for Provider-hosted app. Configuring SharePoint 2013 Apps and Multiple Web Applications on SSL with a Single IP Address It is incredible and informative knowledge. Impressive.">SharePoint 2013 Developer training Online Thanks so much! Your instructions are very clear and helpful. I’ve been wondering how to do this for months and thrilled to find out how finally!">sharepoint training videos Thanks so much! Your instructions are very clear and helpful. I’ve been wondering how to do this for months and thrilled to find out how finally!">sharepoint training videos The post mentions a routing web application with no host header and allows to bind the app domain SSL certificate however what if you have an environment where host named site collections are in use and therefore the parent web application contains no host header for this to work? As you’re aware you cannot have 2 IIS sites, both with out hostheaders bound to the same IP and port. So is the routing web app still needed? I see comment on Dec 28 2016 saying will be removed and I see the article is updated but calls out a March 2013 PU that removed the requirement? I have created a SharePoint provider hosted app but I am a bit confused the way it is working. So The provider hosted app is consist of a asp.net web application which is hosted in IIS server(remote app). And the SharePoint app web, running on SharePoint server. The remote asp.net application is bound to a certificate running on 443 port. But I didn’t configure SharePoint server with the certificate or issuer ID. But when I install the app it’s running just fine. I’m so surprised how it is running without configuring certificate as a high trust app. Is it because both server is under same Domain controller ?
https://blogs.technet.microsoft.com/mspfe/2013/01/31/how-to-configure-sharepoint-2013-on-premises-deployments-for-apps/?replytocom=5895
CC-MAIN-2018-34
refinedweb
4,169
59.23
« Return to documentation listing #include <mpi.h> int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val) INCLUDE ’mpif.h’ MPI_ATTR_PUT(COMM, KEYVAL, ATTRIBUTE_VAL, IERROR) INTEGER COMM, KEYVAL, ATTRIBUTE_VAL, IERROR This deprecated routine is not available in C++. MPI_Attr_put. The type of the attribute value depends on whether C or Fortran is being used. In C, an attribute value is a pointer (void *); in Fortran, it is a single integer (not a pointer, since Fortran has no pointers and there are systems for which a pointer does not fit in an integer, e.g., any 32-bit address system that uses 64 bits for Fortran DOUBLE PRECISION). If an attribute is already present, the delete function (specified when the corresponding keyval was created) will be_set_attr Table of Contents
http://icl.cs.utk.edu/open-mpi/doc/v1.6/man3/MPI_Attr_put.3.php
CC-MAIN-2013-48
refinedweb
126
54.12
hashlib module Introduction: hashlib module is a module that provides string encryption function, including MD5 and SHA encryption algorithm. Specific encryption support includes: MD5,sha1,sha224,sha256, sha384, sha512, blake2b,blake2s,sha3_224, sha3_256, sha3_384, sha3_512, shake_128, shake_256 This module is widely used in user login authentication and text encryption. Verification between documents and documents. This module is easy to call, so let's take a look at it. Basic calls - The basic steps and encryption algorithms are the same. Take MD5 encryption as an example: - Create an MD5 Encryption Object - After the string is converted to byte, the algorithm is encrypted - Display in hexadecimal system - Code: # Import hashlib module import hashlib # Instantiate an MD5 encrypted object md5 = hashlib.md5() # Call the update method of the MD5 object to encrypt the string (here the encoding byte is passed in) md5.update('hello'.encode('utf8')) # Returns a double-length string containing only hexadecimal digits ret = md5.hexdigest() # Print encrypted returned string print(ret) The encryption algorithms that can be created are: md5,sha1, sha224, sha256, sha384, sha512. # Instantiate an MD5 encryption object md5 = hashlib.md5() # Instantiate a sha1 encrypted object sha1 = hashlib.sha1() # Instantiate a sha224 encrypted object sha224 = hashlib.sha224() # Instantiate a sha256 encryption object sha256 = hashlib.sha256() If the amount of data is large, update() can be called several times in blocks, and the final results are the same. md5 = hashlib.md5() md5.update('how to use md5 in '.encode('utf8')) md5.update('python hashlib?'.encode('utf8')) print(md5.hexdigest()) new_md5 = hashlib.md5() new_md5.update('how to use md5 in python hashlib?'.encode('utf8')) print(new_md5.hexdigest()) # Result d26a53750bc40b38b65a520292f69306 d26a53750bc40b38b65a520292f69306 Salt addition Note: But usually such a password is equivalent to a fixed encrypted string. If someone writes such a dictionary, which stores various combinations of strings and corresponding MD5 encrypted strings, and then goes to the violence test, it will be possible to calculate our real password, so make sure to store them. User passwords are not MD5 of commonly used passwords that have been calculated. This method is implemented by adding a complex string to the original password, commonly known as "salt": Code: # String encryption without salt new_md5 = hashlib.md5() new_md5.update('how to use md5 in python hashlib?'.encode('utf8')) print(new_md5.hexdigest()) # String encryption after salt addition new_md5 = hashlib.md5('My dream is to rush out of the earth!'.encode('utf8')) # Salt addition new_md5.update('how to use md5 in python hashlib?'.encode('utf8')) print(new_md5.hexdigest()) # Result d26a53750bc40b38b65a520292f69306 52841008c37295e291f426bbabe56f15 Dynamic Salting # The meaning is to use a variable where salt is added, such as a username. user = input('user>>: ') pwd = input('pwd>>: ') md5 = hashlib.md5('{0}My dream is to visit all over the world.'.format(user).encode('utf8')) md5.update(pwd.encode('utf8')) # Update password print(md5.hexdigest()) When checking files, the method of calculating MD5 value is too large. def file_get_md5(file): md5 = hashlib.md5() with open(file, mode='rb') as fp: # Open the file for line in fp: # loop md5.update(line) # Each update return md5.hexdigest()
https://programmer.group/python-hashlib-encryption-module.html
CC-MAIN-2019-39
refinedweb
505
50.23
Michael Foord (Fuzzyman) I have been programming with Python for nearly four years. I've written several articles on Python, and a couple of them are even worth reading. I am also the author of the following Python projects: I've written a tutorial on IronPython and Windows Forms. My blog is the Voidspace Techie Blog. I'm particularly grateful to IronPython. Because of it I'm now able to earn a living programming with Python, for Resolver Systems. I'm also writing a book, IronPython in Action for Manning publications. Expect to see it out early autumn time.... Along with this we will discuss (briefly) why you might (or might not) want to use IronPython, we'll also encounter and explain some .NET terminology along the way. The talk will be illustrated with code snippets from the The Multi-Tabbed Image Viewer, which of course will be shown in action. Python Python is an Open Source, Object-Oriented, cross-platform, dynamically typed, interpreted programming language. Python is used for a wide variety of purposes: games (Eve Online, Civilization IV), science (particularly bioinformatics and genomics), industry (Seagate), GIS, film industry, desktop applications, system administration, web development. It is used by companies like Google, NASA, Yahoo and Industrial Light and Magic. IronPython was started by Jim Hugunin, who now heads a Microsoft team running the development. IronPython is a very faithful implementation of Python 2.4. All the core language features are there.. The Visual Studio support includes the designer and debugger. It requires the full version of Visual Studio, plus the SDK. The IronPython engine is actually an IronPython compiler. It compiles Python code into .NET bytecode (IL) in memory. The compiled Python assemblies can be saved to disk (making binary only distributions possible). (I'll explain what an assembly is in a few moments.) Because of the dynamic nature of Python they retain a dependency on the IronPython dlls. IronPython has seamless integration with the .NET framework. Types can be passed back and forth from native .NET code with no conversion, making it very simple to use .NET classes from IronPython. This means that extending IronPython with C# (including accessing unmanaged code and the win32 APIs) is much easier than extending CPython with C. An exception to the seamless integration is that .NET 'attributes' are inacessible from IronPython. Additionally you can't consume IronPython assemblies from C#. In order to support the Python feature that you can dynamically swap the __class__ attribute on instances at runtime (and for memory efficiency) IronPython re-uses a single class under the hood. This means that classes created in IronPython can't be used directly by other .NET languages. Microsoft seem to be pushing out the .NET framework through Windows Update now (possibly as an optional update?). So many people are finding they don't need to do this. Good news for distributing IronPython applications. You can download the pre-built binary distribution, or the source code. IronPython is released under a sensible open source license, similar to the BSD License. (You can make derivative works for commercial purposes.) This means you need Python 2.4 installed. The default location of the Python standard library will be C:\Python24\Lib. You can just copy the Python standard library to another folder and add that location to IRONPYTHONPATH (or manually to sys.path) and you can distribute the standard library with your applications. The IronPython interactive interpreter is ipy.exe, which is also used to run scripts. This is the equivalent of python.exe. There is also ipyw.exe which is the equivalent of pythonw.exe and runs scripts without a console box. To switch on tab completion (very useful) and colour highlighting, run ipy.exe with the arguments: ipy -D -X:TabCompletion -X:ColorfulConsole Note Namespaces Usually, but not always, the namespace within an assembly will have the same name as the assembly. You can also load an assembly with a 'strong name', specifying the exact version you want: Alternatively you can load an assembly object from a specific path, and then add a reference to that assembly object.. The random module is from the Python 2.4 standard library. Windows Forms controls are configured with properties. The controls (widgets) inherit from the Control class, so they all have a lot of properties in common.). The Z-order is named because it is the 'Z-axis'. Controls you add first are higher in the Z-order and so if they overlap you will see the one you added first. This is more of a problem if you layout your GUI using absolute positions. You can use methods on the ControlCollection (the collections property) to reorder the controls, or call the BringToFront method on a control.. This method is an event handler. The two unused arguments in the method signature are sender and event.. More things we could have shown you or talked about.... Resolver started developing with IronPython around October 2005. At that point it was almost a daily occurrence to discover bugs in IronPython, create a bugtest to tell us when it was fixed and then implement a workaround. Now this happens very rarely. We recently discovered a bug in __call__ and keyword arguments, I don't remember the last time we discovered a bug prior to that. There isn't an awful lot of difference between being dependent on Python and being dependent on .NET though. Also see the note that goes with Setting Up IronPython.?
http://www.voidspace.org.uk/ironpython/presentation.html
CC-MAIN-2014-41
refinedweb
915
58.99
Create a program in C# that asks the user in the first line What is your name? and save the name in the variable x. The program must respond on the second line with Nice to meet you, x. What is your name? x Nice to meet you, x using System; public class StoreUserInput { public static void Main(string[] args) { Console.Write("What is your name? "); string x = Console.ReadLine(); Console.WriteLine("Nice to meet you, " + x); } } Practice C# anywhere with the free app for Android devices. Learn C# at your own pace, the exercises are ordered by difficulty. Own and third party cookies to improve our services. If you go on surfing, we will consider you accepting its use.
https://www.exercisescsharp.com/introduction-to-csharp/store-user-input/
CC-MAIN-2022-05
refinedweb
120
77.84
Replacing HTTP: A Brief Summary of IPFS Before investing heavily into the entire IPFS infrastructure, you’ll need to wade through the misconceptions and the fud (Fear, Uncertainty, and Doubt). I’m here to help you. It’s important to know what it really means when you see things like permanently stored and decentralized, and I hope to help you understand how IPFS (Interplanetary File System) works, in general. This way, you’ll be able to make the best decision regarding the stack that runs your services or application. And, you’ll even learn some interesting tidbits on how IPFS can be used. A Brief Summary of IPFS There are a few moving parts that are included under the IPFS umbrella. The term “umbrella” is used because it isn’t simply about storage. The umbrella actually contains a collection of other protocols that aim to replace HTTP. I’ll explain some of the key parts below: Gateway This is an instance that is often provided to the public by various contributors. It serves as part of the backbone to the entire “decentralized” aspect of the network. The gateway handles things such as routing the client to the node(s) that has the content and also as a cache mechanism that sits in front of the nodes themselves. All requests are first sent to a gateway before they are retrieved from a node. In terms of a CDN, this can be considered as an edgerouter. Node This is basically a self-hosted instance that you own, and it’s connected to the network. It allows users to access files that you’ve made accessible through your node via the add/publish command. In order for your files to be accessible, the node has to be online. There are caching protocols in place (via gateway) which allow users to access your content if cached, by requesting it from other peers that may have the content. You can think of this as how BitTorrent works, in a sense. If another peer has the content you’ve made available to the network, others can grab it from them. However, if there are no peers with that content, then no one can access it if your node is offline. Since it’s possible to still produce a single point of failure, though, this can fall into the not really decentralized bucket. Hash There are two different types of hashes to take note of: IPFS and IPNS. IPFS Hash This is the hash to the data content you’ve added to your node. It’s also used to access the file through the gateway or from your node. This will always be something unique, depending on the contents of the file. If the file hasn’t been modified, then the hash will remain the same. However, if it has been changed, then it will generate a new hash. This also means that users will need to know the new hash to be able to access it. A lot of topics cover pointing directly to it, but there isn’t a lot around accessing updated data. That is what IPNS is for. IPNS Hash This is the hash that’s associated with your node. Each node instance has its own IPNS hash, which is also its peer identity hash. This is generated upon initialization, when first setting up the node. What is this typically used for, you might ask? It’s so that you can actually have a namespace on the IPFS network that allows you to access published content and always have it pointed to the latest version of the files. IPNS differs from IPFS in that you may have a new hash generate if the content’s data is changed, which means the new hash would need to be provided for access. This is how you avoid grabbing stale content. Whereas, this is a single “static” hash that can be updated to point to the content published. In technical terms, an IPNS Hash can be described as both a static address, since it is configured to always point to a specific node, and a unique address, allocated to always point to content published to it. “Permanently Stored” and “Decentralized” Here’s the thing. You’re going to find a lot of information about how to host your data on IPFS “forever” and for “free”. Don’t fall into the trap of hype and buzzwords. Your IPFS can be considered truly decentralized only if multiple sources have it pinned and stored on their IPFS nodes. Otherwise, the only “data” that is decentralized is the IPFS hash(es) of the files added to the network, and not the actual content itself. The metadata, which is built up of hashes, that constitutes the network, is distributed across the available nodes and thus, decentralized. This metadata is used to look up which node contains the content and serves it to the client that requests it. It can be similar to blockchain, in which everyone who joins the network has a part of the “chain” (the metadata in our case) and shares the same data to other peers also connected to the network. What is PINNED/PINNING? The IPFS protocol has a concept of “garbage collection” which removes infrequently accessed content from the network. This affects the way content is stored on the IPFS network, because after all: resources are finite. When content is “pinned”, it lets the IPFS instance know that it shouldn’t be removed from its storage when a garbage collection runs. It is important to know that this only affects the node(s) that the action is performed on. This means that any node(s) that didn’t explicitly pin content would have that content purged from its storage during the next garbage collection. You can run into a state where, if there are no nodes that have the content pinned, the content is no longer available. A Word of Caution IPFS is configured by default to scan the local network to discover additional nodes/gateways. Depending on the hosting provider of your choice, they may believe that your servers were infected and maliciously sending random packets on the network or scanning for ports. This happened in my case, and almost led to my provider to taking down the server. You should always be careful when setting up your own instance with some saner defaults so that it won’t run into this issue. IPFS comes with a handful of profiles that can be used for your specific use-case. For what it’s worth, local-discovery is enabled by default if you run the ipfs init command without any additional flags. This isn’t something most people mention in tutorials and it’s a gotcha I ran into while looking into configuration options. Conclusion There isn’t anything wrong with IPFS, or using it. It’s just that there’s quite a bit of misleading information out there on what it does and how it works. This makes it hard to understand, at a cursory glance. Hopefully this somewhat high-level explanation provides you with some details to make either an informed decision or to gather more knowledge about the workings of IPFS. As always, it’s recommended to take a look at the IPFS documentation since the protocol is still considered alpha in active development..
https://revelry.co/ipfs-infrastructure/
CC-MAIN-2020-29
refinedweb
1,231
70.13
Spl. Final Result Preview If you have XNA, you can download the source files and compile the demo yourself. Otherwise, check out the demo video below: There are two mostly independent parts to the water simulation. First, we'll make the waves using a spring model. Second, we'll use particle effects to add splashes. Making the Waves To make the waves, we'll model the surface of the water as a series of vertical springs, as shown in this diagram: This will allow the waves to bob up and down. We will then make water particles pull on their neighbouring particles to allow the waves to spread. Springs and Hooke's Law One great thing about springs is that they're easy to simulate. Springs have a certain natural length; if you stretch or compress a spring, it will try to return to that natural length. The force provided by a spring is given by Hooke's Law: \[ F = -kx \] F is the force produced by the spring, k is the spring constant, and x is the spring's displacement from its natural length. The negative sign indicates the force is in the opposite direction to which the spring is displaced; if you push the spring down, it will push back up, and vice versa. The spring constant, k, determines the stiffness of the spring. To simulate springs, we must figure out how to move particles around based on Hooke's Law. To do this, we need a couple more formulas from physics. First, Newton's Second Law of Motion: \[ F = ma \] Here, F is force, m is mass and a is acceleration. This means the stronger a force pushes on an object, and the lighter the object is, the more it accelerates. Combining these two formulas and rearranging gives us: \[ a = -\frac{k}{m} x \] This gives us the acceleration for our particles. We'll assume that all our particles will have the same mass, so we can combine k/m into a single constant. To determine position from acceleration, we need to do numerical integration. We're going to use the simplest form of numerical integration - each frame we simply do the following: Position += Velocity; Velocity += Acceleration; This is called the Euler method. It's not the most accurate type of numerical integration, but it's fast, simple and adequate for our purposes. Putting it all together, our water surface particles will do the following each frame: public float Position, Velocity; public void Update() { const float k = 0.025f; // adjust this value to your liking float x = Height - TargetHeight; float acceleration = -k * x; Position += Velocity; Velocity += acceleration; } Here, TargetHeight is the natural position of the top of the spring when it's neither stretched nor compressed. You should set this value to where you want the surface of the water to be. For the demo, I set it to halfway down the screen, at 240 pixels. Tension and Dampening I mentioned earlier that the spring constant, k, controls the stiffness of the spring. You can adjust this value to change the properties of the water. A low spring constant will make the springs loose. This means a force will cause large waves that oscillate slowly. Conversely, a high spring constant will increase the tension in the spring. Forces will create small waves that oscillate quickly. A high spring constant will make the water look more like jiggling Jello. A word of warning: do not set the spring constant too high. Very stiff springs apply very strong forces that change greatly in a very small amount of time. This does not play well with numerical integration, which simulates the springs as a series of discrete jumps at regular time intervals. A very stiff spring can even have an oscillation period that's shorter than your time step. Even worse, the Euler method of integration tends to gain energy as the simulation becomes less accurate, causing stiff springs to explode. There is a problem with our spring model so far. Once a spring starts oscillating, it will never stop. To solve this we must apply some dampening. The idea is to apply a force in the opposite direction that our spring is moving in order to slow it down. This requires a small adjustment to our spring formula: \[ a = -\frac{k}{m} x - dv \] Here, v is velocity and d is the dampening factor - another constant you can tweak to adjust the feel of the water. It should be fairly small if you want your waves to oscillate. The demo uses a dampening factor of 0.025. A high dampening factor will make the water look thick like molasses, while a low value will allow the waves to oscillate for a long time. Making the Waves Propagate Now that we can make a spring, let's use them to model water. As shown in the first diagram, we're modelling the water using a series of parallel, vertical springs. Of course, if the springs are all independent, the waves will never spread out like real waves do. I'll show the code first, and then go over it: for (int i = 0; i < springs.Length; i++) springs[i].Update(Dampening, Tension); float[] leftDeltas = new float[springs.Length]; float[] rightDeltas = new float[springs.Length]; // do some passes where springs pull on their neighbours for (int j = 0; j < 8; j++) { for (int i = 0; i < springs.Length; i++) { if (i > 0) { leftDeltas[i] = Spread * (springs[i].Height - springs [i - 1].Height); springs[i - 1].Speed += leftDeltas[i]; } if (i < springs.Length - 1) { rightDeltas[i] = Spread * (springs[i].Height - springs [i + 1].Height); springs[i + 1].Speed += rightDeltas[i]; } } for (int i = 0; i < springs.Length; i++) { if (i > 0) springs[i - 1].Height += leftDeltas[i]; if (i < springs.Length - 1) springs[i + 1].Height += rightDeltas[i]; } } This code would be called every frame from your Update() method. Here, springs is an array of springs, laid out from left to right. leftDeltas is an array of floats that stores the difference in height between each spring and its left neighbour. rightDeltas is the equivalent for the right neighbours. We store all these height differences in arrays because the last two if statements modify the heights of the springs. We have to measure the height differences before any of the heights are modified. The code starts by running Hooke's Law on each spring as described earlier. It then looks at the height difference between each spring and its neighbours, and each spring pulls its neighbouring springs towards itself by altering the neighbours' positions and velocities. The neighbour-pulling step is repeated eight times to allow the waves to propagate faster. There's one more tweakable value here called Spread. It controls how fast the waves spread. It can take values between 0 and 0.5, with larger values making the waves spread out faster. To start the waves moving, we're going to add a simple method called Splash(). public void Splash(int index, float speed) { if (index >= 0 && index < springs.Length) springs[i].Speed = speed; } Any time you want to make waves, call Splash(). The index parameter determines at which spring the splash should originate, and the speed parameter determines how large the waves will be. Rendering We'll be using the XNA PrimitiveBatch class from the XNA PrimitivesSample. The PrimitiveBatch class helps us draw lines and triangles directly with the GPU. You use it like so: // in LoadContent() primitiveBatch = new PrimitiveBatch(GraphicsDevice); // in Draw() primitiveBatch.Begin(PrimitiveType.TriangleList); foreach (Triangle triangle in trianglesToDraw) { primitiveBatch.AddVertex(triangle.Point1, Color.Red); primitiveBatch.AddVertex(triangle.Point2, Color.Red); primitiveBatch.AddVertex(triangle.Point3, Color.Red); } primitiveBatch.End(); One thing to note is that, by default, you must specify the triangle vertices in a clockwise order. If you add them in a counter clockwise order the triangle will be culled and you won't see it. It's not necessary to have a spring for each pixel of width. In the demo I used 201 springs spread across an 800 pixel wide window. That gives exactly 4 pixels between each spring, with the first spring at 0 and the last at 800 pixels. You could probably use even fewer springs and still have the water look smooth. What we want to do is draw thin, tall trapezoids that extend from the bottom of the screen to the surface of the water and connect the springs, as shown in this diagram: Since graphics cards don't draw trapezoids directly, we have to draw each trapezoid as two triangles. To make it look a bit nicer, we'll also make the water darker as it gets deeper by colouring the bottom vertices dark blue. The GPU will automatically interpolate colours between the vertices. primitiveBatch.Begin(PrimitiveType.TriangleList); Color midnightBlue = new Color(0, 15, 40) * 0.9f; Color lightBlue = new Color(0.2f, 0.5f, 1f) * 0.8f; var viewport = GraphicsDevice.Viewport; float bottom = viewport.Height; // stretch the springs' x positions to take up the entire window float scale = viewport.Width / (springs.Length - 1f); // be sure to use float division for (int i = 1; i < springs.Length; i++) { // create the four corners of our triangle. Vector2 p1 = new Vector2((i - 1) * scale, springs[i - 1].Height); Vector2 p2 = new Vector2(i * scale, springs[i].Height); Vector2 p3 = new Vector2(p2.X, bottom); Vector2 p4 = new Vector2(p1.X, bottom); primitiveBatch.AddVertex(p1, lightBlue); primitiveBatch.AddVertex(p2, lightBlue); primitiveBatch.AddVertex(p3, midnightBlue); primitiveBatch.AddVertex(p1, lightBlue); primitiveBatch.AddVertex(p3, midnightBlue); primitiveBatch.AddVertex(p4, midnightBlue); } primitiveBatch.End(); Here is the result: Making the Splashes The waves look pretty good, but I'd like to see a splash when the rock hits the water. Particle effects are perfect for this. Particle Effects A particle effect uses a large number of small particles to produce some visual effect. They're sometimes used for things like smoke or sparks. We're going to use particles for the water droplets in the splashes. The first thing we need is our particle class: class Particle { public Vector2 Position; public Vector2 Velocity; public float Orientation; public Particle(Vector2 position, Vector2 velocity, float orientation) { Position = position; Velocity = velocity; Orientation = orientation; } } This class just holds the properties a particle can have. Next, we create a list of particles. List<Particle> particles = new List<Particle>(); Each frame, we must update and draw the particles. void UpdateParticle(Particle particle) { const float Gravity = 0.3f; particle.Velocity.Y += Gravity; particle.Position += particle.Velocity; particle.Orientation = GetAngle(particle.Velocity); } private float GetAngle(Vector2 vector) { return (float)Math.Atan2(vector.Y, vector.X); } public void Update() { foreach (var particle in particles) UpdateParticle(particle); // delete particles that are off-screen or under water particles = particles.Where(x => x.Position.X >= 0 && x.Position.X <= 800 && x.Position.Y <= GetHeight(x.Position.X)).ToList(); } We update the particles to fall under gravity and set the particle's orientation to match the direction it's going in. We then get rid of any particles that are off-screen or under water by copying all the particles we want to keep into a new list and assigning it to particles. Next we draw the particles. void DrawParticle(Particle particle) { Vector2 origin = new Vector2(ParticleImage.Width, ParticleImage.Height) / 2f; spriteBatch.Draw(ParticleImage, particle.Position, null, Color.White, particle.Orientation, origin, 0.6f, 0, 0); } public void Draw() { foreach (var particle in particles) DrawParticle(particle); } Below is the texture I used for the particles. Now, whenever we create a splash, we make a bunch of particles. private void CreateSplashParticles(float xPosition, float speed) { float y = GetHeight(xPosition); if (speed > 60) { for (int i = 0; i < speed / 8; i++) { Vector2 pos = new Vector2(xPosition, y) + GetRandomVector2(40); Vector2 vel = FromPolar(MathHelper.ToRadians(GetRandomFloat(-150, -30)), GetRandomFloat(0, 0.5f * (float)Math.Sqrt(speed))); particles.Add(new Particle(pos, velocity, 0)); } } } You can call this method from the Splash() method we use to make waves. The parameter speed is how fast the rock hits the water. We'll make bigger splashes if the rock is moving faster. GetRandomVector2(40) returns a vector with a random direction and a random length between 0 and 40. We want to add a little randomness to the positions so the particles don't all appear at a single point. FromPolar() returns a Vector2 with a given direction and length. Here is the result: Using Metaballs as Particles Our splashes look pretty decent, and some great games, like World of Goo, have particle effect splashes that look much like ours. However, I'm going to show you a technique to make the splashes look more liquid-like. The technique is using metaballs, organic-looking blobs which I've written a tutorial about before. If you're interested in the details about metaballs and how they work, read that tutorial. If you just want to know how to apply them to our splashes, keep reading. Metaballs look liquid-like in the way they fuse together, making them a good match for our liquid splashes. To make the metaballs, we will need to add new class variables: RenderTarget2D metaballTarget; AlphaTestEffect alphaTest; Which we initialize like so: var view = GraphicsDevice.Viewport; metaballTarget = new RenderTarget2D(GraphicsDevice, view.Width, view.Height); alphaTest = new AlphaTestEffect(GraphicsDevice); alphaTest.ReferenceAlpha = 175; alphaTest.Projection = Matrix.CreateTranslation(-0.5f, -0.5f, 0) * Matrix.CreateOrthographicOffCenter(0, view.Width, view.Height, 0, 0, 1); Then we draw the metaballs: GraphicsDevice.SetRenderTarget(metaballTarget); GraphicsDevice.Clear(Color.Transparent); Color lightBlue = new Color(0.2f, 0.5f, 1f); spriteBatch.Begin(0, BlendState.Additive); foreach (var particle in particles) { Vector2 origin = new Vector2(ParticleImage.Width, ParticleImage.Height) / 2f; spriteBatch.Draw(ParticleImage, particle.Position, null, lightBlue, particle.Orientation, origin, 2f, 0, 0); } spriteBatch.End(); GraphicsDevice.SetRenderTarget(null); device.Clear(Color.CornflowerBlue); spriteBatch.Begin(0, null, null, null, null, alphaTest); spriteBatch.Draw(metaballTarget, Vector2.Zero, Color.White); spriteBatch.End(); // draw waves and other things The metaball effect depends on having a particle texture that fades out as you get further from the center. Here's what I used, set on a black background to make it visible: Here's what it looks like: The water droplets now fuse together when they are close. However, they don't fuse with the surface of the water. We can fix this by adding a gradient to the water's surface that makes it gradually fade out, and rendering it to our metaball render target. Add the following code to the above method before the line GraphicsDevice.SetRendertarget(null): primitiveBatch.Begin(PrimitiveType.TriangleList); const float thickness = 20; float scale = GraphicsDevice.Viewport.Width / (springs.Length - 1f); for (int i = 1; i < springs.Length; i++) { Vector2 p1 = new Vector2((i - 1) * scale, springs[i - 1].Height); Vector2 p2 = new Vector2(i * scale, springs[i].Height); Vector2 p3 = new Vector2(p1.X, p1.Y - thickness); Vector2 p4 = new Vector2(p2.X, p2.Y - thickness); primitiveBatch.AddVertex(p2, lightBlue); primitiveBatch.AddVertex(p1, lightBlue); primitiveBatch.AddVertex(p3, Color.Transparent); primitiveBatch.AddVertex(p3, Color.Transparent); primitiveBatch.AddVertex(p4, Color.Transparent); primitiveBatch.AddVertex(p2, lightBlue); } primitiveBatch.End(); Now the particles will fuse with the water's surface. Adding the Beveling Effect The water particles look a bit flat, and it would be nice to give them some shading. Ideally, you would do this in a shader. However, for the sake of keeping this tutorial simple, we're going to use a quick and easy trick: we're simply going to draw the particles three times with different tinting and offsets, as illustrated in the diagram below. To do this, we want to capture the metaball particles in a new render target. We'll then draw that render target once for each tint. First, declare a new RenderTarget2D just like we did for the metaballs: particlesTarget = new RenderTarget2D(GraphicsDevice, view.Width, view.Height); Then, instead of drawing metaballsTarget directly to the backbuffer, we want to draw it onto particlesTarget. To do this, go to the method where we draw the metaballs and simply change these lines: GraphicsDevice.SetRenderTarget(null); device.Clear(Color.CornflowerBlue); ...to: GraphicsDevice.SetRenderTarget(particlesTarget); device.Clear(Color.Transparent); Then use the following code to draw the particles three times with different tints and offsets: Color lightBlue = new Color(0.2f, 0.5f, 1f); GraphicsDevice.SetRenderTarget(null); device.Clear(Color.CornflowerBlue); spriteBatch.Begin(); spriteBatch.Draw(particlesTarget, -Vector2.One, new Color(0.8f, 0.8f, 1f)); spriteBatch.Draw(particlesTarget, Vector2.One, new Color(0f, 0f, 0.2f)); spriteBatch.Draw(particlesTarget, Vector2.Zero, lightBlue); spriteBatch.End(); // draw waves and other stuff Conclusion That's it for basic 2D water. For the demo, I added a rock you can drop into the water. I draw the water with some transparency on top of the rock to make it look like it's underwater, and make it slow down when it's underwater due to water resistance. To make the demo look a bit nicer, I went to opengameart.org and found an image for the rock and a sky background. You can find the rock and sky at and opengameart.org/content/sky-backdrop respectively. Envato Tuts+ tutorials are translated into other languages by our community members—you can be involved too!Translate this post
https://gamedevelopment.tutsplus.com/tutorials/make-a-splash-with-dynamic-2d-water-effects--gamedev-236
CC-MAIN-2019-13
refinedweb
2,869
58.58
This documentation is archived and is not being maintained. Compiler Warning (level 2) C4356 Visual Studio 2005 Error Message'member' : static data member cannot be initialized via derived class The initialization of a static data member was ill formed. The compiler accepted the initialization. This is a breaking change in the Visual C++ .NET 2003 compiler. See Summary of Compile-Time Breaking Changes for more information. For code that works the same in all versions of Visual C++, initialize the member through the base class. Use the warning pragma to suppress this warning. The following sample generates C4356: // C4356.cpp // compile with: /W2 /EHsc #include <iostream> template <class T> class C { static int n; }; class D : C<int> {}; int D::n = 0; // C4356 // try the following line instead // int C<int>::n = 0; class A { public: static int n; }; class B : public A {}; int B::n = 10; // C4356 // try the following line instead // int A::n = 99; int main() { using namespace std; cout << B::n << endl; } Show:
https://msdn.microsoft.com/en-US/library/30kfwt8c(v=vs.80).aspx
CC-MAIN-2017-22
refinedweb
167
64
"Roman. Roman, X The Roman numeral system is decimal based, but not directly positional and does not include a zero. Roman numerals are based on combinations of these seven symbols: Simple Solution We can single out "elemental" numbers and break the given number at these elements top down. Here is those "elements" for the roman numerals: "M" 1000, "CM" 900, "D" 500, "CD" 400, "C" 100, "XC" 90, "L" 50, "XL" 40, "X" 10, "IX" 9, "V" 5, "IV" 4, "I" 1 Next we try to subtract these numbers from the given until we can. And connect characters from left to right. The result is our number in roman form. ELEMENTS = (("M", 1000), ("CM", 900), ("D", 500), ("CD", 400), ("C", 100), ("XC", 90), ("L", 50), ("XL", 40), ("X", 10), ("IX", 9), ("V", 5), ("IV", 4), ("I", 1)) def checkio(number): result = "" for roman, n in ELEMENTS: if n <= number: result += roman * (number // n) number %= n return result "Clear" Solutions In the "Clear" category, @JulianNicholls's "First" solution has earned many player votes and uses simple clear algorithm. The next is Mark Pilgrim's realisation written by @macfreek. This solution is like the previous one but with comments and other "production" features. "Creative" solutions (just for fun) How about a veeeery long one-liner from @ciel? checkio=lambda data: ['','M','MM','MMM'][data//1000]+['','C','CC','CCC','CD','D','DC','DCC','DCCC','CM'][data//100%10]+['','X','XX','XXX','XL','L','LX','LXX','LXXX','XC'][data//10%10]+['','I','II','III','IV','V','VI','VII','VIII','IX'][data%10] Or "Recursive, short, weird but works! :)" by @hrvoje. def checkio(data): s = lambda b,z: '' if not z else str(s(b%z[0][0], z[1:])) + (b//z[0][0])*z[0][1] return s(data, [(1000, 'M'), (900, 'MC'), (500, 'D'), (400, 'DC'), (100, 'C'), (90, 'CX'), (50, 'L'), (40, 'LX'), (10, 'X'), (9, 'XI'), (5, 'V'), (4, 'VI'), (1, 'I')])[::-1] Or even the puzzler "dict FTW" from @veky instead of a weekend crossword for you. def checkio(x): a,r="",{} for i in range(3): p,(j,c,d)=10**i,"IVXLCDM"[2*i:][:3] r.update({p:j,5*p:c,4*p:j+c,9*p:j+d,10*p:d}) for k in reversed(sorted(r)): a+=x//k*r[k] x%=k return a That's all folks. Maybe you would like to review some CiO mission?
https://py.checkio.org/blog/roman-numerals/
CC-MAIN-2020-40
refinedweb
403
57.71
It's quite unclear how to contribute to MediaInfo, so I'll post here. MediaInfoDLL.h was recently broken on Linux, and later Mac OS X, while using the C API. It is incorrect to include the C++ header <new> for size_t. Patch to fix can be found here: EDIT: This should perhaps be included unconditionally? Please review. Jerome Martinez 2013-09-30 It's quite unclear how to contribute to MediaInfo, so I'll post here. Patches tracker, but I accept patch here too. Don't hesitate to contribute more! It is incorrect to include the C++ header for size_t. crapy code from me :( EDIT: This should perhaps be included unconditionally? Not sure: it is ok in most other systems. But I definitely not know what is the best practice. Currently, I propose: #ifdef __cplusplus #include <new> //for size_t #else /* __cplusplus */ #include <stddef.h> //for size_t #endif /* __cplusplus */ What do you think of it? Vittorio Giovara 2014-08-12 Hi, I got recently bitten by this, can this patch be upstreamed? I believe the ifdef __cplusplus is not needed as new is implicitly defined in c++ anyway, and the header is of course present in both cases. Thanks Jerome Martinez 2014-08-15 There is theory, there is reality ;-). the #include <new> is present because it was not compiling with some C++ compilers used by my users. So for the moment I prefer to keep it. I had no news about my proposal, but if it works I an add it in next version. Is this patch OK in your case? Vittorio Giovara 2014-08-27 I still think it would be cleaner and more standard-compliant to just include stddef.h in either cases. Do you know which compilers were actually broken? FWIW the proposed patch fixes OSX compilation as expected. Vittorio Giovara 2014-09-08 Ping on this issue. Jerome Martinez 2015-03-31 Just some final feedbck: the patch above is now included in the package.
http://sourceforge.net/p/mediainfo/discussion/297609/thread/98b13f4b/
CC-MAIN-2015-35
refinedweb
330
67.86
Overview This chapter focuses on how to use PB to pass complex types (specifically class instances) to and from a remote process. The first section is on simply copying the contents of an object to a remote process ( pb.Copyable). The second covers how to copy those contents once, then update them later when they change ( Cacheable). Motivation From the previous chapter, you've seen how to pass basic types to a remote process, by using them in the arguments or return values of a callRemote function. However, if you've experimented with it, you may have discovered problems when trying to pass anything more complicated than a primitive int/list/dict/string type, or another pb.Referenceable object. At some point you want to pass entire objects between processes, instead of having to reduce them down to dictionaries on one end and then re-instantiating them on the other. Passing Objects The most obvious and straightforward way to send an object to a remote process is with something like the following code. It also happens that this code doesn't work, as will be explained below. class LilyPond: def __init__(self, frogs): self.frogs = frogs pond = LilyPond(12) ref.callRemote("sendPond", pond) If you try to run this, you might hope that a suitable remote end which implements the remote_sendPond method would see that method get invoked with an instance from the LilyPond class. But instead, you'll encounter the dreaded InsecureJelly exception. This is Twisted's way of telling you that you've violated a security restriction, and that the receiving end refuses to accept your object. Security Options What's the big deal? What's wrong with just copying a class into another process' namespace? Reversing the question might make it easier to see the issue: what is the problem with accepting a stranger's request to create an arbitrary object in your local namespace? The real question is how much power you are granting them: what actions can they convince you to take on the basis of the bytes they are sending you over that remote connection. Objects generally represent more power than basic types like strings and dictionaries because they also contain (or reference) code, which can modify other data structures when executed. Once previously-trusted data is subverted, the rest of the program is compromised. The built-in Python batteries included classes are relatively tame, but you still wouldn't want to let a foreign program use them to create arbitrary objects in your namespace or on your computer. Imagine a says all User objects in the system are referenced when authorizing a login session. (In this system, User.__init__ would probably add the object to a global list of known users). The simple act of creating an object would give access to somebody. If you could be tricked into creating a bad object, an unauthorized user would get access. So object creation needs to be part of a system's security design. The dotted line between trusted inside and untrusted outside needs to describe what may be done in response to outside events. One of those events is the receipt of an object through a PB remote procedure call, which is a request to create an object in your inside namespace. The question is what to do in response to it. For this reason, you must explicitly specific what remote classes will be accepted, and how their local representatives are to be created. What class to use? Another basic question to answer before we can do anything useful with an incoming serialized object is: what class should we create? The simplistic answer is to create the same kind that was serialized on the sender's end of the wire, but this is not as easy or as straightforward as you might think. Remember that the request is coming from a different program, using a potentially different set of class libraries. In fact, since PB has also been implemented in Java, Emacs-Lisp, and other languages, there's no guarantee that the sender is even running Python! All we know on the receiving end is a list of two things which describe the instance they are trying to send us: the name of the class, and a representation of the contents of the object. PB lets you specify the mapping from remote class names to local classes with the setUnjellyableForClass function InsecureJelly exception. In general you expect both ends to share the same codebase: either you control the program that is running on both ends of the wire, or both programs share some kind of common language that is implemented in code which exists on both ends. You wouldn't expect them to send you an object of of a User object might differ from the recipient's, either through namespace collisions between unrelated packages, version skew between nodes that haven't been updated at the same rate, or a malicious intruder trying to cause your code to fail in some interesting or potentially vulnerable way. pb.Copyable Ok, enough of this theory. How do you send a fully-fledged object from one side to the other? #! /usr/bin/python from twisted.spread import pb, jelly from twisted.python import log from twisted.internet import reactor class LilyPond: def setStuff(self, color, numFrogs): self.color = color self.numFrogs = numFrogs def countFrogs(self): print "%d frogs" % self.numFrogs class CopyPond(LilyPond, pb.Copyable): pass class Sender: def __init__(self, pond): self.pond = pond def got_obj(self, remote): self.remote = remote d = remote(): from copy_sender import CopyPond # so it's not __main__.CopyPond pond = CopyPond() pond.setStuff("green", 7) pond.countFrogs() # class name: print ".".join([pond.__class__.__module__, pond.__class__.__name__]) sender = Sender(pond) factory = pb.PBClientFactory() reactor.connectTCP("localhost", 8800, factory) deferred = factory.getRootObject() deferred.addCallback(sender.got_obj) reactor.run() if __name__ == '__main__': main() """PB copy receiver example. This is a Twisted Application Configuration (tac) file. Run with e.g. twistd -ny copy_receiver.tac See the twistd(1) man page or for details. """ import sys if __name__ == '__main__': print __doc__ sys.exit(1) from twisted.application import service, internet from twisted.internet import reactor from twisted.spread import pb from copy_sender import LilyPond, CopyPond from twisted.python import log #log.startLogging(sys.stdout) class ReceiverPond(pb.RemoteCopy, LilyPond): pass pb.setUnjellyableForClass(CopyPond, ReceiverPond) class Receiver(pb.Root): def remote_takePond(self, pond): print " got pond:", pond pond.countFrogs() return "safe and sound" # positive acknowledgement def remote_shutdown(self): reactor.stop() application = service.Application("copy_receiver") internet.TCPServer(8800, pb.PBServerFactory(Receiver())).setServiceParent( service.IServiceCollection(application)) The sending side has a class called LilyPond. To make this eligble for transport through callRemote (either as an argument, a return value, or something referenced by either of those [like a dictionary value]), it must inherit from one of the four name and state are sent over the wire to the receiver. The receiving end defines a local class named ReceiverPond to represent incoming LilyPond instances. This class derives from the sender's LilyPond class (with a fully-qualified name of copy_sender.LilyPond), which specifies how we expect it to behave. We trust that this is the same LilyPond class as the sender used. (At the very least, we hope ours will be able to accept a state created by theirs). It also inherits from pb.RemoteCopy, which is a requirement for all classes that act in this local-representative role (those which are given to the second argument of setUnjellyableForClass). RemoteCopy provides the methods that tell the Jelly layer how to create the local object from the incoming serialized state. Then setUnjellyableForClass is used to register the two classes. This has two effects: instances of the remote class (the first argument) will be allowed in through the security layer, and instances of the local class (the second argument) will be used to contain the state that is transmitted when the sender serializes the remote object. persisted (across time) differently than they are transmitted (across [memory]space). When this is run, it produces the following output: [-] twisted.spread.pb.PBServerFactory starting on 8800 [-] Starting factory <twisted.spread.pb.PBServerFactory instance at 0x406159cc> [Broker,0,127.0.0.1] got pond: <__builtin__.ReceiverPond instance at 0x406ec5ec> [Broker,0,127.0.0.1] 7 frogs % ./copy_sender.py 7 frogs copy_sender.CopyPond pond arrived safe and sound Main loop terminated. % Controlling the Copied State By overriding getStateToCopy and markers before sending, then upon receipt replace those markers with references to a receiver-side proxy that could perform the same operations against a local cache of data. Another good use for getStateToCopy is to implement local-only attributes: data that is only accessible by the local process, not to any remote users. For example, a attribute could be removed from the object state before sending to a remote system. Combined with the fact that Copyable objects return unchanged from a round trip, this could be used to build a challenge-response system (in fact PB does this with pb.Referenceable objects to implement authorization as described here). Whatever getStateToCopy returns from the sending object will be serialized and sent over the wire; setCopyableState gets whatever comes over the wire and is responsible for setting up the state of the object it lives in. #! /usr/bin/python from twisted.spread import pb class FrogPond: def __init__(self, numFrogs, numToads): self.numFrogs = numFrogs self.numToads = numToads def count(self): return self.numFrogs + self.numToads class SenderPond(FrogPond, pb.Copyable): def getStateToCopy(self): d = self.__dict__.copy() d['frogsAndToads'] = d['numFrogs'] + d['numToads'] del d['numFrogs'] del d['numToads'] return d class ReceiverPond(pb.RemoteCopy): def setCopyableState(self, state): self.__dict__ = state def count(self): return self.frogsAndToads pb.setUnjellyableForClass(SenderPond, ReceiverPond) #! /usr/bin/python from twisted.spread import pb, jelly from twisted.python import log from twisted.internet import reactor from copy2_classes import SenderPond class Sender: def __init__(self, pond): self.pond = pond def got_obj(self, obj): d = obj(): pond = SenderPond(3, 4) print "count %d" % pond.count() sender = Sender(pond) factory = pb.PBClientFactory() reactor.connectTCP("localhost", 8800, factory) deferred = factory.getRootObject() deferred.addCallback(sender.got_obj) reactor.run() if __name__ == '__main__': main() #! /usr/bin/python from twisted.application import service, internet from twisted.internet import reactor from twisted.spread import pb import copy2_classes # needed to get ReceiverPond registered with Jelly class Receiver(pb.Root): def remote_takePond(self, pond): print " got pond:", pond print " count %d" % pond.count() return "safe and sound" # positive acknowledgement def remote_shutdown(self): reactor.stop() application = service.Application("copy_receiver") internet.TCPServer(8800, pb.PBServerFactory(Receiver())).setServiceParent( service.IServiceCollection(application)) In this example, the classes are defined in a separate source file, which also sets up the binding between them. The SenderPond and ReceiverPond are unrelated save for this binding: they happen to implement the same methods, but use different internal instance variables to accomplish them. The recipient of the object doesn't even have to import the class definition into their namespace. It is sufficient that they import the class definition (and thus execute the setUnjellyableForClass statement). The Jelly layer remembers the class definition until a matching object is received. The sender of the object needs the definition, of course, to create the object in the first place. When run, the copy2 example emits the following: % twistd -n -y copy2_receiver.py [-] twisted.spread.pb.PBServerFactory starting on 8800 [-] Starting factory <twisted.spread.pb.PBServerFactory instance at 0x40604b4c> [Broker,0,127.0.0.1] got pond: <copy2_classes.ReceiverPond instance at 0x406eb2ac> [Broker,0,127.0.0.1] count 7 % ./copy2_sender.py count 7 pond arrived safe and sound Main loop terminated. % Things To Watch Out For - The first argument to setUnjellyableForClassmust refer to the class as known by the sender. The sender has no way of knowing about how your local importstatements are set up, and Python's flexible namespace semantics allow you to access the same class through a variety of different names. You must match whatever the sender does. Having both ends import the class from a separate file, using a canonical module name (no sibiling imports), is a good way to get this right, especially when both the sending and the receiving classes are defined together, with the setUnjellyableForClassimmediately following them. (XXX: this works, but does this really get the right names into the table? Or does it only work because both are defined in the same (wrong) place?) - The class that is sent must inherit from pb.Copyable. The class that is registered to receive it must inherit from pb.RemoteCopy 2. - The same class can be used to send and receive. Just have it inherit from both pb.Copyableand pb.RemoteCopy. This will also make it possible to send the same class symmetrically back and forth over the wire. But don't get confused about when it is coming (and using setCopyableState) versus when it is going (using getStateToCopy). InsecureJellyexceptions are raised by the receiving end. They will be delivered asynchronously to an errbackhandler. If you do not add one to the Deferredreturned by callRemote, then you will never receive notification of the problem. - The class that is derived from pb.RemoteCopywill be created using a constructor __init__method that takes no arguments. All setup must be performed in the setCopyableStatemethod. As the docstring on RemoteCopysays, don't implement a constructor that requires arguments in a subclass of RemoteCopy. XXX: check this, the code around jelly._Unjellier.unjelly:489 tries to avoid calling __init__just in case the constructor requires args. More Information pb.Copyableis mostly implemented in twisted.spread.flavors, and the docstrings there are the best source of additional information. Copyableis also used in twisted.web.distribto deliver HTTP requests to other programs for rendering, allowing subtrees of URL space to be delegated to multiple programs (on multiple machines). twisted.manhole.exploreralso uses Copyableto distribute debugging information from the program under test to the debugging tool. pb.Cacheable Sometimes the object you want to send to the remote process is big and slow. big means it takes a lot of data (storage, network bandwidth, processing) to represent its state. slow means that state doesn't change very frequently. It may be more efficient to send the full state only once, the first time it is needed, then afterwards only send the differences or changes in state whenever it is modified. The pb.Cacheable class provides a framework to implement this. pb.Cacheable is derived from pb.Copyable, so it is based upon the idea of an object's state being captured on the sending side, and then turned into a new object on the receiving side. This is extended to have an object publishing on the sending side (derived from pb.Cacheable), matched with one observing on the receiving side (derived from pb.RemoteCache). To effectively use pb.Cacheable, you need to isolate changes to your object into accessor functions (specifically setter functions). Your object needs to get control every single time some attribute is changed You derive your sender-side class from pb.Cacheable, and you add two methods: getStateToCacheAndObserveFor and stoppedObserving. The first is called when a remote caching reference is first created, and retrieves the data with which the cache is first filled. It also provides an object called the observer. The first time a reference to the pb.Cacheable object is sent to any particular recipient, a sender-side Observer will be created for it, and the getStateToCacheAndObserveFor method will be called to get the current state and register the Observer. The state which that returns is sent to the remote end and turned into a local representation using setCopyableState just like pb.RemoteCopy, described above (in fact it inherits from that class). After that, your setter functions on the sender side should call callRemote on the Observer, which causes observe_* methods to run on the receiver, which are then supposed to update the receiver-local (cached) state. When the receiver stops following the cached object and the last reference goes away, the pb.RemoteCache object can be freed. Just before it dies, it tells the sender side it no longer cares about the original object. When that reference count goes to zero, the Observer goes away and the pb.Cacheable object can stop announcing every change that takes place. The stoppedObserving method is used to tell the pb.Cacheable that the Observer has gone away. With the pb.Cacheable and pb.RemoteCache classes in place, bound together by a call slave object in sync with the sender-side master object. Example Here is a complete example, in which the MasterDuckPond is controlled by the sending side, and the SlaveDuckPond is a cache that tracks changes to the master: #! /usr/bin/python from twisted.spread import pb class MasterDuckPond(pb.Cacheable): def __init__(self, ducks): self.observers = [] self.ducks = ducks def count(self): print "I have [%d] ducks" % len(self.ducks) def addDuck(self, duck): self.ducks.append(duck) for o in self.observers: o.callRemote('addDuck', duck) def removeDuck(self, duck): self.ducks.remove(duck) for o in self.observers: o.callRemote('removeDuck', duck) def getStateToCacheAndObserveFor(self, perspective, observer): self.observers.append(observer) # you should ignore pb.Cacheable-specific state, like self.observers return self.ducks # in this case, just a list of ducks def stoppedObserving(self, perspective, observer): self.observers.remove(observer) class SlaveDuckPond(pb.RemoteCache): # This is a cache of a remote MasterDuckPond def count(self): return len(self.cacheducks) def getDucks(self): return self.cacheducks def setCopyableState(self, state): print " cache - sitting, er, setting ducks" self.cacheducks = state def observe_addDuck(self, newDuck): print " cache - addDuck" self.cacheducks.append(newDuck) def observe_removeDuck(self, deadDuck): print " cache - removeDuck" self.cacheducks.remove(deadDuck) pb.setUnjellyableForClass(MasterDuckPond, SlaveDuckPond) #! /usr/bin/python from twisted.spread import pb, jelly from twisted.python import log from twisted.internet import reactor from cache_classes import MasterDuckPond class Sender: def __init__(self, pond): self.pond = pond def phase1(self, remote): self.remote = remote d = remote.callRemote("takePond", self.pond) d.addCallback(self.phase2).addErrback(log.err) def phase2(self, response): self.pond.addDuck("ugly duckling") self.pond.count() reactor.callLater(1, self.phase3) def phase3(self): d = self.remote.callRemote("checkDucks") d.addCallback(self.phase4).addErrback(log.err) def phase4(self, dummy): self.pond.removeDuck("one duck") self.pond.count() self.remote.callRemote("checkDucks") d = self.remote.callRemote("ignorePond") d.addCallback(self.phase5) def phase5(self, dummy): d = self.remote.callRemote("shutdown") d.addCallback(self.phase6) def phase6(self, dummy): reactor.stop() def main(): master = MasterDuckPond(["one duck", "two duck"]) master.count() sender = Sender(master) factory = pb.PBClientFactory() reactor.connectTCP("localhost", 8800, factory) deferred = factory.getRootObject() deferred.addCallback(sender.phase1) reactor.run() if __name__ == '__main__': main() #! /usr/bin/python from twisted.application import service, internet from twisted.internet import reactor from twisted.spread import pb import cache_classes class Receiver(pb.Root): def remote_takePond(self, pond): self.pond = pond print "got pond:", pond # a DuckPondCache self.remote_checkDucks() def remote_checkDucks(self): print "[%d] ducks: " % self.pond.count(), self.pond.getDucks() def remote_ignorePond(self): # stop watching the pond print "dropping pond" # gc causes __del__ causes 'decache' msg causes stoppedObserving self.pond = None def remote_shutdown(self): reactor.stop() application = service.Application("copy_receiver") internet.TCPServer(8800, pb.PBServerFactory(Receiver())).setServiceParent( service.IServiceCollection(application)) When run, this example emits the following: % twistd -n -y cache_receiver.py [-] twisted.spread.pb.PBServerFactory starting on 8800 [-] Starting factory <twisted.spread.pb.PBServerFactory instance at 0x40615acc> [Broker,0,127.0.0.1] cache - sitting, er, setting ducks [Broker,0,127.0.0.1] got pond: <cache_classes.SlaveDuckPond instance at 0x406eb5ec> [Broker,0,127.0.0.1] [2] ducks: ['one duck', 'two duck'] [Broker,0,127.0.0.1] cache - addDuck [Broker,0,127.0.0.1] [3] ducks: ['one duck', 'two duck', 'ugly duckling'] [Broker,0,127.0.0.1] cache - removeDuck [Broker,0,127.0.0.1] [2] ducks: ['two duck', 'ugly duckling'] [Broker,0,127.0.0.1] dropping pond % % ./cache_sender.py I have [2] ducks I have [3] ducks I have [2] ducks Main loop terminated. % Points to notice: - There is one Observerfor each remote program that holds an active reference. Multiple references inside the same program don't matter: the serialization layer notices the duplicates and does the appropriate reference counting 5. - Multiple Observers need to be kept in a list, and all of them need to be updated when something changes. By sending the initial state at the same time as you add the observer to the list, in a single atomic action that cannot be interrupted by a state change, you insure that you can send the same status update to all the observers. - The observer.callRemotecalls can still fail. If the remote side has disconnected very recently and stoppedObservinghas not yet been called, you may get a DeadReferenceError. It is a good idea to add an errback to those callRemotes to throw away such an error. This is a useful idiom: observer.callRemote('foo', arg).addErrback(lambda f: None)(XXX: verify that this is actually a concern) getStateToCacheAndObserverFormust return some object that represents the current state of the object. This may simply be the object's __dict__attribute. It is a good idea to remove the pb.Cacheable-specific members of it before sending it to the remote end. The list of Observers, in particular, should be left out, to avoid dizzying recursive Cacheable references. The mind boggles as to the potential consequences of leaving in such an item. - A perspectiveargument is available to getStateToCacheAndObserveFor, as well as stoppedObserving. I think the purpose of this is to allow viewer-specific changes to the way the cache is updated. If all remote viewers are supposed to see the same data, it can be ignored. XXX: understand, then explain use of varying cached state depending upon perspective. More Information - The best source for information comes from the docstrings in twisted.spread.flavors, where pb.Cacheableis implemented. twisted.manhole.exploreruses Cacheable, and does some fairly interesting things with it. (XXX: I've heard explorer is currently broken, it might not be a good example to recommend) - The spread.publishmodule also uses Cacheable, and might be a source of further information. Footnotes Note that, in this context, unjellyis a verb with the opposite meaning of jelly. The verb to jellymeans to serialize an object or data structure into a sequence of bytes (or other primitive transmittable/storable representation), while to unjellymeans to unserialize the bytestream into a live object in the receiver's memory space. Unjellyableis a noun, (not an adjective), referring to the the class that serves as a destination or recipient of the unjellying process. A is unjellyable into Bmeans that a serialized representation A (of some remote object) can be unserialized into a local object of type B. It is these objects Bthat are the Unjellyablesecond argument of the setUnjellyableForClassfunction. In particular, unjellyabledoes not mean cannot be jellied. Unpersistablemeans not persistable, but unjelly, unserialize, and unpicklemean to reverse the operations of jellying, serializing, and pickling. pb.RemoteCopyis actually defined as flavors.RemoteCopy, but pb.RemoteCopyis the preferred way to access it - of course you could be clever and add a hook to __setattr__, along with magical change-announcing subclasses of the usual builtin types, to detect changes that result from normal =set operations. The semi-magical property attributesthat were introduced in Python-2.2 could be useful too. The result might be hard to maintain or extend, though. - this is actually a RemoteCacheObserver, but it isn't very useful to subclass or modify, so simply treat it as a little demon that sits in your pb.Cacheableclass and helps you distribute change notifications. The only useful thing to do with it is to run its callRemotemethod, which acts just like a normal pb.Referenceable's method of the same name. - this applies to multiple references through the same Broker. If you've managed to make multiple TCP connections to the same program, you deserve whatever you get.
http://twistedmatrix.com/projects/core/documentation/howto/pb-copyable.html
crawl-002
refinedweb
3,989
51.04
CSE/EEE 230 Spring 2018 Assignment 4 Due March 29 11:59PM Write and test a MIPS program consisting of four functions. In the following descriptions, the symbol & means “address of”. 1. void main(): The main function must 1) print your name 2) call the readData function 3) call count function 4) complete the program. The main function must set up all parameters before calling each of the functions. 2. int readData (&array): The starting address of an array is passed to the function as a parameter using $a0. The function must prompt for and read and store integers in the array until either a zero is entered or 10 numbers are read. Once the tenth integer is entered, your program must stop reading. The function must return (using $v0) the number of values read and stored in the array (10 or less). The zero input is not part of the array and must not be stored in the array. If the first input is a zero, then the array will be empty and the count returned is zero. 3.
https://www.coursehero.com/file/29739178/230-S18-Assign4pdf/
CC-MAIN-2022-05
refinedweb
180
70.33
I completely re-worked my Developing with .NET on Microsoft Azure course earlier this year, and the new videos are now available. Here are some of the changes from the previous version of the course: - I show how to use the Azure CLI for Azure automation from the command line. The CLI works across platforms and the commands are easy to discover. - I show how to setup a local Git repository in an Azure App Service and demonstrate how to deploy ASP.NET Core apps from the repo. - The Azure Functions module uses the new 2.0 runtime to develop a function locally. - The Azure Function is a function using blob storage, Cognitive Services, and Azure CosmosDB. - Numerous other changes to catch up with new features in Azure and VSTS Enjoy! Here are some other topics you'll see covered in the course: - Develop and deploy an ASP.NET Core application to Azure App Services - Manage configuration settings for an App Service - Monitor and scale an App Service - Work with input and output bindings in Azure Functions - Create a git repository with a remote in VSTS or Azure App Services - Setup a build and release pipeline using VSTS for continuous deployment - Connect to Azure storage using the Portal, C# code, and Azure Storage Explorer - Save and retrieve files from blob storage - Configure alerts - Monitor performance metrics using Application Insights - Choose an API for CosmosDB storage - Create and read documents in CosmosDB - Create and read records in Azure SQL using Entity Framework Core In an earlier post we looked at decrypting an asymmetric key using Key Vault. After decryption, we could use the key to decrypt other secrets from Key Vault, like encrypted connection strings. This raises the question – do we need to encrypt our secrets in Key Vault? If we still need to encrypt our secrets, what value does Key Vault provide? The short answers are maybe, and a lot. It’s not a requirement to encrypt secrets before storing the secrets into key vault, but for those of use who work in highly regulated industries, it is difficult to justify to an auditor why we are not encrypting all sensitive pieces of information. Keep in mind that Key Vault already encrypts our secrets at rest and will only use secure communication protocols, so secrets are safe on the network, too. The only benefit of us encrypting the secret before giving the secret to key vault is to keep the plain text from appearing in the portal or as the output of a script. For applications running outside of “encrypt all secrets no matter the cost” mandates, the built-in safety mechanisms of Key Vault are good enough if you follow the right practices. Key Vault allows us to separate the roles of key managers, key consumers, and developers. The separation is important in the production data environment. The security team is the team who can create key vaults for production and create keys and secrets inside a vault. When a system needs access to a given database, the security team can create a login for the application, then add the connection string as a secret in the vault. The team can then give developers a URL that leads to the secret. Developers never need to read or see the secret. Developers only need to place the secret URL in a location where the running application can retrieve the URL as a parameter. The location could be a configuration file, or developers could place the URL into an ARM template to update application settings during a deployment. The security team grants the application read access to secrets in the Key Vault. At run time, an application can read a connection string from the vault and connect to a database. Finally, an auditor can review access logs and make sure the security team is rotating keys and secrets on a regular basis. Best security practices require periodic changes to passwords and access keys. Azure services that rely on access keys enable this scenario by providing two access keys – a primary and secondary. Azure Key vault also helps with this scenario by versioning all secrets in the vault and allowing access to multiple versions (this month's key, and last month's key, for example). We can also roll connection strings. Take the following scenario as an example. 1. Security team creates a login for an application in Azure SQL. They place a connection string for this login into Key Vault. We'll call this connection string secret C1. 2. Devops deploys application with URL to the C1 secret. 3. After 30 days, security team creates a new login for application. They place the connection string in KeyVault. This is C2. 4. At some point in the next 30 days, devops will deploy the application and update the URL to point to C2. 5. After those 30 days, security team removes the login associated with C1. 6. GOTO 1 Key Vault is an important piece of infrastructure for applications managing sensitive data. Keeping all the secrets and keys for a system in Azure Key Vault not only helps you protect those secrets, but also gives you a place to inventory and audit your secrets. The next few posts are tips for developers using Azure Key Vault. The documentation and examples for Key Vault can be frustratingly superficial. The goal of the next few posts is to clear up some confusion I’ve seen. In this first post we’ll talk about encryption and decryption with Key Vault. But first, we’ll set up some context. Over the years we’ve learned to treat passwords and other secrets with care. We keep secrets out of our source code and encrypt any passwords in configuration files. These best practices add a layer of security that helps to avoid accidents. Given how entrenched these practices are, the following line of code might not raise any eyebrows. var appId = Configuration["AppId"]; var appSecret = Configuration["AppSecret"]; var encyptedSecret = keyVault.GetSecret("dbcredentials", appId, appSecret"); var decryptionKey = Configuration["DecryptKey"]; var connectionString = CryptoUtils.Decrypt(encryptedSecret, decryptKey); Here are three facts we can deduce from the above code. 1. The application’s configuration sources hold a secret key to access the vault. 2. The application needs to decrypt the connection strings it fetches from the vault. 3. The application’s configuration sources hold the decryption key for the connection string. Let’s work backwards through the list of items to see what we can improve. Most presentations about Key Vault will tell you that you can store keys and secrets in the vault. Keys and secrets are two distinct categories in Key Vault. A secret can be a connection string, a password, an access token, or nearly anything you can stringify. A key, however, can only be a specific type of key. Key Vault’s current implementation supports 2048-bit RSA keys. You can have soft keys, which Azure encrypts at rest, or create keys in a hardware security module (HSM). Soft keys and HSMs are the two pricing tiers for Key Vault. You can use an RSA key in Key Vault to encrypt and decrypt data. There is a special advantage to using key vault for decryption which we’ll talk about in just a bit. However, someone new to the cryptosystem world needs to know that RSA keys, which are asymmetric keys and computationally expensive compared to symmetric keys, will only encrypt small amounts of data. So, while you won’t use an RSA key to decrypt a database connection string, you could use an RSA key to decrypt a symmetric key the system uses for crypto operations on a database connection string. The .NET wrapper for Azure Key Vault is in the Microsoft.Azure.KeyVault package. If you want to use the client from a system running outside of Azure, you’ll need to authenticate using the Microsoft.IdentityModel.Clients.ActiveDirectory package. I’ll show how to authenticate using a custom application ID and secret in this post, but if you are running a system inside of Azure you should use a system’s Managed Service Identity instead. We’ll look at MSI in a future post. The Key Vault client has a few quirks and exposes operations at a low level. To make the client easier to work with we will create a wrapper. public class KeyVaultCrypto : IKeyVaultCrypto { private readonly KeyVaultClient client; private readonly string keyId; public KeyVaultCrypto(KeyVaultClient client, string keyId) { this.client = client; this.keyId = keyId; } public async Task<string> DecryptAsync(string encryptedText) { var encryptedBytes = Convert.FromBase64String(encryptedText); var decryptionResult = await client.DecryptAsync(keyId, JsonWebKeyEncryptionAlgorithm.RSAOAEP, encryptedBytes); var decryptedText = Encoding.Unicode.GetString(decryptionResult.Result); return decryptedText; } public async Task<string> EncryptAsync(string value) { var bundle = await client.GetKeyAsync(keyId); var key = bundle.Key; using (var rsa = new RSACryptoServiceProvider()) { var parameters = new RSAParameters() { Modulus = key.N, Exponent = key.E }; rsa.ImportParameters(parameters); var byteData = Encoding.Unicode.GetBytes(value); var encryptedText = rsa.Encrypt(byteData, fOAEP: true); var encodedText = Convert.ToBase64String(encryptedText); return encodedText; } } } Here are a few points about the code that may not be obvious. First, notice the EncryptAsync method fetches an RSA key from Key Vault and executes an encryption algorithm locally. Key Vault can encrypt data we post to the vault via an HTTPS message, but local encryption is faster, and there is no problem giving a system access to the public part of the RSA key. Secondly, speaking of public keys, only the public key is available to the system. The API call to GetKeyAsync doesn’t return private key data. This is why the DecryptAsync wrapper method does use the Key Vault API for decryption. In other words, private keys never leave the vault, which is one reason to use Key Vault for decryption instead of bringing private keys into the process. The steps for creating a vault, creating a key, and granting access to the key for an application are all steps you can find elsewhere. Once those steps are complete, we need to initialize a KeyVaultClient to give to our wrapper. In ASP.NET Core, the setup might look like the following inside of ConfigureServices. services.AddSingleton<IKeyVaultCrypto>(sp => {); return new KeyVaultCrypto(client, Configuration["KeyId"]); }); In the above code we use an application ID and secret to generate an access token for Key Vault. In other words, the application needs one secret stored outside of Key Vault to gain access to secrets stored inside of Key Vault. In a future post we will assume the application is running inside of Azure and remove the need to know a bootstrapping secret. Otherwise, systems requiring encryption of the bootstrap secret should use a DPAPI library, or for ASP.NET Core, the Data Protection APIs. Now that we know how to decrypt secrets with private keys in Key Vault, the application no longer needs to store a decryption key for the connection string. var encyptedSecret = keyVault.GetSecret("dbcredentials", appId, appSecret); var connectionString = keyVault.Decrypt(encryptedSecret, decryptionKeyId); We'll continue discussing this scenario in future posts. My latest Pluralsight course is “Building Your First Salesforce Application”. Learn how to work with Salesforce.com by creating custom applications. Start by signing up for a developer account on Salesforce.com, and finish with a full application including reports and dashboards that work on both desktops and mobile devices. Salesforce is a new territory for me, and when the course was announced the question poured in. Are you moving to the Salesforce platform? The short answer is no. The longer answer is that I hear Salesforce in conversations more often. Companies and developers need to either build software on the Salesforce platform or use Salesforce APIs. There was a time when I thought of Salesforce as a customer relationship solution, but in these conversations I also started to hear Salesforce described as a database, as a cloud provider, and as an identity provider. I wanted to find out for myself what features and capabilities Salesforce could offer. I spent some time with a developer account on Salesforce, and when Pluralsight said they needed a beginner course on the topic, I decided to make this course. I hope you enjoy watching and learning! I've seen parameter validation code inside controller actions on an HTTP GET request. However, the model binder in ASP.NET Core will populate the ModelState data structure with information about all input parameters on any type of request. In other words, model binding isn't just for POST requests with form values or JSON. Take the following class, for example. public class SearchParameters { [Required] [Range(minimum:1, maximum:int.MaxValue)] public int? Page { get; set; } [Required] [Range(minimum:10, maximum:100)] public int? PageSize { get; set; } [Required] public string Term { get; set; } } We'll use the class in the following controller. [Route("api/[controller]")] public class SearchController : Controller { [HttpGet] public IActionResult Get(SearchParameters parameters) { if (!ModelState.IsValid) { return BadRequest(ModelState); } var model = // build the model ... return new OkObjectResult(model); } } Let's say a client sends a GET request to /api/search?pageSize=5000. We don't need to write validation code for the input in the action, all we need to do is check model state. For a request to /api/search?pageSize=5000, the above action code will return a 400 (bad request) error. { "Page":["The Page field is required."], "PageSize":["The field PageSize must be between 10 and 100."], "Term":["The Term field is required."] } For the Required validation to activate for Page and PageSize, we need to make these int type properties nullable. Otherwise, the runtime assigns a default value 0 and the Range validation fails, which might be confusing to clients. Give your input model a default constructor to provide default values and you won't need nullable properties or the Required attributes. Of course, this approach only works if you can provide sensible default values for the inputs. public class SearchParameters { public SearchParameters() { Page = 1; PageSize = 10; Term = String.Empty; } [Range(minimum:1, maximum:int.MaxValue)] public int? Page { get; set; } [Range(minimum:10, maximum:100)] public int? PageSize { get; set; } public string Term { get; set; } } I’ve decided to write down some of the steps I just went through in showing someone how to create and debug an ASP.NET Core controller. The controller is for an API that needs to accept a few pieces of data, including one piece of data as a byte array. The question asked specifically was how to format data for the incoming byte array. Instead of only showing the final solution, which you can find if you read various pieces of documentation, I want to show the evolution of the code and a thought process to use when trying to figure out the solution. While the details of this post are specific to sending byte arrays to an API, I think the general process is one to follow when trying to figure what works for an API, and what doesn’t work. To start, collect all the information you want to receive into a single class. The class will represent the input model for the API endpoint. public class CreateDocumentModel { public byte[] Document { get; set; } public string Name { get; set; } public DateTime CreationDate { get; set; } } Before we use the model as an input to an API, we’ll use the model as an output. Getting output from an API is usually easy. Sending input to an API can be a little bit trickier, because we need to know how to format the data appropriately and fight through some generic error messages. With that in mind, we’ll create a simple controller action to respond to a GET request and send back some mock data. [HttpGet] public IActionResult Get() { var model = new CreateDocumentModel() { Document = new byte[] { 0x03, 0x10, 0xFF, 0xFF }, Name = "Test", CreationDate = new DateTime(2017, 12, 27) }; return new ObjectResult(model); } Now we can use any tool to see what our data looks like in a response. The following image is from Postman. What we see in the response is a string of characters for the “byte array” named document. This is one of those situations where having a few years of experience can help. To someone new, the characters look random. To someone who has worked with this type of data before, the trailing “=” on the string is a clue that the byte array was base64 encoded into the response. I’d like to say this part is easy, but there is no substitute for experience. For beginners, one also has to see how C# properties in PascalCase map to JSON properties in camelCase, which is another non-obvious hurdle to formatting the input correctly. Once you’ve figured out to use base64 encoding, it’s time to try to send this data back into the API. Before we add any logic, we’ll create a simple echo endpoint we can experiment with. [HttpPost] public IActionResult CreateDocument([FromBody] CreateDocumentModel model) { return new ObjectResult(model); } With the endpoint in place, we can use Postman to send data to the API and inspect the response. We’ll make sure to set a Content-Type header to application/json, and then fire off a POST request by copying data from the previous response. Voilà! The model the API returns looks just like the model we sent to the API. Being able to roundtrip the model is a good sign, but we are only halfway through the journey. We now have a piece of code we can experiment with interactively to understand how the code will behave in different circumstances. We want a deeper understanding of how the code behaves because our clients might not always send the model we expect, and we want to know what can go wrong before the wrong things happen. Here are some questions to ask. Q: Is a base64 encoded string the only format we can use for the byte array? A: No. The ASP.NET Core model binder for byte[] also understands how to process a JSON array. { "document": [1, 2, 3, 254], "name": "Test input", "creationDate": "2017-12-27T00:00:00" } Q: What happens if the document property is missing in the POST request? A: The Document property on the input model will be null. Q: What happens if the base64 encoding is corrupt, or when using an array, a value is outside the range of a byte? A: The model input parameter itself will be null I’m sure you can think of other interesting questions. There are two points I’m making in this post: 1. When trying to figure out how to get some code to work, take small steps that are easy to verify. 2. Once the code is working, it is often worthwhile to spend a little more time to understand why the code works and how the code will behave when the inputs aren’t what you expect. In a previous post we looked at using Azure AD groups for authorization. I mentioned in that post how you need to be careful when pulling group membership claims from Azure AD. In this post we’ll look at the default processing of claims in ASP.NET Core and see how to avoid the overheard of carrying around too many group claims. The first issue I want to address in this post is the change in claims processing with ASP.NET Core 2. Dominick Baier has a blog post about missing claims in ASP.NET Core. This is a good post to read if you are using the OIDC services and middleware. The post covers a couple different issues, but I want to call out the “missing claims” issue specifically. The OIDC options for ASP.NET Core include a property named ClaimActions. Each object in this property’s collection can manipulate claims from the OIDC provider. By manipulate, I mean that all the claim actions installed by default will remove specific claims. For example, there is an action to delete the ipaddr claim, if present. Dom’s post includes the full list. I think ASP.NET Core is removing claims to reduce cookie bloat. In my experiments, the dozen or so claims dropped by the default settings will reduce the size of the authentication cookies by 1,500 bytes, or just over 30%. Many of the claims, like IP address, don’t have any ongoing value to most applications, so there is no need to store the value in a cookie and pass the value around in every request. If you want the deleted claims to stick around, there is a hard way and a straightforward way to achieve the goal. I’ve seen at least two software projects with the same 20 to 25 lines of code inside. The code originates from a Stack Overflow answer to solve the missing claims issue and explicitly parses all the claims from the OIDC provider. If you want all the claims, you don’t need 25 lines of code. You just need a single line of code. services.AddAuthentication() .AddOpenIdConnect(options => { // this one: options.ClaimActions.Clear(); }); However, make sure you really want all the claims saved in the auth cookie. In the case of AD group membership, the application might only need to know about 1 or 2 groups while the user might be a member of 10 groups. Let’s look at approaches to removing the unused group claims. My first thought was to use the collection of ClaimActions on the OIDC options to remove group claims. The collection holds ClaimAction objects, where ClaimAction is an abstract base class in the ASP.NET OAuth libraries. None of the built-in concrete types do exactly what I’m looking for, so here is a new ClaimAction derived class to remove unused groups. public class FilterGroupClaims : ClaimAction { private string[] _ids; public FilterGroupClaims(params string[] groupIdsToKeep) : base("groups", null) { _ids = groupIdsToKeep; } public override void Run(JObject userData, ClaimsIdentity identity, string issuer) { var unused = identity.FindAll(GroupsToRemove).ToList(); unused.ForEach(c => identity.TryRemoveClaim(c)); } private bool GroupsToRemove(Claim claim) { return claim.Type == "groups" && !_ids.Contains(claim.Value); } } Now we Just need to add a new instance of this class to the ClaimActions, and pass in a list of groups we want to use. options.ClaimActions.Add(new FilterGroupClaims( "c5038c6f-c5ac-44d5-93f5-04ec697d62dc", "7553192e-1223-0109-0310-e87fd3402cb7" )); ClaimAction feels like an odd abstraction, however. It makes no sense for the base class constructor to need both a claim type and claim value type when these parameters go unused in the derived class logic. A ClaimAction is also specific to the OIDC handler in Core. Let’s try this again with a more generic claims transformation in .NET Core. Services implementing IClaimsTransformation in ASP.NET Core are useful in a number of different scenarios. You can add new claims to a principal, map existing claims, or delete claims. For removing group claims, we first need an implementation of IClaimsTransformation. public class FilterGroupClaimsTransformation : IClaimsTransformation { private string[] _groupObjectIds; public FilterGroupClaimsTransformation(params string[] groupObjectIds) { // note: since the container resolves this service, we could // inject a data access class to fetch IDs from a database, // or IConfiguration, IOptions, etc. _groupObjectIds = groupObjectIds; } public Task<ClaimsPrincipal> TransformAsync(ClaimsPrincipal principal) { var identity = principal.Identity as ClaimsIdentity; if (identity != null) { var unused = identity.FindAll(GroupsToRemove).ToList(); unused.ForEach(c => identity.TryRemoveClaim(c)); } return Task.FromResult(principal); } private bool GroupsToRemove(Claim claim) { return claim.Type == "groups" && !_groupObjectIds.Contains(claim.Value); } } Register the transformer during ConfigureServices in Startup, and the unnecessary group claims disappear. Group claims are not difficult to use with Azure Active Directory, but you do need to take care in directories where users are members of many groups. Instead of fetching the group claims from Azure AD during authentication like we've done in the previous post, one could change the claims transformer to fetch a user’s groups using the Graph API and adding only claims for groups the application needs.
https://odetocode.com/blogs/all?page=10
CC-MAIN-2019-51
refinedweb
3,997
55.54
Announcing the Call for Code 2019 Global WinnerLearn more Tutorial Andy Shi | Published November 19, 2017 Microservices Istio is an open source project to better manage service mesh in the world of microservices. It puts together many new concepts, packages, and approaches to enhance the experience of controlling and monitoring microservices. One of the new concepts is “Mixer.” The Istio Mixer, as its name suggests, can take in different configurations and merge them with a different data source, then dispatch them to different channels. This is a very useful feature because it allows users to create a wide range of policies that meet their specific needs. However, the Mixer isn’t a completely simple tool; with increased capabilities comes increased complexity. The Mixer currently supports three categories of policies: The traditional policy format, which consists of match and action (a simple ACL-based approach), cannot accommodate the diversity of the rules. With so many new features and terms it can be confusing for users. In this tutorial, we’ll examine the three major parts of a Mixer configuration: the Adapter/Handler, the Instance, and the Rule. NOTE: The current version being referred to is Alpha version 0.2. Some terminology from version 0.1 has been deprecated. For example, in Alpha version 0.1 “Aspect” was a major concept, but it was difficult to position the concept while specifying both kind and adapter in the API. kind adapter Think of an adapter as a plugin. It’s the code block that performs the logical function and can be invoked by Mixer framework. The image below will help you understand the plugin structure. While some adapters may have connections to backend services like Prometheus or New Relic, others can perform the whole functionality within the adapter code itself, like quota or blacklist. Below is the list of the current adapters available: Of course, as with any plugin framework, you can create your own adapter. That task is beyond the scope of this guide. Handler is an adapter with operational parameters. One way to see this is to take Adapter as the class definition and Handler as the concrete object. In fact, in the configuration file, we only define the handler, which refers to the corresponding adapter. The following is an example of a quota handler. metadata: name: handler namespace: istio-config-default spec: quotas: - name: requestcount.quota.istio-config-default maxAmount: 5000 validDuration: 1s In this quota handler, we specify 5000 requests per second. The operational parameters are defined by the specific adapter. Each handler configuration is therefore different. Instance deals with data weaving. Envoy collects runtime data, but a handler only cares about part of it, so it’s important to pass useful information. There are grpc proto files called templates associated with the instances. Each instance has to fall into one of the templates. The current templates are: Next, let’s take a look at how the date is specified in the instance: “Dimension” actually means compound keys. The attributes are the keys, and are the information weaved mainly by Envoy. They are dispatched into each adapter and can be “cherry-picked” by the instance configuration. This quota instance categorizes the source, sourceVersion, destination and destinationVersion of each request into one compound key. When the handler gets the data, it will put each request into different buckets based on the compound key. The quota of 5000/sec is applied on those buckets individually. Note in the diagram each attribute has a name and expression. The names are fixed; that is, they cannot be changed. The list of names are available here. The value type, that is the int or string, is also fixed. However, the values are not bound. We can change the expression to get a different value. For example, instead of source: source.labels[“app”] we can use source: request.headers[“X-Forwarded-For”]. This will change the value from source label to source IP address. The “|” means alternative value if the previous value doesn’t exist. source sourceVersion destination destinationVersion source: source.labels[“app”] source: request.headers[“X-Forwarded-For”] Rules are used to specify when the instance data will be sent to handlers. You might ask: didn’t we just specify the dimension of the instance? Why do we need rules? Well, as it turns out, the relationship between handler and instance is many to many. So, you need rules to specify when to invoke what. Let’s look at an example: apiVersion: "config.istio.io/v1alpha2" kind: rule metadata: name: promtcp namespace: istio-system spec: match: context.protocol == "tcp" actions: - handler: handler.prometheus instances: - tcpbytesreceived.metric - tcpbytessent.metric In each rule, there is a match, which specifies a condition, and actions, which specify, well, the actions. In this example, when the protocol is TCP, the handler handler.prometheus will be called by two instances: tcpbytesent.metric and tcpbytereceived.metric. tcpbytesent.metric tcpbytereceived.metric Sometimes we want to apply to all situations. In those cases, we can have an empty match or write match: true. In summary, the rule defines when, the instance defines what (data), and the handler defines where (adapter) to dispatch the information. match: true Next, we’ll go through an example to illustrate those concepts. Our task is: use denier adapter (refer to the “list of adapters” image above) to deny all the requests if the user agent is curl. Before we start, it’s important to know that the Istio API follows the Kubernetes API format. There are certain structures and keywords in the format: apiVersion, kind, metadata and spec are the common ones. The first step is to create a handler of denier adapter. curl apiVersion metadata spec apiVersion: “config.istio.io/v1alpha2” kind: denier metadata: name: denyall namespace: istio-system spec: status: code: 7 message: Not allowed The current API version is config.istio.io/v1alpha2. “Kind” is the place to specify adaptor. “Name” is the name of the handler. “Namespace” specifies which namespace the handler can be applied on. The “istio-system” is the super namespace that can be applied on all namespaces in the cluster. Under “spec”, the content is required by the denier adapter. The second step is to create an instance: apiVersion: “config.istio.io/v1alpha2” kind: checknothing metadata: name: denyrequest namespace: istio-system spec: The “kind” here specifies the proto template “checknothing”. The name of this instance is “denyrequest”. Since we don’t need to check anything, the “spec” is left empty; that is, no information is going to be passed on to the handler. The rest are the same as the handler config. Lastly, let’s create the rule: apiVersion: "config.istio.io/v1alpha2" kind: rule metadata: name: mixerdenysome namespace: istio-system spec: match: match(request.headers["user-agent"], "curl*") actions: - handler: denyall.denier instances: - denyrequest.checknothing So far, we should know the “kind” value is “rule”. In “match”, since curl has different versions, it’s important to use partial match here. In “actions”, note that the reference to the handler is the name of handler plus the name of adapter(“kind” in the handler). And the reference to the instance is the name of the instance plus the template name of instance(“kind” in the instance). When we combine all three parts into a .yaml file and run istioctl apply -f xxx.yaml with it, the mixer config is created by Istio. .yaml istioctl apply -f xxx.yaml We hope this tutorial make things a little bit easier for you when writing a Mixer config! IBM Cloud is a great place to start your Istio journey. Conference October 12, 2019 New York IstioKubernetes+ Workshop October 10, 2019 CloudCloud Foundry+ Deploy a Python application to an OpenShift cluster on IBM Cloud using Docker images in a local repository, a GitHub… ContainersKubernetes+ Back to top
https://developer.ibm.com/tutorials/write-istio-mixer-policies/
CC-MAIN-2019-43
refinedweb
1,302
58.79
I'm trying to write a program using a dynamic array that will sum all the numbers before the number entered. (You enter 3 it does 1+2+3=6) Keep getting really wrong output numbers but can't find the error. Code:#include <iostream> using namespace std; void summation(int sumArray[], int array_size); typedef int* IntArrayPtr; int n, array_size, sum = 0; int main() { char choice = 'c'; while (choice == 'c' || choice == 'C') { cout <<"What is your ending number?: "; cin >> array_size; IntArrayPtr sumArray =; sumArray = new int[n]; summation(sumArray, n); cout <<"To quit enter q; to continue enter c."; cin >> choice; } if (choice == 'q' || choice == 'Q') { return 0; } } void summation(int sumArray[], int n) { while (n<array_size) {sum=sum + sumArray[n]; cout <<sum; n++;} cout <<"The sum of 1 to "<<array_size <<" is "<<sum<<endl; }
https://cboard.cprogramming.com/cplusplus-programming/115176-dynamic-array.html
CC-MAIN-2017-13
refinedweb
133
55.78
#include <crypto.h> Inheritance diagram for KLVEObject: This class gives access to single AS-DCP encrypted KLV items within an MXF file with KLVObject interfacing The AS-DCP encryption system adds 32 bytes to the start of the encrypted data. The AS-DCP encryption system forces all encrypted data to be in multiples of 16 bytes. Construct a new KLVEObject. Construct a KLVEObject linked to an encrypted KLVObject. Set the encryption wrapper. Set the decryption wrapper. Set a hasher to use when writing. The hasher must be initialized and ready to start hashing Set a hasher to use when reading. The hasher must be initialized and ready to start hashing Set an encryption Initialization Vector. Set a decryption Initialization Vector. Get the Initialization Vector that will be used for the next encryption. Get the Initialization Vector that will be used for the next decryption. Set the plaintext offset to use when encrypting. Get the plaintext offset of the encrypted data. Initialise the KLVEObject specifics after basic construction (and KLVObject::Init()). Reimplemented from KLVObject. Get the size of the key and length (not of the value). Reimplemented from KLVObject. Get a GCElementKind structure. Reimplemented from KLVObject. Write the key and length of the current DataChunk to the destination file. The key and length will be written to the source file as set by SetSource. If LenSize is zero the length will be formatted to match KLSize (if possible!) Write Out the Header Reimplemented from KLVObject. Write data from a given buffer to a given location in the destination file. Reimplemented from KLVObject. Set the context ID. Get the context ID. Load the AS-DCP set data. Sets DataLoaded on success Read the AS-DCP footer (if any). Calculate the size of the AS-DCP footer for this KLVEObject. The size it returned and also written to property FooterLength Write the AS-DCP footer (if fequired). Read an integer set of chunks from a specified position in the encrypted portion of the KLV value field into the DataChunk. Write encrypted data from a given buffer to a given location in the destination file. Pointer to the encryption wrapper. Pointer to the decryption wrapper. Pointer to a hasher being used for hashing data being written. Pointer to a hasher being used for hashing data being read. True once the AS-DCP header data has been read. The context ID used to link to encryption metadata. Number of unencrypted bytes at start of source data. DRAGONS: ValueLength is a standard MXF length (signed 64-bit), however the AS-DCP spec uses an unsigned 64-bit for PlaintextOffset. We use a Length for PlaintextOffset to keep comparison signs the same Key for the plaintext KLV. Length of the encrypted KLV Value. Number of bytes used to encode SourceLength in the KLVE (allows us to faithfully recreate if required). The Initialization Vector for this KLVE. The check value for this KLVE. The optional TrackFile ID or NULL. The optional Sequence Number of this KLVE within the TrackFile. True if SequenceNumber has been set or read. The optional MIC (if loaded or computed when reading or computed when writing) else NULL. Offset of the start of the encrypted value from the start of the KLV value. Encryption IV if one has been specified. The location of the next read (if reading in sequence) - used to detect random access attempts. The location of the next write (if writing in sequence) - used to detect random access attempts. Number of extra bytes decrypted last time that are buffer for the next read. Left over bytes from decrypting the last chunk - these will be returned first with the next read call. Number of left over bytes not encrypted last time that are buffer for the next write. Left over bytes from encrypting the last chunk - these will be written first at the next write call. The size of the AS-DCP footer to be written for this KLVEObject.
http://freemxf.org/mxflib-docs/mxflib-1.0.0-docs/classmxflib_1_1_k_l_v_e_object.html
CC-MAIN-2018-05
refinedweb
657
69.07
Data storage in Windows Azure Dominik Pinter — Nov 5, 2011 cloudcmskenticowindows azure Hello again, it´s time for another deep dive into Windows Azure. Today’s menu features Windows Azure storage. We will look at the possibilities of storing data in the whole platform, what is different from the standard Windows server and how to leverage new storages which Windows Azure offers. Let´s start with answering a question: „Where can I store my data in Windows Azure? “ There are a lot of alternatives to choose from. The first is SQL Azure. As I have certainly mentioned in one of my previous posts, SQL Azure is a cloud database very similar to Microsoft SQL server. One of my future blog posts will be focused entirely on SQL Azure, so let´s move on to next topic. The second option is to use one of the storages of Windows Azure AppFabric. These storages are not all-purpose; they are specific to certain tasks. The Service bus feature offers queues and topics. There you can store data used for communication between systems connected via the Service bus. The second type of storage is Windows Azure AppFabric cache. As its name suggests, this storage is meant for storing cache data. It is the cloud version of the Windows Server AppFabric product. You can use this storage for two purposes: Cache storage – with Kentico CMS 6 you are able to override the CacheHelper class, which is used for storing and accessing cached data, so that you can write a provider for the Windows Azure AppFabric cache. You may be wondering why we didn´t write it ourselves. The reason is that our caching functionality relies upon cache dependencies but the AppFabric API doesn’t work with CacheDependency object . So we decided rather to focus on other features than write a provider which right now cannot deliver the whole functionality. Session state storage – I have talked about that in my previous post - you can save session state into Windows Azure AppFabric. It´s very easy to set up, you just need to add a few sections to the web.config and add references to your project. The last option is to store data somewhere inside Windows Azure. First of all, you can store data in the local storage of an instance (Windows Azure virtual machine). The system has the NTFS format, therefore you can use the standard System.IO namespace to save files there. If you want to use it, you have to register the usage of local storage into the service definition file: <ServiceDefinition ... > <WebRole ... > ... <LocalResources> <LocalStorage name="MyLocalStorage" cleanOnRoleRecycle="true/false" /> </LocalResources> </WebRole> </ServiceDefinition> Then you need to get the root path of the local storage using this code: LocalResource temp = RoleEnvironment.GetLocalResource("MyLocalStorage"); string path = temp.RootPath; Now you can store whatever you want under this path. Local storage has a few significant disadvantages: Data stored in it isn´t persistent, thus in case your role is shut down, you lose all your data saved there. Data is stored only in one instance but in Windows Azure your application is typically running in multiple machine environment. If you store data in it, you need to take care about its synchronization. For these reasons I recommend using this storage for temporary data or as a cache. Kentico CMS uses it for these two purposes. On the other hand, there are three new types of storages in Windows Azure. These are more general-purpose and they are all built as scalable storages. Windows Azure blob storage Blob is an acronym for Binary Large Object, which means any file with any structure can be saved into this storage. There are two types of objects, blobs and containers. Blobs represent files while every blob is placed in a container. A container is very similar to a folder in a standard file system. One big difference is that the blob storage has flat structure. As you can see on the schema above, it has three levels – root level, container level and blob level. A container cannot contain another container. However, blob name consists of two parts – a prefix and a name. Prefixes can be used to emulate a tree structure by storing path to the files in them. Levels of the tree structure are defined by delimiters – the default delimiter is “/” and I personally recommend to leave it like that. The Blob storage API also offers virtual directory mechanism which uses blob prefixes so you can for example list blobs in certain virtual directory (with certain blob prefix). For better understanding, here is an example of this feature. Let´s say that we have these two blobs: /path1/blob1.txt /path1/path2/blob2.txt The paths are blob prefixes and blob1.txt and blob2.txt are blob names. If you list the /path1/path2/ virtual directory you get only the blob2.txt file. If you list /path1/, the result is blob1.txt - there will be no /path2/blob2.txt in the result listing (but you can change this by a special parameter). Virtual directories are defined by the prefix; there is no way to create or delete a virtual directory and every virtual directory contains at least one blob. Both blobs and containers can have several attributes specified. You can also define your custom attributes. The most important container attributes are access permissions. You have three choices: Full access – in this case, anyone can list and access blobs in the container. Blob only access – anyone can read blob content but cannot list the contents of the container. No public access – access to blobs and containers is restricted to authorized requests. This property is not available for blobs but you can use shared access key mechanism in order to set up access rights on blob level. The most used blob properties are last write time (which is in UTC, since all Windows Azure datacenters use this time) and E-tag. This property is an MD5 checksum of the current version of the blob. If you want to cache files on single instances (this is what Kentico CMS does), this property is very helpful. One thing I personally miss the most is a property/method which returns whether a blob exists or not. There are two possible workarounds – listing the contents of a container and comparing them with the blob name or a faster way – using FetchAttributes. The code can look like this: public bool IsBlobExist(CloudBlob myBlob) { try { // Try to fetch attributes - if file not exists exception is thrown myBlob.FetchAttributes(); return true; } catch (StorageClientException e) { // This exception indicated that blob doesn't exist if (e.ErrorCode == StorageErrorCode.ResourceNotFound) { return false; } else { throw; } } } This code tries to do the FetchAttributes operation. If the blob does not exist, an exception is thrown. This is the best practice to find out whether a blob exists or not. Windows Azure drive There are two options how to use the blob storage – use API directly (like in the example above), or use the Windows Azure drive. Let´s talk about the second choice first. This feature was designed to help you move your applications easier. You just mount a part of the blob storage as a disk in your virtual Azure machine and store your files there. This disk behaves the same way as any other NTFS disk and, of course, you can access it with the System.IO namespace. Internally, data is stored in a VHD file (this file is represented as a blob in the storage), so you can download this file a mount it locally. The guys from Microsoft modified a standard driver for disk access to work with blob storage. If you want to create and mount a Windows Azure drive, you just call this code: // Connect to storage StorageCredentialsAccountAndKey credentials = new StorageCredentialsAccountAndKey(storageName, sharedKey); CloudStorageAccount storageAccount = new CloudStorageAccount(credentials, false); // Initialize instance cache LocalResource localCache = RoleEnvironment.GetLocalResource("InstanceDriveCache"); CloudDrive.InitializeCache(localCache.RootPath, localCache.MaximumSizeInMegabytes); // Create container if not exist CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); blobClient.GetContainerReference("mycontainer").CreateIfNotExist(); // Create cloud drive myCloudDrive = storageAccount.CreateCloudDrive( blobClient .GetContainerReference("mycontainer") .GetPageBlobReference("azuredrive.vhd") .Uri.ToString() ); // Create drive try { myCloudDrive.Create(localCache.MaximumSizeInMegabytes); } catch { // Drive can be already created } // Mount drive string driveLetter = myCloudDrive.Mount(localCache.MaximumSizeInMegabytes, DriveMountOptions.Force); In this example I used the storage client library. First I to connected to the Windows Azure storage. Then I initialized a local storage for caching (you must also add local storage registration to the service definition file). After that I created a container and a blob on the Azure drive. The next step was to create the Azure drive. At the end I mounted the created drive and I stored the drive letter into a variable. From this moment you can use the Azure drive the same way as any other NTFS disk. This sounds really great but Windows Azure has one big disadvantage. You can mount a disk for read/write access only to one instance. Since applications on Windows Azure run typically on multiple instances, this is not what you want. There are options how to solve it, for example: One instance has write access while the other instances can use snapshots of a disk in read only mode. This solution is suitable only if instances can have up-to-date data with little delays because it takes some time to create new snapshots. Also, you need to implement a mechanism to send data from “read only instances” to “write access instance”. And what if an instance with write access will experience some failure? It takes 3 to 5 minutes to start a new instance (depends on size of application) so no data will be written in this interval. Every instance will have its own Windows Azure drive. But data will be cloned multiple times (depends on number of your instances). You will also need to synchronize file changes between instances. Another challenge is to ensure the right behavior when a new role starts. You definitely need to clone an Azure drive, the question is from where. The instance you choose can be slightly unsynchronized at the moment and the clone process can take some time as well. In this time your new instance won’t be able to synchronize data or even read them. In my opinion you can use Windows Azure drive as a temporary solution when moving your application to Windows Azure but nothing else. I personally don´t know any Windows Azure project that can scale out on Windows Azure and uses Windows Azure drive for storing the files at the same time. Blob storage API The basic storage API is REST based. Microsoft chose this because of independence on any language. You can send two types of requests – unauthorized and authorized. The first group is successful only if the given blob/container has set up access for public users and you can only do read operations, you cannot modify any data without authorization. For example, a call which requests a list of containers looks like this: GET HTTP/1.1 x-ms-version: 2011-08-18 x-ms-date: Sun, 25 Sep 2011 22:08:44 GMT Authorization: SharedKey myaccount:CY1OP3O3jGFpYFbTCBimLn0Xov0vt0khH/D5Gy0fXvg= The response looks like this: HTTP/1.1 200 OK Transfer-Encoding: chunked Content-Type: application/xml Date: Sun, 25 Sep 2011 22:08:54 GMT x-ms-version: 2011-08-18 Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 <?xml version="1.0" encoding="utf-8"?> <EnumerationResults AccountName=""> <MaxResults>3</MaxResults> <Containers> <Container> <Name>audio</Name> <Url></Url> <Properties> <Last-Modified>Wed, 12 Aug 2009 20:39:39 GMT</Last-Modified> <Etag>0x8CACB9BD7C6B1B2</Etag> </Properties> </Container> </EnumerationResults> I´m pretty sure that most of you don´t want to program directly against the REST API because you have to create and parse HTTP requests in your code, which is not comfortable. Fortunately there is a client library for some languages, including C#. The C# client library is a wrapper around the REST API, it is written and supported by Microsoft and it provides you with objects for working with the storage. The same listing using the client library looks like this: // Prepare credentials StorageCredentialsAccountAndKey credentials = new StorageCredentialsAccountAndKey("accountName", "sharedkey"); // Connect to blob storage CloudBlobClient client = new CloudBlobClient("blobEndpoint", credentials); // Get container reference CloudBlobContainer container = client.GetContainerReference(ci.ContainerName); // List blobs IEnumerable<IListBlobItem> collection = container.ListBlobs() ; As you can see, the result is a collection of objects. Very nice, isn´t it? Other storages Windows Azure offers two other storage types – queues and tables. Queue storage is basically a set of queues where you can send messages. It contains two types of objects – queue and message. The ideal behavior is FIFO (first in first out) style but the order of delivery is not guaranteed (as the shown in the diagram). A single message can have 8KB at most. You may ask “What is the purpose of this storage?” You can use it for communication between two different roles. The most basic scenario which is usually demonstrated is having a web front-end as a web role where users upload images and a worker role which creates thumbnails from them. Every time a user uploads an image, a message with the image information is sent from the web role to the worker role. The last type of storage is table storage. In this type data is organized in tables and rows like you’re used to from SQL servers. But there are significant differences. First of all, table storage in Windows Azure is not relational, which means constraints like foreign keys cannot be specified. Second of all , tables have no schema, every row can contain different types and number of columns. The table storage is similar to hash tables – you have a unique key which accesses a certain row (value). A key consists of two parts – a partition key and a row key. A partition key can help you with performance of your table storage. Data from one partition is physically stored in one place. Partitions are replicated internally on different parts of the datacenter and partitions which are used more frequently are replicated to a larger number of locations and access to them is faster. Because of this fact it´s not recommended using the same partition ID for your entire table. Rather than that you should divide your table into partitions by usage frequency. Congratulations to those of you who are reading this sentence! You reached the end of my post. This was the first part of my talk about storages, in my next blog post I´m going to describe which storages are used by Kentico CMS and why we decided to use Veer Bahudar commented on Mar 16, 2012 Really!! this is a good article which gives an insight view of storage types in windows azure, which helps a lot for beginners as me as well as developer. You made it very simple and understandable. Thanks for sharing with us. Check out the following links too, it also having nice stuff.... Everyone for yours precious work. kentico_dominikp commented on Dec 4, 2011 Thank you! Frenchie commented on Dec 3, 2011 Super ifnroamtvie writing; keep it up. Jeannie commented on Dec 1, 2011 The purhcaess I make are entirely based on these articles. New subscription Leave message Your email:
http://devnet.kentico.com/articles/data-storage-in-windows-azure
CC-MAIN-2016-44
refinedweb
2,560
55.84
Introduction to the Raspberry Pi Lesson 18 Read a button with GPIOZERO You now know how to “do” output. It’s time to learn “input”. A momentary button is an input device. It is essentially a sensor with only two possible states: “pressed” and “not pressed”. In your circuit, you have connected the output of the button to GPIO14. You Python program will check the voltage at GPIO14 to determine if the button is pressed or not. Unlike with the LED example, this time we’ll go straight to write a regular Python program. This is because we want to get Python to read the state of GPIO14 many times per second, so that as soon as we press the button, Python can print a message on the screen to let us know if has detected the press. We can also do this on the CLI, but it will be a clunky implementation which I prefer to avoid. Use Vim to create a new Python program: $ vim button_gpiozero.py Copy this code into the Vim buffer: from gpiozero import Button import time button = Button(14,None,True) while True: if button.is_pressed: print("Button is pressed") else: print("Button is not pressed") time.sleep(0.1) Save the buffer to disk, and quit Vim (“:wq”). There’s a few new elements in this code, so lets take a moment to learn. In the first line, you are importing the Button module, another member of the gpiozero library. In the second line you import the “time” module, so that you can insert a tiny delay later in your program. This is important because without this delay, you program will sample the button GPIO as fast as your Raspberry Pi can, leaving little time for anything else. We only want to read the state of a button, not to totally dominate the CPU. Line three is a little challenging because it contains three parameters. You can find detailed information about these parameters in the gpiozero documentation for the Button object. The first one is the GPIO number. Since the button is connected to GPIO14, you’ll enter “14” in the first parameter. The second parameter controls the type of pull-up/down resistor we are using. The Raspberry Pi can use internal pull-up resistors resistor, but in our circuit we have provided an external pull-down resistor. This resistor ensures that voltage at GPIO14 is equal to GND when the button is not pressed. For an article on pull-up/down resistors, please have a look at this article. Because of the presence of the external pull-down, we use “None” as the value of the second parameter. In the third parameter, we include the active state value. Because when the button is pressed the voltage at GPIO14 is “HIGH”, and when the button is not pressed the voltage is “LOW”, we use the “True” value for this parameter. If the voltages were reversed (i.e. pressed buttons created a “LOW” voltage, and not pressed button created “HIGH”), then for the third parameter we would write “False”. You have saved the configured Button object in the “button” variable, and then get into an infinite loop. In the look, your program simply reads the state of the button and if it is pressed, it prints “Button is pressed” to the console. If it isn’t pressed, it prints “Button is not pressed”. Run the program like this: $ python3 button_gpiozero.py Now press the button as see how the message on the console changes accordingly. It should look like this: A button was just pressed. It works! .
https://techexplorations.com/guides/rpi/begin/read-a-button-with-gpiozero/
CC-MAIN-2020-40
refinedweb
604
72.46
IPC namespaces are completely disjoint id->object mappings.A task can pass CLONE_NEWIPC to unshare and clone to geta new, empty, IPC namespace. Until now this has supportedSYSV IPC.Most Posix IPC is done in userspace. The posix mqueuesupport, however, is implemented on top of the mqueue fs.This patchset implements multiple mqueue fs instances,one per IPC namespace to be precise.To create a new ipc namespace with posix mq support, youshould now: unshare(CLONE_NEWIPC|CLONE_NEWNS); umount /dev/mqueue mount -t mqueue mqueue /dev/mqueueIt's perfectly valid to do vfs operations on filesin another ipc_namespace's /dev/mqueue, but any useof mq_open(3) and friends will act in your own ipc_ns.After the ipc namespace has exited, you can stillunlink but no longer create files in that fs (sinceaccounting is carried.Changelog: v14: (Jan 16 2009) port to linux-next v13: (Dec 28 2009) 1. addressed comments by Dave and Suka 2. ported Cedric's patch to make posix mq sysctls per-namespaceWhen convenient, it would be great to see this testedin -mm.thanks,-serge
https://lkml.org/lkml/2009/1/16/496
CC-MAIN-2017-13
refinedweb
177
65.52
I was doing some research on Qt 5.0 Logging and it appears to have built in classes for logging. I'm having trouble finding an example. I have located the classes i believe are relevant here. QMessageLogger QMessageLogContext I can see roughly how to create the QMessageLogger Object from the documentation, but how can I create a log file and append to it? By default using qDebug(), qWarning(), etc will allow you to log information out to the console. #include <QtDebug> qDebug() << "Hello world!"; QMessageLogger is designed to leverage special C++ macros (e.g. function, line, file) QMessageLogger(__FILE__, __LINE__, 0).debug() << "Hello world!"; In Qt5 the message logger is used behind the scenes since qDebug() is a macro that will eventually instantiate an instance of QMessageLogger. So I'd just go with using the regular qDebug(). The QMessageLogContext contains what I'd consider as "meta-data", i.e. the file, line number, etc that the qDebug() statement it was called from. Normally you'd concern yourself with the log-context if you're defining your own QtMessageHandler (see qInstallMessageHandler()). The message handler allows for more control of the logging mechanism - like sending logging information to a custom logging server or even to a file. As provided in the Qt Documentation, creating a custom message handler is simple: void myMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) { std::cout << msg.toStdString(); }
https://codedump.io/share/Y2QgTSrFINEs/1/qt-50---built-in-logging
CC-MAIN-2017-43
refinedweb
233
50.02
Yea, im wonderin if i could make, a very simple program i made in a very short period of time,-(i was bored lol)- into a stand alone non terminating program. I am new to this code and don't know whether it is posible or the slightest idea how to do it. The code is... Code: //Sales tax calculator (CA, Alameda county sales tax) #include <iostream> using namespace std; int main () { int i; cout << "Please enter the price: "; cin >> i; cout << " The price you entered is " << i; cout << " The sales tax for this amount is " << 8.75/100*i << ".\n"; cout << " The total amount is $ " << 8.75/100*i+i ; } if you could please explain how to do it that would be great :). Any edits you think would improve the program or enable me to do what i want, if you could post it that would be appreciated
http://cboard.cprogramming.com/cplusplus-programming/80766-newbie-question-dumb-idk-printable-thread.html
CC-MAIN-2016-07
refinedweb
149
85.02
. General excesive Input methods Currently there is no page on ArchWiki properly describing various input methods generally. There is only Internationalization#Input_methods_in_Xorg, but it has several problems: - missing descriptions - X compose key does not fit in - GTK has a default "simple" input method featuring the Ctrl+Shift+ushortcut for entering a unicode character (this was added recently into a wrong article: [2]) - again, no description - no description of XIM - outdated, but sometimes used as fallback? So this is quite enough material to start a new great article ;) -- Lahwaacz (talk) 18:23, 18 December 2013 (UTC) - Update to note: While Internationalization#Input_methods_in_Xorg itself still remains a stub, we had editors contributing language specific instructions which were set as subpages of the article: - Internationalization/Japanese and Internationalization/Korean - --Indigo (talk) 21:57, 11 January 2015 (UTC) (UTC) is constantly receiving updates and improvements. Because of this the Arch wiki must be updated quickly to reflect these changes.) index.php in url address Admins of Arch Wiki, do you noticed, that in every page address begins with? Why? It is uncomfortable. Why could not you do just article name after? — Agent0 (talk|contribs) 22:48, 6 March 2015 (UTC) - Administrators can't configure the entry-point urls, that's something that should be done in LocalSettings.php, which however is currently unpatchable because of FS#35545. - Nonetheless I agree with you, urls could be prettified by removing "index.php/", I think wiki.archlinux.fr has the best configuration in this respect. Documentation is in mw:Manual:Short URL/LocalSettings.php. Backward compatibility wouldn't be a problem since urls can be easily rewritten by the http server. - — Kynikos (talk) 01:49, 7 March 2015 (UTC) - I have noticed, that article's path became. Better, but still with ugly index.php. I agree with you, french arch linux wiki did varian which I wanted: just clearly. But according to [3] it is not recommended in some cases. As I understand, it just do not allow you (Pierre) to use some titles as articles, for example, but really, what reason to have such articles =D. And another problem may be that it may require root access to hosting server. Does wiki.archlinux.org is running on virtual server or it is hosted on a normal server? — Agent0 (talk|contribs) 09:59, 17 August 2015 (UTC) - This could now be done, seeing as FS#35545 has been implemented. — Ekkelett (talk) 06:53, 6 March 2017 (UTC) - Good point. Instead of totally shortening it, we should follow [4] in my view. The french version appears to be ending in what's referred to as unsupported configuration in (UTC) [7], and .install files in the repos are gradually being outphased: see DeveloperWiki:Pacman Hooks -- Alad (talk) 15:32, 29 April 2016 (UTC) Broken section links The link-checker.py script already detects hundreds of links with broken section fragment. Before automatic solution is implemented, what would you say to automatically marking these with Template:Broken section link, similarly to how broken package links are marked with Template:Broken package link? -- Lahwaacz (talk) 14:14, 22 July 2016 (UTC) - +1. That would be helpful indeed. Maybe leave out the hint in the template to keep it short. Indigo (talk) 17:45, 22 July 2016 (UTC) - I have made it look like this for now, with a link to this section: [broken link: invalid section] Of course feel free to modify it, there won't be any marked links for some time anyway... -- Lahwaacz (talk) 12:20, 4 August 2016 (UTC) - Perfect, thanks. It can already be seen in recent changes how helpful it is having them marked. - For anyone wanting to help with keeping our content properly linked: Special:WhatLinksHere/Template:Broken section link lists the identified broken links. Indigo (talk) 11:11, 7 August 2016 (UTC) - There is also hidden Category:Pages with broken section links ;) Lahwaacz (talk) 11:17, 7 August 2016 (UTC) - Interesting to see how many broken section links there are, and how long they went unnoticed... thanks for the upgrade! -- Alad (talk) 13:04, 7 August 2016 (UTC) Subpages in the main namespace Subpages in the main namespace are finally enabled [8], [9]) SVG logo Could we replace the wiki's current png logo with a resolution-independent SVG version as per the homepage? With HiDPI displays becoming common place, graphics can otherwise look aliased/distorted. —This unsigned comment is by Tlvince (talk) 27 March 2017. Please sign your posts with ~~~~! - Hi, this would be a domain-wide change, please open a bug report. — Kynikos (talk) 10:48, 28 March 2017 (UTC) Bot requests Here, list requests for repetitive, systemic modifications to a series of existing articles to be performed by a wiki bot.
https://wiki.archlinux.org/index.php?title=ArchWiki:Requests&mobileaction=toggle_view_mobile
CC-MAIN-2017-30
refinedweb
790
54.12
Arithmetic (until C11) Real (since C11) type capable of representing times. Although not defined by the C standard, this is almost always an integral value holding the number of seconds (not counting leap seconds) since 00:00, Jan 1 1970 UTC, corresponding to POSIX time. The standard uses the term calendar time when referring to a value of type time_t. Show the start of the epoch. #include <stdio.h> #include <time.h> int main(void) { time_t epoch = 0; printf("%ld seconds since the epoch began\n", (long)epoch); printf("%s", asctime(gmtime(&epoch))); } Possible output: 0 seconds since the epoch began Thu Jan 1 00:00:00 1970 © cppreference.com Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://docs.w3cub.com/c/chrono/time_t
CC-MAIN-2021-17
refinedweb
121
56.15
We are about to switch to a new forum software. Until then we have removed the registration on this forum. hi - I'm having trouble debugging why my android app is crashing when trying to use processing android serial to talk via Processing android app to arduino. i can successfully install and launch the app on android, but the app keeps crashing. I'm using really simple code just to see if I can talk via an OTG cable via serial from Android to Arduino via processing app. But when I plug in the OTG USB cable that's plugged into arduino UNO, I can choose the android app to open up that I have installed from Processing to android, but right away it says "Unfortunately, this app has stopped". I'm wondering how to go about debugging this. Is it the wrong port (Serial.list(this)[0]) that is doing this? or something else? I'm not sure how to debug why the app's crashing. I just recently started using Processing 0251 for Android. Even just the line "println(Serial.list(this));" triggers the app to shut down. Thanks in advance! I used this link to help getting set up: Processing code in Android mode: import com.yourinventit.processing.android.serial.*; Serial SerialPort; boolean Toggle; void setup() {fullScreen(); background(255,0,0); println(Serial.list(this)); //this line alone makes the app crash even if i dont have any other code SerialPort = new Serial(this, Serial.list(this)[0], 9600); } void draw() { } void mousePressed() { Toggle = !Toggle; // while (SerialPort.available() > 0) { SerialPort.write( Toggle?"1":"0"); // } } Arduino Code: #define NUMBER_OF_CHANNELS 8 #define PINLED1 13 volatile char lastReceivedCharFromSerialIn = '\0'; void setup() { pinMode(PINLED1, OUTPUT); Serial.begin(9600); } void loop() { digitalWrite( PINLED1, lastReceivedCharFromSerialIn == '1'); } void serialEvent() { while (Serial.available()) { // get the new byte: lastReceivedCharFromSerialIn = (char)Serial.read(); } } Answers Hi. I have exactly the same problem. Have you solved it? Or does anyone know how to deal with it? Other programs which don't use Serial library work fine on my phone. First, can you run your code in Java mode? Second, what is the meaning of talking to an arduino via serial from Android processing? Like are you trying to connect your android device directly to your arduino? Maybe you should try P2P like WiFi or Bluetooth. I am not an expert in this, but I have a feeling android does not have a way to connect via serial. Please correct me if I am wrong. Where are you getting your information or documentation that describe this type of operation? Kf Thanks for your comment. Yes, it runs in Java mode, but it uses different serial library then. I want to connect arduino directly to Android via otg usb cable, but it crashes right after uploading a sketch. I use this library for this purpose: AndroidSerial for Processing An example of this operation is described in the Example section on the library's github site. EDIT : I got this to work. The problem was with the phone. It didn't support otg cable. I used other phone and it work on it. Great, good to hear! Kf
https://forum.processing.org/two/discussion/17375/android-processing-app-crashes-when-using-usb-processing-serial-library-serial-list-this-probs
CC-MAIN-2020-45
refinedweb
526
60.51
3. Getting Started with Pre-trained I3D Models on Kinetcis400¶ Kinetics400 is an action recognition dataset of realistic action videos, collected from YouTube. With 306,245 short trimmed videos from 400 action categories, it is one of the largest and most widely used dataset in the research community for benchmarking state-of-the-art video action recognition models. I3D (Inflated 3D Networks) is a widely adopted 3D video classification network. It uses 3D convolution to learn spatiotemporal information directly from videos. I3D is proposed to improve C3D (Convolutional 3D Networks) by inflating from 2D models. We can not only reuse the 2D models’ architecture (e.g., ResNet, Inception), but also bootstrap the model weights from 2D pretrained models. In this manner, training 3D networks for video classification is feasible and getting much better results. In this tutorial, we will demonstrate how to load a pre-trained I3D model from gluoncv-model-zoo and classify a video clip from the Internet or your local disk into one of the 400 action classes. Step by Step¶ We will try out a pre-trained I3D model on a single video clip. First, please follow the installation guide to install MXNet and GluonCV if you haven’t done so yet. Then, we download the video and extract a 32-frame clip from it. from gluoncv.utils.filesystem import try_import_decord decord = try_import_decord() url = '' video_fname = utils.download(url) vr = decord.VideoReader(video_fname) frame_id_list = range(0, 64, 2) video_data = vr.get_batch(frame_id_list).asnumpy() clip_input = [video_data[vid, :, :, :] for vid, _ in enumerate(frame_id_list)] Now we define transformations for the video clip. This transformation function does three things: center crop the image to 224x224 in size, transpose it to num_channels*num_frames*height*width, and normalize with mean and standard deviation calculated across all ImageNet images. transform_fn = video.VideoGroupValTransform(size=224, mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) clip_input = transform_fn(clip_input) clip_input = np.stack(clip_input, axis=0) clip_input = clip_input.reshape((-1,) + (32, 3, 224, 224)) clip_input = np.transpose(clip_input, (0, 2, 1, 3, 4)) print('Video data is downloaded and preprocessed.') Out: Video data is downloaded and preprocessed. Next, we load a pre-trained I3D model. model_name = 'i3d_inceptionv1_kinetics400' net = get_model(model_name, nclass=400, pretrained=True) print('%s model is successfully loaded.' % model_name) Out: Downloading /root/.mxnet/models/i3d_inceptionv1_kinetics400-81e0be10.zip from... 0%| | 0/51277 [00:00<?, ?KB/s] 1%|1 | 622/51277 [00:00<00:12, 3942.99KB/s] 6%|6 | 3134/51277 [00:00<00:04, 10953.61KB/s] 16%|#6 | 8429/51277 [00:00<00:01, 25516.88KB/s] 30%|##9 | 15253/51277 [00:00<00:00, 39668.91KB/s] 40%|###9 | 20365/51277 [00:00<00:00, 41233.29KB/s] 49%|####9 | 25321/51277 [00:00<00:00, 39580.64KB/s] 58%|#####7 | 29583/51277 [00:00<00:00, 40435.70KB/s] 66%|######5 | 33807/51277 [00:01<00:00, 35689.36KB/s] 74%|#######4 | 37986/51277 [00:01<00:00, 35946.09KB/s] 83%|########2 | 42365/51277 [00:01<00:00, 38031.60KB/s] 91%|#########1| 46811/51277 [00:01<00:00, 39801.51KB/s] 99%|#########9| 50901/51277 [00:01<00:00, 36350.38KB/s] 51278KB [00:01, 34762.25KB/s] i3d_inceptionv1_kinetics400 model is successfully loaded. Note that if you want to use InceptionV3 series model (i.e., i3d_inceptionv3_kinetics400), please resize the image to have both dimensions larger than 299 (e.g., 340x450) and change input size from 224 to 299 in the transform function. Finally, we prepare the video clip and feed it to the model. Out: The input video clip is classified to be [abseiling], with probability 0.991. [rock_climbing], with probability 0.009. [ice_climbing], with probability 0.000. [paragliding], with probability 0.000. [skydiving], with probability 0.000. We can see that our pre-trained model predicts this video clip to be abseiling action with high confidence. Next Step¶ If you would like to dive deeper into training I3D models on Kinetics400, feel free to read the next tutorial on Kinetics400. Total running time of the script: ( 0 minutes 2.867 seconds) Gallery generated by Sphinx-Gallery
https://cv.gluon.ai/build/examples_action_recognition/demo_i3d_kinetics400.html
CC-MAIN-2021-31
refinedweb
682
61.43
Re: Bitcoin, I most strongly agree with the's not meant to be a store of value. (Score:5, Informative) Like all currencies, it's main use is as a medium of exchange. It's pretty decent as that, but sucks for storing value. The two purposes are not mutually exclusive. (Score:5, Insightful) Re:The two purposes are not mutually exclusive. (Score:5, Insightful) Nah, they suck as a medium to store wealth for more than short periods of time. What the OP is missing is that currency is a method of account: A ton of prices are set up with respect to a currency: This is why, say, having oil be priced in dollars and not in Euros was such a big deal a while ago. High demand for currency as a percentage of GDP is telling you that all of the things that are far better stores for wealth than money are just no good (ie, a recession), or that the currency is not really a currency, but a commodity that you are speculating with. Which is why Bitcoin is not something that really resembles a currency: The supply increases slowly, its value vs anything that you could want to buy with it fluctuates wildly, and most of the inventory is being held by people hoping it will go up, instead of actually being used.. Re: (Score:3, Insightful) Re:The two purposes are not mutually exclusive. (Score:5, Interesting) It not only has value as an investment (I personally put about $1000 in when the price hit $14usd/1btc, sold half at $55 and half at $65 and made quite a bit of money), but it also is useful for grey market transactions. For instance, I purchased some Modafinil, a prescription drug which is hard to acquire in the US but is non-recreational and not of concern to the DEA, and I used bitcoins to do it simply because it was the only way to easily pay in such a way that the vendor didn't know anything about me beyond the wallet ID of the one-time use wallet I generated specifically for this transaction, I don't know anything about the vendor outside of his (probably also one-time-use) wallet ID, and yet I ended up with some Modafinil and he ended up with some cash. As a long-term investment, Bitcoin is ludicrous; I agree with this. The price is about to crash as the new ASIC miners come out, and this cycle will likely happen again several times before we hit the 22 million hard cap, which makes it the domain of day traders, not investers. But as a currency, it is wildly more useful than USD, or whatever. You can send bitcoins to someone quickly, easily, and without using a third party transfer service. You can easily purchase bitcoins using cash with websites like localbitcoins.com. There are many websites selling legitimate products, things like computer hardware or ebooks, and the list grows every day. Bitcoin's value is not as an investment. Bitcoin's value is that, even without the backing of a major government or whatever, it has value as a currency simply because of its featureset. We don't consider the 'featureset' of a currency very often, since most currencies have exactly the same featureset as every other currency; you can take it to a bank and change it into 'electronic' money, deposit it into your paypal, etc. But bitcoin has all of those features built into the actual currency itself, with no reliance on third parties and built-in (relative) privacy. Re: (Score:2) I also agree that it's in a bubble and about to crash. However, I don't understand what the new ASIC miners have to do with it. I thought that the total bitcoin mined collectively per day stays pretty much constant regardless of the horsepower thrown at it (it self adjusts). What concerns me more is the cost of collective mining is proportional to the price. So looking at this chart, you can see periods were many bitcoins were gobbled up and calm periods, where I think that the transactions were due mainly to Re:The two purposes are not mutually exclusive. (Score:5, Informative) If Miners leave the system, then the computational complexity goes down for verifying blocks. If the price of Bitcoin goes up (which it must with greater usage), then mining becomes more profitable, and will attract more minors. Really the system works pretty well to balance itself, and likely has nothing to do with a possible crash in price. If you look over at LiteCoin, a much less popular crypto currency derived from Bitcoin, they just has a large run up, then dropped over half their value. But in the end, they still didn't fall back to their original run up price. They are likely to continue to rise in price as compared to other options. Really, I think the fears of Bitcoin crashing are overblown. Right now Bitcoin has a capitalization of almost 800 million. Quite a bit, but nothing like the 68 billion capitalization of eBay (PayPal). At LEAST a billion or two of that can be contributed to PayPal. And people think Bitcoin is over valued at a fraction of that? When Bitcoin arguably better addresses the same problems of facilitating transactions, only better, cheaper, more securely? Re:The two purposes are not mutually exclusive. (Score:5, Funny) Great. The best way to get bitcoin regulated is when people hear you can use it to attract minors. Re:The two purposes are not mutually exclusive. (Score:4, Funny) Is bitcoin a gateway drug? What's next, ByteCash? Re:The two purposes are not mutually exclusive. (Score:4, Insightful) Paypal and Bitcoin are apples and oranges, though, although I get what you're saying. When paypal collects a fee, that goes right into the company coffers, and therefore part of the shareholder value. Bitcoin transaction fees just go to the miner that collected them. The investors get nothing. Instead they get to pay around 12% interest per year to the miners (currently, of course this will drop). Valuing bitcoin is a tricky business, a lot like valuing gold, but different from that also. The weird thing about bitcoin is that, unlike gold, it's value doesn't change with the amount used. For example, 20,999,999 BTC could be locked away by long term investors, leaving 1 BTC for the entire economic side of bitcoin to run on, and the economy would work just as well as if it had all 21M BTC to work with. However, in the first scenario, if an investor decided to cash out, it's the economy that must support him. So if he sold 1 BTC, then the entire circulation of bitcoin in the economy would double in size in terms of BTC, which would cause the value of all BTC to drop to half. This is really important in understanding bitcoin in my opinion, because compared to a regular stock, where future events can be baked into the price, the price of Bitcoin cannot similarly be. Why not? Because the price of bitcoin must equal the amount being circulated, times the amount of currency in regards to intrinsic worth each of the players in the economy need to conduct business. In other words, consider the example where only 1 BTC was used by the economy and the rest tied up with long term investors. Every time a consumer wanted to buy a TV that normally goes for $1199, they'd have to get that amount in Bitcoin, whatever it might be. Similarly, a business would need it's cash flow for it's purchases, and refunds, etc. So, take that amount as valued in USD, and divide it by the amount of Bitcoin available to the economy, and you get the price that USD/BTC has to be. After all, if it wasn't, then consumers would have to adjust their transitory holdings, businesses would have to adjust the amount used for cash flow until it was. So, in essence the investors are facing a situation somewhat like the prisoners dilemma. Cash out before everyone else to get most of the profit. But if no one cashes out, or more people cash in than cash out, and the price goes higher, because you squeeze the economy into less and less remaining bitcoin. In a normal system with physical goods, eg. gold, the value of the economy decreases as more investors pile in and start locking gold in vaults, which means less rings for sale, so the effect is tempered. But with bitcoin, this steam valve never get released.. Can you guess what happens here? Both forces diverge, when one is strong the other is weak. Investors buy more and more of BTC, so the price of BTC hits the roof, so some investors cash out, and then it hits the floor, because the bitcoin economy has more BTC to work with, and the price of BTC has to match the total intrinsic value amount needed to run the economy divided by the economy's share of the Bitcoin. (The fact that investors can cash out at anytime cannot be baked into the price). And again, in circles. And the nearly unnoticed people trying to work an economy lose and gain and lose and gain. Until they get sick of it, and shops slowly go belly up or refuse to take BTC, until it dwindles to nothing. And the bubbles one after another start to fade, along with the economy, until nothing is left. Re:At a crude level, how does this work? (Score:5, Informative) You're way off. I'll give it a try, but its kind of a complicated system. First, let me give you the upshot. Imagine miners as a collective unit. Every 10 minutes or so, 25 bitcoins created out of thin air are competed by all miners and then won by a single one. No matter how many miners there are, the number of bitcoins up for grabs doesn't change. Imagine a wealthy person throwing a scrap of bread into a crowd of beggars below, all competing to try and get the next piece, and you'll get the idea. How does this benefit the system? What is this mysterious work that needs to be done? The heart of bitcoin is just an electronic order book. It contains every transaction from the beginning of bitcoin written in to it. To find out how many bitcoins you have, you consult the order book which is freely available public information. It's available through P2P sharing, somewhat like bit torrent. Every time someone makes a trade, it's written in this book. (Public key cryptography is used to prevent unauthorized entries. That is, you sign a transaction with a private key of the sender and the public key of the receiver.) The problem that mining attempts to prevent is as follows. What if a hacker makes a copy of the existing Bitcoin order book and then buys a Ferrari or something for 10,000 BTC in the real account book, and then uses a botnet to try and pass off his copy as real. If other people don't know which is which and start using his copy he made, then he can re-spend the 10,000 BTC on a Lamborghini in his copy. This is know as the double spend attack. You might think that the order book should just be stored at an official place like bitcoin.com or something, and that's that. However, one of the design goals was to prevent a central authority from being needed, because a central authority can be shut down. If the US government decided one day to seize bitcoin.com, then in that case, Bitcoin would no longer exist. So, here is how mining works, and prevents the double spend attack. Every time a time a transaction is made, it's given to the miners. Each miner take a number of transactions, and hashes them with the entire order book, the date timestamp, and a random number. (They also add some other information such as the address where the reward goes to). If the final hashcode they get is below a certain value, called the hash target they win. The hash they use is 256 bytes long, and the hash target is very small, ex. 00000000000000000000000000000000000000000000000000007F345334478. If they lose, they have to try again with a different random number. They win very rarely, but since miners have fancy exotic hardware meant to do this operation millions or billion of times a second and there are so many of them, someone does eventually find it. When someone wins, he shares it with everyone in the P2P network who all update their order book and the game starts again. If it took over 10 minutes to find the hash target for the previous block, the hash target is made higher, so it will be easier next time. If it took less, it is made lower. In this way, it balances out, so a miner wins around every 10 minutes, regardless if the total number of miners grow or shrink. How does this help prove the order book is not a copy? Imagine that miners worked at the Animal Crackers factory, and the factory wasn't perfect, so % 0.01 of the time it would make an animal where its head was upside down. If a miner found that, he would take a picture of it and show it to everyone would then in turn put then put it into their copy of the order book (and the miner would be paid for doing so). Whenever there was confusion about which order book was real and which was not, you'd take a look at the two copies, and simply count the pictures of animals with its head upside down. Whichever had the most pictures would be considered the official order book. So, if some hacker made a copy, the only way they could pass it off as an official order book is if they also found animals with their head's upside down faster than everyone else. Since there are so many other miners looking, this isn't feasible. I've left out some details, but that is the general idea. I hope it helps. If you have any questions, I'd be happy to answer them. Re: (Score:3) Are you kidding me? (Score:4, Insightful) "But as a currency, it is wildly more useful than USD, or whatever." That is one of the most moronic things I've read about bitcoins. It is hardly usable as a currency. You've found a few specialty shops that will take it for payment. Good for you. I can find an entire COUNTRY of stores that take USD, and plenty of places around the world. Go have a look at Amazon.com, look at what you can buy there, for US Dollars but NOT for Bitcoins. You seem to be all caught up on the fact that you can "send" Bitcoins directly to someone else. So what? That is a semantic argument. All currencies are just shuffling bits around in computers anyhow. The details really don't matter, what matters is how easily you can use it to pay for things. Bitcoin is very hard, few people accept it and, surprise, surprise, they convert it to real money as soon as they can. US dollars are very easy, they are accepted all over the place. Re: (Score:2) If I converted all of my USD to Euro, and then all of the problems with Greece, Cypress, and Spain got sorted out and the Euro went up in value, and I turned all my money back into USD, I would say that I had "made quite a bit of money" in the exact same way, and I don't think that anyone thinks that euros aren't "real" money. Re: (Score:3, Funny) I don't think that anyone thinks that euros aren't "real" money. They're way to colourful to be real money. Just like the Canadian dollar. Re: (Score:3). But the thing is every currency is useless if the usage drops. Ask the people who had plenty Reichmarks or Zimbabwean dollars or Soviet rubles how that worked out, whether it's fiat money or gold standard doesn't matter since they'd never be able to convert all that money to gold if everyone wanted to cash out. That promise is as worthless as the paper money it was written on, sure you could do it in good times when you could have bought gold for it on the commodity market too, but not when you'd actually n Re: (Score:3) Bitcoin doesn't exactly have pyramid scheme dynamics. Rather, it has bubble dynamics. The winners those who jump off right before the bubble bursts, the losers are those who do it too late. I've seen estimates/claims that Satoshi (and possibly his friends) sit on 1.2 million bitcoin, which they never have moved. That is a lot of money, but it could quickly become worthless. Re: (Score:2). You mean like every fiat currency out there as well, including the US dollar? Currency doesn't have to be useful for storage (Score:3) Its job is to support current transactions, and to circulate. As long as it's vaguely stable for short periods of time, compared to the transaction speed, amount of it available and the willingness of commodity providers to accept it, that's good enough. Immediately after the US occupation of Germany post WW II, cigarettes were the main practical currency, even though they weren't very storable, had a random value, and weren't easy to use in large quantities, because there was enough supply available from Re: (Score:3) I have to agree with the OP. The two purposes might not be mutually exclusive, but a currency can certainly be "useful" for one purpose and not the other. From a USAian perspective, the $US is (for now) a global medium of exchange and easily carried. Unfortunately, the dollar has lost over 90% of its value since the inception of the Federal Reserve. Right now, they are eroding the value with $85 Billion per month in artificial credit expansion. Is the currency really a store of wealth if the purchasing p Re: (Score:2) Re: (Score:2) Bingo. For a medium of exchange, BitCoin has a lot of positive aspects. However, until it becomes a mature currency, one is best moving value into it, doing the buy/sell, then moving out of it as fast as possible. On the other hand, the best medium of exchange that holds its stored value would be precious metals. Gold is the most popular and with proper assay certificates stored with the medium, the chance of getting a fake bar can be fairly low. However, gold isn't as good for an exchange mechanism as a Re: (Score:2) I do not doubt that the US government will try to regulate Bitcoin, fail, and then try to outlaw it. That will still have very little effect on Bitcoin as it does not rely on recognition by the US government. They would have more chance of trying to outlaw the rouble. I think that they should just ignore it and let it dwindle into obscurity instead of giving it constant limelight and coverage. Re:The two purposes are not mutually exclusive. (Score:4, Funny) I store my money in my well fed family. Re: (Score:3) Re: (Score:3) Oh my god where do you armchair investors come from? Store your value in stock? Bonds? Land? You're nuts. Do you know how bonds grow? You take a risk in bonds. Bonds are usually sold; they can lose value, and you have to wait out the maturity term, taking small amounts of interest, missing opportunities, to avoid losing value. If you suddenly need the value stored in your bond, you may have to sell it at a loss greater than the loss of inflation--because you have less physical dollars at the same defl What's bitcoin? (Score:4, Insightful) Seriously, with the number of bitcoin articles here, hardly anyone should be able to honestly vote that. Re: (Score:3) I kind of know what it is, but I don't really know. it's like those articles about 'raspberry pi'.. they all assume we're supposed to know what it is and that we're supposed to care. At least Bitcoin has a name that gives me some idea of what the product is used for. And I know that it's a virtual currency, but I've never seen an option to pay in bitcoin anywhere. Re: (Score:2) Re: (Score:3) I say why would people bother, but there are people out there who very much believe in bitcoin as a real alternative currency and who have a very low opinion of people who are Re: (Score:2) I don't think a lottery is the correct description. In a lottery, if you bought every single ticket, your expect return would be about 50 cents for every dollar you invested. In Bitcoin, you invest your hardware and utility costs, and the expected return is greater than $1 for every dollar invested. Otherwise, why would people bother? I agree with your conclusion. But the lottery comparison is slightly broken. "expected value" includes probability so there is no need to buy every ticket, just a statistically valid sample. Plus it is even worse than you predicted (at least for the big name lotteries) because it varies with the current prize payout (e.g. typically the jackpot amount is not fixed). And to add some concrete detail, currently since Powerball was just won the expected value is $0.50 on a $2.00 ticket, where $0.36 is from the f Re: (Score:3) But on the bad side, as far as I can tell Bitcoin is a fundamentally deflating currency. The more time passes, the more the rate of new coin creation diminishes. So the longer you hold yo Re: (Score:2) Re: (Score:3) The End-Game (Score:4, Interesting) If bitcoin continues long enough to reach the end-game, wouldn't it create a deflationary spiral? Re:The End-Game (Score:4, Informative) Yes, which is the exact same problem as using the gold standard - there's only so much gold out there (and it has way more uses than sitting in a vault backing currency). Re: (Score:3) Re: (Score:2) In what sense do you mean "deflationary?" Do you mean that the price of everything else denominated in bitcoins would decrease (as in ordinary currency deflation) due to scarcity? I don't think so, because bitcoins are not like an ordinary commodity that people want for its utility, thus there can never be a shortage. If people want to store more value, they have the alternative of using dollars or euros, for example, or physical commodities like gold or real property. Also, new digital currencies with la Re: (Score:2) As opposed to trying to make something with unlimited availability have value? Re: (Score:3) If you mean that the prices of goods and services in bitcoins will continue to decline, then yes. Contrary to the endless propaganda being spewed by central bankers, so-called "mainstream" economists and the media, deflation is a good thing, not the bogeyman. In fact, it should be the natural long-term trend, with periodic short term cycles. Technological advancements and productivity gains should be increasing the purchasing power and increasing standards of living for wage earners. Eroding the purchasing Re: (Score:3) Bitcoins sure seem to have had a goal of making sure that a Bitcoin never loses value. Unfortunately, the real world never works that way: Tools and equipment depreciate and have to be maintained. Arable land loses its fertility. A good house becomes a bad house because drug dealers move into the neighborhood. Business investments can go south. Perishable commodities like food spoil. Countries and their currencies fall as surely as they've risen. And Bitcoins only have value as long as people are willing to Re: (Score:2) Currently, bitcoin transfers don't get validated until a new block is mined. Would mining the last coin mean that no new transactions are possible? Re: (Score:2) Fundamentally, a currency is backed by the resources of a country. The US Dollar is backed by the US GDP, the CNY by Chinese GDP, and so on. If US GDP increases, your USDs go up in value. Bitcoin however is backed by nothing. It has no intrinsic value per se, unlike currencies or stocks. It is valuable only because others think it is valuable. If tomorrow everybody thinks 1 Bitcoin is worth 100 USD, they are worth 100 USD. If everybody thinks they are worthless, they are worthless. It is the ultimate deriva Re: (Score:3) Hopefully. Making artificial inflation become impossible, should be one of the design goals of any currency. It's called "learning from mistakes." Some people will mention mistakes have been made on both sides. So I guess it's a question of which ones are more recent and relevant. Is boom/bust your bogeyman, or is inflation & unbounded government debt your bogeyman? Personally, I think volatility and Bitcoin is simple, and complicated (Score:5, Insightful) I love the idea of a decentralized, non-controllable, virtually anonymous (and truly anonymous with the use of proper laundries), non-government, non-corporation, currency. I love the idea that I can just send a few coins (or parts or whatever) as a tip to anyone else without an intermediary taking a cut. I love that I can use it for true micropayments, microdonations etc. I support Bitcoins because, while it's not the best possible option, it's the best existing option. But, I don't like that early adopters are massively rich. I don't like that the current chain is 2GB and rising (hard to download when your Internet connection is rubbish). And there are a few other minor issues with it. But ultimately, I think that, as a tool to remove power from governments and corporations, it's a good one. It's a good currency to use to be paid in, and to spend, and to save for a rainy day. But, like any other store of wealth or capital, don't put all your eggs in one basket. Just like you don't put all your savings into stocks or gold, don't put them all into Bitcoins.: (Score:2) Why do you think that Bitcoins are not a good currency to save? I have an amount that, while the value against fiat currencies has varied, has generally increased in value. Sounds like a good investment to me. Better than certain stocks at least. And people do put their life savings into stocks. I've only got a small amount of capital in Bitcoins, but that's mainly because I don't want to hand over my details to an exchange. I would rather receive the BTC in exchange for labor done. Which is how I got most Re: (Score:2) Why do you think that Bitcoins are not a good currency to save? Because it's yet another fiat currency not based on or backed by anything of actual, tangible value. Sounds like a good investment to me. Better than certain stocks at least. I realize that's what all the lemmings have been conditioned by the media and Wall Street to compare things to: "Sir, where would you like this hot poker inserted; down your throat or up your ass?" :p As part of a varied bundle, I can't see anything wrong with investing in, and using BTC. It's all relative. Yes, I suppose I'd rather keep my wealth in BTC form, if for no other reason than its deflationary nature, than in stocks or rapidly-dying government fiat... but this baby, [kitco.com] despite T.P.T.B. sup Re: (Score:2) Because it's yet another fiat currency not based on or backed by anything of actual, tangible value. I hear this a lot, but I've yet to be convinced that shiny metals themselves are of actual, tangible value. Speculation and perceived value is what keeps gold prices where they are. Re: (Score:2) I've yet to be convinced that shiny metals themselves are of actual, tangible value. LOL! To tell you the truth, I wouldn't be convinced, either... unless, that is, I'd formed my opinions not on the insane silliness spouted by the media but rather on some actual knowledge of history... :p Re: (Score:3) The value of a Bitcoin (unique to anything not patterned after Bitcoin) is the ability to engage in a transaction without the aid of any centralized third parties. That is an intrinsic property of Bitcoin. And relatively unique to Bitcoin (and other crypto currencies). You may not value that property, but it does exist, and some people do value it. Re: (Score:2) Re: (Score:3) The only reason a pyramid scheme is bad is because when people realize it's a pyramid scheme, there isn't actually enough money to pay everyone back. Although it's possible to describe bitcoins as a pyramid scheme, the money doesn't disappear the moment people decide to take it back. Although it's also possible to describe Social Security as a pyramid scheme, everybody already knows how it works so there's no surprise and the beneficiaries are poor old people instead of a handful of already-rich bankers. A Ponzi scheme is only bad because it will inevitably come crashing down on the poor fools who fell for it. This is not how social security works. Social security works on the observation that people should make long-term investments so we don't have the elderly dying in the streets. Social security savings are supposed to be responsibly invested in long term securities, and guaranteed by the government so they give a predictable return (and being the government it means you can negotiate deals which are impossible for any smaller player). The US has simply managed to fuck the concept up since for some reason scr Re: (Score:3) It's not quite anonymous, but it's incredibly easy to make it truly anonymous. And even if it's not truly anonymous, it's still worth an enormous amount. It prevents corporations from blocking donations to undesirables (e.g. Wikileaks). It allows those who can't otherwise (e.g. if your poor in a third-world country, without a credit card or even a bank account) give microdonations, pay micro-amounts and receive donations and payments (through the use of an online wallet service, at an Internet cafe). Just as Crypto, value, etc. (Score:3, Informative) I have a very conflicting view of Bitcoin. Here are a few of my thoughts on the subject: 1- Crypto: how do we know the bitcoin crypto is really good/really secure? Who has done an audit of the code? Implications: Cryptography is a very hard subject to tackle. Many an encryption scheme has been cracked and left in tatters, that seemed formidable enough at first sight. If the bitcoin cryptography is cracked, then fake bitcoins can be ''mined'' (meaning: created out of thin air) and the whole currency disappears in a puff of smoke (so to speak). 2- Security: how do we know the bitcoin P2P client is really secure? Who had done an audit of the code? What about the currency transmission protocol? Implications: if you can't "fake" bitcoins, at least you can intercept them out of thin air between Alice and Bob. What then? The same bitcoin exists twice and that cannot be good for bitcoins.... Also, see point #1 and #2 above: I would feel a lot more confident in Bitcoin if the currency had been created by a recognized researcher in cryptography and digital currencies. 4- Economics: Bitcoin is essentially a ''fixed size'' currency... As someone has already pointed out, this has ''interesting'' properties, for various values of ''interesting''. If all bitcoins are mined then what? Implications: once all bitcoins have been "mined", the only result can be a very serious "inflation" in the value of bitcoins if demand for this currency helds up - the only way to maintain a sustainable level of economic activity would be to raise the price of bitcoins by using it sub-division properties (yes, you can split a Bitcoin into smaller values). So right now 1 BT is, say = US$ 1. But what happens when 0.1 BT = US$1? This would imply staggering inflation in the implied value of Bitcoins and a Ponzi-like scheme, where the very first "miners" of BT would reap a staggering reward, leaving everyone else holding the bag. This could potentially bring a crisis of confidence in Bitcoin, and crash the entire currency, tulip-mania style. You think I am going too far? There is now a cottage industry dedicated to selling you computing platforms (usually using Nvidia/ATI and OpenCL) to mine more Bitcoins. This, to me, smells of a ''mania'' phase, since, lest we forget, Bitcoins are completely immaterial and are not recognized anywhere except within circles of a dubious nature (Silk Road, anyone?). In other words, yes, Bitcoin is fascinating in many ways... But I am not 100% sure this thing has been thought out in all of its aspects... Re:Crypto, value, etc. (Score:4, Interesting) Re: (Score:2) Not more "scam" than the person who created the first 1000x1000 all ad, no content page, sold it for $1/pixel and made almost a million dollars in the dotcom age. Assuming he created it I also assume he mined lots of the early BitCoins which would, if it became a huge economy, be worth lots of money. At least, it wouldn't have to be more of a scam than BitCoin already is ;) Currency has no value (Score:2) It is ONLY a medium of exchange. Its considered good or bad depending on whether it can be counterfeited. While I find it an interesting idea to create a monetary system that is independent of any national power, I will not consider "another" unbacked currency. Especially a virtual one. If you really want to make something, create a currency based on labor contracts. Offer your time for sale: I promise to work 10 hours on whatever legal project you would have me work on. And sell that. The Re: (Score:3) Offer your time for sale: I promise to work 10 hours on whatever legal project you would have me work on. This is basically the Labor Theory of Value, which argues that only work creates value. This formed the basis of the theory of capitalism created by one Karl Marx: The idea was that money was simply one kind of commodity that everyone had collectively decided can be exchanged for the results of other people's work. For example, if I want a cheese sandwich, I can grow the wheat, thresh it, grind it into flour, add some oats and such that I've also grown, pull up some water from the well, bake some kind: (Score:2) >> The only medium of exchange that will work is one that is controlled by the government Not true unless you are specifically talking about a fiat currency (i.e. one that governments can make out of thin air because it isn't backed by anything, so has no intrinsic value, such as the US dollar). If you switch to a currency with or based on intrinsic value such as gold, silver, livestock etc. you dont need a government to control it. Such systems have already worked reasonably well for thousands of years Re: (Score:2) Unlimited accumulation of wealth = bad thing (Score:2) I think that long-term, unlimited accumulation of wealth is a terrible thing for society. Thus, the better Bitcoin is for this purpose, the less I like it. Ability to save some wealth is useful --- savings for a rainy day, a college fund for the kids, a nest-egg set aside for retirement. But, the ability for a tiny number of people to end up with thousands of lifetimes of others' wages (and the ability to throw that money around to assure that thousands more lifetimes will be spent serving their self-enrich Not as a store of value (Score:2) I wouldn't keep any money in bitcoins, but they can be useful for money transfer. My more complicated opinion (Score:2) As a store of value: Terrible. As a medium of exchange: Great! portability (Score:2, Interesting) If I had a beef with bitcoin is its lack of portability. Now I know many of us a technical bent and in your head you went "what do you mean crazy man?!? I can use it on linux or windows or android! " well you don't understand the larger meta portability I am talking about. I cannot put a dozen bitcoins into my pocket, hike into some remote area and trade them to the locals for goods and services. I cannot physically move a bitcoin and control who has access to it. I look at things like the bank seizures bei BitCoin and BotNets (Score:2) My biggest complaint about BitCoin is that it could very easily be used as a way for BotNet operators to monetize their exploits. The whole idea behind BitCoins' value (as I understand it) is that they should be worth the same amount as the processing power used to compute them would have cost. However, since the BotNet operators don't pay the costs of processing (those costs, in terms of electricity to run the processors are paid by the owners of the compromised machines), they basically get to steal money Waiting for Bytecoin... (Score:5, Funny) "Sending money" (Score:4, Interesting) One thing I'm noticing in this discussion is the fact that apparently in America the concept of sending money directly from one person to the next is considered alien and revolutionary by many, even though you can do that with good old USD too. It's called a bank transfer. I think it's because the use of cheques is still so widespread in the US. I've never understood that strange preference for paying by cheque. I did an internship in the US, and I could choose between receiving my wages as a cheque, or having it directly deposited into my bank account. I chose the latter, as I am used to that and it makes much more sense. I think I was the only one in the entire company. I don't get it. Really, a piece of paper? That you can lose? That can be stolen? That's a hassle because you have to physically bring it somewhere to get your money? That can bounce (a really weird concept to me)? Here in the Netherlands (and certainly most of Europe as well, I don't know about the rest of the world) it's extremely common to pay each other by direct bank transfer. It's how everybody receives their wages and pays their bills. If you go out to dinner together it's common for one person to pay the bill and everybody else to transfer their share to their bank account. It's fast, easy, safe, and secure. With the phone apps every bank has these days it's a matter of seconds to do. There is no "bouncing", once you receive the money it's yours. Very odd that it just doesn't seem to want to catch on in the US. How about (Score:3) "I have a negative opinion of and distrust Bitcoin USERS?" Re:I don't give a shit about imaginary currencies. (Score:5, Insightful) Including the Euro and the modern Dollar, by the way. Either the stuff you pay me with is backed by something real... not just belief... or GTFO. And I believe that if I offered you 1000 USD or EUR, that you would not tell me to GTFO and to come back when I had some zinc or hog bellies. Re: (Score:2) Including the Euro and the modern Dollar, by the way. Either the stuff you pay me with is backed by something real... not just belief... or GTFO. The only thing that matters to you is what YOU believe. You believe in the USD and so do people that you trade with. There are plenty of people out there who do not believe in the USD, believe me, and they won't take it if you offer. Bitcoin has a not insignificant following, but there are plenty of people who won't take it, and the most important of those people to your decision being you. Re: (Score:3, Informative) No. The most important is what the people I want something from believe. If I believe that maple leafs are worthless, but my baker thinks they are worth a lot, and offers me bread for a few of them, then the maple leafs will get a value for me, namely the value that I can get bread for them. And if I don't have a maple tree, and I'm sure the baker will continue to accept them, I'll even be willing to give some things for maple leaves too, as long as I: (Score:2) Gold is already worthless as a currency. It's prone to speculation and the additional supply you have coming onto the market at any given time is minimal. What's more, the industrial applications for it is somewhat limited and most of the value presently comes from people hoarding it. In other words, gold has very little real value to it, and when times change and it goes out of fashion again, it will be right back where it was prior to the recent run up. Then there's the issue of the assaying you need to) Which would you rather own when your economy is experiencing hyperinflation? At that point your fallacy becomes obvious: gold _is_ something, whereas fiat currencies are merely temporarily _backed by_ something. I agree with you in dissing gold as a mere "shiny metal"; however as long as most of the world disagrees, both of us would be wise to respect gold's highly superior intrinsic value. That value is not intrinsic, because as you say, it's only because most of the most believes it has value, that it does have that value. When people stop believing that, it stops having value. When society collapses completely, which would you rather own: gold, or a piece of land? Land has intrinsic value. Gold doesn't. Re: (Score:3) "Which would you rather own when your economy is experiencing hyperinflation? " a good regulatory body is what In would rather have. regardless of the currency base. Of course currency based o gold is high subjective to other forces. It also limits growth. It's called the "Gilded cage" for a reason. Re: (Score:3) Re: (Score:2) Re:I don't give a shit about imaginary currencies. (Score:4, Insightful) And in a desert gold a liter of water is worth more then all the gold you have after 3 days. In fact if I have a big functioning economy, and all you have is a gold mine, then your gold is actually worthless. And you'll be really screwed if my people's culture say, viewed shiny things as senseless opulence. It's a commodity. Re: (Score:3) read like the crap from political campaigns or HR consultants?.... opinions, not the basis for an academic study. Actually that's the point. Opinions are very suitable for academic study, and discovering opinions is the primary purpose of polling. You wouldn't do a poll to discover facts of physics or any other natural law. You poll to discover what people think, i.e. their opinions. Re: (Score:2) If I could demonstrate a Magic Spell to you, would that Spell have worth? What if it could allow you to moving any number (or fraction) of coins from your possession to anyone else in the world without the help of any centralized third party? Would that have value? Because that is what Bitcoin is. The ability to engage in transactions without involving any centralized third party. You might not consider that important, but some people do. What is Paypal worth? VISA? MasterCard? American Express? Hint: Re:Mining (Score:4, Informative) Since I am mining right now with my graphics card in the background, I will try to explain. The bitcoin system has at it's core a database that records transactions between accounts. Transactions are grouped into sets called blocks, and they are chained together by using the hash of the previous block as part of generating the next block. We want the history of transactions to be hard to tamper with, including adding new, possibly spurious, transactions. Therefore to record a new block and have it be accepted by the network, a difficult condition needs to be met. Specifically, a set of new transactions, the hash of the previous block, and an unknown number (nonce) must result in a hash value below a value set by the software Here's a recent block: [blockexplorer.com] You can see the hash value has a bunch of leading zeroes, and the Nonce (834654508) is a fairly high number. The only known way to generate a suitably low hash is to try different nonces till you find one that works. Anyone wanting to include a spurious transaction would have to find the right number faster than the whole rest of the network. This is extremely difficult. You will notice the first transaction listed says "Generation: 25 + 0.37485 total fees". Whoever found the right nonce for this block gets to send 25 newly created bitcoins to themselves, plus whatever transaction fees the other transactions in the block included. This is payment for the work done in maintaining a collectively hard to forge account history for everyone. The Top500 supercomputer list () has a combined power of 162 Petaflops. The bitcoin network hash rate () is 630 Petaflops, about 4 times more. It's that massive level of computing power that makes the transaction history tamper-proof. The security of the accounts history, in turn, gives people confidence to use the bitcoin network to buy and sell stuff. So to answer your questions directly, 1) They are not "pulled from the air", they are a reward for the difficult task of securing the database, which collectively other people are willing to grant to get the security. The validity of a hash is that it meets a difficult mathematical test, but is easy for anyone to check once found, by simply doing a hash of the raw block data and seeing it matches the announced value. If a block fails that check, it gets rejected by everyone and not added to the copies of the block chain. 2) It's not cheating, it's payment for useful and necessary work.
http://slashdot.org/poll/2549/re-bitcoin-i-most-strongly-agree-with-the-following
CC-MAIN-2014-35
refinedweb
7,963
70.53