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
|
|---|---|---|---|---|---|
Interview: John O'Hanley, Author of WEB4J Framework
- First of all, can you give some background about yourself?
I'm John O'Hanley and I have been programming for 10 years. I have specialized in Java web applications for 6 of those 10 years. I am the author of javapractices.com, and have operated the site since 2002. I have a bachelor's degree in Physics. I have also worked for a number of years in the back office of an investment dealer, where I became interested in computing for simplifying business operations. I live in Prince Edward Island, Canada.
- John, you've created "yet another web framework"! Why, oh why?
In a word? Pain. The existing tools I see out there don't seem to be focused on taking away the pain of the average programmer. Nor does there seem to be any minimal, full stack tool for building a simple browser front end to a relational database. It seems very worthwhile to have such a tool. And its intent is not to 'take over the world'. Its intent is to fill a small 'niche', to satisfy people who would like to do things in a particular way.
I do sympathize with people's frustration with having so many tools to choose from, however. But at least its better than having too few!
- In a nutshell, can you specify three reasons why I would use WEB4J?
I would say these are the core reasons for considering WEB4J:
- you are in pain
- you are looking for a simpler way of doing things
- you are not looking for an Ajax or RIA style of implementation
If those criteria don't speak to you, then you shouldn't consider WEB4J. If they do speak to you, then you should look into it. And you should be a bit careful here: since WEB4J is a minimalist framework, you may find that some of its policies are not to your liking. I go to some lengths on web4j.com to make the drawbacks of the tool clear to people from the start. I do this because I think people appreciate the candour, and because I don't want them to become disappointed with it after it's too late (which is not in anyone's interest).
- Do other frameworks not provide these features?
As far as I know (and I may be dead wrong here), there are no other frameworks that:
- let you use plain text .sql files
- let you implement Model Objects as immutable objects, instead of JavaBeans
- encourage you to place validation in Model Objects
- encourage you to place all items related to a feature/screen in a single directory/package - JSP, Action, Model Object, DAO, and .sql file.
Here is an illustration of what is meant by a plain text .sql file. It contains all the SQL statements used by a single feature/screen, and is placed in the same directory as the DAO that uses it:
MEMBER_FETCH {
SELECT Id, Name, IsActive, DispositionFK
FROM Member WHERE Id=?
}
MEMBER_LIST {
SELECT Id, Name, IsActive, DispositionFK
FROM Member ORDER BY Name
}
MEMBER_ADD {
INSERT INTO Member(Name, IsActive, DispositionFK)
VALUES (?,?,?)
}
MEMBER_CHANGE {
UPDATE Member SET Name=?, IsActive=?, DispositionFK=?
WHERE Id=?
}
MEMBER_DELETE {
DELETE FROM Member WHERE Id=?
}
COUNT_ACTIVE_MEMBERS {
SELECT COUNT(*) FROM Member WHERE IsActive=1
}
Each SQL statement is placed in a block, and associated with an identifier, such as MEMBER_FETCH. Those identifiers are referenced in code, and act as a bridge between .sql files and code. To find typing errors related to such String identifiers, WEB4J will perform an extensive validation upon startup, to ensure that there is no mismatch between these identifiers and corresponding references in your code. Your app will not run if any mismatch in these identifiers is found. This protects you from hard-to-find runtime errors, by replacing them with 'startup-time' errors. In practice, this is almost as good as having compile time checking.
Here is an illustration of a typical Model Object. Note that it is an immutable object, not a JavaBean. Also note that it is responsible for its own validation (see the validateState method).
package hirondelle.fish.main.member;
import hirondelle.web4j.model.ModelCtorException;
import hirondelle.web4j.model.ModelUtil;
import hirondelle.web4j.model.Check;
import hirondelle.web4j.model.Id;
import hirondelle.web4j.security.SafeText;
import hirondelle.web4j.util.Util;
import hirondelle.web4j.model.Code;
import hirondelle.fish.main.codes.CodeTable;
import static hirondelle.web4j.util.Consts.FAILS;
/** Member of the Fish and Chips Club. */
public final class Member {
/**
* Constructor.
*
* @param aId internal database id, 1..50 characters, optional
* @param aMemberName full name of member, 2..50 characters, required
* @param aIsActive true if the member is usually a Fish
* and Chips participant, false if the member is no longer
* active; inactive members are no longer included on the RSVP list. Required.
*/
public Member (Id aId, SafeText aMemberName, Boolean aIsActive, Id aDisposition)
throws ModelCtorException {
fId = aId;
fName = aMemberName;
fIsActive = Util.nullMeansFalse(aIsActive);
fDisposition = CodeTable.codeFor(aDisposition, CodeTable.DISPOSITIONS);
validateState();
}
public Id getId() { return fId; }
public Boolean getIsActive() { return fIsActive; }
public SafeText getName() { return fName; }
public Code getDisposition(){ return fDisposition; }
/** Intended for debugging only. */
@Override public String toString() {
return ModelUtil.toStringFor(this);
}
@Override public boolean equals( Object aThat ) {
Boolean result = ModelUtil.quickEquals(this, aThat);
if ( result == null ){
Member that = (Member) aThat;
result = ModelUtil.equalsFor(this.getSignificantFields(), that.getSignificantFields());
}
return result;
}
@Override public int hashCode() {
if ( fHashCode == 0 ) {
fHashCode = ModelUtil.hashCodeFor(getSignificantFields());
}
return fHashCode;
}
// PRIVATE //
private final Id fId;
private final SafeText fName;
private final Boolean fIsActive;
private final Code fDisposition;
private int fHashCode;
private void validateState() throws ModelCtorException {
ModelCtorException ex = new ModelCtorException();
if ( FAILS == Check.optional(fId, Check.range(1,50)) ) {
ex.add("Id is optional, 1..50 chars.");
}
if ( FAILS == Check.required(fName, Check.range(2,50))) {
ex.add("Name is required, 2..50 chars.");
}
if ( FAILS == Check.required(fIsActive) ) {
ex.add("Is Active is required. Inactive Members will not be RSVPed.");
}
if ( FAILS == Check.required(fDisposition) ) {
ex.add("Disposition is required.");
}
if ( ! ex.isEmpty() ) throw ex;
}
private Object[] getSignificantFields(){
return new Object[]{fName, fIsActive, fDisposition};
}
}
There are other items that are available in other frameworks. However, the combination of features for web4j is likely attractive to a number of developers:
- full stack tool
- small 'surface area' (only 82 classes)
- no custom XML files (only web.xml is used)
- no annotations
- no object-relational mapping
- lets you place translations in the database, and avoid the problems associated with properties files
- helps protect you from common hacks (CSS, CSRF, Sql Injection)
- forms implemented in plain HTML
- ...and so on
- Can you run us through a step-by-step quick start?
I have created a Getting Started Guide. It covers the mechanics of getting the example application up and running. It was created for a Tomcat and MySQL environment. The example application is called Fish & Chips Club. Here is a typical screenshot (click for a full image):
If you don't feel like downloading it, you can still examine the source code, on the web. The javadoc for the example app has links to underlying source code, JSPs, and .sql files. For example, this Action class links to its implementation (click on the class name, or a method name). It also links to its view.jsp and statements.sql files.
As an example, you can look at all elements of this particular feature (a 'Resto' is a slang term for a restaurant):
- Action - RestoAction
- Model - Resto
- DAO - RestoDAO
- JSP - view.jsp
- SQL statements - statements.sql
The idea here is that, initially, what's most important for the application developer isn't the API per se, but rather what their application is basically going to look like. A developer can get an excellent idea of the overall feeling of a tool, just by looking at an application that uses it.
Going throught the FAQ is also of interest for beginners, since it helps you quickly evaluate the tool. It also includes links to example Actions, Model Objects, DAOs, and JSPs.
Once the example app is up and running, the next step is to read the User Guide. Again, the example application is almost always a good illustrator of the API. So, you can scan its source code to view realistic use cases for almost all methods.
The next step is to build something for yourself. For your first web4j app, it's highly recommended that you start with its example app, and gradually change it to your needs. It's always easier to start with something that is already working, instead of building from scratch.
If features in the example app need to be removed, you can do so simply by deleting a single directory. This is possible only because the example app is implemented using package-by-feature, where all items related to a feature/screen are placed in a single package/directory - JSP, classes, and .sql file.
It's also recommended that you create your own version of the example app, which better suits your needs. For example, you may want to use just a single database, not three. Or you may not care too much about multilingual apps. Once you create your own version of the example app, you can use it as a template for new applications, more closely customised to your needs.
- Can you compare & contrast WEB4J with the following alternatives -- JSF, Struts, GWT, Wicket.
That's a big question! It's also a dangerous one. I've built apps with Struts, but not with JSF/GWT/Wicket. (Some might take that as evidence of incompetence. In my defense, although I have not built any apps using JSF/GWT/Wicket, I have of course read their documentation, and have gotten an overall feel for what they are about.)
Off the top of my rapidly balding head, I guess the most important aspects are :
- is it full stack?
- is it plain vanilla, or RIA/Ajax?
- is it more about request/response, or about components?
I believe this is accurate (please correct if false or misleading) :
For those wishing a more detailed comparison, they might use the FAQ created for WEB4J, and attempt to answer the same questions for other tools. For those already familiar with another tool, this will provide a quick comparison.
- Why is it named WEB4J?
Simply out of imitation of other tools, such as log4j, oc4j, and so on.
- When and how did you start working on this framework?
I started it in 2002. I first began it because I felt that Struts was mediocre, and I was frustrated. I couldn't find a tool that came close to satisfying me. The first version was built in about 6 weeks. That version had some interesting things about it, but it was mediocre. I have worked on it steadily since then, slowly improving it. I took my time with its design, and I had the luxury of changing it constantly over a number of years, removing extraneous items, and always trying to simplify things from the point of view of the programmer. Only recently has it really become ready for wide consideration.
It may sound silly and pretentious, but I would say that how I built it was influenced more by esthetics than by technical issues. When I think of good books I might recommend to those interested in API design, the first two books that come to mind are The Classical Theory of Fields by Landau and Lifshitz (electrodynamics and relativity), and The Nature of Order by Christopher Alexander (architecture). These books have absolutely nothing to do with coding, but everything to do with elegance, beauty, and simplicity.
This might seem flaky to some people, but I think it's at the core of what WEB4J is about: it's not about the implementation details, it's about compassion for the experience of the application programmer. Other tools seem to almost always first presume a particular implementation style, and thus become locked into it.
For example, object-relational mapping grows out of the desire to, in a sense, replace SQL with object graph navigation. Some front end frameworks are based on the idea that desktop style of programming is superior to plain request/response. And so on. Fundamentally, those kinds of tools are based on ideas, not feelings. In building WEB4J, I never first made any assumptions about implementation ideas. Rather, I listened to the code, looked for the pain points, and tried to remove the pain points in such a way that the application programmer would have a deep feeling of simplicity, clarity, and elegance.
- Are there others involved in the project?
I am the sole developer. There are 82 classes in the public API, which doesn't seem excessively large for a single person.
- What's the timeline for upcoming releases and what do you expect them to provide?
Currently, small updates are released about every 5 weeks. The focus of releases is not to focus on new features, but on fixes and improvements. Since it is a minimalist framework, I need to be a bit...paranoid about adding things. When considering adding something new, I always repeatedly ask myself the question "does this really need to be in the core?" This is similar to Joshua Bloch's dictum "When in doubt, leave it out".
In addition, I can sometimes improve the example application, without altering web4j itself.
Some ideas I'm currently considering:
- loosen the coupling between the data layer and the servlet environment, such that a standalone unit tests can be written for DAOs. (This is a priority issue.)
- the example app uses a login filter, which places user info into session scope upon login. Should that be in the web4j core?
- Data ownership restrictions per user - this is easy to implement, using WHERE ownerid=? kinds of clauses in SQL. Can web4j make that easier somehow?
- Model Objects in the example app have a private getSignificantFields() method, used by equals and hashCode. Is it better to just use a private field instead?
- Should primary key fields should be included in equals and hashCode? Does it matter?
- for Model Objects, is it ever acceptable to not override equals and hashCode?
Dimitris Menounos replied on Wed, 2008/05/21 - 3:51am
John O'Hanley replied on Wed, 2008/05/21 - 6:09am
Dimitris,
Good question. Transactions are defined in DAOs, not in the .sql files.
WEB4J splits operations into 3 kinds :
The example application uses all three styles. The last two styles are demonstrated with operations on Users and their Roles. As you recall, 1 User can have N Roles.
Deleting a User has 2 operations, with no looping : delete the Roles, then delete the User. The code looks like this:
<PRE>
Here, the SqlId objects map to the identifiers in the .sql file. Note that for these simple transactions, the code is straight-line, has no try..catch, and doesn't even refer to a connection.
To illustrate the 'transaction-with-loop' case, changing a User's Roles is implemented in a 'delete-all-roles, then add-all-roles' style. The delete-all-roles is a single operation, while the add-all-roles operation requires looping. This resulting code in the DAO has more structure than the previous example.
<PRE>
</PRE>
It's true that this has non-trivial structure, with its looping operation, and the static inner 'helper' class. However, it's still true that the DAO doesn't deal with try..catch, or with connection management.
For more information, please see the User Guide:
The complete DAOs can be found here :
How does all this strike you? Does it seem like something that would make you happy to use? Does it seem onerous?
- John
Dimitris Menounos replied on Thu, 2008/05/22 - 3:39am
You said that web4j "was influenced more by esthetics than by technical issues". Starting with this I have to say that the given example code doesn't look very pretty to me. Additionaly IMO DAOs should not define transaction boundaries.
John O'Hanley replied on Thu, 2008/05/22 - 5:58am
Dimitris,
Thanks for your comment. I agree with you regarding the 'transaction-with-looping'. I'm not satisfied with it either, and I wish it was simpler...
For the other 2 cases (no-transaction and transaction-with-no-looping) I am, on the other hand, satisfied that they are simple and compact. I can't see anything more to 'take away'. Everything unnecessary has been removed, in those cases.
- John
John O'Hanley replied on Thu, 2008/05/22 - 5:59am
If anyone has any comments or questions, I would be glad to answer them...
- John
John O'Hanley replied on Sun, 2009/03/22 - 9:01am
|
http://java.dzone.com/news/interview-john-ohanley-web4j
|
CC-MAIN-2014-23
|
refinedweb
| 2,782
| 57.57
|
_read pin 0 to reset the pin after it has been used for playing tones.
Quick Test
If you have access to a serial monitor, like the REPL window in Mu, this program will show you the features of the board in one go, outputting readings from the inputs after the outputs have been tested.
from microbit import * import music import neopixel # Initialise neopixels npix = neopixel.NeoPixel(pin13, 6) # Define some colours red = (64,0,0) green = (0,64,0) blue = (0,0,64) nocol = (0,0,0) # light all neopixels with given colour def light_all(col): for pix in range(0, len(npix)): npix[pix] = col npix.show() # wipe a colour across pixels one at a time def wipe(col, delay): for pix in range(0, len(npix)): npix[pix] = col npix.show() sleep(delay) def read_joy(): return pin1.read_analog(), pin2.read_analog(), pin8.read_digital() def read_buttons(): # red, blue, green, yellow btns = [pin12,pin15,pin14,pin16] return [p.read_digital() for p in btns] def read_pot(): return pin0.read_analog() def play_tune(): music.play(music.BADDY) pin0.read_digital() light_all(red) play_tune() wipe(blue,250) while True: x,y,j = read_joy() btns = read_buttons() p = read_pot() print(x,y, j, btns, p) sleep(20)
The readings you see being printed are the x and y values for the joystick, whether or not the joystick button is pressed, the state of the buttons and finally, the reading from the potentiometer.
I ran this as a first test to see some use of all of the parts of the board. Watching the readings as you press and move the inputs is an easy way to see how things work.
The Rest Of The Section
There are already pages on the site that look at how to deal with the individual components of the board. I chose to use the board to reflect a little more on each of these, like the buttons and the dial, and work out better approaches to programming for them. I also converted some older programs to use the Bit:Commander as an input and found them easier to use as a result.
|
http://www.multiwingspan.co.uk/micro.php?page=bcintro
|
CC-MAIN-2019-09
|
refinedweb
| 351
| 67.49
|
Hey first time poster, first year of computer programming so I thought to myself, why not sign up for a forum ! So here I am ahah.
Anyways I'm a bit stumped on my assignment, and would like a bit of clarification, I'll show you what I've got so far.
Basically it's the old Jelly Bean game, ask users how many will be playing, and then they enter their names, their guesses and so on.
Here's my code so far.
Code Java:
import java.util.Scanner; public class M_H_Project2JellyBeans { public static void main(String[] args) { Scanner input = new Scanner(System.in); //introduce the program to the user System.out.print ( "\t Welcome to Moe's Jelly Bean Guessing Game! " + "\n\t ******************************************" + "\n Can you guess correctly how many Jelly Beans are in the jar ? " + " \n -The number of Jelly Beans in the jar ranges from 1001 to 1999- " ); //ask how many people will be making a guess System.out.print( "\n\n How many people will be attempting to guess the right number today ? " ); int arraySize = input.nextInt(); //create a String array for the names and an int array for the guess String[] nameArray = new String[arraySize]; int[] guessArray = new int[arraySize]; int xNumber; //create random jelly bean number int jellyBeans =(int)(Math.random()*(1999-1001+1) + 1001); //set up a for loop to enter the data for(int i = 0; i < nameArray.length; i++) { input.nextLine(); //clear the buffer //ask for name of person System.out.print("Enter name of person #" + (i+1)+ ":"); nameArray[i] = input.nextLine(); //do-while loop do { //Ask the user to enter their guess. System.out.print(nameArray[i] + ", Enter your guess between 1000 and 2000: "); guessArray[i] = input.nextInt(); //Let user know they've entered an invalid number if number they've entered //does not range from 1001 to 1999 ! if ( guessArray[i] <= 1000 || guessArray[i] >= 2000 ) { System.out.println("Don't be silly ! Your guess has to be between 1001 to 1999...Please try again."); } } while(guessArray[i] <= 1000 || guessArray[i] >=2000); { System.out.println("\t\t\t\t[*" + nameArray[i] + " has entered '" + guessArray[i] + "' as a guess*]" ); } if ( guessArray[i] == jellyBeans) { System.out.println("TheThe winner is" + nameArray + "with a guess of " + jellyBeans + ", which is exactly the same as the number of jelly beans in the jar."); } } System.out.println("\nThere were " + jellyBeans + " Jelly beans in the jar"); int lowestDifference = findLowestDifferencehelper.findLowestDifference(jellyBeans, guessArray[0]); System.out.println( "Your guess was " + lowestDifference + " jelly beans away from the actual number."); } }
And here's the method i've created to findLowestDifference() of the users guess and the actual randomized amount of jellybeans.
Code Java:
public class findLowestDifferencehelper { /* *MethodName: findLowestDifference() *Purpose: determines the difference between actual Jellybeans and players' guess *Accepts: an array of type int *Returns: the difference */ public static int findLowestDifference(int num1, int num2) { int lowestDifference = Math.abs(num1 - num2); return lowestDifference;
Now my problem is, when i run the program, and enter let's say 2 users, and enter their guesses, i only get a difference for the first user.
Welcome to Moe's Jelly Bean Guessing Game!
******************************************
Can you guess correctly how many Jelly Beans are in the jar ?
-The number of Jelly Beans in the jar ranges from 1001 to 1999-
How many people will be attempting to guess the right number today ? 3
Enter name of person #1:Moe
Moe, Enter your guess between 1000 and 2000: 1300
[*Moe has entered '1300' as a guess*]
Enter name of person #2:Jon
Jon, Enter your guess between 1000 and 2000: 1500
[*Jon has entered '1500' as a guess*]
Enter name of person #3:Steve
Steve, Enter your guess between 1000 and 2000: 1800
[*Steve has entered '1800' as a guess*]
There were 1008 Jelly beans in the jar
Your guess was 292 jelly beans away from the actual number.
I need to create a reportWinner() method, however, how do i make my code give me the lowestdifference for each and every guess ?
This is what the program is supposed to look like when run when i finish.
How many players will be making guesses today? 3
Please enter name # 1: Mike
Mike, enter your guess between 1000 and 2000: 1585
Please enter name # 2: Bill
Bill, enter your guess between 1000 and 2000: 1376
Please enter name # 3: Tony
Tony, enter your guess between 1000 and 2000: 1723
There were 1139 jelly beans in the jar.
The winner is Bill with a guess of 1376, which is 237 away from the actual number of jelly beans.
Thanks in advance guys, I hope I didn't post too much at once ahah.
|
http://www.javaprogrammingforums.com/%20object-oriented-programming/6228-%5Bmethod%5D-help-printingthethread.html
|
CC-MAIN-2017-47
|
refinedweb
| 776
| 64
|
Conservapedia talk:What is going on at CP?/Archive206
Contents
- 1 Ken Dolls Awards
- 2 Another failed experiment
- 3 In bizzaro world...
- 4 Extremely late realization
- 5 On behalf of bears everywhere...
- 6 Wait, what?
- 7 Lumping Andy with "Holocaust deniers"
- 8 Obama bows
- 9 Understanding [Conservapedia] by Andrew Sullivan
- 10 Andy doesn't read own source
- 11 Kara and Andy compete for the Biggest Moron award on the same user talk page
- 12 User 188 is a communist
- 13 Irony
- 14 So many favourable comments!
- 15 Quantum tunneling WIGO
- 16 Forbidden
- 17 Cambrian Explosion Being Rewritten
- 18 Jetstream
- 19 facepalm.jpg
- 20 Oct 2010: articles and namespaces at Conservapedia and RationalWiki (and aSK)
- 21 Who's left at CP?
- 22 It's just a jump to the right...
- 23 Wiki-guru User188 - please may I touch you, the goodness might rub off on me
- 24 Conservapedian Science got boring.
- 25 So does Andy not care about Joe Miller?
- 26 Could have been Andy
- 27 So much for added protection and vetting
- 28 DanielPulido goes down!
- 29 Kinda weird: Why would CP have a link to a page that links to what they would consider porn?
- 30 Atheist bears invade Mainpage
- 31 Maintenance
- 32 Leeds
- 33 Miracles
- 34 Job queue
- 35 Creepy
- 36 ConservaMath Medal
- 37 Veterans Day
- 38 Blasts from the past
- 39 SamHB
- 40 An (ex?)-Conservapedian at my university?
- 41 CP's bear
- 42 Andy's view of conservatives as never-ending victims
- 43 So... if you read books that means you're a Liberal
- 44 Koeckritz *loves* Sarah Palin
- 45 Conservative learning from TK?
- 46 Stupidity theory
- 47 Kenny boy...
- 48 Screen Caps
- 49 Makes perfect sense
- 50 Andy, please learn to write English!
- 51 User 188 cops a ban
Ken Dolls Awards[edit]
Is it me, or is "smooth as a" Ken Doll's latest shots at us getting sad, even for him. Lets give him another award for "ignoring or pretending does not exist" our facts on christianity. --Thunderstruck (talk) 23:59, 7 November 2010 (UTC)
- He is totally stoked, and nobody other than the page creator has even suggested or voted yet. Nice work, Ken. I like your idea, let's create an award specially for ken, and then not give it to him. Better yet, how about "the most in (out of) touch with the speaker industry" award? ħuman
00:31, 8 November 2010 (UTC)
- I am totally taking credit for his return to the phrase "cat that gets hit by the shoe that yelps the loudest" Thank you SirChuckBHITWIN FOR PRESIDENT! 07:42, 8 November 2010 (UTC)
- You gotta wonder, if he wins, will he come over and make a speach? And not just any speach, an egomaniacal "George Cloony at the Oscars" type of speech. --Thunderstruck (talk) 11:39, 8 November 2010 (UTC)
- Pssst, speak (verb) but speech (noun) and Speke (airport). Lily Inspirate me. 12:57, 8 November 2010 (UTC)
- Thanks Andy. --Thunderstruck (talk) 13:04, 8 November 2010 (UTC)
- Lily is the residential pedant. Ironically, she literally dabbles in pedanticism. ONE / TALK 13:21, 8 November 2010 (UTC)
- Lily is not zoned for commercial use. --Kels (talk) 17:05, 8 November 2010 (UTC)
- With that I heartily agree. Lily Inspirate me. 17:14, 8 November 2010 (UTC)
- Or pedantry. Trap sprung! ONE / TALK 15:28, 8 November 2010 (UTC) Lily Inspirate me. 13:46, 8 November 2010 (UTC)
- And I'm not alone. Lily Inspirate me. 13:49, 8 November 2010 (UTC)
Another failed experiment[edit]
larronsicut fur in nocte 11:05, 8 November 2010 (UTC)
- I dunno, I see the "e-mail us to join" is back on the front page. Along with Al Gore being Fred Phelps supporter. --PsyGremlinFale! 11:27, 8 November 2010 (UTC)
- You are absolutely right: it is there - again - since Oct 5, 2010. It is just not mentioned at cp:Special:UserLogin, you know, the logical place for such information...
- larronsicut fur in nocte 12:08, 8 November 2010 (UTC)
- For those not keeping track, the "e-mail for an account" idea hasn't been going so well. In the week CP has been doing it, the sysops have created six accounts (One by Karajou, two by Andy and three by TK). Of those, only two have actually been used to edit - StephenKP (inactive since his first day) and JonG2. Colonel of Squirrels医药是医药,和那个不是医药。 17:12, 8 November 2010 (UTC)
- Evaluating the effectiveness of the policy is necessarily a subjective determination. Look at it from Andy's perspective. For years he's been encouraging overzealous blocking that would decimate the membership of any wiki that actually depended on good faith editors. And he's mostly correct that the vast vast majority of people who sign up and manage to edit aren't "conservative" enough for CP. So from his perspective it might very well be that two editors in a few weeks is just fine. But one gets the impression zero would be better.
19:24, 8 November 2010 (UTC)
- I kind of miss the days when bright-eyed and bushy tailed editors would sign-up, only to end up being exiled. Maybe CP is switching to a multiple-generational project. In a few generations they'll have enough quality articles to give the Daily Mail a run for their money. They still have their guide to wanking up there, so maybe there is hope for CP. Concernedresident omg!!! ponies!!! 23:35, 8 November 2010 (UTC)
In contrast, one of my favorite meta-pages here, RationalWiki:How_I_found_RationalWiki, continues to be added to by a healthy handful every month. Hell, the noobs even build the continuing structure of the page (since I doubt we oldsters do)! ħuman
01:35, 9 November 2010 (UTC)
In bizzaro world...[edit]
Conservative double standard: Juan Williams is almost immediately hired by Fox News, but commentators (such as Keith Olbermann) disliked by conservatives must crawl back to second-rate networks like MSNBC. Andy really is insane. If I saw him walking down the street, I'd cross to the other side. Occasionaluse (talk) 20:49, 8 November 2010 (UTC)
- at least I wouldn't accept a diner invitation to his home... larronsicut fur in nocte 20:58, 8 November 2010 (UTC)
- Ok, that was damn funny. :) --98.144.126.13 (talk) 21:25, 8 November 2010 (UTC)
- hah! Occasionaluse (talk) 21:38, 8 November 2010 (UTC)
- That, and Jesus told him not to wash his hands before cooking. --JeevesMkII The gentleman's gentleman at the other site 22:10, 8 November 2010 (UTC)
- Captain Obvious to the rescue ;-) --larronsicut fur in nocte 22:12, 8 November 2010 (UTC)
Extremely late realization[edit]
Christ, I finally realized why Andy, the rich(?), suit-wearing lawyer suddenly supports "greasy spoon" restaurants, opposes handwashing and cheers on Joe Sixpackimg (the couch potato who doesn't spend his time on reading the Bible and instead drinks beer while watching TV).
Because up until now, I had completely forgotten that evil President
Nicolae Carpathia Barack MUSLIM NAME HUSSEIN Obama wants people to stop being fat slobs.img
So... greasy spoon --> Jesus hates handwashing --> Obama's Muslim agenda to make people healthy <-- Joe Sixpack, Hero of
the Imperium Conservatism
I think it's time we get a flowchart or other sort of diagram to connect the various insight dots. --Sid (talk) 00:00, 9 November 2010 (UTC)
- You need Glenn Becks chalk board. It was specialy created to handle MEGA-TONS of bat shit crazy.--Thunderstruck (talk) 01:08, 9 November 2010 (UTC)
- I would respect any efforts you put in that direction, Sid. Use that program someone told me about when I did the "who sysoped who" chart? 'Twas easy to use once I had my data scribbled out. ħuman
01:15, 9 November 2010 (UTC)
- That article is so... fucked up. "elitist, fancy-college-graduate" = Andy. And Joe six pack means a dude who drinks a six pack every evening to escape his tawdry "working class" world. PS, Andy, your party has been trying to destroy the working class for 30 years now. ħuman
01:18, 9 November 2010 (UTC)
On behalf of bears everywhere...[edit]
... I apologize for Ken's latest essay.img (The "B" in "MDB" stands for "Bear". Woof.) MDB (talk) 15:58, 8 November 2010 (UTC)
- "I hope you didn't think I would fail to mention the Soviet Union and atheistic communism!" No, Ken, I'm just shocked that you didn't mention homosexuality. And where's our Hitler? We paid a lot of money to get the ticket to the Conservative Show. Where's our Hitler? --wwwwolf (barks/growls) 16:35, 8 November 2010 (UTC)
- What I'd like to know is how many of those North Dakotan Christians are Biblical literalists. That is, are they Christian, or are they "Christian", from a CP point of view? --Kels (talk) 16:44, 8 November 2010 (UTC)
- Interestingly they seem to have burned some of the earlier discussion on mpr about the earlier article where lances called ken out and tk agreed with him, which article ken wrote then deleted. The talk was moved from mpr to talk:are atheists smarter than bears. Which now naturally redirects to the atheism article instead of a talk page. And sorry, I didn't cap it and do not have it in cache.Oldusgitus (talk) 17:46, 8 November 2010 (UTC)
- No need to cap it. TK - Ken's done that in a dozen instances I can find - many many of the talk pages for his essays and articles redirect to the Atheism or Evolution talk pages, or are locked along with the essay. The Atheism talk page has a weird "Atheism Egress Department" legend at the top that's not exactly what one would expect seeing on an encyclopedia. You really ought to do something to rein Ken in lately - he's rapidly burning what remaining credibility Conservapedia had, driving editors off, and basically acting like a douche. You're welcome.
19:19, 8 November 2010 (UTC)
- Jo Stalin was a communist? Whodathunkit. But why is there no answer to the bear question? ₩€₳$€£ΘĪÐ
Methinks it is a Weasel 19:24, 8 November 2010 (UTC)
- "A bear must have some secrets, after all. They allow us to seem attractive and mysterious." MDB (talk) 19:27, 8 November 2010 (UTC)
- Is this worth the bother, he just copies and pastes the writing from his other "essays", changes a few words around and switches up the animal. Still I like how he thinks that "no religion" means atheist, admitting backhandedly there are far more atheists in the United States then CP ever will up front. As for North Dakota, it is true they have the highest per capita of churches per person, but if he read another paragraph or two in to that link, he would discover 20% of those churches are now shuttered. Is most religious state is becoming...less religious? --BMcP - Just an astronomy guy 20:13, 8 November 2010 (UTC)
- Is it worth mentioning the state that came in number three on the no religion survey (at 24%) was number five when it came to lowest unemployment (5.8%), which is Vermont? Also ♥ K e n D o l l ♥ Oregon doesn't have the 5th highest unemployment according to the survey you cite, but 7th, learn to count and you're welcome. --BMcP - Just an astronomy guy 22:19, 8 November 2010 (UTC)
I failed in English again[edit]
Should I be worried that I did not find the word "bear" in anywhere other than the title and the caption of one picture? It's an essay somewhat related to bears, right? K61824ZOYG I edit like Kenservative! 06:47, 9 November 2010 (UTC)
- Not really. More like "BEARS! Now that I've got your attention, read this predictable drivel which has nothing to do with bears." ₩€₳$€£ΘĪÐ
Methinks it is a Weasel 13:49, 9 November 2010 (UTC)
- Worst is, if anybody questions it - oh, right, there aren't any left - it'll be "please cite examples where I do not reference bears in the article," "until such time as you can show that bears are smarter than atheists, I'm going to ignore you." Hey Ken, when are you going to write an "essay" about Andy hiding in his non-intellectual bunny hole, when questioned about his unbelief in relativity. --Ψ GremlinSermā! 14:18, 9 November 2010 (UTC)
- Somebody did question it: Question,img a promise by TK to unlock the talk page,img removal of entire section,img talk page still locked days later.img --Sid (talk) 17:52, 9 November 2010 (UTC)
Wait, what?[edit]
Liberals legalize gay marriage because they have no interest in fairness or equality, only promoting their own agenda. THIS IS WHY WE ARE LAUGHING AT YOU. --Thunderstruck (talk) 23:32, 8 November 2010 (UTC)
- You have to admit that TK has a talent for copypasting from just the right articles: They make CP look absolutely idiotic, and yet Andy undoubtedly congratulates him for improving the main page with his excellent headlines. If anybody ever questions why everybody here keeps chanting "TK is a parodist", just point them to MPR headlines such as this one. --Sid (talk) 23:46, 8 November 2010 (UTC)
- Because no one will radioactively date him, let alone suggestively the civetousness of a Prawline holy band(age). ħuman
01:25, 9 November 2010 (UTC)
- I don't know how to do hide revisions. Someone please get rid of that anonymous edit.
01:27, 9 November 2010 (UTC)
- Something's messed up here... Someone appears to have deleted the BoN edit, but I can still see it. Oddly, even though I'm a 'sop, I can't see who hid it!--cm2 01:44, 9 November 2010 (UTC)
- I will allow PJR to explain. - π 01:52, 9 November 2010 (UTC)
- And as to why you as a sysop cannot see or edit the suppressed revision - it is because the hidden edit was hidden by a bureaucrat - they have the powers that be to hide edits even from sysops. It's basically a higher level of the sysop's ability to hide revisions. You can see who hid the edit, though, at Special:Log/suppress. ~SuperHamster Talk 01:58, 9 November 2010 (UTC)
- Can someone now please kill my non sequitur response to the BoN please? ħuman
02:12, 9 November 2010 (UTC)
- And then we'll have to remove Nutty's non sequitur comment...and then Centimeter's....then Pi's...then mine...then yours...then mine again... ~SuperHamster Talk 02:15, 9 November 2010 (UTC)
- And then we'll have to cancel the wiki, hurl the server off a cliff, swear all witnesses to lifelong secrecy, and...--cm2 02:18, 9 November 2010 (UTC)
- ...and then we'll have to start out again with RationalWiki 3.0. ~SuperHamster Talk 02:21, 9 November 2010 (UTC)
- Damn, let me save my userboxes to my hard drive first... I fixed my post to clarify the mud. ħuman
03:55, 9 November 2010 (UTC)
- I missed the fun. Why are we removing the BoN's comments again? ThiehZOYG I edit like Ken! 06:43, 10 November 2010 (UTC)
Lumping Andy with "Holocaust deniers"[edit]
Not loved by the Jews either, Andy.
"Now a new generation of Einstein deniers, including some Holocaust revisionists, are launching attacks, simultaneously rejecting Einstein’s science and accusing him of stealing his ideas from others." (has this been brought up before? If so apologies) 03:11, 9 November 2010 (UTC)
- Say, would this be a reliable third-party source for the WP article? --Kels (talk) 03:34, 9 November 2010 (UTC)
- Don't see why not but there's an awful lot in the article: what to use? 03:39, 9 November 2010 (UTC)
- I'd say just put a flea in the ear of the smart folks over there about it, let them come up with their faves. --Kels (talk) 03:49, 9 November 2010 (UTC)
- Yes indeed. ħuman
03:50, 9 November 2010 (UTC)
- Duly posted at wp:as and wp:cp talk pages. ħuman
03:53, 9 November 2010 (UTC)
- And it has been duly replied to. By meh. ~SuperHamster Talk 04:04, 9 November 2010 (UTC)
- Anybody want to make sure Conservapedia knows they have something in common with their favourite guy to compare people to, Hitler? Dalek (talk) 04:20, 9 November 2010 (UTC)
- Don't worry, they read this page as much as we do. 04:22, 9 November 2010 (UTC)
- Andy's denial of relativity is what I like to call Douche Physik. --Night Jaguar (talk) 06:11, 9 November 2010 (UTC)
- A. Schlafly's position towards the Theory of Relativity resembles the Deutsche Physik of the 1930s:
- It was invented by this Jew, so it can't work
- while R. Schlafly has the views of a Deutscher Physiker of the 1940s:
- It seems to work, so it wasn't invented by a Jew
- larronsicut fur in nocte 06:28, 9 November 2010 (UTC)
- Awesome. There's some wonderful comments in there - "conservative bloggers" (see, it's not just us who think your "encyclopaedia" has failed); "did not respond to repeated attempts to interview him for this article" - wow, see how the conservatives run from questions. Hiding in your intellectual rabbit hole again, Andy? --Ψ GremlinTala! 10:56, 9 November 2010 (UTC)
- "Schlafly uses a technique known in rhetoric as the 'Gish Gallop'" Beautiful! Are we quite sure one of us didn't write this? --Ψ GremlinSpeak! 11:09, 9 November 2010 (UTC)
Reading that article again, is that really the basis of Andy's basis for hating the ToR? "Tribe’s article uses relativity as a metaphor for understanding constitutional law. In the footnotes, Tribe thanks the man who was then the editor of the review: a law student named Barack Obama." So because Obama is involved, it must be wrong. Surely, he can't be that short-sighted? What did Obama do to engender such hatred in Andy? Besides defeat Andy for the post of HLR Pres, of course. --Ψ GremlinParlez! 14:27, 9 November 2010 (UTC)
- I always thought that it was the whole 'relativity/relativism' debacle. EddyP (talk) 14:32, 9 November 2010 (UTC)
The JTA article is very poor on actual physics. Although there were no elevators in Newton's day his theories provide a perfectly reasonable explanation of the force you experience in an accelerating elevator. Greg Egan came up with a world where ordinary people can notice relativistic effects - they live inside a rock about to fall into a black hole. Not Earth. I think people who write articles like this ought to be required to at least read a couple of primers for the layman like Six Easy Pieces and complete a quiz to show they understood them. 82.69.171.94 (talk) 14:59, 9 November 2010 (UTC)
Obama bows[edit]
OMG! Obama bows to the Indian parliament!!img Oh noes! Because respecting another's culture and saying "Namaste" is such a liberal thing to do. Then again, we are talking Jpratt here and the words "pig ignorant" spring to mind, although that really is an insult to pigs. --Ψ Gremlin말하십시오 15:04, 9 November 2010 (UTC)
- Yeah but he's a Muslim remember. And we all know how Muslims love India. No, wait... StarFish (talk) 16:10, 9 November 2010 (UTC)
- Well, Islam is the second-most-practised religion in India at over 13% of the population (thank you, QI). Therefore (insert something about liberals and muslims). Cantabrigian (talk) 17:30, 9 November 2010 (UTC)
Understanding [Conservapedia] by Andrew Sullivan[edit]
Sullivan recently wrote about why Fox News is not a conservative channel, but a partisan one. I thought the critique was equally apt for Conservapedia:.
This is why A Storehouse of Knowledge was started. This is why so many people--including their fellow travelers--are banned. Conservapedia is not a conservative site, but one of third-rate insecure intellects who are beholden to Andrew Schlafly's ego, hoping some of the second-hand glamor of Phyllis Schlafly will rub off on them. --Leotardo (talk) 18:15, 9 November 2010 (UTC)
- Yeah, that looks quite applicable. CP officially allows "liberals" (a.k.a. people who don't agree with Andy's opinion) on their site... as long as they openly agree with Andy or just stay quiet and never edit articles controlled by the sysops. And they allow "liberal" (a.k.a. whatever doesn't agree with Andy's opinion) POVs in articles... as long as they are disclaimer'd by "liberals/atheists/evolutionists falsely claim X because they hate God/America and want to mislead the public". --Sid (talk) 18:43, 9 November 2010 (UTC)
Andy doesn't read own source[edit]
Just saw this on the Main Page from Andy. Apparently, Liberal "bailing out" is the same as "increasing funding to counter the GOP's effort".
I may have misunderstood this, but it would appear that, having read all the article, the Republicans have certain big groups that can finance them, so Obama has allowed the Democrats to receive funding to put them on a par with the GOP. Am I getting this right? AlexR4444 (talk) 18:27, 9 November 2010 (UTC)
Kara and Andy compete for the Biggest Moron award on the same user talk page[edit]
Current version of the page in questionimg (and the historyimg in case people doubt it's really them)
As background, the user tried to insertimg a note asking people to categorize stuff from the "unsorted" pile into more appropriate sub-pages. As of right now, there are already several such sub-pages (Abortion, Conservapedia smears, Global warming, Homosexuality, Liberal Politicians, Obama - a.k.a. sections 1.3 to 1.8 of the main article).
What happens next is predictable:
Andy reverts and whines about the banner and completely fails to even acknowledge what was being suggested. It all boils down to his old hatred of funny boxes above his precious insights.
The user posts a reasonable reply and reverts Andyimg (WARNING! DANGER!) And then... Karajou stumbles in with his own brand of idiocy: "You have two businesses to run, but you claim you don't have the time to trim an article?"
...oh, and then he figures that this might not out-stupid Andy's post on that page, so he adds to it, suggesting that instead of placing stupid boxes, why didn't the user suggest a better layout - for example one that moves entries from the main article to sub-pages. ...WHICH IS EXACTLY WHAT IS ALREADY THERE AND WHICH THE USER WAS TRYING TO MOTIVATE PEOPLE TO DO.
...on the other hand, I should be happy: CP had become boring (for me) during the election hype. It's downright refreshing to see oldskool 2-on-1 bullying again! --Sid (talk) 23:35, 8 November 2010 (UTC)
- What happened to Capturebot? 00:03, 9 November 2010 (UTC)
- Shame that Capturebot crapped out. I would have loved to see what Andy thought was such an eyesore.
- These acts of absurd rudeness still manage to catch me by surprise. In a sense, this is worse than the instablocks. That's driven by reflexive paranoia; this is just being mean for the sake of being mean. Karajou trying to take credit for the guy's idea is a nice touch, too. Colonel of Squirrels医药是医药,和那个不是医药。 09:44, 9 November 2010 (UTC)
- CoS, I think that what you wanted to see is thisimg. For some reason Andy hid the original banner edit but Ctown200 (NOT Ctown2000 you moron, Andy) resubmitted it and chief brown-nose TK just reverted rather than hiding it again - "DO NOT revert administrators decisions". Lily Inspirate me. 10:43, 9 November 2010 (UTC)
- Some more back and forthimg until TK steps in to "clarify"img that Karajou was somehow right in this exchange,img Ctown was somehow wrong, Ctown insulted Karajou, thisimg gets silently reverted,img oh, and finally... BANHAMMER. --Sid (talk) 20:36, 9 November 2010 (UTC)
- Love the block comment. "Take some time to cool off." Five years to be precise. SJ Debaser 20:46, 9 November 2010 (UTC)
- It might just be a set-up for a good cop/bad cop routine so that the guy has to apologize to poor, poor Karajou, send Andy a personal apology for cluttering the precious WP Bias page with a hideous box, promise to never be such a bad person again, and then submit a writing plan to Ed for good measure. I mean, the talk and user pages weren't immediately deleted, so... --Sid (talk) 20:52, 9 November 2010 (UTC)
- Karajou doesn't like TK claiming the Biggest Moron award for himself, so he posts - after the talk page was locked and the user was banhammered - this little shot.img Lovely. --Sid (talk) 18:47, 10 November 2010 (UTC)
User 188 is a communist[edit]
Hysterical! 04:07, 9 November 2010 (UTC)
- Ha haa! Wikipedia's many cranks usually annoy me but that made me laugh. Totnesmartin (talk) 10:08, 9 November 2010 (UTC)
- I preferred the comment on Ed Poor's talk page. Lily Inspirate me. 10:54, 9 November 2010 (UTC)
- I love Ed's WP talk-page. Every 2nd entry is notifying him that one of his stubs is being deleted. --Ψ GremlinTala! 15:07, 9 November 2010 (UTC)
- Ed operates a "shit against the wall" policy. It works like this: 1) create a bajillion articles for anything and everything, no matter how obscure, while putting minimal effort into each one. 2) Hope some other editor stumbles across one of them an expands on it, creating something slightly less likely to be deleted. 3) Claim responsibility for the entire article in its present state. ONE / TALK 16:22, 9 November 2010 (UTC)
- Now that's being economical with the truth and deliberately unfair on Uncle Ed, One. He also regularly copies entire chunks of other people's work and claims them as his own. DeltaStarSenior SysopSpeciationspeed! 16:30, 9 November 2010 (UTC)
- Which reminds me. User188 once told me of the java app he'd written on WP to translate Japanese kana into Roman letters. Anybody know if such a beast exists? I would have thought Java was beyond Ed's capabilities. --Ψ GremlinSprich! 16:35, 9 November 2010 (UTC)
- The man can't even do wiki markup. The only Java Ed's dealt with is probably in a coffee cup. Lily Inspirate me. 18:59, 9 November 2010 (UTC)
- Surely Ed drinks instant? I can't imagine him dealing with the complex process of brewing it himself. Hmm, maybe that's why he got married. --Kels (talk) 21:33, 9 November 2010 (UTC)
- This thread is full of
starswin! ħuman
05:11, 10 November 2010 (UTC)
- I wouldn't put it past Ed to visit Starbucks for the free WiFi. Lily Inspirate me. 11:09, 10 November 2010 (UTC)
Irony[edit]
I have to love the strange grouping of headlines on CP borked news:
- "World thinks we are idiots", followed by
- "Tea Party deserves House GOP leadership slot."
And you wonder why the world thinks you're idiots. --Ψ Gremlin話しなさい 15:04, 9 November 2010 (UTC)
- They dont care what the world thinks, because the world is full of commie libs, like Europe.--Thunderstruck (talk) 15:52, 9 November 2010 (UTC)
- I love how CP slowly but surely gathers a higher and higher proportion of the world's population in the "liberal" camp. It's a wonder there's any true conservatives left at all. Someone ought to convince Andy to do a list of all currently serving senators/congressmen, and give each one a "conservativity" rating, ranging from liberals through RINOs to actual conservatives. Would any of them score a 10? ONE / TALK 16:12, 9 November 2010 (UTC)
- And then get him to revisit the list a month later & find how many have become RINOs in the meantime. 16:16, 9 November 2010 (UTC)
- ooh! I can see it now - cp:Quantifying conservativity. Sadly, only St Ronnie, Mama S and Funbags Palin will score full points. --Ψ GremlinПоговорите! 16:18, 9 November 2010 (UTC)
- Bachman? Rand P? 16:22, 9 November 2010 (UTC)
- Maybe Bachman, but not Rand Paul. Andy is not enamored with the Libertarians. DickTurpis (talk) 17:38, 9 November 2010 (UTC)
- Wow.... Just did a quick spot check of their main page, and the words "liberal or liberals" appears over 150 times. Maybe CP needs a new word... How about "Manticores." you know, Manticore madness: Manticores in Congress demand equal rights. Hey, It might catch on. SirChuckBA product of Affirmative Action 21:28, 9 November 2010 (UTC)
- Speaking of quantifying, since open mindedness, vulnerability to Atheism, mental strength, faith, liberal style, idolatry and order have already been quantified, should we have an article on Conservapedia trying to quantify mostly everything? K61824TK = Terry Koeckritz 06:12, 10 November 2010 (UTC)
- It should be called "Conservapedia:Quantifying Andrew Schlafly's obsession with quantification". I might just make it... ONE / TALK 10:55, 10 November 2010 (UTC)
So many favourable comments![edit]
"Joaquin, we get so many favorable comments!img Hmmmmmm, you know, I have yet to see one...Aceword up 22:09, 9 November 2010 (UTC)
- The lurkers support him in p-mail. Tmtoulouse (talk) 22:12, 9 November 2010 (UTC)
- Oh, they're occasionally on the Main Page Talk, but usually they smell a lot like attempts to curry favor by nascent socks. 173.10.105.29 (talk) 22:19, 9 November 2010 (UTC) PS No need to welcome me, I'm not new, just can't be bothered to log in.
- STFU noob. Welcome to Rational Wiki!!! Occasionaluse (talk) 22:27, 9 November 2010 (UTC)
- I'm Aziraphale, not noob, just not very talkative. Thanks, though. :) 173.10.105.29 (talk) 23:12, 9 November 2010 (UTC)
- Oh look, a "We should discuss this here with the input of the editors" issue has already become a "I will discuss this with Andy. In private. And then I will tell you what Andy's will is."img TKification. --Sid (talk) 00:07, 10 November 2010 (UTC)
- Is it even distinguishable from just TK pulls idea(s) out of his ass and pretends that the idea(s) has been discussed with Andy? Thieh"6+18=24" 01:57, 10 November 2010 (UTC)
- Based on the snippets and history I've seen, I find it likely that said discussions go more along these lines: "Hey Andy, I just had this great idea that doesn't require any work or sacrifice from your side and that would make your glorious project 500 times better and more secure! Should I, your loyal follower, sacrifice myself to work on it?" - "Uh, sure, sure, that sounds awesome. Thanks for all your hard work, TK!", which is basically the same as "TK came up with it and there was no discussion", but he still technically got a green light, which he will use to slap others around with it. --Sid (talk) 07:47, 10 November 2010 (UTC)
- I'm sure if you trawl through TZB, there'll be examples of just that. The categorisation project comes to mind. Of course, anything that involves Andy having to do some work - such as installing flagged revisions - dies a quick death. --Ψ GremlinПоговорите! 11:27, 10 November 2010 (UTC)
- It's always been a case of the lunatics running the asylum. Anyone who showed any wiki-fu has been barred from the club, maybe Terry Chuckarse knows a bit but he's only interested in his own stuff rather than CP as a whole. I would guess than even CPWebmaster is not around for Andy to call on any more. Lily Inspirate me. 11:42, 10 November 2010 (UTC)
- With this "I will discuss it with Andy" stuff, I'm kind of seeing parallels with Jacob from Lost.
sshole 14:16, 10 November 2010 (UTC)
- CPWebmaster hasn't edited since a few edits in March, and those were his first since July 2009. With Iduan also gone (blocked?) it's safe to say there is nobody left with anything but the most basic wiki-fu. God forbid they should have another week that wasn't, or Andy tries to load a software upgrade... --Ψ GremlinTala! 14:45, 10 November 2010 (UTC)
- On the subject of TWTW, I remember (again from TZB) them throwing a frothy because our TomTomTooLoose offered some suggestions on how to fix the broken wiki. Needless to say, paranoia won over reason. --Ψ GremlinZungumza! 14:47, 10 November 2010 (UTC)
- They seriously think that every single action taken by us is part of an agenda to destroy them. It's pure Reductio ad Hitlerum: "If RW wants X, then X is bad and we should never do it!" I remember (TZB: "530/aba418...") that during the brief episode when their server was hacked to rewrite certain URLs, DeanS noticed my quick and dirty Javascript (Greasemonkey) patch to allow people here to browse CP without triggering the hacked links. Just a short and simple Javascript thingy, but he didn't trust it because the function was called "rw" (as in ReWrite) and because the Greasemonkey namespace was RW's URL. --Sid (talk) 19:05, 10 November 2010 (UTC)
- Andy is not only wiki-illiterate he is completely stupid. He had a hard-on against templates, hierarchical categorisation and sentence case title names. TK just sucked up to him so that the whole site got constipated. PJR and a handful of wiki-literate peons attempted to rectify the situation but they all got forced out or ban-hammered. There was a lot of work to actually tidy up CP but of course this housekeeping was disregarded as menial work so it didn't count for meritocratic promotion. Conservative "insights", no matter how obscure or hidden amongst the scatological wallpaper, are what really matter. I think that is why the site is no more than a political blog rather than an alternative to Wikipedia.
ГенгисOur ignorance is God; what we know is science. 21:22, 10 November 2010 (UTC)
I am amazed at how little Andy has learned about the MW environment in four years of owning a wiki. Hell, within two months of being there I was struggling to learn simple LaTeX. I doubt Andy can even write a table, in html or MW markup. All he has mastered is putting brackets around every instance of "liberal". ħuman
15:05, 10 November 2010 (UTC)
Quantum tunneling WIGO[edit]
The idiot's defeating his "faith" thing in his enthusiasm to show biblical foreknowledge. Where's the "miracle" if it's all scientifically explainable (which is of course crap)? He's turning his god into a time travelling alien. 02:56, 10 November 2010 (UTC)
- I fail to see the "Scientific foreknowledge". Perhaps he climbed through a window? Aceword up 02:59, 10 November 2010 (UTC)
- Room has no windows and the door is locked from inside -- a typical locked room mystery. Therefore if Jesus manages to sneak in, it has to be some form of teleportation or quantum tunneling, or whatever kind of BS that can be made up. Thieh"6+18=24" 05:56, 10 November 2010 (UTC)
- Damn ye to heck for getting me to click on tvtropes...there goes the weekend! C®ackeЯ
- "He's turning his god into a time travelling alien"
- If he's gonna worship a time travelling alien he might as well make it Doctor Who. --Night Jaguar (talk) 12:34, 10 November 2010 (UTC)
- If that counts as cientific foreknowledge of quantum tunneling, thenI too was gifted with it at the age of four when I used to imagine a television crew spontaneously appearing in my bedroom to film a magical midnight documentary about my toy cupboard. 212.219.200.254 (talk) 13:43, 10 November 2010 (UTC)
-
- Perhaps Andy is secretly atheist since he is attempting to find naturalistic reasons for all the supernatural miracles of the Bible.--BMcP - Just an astronomy guy 18:36, 10 November 2010 (UTC)
Forbidden[edit]
Wow, I was just thinking the other day that Hurlbut had been quiet. Clearly he was devoting his time to his cluster fuck (and earning money through link-spamming his blog). However, I do love the unintentional funny Terry manages to slip in.
Morbius also provides a prize example of the arrogant scientist, complete with his own set of professor values: an attitude that he is above human law and permitted to write his own law. Perhaps I do not prefer to be dictated to on my own world.
Yes, Shakespeare was all about professor values and evolution. By the way Hurlbut - if it wasn't for professors, you would never have qualified as a doctor.
Now, I wonder who else has his own little world, where he doesn't like to be dictated to? On a more serious note, given that everywhere and everything is a vast liberal plot, designed to turn them all into raving homosexuals, what do these people do for fun? --Ψ GremlinFale! 13:26, 10 November 2010 (UTC)
- It's very rare that you get a whole 20,000 byte article complete with infoboxes posted in one go. I'm not saying it was plagiarised but it seems strange that Terry Chuckarse will make use of it only on CP. I am also intrigued by the red links in the cast list, can we expect articles on those people soon? Lily Inspirate me. 14:29, 10 November 2010 (UTC)
- "you would never have qualified as a doctor." TerryH is a doctor? Of what? 68.40.166.215 (talk) 14:44, 10 November 2010 (UTC)
LOL! When they are burying the bodies of their fellow crewman destroyed by the id monster, the captain is reading "ashes to ashes, dust to dust" etc. All I can think of when I see that scene is how weird it is that atheists would use Genesis 3:19 (it's paraphrased from there I think) in that way. Boy, them atheists sure are tricksters. Please VIEW movies before you write about them CP clowns! LOL! Jimaginator (talk) 21:53, 10 November 2010 (UTC)
Cambrian Explosion Being Rewritten[edit]
I wonder how CP will handle this. WIGO in the future, or ignore it completely. It is typical for creationists to say that the Cambrian Explosion cannot be explained, etc.
[8] Jimaginator (talk) 21:58, 10 November 2010 (UTC)
- TerryH and the others will pray that AiG/CMI publishes a "This doesn't mean anything!" piece they can plaster on CP before Andy comes up with his own insight as he did with the Lenski thing (the seed of insight had been planted, like, MINUTES before the plastering there, I think, and look how that ended). --Sid (talk) 22:30, 10 November 2010 (UTC)
Jetstream[edit]
What's weirder, the triple bolding or the ominous link to Biblical Scientific Foreknowledge?img --Sid (talk) 22:43, 10 November 2010 (UTC)
- Nevermind the "ominous", I just realized that it's already there. --Sid (talk) 22:44, 10 November 2010 (UTC)
- Looks like a nice little parodist is still reading us closely and fixed itimg ghazi alizm, comments? 01:25, 11 November 2010 (UTC)
facepalm.jpg[edit]
I know it's the same rhetoric, but how he fails to see who the big spenders are in history is beyond me (ref). If you read Conservapedia, you'd think Reagan never had a budget with a deficit. – Nick Heer 00:24, 6 November 2010 (UTC)
- Pure commie agitprop crap. From whitehouse.gov, Column H, Deficit as a Percentage of GDP: [9]
- Highest deficit by Reagan is 6.0% of GDP in 1983;
- Obama 2009 in 10.9%; 2010 (projected) 11.2%; 2011 (projected) 8.9% of GDP.
- Why don't you get a life or get real before you start spreading your hate and fear. Try dealing with facts, sir. nobsdon't bother me 18:54, 6 November 2010 (UTC)
- Rob, go fuck yourself. DickTurpis (talk) 19:58, 6 November 2010 (UTC)
- Once again CP's Counter-Intelligence fulfills his role by talking Counter to Intelligence. Well done Nobrot, at this rate nobody's going to believe you when you say that the Sun rises in the East. Of course, in your twisted fairytale world you probably think of the Sun as being a Communist sympathizer as well, the way it always sets in the West and all.--
Spirit of the Cherry Blossom 20:02, 6 November 2010 (UTC)
- Oh, did we forget to mention in the fourth year of Obama's budget, the deficit get's down to 5.9%, finally 0.1 less than Reagan's worst deficit. Only question is, how many more jobs will be destroyed from the 7.6% Unemployment rate he inherited from GWB. nobsdon't bother me 20:18, 6 November 2010 (UTC)
- Lol, Rob, you are always amusing. How about the completely destroyed and imploding financial sector and economy in general he inherited? ħuman
01:47, 7 November 2010 (UTC)
- The Reagan recovery lasted 28 years, sustained growth until the crash of 2008 and 22 million jobs were created. nobsdon't bother me 21:13, 8 November 2010 (UTC)
- Rob, two things: 1) you should probably stop posting here or you might have to ban yourself. 2) I don't know if anyone has told you, but there were other presidents after Reagan. Clinton might have contributed a tad to the economy too. – Nick Heer 19:09, 9 November 2010 (UTC)
- This is not a partisan argument; from 1979 til 2003 (24 years) there we only two Federal Reserve Board chairman, Volcker & Greenspan, spanning five U.S. Presidents of both parties, Carter, Reagan, GHW Bush, Clinton, & GW Bush. Approximately March of 2008 (at the time of the Lehman & Bear Stearns crisis) the Fed underwent a major once in a generation policy shift. Critics warned of the Fed losing its independence. Much has been written on this, but I'm gonna quote wp:Henry Kaufman, from Nov. 2009,
- All of this would narrow the gap between the Federal Reserve and the political arena. Taken to its logical conclusion, our market-based system of credit allocation would be replaced by a socialized financial system, and the Federal Reserve would become part of it....Our financial system is at a crossroads... [10]
- So these partisan discusssions, blaming GW Bush & Reagan for AIDS & hurricanes while hailing Clinton & Obama for hope & salvation are beyond pointless. If any reader here has any insight at all, time to get focused on the planets problems cut the meaningless, ideological drivel. nobsdon't bother me 20:37, 9 November 2010 (UTC)
- Rob, your technique of introducing random bullshit into arguments isn't going to get you anywhere. The fact is that under Reagan and the Bushes, the deficit increased. Under Clinton, there was a surplus entirely of the Democrats' making. Under Obama, despite having to pick up the mess Dubya left, he has already made progress towards bringing America back to a sensible budget. Republicans increase the deficit, Democrats cut it. Fact. Now fuck off. –SuspectedReplicant retire me 21:38, 9 November 2010 (UTC)
- Bullshit. As the Ginghich Congress was sworn in, William Jefferson Clinton responded to Republican proposals.
- Finally, balance the budget in 10 years. It took decades to run up this deficit; it's going to take a decade to wipe it out. Now mind you, we could do it in 7 years, as [GOP] congressional leaders propose. But the pain we'd inflict on our elderly, our students, and our economy just isn't worth it.[1]
- The cp:Contract With America balanced the budget in less time, despite Clinton's publicly stated opposition to it.
- ↑ William J. Clinton,[ Address to the Nation on the Plan To Balance the Budget,] June 13, 1995.
[11]— Unsigned, by: RobSmith / talk / contribs 20:43, 10 November 2010 (UTC)
- More RobS bullshit. Republicans only ever want to cut deficits when Democrats are in power. Clinton, despite initial misgivings, managed to create a surplus despite Republicans, not because of them. Republicans cut taxes then never, ever get around to cutting spending. It's always left to Democrats to clear up the mess the GOP leave behind. TerrenceKoeckring (talk) 21:10, 10 November 2010 (UTC)
- Pure B.S.; you need to come armed with some facts in the coming debates. I don't beleive in shooting an unarmed man. Arm yourself with some brains, too. nobsdon't bother me 21:14, 10 November 2010 (UTC)
- Coming from you, that's a compliment. You're an ignorant piece of shit who can barely string two words together, let alone a coherent argument, as already documented here. Your continual attempts to flood a debate with bullshit don't work here so give up and crawl back into the cesspit of CP. TerrenceKoeckring (talk) 21:57, 10 November 2010 (UTC)
- Wow. You sound like you're applying for a job above your paygrade. [12] nobsdon't bother me 21:39, 11 November 2010 (UTC)
- Yup, there he goes again. Totally random response because he's incapable of rational thought. Goodbye Rob. You know, I was egging Terry Koeckritz on when he was trying to frame you for stuff. I mean, he's a total asshole, but you're just an idiot. Watching him fuck CP right up the ass is fun but even reading your stuff gives intelligent users a headache so it would have been good if you had been blocked so you couldn't inflict pain on us all. Gods peed, Rob, Gods peed. TerrenceKoeckring (talk) 23:52, 11 November 2010 (UTC)
Rob, while I applaud you for removing your head from Andy's asshole (more so then his other minions), I got to ask, why are you here? Dont you have some gays to bash, or a bible to thump?--Thunderstruck (talk) 03:59, 10 November 2010 (UTC)
Oct 2010: articles and namespaces at Conservapedia and RationalWiki (and aSK)[edit]
- 106429: cp:Essay: Attention atheists: Please get a life!
- 106447: cp:Essay: 10 telltale signs you are on your way to becoming an atheist nerd
Conservapedia shows a proclivity for blogging pseudo-news (as even Joaquín found out). I updated the pic I made earlier, and added a pic for RW just for comparison: though we are not an encyclopaedia as others claim to be, we had twice at many edits in "main" as Conservapedia: 4404 to 2218.
larronsicut fur in nocte 17:40, 9 November 2010 (UTC)
- That's bad when ♥ K e n D o l l ' s ♥ pseudo-essays come in 3rd and 7th respectively in pages edited for the month. --BMcP - Just an astronomy guy 17:53, 9 November 2010 (UTC)
- I wonder what the (rest of the) CP namespace will become if we have all the WIGO's on a separate namespace. ThiehTK = Terry Koeckritz 19:31, 9 November 2010 (UTC)
- 2.5% of all edits were made on pages in conservapedia-namespace other than Conservapedia:What is going on at CP? and Conservapedia talk:What is going on at CP? larronsicut fur in nocte 09:22, 11 November 2010 (UTC)
wikipedia[edit]
- In Sep 2009, there were over four times as many edits at WikiPedia than Conservapedia had since 2007!
- WikiPedia isn't as chatty as Conservapedia: 2/3 of the entries are in namespace main
larronsicut fur in nocte 09:59, 10 November 2010 (UTC)
Who's left at CP?[edit]
In reading the dialogue above about the "discussion" on CP about the Bias in Wikipedia page, with it culminating in the blocking of Ctown200, I'm wondering who exactly is left? Is it just the sysops? Looking at the logs for Ctown200, it seems like he/she was there for a while. Was that pretty much the last productive user? Apart from the sysops and their blogging on the main page? ghazi alizm, comments? 20:44, 9 November 2010 (UTC)
- I think there are a few "normal people" (people who are not sysops and aren't openly emulating them) left. But they tend to stay out of the way of any sysop pet projects and don't edit as often as Andy or Ken, so they're effectively flying under everybody's radar. Plus of course the usual bunch of people who register, make one or two edits and then are either hammered randomly or decide never to return on their own. --Sid (talk) 20:49, 9 November 2010 (UTC)
- (EC) According to CP's stats, there are 50 users who've edited in the past 7 days. LArron has the real info, but I'd say 20-30 of those are already banned. There's still a lot of small time parodists still around, a few red names that will be short lived, and the cabal. That's it. It would be fun to adapt Sid's recent changes Kenfilter to be a general sysopfilter. Occasionaluse (talk) 20:52, 9 November 2010 (UTC)
- As far as good faith editors go, I think they're down to FOIA and JakeRMurrin (as indicated by LArron's page edit stats). Apart from them, we've got LanceS continuing to shock me by avoiding the banhammer, and a few other people who are either extremely dumb good faith editors or crappy parodists - it's so hard to tell these days. Colonel of Squirrels医药是医药,和那个不是医药。 23:49, 9 November 2010 (UTC)
Other editors are doing a lot of edits - but they are obsessed with only a few single items: not only BertSchlossberg and FOIA, but also cperlobo, Daniel1212... Meanwhile, quality control is non-existent: the regulars have neither the qualification nor enthusiasm enough to re-read old material, so that errors have to be pointed out by third parties. (An exception to this rule is cp:Center which was laughed at for many times, but still states: The center of a geometric shape is a point that, on average, the points of the shape are equidistant from. Ed Poor just fails to see what is wrong with it...) Heck, two years ago I pointed out some glaring atavisms on the talk page of an article about a major historical figure - nothing happened. All the nonsense, still there - and linking from here once would get it fixed. Go figure.
larronsicut fur in nocte 11:15, 10 November 2010 (UTC)
- The great paradox of isolating CP from vandals is that they also isolate themselves from constructive help. There is so much misinformation and disinformation that the casual visitor will very quickly assume that it is some sort of huge joke and would be deterred from pointing out anything that is obviously wrong. In the general knowledge department they have not had anyone as good as Fox for clearing up parody, but then he was despatched by TK dribbling poison into Andy's ear. The problem is that people who care about correcting parody also tends to care about correcting the lies and when integrity meets ideology it's usually the ideologues who come out on top. Lily Inspirate me. 14:42, 10 November 2010 (UTC)
- I emailed Tzoran a few weeks ago and had a bit of an exchange (friendly, but not too informative) but he/she hasn't responded to my most recent emails. If someone's too busy to edit CP they MUST be too busy to read emails, right? ghazi alizm, comments? 14:35, 10 November 2010 (UTC)
- At least I'm still there. In more than one incarnation. Making TK dance. DogPMarmite Patrol 17:43, 10 November 2010 (UTC)
I don't think anyone's left at CP, I think everyone over there is rig-pfffffffft I'm sorry I can't even finish writing that sentence. X Stickman (talk) 13:03, 11 November 2010 (UTC)
It's just a jump to the right...[edit]
How long before the entire GOP become RINOs?img --Ψ Gremlin말하십시오 11:21, 10 November 2010 (UTC)
- He's quoting from a Rasmussen poll: the most biased and least accurate pollster". –SuspectedReplicant retire me 12:05, 10 November 2010 (UTC)
- Given that in the UK so many on the left criticised New Labour for moving to the right it's a wonder that we didn't have LINOs. Lily Inspirate me. 15:15, 10 November 2010 (UTC)
- To be fair, New labour are LINOs. There is currently no mainstream that represents in Labour movement in the UK and hasn't been for years.--AMassiveGay (talk) 17:23, 10 November 2010 (UTC)
- I agree, but nobody has ever called them LINOs. Lily Inspirate me. 17:47, 10 November 2010 (UTC)
- If they were LINOs then people would walk all over them (sorry). Jack Hughes (talk) 13:49, 11 November 2010 (UTC)
Wiki-guru User188 - please may I touch you, the goodness might rub off on me[edit]
So Bad Touch has taken to posting his inane stubs as templates now.img Can't wait to see where these get used. Not to mention the random red-links here. Seriously, how desperate were WP in the olden days that he rose above the post of assistant tea strainer? --Ψ GremlinSprich! 14:55, 10 November 2010 (UTC)
-
- I'm really enjoying the work he's putting into CP:Shirley Sherrod. Somehow it was all a liberal smear campaign which Drudge and Breitbart became the victims of. Reminds me of the time Ed thought we should say Palin quit her job as governor to run for vice president...only a few months after Obama had been in office. Occasionaluse (talk) 15:06, 10 November 2010 (UTC)
- He was doing this last week on WP. It got the response it required: SuperHamster: "this is rather useless and unnecessary, and serves as more of a hindrance than a helpful tool." SmegEd: "Okay to delete, Thanks, Ham."
15:23, 10 November 2010 (UTC)
- A tale of 2 wikis: Sane wiki - Ed, your stuff is crap and we're getting rid of it. Insane wiki: Ah, another valuable contribution by a long-standing sysop. --Ψ GremlinParla! 15:32, 10 November 2010 (UTC)
- I just view him as a sort of dopey old guy who just figured out transclusion, thinks he's a lot smarter and more creative than he is, and doesn't really know what to do with himself.
15:43, 10 November 2010 (UTC)
- It definitely says a lot about his ability to learn new things and understand complex concepts. Occasionaluse (talk) 15:48, 10 November 2010 (UTC)
- What on earth is he doing? Aside from the pathetic deceit in his quote (There are literally hundreds of movies where the yanks are heroes, whether it's historically accurate or not), but when would such a 'template' ever be used? Or is he planning to add this drivel to every movie article? At least that would increase the length of most of his articles by 4-5 times. DeltaStarSenior SysopSpeciationspeed! 15:52, 10 November 2010 (UTC)
- My head is reeling. Ed, stop now before you make an even bigger idiot of yourself. Whoops, too late. He has redirected an article of the same name to the template. Lily Inspirate me. 17:20, 10 November 2010 (UTC)
- His hard-on for this Andrew Klavan guy goes on: Check out CP's entire article on Toy Story 3img --Sid (talk) 19:12, 10 November 2010 (UTC)
- I followed the link, and verily did I facepalm mightily. "Dude," muttered I to myself – well knowing, to my dismay, mr. Poor wouldn't hear it – "putting quotes in templates is a fairly silly practice, and only creates a maintenance nightmare. Ever heard of bifurcated histories, mr. 188th?", referring to the widely-known limitation of MediaWiki that states that it is currently impossible to get exact snapshot of a page exactly as it looked at a given point of time, because templates can only be referenced in their current state. But more confusion awaited me as I clicked "What Links Here". Staring back at me from the distant website were the words "Americans as the good guys (redirect page)", the sole line, a technological enigma antithetical to my personal quest for functional computer systems, a crystalline mystery in such a grandiose scale that my brains couldn't comprehend it. What kind of a mind could produce such troublesome statements? --a random guy on a gigantic and harrowing nanowrimo streak (pardon the awful prose) wwwwolf (barks/growls) 22:21, 10 November 2010 (UTC)
- Every post on this page should be like this! ONE / TALK 10:19, 11 November 2010 (UTC)
- I love Ed's in-depth article on JFK Jrimg. --Night Jaguar (talk) 19:38, 11 November 2010 (UTC)
Conservapedian Science got boring.[edit]
I guess I still enjoy some of the stuff that comes out of Conservapedia, but the science stuff has got boring after Andy's recent Bible science crap of late. He could come out, in all sincerity and claim that polio is a liberal conspiracy to intrude into citizens' lifes; that a passage of one of the gospels was mistranslated and actually means that the internet would one day be developed to deliver conservative insights and that Jewish people made up non-Newtonian fluids to discredit Newton's Christian-inspired works... it's meaningless to me now, he's totally worn out the, "As if somebody could believe that..." part of my brain.
EXTERMINATE 02:08, 11 November 2010 (UTC)
- o_0 I missed those three. Links/captures? - David Gerard (talk) 20:04, 11 November 2010 (UTC)
So does Andy not care about Joe Miller?[edit]
I haven't seen anything on CP about the Alaska tea bag v. RINO race in the last few weeks. --Opcn (talk) 05:54, 11 November 2010 (UTC)
- I would speculate that before the election he did not even think that Murkowski was any sort of factor, and afterward he did not want to admit the possibility that a RINO running a write-in campaign could win an election contest against a Tea Party man with official backing.
ListenerXTalkerX 06:11, 11 November 2010 (UTC)
- I think I may have just figured it out. If Joe Miller gets in there will instantly be an uproar over it and a recall effort, the guy has a 36% approval rating (72% disapproval) and he hasn't even gotten in (probably lower with how much of a stickler he has become for the rules that don't exist but benefit him), Menendez has something like a 38-42 split. --Opcn (talk) 20:55, 11 November 2010 (UTC)
Could have been Andy[edit]
...why I became a lawyer, and not a doctor, or an engineer, or a scientist, because I can't figure this stuff out. Say no more! 10:40, 11 November 2010 (UTC)
- It's an interesting point that he appears to want to make a judgement despite admitting he can't figure it out - although that may be his inner politician trying to be judgemental (as they often are). But he's approaching the problem very much like a lawyer, which may be the root of the wider denialism problem, when he talks about "both sides". That's fine for law, and in theory it should work like science; you hear both sides and the case should be "most convincing" equals "the right one". But in practice it's more complex because science rarely, if ever, poses simple dichotomies that can be solved like a legal case - in short, there aren't really any "sides" to hear. You have just one side; that's science. And you have just one one witness, that's empirical reality.
sshole 15:40, 11 November 2010 (UTC)
- It certainly reads like positioning himself to appeal to the right-wing and moderate Republicans, "I don't think Climate Change is happening, but we should still consider it and keep assessing it." = "I'd like to be President."
EXTERMINATE 18:35, 11 November 2010 (UTC)
So much for added protection and vetting[edit]
StephenKP barely lasted longer than a week despite having requested an account through Andy himself. (And yes, it's connected to the Leeds WIGO) --Sid (talk) 07:53, 10 November 2010 (UTC)
- I think it's because of thisimg exchange. It's impossible to tell whether Stephen was a sincere editor, but choosing one of the most obvious parodists in recent history over him...it's like they're wrecking their own blog on purpose. Röstigraben (talk) 08:26, 10 November 2010 (UTC)
- So much for my theory that these are people Andy met in real life... unless Andy repairs the damage ASAP. ħuman
15:00, 10 November 2010 (UTC)
- Actually I think StephenKP got booted for this.--
Spirit of the Cherry Blossom 16:35, 10 November 2010 (UTC)
- Ouch! Laughed at the "communication problem" jab. How long before this method proves unsuitable for new accounts? Btw, has anybody tried their sign up? Do they ask for any personal info? --Ψ GremlinTal! 16:49, 10 November 2010 (UTC)
- The Leeds article is the funniest thing I have read on that site in a good long while; can we be any more narcissistic with our persecution complex? --BMcP - Just an astronomy guy 18:17, 10 November 2010 (UTC)
- Wow, Leeds looks alot like Plymouth Ma.--Thunderstruck (talk) 18:30, 10 November 2010 (UTC)
- Over 500 vandalism attempts from Leeds? Is that the edit count of blocked users from Leeds, or separate users, or just a wholly made up figure?
EXTERMINATE 18:59, 10 November 2010 (UTC)
- Well, my IP shows me as being in Sheffield although I'm about 15 - 20 miles away (not far by US standards but leagues for UKites) 19:04, 10 November 2010 (UTC)
- Both my house and my parents' house show as Leeds, so I've probably contributed a fair bit of that vandalism over the years. But I'm very much blocked at both now.
EXTERMINATE 19:29, 10 November 2010 (UTC)
- P.S. We need a Yorkshire userbox.... :P
EXTERMINATE 19:31, 10 November 2010 (UTC)
- Template:User Yorkshire
- My humble effort, Sire. --Ψ GremlinRunāt! 13:54, 12 November 2010 (UTC)
Imma call bullshit on the 500 vandalism edits number bc (a) I don't believe they have any mechanism for even knowing and (b) Patti can't count that high.
19:46, 10 November 2010 (UTC)
Ouch! I've just realised how much info I've given out about my browsing habits with that screenshot. Well done me. Still, shows I've got good taste, going my the Bookmarks toolbar…--
Spirit of the Cherry Blossom 20:00, 10 November 2010 (UTC)
- Hee! I always use: "select area to grab" 20:04, 10 November 2010 (UTC)
- Excellent advice Susan. I read in today's Independent about someone who posted a picture of their computer on Twitter. Unfortunately the monitor was adorned with a Post-It note that contained their credit card number, expiry date and security code. Oops!
ГенгисOur ignorance is God; what we know is science. 21:00, 10 November 2010 (UTC)
- P.S. @SD At least you didn't have your IP address displayed. I have made screencaps before which exposed my ID. Fortunately the twits at CP thought that my sock was being framed and I got away with it. It doesn't matter now, as I have put that one to bed.
ГенгисOur ignorance is God; what we know is science.21:05, 10 November 2010 (UTC)
- Just for curiosity, I just screengrabbed "the whole desktop": I have 2 screens (lappy & extra monitor on which my magnum opus is permanently resident) : It grabbed both of them to my surprise. 21:11, 10 November 2010 (UTC)
- I didn't realise you were so well endowed Sue. The Firefox screencap add-ons are quite powerful, especially for grabbing the entire page.
ГенгисOur ignorance is God; what we know is science. 21:31, 10 November 2010 (UTC)
DanielPulido goes down![edit]
Andy strips Danny boy of his rights! LOL! Occasionaluse (talk) 14:58, 11 November 2010 (UTC)
- It was probably those Teabagging edits.
ГенгисOur ignorance is God; what we know is science. 15:03, 11 November 2010 (UTC)
- (EC)Would the puppeteer please stand up and explain? EddyP (talk) 15:03, 11 November 2010 (UTC)
- Wonder if it has anything to do with this wonderful TK message. The Goonie Punk Can't sleep, clowns will eat me! 15:08, 11 November 2010 (UTC)
- I'll bet dollars to donuts that Daniel gets some rights back. Occasionaluse (talk) 15:20, 11 November 2010 (UTC)
- Just how in the world is Danielle Pudenda calling the "Tea Bag Movement" "Teabagging" the Creation of Troublemaker/Troll/Liar? Terry is one vicious bully.
15:30, 11 November 2010 (UTC)
- This may be a stupid question but you do know what teabagging is?
ГенгисOur ignorance is God; what we know is science. 15:37, 11 November 2010 (UTC)
- I am excitedly waiting for my missus to get home from work! DeltaStarSenior SysopSpeciationspeed! 16:27, 11 November 2010 (UTC)
- Do it with someone you luv! --BMcP - Just an astronomy guy 17:37, 11 November 2010 (UTC)
- No, what's teabagging? If I said a nickname name of the Teabag Movement was "teabagging" would you call me a troll, liar, or troublemaker?
17:51, 11 November 2010 (UTC)
- I think there were a few old/naive tea party supporters who might have used the term in earnest, but I think the media has done a good enough job making its common meaning known. Most likely, anyone, especially a hep cat like Nutty, would be trying to make trouble (as far as CP is concerned) by using it. Occasionaluse (talk) 17:55, 11 November 2010 (UTC)
Cp dead yet?[edit]
It's been over a week since you last declared conservapulido dead. The last pangs of death or just one more week left?--193.200.150.125 (talk) 17:03, 11 November 2010 (UTC)
- At least once every two weeks someone posts suggesting the impending death of CP, and suggests that we cut it off, like a diseased hand. But, like any diseased hand, it comes flopping back. SJ Debaser 17:22, 11 November 2010 (UTC)
- BON is on to something. We should make a (sticky) thread about whether or not CP is dead. Occasionaluse (talk) 17:29, 11 November 2010 (UTC)
- Or have a CP energy bar like the Obamageddon thing. Totnesmartin (talk) 17:38, 11 November 2010 (UTC)
- Good idea! Let's pretend to brainstorm on metrics until LArron notices. Occasionaluse (talk) 17:40, 11 November 2010 (UTC)
It isn't dead - it is nearing perfection: 71 % of the articles in namespace main weren't touched for over one year, while the inferior articles in namespace main here at RationalWiki need constant tinkering: only 28% were mature enough not to be altered... (I assume that this is at least the view of 30,000-articles-are-enough Andrew Schlafly.
larronsicut fur in nocte 20:37, 11 November 2010 (UTC)
- Come on now, BoN. If you're going to rip off my little gimmick, at least have it measure something other than Obamageddon. --JeevesMkII The gentleman's gentleman at the other site 21:57, 11 November 2010 (UTC)
- Martin made the template, not BoN. Just sayin' Occasionaluse (talk) 21:58, 11 November 2010 (UTC)
- "But, like any diseased hand, it comes flopping back." That's the funniest thing I've read all day. Thanks for that. Corry (talk) 02:49, 12 November 2010 (UTC)
- What a wonderful example of ignorant stupidity. Danny'sPudenda has obviously heard us using the term 'teabaggers' and with no idea about it's actual meaning, tried to be constructive on CP. Needless to say, Wormtongue diddled in Andy's ear and DoublePenetration's done for. Now, will he stay or will he go? --Ψ GremlinSpeak! 09:03, 12 November 2010 (UTC)
- I can't take credit for it, it's from an early episode of American Dad. Good expression though. SJ Debaser 12:04, 12 November 2010 (UTC)
Kinda weird: Why would CP have a link to a page that links to what they would consider porn?[edit]
[13]Jimaginator (talk) 21:23, 11 November 2010 (UTC) Sir Clive's lady et al... — Unsigned, by: Jimaginator / talk / contribs 21:24, 11 November 2010 (UTC)
- Why is CP getting pissy. They got what they wanted, forced prayer, and punishment of those who don't pray.--Thunderstruck (talk) 21:53, 11 November 2010 (UTC)
- Typical fake outrage. OMG, they were told to go through the motions. That's one step from actually believing it!!!! Occasionaluse (talk) 21:57, 11 November 2010 (UTC)
- Ah, but they were forced to pray to that nasty goatherd Allah (I was being ironic, before you declare a fatwa on my ass), and not the one, true, hold baby Jeeves. Of course, Andy would be in favour of beatings (or even waterboarding) for not praying to Baby Jeeves. --Ψ GremlinSiarad! 09:07, 12 November 2010 (UTC)
- The outrage is, as usual, over the top, but I'm gonna have to agree with the general sentiment. The only thing kids should be learning about the religions is the history, the beliefs, and why it's all a pile of complete bunk. Participation in their ridiculous traditions is not necessary. ONE / TALK 10:26, 12 November 2010 (UTC)
Atheist bears invade Mainpage[edit]
The Atheist Bears have landed on Mainpage. I wonder what the American Family Association’s Bryan Fischer would say about that. Christian fundamentalists are such a bizarre breed of human. --Leotardo (talk) 05:35, 11 November 2010 (UTC)
- More interesting, as of this morning, no mention of Veterans Day; I suppose comparing atheists to ursines is more important then remembering American veterans (At least until they read this comment and change the CP mainpage accordingly). --BMcP - Just an astronomy guy 14:05, 11 November 2010 (UTC)
- Well that didn't take longimg --BMcP - Just an astronomy guy 14:50, 11 November 2010 (UTC)
- Hold on, I thought Conservative was going to stop using the Main Page to flog his goofy essays? Ken, you dirty liar. Colonel of Squirrels医药是医药,和那个不是医药。 16:36, 11 November 2010 (UTC)
- One of their sources loops.
According to here Oregon has a higher growth rate than the US average, and North Dakota has a smaller.
Acoording to here Oregon has a higher per capita income.
Acoording to here North Dakota has a higher poverty rate.
Acoording to here North Dakota has more taxes.
Also, Oregon has the The Dandy Warhols,
Bohemian Like You (uncensored) - The Dandy Warhols, and
The Dandy Warhols - We Used To Be Friends
Whereas North Dakota isn't even in the category,
Category:American rock music groups by state
As for dumb atheists, even CP has an article on Stephen Hawking however stubby and redlined is. As for Anglicans, would CP include Rowan Williams, which Christopher Hitchens attacks here (Hitchens lays into Rowan Williams--and Christianity as well)?Civic Cat (talk) 20:47, 12 November 2010 (UTC)
Maintenance[edit]
Above I stated that 71 % of the articles in namespace main weren't touched for over one year at Conservapedia, while the rate for RationalWiki is 28%.
The pics show this excess of aged articles at CP in comparison with RW. And it is not much of a surprise, as a much smaller group of active editors has to take care of ten times the pages.
larronsicut fur in nocte 22:19, 11 November 2010 (UTC)
- Perhaps the untouched articles have simply reached such a high level of informational quality that they don't need any tweaking. Why mess with perfection?--WJThomas (talk) 02:16, 12 November 2010 (UTC)
- They have ten times as many mainspace articles as us? Really? Of course, most of their "debates", "essays", "conundrums", and "masturbations" are in the mainspace due to technical incompetence. ħuman
03:21, 12 November 2010 (UTC)
- Don't forget that all Andy's edumakshunal courses and student homework are also in Mainspace. It can't all be technical incompetence as they managed to create a bunch of other namespaces for the various competitions which still fester in a dusty corner. In this instance I think it is mostly managerial incompetence.
ГенгисOur ignorance is God; what we know is science. 10:52, 12 November 2010 (UTC)
- You can always see this in the "Reverted to last version by _____" after they get hit by a vandal wave against random pages -- it usually turns up some really old-timers who haven't been there in years. --MarkGall (talk) 03:27, 12 November 2010 (UTC)
- Are we asking for them to make a bot to scrub articles or have we excluded bot edits already? K61824What is going on? 03:42, 12 November 2010 (UTC)
- Perhaps the untouched articles..: No doubt, that is Andy's line of reasoning. (For quite a while, Andy's last action of the day was to make a minor improvement at some random article, no doubt using cp:Special:Random. Nowadays his approach to his wiki seems to be inspired by Schrödinger's cat: An article is perfect as long as I don't look at it...).
- They have ten times as..: and even there "debates", "essays", "conundrums", and "masturbations" get stale.
- You can always see: Indeed, it is always nice to see a well-known name again!
- Are we asking for..: I could have excluded bot-edits (and I may do so in the future). But given that their only working bot is EdBot that seemed moot at this point.
larronsicut fur in nocte 07:15, 12 November 2010 (UTC)
Kriss AkabusiAAAWOOOGAAAR!!1 09:18, 12 November 2010 (UTC)
-
- They have an "EdBot"? What does it do, make pointless stubs at a super-human rate? ONE / TALK 10:55, 12 November 2010 (UTC)
- It looks like all EdBot does is assign categories. It also did a mass reversal of edits by HarryY. That said, its edits on 21 Aug were the first since Dec 2008, so clearly user188 doesn't like using it. --Ψ GremlinParlez! 11:26, 12 November 2010 (UTC)
Speaking of The Greatest User WP Ever Had, isn't he cute when he's passive-aggressive? --Kels (talk) 19:33, 12 November 2010 (UTC)
- Yes indeed. What a moron. He could make a user sub page explaining why he can't edit UC talk pages and answer the automated notices with it. Instead of whining randomly. ħuman
02:12, 13 November 2010 (UTC)
Leeds[edit]
Meant to write about this earlier, but forgot. I think that editimg alone is a perfect example of just how CP has given up any pretense at being encyclopaedic and has instead become a self-referential blog. If anybody was actually using CP as a source, the fact that hordes of Leeds residents (at least it wasn't Bradford - that would be a muslin conspiracy) have allegedly "vandalised" CP is of no relevance at all, except for the butthurt morons, lurking within its walls. --Ψ GremlinПоговорите! 09:40, 12 November 2010 (UTC)
- Jpatt was clearly frustrated and decided to vent it, in his typically childish manner, by editing encyclopedic content to adopt his petulant point of view. It happens from time to time on WP, but the difference is that someone at WP will clean it up and the user will regret his lapse in keeping a cool head. Neither of those will happen at CP. And that fact that every other sysop at CP saw the edit, and did nothing about it, is damning evidence that they just don't give a shit. ONE / TALK 10:07, 12 November 2010 (UTC)
- It's somehow comforting when the people you despise come out with such blatant racialist shit that it confirms that you were right all along to despise them. A sort of "Surely they can't be that bad - oh yes they are." Jack Hughes (talk) 11:04, 12 November 2010 (UTC)
- Anyone in the UK who reads it knows it's bollocks anyway - we all know that people from Leeds don't have the internet. SJ Debaser 12:08, 12 November 2010 (UTC)
- Aye th' do, Josh. It's called t'Ceefax. PS. There's nothing 'racist' about Pratty's edit, Jack, it's just stupid. What I do particularly like about stuff like this is that if any new editor had added it, it would have been immediately reverted as parody (or 'vandalism' as they like to call everything now), but when a sysop does it it becomes encyclopaedic. I suppose most of ♥ K e n D o l l ' s ♥ shit falls in to this category... DeltaStarSenior SysopSpeciationspeed! 12:38, 12 November 2010 (UTC)
- To quote - "Despite the influx of Muslim people from all over the UK, Leeds citizens have lost none of their reputation for friendliness and hospitality except if you're Christian." (My emphasis). That's not just stupid, it's racist stupid implying that Muslims are unfriendly. Jack Hughes (talk) 12:48, 12 November 2010 (UTC)
So Leeds is full of people who think CP and what they stand for are a load of garbage? It sounds like a pretty nice place, actually. Corry (talk) 12:51, 12 November 2010 (UTC)
- (ec x 2)Exactly, DS! Ken creates drivel, with the excuse "it attracts web traffic" - fine. Anybody else tries that - blocked for eternity. Same with pop culture - create an anime article - delted/blocked... unless you're Bad Touch Poor, then you can write about "loved starved Japanese schoolgirls" with impunity - as evidenced by Karajou revertingimg thisimg edit. So nice to have a "one rule for us / another rule for everybody else" rule. Oh, wait, there is no "everybody else" left. --Ψ GremlinTala! 12:57, 12 November 2010 (UTC)
- Sigh, "muslim" isn't a race, Jack. Therefore is statement isn't racist. Prattster even said "from all over the UK" (which is bizarre, as I'd imagine that the influx has been predominantly from Pakistan and Bangladesh) so you can't even call it xenophobic. When people (from either side of the political spectrum) scream "RACIST" at anything they don't like, it not only makes them look pathetic, but more importantly it massively degrades the meaning of the term. His edit was religionist, but not racist. And to be honest, I find different religions bickering and having a go at each other quite amusing. DeltaStarSenior SysopSpeciationspeed! 16:04, 12 November 2010 (UTC)
- I think the word people are struggling to find here is bigot.--
Spirit of the Cherry Blossom 16:09, 12 November 2010 (UTC)
Reminds me of a story I heard once about a football game between mp's and journo's from the correct and beautiful side of the penines and mp's from Yorkshire. One player went in rather hard on an oppo player to be met with the words 'hold on, the war of the roses has been over for a long time'. 5 minutes later said person was launched skywards by someone who, as the bloke landed, simply stated 'Not round ere it asnt'. Oldusgitus (talk) 16:35, 12 November 2010 (UTC)
- I just want to know who these other vandals in Leeds are. Anyone else?
EXTERMINATE 16:49, 12 November 2010 (UTC)
The best part for me was that after foaming at the mouth with liberal values, he leaves "Leeds is famous for being Barbara Taylor Bradford's birthplace." tacked on at the end of the paragraph. I didn't know who that is, but according to some POV Wikipedia editor, she is "one of the world's most beloved storytellers." I'm too lazy to look from where Trashbags plagiarized the Leeds articleimg. --Leotardo (talk) 17:11, 12 November 2010 (UTC)
- I don't know if you read that version of the article in full but a notable excisionimg was made about a month later which explains the talk page comment.
ГенгисOur ignorance is God; what we know is science. 17:25, 12 November 2010 (UTC)
- Was it Trashbat who created the famous Hebden Bridge article over there? 17:37, 12 November 2010 (UTC)
- Yes, I presume you remember that because of the dyke reference. Talking of which, there is a longstanding pun on CP about "dykes on bikes" which the sysops have yet to discover.
ГенгисOur ignorance is God; what we know is science. 18:12, 12 November 2010 (UTC)
- Oi! Hebden Bidge was one of mine, in pre-Bugler times, thanks very much (though not the dykes ref. I'm terribly PC). Fretfulporpentine (don't know how to do tildes on a MacBook) 22:01, 12 November 2010 (UTC)
Miracles[edit]
So I see Andy has been called on his writing off miracles as science.img Is it just me, or does his answer actually discount the miracles as being miraculous?
miracles are probably best translated as "signs". They do not conflict with nature, but instead provide a window into its true underlying basis
In other words, Jesus actually used quantum mechanics to turn water into wine, but to the unwashed masses it seemed like a miracle. So, Andy's finally now reached the point where even the basic tenats of Christianity no longer fit his world view. --Ψ GremlinTala! 11:18, 12 November 2010 (UTC)
- There is still some codswallop to call on, though. If that's his explanation, then all supposed 'miracles' in the Bible are 'signs' of the underlying reality. So the fact that Jesus came back from the dead.... is that foreshadowing the eventual scientific discovery of reanimation? Whoever is running that sock needs to squeeze the inevitably hilarious answer out of him. ONE / TALK 11:39, 12 November 2010 (UTC)
- I wonder if Andy would be willing to use "science" to explain away different miracles of saints. -Lardashe
- It's funny how Andy is probably the most prolific heretic I've encountered on the net. I don't think he's ever wasted just one thought about what would happen to him if the world were actually run according to his crazy theocratic notions. Röstigraben (talk) 11:55, 12 November 2010 (UTC)
- I think the whole "coming back from the dead" thing actually came up on the talk page? And I think that yes, Andy went "...why not?" about this not being supernatural. But I'd have to check the archives to verify later - my memory is very fuzzy there, so I may be wrong. --Sid (talk) 18:15, 12 November 2010 (UTC)
- "No physical law, for example, proves that rising from the dead is impossible."img --Sid (talk) 18:25, 12 November 2010 (UTC)
Sad, sad Andru: The sad thing about miracles and Andru is that science (or history or any other field) would be invoked if it confirmed a miracle, but dismissed if it either cannot confirm a miracle or downright deflates one. Either Dawkins or Hitchens pointed out that if science CONFIRMED the power of prayer, it would be trumpeted to high heaven (sic), but since studies so far have shown that prayer power is nil or even negative so far, then the loonies say that science must be wrong. And, of course, science can always be forced to fit anything. Witness quantum tunneling being used by Jesus etc. Jimaginator (talk) 21:36, 12 November 2010 (UTC)
- Andy's well into self-parody terrority hereimg:
- Closemindedness against the Bible has impeded the advancement of science for thousands of years.... Jesus's calming of the storm by observing it is the same effect as the collapse of the quantum mechanical wave function upon observation.
- Somebody else WIGO it cuz I'm really at a lost for words. --Night Jaguar (talk) 00:14, 13 November 2010 (UTC)
Ooh, ooh, I want to help! Can't edit there, here is "close enough" though. "Cursing the fig tree ... I am not aware of any plant pathogens which act this quickly." Yeshua invented glyphosate (RoundUp™)!!! ħuman
02:08, 13 November 2010 (UTC)
- I never knew about this fig tree business before today. That has to be the dumbest miracle I've ever heard of -- Jesus is craving some figs, but they're out of season, so he kills the first fig tree he finds with magic? Of course this still makes more sense than the "discussion" on Talk:Foreknowledge. --MarkGall (talk) 02:15, 13 November 2010 (UTC)
Job queue[edit]
I see the stats page lists "Job queue length - 2." Job queue being "designed to hold many short tasks using batch processing." Any ideas what this could be? --Ψ GremlinParlez! 13:33, 12 November 2010 (UTC)
- Usually the job queue backs up when you edit a high use template. - π 13:40, 12 November 2010 (UTC)
- Ah, as evidenced by Ken's diddling around on MPR. Thx! --Ψ Gremlin말하십시오 13:57, 12 November 2010 (UTC)
- Might be the way keeps reverting himself on one of his essay. - π 14:04, 12 November 2010 (UTC)
- And talking of templates, Johnny X-Ray has put the Conservatism template on the bottom of the main page. Not that anyone will ever find it down there though. He might as well add the Liberal Traits template as well given the number of times LIBERAL is slapped on MPL & MPR.
ГенгисOur ignorance is God; what we know is science.
- P.S. I like how the MainPage has Category:Templates at the bottom. Doh. Somebody's wiki-fu is obviously not up to scratch, eh, TKimg.
ГенгисOur ignorance is God; what we know is science.14:10, 12 November 2010 (UTC)
-
- Wait...the main page has a bottom? Occasionaluse (talk) 14:32, 12 November 2010 (UTC)
–SuspectedReplicant retire me 15:02, 12 November 2010 (UTC)
- Where do you think all the shit comes from? ONE / TALK 15:13, 12 November 2010 (UTC)
- Isn't that obvious if you have to use the word shit? Or is "bottom" referring to some body part I have yet to be aware of? ThiehInsomnia? Masturbate till you pass out 17:44, 12 November 2010 (UTC)
- 'Back bottom' or 'front bottom'?
ГенгисOur ignorance is God; what we know is science. 18:10, 12 November 2010 (UTC)
- Wait, this isn't a discussion of Shakespeare's comedies? --Kels (talk) 17:59, 12 November 2010 (UTC)
Creepy[edit]
Cryptic message - Operation Gatling Gunimg joins Operation Hell-there's-a-whole-bunch-of-us-operations-that-don't-exist-anywhere-outside-Ken's-mind. However, given the - unrelated, surprise, surprise - YouTube clip of Samurai being mowed down and the fact it's directed at "The Person Most Likely To Walk Into A Fastfood Restaurant Carrying A Small Arsenal" and it takes on a creepy symbolism. Has Ken decided to do more than kill atheism on teh innertubes? (and yes, Ken, somebody is giving you some attention again. Bet that makes you warm and tingly between your legs, hey?) --Ψ GremlinTala! 16:49, 12 November 2010 (UTC)
- Has Ken even watched that clip? --
YossarianThe Man from the USSR 04:54, 13 November 2010 (UTC)
ConservaMath Medal[edit]
This isn't really news, but the "ConservaMath Medal" went nowhere. I only point it out because this piece of stupidity generated such idiotic discussions; time wasted that could have been used--yeah, right--building an "encyclopedia". I just wanted to gloat over what failures they are, and how enjoyable are these moribund testimonies to their stupidity. --Leotardo (talk) 17:42, 12 November 2010 (UTC)
- I think they should only give the medal of Geo.plrd designs it. Corry (talk) 18:34, 12 November 2010 (UTC)
Veterans Day[edit]
Is it just me or did CP completely miss veterans day on the MPR (or anywhere else)? I forgot about it too and ended up driving to school, parking in an empty parking lot, walking to my lecture hall and wondering where everyone was. As a drug using flag burning liberal this is excusable, but for CP to completely ignore a holiday honoring veterans is pretty surprising. --Have Blue (talk) 17:06, 12 November 2010 (UTC)
- Pretty sure that I saw TK covering it on the main page. *checks* Yep, on MPL.img Andy just removed it quicklyimg once the day was over. --Sid (talk) 17:47, 12 November 2010 (UTC)
- I was surprised they didn't jump on the Google Veteran's Day logo is Muslim conspiracy bandwagon. --Leotardo (talk) 17:55, 12 November 2010 (UTC)
- All that "crescent moon is Muslim" crap, but I remember a 'boot on the other foot' situation when I worked in Jordan during the late 70s - they brought out some new banknotes with a partly geometric design reminiscent of some Islamic architecture, unfortunately it was in the shape of 6-pointed stars which some people claimed was Jewish, even though they were not designed as overlapping triangles like the Star of David.
ГенгисOur ignorance is God; what we know is science. 18:09, 12 November 2010 (UTC)
- I'm surprised that Jpatt didn't post this on MPR. --Sid (talk) 18:11, 12 November 2010 (UTC)
- What a fat load of crazy. Who else is crazy? This lady. I love it when people say "I'm not prejudiced" between n-bombs. Corry (talk) 18:30, 12 November 2010 (UTC)
- Oh my: "must kill Google to honor America"
18:39, 12 November 2010 (UTC)
- For the sake of all the people who live near him, I really hope that JP is an incredibly deep cover parodist. Corry (talk) 18:48, 12 November 2010 (UTC)
- Except he's not. And he's armed.
19:08, 12 November 2010 (UTC)
- Did that logo run worldwide, or was it country-specific? ħuman
01:47, 13 November 2010 (UTC)
-
- I'm not sure, but I'm guessing it was America-specific since it was our Veteran's Day, and the Canadians, French, etc. wouldn't care about it (and might find it culturally imperialistic). --Leotardo (talk) 03:29, 13 November 2010 (UTC)
- November 11 is Remembrance Day in Canada, which is essentially the same thing but without the shopping frenzy. "The 11th hour of the 11th day of the 11th month", "Lest we forget", poppies and so forth. --Kels (talk) 04:17, 13 November 2010 (UTC)
- Shopping frenzy? Everything here is closed on 11/11. Not sure where you got that. ħuman
04:28, 13 November 2010 (UTC)
- Shopping frenzy starts the day after (the day when everything is closed). ThiehCP≠Child Porn? 05:12, 13 November 2010 (UTC)
- In unpatriotic New York City, nothing is closed on Veteran's Day. --Leotardo (talk) 14:10, 13 November 2010 (UTC)
- Just to type what everybody knows, "Black Friday" in the US is the day after Thanksgiving. There are no holydaze between then and Xmas, and it is typically the biggest retail sales day of the year (since everybody with a decent job has the day off, etc.). I suppose with the Xmas season now starting somewhere around Labor Day, Veteran's Day could be a big shopping day.... wewll, with the economy the way it is these days, any consumer activity is probably a good thing... ħuman
14:59, 13 November 2010 (UTC)
- Oh, and Leo, while most retail outlets were probably open, closed will be: any Federal office or operation, probably most or all state and local government offices, banks, and misc. others (I tried to call in to pay a phone bill, they had the day off!). A local hardware store was closed here. Holydaze like this one are very erratically honored. UPS worked, USPS didn't. ħuman
15:05, 13 November 2010 (UTC)
- Yeah, you're right with that list, but I didn't notice any difference. With ATMs, I maybe walk into a bank three times a year for something. Nothing seemed closed in the financial district because the NYSE was open. --Leotardo (talk) 15:26, 13 November 2010 (UTC)
- If USPS was working, I would have had to go to bank to deposit two checks. Also I almost brought two packages to USPS to send to customers au Canada, but luckily Nutty had already whined to me about the PO being closed. So instead I thought of some veterans I have known, and some I haven't, and meditated on how a pacifist can honor the sacrifices of those who go to war. ħuman
00:36, 14 November 2010 (UTC)
Blasts from the past[edit]
Every now and again, I trawl through the SDG and TZB archives, looking for a good laugh. I'm rarely dissapointed, as evidenced by these gems from the SDG days. First up, we have Bad Touch Poor being a tad modest (SDG Level_1/New Folder/1a0a9d92f81ee391.html)
Not to lift myself up too high, but I have a hard-won reputation of being rational and fair. Liberals respect my rationality, even when they disagree on points at issue. Liberals also respect my fairness: I only block when I have a reason, and I'm magnanimous with granting clemency, forgiveness, second chances, etc.
I.
As the saying goes, "There are no words..."
Then - and this blew my mind - an actual discussion about whether or not some editors should be blocked. Karajou's reply is pure gold - where have those days gone? (SDG Level_1/New Folder/0fa51b44d51b613a.html}
Andy: I'd be reluctant to block too many liberals at once, because we want to keep some debate. Brian has suggested blocking all of these: Middle Man, Wikinterpreter, Jrssr5, JLindon. I'd don't know if there is enough evidence to block them. Though all seem to be liberal, some of them make helpful comments or edits.
(my emphasis)(my emphasis)
Karajou: In the case for the blocks there would have to be a unanimous consensus first, followed by final approval, etc etc, which is why I wouldn't act on it myself.
I guess the "block by approval only method didn't last long. --Ψ GremlinПоговорите! 09:08, 13 November 2010 (UTC)
- Wow! This *is* hysterical. Were they ever actually like this, or were their words just the usual liberal deceit? It would add some humanity to them if they had started out like this, but just got embittered by vandalism, ridicule, untreated Syphilis kicking in, etc. --Leotardo (talk) 14:13, 13 November 2010 (UTC)
- Yes, they thought they were. For a few months in early 2007. Then TeamKiller pointed out to Andy that the evil liberals were wasting all his time with talk, talk, talk, and it was only three slippery steps from there to blocking all new registrations, which Andy seems to have been perfectly happy with. Problem solved. ħuman
00:14, 14 November 2010 (UTC)
SamHB[edit]
Got to hand it to the man, he clearly has a thing for punishment. Andy's welcomed him back but it's hardly an auspicious start.img "Hi, I'd back to edit, but please restore 'Compass and Straightedge' so I can fix it." Andy (ever the manager) "Er... I didn't delete it. Please work on something else." Given that Ed "improved" the maths category again, I feel Sam is on another hiding to nothing. --Ψ GremlinSermā! 13:54, 13 November 2010 (UTC)
An (ex?)-Conservapedian at my university?[edit]
Through the various email exchanges and all that and somewhat of an overlap in interests (finance in particular) my shocking truth for the day is that apparently the CPian that I'd been emailing with, tzoran (Tyler Zoran) attends my university in Chicago and is actually in one of my MSF courses. Should I be disturbed that my RW/CP life is starting to overlap with my university life? :P ghazi alizm, comments? 20:41, 13 November 2010 (UTC)
- Welcome to the rabbit hole. K61824Ask me for relationship advice 21:01, 13 November 2010 (UTC)
- I used to admin a DoD (day of defeat, a Half Life mod) server ages ago, and one night I got into this huge argument with someone who had become a semi-regular on the server and ended up banning him (because he went mad and started breaking all kinds of server rules, not because we'd had an argument). Then I went into college the next day and the guy was in my damn class, talking to his friend about this asshole admin who banned him for no reason. It is incredibly creepy, so yes. I can understand the feeling, Ghazia. X Stickman (talk) 21:04, 13 November 2010 (UTC)
- Small world, sometimes, it seems. More news on this later; I don't know too much about him personally or as a user of CP, but I can't imagine someone who's actually enough of a maniac to be there can possibly be constructive down here in our normal little reality, what with all its liberal biases. ghazi alizm, comments? 21:14, 13 November 2010 (UTC)
CP's bear[edit]
It's not often I go to CP's front page but I just had a gander and there's a picture of a grizzly bear with the caption:
- Biblical scientific foreknowledge adds a new insight: the possibility of quantum tunneling was illustrated nearly 2000 years before scientists discovered it.
What, pray tell, the fuck is that about? ONE / TALK 15:22, 11 November 2010 (UTC)
- Well, without looking I can say that the quantum tunnelling is something about Jesus appearing inside a locked room (yeah, cause that's a totally accurate description of the phenomenon, Professor Schlafly) while the grizzly may be related to the thing on WIGO:Clogs about culling them all because they've killed someone (and defending the bears is a LIEberal thing to do).
sshole 15:34, 11 November 2010 (UTC)
- And the Bears are a sports team from Chicago, which is a liberal bastion that spawns numerous community organizers, so of course defending the bears or the Bears is a liberal thing to do. Hmmm, I tried, but I just can't. I'm just not on the same level as Andrew Schlafly so these conservative insights are hard to think up! ghazi alizm, comments? 16:08, 11 November 2010 (UTC)
- It's tied to one of ♥ K e n D o l l ' s ♥ latest "essays" on atheism, something about the supposed question "if atheists are smarter then the average bear" (its clever because it's Yogi Bear!). The essay is a rehash of his previous six or seven essays, same thoughts, same logical fallacies, and same word salad, just the paragraphs and pictures have been moved around. --BMcP - Just an astronomy guy 17:28, 11 November 2010 (UTC)
- For some reason every time I read some recent mention of the bears and CP I can't help but hear the music from the Blue Oyster play in my head. --Tygrehart 01:22, 12 November 2010 (UTC)
- For me, it's Bjork turning into a bear in this video,
Bjork-hunter videoclip (long)(HQ)Civic Cat (talk) 20:50, 12 November 2010 (UTC)
Andy's view of conservatives as never-ending victims[edit]
I've been fascinated at how much the victimhood mentality is so pervasive with Andy. We saw it a lot during the election when he would report poll numbers from mainstream media sources and say they were "admitting" something. Like, 'Even Politico admits that a tsunami of Republicans is headed for the House' or 'Polls show Democrats headed for disaster, admits the liberal New York Times.' It was silly, the idea that they were 'admitting' something that they didn't want to, when poor poll numbers were being reported daily by the MM.
So there's a tidal wave of Republicans, they have the House, and they effectively had the Senate before the election, and even more so now. Obama has signaled he's willing to even concede on tax cuts for the rich, of all things. The Republicans in DC can't contain their hubris, no matter how they try. But don't let that stop Andy from blaming a minor drop in the stock market on 'Obama and liberals refuse to accept America's Election Day message'. As someone who works on Wall Street, I can assure all of you that the "why don't the liberals just get it?!" idea is not what caused a dip. I don't know if he's purposefully deceitful, or if he is just lost inside his own deluded half-brained head, where those damn liberals--who only maintain through deception and chicanery any shred of power--are the cause of all the world's ills. --Leotardo (talk) 15:15, 13 November 2010 (UTC)
-
- Simple 2-part answer; Andy (and the others at CP) has a massive persecution complex, that allied with "everything liberals do is bad and the source of all my woes," as well as a deep-seated grudge against Obama and you get the pathetic whining shit that he is. --Ψ GremlinRunāt! 15:28, 13 November 2010 (UTC)
- Not forgetting that the are also Christians a much stamped upon minority! 16:19, 13 November 2010 (UTC)
- Andy considers himself a conservative. He can't see why any other conservative would criticise him, because he's obviously such a good conservative. Therefore, any criticisms he gets must be from liberals (because liberals do nothing other than oppose conservatism). Unfortunately, Andy is a god damn idiot, so he gets criticised a *lot*, by everyone and everything. From his perspective, he must feel like an incredibly persecuted minority, that the libruls are everywhere and doing nothing but attacking good conservatives like him. He's just extrapolating that to conservatism as a whole. X Stickman (talk) 19:07, 13 November 2010 (UTC)
- I remember him coming up with "most liberals pretend to be conservative" to explain why conservatives criticized him, because it couldn't possibly be because he was a total idiot. Which led to some really bizarre concepts as there being a conservative majority, but most of them are liberals in disguise, but we should do conservative things because there's a conservative majority after all. --Kels (talk) 20:38, 13 November 2010 (UTC)
- I'll put money on the table that when both the court cases of recalling senators that he's representing loses, he'll put on MPR about liberal judicial activism. Thieh"6+18=24" 21:05, 13 November 2010 (UTC)
- The meme is spreading, I suppose. It used to be just Christians who were the poor put-upon oppressed majority. Now it's "conservatives" (whatever the hell that even means in USA today) as well? ħuman
00:07, 14 November 2010 (UTC)
- It's martyrdom. The absolute central tenet to any fundie Christian belief isn't Jesus' life, it's his death, ultimately it's why fundies either ignore the teachings of the New Testament or seek to rewrite them. Andy's just one in a long line of "I'm Christian, therefore I follow Christ's example, therefore I'm a martyr, and if I'm not actually a martyr then I'll do everything in my power to behave like one." The simple fact is that fundies find it a lot easier to live a lie as a wannabe-Matyr, than actually follow the tenets that they claim to believe in of forgiveness, non-judgement, and blind charity.--
Spirit of the Cherry Blossom 00:33, 14 November 2010 (UTC)
--Leotardo (talk) 06:07, 14 November 2010 (UTC)
- Yes, that fills in all the gaps in my post, thank you! ħuman
00:50, 14 November 2010 (UTC)
- Am I reading this right? A martyr is supposed to die, right? So how would wannabe martyrs exist if none of those guys want to put their lives on the line? Thieh"6+18=24" 10:25, 14 November 2010 (UTC)
- Because actually dying for a cause would require accepting aspects of Christianity that they can't encompass. They want the martyr label (from their point of view that makes them uber-Christian) without the actual martyrdom. Hence wannabe-martyrs rather than actual martyrs.--
Spirit of the Cherry Blossom 18:16, 14 November 2010 (UTC)
- Technically...yes. Martyrs are supposed to die for thier cause. However keep in mind fundies like Andy don't want to actually want to die, they want to suffer (or at least make it seem like they are suffering.) Used to be that was not hard to do. In some places (like the Middle East where Monotheism was born) food and water is scarce, the environment is hostile, and belief that your afterlife would be a paradise made dealing with these harsh realities easier.
- Fast forward a couple millennia and to a new geographical location. You're a Fundamentalist Monotheist, you want to serve your god and emulate the life of your prophet. Problem is the world you live doesn't offer many opportunities for suffering, especially if you are from an upper middle to upper class household. Food is plentiful, you have access a good education and stable employment. Medical care for once life threatening ailments is plentiful and modern technology put information and entertainment at your fingertips. So how do you suffer? How do you show your god that you so deserve the riches he has promised you after you die?
- Well you could give up all those comforts of life, living humbly and piously, but that's hard work. You could use the comforts you have to help and enrich the lives of those less fortunate than you, but that's also hard work. Then it hits you: you're also supposed to bring the word of your god to other people, whether they want it or not. That's tenant that doesn't take much effort and still keeps you in good with the almighty. Even better some of those you talk to will reject your word outright. Some of them even get hostile about it. Ah, now we're getting somewhere. See <insert deity of choice>? See how I try to do your works and receive nothing but insults and ridicule for it? See how I suffer? Surely I am worthy of you. Surely I am one of your chosen for it.
- Folks like Andy and his ilk do not really know what suffering is, what real discrimination or intolerance feels like. They sit in their posh homes, living lives that would have made them kings (or gods) in another place and time, enjoying advantages once reserved for only the absolutely powerful, all the while wail and moan to the heavens about how hard their existence is. If their prophet came down tomorrow he would probably weep at how his words and image had been so perverted. --Tygrehart 18:26, 14 November 2010 (UTC)
So... if you read books that means you're a Liberal[edit]
Very well, folks, this is it. Andy is a parodist.img Hateboy (talk) 23:17, 13 November 2010 (UTC)
- No he is not, he is just an extremely narrow-minded person. - π 23:24, 13 November 2010 (UTC)
- If a sane person had written this, it would strike me as a moment of self-deprecation.Webbtje (talk) 23:28, 13 November 2010 (UTC)
- So apparently everyone in Laredo, like everyone everywhere else, buys their books on line now? Leaving no market for local bricks and mortar sellers? ħuman
23:47, 13 November 2010 (UTC)
- This was in the news back in January... a new bookstore has already opened. --MarkGall (talk) 00:01, 14 November 2010 (UTC)
- There's that one, another used book store, a Spanish language book store (consider it's like 500 yards from Mexico I'd be surprised if there wasn't one, and a religious bookstore. And the comic shop. But yeah, other than that nobody there's ever going to be able to buy another book in their lives.
00:03, 14 November 2010 (UTC)
- Sometimes I have trouble believing Andy is NOT an extremely dedicated parodist. --Night Jaguar (talk) 00:44, 14 November 2010 (UTC)
- Or an extremely predicated Diderotist. ħuman
00:57, 14 November 2010 (UTC)
- Is there any medium of communication that he hasn't yet dismissed as liberal claptrap? Where does he think reliable information comes from, if even the Bible had to be rewritten? --TinOl (talk) — Unsigned, by: 160.39.62.235 / talk / contribs 01:07, 14 November 2010 (UTC)
- Andy's been pretty thorough. He has essays about the liberal bias in cave paintings, Morse code and Incan knotted strings (sad that I have to point out I'm joking). --Night Jaguar (talk) 01:27, 14 November 2010 (UTC)
- His insights, of course! ħuman
01:13, 14 November 2010 (UTC)
He can't even read online anyhow: he looked for "miracle" & couldn't find itimg; ten seconds: Assuming that's the biBull he means? 01:17, 14 November 2010 (UTC)
- That's wigo-worthy, IMNSHO. Nice one! ħuman
01:55, 14 November 2010 (UTC)
- I don't know it that's the book he's referring to: there's several similar titles, I believe. 02:08, 14 November 2010 (UTC)
- Indeed. The New American Bible appears to be different from the New American Standard Bible. No idea how either the Judean People's Front or People's Front of Judea feel about them. --Night Jaguar (talk) 02:17, 14 November 2010 (UTC)
- Wow. Just when I think Andy couldn't portray himself as being anymore idiotic, he manages to up the ante. Then again, books are full of those pesky fact things. Btw, who coined the 'don't read a book, write a book" crap on CP - Andy or SkaterBoi's Boy? --Ψ Gremlin講話 09:47, 14 November 2010 (UTC)
- If they don't read what has been written, then how are they suppose to avoid plagiarism? Or is ripping off contents by some other people becomes some sort of conservative trait that I am not aware of? K61824Ask me for relationship advice 10:27, 14 November 2010 (UTC)
Just more blatant anti-intellectualism. EddyP (talk) 11:46, 14 November 2010 (UTC)
Koeckritz *loves* Sarah Palin[edit]
It figures that Terry, the Roman Catholic dolt, would find solace in the snowbilly grifter Sarah Palin. A moron for a moron. He even bigged this MPR schlock. --Leotardo (talk) 05:59, 14 November 2010 (UTC)
- Of course it's a strictly non-sexual attraction.
ГенгисOur ignorance is God; what we know is science. 09:24, 14 November 2010 (UTC)
- Should it be Koeckritz? (check the diffs, I think a 'c' might be missing) K61824Insomnia? Masturbate till you pass out 10:15, 14 November 2010 (UTC)
Conservative learning from TK?[edit]
So Ken, in the course of perfecting his Summa Homosexualia, decided to shadowbox with an editor who was permablocked more than five months ago. Nothing unusual about that. However, as soon as Ken realized that he was fighting a ghost, he decided to reblock the guyimg, even reusing the original block comment. TK loves blocking people who have already been blocked, and I've seen other sysops do it as well, but Ken? Is this new behavior, or am I missing something? Perhaps the closed environment of CP is beginning to select for unusual mutations...a TK/Conservative hybrid would be as likely as any to survive there. Colonel of Squirrels医药是医药,和那个不是医药。 06:34, 14 November 2010 (UTC)
- When Ken quotes his own articles which quote other publications then we get get classic acute lexical constipation.
ГенгисOur ignorance is God; what we know is science. 09:32, 14 November 2010 (UTC)
Stupidity theory[edit]
I see Johnny XRay is plumbing new depths, even by his standards. Seems Mcveigh wasn't a disaffected right-wing nutter. No, he was a pawn of Middle East terrorists.img What is the "Trustworthy" encyclopaedia using as a source? A wing-nut blog, written by somebody called Pamela Geller, who isn't above using words such as "Jewpidity."
oh yes, and using ALL CAPS in your reference just makes you look like a hysterical moron... oh, wait... --Ψ GremlinParla! 09:59, 14 November 2010 (UTC)
- Geller is a prominent Jewish/pro-Israel blogger so although "Jewpidity" might sound anti-Jewish it's really an attack on more moderate and conciliatory Jews, she also uses the term "Jewicidal". Ironically she also refers to "Islamic antisemitism" when Arabs are themselves Semitic, but I guess that argument has been buried by the cruft of history.
ГенгисOur ignorance is God; what we know is science. 10:35, 14 November 2010 (UTC)
Kenny boy...[edit]
...are you paying attention? Terry Koeckritz is trying to teach you somethingimg. == Iscariot (talk) 11:42, 14 November 2010 (UTC)
- In other news, I see Terrykins seems to be cleaning up CP's references to homosexuality. [1]img [2]img [3]img [4]img [5]img [6]img[7]img
- Whilst commendable, it's certainly a departure from CP's usual "let's call them every name under the sun policy" and I wonder what bought it on. Maybe a struggle with someone's inner conscience? Either way, how will Ken react to CP succumbing to the homosexual agenda and destroying Ken's soopah-seekrit plan to destroy homosexuality on the Internet? --Ψ GremlinPraat! 12:17, 14 November 2010 (UTC)
- Well, technically, this is an ancientimg policy, but it was quickly tossed aside along with the no-gossip policy it's based on. I'm quite surprised about this sudden return to the roots, too. Guess we'll have to wait for the next SDG/TZB-style leak to figure out the full story... --Sid (talk) 19:48, 14 November 2010 (UTC)
- Though, re-reading the "new policy" (my brain's still fried from hours of studying), it's indeed different than the one I linked to (self-identify vs. primarily known). Very odd... --Sid (talk) 19:51, 14 November 2010 (UTC)
Screen Caps[edit]
Don't forget that Capturebot will (presumably) be down for a bit, so if anything particularly stupid happens over at CP, don't forget to take a screen shot. --Ψ GremlinPraat! 13:23, 14 November 2010 (UTC)
- Looks to be alive again, unless people are doing them all manually? ħuman
01:04, 15 November 2010 (UTC)
Makes perfect sense[edit]
Andy sees himself as a provocateur. Occasionaluse (talk) 20:01, 14 November 2010 (UTC)
- Note to self: when charged with hubris, hide behind "provocateur." Tetronian you're clueless 20:44, 14 November 2010 (UTC)
- Seems like it's got all kinds of applications. I'm not a hate filled bigot, I'm just being provocative. Occasionaluse (talk) 20:47, 14 November 2010 (UTC)
- "I just say what other people are thinking" - Ann Coulter, possibly paraphrased, "justifying" her blatant bigotry and hate speech. ħuman
23:44, 14 November 2010 (UTC)
- I recall Rush describing his own show on similar terms. So it's not unique to Andy by any means. Tetronian you're clueless 01:35, 15 November 2010 (UTC)
Andy, please learn to write English![edit]
It took me a while to realise that Andy actually means "...300,000 churches and 13,000 McDonald's but 0 hospitals built by atheists." My grammar isn't wonderful, but I like to think I can avoid that level of ambiguity. By the way, does any one know if this little "fact" is at all true? --Old Fashioned Architect — Unsigned, by: OldFashionedArchitect / talk / contribs 20:22, 14 November 2010 (UTC)
- Given the minuscule proportion of atheists in this country, I am inclined to think it is, at least as far as big hospitals go. One could, of course, also point out the low proportion of our hospitals that were built by Jews, Muslims, or even Protestants.
ListenerXTalkerX 20:27, 14 November 2010 (UTC)
- Once upon a time my great-aunt and great-uncle endowed a hospital wing in Toronto. They were very wealthy and very generous atheist Jews. This parable actually happened.
20:35, 14 November 2010 (UTC)
- (ec)The "Atheists don't build hospitals" argument is old, and some people here likely remember the consensus re: the truth of the claim better than I do. IMO, hospitals built by atheists likely exist, but they aren't going to scream it out to the world by calling them the "Richard Dawkins Materialism Hospital For People Who Don't Believe In God" or stuff like that. Besides, this entire thing is just part of Andy's justification for not doing shit himself: "I'm a Christian, and Christians build hospitals and give to charity! ...that's enough, right?" --Sid (talk) 20:39, 14 November 2010 (UTC)
- (EC) I think that somewhere in the Gospel of Schlafly there is a passage to the effect of, "Thou shalt not give a dime to the godless liberal Canadians, lest thou be damned to the outer darkness." Besides, if one allowed other countries in the tally, one would have to hand-wave away the large numbers of hospitals built by communists in the Second World.
ListenerXTalkerX 20:50, 14 November 2010 (UTC)
- IIRC a user provided an example of a hospital built by an atheist, whereupon Ed stepped in and declared that one counterexample hardly disproved Andy's statement that atheists had built no hospitals. EddyP (talk) 21:12, 14 November 2010 (UTC)
- Andy also discounts atheist Bill Gates' philanthropies which, while not directly building hospitals, are very much related to health. (Though that's in the Third World, which Andy doesn't give a damn about anyway.)
- Plus, aren't most hospitals today corporate-owned and have little relationship to churches beyond names and chaplains for patients who might desire spiritual comfort? They might have been founded by theists, but the connection to religion now is slim. MDB (talk) 21:50, 14 November 2010 (UTC)
- For that matter, is there no state built hospitals in the states? I thought the first amendment dissociates the government from religion, so it would result in all state-built hospitals being built by the atheist government. But then of course, that government is not religious thing is *still* open to interpretation by some nutjobs. Thieh"6+18=24" 00:44, 15 November 2010 (UTC)
RE:OP, Andy rejects the liberal Harvard comma. The conservative comma separates independent clauses. Occasionaluse (talk) 22:02, 14 November 2010 (UTC)
- Rejecting the Havard comma is mostly done in journalistic writing, which we are happy that Andy joins the lamestream media. ThiehWhat is going on? 00:48, 15 November 2010 (UTC)
User 188 cops a ban[edit]
Ed's blocked for a day for breaching a topic ban. Naughty Ed! 08:07, 11 November 2010 (UTC)
- Ed: "Ironically, I am so great!" --
YossarianThe Man from the USSR 08:12, 11 November 2010 (UTC)
- I'm actually on Ed's side here, I think blocking him was a bit of an overreaction. Never attribute to malice that which can be adequately explained by extreme stupidity. -- Nx / talk 08:14, 11 November 2010 (UTC)
- Yeah, I thought that too, but if he's as clued up as he thinks he is he'd have steered clear of it anyway. User:Kitfoxxe seems to have been an accidental agent provocateur. 08:17, 11 November 2010 (UTC)
- He's been warned about POV-pushing and topic bans so many times though... asking doen't stop him, telling doesn't stop him... let him sulk on CP for a day and liveblog teen movies. Totnesmartin (talk) 09:32, 11 November 2010 (UTC)
- "my fellow contributors were begging me to write more" - yes Ed, because all you seem to produce is worthless stubs.
ГенгисOur ignorance is God; what we know is science. 09:42, 11 November 2010 (UTC)
- I dunno, I'm kinda torn here. On the one hand, the block seems a bit overkill, even if it's just for a day. On the other hand, (IIRC) several people have sent such standard "I found your name in the article history and now started a discussion on X, could you give input?" messages to him, and each time he simply replied on his own talk page that he's topic-banned. This time he did the same, but then also wandered onto the off-limits talk page and practically tried to lure unsuspecting people into letting him edit again despite the ban, treating such a standard note as some sort of "Oh, Ed, please edit again on UC articles, we need you!". Sorry, but Ed either knows the proper channels to re-negotiate his ban, or he knows who to ask what are the proper channels. --Sid (talk) 12:35, 11 November 2010 (UTC)
- As the blocking admin said "to acknowledge a ban and then violate it three minutes later is unacceptable". If he'd just made his talk page post asking if he could edit, he'd have got away with a warning. The way he did it clearly looks like gaming the system. He even apologised for doing it on his talk page. –SuspectedReplicant retire me 13:12, 11 November 2010 (UTC)
Topic bans are stupid and bring question on Wikipedia's alleged claim of neutrality. If Wikipedia is not going to have its admins vetted, and there have been several cases of admins lying about who they really are, it has no moral authority to say who is or who is not qualified to edit an article. ConservapediaEditor (talk) 07:23, 14 November 2010 (UTC)
- You're clinging to common misconceptions about Wikipedia's Neutral Point of View policy. The policy simply states that the subjective load (emotional, political, popularity) of any specific fact has no relevance to whether or not that fact can be included to an encyclopedia article; the only thing that matters is that the fact is published in a reliable source. If an editor cannot abide by sourcing requirements in a situation where those reliable sources are absolutely needed, then yes, it's probably better that that editor doesn't contribute material that cannot be used to improve the article. That's the bottom line: Article quality can only be improved if people agree to stick to the same standard, and it's easier to develop standards for quality of encyclopaedia articles than quality of people. --wwwwolf (barks/growls) 10:27, 15 November 2010 (UTC)
|
https://rationalwiki.org/wiki/Conservapedia_talk:What_is_going_on_at_CP%3F/Archive206
|
CC-MAIN-2019-09
|
refinedweb
| 20,441
| 70.63
|
- Panel Header creation via config ...
- Date Grid Filter
- hide item of a grouptabpanel
- restore functionality for Panel in ExtJs
- How to control whether the grid is editable or not in ExtJS 4.1.1 ?
- Scroll Bar is Moving Up And Down
- Extjs 4 pie chart with php mysql example source code
- Extjs 4 and PHP-Anyone?
- Item in grid is deselected after record has been modified with set-method
- 4.1.3 for public?
- How to load data in to one tree store(Memory proxy) from another tree store reader
- Downloded file cannot be opened on windows. it can be developed using exporter plugin
- Extjs Grid scroll dons't work after application kept insert and delete record.
- Using custom file structure with sencha create
- Adding custom properties to Grid state
- Table Layout not respecting number of columns for cells
- SOAP with browser certificate authentication
- Different design for the Ext Window
- Accessing/Toggling series in a chart
- Tab CSS How To
- Using a new Button UI specification
- Grid page number not changing after store.load
- Themes for Ext 4
- autoScroll bar
- autoScroll bar
- fireEvent with Ext.Msg.prompt
- Pie chart with lines
- Disable month if dates of this month are disabled in extjs4.1 using Ext.form.DateFiel
- Problem with panel expand/collapse in Viewport
- Checkbox slection model does not get checked when locking grid column is used
- Problem with panel expand/collapse in Viewport
- Timefield/Combobox expanded list issue when setting value from loadRecord.
- Adding Buttons to Windows Dynamically
- pagination
- Sort after append
- Model field mappings for nested json
- hasMany on nested JSON
- Displayfield and afterBodyEl for it
- copy/paste in editable extjs grid
- Chart with grouped Store
- Keep the "Match filter" while paging
- how to add some text in a textfield.
- Floating an element inside a tabpanel (or any cardlayout)
- NumberField submitting as a string on jsonSubmit
- Poor Form Layout Performance
- DynamicGrid and custom renderer function???
- Grid Column Locking Causes Many Problems
- How to Reload the pie chart dynamically
- Extjs 4.1.0 portal example scroll issues in firefox version 15
- Problem with browse button in ExtJs form
- Grid DragDrop with stripeRows
- Step Line Chart - using Ext JS 4.1.3
- ExtJS right angled line graph/chart
- Docked Row in grid
- Populating grid panel dynamically
- Problem with grid-odd-fill
- wrapping all functions beforehand
- Treegrid Summary
- Collapsible Panel in West Region don't shows the tiltle
- How to add an icon on a multiselect combo only when a value is selected?
- Show popup window from a popup window
- Cant able to submit form items.
- Grid Grouping
- Error when compiling project with calendar
- Apply tooltip dynamically to tools items on panel
- Border Layout Collapsed Panel Vertical Title not showing 4.1.3
- Sliding Effect/ Carousel Effect
- Stack Bar chart render issues
- extjs panel collapse and expand
- ExtJs and SingalR
- validator doesn't work
- error when form is submitting
- Ux Multiselect problem with ext-all.js
- Click event been fired even if no event wirrten for it when using the prperty itemTpl
- Memory leak of drawing living line
- REST response via Ajax request is empty
- WADL Support without Complete Team
- Backend Database Connectivity Coding in DirectJngine
- TreePanel to use different store at each level?
- Issue with file upload form on Firefox
- Multiselec Ux problem with big items
- Locked & stateful both are not working at same time?
- select element disappear!what‘s happened?
- excel file downloading
- How to create a column chart with whereby the the x axis will display three columns (
- ServerProxy error when using Tree Panel
- Auto suggest Implementation in sencha
- Customize PagingToolBar Layout
- model.load Method
- getComponent fetches from wrong tab, Anyone know why?
- Is there any equivalent
- Two editable text field in a grid cell !!!
- Width of combobox window crossing width of combobox
- Uniform Resizing/Scaling of components?
- ExtJS 4.1 MVC detect splitbutton's menu's 'click' event
- Combobox window width issue on click
- Facing problem with Ext.Ajax.abortAll() function
- How to get the value of selected displayField in ExtJS 3.4 ComboBox?
- Row Expender plugin
- ExtJS 4.1: Another way to load ExtJS Application for production
- Problem with reloading data into a Pie chart.
- draggable delegate not working properly on panel?
- Chart series hightlight via highlightCfg
- Memory consumption in official ExtJS 4.1 example
- Videoplayer
- Reusable Components
- variableRowHeight: true breaks infinite grid scroll
- Ext.Window overflow image outside window
- Use of !important to override inline style
- Dynamically set labels from record
- formatting series markers according to data
- Firefox error - Exception... "'JavaScript component does not have a method named: "..
- Load Store Dinamically in component ItemSelector, please help me.
- extjs and php example
- Packaging sencha single application files
- No space long text
- Changing grid.emptyText on the fly
- Fata error: require_once(): Failed opening required 'folder/file.php' (...)
- Row Expender
- Best Way to implement Hotkeys in a big Application.
- Performance in IE 7 and Mozilla Firefox (any version after 8.0)
- Is Ext.require guaranteed to finish before onReady is called?
- Cancel file upload
- Empty line in a combobox in a grid when editing is only 3px high
- Adapt ux.IFrame to windows size
- Questions about paging with buffered grid with local cache in Extjs 4.1
- Display a single cell for multiple rows in Tree Panel
- Is there any ExtJS4 PHP framework?
- Buffered Grid Scrolling Performance Unacceptable
- Version conflict in an integration application
- Setting up project in eclipse with sencha vjet plugin
- Ext Js 4 MVC - Add Listener to Image in a grid panel
- Collapse Tool action and Title Collapse Action completely different
- Applying custom filter to ExtJS grid
- Web Desktop Example's Module
- Is there a time delay between ajax requests?
- Layout Problem
- set maxValue during execution
- Obtaining call stack programatically
- Grid row color with getRowClass is not working
- How to confirm window closing
- Change code to MVC
- How to render chart inside Xtemplate
- Override pagingtoolbar buttons in ExtJS
- Updating propertygrid content from a datasource
- How do I shrinkWrap some buttons?
- Store filter problem
- Tab Context Menu
- Portal Sample with Navigation
- How to render ajax tool tip on image tag.
- Application namespace not found.
- expandable/splitter panels using extjs4.0
- playing rtsp/trmp file in extjs
- Line chart color with no markers.
- Best Practice: Populating view
- Viewport dosent show panel's content unless refresh/resize page.
- Button Align in tbar in Grid Panel
- how to desactivate _dc parameter
- Custom CSS (.x-boundlist-item) override in ExtJS combobox
- Change event for checkbox is not working
- Question about ExtJS license.
- Trigger on mouse over/hover in Combobox
- Show status text instead of id
- Rowexpander Error
- How to update boxLabel for a radio button after rendering?
- Change panel region on the fly
- How to stroke image sprite?
- 4.1.1a: Treegrid metaData fields problem
- Progress Bar inside Window
- Fixing panel's buttontoolbar in the enclosing window
- scroll dataview by drag drop
- ExtJS 4.1.1 add tab in FF18
- Accordian layout - Multi panels are expanding at the same time
- How to read data from store sync GET variables
- not able to display tree grid with hard coded values using plain html page
- Read id value of selected item in dataview
- custom classes not working locally
- Button inside form panel not rendering properly
- History management not working in Iframe Panel
- How to set focus class for Ext-JS 4 Grid Class Cell Editor?
- Problem in constrainTo configuration in Panel
- scroll bar does not show up
- Ext.data.Store.load fails if param value is too long
- textchange event doesnt fire
- Save a ext panel window as image
- How to create textfield cell in grid?
- In IE9 Browser, Data is not showing in the view
- xtype:image handling of click event in controller
- Grid - with headers arranged horizontally - per row
- Splitter doesn't work on vbox with 3 panels inside middle panel never resizes itself
- Split button with slider
- Web Desktop issues when navigate in windows
- Component Query - Too many instances?????
- Alternate for setcontainer(Ext.container) in Ext js 4
- How i can drag to the end when i scroll the tabpanel
- Silly question regarding callParent
- ExtJS 4.1 MVC relative paths work incorrectly
- Custom KeyNav for TextField
- How to call parent class overridden method in overriding method
- Can we get a grid which got his column are autoresizing with their content?
- Loading subset of json into editable combobox in the Grid
- Create a Store from a subset of JSON Store
- Autoheight tabPanel when tab content changed
- Extjs and Sencha Touch
- How do I make a grid 'render' before it's visible?
- Extjs 4.1 Paging bar (Ext.toolbar.Paging) overflow issue
- How to align Chart to the top ?
- Extjs Navigation
- Not able to view simple tree Grid with the local data
- Class instantiation Order
- update tbar of grid dynamically
- How to add increment & decremented buttons to slider
- How to add zoom in & zoom out for panel content by changing the slider value.
- Working with model and store
- Unable to Implement EXT JS GridPanel Paging
- how do we specify our own intervals on Extjs sliders
- Grid view "lost" data after switching to another window
- Controller View 'Getter' Question
- Disabled text box not scrolling IE
- Border Layout East Region Over North
- How get datefield values from MVC
- get grid cell by posotion
- urgently:how to maximize a portlet in portal?
- menu as toolbar items and context menu items
- Ext Js 4.1 - Access to ClipBoard
- fixed row Grid with Roweditor/Celleditor and different combobox value
- Bar in the entire cell of the grid
- How to bold a particular row of the grid in ext js
- Set panel->Frame=true dynamically
- Ext.form.Label - wordwrap the text
- Simple Tasks Example
- Unable to view HTML with styles using HTMLEditor
- How To Get The Selected Radio Button Value In Ext.grid.Panel
- How to group multiple Ajax requests into a single batch request?
- What happened to sencha create jsb?
- Grid numberfield dirty mark
- Servlet call not happen inside the store
- How to update controller controlled objects after an object was dynamically loaded ?
- [4.1.3] Buttons of Toolbar render problem !
- Collapse/minimize the Grid if the grid contains no data
- Working with component
- ExtJS 4.1 Grids and IE7 and IE8
- How can i change url to background-image
- Auto log user by mimic a post behavior in an Iframe
- Header Override Display After Collapse
- Help with border-radius on new elements in legacy browsers
- Trigger loading message with grid
- Programmatically toggle off a pie chart slice?
- How to prevent a 2nd line in a multiline chart from extending off the viewable area
- Grid filter change listener
|
https://www.sencha.com/forum/archive/index.php/f-87-p-45.html
|
CC-MAIN-2015-27
|
refinedweb
| 1,752
| 50.67
|
On 05/08/2012 04:40 PM, Eric Blake wrote: > On 05/08/2012 04:30 PM, Eric Blake wrote: >> On 05/08/2012 10:04 AM, Osier Yang wrote: >>> As libnuma's API is used to set memory policy. >>> --- >>> libvirt.spec.in | 4 ++++ >>> 1 files changed, 4 insertions(+), 0 deletions(-) >>> >>> diff --git a/libvirt.spec.in b/libvirt.spec.in >>> index 95d8af4..f7764e8 100644 >>> --- a/libvirt.spec.in >>> +++ b/libvirt.spec.in >>> @@ -457,8 +457,12 @@ BuildRequires: gawk >>> BuildRequires: scrub >>> >>> %if %{with_numad} >>> +%if 0%{?fedora} >= 17 >>> +BuildRequires: numactl-devel >>> +%else >>> BuildRequires: numad >>> %endif >>> +%endif >> >> ACK. > > Actually, I may have spoken too soon. See >. > > I think we have two needs - when configuring, we need to know the > location of the numad executable; and when linking, we need the > numactl-devel libraries. Based on which packages provide those, we may > need multiple BuildRequires. I'm still investigating what F16 vs. F17 > provides. NACK. Both F16 and F17 provide /usr/bin/numad in the numad package; I think the real dependency here is that you are stating that now, if we hard-code the use of numad, we are also requiring numactl-devel to be present. libvirt.spec.in already has a dependency on numactl-devel; what is missing is a configure check that errors out if you say --with-numactl=no --with-numad=yes. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library
Attachment:
signature.asc
Description: OpenPGP digital signature
|
https://www.redhat.com/archives/libvir-list/2012-May/msg00448.html
|
CC-MAIN-2019-18
|
refinedweb
| 242
| 57.27
|
Hi. I'm trying to write a sports prediction site whereby players can predict scorelines and then be awarded points if they're correct. I've set up a predictions form that feeds into a database and I have another column in the database called results. I want to get this field to display the word 'home' or 'away' depending on the scoreline. Here's the code I've done so far - I've included comments on what I'm trying to achieve with each line of cod.
import wixData from 'wix-data';
var game1_h, game1_a; //define the 2 scoreline fields
var game1_result = ["home", "away"]; //define the 2 possible answers for the results field
wixData.query("Week1_Preductions2")
.contains("game1_h", 0)
.contains("game1_a", 1)
.find() //search the Week1_Prediction2 database for the values in fields ‘game1_home’ and ‘game1_away’
.then( (results) => {
if (game1_h >= game1_a) {
$w("game1_result").value = results["home"]; //inserts the word ‘home’ in the results field if the home team wins or draws
}
else {
$w("game1_result").value = results("away"); //inserts the word ‘away’ in the results field if the away team wins
}
} );
console.log(game1_result);
Can anyone please help and show me where I'm going wrong?
Thanks a lot,
Paddy
Hi Paddy,
Your code has many Wix Code and Javascript errors. I would recommend starting with Wix Code Basics. You can also play with some of the Wix Code Examples which will let you learn by observing working apps. The tutorial How to Use Code to Let Your Users Search a Collection demonstrates how to perform queries and other database techniques.
A gentle warning: The system you are describing is not trivial and will be a challenge for beginner coders. As you learn, we'll be here to help you get pointed in the right direction.
If your project is urgent and you won't have enough time to learn how to build your app, you might want to consider checking out the WixArena - it's a hub where you can look for Wix Code (and other) experts for hire.
Have fun and good luck,
Yisrael
Thanks for that Yisrael. I appreciate the feedback.
Paddy
|
https://www.wix.com/corvid/forum/community-discussion/how-can-i-get-a-greater-than-function-code-to-work
|
CC-MAIN-2019-47
|
refinedweb
| 354
| 70.73
|
i think there is a bug in your prog, the array cv, which stores the eularian circle can become as long as 1000, because you visit one node for every edge. So hence there are 1000 edges you can visit up to 1000 nodes on your way.
Moderator: Board moderators
Code: Select all
#include <algorithm> #include <iostream> #include <sstream> #include <string> #include <vector> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> using namespace std; #define V(c) vector <c> #define ALL(c) (c).begin(),(c).end() #define FOR(i,v,n) for(int i=v,_n=n;i<_n;++i) #define FORD(i,v,n) for(int i=(n-1),_v=v;i>=_v;--i) #define REP(i,n) FOR(i,0,n) #define REPD(i,n) FORD(i,0,n) #define FOREACH(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it) #define sz(c) (c).size() int G[51][51],grau[51],usado[51],vis[51]; void calc(vector<pair<int,int> >& res, int i) { REP(j,50) if (G[i][j]>0) { G[i][j]--; G[j][i]--; vis[i]=vis[j]=1; res.push_back(make_pair(i+1,j+1)); calc(res,j); break; } } int main( int argc, char* argv[] ) { int ncasos, caso=1; cin>>ncasos; while(ncasos--) { int N; cin>>N; // limpando memset(G,0,sizeof(G)); memset(grau,0,sizeof(grau)); memset(usado,0,sizeof(usado)); memset(vis,0,sizeof(vis)); // lendo REP(i,N) { int u,v; cin>>u>>v; u--; v--; G[u][v]++; G[v][u]++; grau[u]++; grau[v]++; usado[u]=1; usado[v]=1; } vector<pair<int,int> > res; cout<<"Case #"<<caso++<<endl; REP(i,51) if (grau[i]>0) { calc(res, i); break; } bool flag=true; REP(i,51) REP(j,51) if (flag && G[i][j]>0) { vector<pair<int,int> > novo; calc(novo, i); bool flag2=false; REP(r,sz(res)) { if (res[r].second == novo.front().first && res[(r+1)%sz(res)].first == novo.back().second) { vector<pair<int,int> > novoRes; REP(i,r+1) novoRes.push_back(res[i]); REP(i,sz(novo)) novoRes.push_back(novo[i]); FOR(i,r+1,sz(res)) novoRes.push_back(res[i]); res=novoRes; flag2=true; break; } } if (!flag2) { flag=false; break; } } if (!flag || sz(res)<N || res.back().second != res.front().first) { cout<<"some beads may be lost"<<endl<<endl; continue; } REP(i,sz(res)) { cout<<res[i].first<<" "<<res[i].second<<endl; } cout<<endl; } return 0; }
Yes I know a better way that uses a linked list and adjacency matrix to get O(n) running time. I do not take credit for the following code, it was not written by meYes I know a better way that uses a linked list and adjacency matrix to get O(n) running time. I do not take credit for the following code, it was not written by meJulien Cornebise wrote:Hi Deneb
I had much troubles with this part, and that's what makes my code so ugly and so slow
The algorithm is as follows :I hope this pseudo code is clear enough and not too much wrong (I've got the brain bottom-up because of christmas parties AND working my final exams wich are in two weeksI hope this pseudo code is clear enough and not too much wrong (I've got the brain bottom-up because of christmas parties AND working my final exams wich are in two weeks
Code: Select all
/* I don't mention global variables used to mark the cycles and to store the eulerian cycle */ /* direct_cycle is the direct cycle you're processing */ construct_eulerian_cycle(direct_cycle) { Mark this cycle; For each vertex in the cycle { Add the vertex to the eulerian cycle: For all non-marked cycles C containing this vertex { construct_eulerian_cycle(C); } }
).).
I confess it's horribly slow and ugly, so if anybody has another algo, please tell !
Code: Select all
list< int > cyc; void euler( list< int >::iterator i, int u ) { for( int v = 0; v < n; v++ ) if( graph[u][v] ) { graph[u][v] = graph[v][u] = false; euler( cyc.insert( i, u ), v ); } } int main() { // read graph into graph[][] and set n to the number of vertices euler( cyc.begin(), 0 ); // cyc contains an euler cycle starting at 0 }
Yes.Yes.adelar wrote:"There may be many solutions, any one of which is acceptable" meaning that the output can be started on any edge...??
Code: Select all
Case #1 1 1 1 2 2 2 2 1
Code: Select all
2 6 1 3 1 2 2 3 3 4 3 5 4 5 6 1 2 1 3 2 3 3 4 4 5 3 5
Code: Select all
Case #1 5 3 3 1 1 2 2 3 3 4 4 5 Case #2 5 3 3 1 1 2 2 3 3 4 4 5
|
https://onlinejudge.org/board/viewtopic.php?f=9&t=732&p=35475
|
CC-MAIN-2020-29
|
refinedweb
| 816
| 53.85
|
Windows Azure websites helps you create highly scalable websites with fast deployment to the Windows Azure . Since Python stack is available on Windows Azure websites , I have been excited to build Python applications on Windows Azure Websites .
Flask is popular python framework based on Werkzeug, Jinja 2 . In this tutorial I will show you how to create a Hello world Flask application on Windows Azure .
Create a folder for your application if you haven’t already , say ‘myflasksite‘ and include the source for the following libraries :
Extract the TAR packages for the above libraries to your application folder . Here is how the directory structure would look like
myflasksite \ +-flask (folder name must be 'flask' and this is case-sensitive) \ |-- folders and files of flask library +--jinja2(folder name must be 'jinja' and this is case-sensitive) \ |-- folders and files of jinja2 library +--werkzeug (folder name must be 'werkzeug' and this is case-sensitive) \ |-- folders and files of werkzeug library +--myapplication (this is where your application content will live . You can change the name of this folder to the name of your application) \ |--application content
In ‘myapplication’ folder create a __init__.py file and enter this code in the file which will serve a “Hello World” message when the site is browsed . For more on Flask check out the documentation here
from flask import Flask
app = Flask(__name__)
@app.route(“/”)
def hello():
return “Hello World!”
if __name__ == “__main__”:
app.run()
Now all we need to do is setup an Azure website and configure it to run the Flask application . Once you are logged into the Windows Azure Management portal , you will need to create a new site with “Quick create” as shown below and enter the site name , say “helloworldflask”
Once the site is up and running , access the Dashboard of the site and click on ‘ Configure’ tab . To run Flask application , you need to :
- Create app settings for your flask application
- You need to set the Python Path for the application in web.config . For Azure websites, use ‘D: \home\site\wwwroot’ as this will point to the site root where the any frameworks needed by your application will reside
PYTHONPATH D:\home\site\wwwroot
2. You need to set the WSGI_HANDLER for the application in web.config . It’s a module/package name, followed by the attribute in the module to be used; for example mypackage.mymodule.handler. Add parentheses to indicate that the attribute should be called.
WSGI_HANDLER myapplication.app
Note that WSGI_HANDLER is referencing the name of your application folder , in this case it is ‘myapplication
- Create a handler to handle requests
EXTENSION * SCRIPT PROCESSOR PATH D:\python27\python.exe ADDITIONAL ARGUMENTS D:\python27\scripts\wfastcgi.py
Save the configuration and now it’s time to copy the content of ‘myflasksite’ to the newly created site ‘helloflask’ .
Now your site is configured for using Flask . You can use FTP or GIT to deploy your Flask Application to this newly created Azure Website , for this tutorial I will show how to use GIT . Here are the steps :
- Install GIT on your local machine , if you haven’t already
- Setup GIT deployment on Azure Website :
Click on “Setup deployment from source” your helloworldflask website Dashboard
- Select Local GIT repository and continue . This will set up a GIT deployment for your website
- You will now see a Deployments Tab for your site with a list of instructions on how to deploy your local site content to the azure website
- Open Git BASH command Line and move to your application folder (‘myflasksite’ folder )
- At the command prompt, and then type this command:
git init git add . git commit -m "initial commit"
- At the command prompt, change to the root directory for your app, and then type this command:
git remote add azure git push azure master
Once the content is deployed successfully , browse the site
That’s it . Your Flask application is up and running on Azure website .
6 thoughts on “Build your Flask application on Windows Azure Websites”
Thanks for this! I’ve followed your steps but still getting a 500 error. The logs show “ErrorDescription An unknown FastCGI error occurred” when trying to navigate to ‘/’: Any ideas?
In the configure page on windowsazure.com ,setup a new “application setting” for getting python logs
WSGI_LOG D:\home\site\wwwroot\log.txt
This will give you the actual error why it this failing in log.txt . I recommend to install Flask from the “Gallery” in Windows Azure websites . The Gallery has a basic template for Flask application that can be modified to your needs .
Thanks! Will give it a try. One thing I noticed is that the template (and other blogs) have a web.config file that seems to duplicate some of the config settings in the portal…with the exception of this guy:
Any idea how this works?
Here it is:
action type=”Rewrite” url=”handler.fcgi/{R:1}” appendQueryString=”false” /
Got it, thanks! This was also really helpful:
Flask template was updated in September with the fix for the query string issue . Now the web.config has it set to appendQueryString=”true” . Did you see the value being set to false in web.config ?
|
https://sunithamk.wordpress.com/2013/04/30/build-your-flask-application-on-windows-azure-websites/
|
CC-MAIN-2018-22
|
refinedweb
| 865
| 61.16
|
This blog post is the first in a series of four posts to discuss how to use a Model-View-View-Model (MVVM) approach in an MVC application. The MVVM approach has long been used in WPF applications, but has not been prevalent in MVC applications. Using a View Model class in MVC makes good sense as this blog post illustrates. You are going to be guided step-by-step building an MVC application using the Entity Framework and a View Model class to create a full CRUD web page.
The reasons why programmers are adopting MVVM design pattern is the same reasons why programmers adopted Object Oriented Programming (OOP) over 30 years ago: reusability, maintainability and testability. Wrapping the logic of your application into.
The thing to remember with MVVM is all you are doing is moving more of the logic out of the code behind of a user interface, or an MVC controller, and into a class that contains properties and methods you bind to the user interface. To use MVVM you must be using classes and not just writing all your code in a MVC controller. a controller method.
There are many reasons for using MVVM in an MVC application. Below are some of them.
This series of blog posts have a few goals for you to accomplish.
For this sample, create a table called Product in a SQL Server database. In the following code snippet,. Below is the data that I used to create the list of product data for this sample application.
Here is the script to add the data to the Product table.
SET IDENTITY_INSERT Product ON
GO
INSERT Product (ProductId, ProductName, IntroductionDate, Url, Price)
VALUES (1, 'Extending Bootstrap with CSS, JavaScript and jQuery', '2015-06-11', '', 29.0000);
INSERT Product (ProductId, ProductName, IntroductionDate, Url, Price)
VALUES (2, 'Build your own Bootstrap Business Application Template in MVC', '2015-01-29', '', 29.0000);
INSERT Product (ProductId, ProductName, IntroductionDate, Url, Price)
VALUES (3, 'Building Mobile Web Sites Using Web Forms, Bootstrap, and HTML5', '2014-08-28', '', 29.0000);
INSERT Product (ProductId, ProductName, IntroductionDate, Url, Price)
VALUES (4, 'How to Start and Run A Consulting Business', '2013-09-12', '', 29.0000);
INSERT Product (ProductId, ProductName, IntroductionDate, Url, Price)
VALUES (5, 'The Many Approaches to XML Processing in .NET Applications', '2013-07-22', '', 29.0000);
INSERT Product (ProductId, ProductName, IntroductionDate, Url, Price)
VALUES (6, 'WPF for the Business Programmer', '2009-06-12', '', 29.0000);
INSERT Product (ProductId, ProductName, IntroductionDate, Url, Price)
VALUES (7, 'WPF for the Visual Basic Programmer - Part 1', '2013-12-16', '', 29.0000);
INSERT Product (ProductId, ProductName, IntroductionDate, Url, Price)
VALUES (8, 'WPF for the Visual Basic Programmer - Part 2', '2014-02-18', '', 29.0000);
SET IDENTITY_INSERT Product OFF
GO
As there are three pieces to a MVVM application, the Model, the View and the View Model, there are three Visual Studio projects you need to build within a single solution.
Let's start building those now.
Open Visual Studio and click on the File | New Project to display the New Project window. Select Web from the Templates under Visual C#. From the list in the middle of the window select ASP.NET Web Application (.NET Framework). Set the name of this project to PTC as shown in Figure 2.
width="635px" alt="Image 2" data-src="/KB/aspnet/1174826/image2a.png" class="lazyload" data-sizes="auto" data->
Click the OK button. When prompted, choose the MVC template as shown in Figure 3 and click the OK button.
width="634px" alt="Image 3" data-src="/KB/aspnet/1174826/image3a.png" class="lazyload" data-sizes="auto" data->
You are going to be using the Entity Framework in all threes projects. While you are still building this MVC project, let's go ahead and add the necessary DLLs and configuration file entries. Right mouse click on the project and select Manage NuGet Packages… Click on the Browse tab and search for Entity Framework. Click the Install button as shown in Figure 4.
width="639px" alt="Image 4" data-src="/KB/aspnet/1174826/image4a.png" class="lazyload" data-sizes="auto" data->
Let's now build a project to just hold all data access classes and any other Entity classes we need to create. Right mouse click on the solution and choose Add | New Project. Select Windows from the Templates on the left tree view. Select Class Library from the middle part of the window. Set the name to PTC.DataLayer as shown in Figure 5.
width="637px" alt="Image 5" data-src="/KB/aspnet/1174826/image5a.png" class="lazyload" data-sizes="auto" data->
Click the OK button to create the new project. Delete the file Class1.cs as you won't need this. Right mouse click on this project and select Add | New Item… From the New Item window select Data | ADO.NET Entity Data Model. Set the name to PTCData as shown in Figure 6. Click the Add button.
alt="Image 6" data-src="/KB/aspnet/1174826/image6-r-700.png" class="lazyload" style="cursor: pointer; border: 0; width: 700px; height: auto" onclick="imageCleanup.showFullImage('/KB/aspnet/1174826/image6.png')" data-sizes="auto" data->
On the Entity Data Model Wizard screen that is now displayed (Figure 7), select the Code First from database option.
width="640px" alt="Image 7" data-src="/KB/aspnet/1174826/image7.png" class="lazyload" data-sizes="auto" data->
Click the Next button to advance to the next screen. On the next page of this wizard (Figure 8) add a connection string where you created the Product table. Leave everything else as it is on this page and click the Next button.
width="640px" alt="Image 8" data-src="/KB/aspnet/1174826/image8.png" class="lazyload" data-sizes="auto" data->
You are now going to choose the Product table you created earlier in this blog post. Drill down into your collection of tables and check the Product table as shown in Figure 9.
width="640px" alt="Image 9" data-src="/KB/aspnet/1174826/image9.png" class="lazyload" data-sizes="auto" data->
Click the Finish button and Visual Studio will generate new classes that allow you to create, read, update and delete data in the Product table.
The last project you need to add is one for your View Model classes. Right mouse click on the solution and choose Add | New Project. Select Windows from the Templates on the left tree view. Select Class Library from the middle part of the window. Set the name to PTC.ViewModel as shown in Figure 10.
Click the OK button. Rename Class1.cs to ProductViewModel.cs.
width="640px" alt="Image 10" data-src="/KB/aspnet/1174826/image10.png" class="lazyload" data-sizes="auto" data->
Just like you added the Entity Framework to the MVC project, you need to add it to this project as well. Right mouse click on the project and select Manage NuGet Packages… Click on the Browse tab and search for Entity Framework. Click the Install button as shown in Figure 11.
width="640px" alt="Image 11" data-src="/KB/aspnet/1174826/image11.png" class="lazyload" data-sizes="auto" data->
Now that you have all the projects created, you need to add the appropriate references in each. Add a reference to the PTC.DataLayer and PTC.ViewModelLayer project from the PTC project. Add a reference to the PTC.DataLayer project from the PTC.ViewModelLayer project.
Copy the <connectionString> element from the PTC.DataLayer app.config file to the PTC web.config file.
<connectionString>
<connectionStrings>
<add name="PTCData"
connectionString="YOUR CONNECT STRING HERE"
providerName="System.Data.SqlClient" />
</connectionStrings>
At this point, your solution should look like Figure 12.
Let's start to write code in the ProductViewModel to retrieve a collection of Products using the Entity Framework generated code. Open the ProductViewModel class and add a couple of using statements:
ProductViewModel
using PTC.DataLayer;
using System.Collections.Specialized;
Add a property to the view model class to hold the collection of products.
public List<Product> DataCollection { get; set; }
Add another property to hold any messages to display to the user.
public string Message { get; set; }
Add an Init() method to initialize the DataCollection property and message property.
Init()
DataCollection
public void Init() {
// Initialize properties in this class
DataCollection = new List<Product>();
Message = string.Empty;
}
Add a constructor to call the Init() method
public ProductViewModel()
: base() {
Init();
}
Add a couple of methods to handle exceptions. You are not going to do any exception publishing in this blog post, but you want to have the methods there so you can add it easily later.
public void Publish(Exception ex, string message) {
Publish(ex, message, null);
}
public void Publish(Exception ex, string message,
NameValueCollection nvc) {
// Update view model properties
Message = message;
// TODO: Publish exception here
}
Add a method named BuildCollection() that calls the PTCData class to retrieve the list of products from the database table.
BuildCollection()
protected void BuildCollection() {
PTCData db = null;
try {
db = new PTCData();
// Get the collection
DataCollection = db.Products.ToList();
}
catch (Exception ex) {
Publish(ex, "Error while loading products.");
}
}
You are going to use the View Model class to handle many requests from your UI. Instead of exposing many different methods from the ProductViewModel class, let's create a single public method named HandleRequest(). For now, you are just going to call the BuildCollection() method from this method. However, later, you are going to add a switch…case statement to handle many different requests.
HandleRequest()
public void HandleRequest() {
BuildCollection();
}
Now that you have the data layer and the view model classes created and ready to return data, you need a controller that can call our HandleRequest() method. Go back to the PTC project and right mouse click on the \Controllers folder. Select Add | Controller… from the menu. Choose the MVC 5 Controller – Empty template and click the Add method as shown in Figure 13.
width="633px" alt="Image 13" data-src="/KB/aspnet/1174826/image13.png" class="lazyload" data-sizes="auto" data->
When prompted to set the Controller name, type in ProductController and click the Add button as shown in Figure 14.
width="633px" alt="Image 14" data-src="/KB/aspnet/1174826/image14.png" class="lazyload" data-sizes="auto" data->
You will now see a controller class in your \Controllers folder that looks like the following.
public class ProductController : Controller
{
// GET: Product
public ActionResult Index() {
return View();
}
}
Add a using statement at the top of this class so you can use the ProductViewModel class in this controller.
using PTC.ViewModelLayer;
Modify the GET method to look like the following code.
public ActionResult Product() {
ProductViewModel vm = new ProductViewModel();
vm.HandleRequest();
return View(vm);
}
Under the \Views folder see if you have a \Product folder already. If you don't, then add one. This folder is generally created when you add a controller called ProductController. Right mouse click on the \Views\Product folder and select the Add | MVC 5 View Page with Layout (Razor) from the menu as shown in Figure 15.
width="632px" alt="Image 15" data-src="/KB/aspnet/1174826/image15.png" class="lazyload" data-sizes="auto" data->
When prompted to set the name for the item, type in Product as shown in Figure 16.
width="490px" alt="Image 16" data-src="/KB/aspnet/1174826/image16.png" class="lazyload" data-sizes="auto" data->
After setting the name you will be prompted to select the shared layout page. Select the \Views\Shared\_Layout.cshtml page as shown in Figure 17.
width="632px" alt="Image 17" data-src="/KB/aspnet/1174826/image17.png" class="lazyload" data-sizes="auto" data->
After the MVC page is added, add two statements as shown below.
@using PTC.ViewModelLayer
@model ProductViewModel
Write the code to display a table of product data. Add the following HTML after the code shown above.
<div class="table-responsive">
<table class="table table-condensed table-bordered
table-striped table-hover">
<thead>
<tr>
<th>Product Name</th>
<th>Introduction Date</th>
<th>Url</th>
<th>Price</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.DataCollection) {
<tr>
<td>@item.ProductName</td>
<td>
@Convert.ToDateTime(item.IntroductionDate)
.ToShortDateString()
</td>
<td>@item.Url</td>
<td>
@Convert.ToDecimal(item.Price).ToString("c")
</td>
</tr>
}
</tbody>
</table>
</div>
Run the page and you should see a page that looks like the following.
width="634px" alt="Image 18" data-src="/KB/aspnet/1174826/image18.png" class="lazyload" data-sizes="auto" data->
In this blog post, you created the start of an MVC application that is going to use a MVVM design pattern. You learned a few reasons why using an MVVM approach is a solid design decision in almost any kind of application. In the next blog post you learn to search for products and break up your single MVC page into a couple of different partial.
|
https://codeproject.freetls.fastly.net/Articles/1174826/Using-MVVM-in-MVC-Applications-Part-4
|
CC-MAIN-2021-49
|
refinedweb
| 2,123
| 58.28
|
Table of Contents
Many APIs are publicly available. All APIs on the RapidAPI platform are publicly available. But there are also so-called internal APIs, which are created and used by developers that need APIs for private applications.
When it comes to web and mobile applications, there is a process to follow in order to determine what API the website uses. In some cases, you can also use the internal API without interacting with the website (i.e. programmatically, by issuing requests directly from the code). In this tutorial, we will demonstrate how to find an API of a website.
How websites use APIs
There are two main ways in which websites use APIs. For the sake of keeping things simple, we’ll call them the backend-tied method and frontend-tied method.
The backend-tied approach is the method where the application makes requests to the API on the server’s side. The pipeline looks like this:
- The user wants to visit a page of the website. He/she uses a browser to send an HTTP request to the server where the site is hosted.
- To provide a response to the user, the server needs to use an API.
- The server sends the request(s) to the API and processes the response of the API. The response to the user is prepared using the response of the API.
- The server sends the prepared response (most often it is the HTML page) to the user.
- The user’s browser renders the response and shows the result to the user.
The key peculiarity of this method is that the user’s browser knows nothing about what is going on on the server’s side (how the response was prepared). This means that we (as users) cannot detect whether any API was used by this site. The exception comes in when the information about used APIs are available on the website, or when t is obvious that the website uses an API (for example, when the website displays information about flight tickets from the Skyscanner).
A vivid example of the backend-tied approach of API usage can be found in our How To Build a Sentiment Analysis App tutorial. The Django web application there sends requests to the API on the server’s side.
Another method is the frontend-tied approach.
Most modern web frameworks use client-side rendering. They send a blank HTML file to the browser along with JavaScript that fills it with data. In this case, it takes data from the internal API. And this is handy for us because if it is done with our browser we can find it. Let’s explore how this works in more detail.
How to see whether a website uses an API
Let’s create a little sandbox to demonstrate how it works. We can use Flask to make a simple internal API which will send only one string of text data. The ‘Access-Control-Allow-Origin’ header is added so we can simply open the HTML file in the browser and make this request from it.
from flask import Flask from flask import jsonify from flask import after_this_request app = Flask(__name__) @app.route('/test_data', methods=['GET']) def get_data(): @after_this_request def add_header(response): response.headers['Access-Control-Allow-Origin'] = '*' return response data = 'An internal API is an interface that enables access to a company’s backend information and application functionality for use by the organization’s developers. The new applications created by these developers can then be distributed publicly although the interface itself is not visible to anyone not working directly with the API publisher.' return jsonify(data) if __name__ == '__main__': app.run(debug=True)
Then we will write an HTML page that will request this string and view it.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Test page</title> </head> <body> <h1>Hello world</h1> <p id="text"></p> <script> const text_el = document.getElementById('text') const url = '' fetch(url) .then((resp) => resp.json()) .then(function(data) { text_el.innerHTML = data }) </script> </body> </html>
If we open this page in the browser and view the page source code we will not see the data and this is typical for a frontend-tied approach using the API. If it was not a test page, we wouldn’t see the script either.
Let’s go back to our page in the browser and open the Developer Tools.
Now we need to open the Network tab and choose the XHR filter. XHR refers to the XMLHttpRequest which is the JavaScript object that is used to retrieve data from a server. (We actually use the fetch() request but it’s almost the same.) In some cases, we’ll need to repeat an action or refresh the page to see requests here. With real sites, there could also be a lot of requests. We need to choose the ones that look similar to what we expect to find.
If we click on a request we’ll see the full URL, the HTTP method, and any other necessary information. With our page, we see the “” address and the GET method.
Now we can open the Response tab and suppose that the data is what we are looking for.
All that we still need to do is to simply make a similar request programmatically and check if we get the same answer.
Test your hypothesis from Python code
Python has a Requests library that is ideal for this purpose. For our example, the code will look pretty simple.
import requests url = '' response = requests.get(url) print(response.text)
Here is what the code above returns:
"An internal API is an interface that enables access to a companyu2019s backend information and application functionality for use by the organizationu2019s developers. The new applications created by these developers can then be distributed publicly although the interface itself is not visible to anyone not working directly with the API publisher."
But Requests itself has a lot more options. Any other HTTP method can be used with requests the same way as the GET method. We may also add data to the request body.
In most cases, we’ll get our response in JSON or XML format, so we’ll need to make some transformations or parsing.
Conclusion
There are two ways in which websites can use APIs. If we can see the data on the page but can’t find it in the page source, that’s okay. Finding an API with browser tools is not that complicated. Working with it may be easier than writing parsers for the HTML.
But if we can’t see requests from the browser it does not mean that the site doesn’t use API. If it sends server-side requests we may have trouble finding out which API a website uses.
|
https://rapidapi.com/blog/how-to-find-the-api-of-a-website/
|
CC-MAIN-2020-34
|
refinedweb
| 1,136
| 63.8
|
Today: modules, how the internet works
The pylibs.py example file begins..
#!/usr/bin/env python3 """ Stanford CS106A Pylibs Example Nick Parlante """ import sys import random def read_terms(filename): ...
#!/usr/bin/env python3
#!/usr/bin/env python3
#!/usr/bin/python
import sys
Modules hold code for common problems, ready for your code to use. We say that you build your code "on top of" the libraries. Modern coding is part custom, and part building on top of module code.
import math
import mathline
math.sqrt(2)
math.sqrt(2)
random.randrange(10)
import math .. math.sqrt()
>>> import math >>> math.sqrt(2) # call sqrt() fn 1.4142135623730951 >>> math.sqrt
>>> >>> math.log(10) 2.302585092994046 >>> math.pi # constants in module too 3.141592653589793
Quit and restart the interpreter without the import, see common error:
>>> # quit and restart interpreter >>> math.sqrt(2) # OOPS forgot the import Traceback (most recent call last): NameError: name 'math' is not defined >>> >>> import math >>> math.sqrt(2) # now it works 1.4142135623730951
Other modules are valuable but they are not a standard part of Python. For code using non-standard module to work, the module must be installed on that computer via the "pip" Python tool. e.g. for homeworks we had you pip-install the "Pillow" module with this command:
$ python3 -m pip install Pillow ..prints stuff... Successfully installed Pillow-5.4.1
A non-standard module can be great, although the risk is harder to measure. The history thus far is that popular modules continue to be maintained. Sometimes the maintenance is picked up by a different group than the original module author.
When you install a module on your machine from somewhere - you are trusting that code to run on your machine. In very rare cases, bad guys have tampered with modules to include malware in the module. Be more careful if installing a little used module. In contrast, python itself or standard modules like urllib are very safe as so many people use them.
dir(module)- shows a list of all the defs in the module
help(module.fn)- shows some help text for that function
>>> import math >>> dir(math) ['__doc__', '__file__', '_', 'remainder', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'tau', 'trunc'] >>> >>> help(math.sqrt) Help on built-in function sqrt in module math: sqrt(x, /) Return the square root of x. >>> >>> help(math.cos) Help on built-in function cos in module math: cos(x, /) Return the cosine of x (measured in radians).
You already have! A regular old foo.py file is a module.
How hard is it to write a module? Not hard at all. A regular Python file we have written works as a module too with whatever defs the foo.py file has.
Consider the file wordcount.py in wordcount.zip
Forms a module named wordcount
Try this demo in the wordcount directory
>>> # Run interpreter in wordcount directory >>> import wordcount >>> >>> wordcount.read_counts('test1.txt') {'a': 2, 'b': 2}
>>> dir(wordcount) ['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'clean', 'main', 'print_counts', 'print_top', 'read_counts', 'sys'] >>> >>> help(wordcount.read_counts) Help on function read_counts in module wordcount. The text here comes from the """Pydoc""" you write at the top of a function. read_counts(filename) Given filename, reads its text, splits it into words. Returns a "counts" dict where each word ...
# 1. In the babygraphics.py file # import the babynames.py file in same directory import babynames ... # 2. Call the read_files() function names = babynames.read_files(FILENAMES)
Here is the HTML code for is plain text with a bolded word in it, tags like
<b> mark up the text.
This <b>bolded</b> textHTML Experiment - View Source
Go to python.org. Try view-source command on this page (right click on page). Search for a word in the page text, such as "whether" .. to find that text in the HTML code.
Thing of how many web pages you have looked at - this is the code behind those pages. It's a text format! Lines of unicode chars!
>>> import urllib.request >>> f = urllib.request.urlopen('') >>> text = f.read().decode('utf-8') >>> text.find('Whether') 26997 >>> text[26997:27100] "Whether you're new to programming or an experienced developer, it's easy to learn and use Python.\r\n"
# without >>>, for copy/paste import urllib.request f = urllib.request.urlopen('') text = f.read().decode('utf-8')
Now does the Internet work? I pulled these slides together I had laying around from another class. Neat to see how something you use every day works.
TCP/IP blooper in this video of "The Net"...
video
Blooper: in the video the IP address is shown as 75.748.86.91 - not a valid IP address! Each number should be 1 byte, 0..255
The most common way for a computer to be "on the internet" is to establish a connection with a "router" which is already on the internet. The computer establishes a connection via, say, wifi to communicate packets with the router. The router is "upstream" of the computer, connecting the computer to the whole internet.
The packet is passed from router to router - called a "hop". There might be 10 or 20 hops in a typical internet connection.
The routing of a packet from your computer is like a capillary/artery system .. your computer is down at the capillary level, your packet gets forwarded up to larger and larger arteries, makes its way over to the right area, and then down to smaller and smaller capillaries again, finally arriving at its destination.
So what does it mean for a computer to be on the internet? Typically it means the computer has established a connection with a router. The commonly used DHCP standard (Dynamic Host Configuration Protocol), facilitates connecting to a router; establishing a temporary connection, and the router gives your computer an IP address to use temporarily. Typically DHCP is used when you connect to a Wi-Fi access point.
Bring up the networking control panel of your computer. It should show what IP address you are currently using and the IP address of your router. You will probably see some text mentioning that DHCP is being used. Your computer will likely have a local IP address, just used while you're in this room.
"Ping" is an old and very simple internet utility. Your computer sends a "ping" packet to any computer on the internet, and the computer responds with a "ping" reply (not all computers respond to ping). In this way, you can check if the other computer is functioning and if the network path between you and it works. As a verb, "ping" is also used in regular English this way .. not sure if that's from the internet or the other way around.
Experiment: Most computers have a ping utility, or you can try "ping" on the command line (works on the Mac, Windows, and Linux). Try pinging or pippy.stanford.edu. Not all computers respond to ping. Type ctrl-c to terminate ping.
Milliseconds fraction of a second used for the packet to go and come back. 1 ms = 1/1000 of a second. Different from bandwidth, this "round trip delay".
Here I run the "ping" program for a few addresses, see what it reports
$ ping # I type in a command here PING (74.125.224.144): 56 data bytes 64 bytes from 74.125.224.144: icmp_seq=0 ttl=53 time=8.219 ms 64 bytes from 74.125.224.144: icmp_seq=1 ttl=53 time=5.657 ms 64 bytes from 74.125.224.144: icmp_seq=2 ttl=53 time=5.825 ms ^C # Type ctrl-C to exit --- ping statistics --- 3 packets transmitted, 3 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 5.657/6.567/8.219/1.170 ms $ ping pippy.stanford.edu PING pippy.stanford.edu (171.64.64.28): 56 data bytes 64 bytes from 171.64.64.28: icmp_seq=0 ttl=64 time=0.686 ms 64 bytes from 171.64.64.28: icmp_seq=1 ttl=64 time=0.640 ms 64 bytes from 171.64.64.28: icmp_seq=2 ttl=64 time=0.445 ms 64 bytes from 171.64.64.28: icmp_seq=3 ttl=64 time=0.498 ms ^C --- pippy.stanford.edu ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.445/0.567/0.686/0.099 ms
Traceroute is a program that will attempt to identify all the routers in between you and some other computer out on the internet - demonstrating the hop-hop-hop quality of the internet. Most computers have some sort of "traceroute" utility available if you want to try it yourself (not required). On Windows it's called "tracert" in Windows Power Shell, and it does not suppor the "-q 1" option below, but otherwise works fine.
Some routers are visible to traceroute and some not, so it does not provide completely reliable output. However, it is a neat reflection of the hop-hop-hop quality of the internet.
codingbat.com is housed in the east bay - 13 hops we see here. The milliseconds listed is the round-trip delay.
$ traceroute -q 1 codingbat.com traceroute to codingbat.com (173.255.219.70), 64 hops max, 52 byte packets 1 rt-ac68u-b3f0 (192.168.1.1) 7.152 ms 2 96.120.89.177 (96.120.89.177) 9.316 ms 3 24.124.159.189 (24.124.159.189) 9.638 ms 4 be-232-rar01.santaclara.ca.sfba.comcast.net (162.151.78.253) 9.775 ms 5 be-39931-cs03.sunnyvale.ca.ibone.comcast.net (96.110.41.121) 31.753 ms 6 be-3202-pe02.529bryant.ca.ibone.comcast.net (96.110.41.214) 10.273 ms 7 ix-xe-0-1-1-0.tcore1.pdi-paloalto.as6453.net (66.198.127.33) 10.570 ms 8 if-ae-2-2.tcore2.pdi-paloalto.as6453.net (66.198.127.2) 11.344 ms 9 if-ae-5-2.tcore2.sqn-sanjose.as6453.net (64.86.21.1) 13.555 ms 10 if-ae-1-2.tcore1.sqn-sanjose.as6453.net (63.243.205.1) 11.583 ms 11 216.6.33.114 (216.6.33.114) 11.938 ms 12 if-2-4.csw6-fnc1.linode.com (173.230.159.87) 14.833 ms 13 li229-70.members.linode.com (173.255.219.70) 11.549 ms
A random Serbian address - 31 hops - the farthest thing I could fine. See the extra delay where the packets go across the Atlantic - I'm guessing hop 16. The names there may refer to Amsterdam and France. Note that the packets are going at a fraction of the speed of light here - a fundamental limit of how quickly you can get a packet across the earth.
$ traceroute -q 1 yujor.fon.bg.ac.rs traceroute to hostweb.fon.bg.ac.rs (147.91.128.13), 64 hops max, 52 byte packets 1 rt-ac68u-b3f0 (192.168.1.1) 9.136 ms 2 96.120.89.177 (96.120.89.177) 9.608 ms 3 24.124.159.189 (24.124.159.189) 20.184 ms 4 be-232-rar01.santaclara.ca.sfba.comcast.net (162.151.78.253) 15.058 ms 5 be-39911-cs01.sunnyvale.ca.ibone.comcast.net (96.110.41.113) 11.050 ms 6 be-3411-pe11.529bryant.ca.ibone.comcast.net (96.110.33.94) 11.294 ms 7 be3111.ccr31.sjc04.atlas.cogentco.com (154.54.11.5) 10.420 ms 8 be2379.ccr21.sfo01.atlas.cogentco.com (154.54.42.157) 20.021 ms 9 be3110.ccr32.slc01.atlas.cogentco.com (154.54.44.142) 37.200 ms 10 be3037.ccr21.den01.atlas.cogentco.com (154.54.41.146) 36.318 ms 11 be3035.ccr21.mci01.atlas.cogentco.com (154.54.5.90) 49.991 ms 12 be2831.ccr41.ord01.atlas.cogentco.com (154.54.42.166) 66.591 ms 13 be2718.ccr22.cle04.atlas.cogentco.com (154.54.7.130) 67.178 ms 14 be2993.ccr31.yyz02.atlas.cogentco.com (154.54.31.226) 77.369 ms 15 be3260.ccr22.ymq01.atlas.cogentco.com (154.54.42.90) 86.026 ms 16 be3042.ccr21.lpl01.atlas.cogentco.com (154.54.44.161) 152.559 ms 17 be2183.ccr42.ams03.atlas.cogentco.com (154.54.58.70) 161.324 ms 18 be2813.ccr41.fra03.atlas.cogentco.com (130.117.0.122) 164.945 ms 19 be2960.ccr22.muc03.atlas.cogentco.com (154.54.36.254) 172.507 ms 20 be2974.ccr51.vie01.atlas.cogentco.com (154.54.58.6) 197.670 ms 21 be3463.ccr22.bts01.atlas.cogentco.com (154.54.59.186) 181.075 ms 22 be3261.ccr31.bud01.atlas.cogentco.com (130.117.3.138) 184.336 ms 23 be2246.rcr51.b020664-1.bud01.atlas.cogentco.com (130.117.1.14) 189.231 ms 24 149.6.182.114 (149.6.182.114) 182.364 ms 25 amres-ias-amres-gw.bud.hu.geant.net (83.97.88.6) 191.607 ms 26 amres-mpls-core----amres-ip-core-amres-ip.amres.ac.rs (147.91.5.144) 187.181 ms 27 * 28 stanica-134-241.fon.bg.ac.rs (147.91.134.241) 204.945 ms 29 stanica-134-250.fon.bg.ac.rs (147.91.134.250) 192.673 ms 30 stanica-134-250.fon.bg.ac.rs (147.91.134.250) 193.978 ms 31 stanica-134-250.fon.bg.ac.rs (147.91.134.250) 193.032 ms !Z
|
http://web.stanford.edu/class/cs106a/handouts_w2021/lecture-24.html
|
CC-MAIN-2022-05
|
refinedweb
| 2,263
| 70.5
|
Hello Everyone
I want to switch my career in Data Science and have been learning Machine Learning since last two weeks. I want to learn optimization technique and applying the BFGS algorithm on some data to get optimize value of theta in linear regression.
When I'm running my code in python, it gives the following error:
> derphi0 = np.dot(gfk, pk)
> ValueError: shapes (3,47) and (3,47) not aligned: 47 (dim 1) != 3 (dim0)
Any help will be appreciated.
Following is my python code for the same:
import numpy as np
from scipy.optimize import minimize
import matplotlib.pyplot as plt
filename='ex1data2.txt'
data = np.loadtxt(filename, delimiter=',')
X=data[:,0:2]; y=data[:,-1]
m=len(y)
X1=X.reshape((m, 2))
y1=y.reshape((m, 1))
X_norm = np.copy(X1)
mu = np.zeros((1, len(X1[1,:])))
sigma = np.zeros((1, len(X1[1,:])))
mu = np.mean(X_norm,axis=0)
mu=np.array(mu)
sigma = np.std(X_norm,axis=0)
sigma=np.array(sigma)
for iter in range(0,(len(X1[1,:]))):
X_norm[:,iter] = (X1[:,iter] - mu[iter])/sigma[iter]
X=np.concatenate([np.ones((m,1)), X_norm], axis=1)
theta0=np.zeros((3,1))
def cost(theta):
h=(np.dot(X,theta)-y1)**2
return (h.sum(axis=0))/(2*m);
def gradient(theta):
h1=np.dot(X,theta)-y1
grad=(np.dot(X.T,h1))/m
return grad;
thetaopt = minimize(cost, theta0, method='BFGS', jac=gradient,options={'disp': True,'maxiter':400})
print(thetaopt)
I also, have attached the data set that I'm using in my code.
Any kind of help will be appreciated.
Thanks
Views: 406
<![if !IE]>▶<![endif]> Reply to This
I don't understand what you are doing because I am new to these techniques, but I am a python programmer.
lets us solve line by line- Below is some part of your code(I did some changes to your script I believe some of your lines are redundant). your "for" loop wont work because "mu" and "sigma" are of size 2 where as "iter" will go up to 46
import numpy as np
from scipy.optimize import minimize
import matplotlib.pyplot as plt
filename='ex1data2.txt'
data = np.loadtxt(filename, delimiter=',')
X=data[:,0:2]; Y=data[:,-1]
X_norm = np.copy(X)
mu = np.mean(X_norm,axis=0) #column wise
sigma = np.std(X_norm,axis=0)#column wise
for iter in range(0,(len(X))):
X_norm[:,iter] = (X[:,iter] - mu[iter])/sigma[iter]
<![if !IE]>▶<![endif]> Reply
<![if !IE]>▶<![endif]> Reply to Discussion
© 2018 Data Science Central ®
Badges | Report an Issue | Privacy Policy | Terms of Service
|
https://www.datasciencecentral.com/forum/topics/multi-variable-linear-regression-optimize-theta-by-using-bfgs?page=1&commentId=6448529%3AComment%3A745205&x=1
|
CC-MAIN-2018-34
|
refinedweb
| 437
| 62.75
|
Well done! The app now displays a list of tags from the database.
Instructions
Let’s add another action to display a specific tag. Looking at the seven standard controller actions, we need to use the
show action. Let’s set it up now.
First in the routes file, add this route:
get '/tags/:id' => 'tags#show', as: :tag
Here we use
as: to name this route “tag”.
Then in the Tags controller, add the
show action:
def show @tag = Tag.find(params[:id]) @destinations = @tag.destinations end
In app/views/tags/show.html.erb inside the
<h2> element, display a tag’s title.
Then in
<div class="cards">...</div>, iterate through each destination in the
@destinations array and display its image, name, and description.
Finally in app/views/tags/index.html.erb within the
<% @tags.each do |t| %>...<% end %> block, add this link:
<%= link_to "Learn more", tag_path(t) %>
By giving the route in step 1 the name “tag”, Rails automatically creates a helper method named
tag_path. We use
tag_path(t) here to generate the URL to a specific tag’s path, for example
/tag/1.
Visit in the browser. Click on a ‘Learn more’ to see all destinations under that tag.
|
https://www.codecademy.com/courses/learn-rails/lessons/one-many/exercises/one-many-show-tag
|
CC-MAIN-2021-39
|
refinedweb
| 202
| 69.99
|
Import Buyer
Jobs - Fashion & Clothing Industry Import
Buyer Job Description
Import Buyer
Find Jobs as an
Import Buyer
Do you really like to travel? As in up and go every
week kind of travel? If you are ready and willing to travel the world
mainly the Far East and Europe then a career as an import buyer might be
for you. You really could be called upon to travel virtually anywhere in
the world. Buyers in every department of a company in the fashion and
textile industries may need the import buyer to assist them with purchasing
and sourcing trips all over the globe. There is no purchasing job listed in
the Apparel Search directory that might not need the assistance of the
import buyer at some point.
You must have a background in imports in either retail
or manufacturing to successfully fill this position. Experience in one of
those environments is a non-negotiable requirement for this job. A minimum
of three years, and closer to five years, of experience in a senior import
purchasing or merchandising role, (i.e. a decision-making role) is not an
uncommon requirement for stepping into a position such as this one.
Experience handling the accounts of major retailers is also pretty much
mandatory. You simply can not become an import buyer without a high level
of experience in working with global sources/manufacturers.
Because you will be communicating and negotiating
across boundaries of physical distance and cultural differences, your
communication skills must be razor sharp. You will support other buyers in
their negotiations with overseas contacts for each department's direct
sourcing needs. In your role as liaison between buying teams and factories,
you will ensure the proper ordering and timely delivery of all products.
You will help to ensure that all orders are delivered in full.
Senior buyers will be able to direct source new
products that are never-before-seen in your target market with your
guidance. By directing senior buyers to global suppliers, you will enable
your company to make exciting additions to its product range within each
product category. As innovative new products are added, your selections
will lead to an expanded customer base if they are in line with the trends
you have spent hours working with marketing and sales teams and comparison
shopping your little importing heart out to predict. Your suggestions are
made with an eye to both the internal customers (stores) and the external
customers (consumers) needs, and to internal sales team goals.
Senior import purchasing agents usually have quite a
hand in in-house production as well. You will present ideas and concepts
gathered in your travels to buyers at concept meetings. Your ideas may need
to be followed from concept through to production. In which case, you will
not only be offering your assistance to other senior buyers in sourcing and
selection, but also acting as a liaison with foreign manufacturers.
You will communicate with factories, buyers, sales
representatives, and customers on a daily basis, to make sure that the
process is flowing smoothly from beginning to end not least of all that
orders are completed in full, up to standards, and on schedule.
In short, only your organizational skills and trendy
clairvoyance will outshine your communication abilities in an import buyer
position. For those who are interested in a position in the
fashion and textile industry that have the freedom to commit to frequent
travel, it will be difficult to find a job that fits the bill more than
that of an import buyer.
Find Jobs as an
Import Buyer.
Learn more about
Fashion Industry Buyers.
|
https://www.apparelsearch.com/employment/job_descriptions/jobs/cat/buying/i/import_buyer.htm
|
CC-MAIN-2019-09
|
refinedweb
| 605
| 50.57
|
We needed an advanced search system in the recent project. This system included many filters that required a flexible and scalable search system.
I decided to implement a package for this system that you can see it in the GitHub and use it in your project.
What's the problem?
The problem is that you will encounter with a set of filters that you must check for a lot of conditions to add to the query.
Writing a lot of terms will surely reduce the readability of your code and slow down the development process.
Also, you can only use the filters and terms in the same scope and they will not be reusable.
But the Solution
You must Refactor your code!
To solve this problem, you need to Refactor your code by replacing many of your conditionals with Polymorphism.
Practical Example:
Suppose we want to get the list of the users with the requested parameters as follows:
The Requested parameter will be as follows:
[ 'age_more_than' => '25', 'gender' => 'male', 'has_published_post' => 'true', ]
In a common implementation, following code will be expected:
We check out a condition for each request parameter.
In the future, we will have more parameters that should be checked and applied in the code above that causes us to have a dirty code.
Use the Eloquent-Builder
After installing the package presented,change your code as follows:
You just send the model and parameters to ‘to’ method.Then, you need to define the filter for each parameter that you want to add to the query.
So easy!
Defining a filter
For example, I’ll implement one of the above example filters. Follow the example below:
For more details check out the GitHub repository.
mohammad-fouladgar
/
eloquent-builder
This package provides an advanced filter for Laravel or Lumen model based on incoming requets.
Provides a Eloquent query builder for Laravel or Lumen
This package allows you to build eloquent queries, based on request parameters It greatly reduces the complexity of the queries and conditions, which will make your code clean and maintainable.
Basic Usage
Suppose you want to get the list of the users with the requested parameters as follows:
//Get api/user/search?age_more_than=25&gender=male&has_published_post=true [ 'age_more_than' => '25' 'gender' => 'male' 'has_published_post' => 'true', ]
In a common implementation, following code will be expected:
<?php namespace App\Http\Controllers; use App\User; use Illuminate\Http\Request; class UserController extends Controller { public function index(Request $request) { $users = User::where('is_active', true); if ($request->has('age_more_than')) { $users->where('age', '>', $request->age_more_than…
Good luck and thank you for sharing your valuable time with me.
Happy Coding!
Discussion (11)
Hi,
First of all thanks for your easy and great solution.
I found many solutions for eloquent search filters, but this is discrete :).
I felt that relational object filters were not discussed.
So here is my code for eloquent relational search, hope it will also help some one.
For relational object follow these steps:
I have two tables Profiles and Leads.
Each Profile has some Leads against it.
This is my coding style, please change this according to your code ethics.
// @$Profile is the instance of collection in my Controller function
$Profiles = $this->Profiles;
$Profiles= $this->ApplyFilters($Request, $Profiles)->get();
// Apply Filters to relational models
private function ApplyFilrers($Request, $Profiles){
foreach(request()->all() as $Key=>$Value){
// if($Key == “Category”){
$Profiles = $Profiles->whereHas(‘Leads’, function($Profile) use($Key, $Value){
// I have a CategoryFilter in my EloquentFilters\Leads
$Profile = EloquentBuilder::to($Profile, [ $Key=>$Value]);
});
//}
}
return $Profiles;
}
Thanks you for your kind words ;)
It was an interesting example.
Thank you for sharing.
Also if you want to implement a filter for a columns against multiple values.
For example following is the array you mentioned in example, but with gender filter as an array.
[
'age_more_than' => '25',
'gender' => ['male','female','custom']
'has_published_post' => 'true',
]
class GenderFilter extends Filter
{
}
Nice.
Type of the value parameter is mixed and you can set it to any value based on your requirement.
Thanks Dear @Farrukh
Thanks for your appreciation.
Hi,
Can we do sorting for eloquent relations?
Yes,you can.
EloquentBuilder return an instance of Builder:
Thanks a lot for your reply.
I did not try it yet. Hope it will work as I wish.
Regards
Hi,
I used laravel debugger, when I used Eloquent Builder it shows me a (lot) number of queries.
is it normal or there is some method to reduce that
Regards
Farrukh
Hi,
The EloquentBuilder reduces the complexity of the queries and conditions of the code.Number of queries is not related to it.
Good luck
Thanks a lot dear
Nice work man. You made a typo. According to the docs on GitHub github.com/mohammad-fouladgar/eloq...,
class AgeMoreThanFilter should extend Filter and not implement Filter
And EloquentBuilder::to() method should not be called statically. Am sure the package has been updated.
Thanks Bill, Yes The package has been updated.
Please read this article : dev.to/mohammadfouladgar/laravel-m...
thank you for your great solution
You're welcome. Good luck...
Nice post. Btw your before and after example is the same, took me sometimes to realize this.
Edit : After sign in, the post display correct before and after, maybe a bug
Thanks!
I hope useful for you.
Maybe...,i don't know
Nice post! And how about this?
github.com/spatie/laravel-query-bu...
Thanks so much.
That package is also good.
My goal is to use it more easily and avoid any complexity too.
Also, for the better development of the source, used from design patterns such as the factory method and other concepts of OOP.
Seriously? Imagine if you have 15-20 filters, you will repeat the queries with if loop 20 times?
I think it's better than using complex terms. In this way we have better management of each filter.
Also, We observation to the single responsibility principle.
if you have a better way, please suggest. thanks a lot for your notice.
You can build the query with normal mysql syntax, then if you use a form, give the form name of the database field that you want to compare, and the value of the form input is the value you want to search for example 3, or some name. Then when the value returned is null, you normally don't take the field into the sql string. Its just some formatting you have to use in the controller, and its all automated, if the main purpose is directory listing or similar stuff
I suggest using the package once.
The query goes to the database only once.
I think the legacy code block isn't what is intended. Cool idea with the filter though. Nice article.
@bpedroza Thank you for your noticing.
This block updated in GitHub repository.
thanks a lot, very useful post. 💖
You are welcome, Thank you 👍
Nice post!
Can we combine two or more filter classes to single one.
If some filters have be a single responsibility you can manage them in a single filter class.Otherwise, you should define a filter-class for each filter argument.
|
https://practicaldev-herokuapp-com.global.ssl.fastly.net/mohammadfouladgar/making-the-advanced-search-query-with-eloquent-builder-in-laravel-30g3
|
CC-MAIN-2021-31
|
refinedweb
| 1,177
| 65.32
|
Introduction To Relaxed Node Types
What are relaxed node types?
A node type is a JCR concept that relates to the structure of the repository. Node types define what a node of that type may or must contain in terms of properties and child nodes. For instance a node type can be defined that stipulates that a property called 'expires' of type date is mandatory for that type of node. In other words node type definitions or CNDs are the equivalent of schema definitions in XML and table definitions in a RDBMS database.
It is possible to relax the structural requirements you put on a node by using wildcards in your node type definitions. For instance you can say that a node can have any number of properties of type boolean, that you can name those properties whatever you like, and that they can be either multi-valued or single-valued. In CND notation this would look like this:
- * (boolean) - * (boolean) multiple
This then is what is referred to as relaxing the node type.
Why should I care?
In Bloomreach Experience Manager, whenever you create a new document type using the document type editor, a corresponding CND is generated that defines what the nodes that represent documents of that type in the repository should look like. Before Bloomreach Experience Manager release 7.6 the CND that was generated used strict typing. Corresponding property definitions were declared only on fields that were explicitly added. Adding a field called 'expires' of type date resulted in the CND having the following entry:
- expires (date)
From Bloomreach Experience Manager 7.6 onwards this is no longer the case. All document types you create using the document type editor have a very simple corresponding CND. This is because the node type of that document type inherits from a node type that defines all possible combinations of properties that you might need for your custom type. Therefore this CND no longer needs to be customized. Nor changed when you change the document type for that matter. And this is where the real added value of relaxed types comes in.
Remember that previously when you changed a document type you had to walk through all the documents of that type that were in the repository to add/remove/change the fields that were added/removed/changed in the type definition. This is what happened when you clicked 'update all content'. This in itself could be a very heavy operation depending on the amount of documents of that type that were in the repository. But not only that. To make it possible to change a type a rather complicated operation was needed because an entirely new namespace had to be introduced and the document type had to be moved to that new namespace. This in turn made the upgrade process more complicated.
With the introduction of relaxed node types changing the document type is a lot less involved than it was before. CNDs do not need to be updated and so no new namespaces need to be introduced. Also there is no longer the need to traverse all the documents of a type in order to update their contents to reflect the new type. The 'update all content' button has therefore been removed. This means that removing a field from the document type does not result in that field being deleted from the corresponding documents any more. The field is still there, just not visible anymore to an editor editing that document.
The latter is actually something you should be aware of when editing a document type. Re-adding a previously removed field will result in that field again being visible in the editor. However adding a field of the same name as a previously deleted field without that field being of the same type as before will wreak havoc on the CMS. This is a scenario that is definitely not supported and you are on your own if you attempt to do this.
Note that the relaxation of types only refers to the document data itself, meta-data related to workflow, taxonomy, tagging, etc. that is stored along with the document are still strictly typed.
If after changing the document type you want to clean up your documents, you are advised to write and run an updater script to do that.
When not to use relaxed types
There are situations in which you would prefer to use strict typing instead. For instance if your documents are to be accessed and managed by code that is not under your own control, then type safety is an issue you should consider. Strict typing allows you to enforce the correct usage of your repository in this scenario. However, if the code that uses the repository is entirely under your own control then using relaxed typing gives you far more flexibility. The important thing to remember is that with relaxed types the responsibility for maintaining the structure of the repository has been moved from the repository itself to the code that accesses the repository.
So strict typing is still an option if your use case requires it. However, you won't be able to use the document type editor to manage your types anymore, and you must fall back to managing them manually.
|
https://documentation.bloomreach.com/12/library/concepts/document-types/introduction-to-relaxed-node-types.html
|
CC-MAIN-2021-04
|
refinedweb
| 882
| 60.75
|
The title basically says it all, but I am specifically interested to know if the following (slightly abusive) macro should be expected to work (with C99 or greater), that is, that it will return a pointer to a valid section of stack allocated memory based on the size of the expression:
#include <stdint.h>
#define NASTY(expr) ( \
8 == sizeof(expr) ? (void *)(&(uint64_t){(expr)}) : \
( \
4 == sizeof(expr) ? (void *)(&(uint32_t){(expr)}) : \
( \
2 == sizeof(expr) ? (void *)(&(uint16_t){(expr)}) : (void *)(&(uint8_t){(expr)}) \
) \
) \
)
memcpy
x*y+z
I don't know what you mean by "a new scope" - in C, "scope" is relevant only to identifiers, not object lifetime. Per 6.5.2.5 Compound literals,
If the compound literal occurs outside the body of a function, the object has static storage duration; otherwise, it has automatic storage duration associated with the enclosing block.
Thus, if you use this macro inside a function body, the lifetime of the pointed-to object will persist until execution of the enclosing block ends. This might or might not meet your needs; you could get in trouble by writing:
if (foo) { p = NASTY(bar); } /* ... */ /* Do something with p */
|
https://codedump.io/share/rNnd3tWp4jMF/1/does-c39s-ternary-conditional-operator-create-a-new-scope
|
CC-MAIN-2017-34
|
refinedweb
| 189
| 52.09
|
/* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Tony Nardo of the Johns Hopkins University/Applied Physics.h 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/finger/finger.h,v 1.5 2004/03/14 06:43:34 jmallett Exp $ */ #ifndef _FINGER_H_ #define _FINGER_H_ typedef struct person { uid_t uid; /* user id */ char *dir; /* user's home directory */ char *homephone; /* pointer to home phone no. */ char *name; /* login name */ char *office; /* pointer to office name */ char *officephone; /* pointer to office phone no. */ char *realname; /* pointer to full name */ char *shell; /* user's shell */ time_t mailread; /* last time mail was read */ time_t mailrecv; /* last time mail was received */ struct where *whead, *wtail; /* list of where user is or has been */ } PERSON; enum status { LASTLOG, LOGGEDIN }; typedef struct where { struct where *next; /* next place user is or has been */ enum status info; /* type/status of request */ short writable; /* tty is writable */ time_t loginat; /* time of (last) login */ time_t idletime; /* how long idle (if logged in) */ char tty[_UTX_LINESIZE+1]; /* null terminated tty line */ char host[_UTX_HOSTSIZE+1]; /* null terminated remote host name */ } WHERE; #define UNPRIV_NAME "nobody" /* Preferred privilege level */ #define UNPRIV_UGID 32767 /* Default uid and gid */ #define OUTPUT_MAX 100000 /* Do not keep listinging forever */ #define TIME_LIMIT 360 /* Do not keep listinging forever */ #define UT_NAMESIZE 8 /* old utmp.h value */ #include "extern.h" #endif /* !_FINGER_H_ */
|
http://opensource.apple.com/source/adv_cmds/adv_cmds-138.1/finger/finger.h
|
CC-MAIN-2015-48
|
refinedweb
| 239
| 52.73
|
Check in which channel a given shader is in
On 02/11/2015 at 10:51, xxxxxxxx wrote:
Hi everyone, I've made a little script to "search" the name or type of a shader among all materials and so far is working, I get the number of occurrences and in which material they are. So far so good, BUT...what if I want to know also in which channel?
Here's the code:
import c4d, os from c4d import gui def shadertree(shader,parola,nome) : # Loop through the BaseList k = 0 while(shader) : if str.lower(parola) in str.lower(shader.GetName()) or parola in str.lower(shader.GetTypeName()) : k = k+1 # Check for child shaders & recurse if shader.GetDown() : shadertree(shader.GetDown(),parola,nome) # Get the Next Shader shader = shader.GetNext() return k def main() : parola = gui.InputDialog('Search') if not parola : return mat = doc.GetFirstMaterial() nome = mat.GetName() n = 0 while(mat) : shd = mat.GetFirstShader() if shadertree(shd,parola,nome) > 0: print "Found "+str(shadertree(shd,parola,nome)) + " occurrences of '"+parola+"' in material: "+str(mat.GetName()) n=n+1 # Get the Next material mat = mat.GetNext() if n == 0: print "Not Found" if __name__=='__main__': main()
On 03/11/2015 at 07:06, xxxxxxxx wrote:
Hi,
actually the channels of standard materials are a historically grown internal construct. You probably already noticed, that there's no equivalent for BaseChannel in the Python SDK.
Furthermore you have to be aware, that channels exist only for standard materials (type c4d.Mmaterial), there are lots of other materials, that don't have the concept of channels (like Sketch and Toon, Hair and all those special materials like Banzi, Cheen,...).
For standard materials you can get the shader of each channel by accessing the material directly (mat[c4d.MATERIAL_COLOR_SHADER] for example). A list of these IDs can be found in the C++ docs or of course you can simply drag the texture parameter of each channel to the console.
And a last thought: There are also objects that make use of shaders (like for example the Displacement Deformer), so you may want to consider iterating these as well.
On 03/11/2015 at 09:54, xxxxxxxx wrote:
Thanks Andreas, that make sense I guess.
I'm trying to think to a workaround, maybe iterating through all attributes of a material, check if they are texture slots and something is loaded in? Just thinking out loud :)
thanks again
|
https://plugincafe.maxon.net/topic/9181/12192_check-in-which-channel-a-given-shader-is-in/2
|
CC-MAIN-2020-10
|
refinedweb
| 406
| 65.73
|
Hi all,
I recently found myself writing lots of text-based game-type stuff, some of it MUD-like, and some intended to be played with a custom client. Either way, I found myself re-using a lot of the same code, so I made me a package!
The package is creatively called gsb (Game Server Base), and it's reminiscent of Flask or Klein.
There's a more complete example in the repo's examples folder, but here's a basic idea:
from gsb import Server # like flask.Flask. s = Server() # This holds commands ETC. @s.command('^quit$') def do_quit(caller): """Disconnect from the game.""" s.disconnect(caller.connection) s.run()
This will run a very minimalist game on port 4000.
Clearly it's not very interesting having only one command, but you can create as many as you like, making yourself a fully-functioning MUD-type server, or (I used it for) an RTS-type thingy. I was using Telnet to test, so I thought I may as well make it MUD like.
Anyways, there's full documentation (for once). If anyone's got any suggestions or whatever, please let me know either by email or Github or something.
To install with pip do:
pip install git+
Happy hacking.
Chris Norman
Selling my soul to andertons.co.uk since 2012.
|
http://forum.audiogames.net/viewtopic.php?id=21844
|
CC-MAIN-2018-05
|
refinedweb
| 222
| 74.08
|
Thank you for Posting
sap partner companies in bangalore
sap implementation companies in bangalore
sap partners in india
aws staffing
Hi There,
I love all the posts, I really enjoyed.
I would like more information about this, because it is very nice., Thanks for sharing.
i wrote a function two different ways. can someone tell me which is better and why?
Python Code: (Double-click to select all)
1
2
3
4
5
6
7
8
9 def pathftn(p,unknown='?'):
if p.is_symlink: return 'l'
if p.is_block_device: return 'b'
if p.is_char_device: return 'c'
if p.is_dir: return 'd'
if p.is_file: return 'f'
if p.is_socket: return 's'
if p.is_fifo: return 'p'
return unknown
Python Code: (Double-click to select all)
1
2
3
4
5
6
7
8
9
10 def pathftn(p,unknown='?'):
t=unknown
if p.is_symlink: t='l'
elif p.is_block_device: t='b'
elif p.is_char_device: t='c'
elif p.is_dir: t='d'
elif p.is_file: t='f'
elif p.is_socket: t='s'
elif p.is_fifo: t='p'
return t
Excellent tutorials - very easy to understand with all the details. I hope you will continue to provide more such tutorials.
Thanks,
Irene Hynes
I have to voice my passion for your kindness giving support to those people that should have guidance on this important matter.
AWS Training in Bangalore
i tried but its taking only first line of the "commands.txt".
commands.txt contains:
sh run vlan 158
sh run vlan 159
def shvlan(device,child):
commandFile = open('commands.txt', 'r')
commands = [i for i in commandFile]
for command in commands:
child.sendline(command)
child.expect('.*#')
vlans = child.after
child.close()
print device + ' conn closed'
print 'sh run vlan executed'
print vlans
return vlans
it is very important
sluts mature
hi Eric,
the same output if incase i want to store into another text file how can we do that? can you post the extemnsion of this code for same?
Wonderful Blog. Keep Posting.
Advanced Excel Training in Chennai
Corporate Excel Training in Mumbai
Advanced Excel Training in Bangalore
Power BI Training in Chennai
Corporate Tableau Training
Corproate Excel Training Delhi, Gurgaon, Noida
Thank you for sharing your valuable suggesions its very usefull to me Python Training, SVR Technologies offers Online & Corporate Classes with Free Live Demo, We cover practical sessions and all the modules in Python..
24/7 Online Training | Corporate Training, Videos, Job Support. SVR Technologies building careers for Software Engineers With online Training self-paced.
Features:
>> Live Instructor LED Classes
>> Experienced Faculty
>> Free Video materials
>> 24/7 Support
>> Flexible Timings
>> Lowest Fee
Enroll For Live Classes: python online training
The 3D laser scanning service is very popular nowadays. Because 3D laser scanning is very useful for project surveying, design, and construction. If you need the best 3D laser scanning service then you can visit our site. Best 3D laser scanning service Calgary, Alberta
Great Article
IEEE Projects on Cloud Computing
Final Year Projects for CSE
Great read shared.
emergency tree services palm beach county
Excellent post.
patio screen repair west palm beach
Best post.
Useful one.
west palm beach airport limo service
Nice post.
bathroom remodelers palm beach
Great post shared.
commercial ac unit royal palm beach
Thanks for sharing.
palm beach county bathroom remodeling
Perfect post shared.
tree trimmers tampa
Useful article. kitchen remodel contractor wellington fl
this blog very creative and interesting.
hotels in Lahore
thank you for sharing informative content.
123movie.
Project Centers in Chennai
JavaScript Training in Chennai
Final Year Project Domains for IT
JavaScript Training in Chennai
הייתי חייבת לפרגן, תודה על השיתוף.
קבוצת גבאי
סופסוף מישהו שתואם לדעותיי בנושא. תודה.
סינמה רהיטים
Great Article.
פתרונות אלומיניום
Great Article. Thank you for sharing! Really an awesome post for every one.
123movies
Thanks for the blog loaded with so many information.
123moviesשי אירוח טבעוניולחן פינת אוכל
אהבתי מאוד את סגנון הכתיבה.
עיניים שקועות
very nice and informative post.
מערכת קולנוע ביתית
אין ספק שהפוסט הזה דורש שיתוף. תודה.
הפקת אירועיארז ליולדת
תודה על השיתוף. מחכה לכתבות חדשות.
השקעה בנדל"ן בארה"ב
Excellent information Providing by your Article. Thanks
back seat protector for dogs
great post very nice.
מומחה קידום אתרמונה על בלוק עץ
סופסוף מישהו שתואם לדעותיי בנושא. תודה.
התקנת אינטרקוט
Thanks for sharing the information... sharing
Photo Booth Rental South Coast
global asset management seoul
תודה על השיתוף. מחכה לכתבות חדשות.
מומחה קידום אתרים בגוגל
הייתי חייבת לפרגן, תודה על השיתוף.
מזרון למיטת תינורקעות להשקעה
כל הכבוד על הפוסט. אהבתי
מציאות רבודה
Thank you for such a well written article.
global asset management seoul
Extraordinary Article
global asset managementדפסת תמונות על קנבס
Nice post thanks for sharing with us.
אינטרקום למשרד
great posting.
מתקין מצלמות אבטחה
I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. share more.
Ai & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai
great.
global asset management korea
Thanks for sharing this information is useful for us, also I read an article on the same theme
Keep Sharing.
Garage door repair Vaughan
nice post.
Global asset management Korea posting.
מתקין מצלמות אבטחה
Nice and use full contents.
stratford management Tokyo
Thanks for the information you shared that's so useful and quite informative and i have taken those into consideration....
Bastion Balance Korea
Thanks for sharing.
Erectile dysfunction Las Vegas
When you are arranging again i am interested but it had been too late to visit your blog.
Investors Magazine
Great Article. Thanks for sharing info.
single trundle bedריכת שחיה פרטית
A superbly written article.
Overhead Door Pros
wow lovely cake. looks so delicious.
Garage Door Repair Okotoks
Superb info
Garage Door Repair Penn Hills
שירות מצוין. ממליץ בחום.
yes it would be, once my friend gave me lecture about modesty it was amazing and heart touching.
garage spring replacement pittsburgh
Excellent article
garage door repair chestermere
I really enjoyed reading your blog. Great blog
UFA
I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
24 hour garage doors ottawa
Nice work
เล่นหวยลาว pantip
It’s really great post, nice blog..I would like to appreciate your work and would like to tell to my friends.
Garage Door Installation
Best IT Training in Chennai
Tube fittings
Manifold valves
Needle valve
Ball valve
Thanks for the information you shared that's so useful and quite informative and i have taken those into consideration....
garage door repair east houston tx
I just came across to reading your blog it serve very useful information about the interiors thank you.
garage door repair Edmonton
Mua vé máy bay tại Aivivu, tham khảo
Ve may bay di My
vé máy bay tết
vé máy bay đi Canada bao nhiêu tiền
vé máy bay đi Pháp bao nhiêu tiền
vé máy bay đi Anh quốc
đặt vé rẻ
combo đi đà nẵng
combo nha trang giá rẻ
visa trung quoc du lich
dịch vụ cách ly tại khách sạn
virtual learning platforms
school management app
school management software
school erp software
classroom management software
I am not much into reading, but somehow I got to read lots of articles on your blog. Its amazing how interesting it is for me to visit you very often.
commercial garage door repair Pittsburgh
You're so talented in writing. God is truly utilizing you in tremendous ways.
commercial garage door repair Calgary
Mua vé máy bay tại Aivivu, tham khảo
gia ve may bay di my
cách mua vé máy bay giá rẻ từ mỹ về việt nam
giá thuê máy bay từ anh về việt nam
máy bay từ pháp về việt nam
This article has great reference value, thank you very much for sharing, I would like to reproduced your article, so that more people would see it.
garage door repair Richmond Hil
I wanted to thank you for this great blog! I really enjoying every little bit of it and I have you bookmarked to check out new stuff you post.
garage door blog
Another helpful post. This is a very nice blog that I will definitively come back to several more times this year!
garage door repair Pickering
מאמר מצוין נהניתי מכל רגע של קריאה
חברת ניקיון
Great and excellent post
financial news magazine
This is easier and surely gives comfort to internet users. Thanks for sharing. Post like this offers great benefit. Thank you!
אטרקציות לחתונה
Nice content
greenairductcleaningpittsburgh.com
I really like the fresh perpective you did on the issue. I will be back soon to check up on new posts! Thank you!
commercial hood cleaning pittsburgh
It's really a nice and helpful piece of information. I'm glad that you shared this helpful info with us. Please keep us informed like this.
garage door repair in Evergreen
informative post
garage door installation burlington
Nice content
plumber in tremont
עיצוב ממשק משתמש
It's always exciting to read articles from other writers and practice something from their websites.
garage door installation burlington
ecommerce service company in usa
shopify website development in usa
prestashop development in usa
magento development in usa
oscommerce development in usa.
I am extremely delighted with this web journal. It's a useful subject. It helps me all that much to take care of a few issues.
garage door spring replacement north dallas
Your post has those facts which are not accessible from anywhere else.
window repair markham
So lucky to come across your excellent blog. Your blog brings me a great deal of fun. Good luck with the site.
best garage door service in philadelphia
It's always exciting to read articles from other writers and practice something from their websites.
window replacement
I really loved reading your thoughts, obviously you know what are you talking about! Your site is so easy to use too, I’ve bookmark it in my folder
Los Angeles Garage Doors
A useful post shared.
austin garage door installation
I really loved reading your thoughts, obviously you know what are you talking about! Your site is so easy to use too, I’ve bookmark it in my folder
24-hour garage door repair in Las Vegas
I think this post will be a fine read for my blog readers too, could you please allow me to post a link to my blog. I am sure my guests will find that very useful.
garage door motor repair
I really loved reading your thoughts, obviously you know what are you talking about! Your site is so easy to use too, I’ve bookmark it in my folder
A1 Windows Repair
I really loved reading your thoughts, obviously you know what are you talking about! Your site is so easy to use too, I’ve bookmark it in my folder
Kitchen Star Houston
I really loved reading your thoughts, obviously you know what are you talking about! Your site is so easy to use too, I’ve bookmark it in my folder
scam warning
A useful post shared.
stratford management scam
This is easier and surely gives comfort to internet users. Thanks for sharing. Post like this offers great benefit. Thank you!
reputation management
That is associating with, turning on my camera and using it isn't the issue, clarifying the total of the spots I've conquered the perspective, is. Showing up reliably. A responsibility of appreciation is all together for this of web diaries, constantly need to track down a couple of arrangements concerning the experiences of individual adventurers. อนิเมะ
I really loved reading your thoughts, obviously you know what are you talking about! Your site is so easy to use too, I’ve bookmark it in my folder
Washing Machine Repair
I really loved reading your thoughts, obviously you know what are you talking about! Your site is so easy to use too, I’ve bookmark it in my folder
scam warningעות מלכין
I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day! ยูฟ่าสล็อต
I really loved reading your thoughts, obviously you know what are you talking about! Your site is so easy to use too, I’ve bookmark it in my folder
Columbus Roofing Pros
Valuable information! Looking forward to seeing your notes posted.
car lockout service
A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post.
Clear Water Management
nike shirt langarm
Valuable information! Looking forward to seeing your notes posted.
Houston Garage Door 4 Business
This is a wonderful article, Given so much info in it, These type of articles keeps the user's interest in the website.
mobile locksmith
Guys just sharing, I've found this interesting! Check it out!
Escort Erotic Massage |
borse gabs etnico
This is a brilliant writing and very pleased to find this site. I couldn’t discover to much different information on your blog. I will surely be back again to look at some other important posts that you have in future.
etobicokecarlocksmith.com
So lucky to come across your excellent blog. Your blog brings me a great deal of fun. Good luck with the site. Commercial Locksmith in Markham
valentine gauthier chaussures
Valuable information! Looking forward to seeing your notes posted.
transponder key programming
Very Informative and useful... Keep it up the great work. I really appreciate your post.
A round of applause for your mind blowing article. Much thanks to you, Fantastic.
mitsubishi inverter split ac เกมส์พนันออนไลน์ที่เปิดให้บริการไม่นานเปิดตลอด 24 ชั่วโมง สล็อตแตกง่ายสล็อตแตกยาก เล่นง่ายไม่ยากใครๆก็เล่นได้ทั้งวันไม่มีเบื่อ
json to string
json to string online
trolls characters
such a great content...its very interesting to read....
Ai Course in coimbatore
Machine Learning Course in Coimbatore
placement training institutes in coimbatore
job oriented courses in coimbatore
mean stack training in coimbatore
php Training in coimbatore
digital marketing training in coimbatore
ethical hacking training in coimbatore
Final Year Project Center in Coimbatore
React js training in coimbatore
luxury party wearantique gold suede hijab
luxury party wearsilver fox suede hijab
Our goal is to make buying or selling a home, or getting a mortgage, as easy and stress-free as possible. Our Artificial Intelligence-Digitized platform is designed to educate & empower the consumer and connect you with top-rated certified agents, while saving thousands of dollars through the process.
buy realty
Subsequently, after spending many hours on the internet at last We've uncovered an individual that definitely does know what they are discussing many thanks a great deal wonderful post.
dentist in miramar
3D laser surveying files cannot be read using everyday computer applications. To read point clouds, customers must possesses free viewer software licenses (e.g. Trimble, Leica, Pointools, etc.) and fee paying software licenses for the implementation of software that accommodates segmentation, sampling, measurement, modeling, exporting, saving of changes, etc. (e.g. Autocad, PDMS, Rhino). To read data model files, customers must possess computer assisted design software (e.g. Autodesk, Intergraph, Dassault System products, etc. âEUR¨ 3d laser scanning survey Sydney
lisez cet article sur Jean Jacques Perrut
I like this post, And I figure that they have a great time to peruse this post, they might take a decent site to make an information, thanks for sharing it with me.
estate sales in san clemente
laser fume extractor
portable dust collector
mobile dust collector
Grossing station
Welding fume extractor
SAT Chemistry
gcse organic chemistry
organic chemistry tutor
organic chemistry notes
donate for poor child
sponsor a child in need
volunteer in orphanage
Special school
canli
|
http://blog.pythonicneteng.com/2012/11/pexpect-module.html
|
CC-MAIN-2022-27
|
refinedweb
| 2,672
| 65.42
|
invalid_arity method similar to method missing ?
- From: didier.prophete@xxxxxxxxx
- Date: 16 Jan 2006 11:39:40 -0800
all,
Is there a function similar to method_missing when an existing method
is called with the wrong number of arguments ?
Suppose I have a class:
class MyClass
def my_func(var1, var2)
end
end
And then I end up calling:
MyClass.new.my_func
As expected, I end up getting an ArgumentError exception ('wrong number
of arguments...). Is there a way to catch these... something like a
'method_missing' (method_missing doesn't get called since the method
exists...)
-Didier
ps: obviously, for simple problems, I could end up using some default
argument values, but it won't work for the (real and more complex)
problem I am trying to solve...
.
- Prev by Date: Re: ruby under cygwin & windows paths
- Next by Date: [newbie] this month, the next month, and the one after that
- Previous by thread: XMLRPC problem. Can anyone help?
- Next by thread: invalid_arity method similar to method missing ?
- Index(es):
|
http://newsgroups.derkeiler.com/Archive/Comp/comp.lang.ruby/2006-01/msg02553.html
|
crawl-002
|
refinedweb
| 167
| 64
|
This article is a compilation of useful Wi-Fi functions for the ESP32. We’ll cover the following topics: scan Wi-Fi networks, connect to a Wi-Fi network, get Wi-Fi connection strength, check connection status, reconnect to the network after a connection is lost, Wi-Fi status, Wi-Fi modes, get the ESP32 IP address, set a fixed IP address and more.
This is not a novelty. There are plenty of examples of how to handle Wi-Fi with the ESP32. However, we thought it would be useful to compile some of the most used and practical Wi-Fi functions for the ESP32.
Table of Contents
Here’s a list of what will be covered in this tutorial (you can click on the links to go to the corresponding section):
- Wi-Fi Modes: station, access point and both (station + access point);
- Scan Wi-Fi networks;
- Connect to a Wi-Fi network;
- Get Wi-Fi connection status;
- Check Wi-Fi connection strength;
- Get ESP32 IP address;
- Set an ESP32 Static IP address;
- Disconnect Wi-Fi;
- Reconnect to Wi-Fi after connection is lost;
- ESP32 Wi-Fi Events;
- Reconnect to Wi-Fi Network After Lost Connection (Wi-Fi Events);
- ESP32 WiFiMulti
- Change ESP32 Hostname.
Including the Wi-Fi Library
The first thing you need to do to use the ESP32 Wi-Fi functionalities is to include the WiFi.h library in your code, as follows:
#include <WiFi.h>
This library is automatically “installed” when you install the ESP32 add-on in your Arduino IDE. If you don’t have the ESP32 installed, you can follow the next tutorial:
If you prefer to use VS Code + PaltformIO, you just need to start a new project with an ESP32 board to be able to use the WiFi.h library and its functions.
ESP32 Wi-Fi Modes
The ESP32 board can act as Wi-Fi Station, Access Point or both. To set the Wi-Fi mode, use WiFi.mode() and set the desired mode as argument:
Wi-Fi Station
When the ESP32 is set as a Wi-Fi station, it can connect to other networks (like your router). In this scenario, the router assigns a unique IP address to your ESP board. You can communicate with the ESP using other devices (stations) that are also connected to the same network by referring to the ESP unique IP address.
The router is connected to the internet, so we can request information from the internet using the ESP32 board like data from APIs (weather data, for example), publish data to online platforms, use icons and images from the internet or include JavaScript libraries to build web server pages.
Set the ESP32 as a Station and Connect to Wi-Fi Network
Go to “Connect to Wi-Fi Network” to learn how to set the ESP32 as station and connect it to a network.
In some cases, this might not be the best configuration – when you don’t have a network nearby and want you still want to connect to the ESP to control it. In this scenario, you must set your ESP board as an access point.
Access Point
When you set your ESP32 board as an access point, you can be connected using any device with Wi-Fi capabilities without connecting to your router. When you set the ESP32 as an access point, you create its own Wi-Fi network, and nearby Wi-Fi devices (stations) can connect to it, like your smartphone or computer. So, you don’t need to be connected to a router to control it.
This can be also useful if you want to have several ESP32 devices talking to each other without the need for a router.
Because the ESP32 doesn’t connect further to a wired network like your router, it is called soft-AP (soft Access Point). This means that if you try to load libraries or use firmware from the internet, it will not work. It also doesn’t work if you make HTTP requests to services on the internet to publish sensor readings to the cloud or use services on the internet (like sending an email, for example).
Set the ESP32 as an Access Point
To set the ESP32 as an access point, set the Wi-Fi mode to access point:
WiFi.mode(WIFI_AP)
And then, use the softAP() method as follows:
WiFi.softAP(ssid, password);
ssid is the name you want to give to the ESP32 access point, and the password variable is the password for the access point. If you don’t want to set a password, set it to NULL.
There are also other optional parameters you can pass to the softAP() method. Here are all the parameters:
WiFi.softAP(const char* ssid, const char* password, int channel, int ssid_hidden, int max_connection)
- ssid: name for the access point – maximum of 63 characters;
- password: minimum of 8 characters; set to NULL if you want the access point to be open;
- channel: Wi-Fi channel number (1-13)
- ssid_hidden: (0 = broadcast SSID, 1 = hide SSID)
- max_connection: maximum simultaneous connected clients (1-4)
We have a complete tutorial explaining how to set up the ESP32 as an access point:
Wi-Fi Station + Access Point
The ESP32 can be set as a Wi-Fi station and access point simultaneously. Set its mode to WIFI_AP_STA.
WiFi.mode(WIFI_AP_STA);
Scan Wi-Fi Networks
The ESP32 can scan nearby Wi-Fi networks within its Wi-Fi range. In your Arduino IDE, go to File > Examples > WiFi > WiFiScan. This will load a sketch that scans Wi-Fi networks within the range of your ESP32 board.
This can be useful to check if the Wi-Fi network you’re trying to connect is within the range of your board or other applications. Your Wi-Fi project may not often work because it may not be able to connect to your router due to insufficient Wi-Fi strength.
Here’s the example:
/* Example from WiFi > WiFiScan Complete details at */ ); }
You can upload it to your board and check the available networks as well as the RSSI (received signal strength indicator).
WiFi.scanNetworks() returns the number of networks found.
int n = WiFi.scanNetworks();
After the scanning, you can access the parameters about each network.
WiFi.SSID() prints the SSID for a specific network:
Serial.print(WiFi.SSID(i));
WiFi.RSSI() returns the RSSI of that network. RSSI stands for Received Signal Strength Indicator. It is an estimated measure of power level that an RF client device is receiving from an access point or router.
Serial.print(WiFi.RSSI(i));
Finally, WiFi.encryptionType() returns the network encryption type. That specific example puts a * in the case of open networks. However, that function can return one of the following options (not just open networks):
- WIFI_AUTH_OPEN
- WIFI_AUTH_WEP
- WIFI_AUTH_WPA_PSK
- WIFI_AUTH_WPA2_PSK
- WIFI_AUTH_WPA_WPA2_PSK
- WIFI_AUTH_WPA2_ENTERPRISE
Connect to a Wi-Fi Network
To connect the ESP32 to a specific Wi-Fi network, you must know its SSID and password. Additionally, that network must be within the ESP32 Wi-Fi range (to check that, you can use the previous example to scan Wi-Fi networks).
You can use the following function to connect the ESP32 to a Wi-Fi network initWiFi():
void initWiFi() { WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); Serial.print("Connecting to WiFi .."); while (WiFi.status() != WL_CONNECTED) { Serial.print('.'); delay(1000); } Serial.println(WiFi.localIP()); }
The ssid and password variables hold the SSID and password of the network you want to connect to.
// Replace with your network credentials const char* ssid = "REPLACE_WITH_YOUR_SSID"; const char* password = "REPLACE_WITH_YOUR_PASSWORD";
Then, you simply need to call the initWiFi() function in your setup().
How it Works?
Let’s take a quick look on how this function works.
First, set the Wi-Fi mode. If the ESP32 will connected to another network (access point/hotspot) it must be in station mode.
WiFi.mode(WIFI_STA);
Then, use WiFi.begin() to connect to a network. You must pass as arguments the network SSID and its password:
WiFi.begin(ssid, password);
Connecting to a Wi-Fi network can take a while, so we usually add a while loop that keeps checking if the connection was already established by using WiFi.status(). When the connection is successfully established, it returns WL_CONNECTED.
while (WiFi.status() != WL_CONNECTED) {
Get Wi-Fi Connection Status
To get the status of the Wi-Fi connection, you can use WiFi.status(). This returns one of the following values that correspond to the constants on the table:
Get WiFi Connection Strength
To get the WiFi connection strength, you can simply call WiFi.RSSI() after a WiFi connection.
Here’s an example:
/* Complete details at */ #include <WiFi.h> // Replace with your network credentials (STATION) const char* ssid = "REPLACE_WITH_YOUR_SSID"; const char* password = "REPLACE_WITH_YOUR_PASSWORD"; void initWiFi() { WiFi.mode(WIFI_STA);: }
Insert your network credentials and upload the code.
Open the Serial Monitor and press the ESP32 on-board RST button. It will connect to your network and print the RSSI (received signal strength indicator).
A lower absolute value means a strongest Wi-Fi connection.
Get ESP32 IP Address
When the ESP32 is set as a Wi-Fi station, it can connect to other networks (like your router). In this scenario, the router assigns a unique IP address to your ESP32 board. To get your board’s IP address, you need to call WiFi.localIP() after establishing a connection with your network.
Serial.println(WiFi.localIP());
Set a Static ESP32 IP Address
Instead of getting a randomly assigned IP address, you can set an available IP address of your preference to the ESP32 using WiFi.config().
Outside the setup() and loop() functions, define the following variables with your own static IP address and corresponding gateway IP address. By default, the following code assigns the IP address 192.168.1.184 that works in the gateway 192.168.1.1.
// Set your Static IP address IPAddress local_IP(192, 168, 1, 184); // Set your Gateway IP address IPAddress gateway(192, 168, 1, 1); IPAddress subnet(255, 255, 0, 0); IPAddress primaryDNS(8, 8, 8, 8); // optional IPAddress secondaryDNS(8, 8, 4, 4); // optional
Then, in the setup() you need to call the WiFi.config() method to assign the configurations to your ESP32.
// Configures static IP address if (!WiFi.config(local_IP, gateway, subnet, primaryDNS, secondaryDNS)) { Serial.println("STA Failed to configure"); }
The primaryDNS and secondaryDNS parameters are optional and you can remove them.
We recommend reading the following tutorial to learn how to set a static IP address:
Disconnect from Wi-Fi Network
To disconnect from a previously connected Wi-Fi network, use WiFi.disconnect():
WiFi.disconnect()
Reconnect to Wi-Fi Network After Lost Connection
To reconnect to Wi-Fi after a connection is lost, you can use WiFi.reconnect() to try to reconnect to the previously connected access point:
WiFi.reconnect()
Or, you can call WiFi.disconnect() followed by WiFi.begin(ssid,password).
WiFi.disconnect(); WiFi.begin(ssid, password);
Alternatively, you can also try to restart the ESP32 with ESP.restart() when the connection is lost.
You can add something like the snippet below to your loop() that checks once in a while if the board is connected.
unsigned long currentMillis = millis(); // if WiFi is down, try reconnecting if ((WiFi.status() != WL_CONNECTED) && (currentMillis - previousMillis >=interval)) { Serial.print(millis()); Serial.println("Reconnecting to WiFi..."); WiFi.disconnect(); WiFi.reconnect(); previousMillis = currentMillis; }
Don’t forget to declare the previousMillis and interval variables. The interval corresponds to the period of time between each check in milliseconds (for example 30 seconds):
unsigned long previousMillis = 0; unsigned long interval = 30000;
Here’s a complete example.
/*"; unsigned long previousMillis = 0; unsigned long interval = 30000; void initWiFi() { WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); Serial.print("Connecting to WiFi .."); while (WiFi.status() != WL_CONNECTED) { Serial.print('.'); delay(1000); } Serial.println(WiFi.localIP()); } void setup() { Serial.begin(115200); initWiFi(); Serial.print("RSSI: "); Serial.println(WiFi.RSSI()); } void loop() { unsigned long currentMillis = millis(); // if WiFi is down, try reconnecting every CHECK_WIFI_TIME seconds if ((WiFi.status() != WL_CONNECTED) && (currentMillis - previousMillis >=interval)) { Serial.print(millis()); Serial.println("Reconnecting to WiFi..."); WiFi.disconnect(); WiFi.reconnect(); previousMillis = currentMillis; } }
This example shows how to connect to a network and checks every 30 seconds if it is still connected. If it isn’t, it disconnects and tries to reconnect again.
You can read our guide: [SOLVED] Reconnect ESP32 to Wi-Fi Network After Lost Connection.
Alternatively, you can also use WiFi Events to detected that the connection was lost and call a function to handle what to do when that happens (see the next section).
ESP32 Wi-Fi Events
The ESP32 can handle all the following Wi-Fi events:
For a complete example on how to use those events, in your Arduino IDE, go to File > Examples > WiFi > WiFiClientEvents.
/* This sketch shows the WiFi event usage - Example from WiFi > WiFiClientEvents Complete details at */ /* * = "REPLACE_WITH_YOUR_SSID"; const char* password = "REPLACE_WITH"); WiFi.begin(ssid, password);; default:); }
With Wi-Fi Events, you don’t need to be constantly checking the Wi-Fi state. When a certain event happens, it automatically calls the corresponding handling function.
Reconnect to Wi-Fi Network After Lost Connection (Wi-Fi Events)
Wi-Fi events can be useful to detect that a connection was lost and try to reconnect right after (use the SYSTEM_EVENT_AP_STADISCONNECTED event). Here’s a sample> const char* ssid = "REPLACE_WITH_YOUR_SSID"; const char* password = "REPLACE_WITH_YOUR_PASSWORD"; void WiFiStationConnected(WiFiEvent_t event, WiFiEventInfo_t info){ Serial.println("Connected to AP successfully!"); } void WiFiGotIP(WiFiEvent_t event, WiFiEventInfo_t info){ Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); } void WiFiStationDisconnected(WiFiEvent_t event, WiFiEventInfo_t info){ Serial.println("Disconnected from WiFi access point"); Serial.print("WiFi lost connection. Reason: "); Serial.println(info.disconnected.reason); Serial.println("Trying to Reconnect"); WiFi.begin(ssid, password); } void setup(){ Serial.begin(115200); // delete old config WiFi.disconnect(true); delay(1000); WiFi.onEvent(WiFiStationConnected, SYSTEM_EVENT_STA_CONNECTED); WiFi.onEvent(WiFiGotIP, SYSTEM_EVENT_STA_GOT_IP); WiFi.onEvent(WiFiStationDisconnected, SYSTEM_EVENT_STA_DISCONNECTED); /* Remove WiFi event Serial.print("WiFi Event ID: "); Serial.println(eventID); WiFi.removeEvent(eventID);*/ WiFi.begin(ssid, password); Serial.println(); Serial.println(); Serial.println("Wait for WiFi... "); } void loop(){ delay(1000); }
How it Works?
In this example we’ve added three Wi-Fi events: when the ESP32 connects, when it gets an IP address, and when it disconnects: SYSTEM_EVENT_STA_CONNECTED, SYSTEM_EVENT_STA_GOT_IP, SYSTEM_EVENT_STA_DISCONNECTED.
When the ESP32 station connects to the access point (SYSTEM_EVENT_STA_CONNECTED event), the WiFiStationConnected() function will be called:
WiFi.onEvent(WiFiStationConnected, SYSTEM_EVENT_STA_CONNECTED);
The WiFiStationConnected() function simply prints that the ESP32 connected to an access point (for example, your router) successfully. However, you can modify the function to do any other task (like light up an LED to indicate that it is successfully connected to the network).
void WiFiStationConnected(WiFiEvent_t event, WiFiEventInfo_t info){ Serial.println("Connected to AP successfully!"); }
When the ESP32 gets its IP address, the WiFiGotIP() function runs.
WiFi.onEvent(WiFiGotIP, SYSTEM_EVENT_STA_GOT_IP);
That function simply prints the IP address son the Serial Monitor.
void WiFiGotIP(WiFiEvent_t event, WiFiEventInfo_t info){ Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); }
When the ESP32 loses the connection with the access point (SYSTEM_EVENT_STA_DISCONNECTED), the WiFiStationDisconnected() function is called.
WiFi.onEvent(WiFiStationDisconnected, SYSTEM_EVENT_STA_DISCONNECTED);
That function prints a message indicating that the connection was lost and tries to reconnect:
void WiFiStationDisconnected(WiFiEvent_t event, WiFiEventInfo_t info){ Serial.println("Disconnected from WiFi access point"); Serial.print("WiFi lost connection. Reason: "); Serial.println(info.disconnected.reason); Serial.println("Trying to Reconnect"); WiFi.begin(ssid, password); }
ESP32 WiFiMulti
The ESP32 WiFiMulti allows you to register multiple networks (SSID/password combinations). The ESP32 will connect to the Wi-Fi network with the strongest signal (RSSI). If the connection is lost, it will connect to the next network on the list. This requires that you include the WiFiMulti.h library (you don’t need to install it, it comes by default with the ESP32 package).
To learn how to use WiFiMulti, read the following tutorial:
Change ESP32 Hostname
To set a custom hostname for your board, call WiFi.setHostname(YOUR_NEW_HOSTNAME); before WiFi.begin();
The default ESP32 hostname is espressif.
There is a method provided by the WiFi.h library that allows you to set a custom hostname.
First, start by defining your new hostname. For example:
String hostname = "ESP32 Node Temperature";
Then, call the WiFi.setHostname() function before calling WiFi.begin(). You also need to call WiFi.config() as shown below:
WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE); WiFi.setHostname(hostname.c_str()); //define hostname
You can copy the complete example below:
/*"; String hostname = "ESP32 Node Temperature";: }
You can use this previous snippet of code in your projects to set a custom hostname for the ESP32.
Important: you may need to restart your router for the changes to take effect.
After this, if you go to your router settings, you’ll see the ESP32 with the custom hostname.
Wrapping Up
This article was a compilation of some of the most used and useful ESP32 Wi-Fi functions. Although there are plenty of examples of using the ESP32 Wi-Fi capabilities, there is little documentation explaining how to use the Wi-Fi functions with the ESP32 using Arduino IDE. So, we’ve decided to put together this guide to make it easier to use ESP32 Wi-Fi related functions in your projects.
If you have other useful suggestions, you can share them on the comments’ section.
We hope you’ve found this tutorial useful.
Learn more about the ESP32 with our resources:
78 thoughts on “ESP32 Useful Wi-Fi Library Functions (Arduino IDE)”
Hi
Your blog is very interresting and helps a lot, but i miss the information to change the hostname of the esp32. Is it possible to change the Espressif unit name to a project specifish name.
I know i can change the name in the wlan router but the unit name still is Espressif
Regards
Hi,
You can change ESP32 hostname using commands like this:
String MA02_ID = “MA02_09”;
WiFi.setHostname(MA02_ID.c_str()); //define hostname
Hi Werner,
Try this, it should do the trick 😉
WiFi.mode(WIFI_MODE_STA);
WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE);
WiFi.setHostname(YOUR_HOSTNAME);
WiFi.begin(YOUR_WIFI_SSID, YOUR_WIFI_PASS);
Hi,
Unfortunately doesn’t work for me – tried it on 2 different boards and with different sized hostnames. Small hostnames just continue to show expressif on network scan and larger hostname just gives a blank 🙁
Regards, Sandy
Sorry to hear that…
It works perfectly on my side!
Even with a rather long name with spaces.
Try to refresh the DHCP client list on your router.
Hi,
Sorry for the delay.
I rebooted my router and lo and behold the changed hostnames appeared – thank you 🙂
Sandy
I wanted to post an image to illustrate my point in my last comment, but it didn’t work. You can see it by clicking on the link.
The arduino-esp32 framework has just been updated to version 1.0.5. Some of the fixes include the following:
ad4cf146 Rework setHostname for WiFi STA
5de03a39 Fix WiFi STA config IP to INADDR_NONE results in 255.255.255.255
See if this solves your problem?
Is there a way to quickly do a WiFi Scan for a SPECIFIC SSID and, when it detects the WiFi SSID is available (or not), does something with this information in the sketch?
Hi Jim,
Something like that?
#include <Arduino.h>
#include <WiFi.h>
const char* SPECIFIC_SSID = "MyNetwork";
const char* ENC_TYPE[] = {
"Open",
"WEP",
"WPA_PSK",
"WPA2_PSK",
"WPA_WPA2_PSK",
"WPA2_ENTERPRISE",
"MAX"
};
struct WiFiInfo {
bool found;
int32_t channel;
int32_t rssi;
wifi_auth_mode_t auth_mode;
} wifi_info;
void findWiFi(const char *ssid, WiFiInfo *info) {
info->found = false;
int16_t n = WiFi.scanNetworks();
for (uint8_t i=0; i<n; ++i) {
if (strcmp(WiFi.SSID(i).c_str(), ssid) == 0) {
info->found = true;
info->channel = WiFi.channel(i);
info->rssi = WiFi.RSSI(i);
info->auth_mode = WiFi.encryptionType(i);
return;
}
}
}
void setup() {
Serial.begin(115200);
findWiFi(SPECIFIC_SSID, &wifi_info);
Serial.printf(wifi_info.found
? "SSID: %s, channel: %i, RSSI: %i dBm, encryption: %s\n"
: "SSID: %s ... could not be found\n",
SPECIFIC_SSID,
wifi_info.channel,
wifi_info.rssi,
ENC_TYPE[wifi_info.auth_mode]);
}
void loop() {}
Sorry… formatting with Markdown didn’t work properly :-/
But you should be able to format the code in your favorite editor.
I fixed that by publishing the code on GitHub Gist 😉
Hi Stéphane,
Thanks for sharing this.
Regards,
Sara
This worked perfectly. Thank you! I wonder if there is a faster way to get the SSID without having to scan for all networks first, and then isolating the network I’m searching for. Is there a way to do this?
hi, I hope someone can help me with this issue becasue I have weeks working on it and nothing looks to work….. I have a esp32 with my basic code just to connect with my wifi, not matter what I do, it does not connect, always shows me the error disconnected from AP (event 5)…. do you have any idea what is this happening? thanks
To use as a WiFi reference, there is a couple of things I would’ve liked to see included; i.e., commands to manipulate the MAC address of a board, and an example using the soft_AP and STA modes together.
As Werner noted, if there is a way to redefine the identifier, that would be great to know too!
That said, it is still a great article, and I would love to see it expanded with more examples of the more obscure commands’ responses. Maybe a downloadable table of the command/method/event, use format, possible responses, and any comments (such as “only valid in STA mode” or, a link to an example. Most of this is already in the article, just not well summarized, so hard to locate.
Cheers!
+1 for an example of how the combination WIFI_AP_STA works.
Thanks,
Dennis
Great tutorial!
Thanks for your work.
I found the automatic reconnection feature after the card disconnected very interesting. However, they seem to understand that this doesn’t always work. Especially when using Blynk. Has anyone had any experience in this regard?
Greetings. Mike.
Great article. Woyld have liked to ser how to use both modes to make a WiFi extender on ESP32. Thete is little info on this on the web although i know it is possible.
Check this sentences pls: “Or, you can call WiFi.diconnect() followed by WiFi.begin(ssid,password)”. Must WiFi.disconnect
Hi.
Thanks. You are right.
It’s fixed now!
Regards,
Sara
Is it now possible to run ESP-Now together with WiFi in STA mode?
My last state was: ESP-Now and WiFi must share the same channel and the channel number must be 1. Even when the router starts a connection at channel 1 in STA mode, if the router changes the channel to avoid traffic collisions, the ESP-Now connection breaks.
Hi,
Really good – thanks!
I would echo Dave’s request for an example using the soft_AP and STA modes together.
Sandy
Thanks for the suggestion.
I’ll add that to my list.
Regards,
Sara
Great Tutorial!
I am having some trouble connecting to my local WiFi and I’m sure this info will help me understand what is happening.
Do you have something similar for the ESP8266?
What I would find most useful would be some sample code that:
attempted a connection with stored network ID and credentials
if this failed fall back to AP mode, so that a user can connect, login to a webUI, save new network details, and then reboot / attempt to reconnect.
No-one want to recompile code, just so a device can change networks.
Hi.
Thanks for the suggestion.
In fact, we have a project like that in our most recent eBook:
I’ll probably release that project or a simplified free version of that project soon.
Regards,
Sara
Very helpful artical. Thank you very much
It’s a pity that you omitted
WiFi.persistent()command. I think, that this function is one of the most important when using WiFi and literally nobody knows about it.
In short: This function is true on default and causes, that every time (on every reboot) when calling WiFi.begin the ssid+pass are written into flash. This is a flash killer when using WiFi and deepsleep together.
Thanks for sharing that.
I’ll add it to the tutorial in the next update.
Regards,
Sara
Hi,
Thank you for publishing the article.
Regarding Reconnect to Wi-Fi Network After Lost Connection code
I have a need to modify the while loop so it checks for two conditions for example
(WiFi.status() != WL_CONNECTED) or (WiFi.status() != WL_NO_SSID_AVAIL)
Could you advice me of the best approach
Best regards
I have found that setting a static IP address in Station mode sometimes works, and sometimes not. I guess it depends on the router and a bunch of advanced network stuff that I dont understand. Nevertheless: this means for a user who wants to access the ESP32 webserver page, he/she must know the IP. How do you solve this when that user does not have access to the serial print nor some ESP-attached display?
A static IP address would be a great solution, but it is just not reliable enough. I have also tried with mDNS and also that was unreliable (worked on iPhone but not Android).
This is a use case where I would give a project as a gift to someone who doesnt know Arduino and can’t expect them to read Serial monitor or something like that. I haven’t found a true solution to this problem anywhere. How do you solve it?
Hi Amin,
normally a DHCP server on the router supplies IP addresses to the clients from a list of allowed addresses. If you set a static IP address in Station mode, this address must be excluded from the list of addresses the router is allowed to supply, otherwise two same addresses clash. Look in the configuration of your router, search for a DHCP entry and exclude your static IP address. Then static IP addresses are really reliable.
Thank you for your reply Peter. That would totally make static IP addresses work. But my use case is when I give a project as a gift to someone to use in their home network. I can’t expect them (think your mother haha) to go in and mess in the config of their router. I am looking for a solid and simple solution that does not require reading the serial monitor, or attaching a screen (one time use only to find out the IP!) nor changing their router settings. Most people can’t do this and I want to build something for most people.
Hi Amin,
in your case you cannot go with a static IP address. You know the MAC (physical) address of your ESP32 board or you can set the MAC address of the ESP32 to your own address (see RUI’s tutorials for details). Then you need to identify the dynamic IP address corresponding to your MAC address within your client app. This is done by the ReverseARP protocol RARP. On Windows or Linux use “arp -a” which creates a list of all MAC addresses and the corresponding IP addresses in your network. See for details.
Peter
If you don’t want to attach an LCD or TFT screen to your device, you can flash a simple LED to reveal the last byte of the IP address, going through the 3 decimal digits that make it up for example… assuming the person knows the address class of their private network (which they can view on any of their connected devices) 😋
Hi
Thank you for publishing the article. Regarding the while loop I have a need to modify the while loop so it checks for two conditions for example
(WiFi.status() != WL_CONNECTED) or (WiFi.status() != WL_NO_SSID_AVAIL)
Could you advice me of the best approach
Best Regards
Is there a way to show my gratitude, Rui and Sara? The books and tutorials that you produce are nothing short of fantastic. It’s a joy to work on a project that incorporates your work knowing that you have published information and code that is accurate and complete. You two are making a huge impact on the world of IOT and data networking that will advance the technology as well as advance the knowledge of thousands of us nerds! Thank you for what you do for the world every day!
Hi Bob.
Thank you so much for your nice words.
I’m glad you enjoy our tutorials and eBooks.
There are several ways to support our work. See here:.
Regards,
Sara
I was looking for same type of content. Thanks for doing enhanced research for us. I will try it and give my feedback again.
Hi Sara & Rui,
Thank you for another great tutorial. You guys are really the best on the ESP tutorials for many reasons. Please forgive the length of this little comment. Note to all of you: I do not make a dime writing what I post below. I just love the work that Rui & Sara are doing and want them to keep doing it forever!
I have a stressful job that I actually love, (regulatory consultant helping people comply with impossible regulations), but as far as concentration zen time to re-load a kinder gentler me, reading & following the Random Nerds tutorials & courses is the best stress relief I have had in 50 years (neglecting some obvious things like swimming, fishing, time with wife, and family gatherings, etc.) No kidding!
Note to Bob above about support. You can’t go wrong purchasing RN courses at their.
The Random Nerd courses are very comprehensive, better organized, easy to follow, inexpensive, and just pure excellence compared to other courses on similar subjects. They have on-line and pdf version of the courses, as well as great videos for all the course material. They are the best organized courses with useful examples. Every time I have had a relevant question and email either Rui or Sara, they respond with really helpful info that is to the point and relevant. I just wish I had more time to spend reading their stuff and using it on my little projects.
As far as the boards used on their ESP32 courses, even though Rui & Sara mostly use the ESP-WROOM-32 varieties (30 pin and 38 pin Devkits mostly), their code runs on every ESP32 board that I have tried it on, by just paying attention to the pinout for the board and adapting the code a little.
Hope I did not miss Amin’s point, but maybe a suggestion for Amin: if you try out their code on a couple of ESP32’s with little on board displays, even though they are a little more expensive, like the M5Sticks, M5 Core, LILIGO TTGO T-Display, or LILIGO TTGO TS, or HelTec WiFi Kit V2, or even the MorphESP240, (Definitely use Rui & Sara’s Maker Advisor at for where to get a ESP32 board with display for the best price), then you will find one for a reasonable price that you can try your code on. Then when you are satisfied with how it works, just port it over to a very inexpensive DevKit V1 or whatever ESP board you like.
One last thing, I looked and seem to remember a Random Nerds tutorial for ESP32 autoconnect (initial connection and adding to existing code, something like the stuff on Hackster, IOTDesignpro, Circuit Digest, or Instructables:
And a great one by Frenoy Osburn,
Anyway, they work mostly, but I pray that Rui & Sara do a tutorial on that, because it it will be far superior to what I have tried so far. Maybe they have & I just can’t find it. Anyway, I might be confusing it with another source. Don’t get me wrong, the other authors tutorials & githubs are fine. Nonetheless, the way Rui & Sara do their stuff blows everyone else out of the water.
Thanks again Random Nerds. I wish words were sufficient to express my appreciation. I’ve already purchase and read all you courses (except 2).
Hi.
Thank you so much for your nice words and for supporting our work.
I’m speechless about your awesome testimonial. I just want to say “Thank you!”. It feels nice to know that people find value in our work.
The randomnerds website is not ours. I’ve deleted that line in your comment to not confused other people.
These are the sites we own:
Once again, thank you.
Regards,
Sara
I think the tutorial you are looking for is this one:
Regards,
Sara
Small correction
soft-AP stands for ‘software enabled Access Point’ meaning; the feature is emulated in software. It’s nothing to do with the fact it’s not connected to a wired network (In fact you can connect a softAP to a wired network; this and it’s still a softAP)
have any example with “WiFi.mode (WIFI_STA_AP)”???
I’m just starting to use the Espressif ‘ESP-S2-SAOLA-1’ (ESP32-S2-WROVER)
I copied your demo but I’m not able to connect to my private WiFi using ‘SAOLA’ board. Using a different ESP32 board works fine.
Software never goes in WL_CONNECTED
‘ssid’ and ‘password’ are correct.
Serial.print(“Connecting to “);
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(“.”);
}
SAOLA board works fine for other functionality, also ‘Access Point’ implementation is fine! Only the ‘WIFI_STA’ give me trouble.
What’s wrong?
Something relate to ESP32-S2?
Thanks.
Hi, I’ve just started playing with ESP32s and this site has been a nice resource for me. I know that WPA2* is not very secure and I have discovered that EspressIf has added support for WPA3. I am however not sure if the Arduino IDE supports this yet, or even if they are working on adding this support.
Do you happen to know what is going on with WPA3 and Esp32 in relation to Arduino IDE?
Thanks!
Sinds arduino core 2.0, WPA3 is supported. I can’t find a tutorial yet but hopefully soon here
Great tutorial!
Thanks for your work.
but, do you have any example “WiFi.mode (WIFI_AP_STA)” ??
For example, the user with a new ESP at home uses AP mode to select his home network and configure his email, after saving these data ESP restarts and enters Station operating mode connecting to this wifi network previously configured for send temperature data to a server using the e-mail registered as data, if it is necessary to reconfigure the wifi network again it should go back to the menu with the available wifi networks, it could have a physical button for this or a config/use jumper.
Thank you for this useful sample AP code.
It works with my WROOM board, except that ‘channel’ and ‘ssid_hidden’ parameters do nothing. I always get channel 1, and the SSID is always visible.
Seems the WiFi library is for 8266 devices, so thought I’d try for something more specific to the hardware. Unfortunately Espressif want us to use ESP-IDF. I don’t know how to apply their code to the Arduino IDE. (Could try with Eclipse, but it’s a bit clumsy.)
So I’ll have a play with the Esp32WifiManager and see what happens.
I was wondering if I could influence the signal strength, hence wanting to not use channel 1, which is pretty crowded in my house. Maybe not. Trying external antennas soldered to the boards. That helped a bit with a LilyGo ESP32+LCD board.
An update on my previous comment:
The ‘channel’ and ‘ssid_hidden’ parameters to WiFi.softAP() do take effect if the password is long enough. (A password of less than 8 chars doesn’t work, it is equivalent to no password.)
Excellent tutorial
My need is a bit similar to. ‘Admin’
I have an air quality sensor. CO2 VOCs etc.
Set as an AP
I want to go into a public place that has an open WiFi.
Scan for the open WiFi.
Select it with a cellphone
Then my unit would connect to that.
Ive spoken to some of the places i visit and so everyone would permit me to rest the air.
Hi.
Take a look at WiFiManager:
Regards,
Sara
great tutorial!
my system is not able to find the definition for this: WiFiEventInfo_t
I am including these headers: ESP8266WiFi.h ESPAsyncTCP.h ESPAsyncWebServer.h
any suggestions?
Hi.
This tutorial is for the ESP32, not for the ESP8266.
Regards,
Sara
Hi, this is very useful information. I wish I had found your article a few weeks ago when I started with my ESP32-C3 project. I’m working on a project that involves collecting CSI data between chips for distance ranging and I can collect CSI data at the moment only through the chips connecting one as station, the other as AP. It would be better if I could get the chips to broadcast packets and listen for these to generate the CSI data, rather than make individual connections so that the distance estimation can occur for multiple chips. Is this possible?
Hi.
Take a look at ESP-NOW and ESP-MESH communication:
–
–
Regards,
Sara
My understanding is that ESP-NOW won’t provide CSI data, but I haven’t played around with it yet myself. Thanks for the reply.
ESP-MESH looks promising thanks!
ATTN: Arduino IDE libraries now seem to require different constant and type names.
This code does not work when using the Arduino IDE (Nov 2021). The constant names that work are different and (to add to the confusion) these (SYSTEM) names are still defined. For example, instead of
SYSTEM_EVENT_STA_CONNECTED
use ARDUINO_EVENT_WIFI_STA_CONNECTED.
You can find all of the connect constants and types (some type names are also different) here:
Thanks for all the great tutorials.
Cheers,
–joey
Hi.
Thanks for pointing that out.
I’ll test it soon and update the tutorial if needed.
Regards,
Sara
WPA3 is nog supported in arduino core 2.x. Can the tutorial updated with this?
Is there a simple speed test I can run to test signal strength/quality? I’m trying to run an app where a camera image captured is uploaded to a cloud drive, but get beacon timeouts that trash the wifi connection. So I’m trying to diagnose things.
Hi.
Check example 5:
Regards,
Sara
ESP32 ESP-Now and channels
My ESP32 ESP-Now transmitter is always on in my shed, it transmits weather data. It was apparently set to channel 2.
My ESP-Now receiver is in my workroom and sometimes is turned off for new programming.
One time the receiver went off IP address and channel. I booted my network system and the receiver channel came back to channel 2.
I read through the article, but didn’t find anything about keeping the channel number between two devices.
Apparently in the article it mentioned doing something to the transmitter to change the channel (but I don’t know what).
Is there a way to make the router set the channel # on the receiver?
Or is there another way?
Thanks
Hi.
In the ESP-NOW Web Server example, there’s a section that shows how to put the sender and receiver on the same channel automatically.
That solution was presented to us by one of our readers. Maybe it is better to take a look at his explanation and examples here:
Regards,
Sara
As I see ESP32 supports explicit LongRange mode (ofcourse at a cost of compromised band width), but how to enable it?
Hi, I made everything like here, but I have an error: initWiFi() was not declared in this scope. Why? I copy everything like in ebook and it doesn’t work((
Hi.
what code are you using?
Where are you calling the initWiFi() function and where is it declared?
Regards,
Sara
Dear all, I have a strange problem, I have this code for a DOIT ESP32 DEV KIT V1:
// Connect to Wi-Fi
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
Inside setup(), and I have no problems at all to compile it.
If I import the same file from PlatformIO, I get the following error:
C:/Users/josem/Documents/PlatformIO/Projects/220726-183829-esp32doit-devkit-v1/src/_20220724_Telegram_Control_ESP32_ESP8266.ino: In function ‘void setup()’:
C:/Users/josem/Documents/PlatformIO/Projects/220726-183829-esp32doit-devkit-v1/src/_20220724_Telegram_Control_ESP32_ESP8266.ino:262:7: error: ‘class WiFiClass’
has no member named ‘mode’
WiFi.mode(WIFI_STA);
Any suggestion about?
I mean I have no problem to compile, under Arduino IDE, but at opposite, I’m not able to compile inside VSC – PlatformIO
Hi.
Did you have the right board in the platformio.ini file?
Regards,
Sara
Yes, I think so, this is my PlatformIO.ini
[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
lib_extra_dirs = ~/Documents/Arduino/libraries
; Serial Monitor options
monitor_speed = 115200
Do you thing that it could be a good idea to publish it on Facebook too?
I don’t think it is necessary.
However, if you’re not able to solve the issue, you can search for further help.
Regards.
Sara
Why are you using this:
lib_extra_dirs = ~/Documents/Arduino/libraries
?
I’ts not because of me, just appeared when I imported the project from Arduino
I suggest creating a new project from the start using VS Code.
Regards,
Sara
|
https://randomnerdtutorials.com/esp32-useful-wi-fi-functions-arduino/?replytocom=556040
|
CC-MAIN-2022-33
|
refinedweb
| 6,869
| 64.81
|
Bounding rectangle of rotated Item
How do you access the bounding rectangle of a rotated QML Item? For example in the code below how would I make the parent 'boundingRect' match the extents of the rotated child.
@
import QtQuick 2.1
import QtQuick.Controls 1.0
ApplicationWindow {
id: mainWindow
width: 300
height: 300
Rectangle { id: boundingRect x: 50 y: 50 color: 'yellow' width: childrenRect.width height: childrenRect.height Rectangle { id: rotated width: 75 height: 100 border.width: 1 border.color: 'blue' rotation: 45 } }
}
@
Started to look at a solution using a width/height based on mapFromItem() but I don't think that's going to work as a general solution when I have multiple children which may be rotated and I want the bounding box of all of them.
Thanks
|
https://forum.qt.io/topic/36313/bounding-rectangle-of-rotated-item
|
CC-MAIN-2017-34
|
refinedweb
| 130
| 57.98
|
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 to copy and modify the value of an inherited field
Hello,
I'm inherinting some fields from module A that I want to be able to change in custom module B, but I don't want those changes to affect module A
This is my custom module B, that inherits from crm.claim
from openerp import models, fields, api
from datetime import datetime
class CrmClaim(models.Model):
_inherit = "crm.claim"
partner_id = fields.Many2one('res.partner', 'PartnerID')
Address = fields.Char(related='partner_id.contact_address')
mobile_phone = fields.Char(related='partner_id.mobile')
I want to be able to change the value of the Address and mobile_phone associated with the claim, without this change affecting res.partner
I've tried using the parameter copy=True, but when I change the phone in claims, it changes the phone in Customers too
Thank you
Hi,
You have to define the `address` field as a normal field, then use the onchange function on `partner_id` field to get the contact_address from res.partner.
Make sure that in onchange function you can do anything you want (just add your conditions)
try with store=True, like:
Address = fields.Char(related='partner_id.contact_address', store=True)
It still modifies the res.partner field
That needs an update of the module. Not just a server restart. It needs boths
Sorry, I just saw this. it still modifies the res.partner field even with a module update
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-to-copy-and-modify-the-value-of-an-inherited-field-105020
|
CC-MAIN-2017-22
|
refinedweb
| 288
| 57.16
|
....
There are an increasing number of hybrid parrallel applications that mix
distributed and shared memory parallelism. To know how to support that model,
one need to know what level of threading support is guaranteed by the MPI
implementation. There are 4 ordered level of possible threading support described
by
mpi::threading::level.
At the lowest level, you should not use threads at all, at the highest level,
any thread can perform MPI call.
If you want to use multi-threading in your MPI application, you should indicate in the environment constructor your preffered threading support. Then probe the one the librarie did provide, and decide what you can do with it (it could be nothing, then aborting is a valid option):
#include <boost/mpi/environment.hpp> #include <boost/mpi/communicator.hpp> #include <iostream> namespace mpi = boost::mpi; namespace mt = mpi::threading; int main() { mpi::environment env(mt::funneled); if (env.thread_level() < mt::funneled) { env.abort(-1); } mpi::communicator world; std::cout << "I am process " << world.rank() << " of " << world.size() << "." << std::endl; return 0; }.
environment.
|
http://www.boost.org/doc/libs/1_58_0/doc/html/mpi/python.html
|
CC-MAIN-2015-22
|
refinedweb
| 174
| 50.23
|
When writing plug-ins, you no longer have to use this hack to get WebKit
example pages loaded:
def InstallInWebKit(appServer):
app.addContext('PSPExamples', appServer.serverSidePath('../PSP/Examples'))
However, you have to do a little advertising in your Properties.py file and
put a Main.py or index.py[psp, whatever] in your Examples/.
I also enhanced the sidebar of the example page so that it shows the
examples pages for each plug-in indented underneath the plug-in's name.
Please see the doc string in WebKit/Examples/ExamplePage.py for complete
instructions and give it a try.
I'll probably merge the "Welcome" example into WebKit's main example page.
And I either broke the "View source of..." link or it never worked for
plug-ins anyway. I'll fix in the next 24 hrs.
-Chuck
|
http://sourceforge.net/p/webware/mailman/webware-discuss/thread/5.0.2.1.0.20010425180428.028e37e0@mail.mindspring.com/
|
CC-MAIN-2015-48
|
refinedweb
| 138
| 53.07
|
From this documentation, I see that IntelliJ has awareness of xpath extension functions, at least for EXSLT, but it's not clear how this is configured:
Instead of EXSLT, I am using Saxon functions in my xpath expressions. I am able to declare the namespace for it, but there is no associated DTD because functions are not elements. So how can I get tool support for Saxon functions? For example, the saxon:evaluate function:
<xsl:stylesheet xmlns:
<xsl:variable
IntelliJ is asking for a DTD, which doesn't exist, and even if it did, wouldn't document functions. I can set it to be ignored, but I'd like to have tool support for Saxon functions. How can this be done?
Hello,
The XSLT-plugin currently only knows about (EXSLT) extension functions that are implemented by the current XSLT processors. Unfortunately, there is no easy way configure additional functions.
Saxon extension functions will be available in IDEA 13: IDEA-115187
Regards,
Sascha
|
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206750205-Configuring-XPath-extension-function-namespace-without-DTD?page=1#community_comment_206652239
|
CC-MAIN-2022-33
|
refinedweb
| 162
| 62.68
|
Allocate, reallocate, or free a block of memory
#include <stdlib.h> void* realloc( void* old_blk, size_t size );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The realloc() function allocates, reallocates, or frees the block of memory specified by old_blk based on the following rules. You can control parts of this behavior via the MALLOC_OPTIONS environmental variable.
If the value of MALLOC_OPTIONS contains an R or a V, realloc() calls free() to release the memory pointed to by old_blk, and then returns NULL. This is the way QNX Neutrino 6.4.0 and earlier behaved.
The realloc() function allocates memory from the heap. Use free() or realloc() to free the block of memory. );
A pointer to the start of the allocated memory, or NULL if an error occurred (errno is set).
; }
|
http://www.qnx.com/developers/docs/6.6.0_anm11_wf10/com.qnx.doc.neutrino.lib_ref/topic/r/realloc.html
|
CC-MAIN-2018-43
|
refinedweb
| 141
| 58.79
|
This article will give you step-by-step introduction to debug Windows Forms application run-time error using C#.
Figure: 1 - Example in run-time mode.
Introduction
How often do you hear from your pear, "I'm busy debugging my code"? Well, as I can see debugging and code development goes hand-in-hand for every developer. Although debugging is becoming easier and innovative every passing release of VS 2005; beginner level developers still find it challenging. Here is my take on debugging 101. In this article, I'll show you, a simple step-by-step tutorial to find bug and go one step ahead to become a code warrior!
I assume the reader has the basic understanding of the Visual Studio (VS) 2005 IDE. You should also comfortable writing code with C#.
What is Debugging?
Well, to understand what is debugging, you've to know what a bug is! If I can put it in a simple word, bug is result of code went wrong during your development. So, what does bug do? Well, simple it produces error. You know what happens when an error is produce; therefore, debugging is process to remove such bugs and prevent errors.
A quality of the application is determined with the amount of debugging efforts spent on it. No wonder nine out of ten times we build project in debug mode. A truth in developers life is no matter how much care is taken bugs does get into code. Even the most experienced developer can introduce a bug by doing silliest of silly mistake. I'd say nothing to worry; with a strong debugging support built into VS IDE, we can easily tackle the most notorious bug.
Different types of Errors!
Now we know bug produce error! So, what are the different types of errors? Well, let's divide them into the following three categories:
Design time error, I'd say most "friendly" errors of all. The simple reason is most of them can be fixed without much hassle. VS IDE feature Intellisense plays a big role to fix this error. Run time error, here you go, welcome to the world of panicking. Run time errors are real bad if they crash your application during demo session.
Third in list is logical error. Boy, here you basically gradate from state of panicking to hair pulling. On rather lighter note, at this time you also think of banging your head on your favorite keyboard or tossing the box out of the window.
Bugs which produce logical errors are nasty. As you can see, complier doesn't complaint on them. You'll also wont get any run time error; however, the result you are expecting, don't show up the same. In such scenarios debugger comes most handy. Let's look at the following example:
Imagine you are calculating average sales for each month. The formula is simple, "average sales per month = total sales / 12". Now at some point in your code instead of 12 you are dividing it by 13. So the result is not correct. To find out this 13 in code and replacing with 12, that is what debugger will help you with.
To demonstrate the debug technique we need to create a bug first. This is one of rare moments where you are deliberately creating a bug. So, have fun. Creating run time bug is not a big deal. You can see many situations which can result in run time error. For example, how about "Divided by Zero"? Or Array index out of the range error?
Let's go ahead and create a simple application which will produce a table of two and store the result in an array of ten subscripts. We'll introduce the error in loop, in which we read from array and display the table using multiline Textbox control. Please see
Figure 2, one button will produce the table and another one will result in a run time error..
Please do the following steps to create a Windows Application Project:
Figure: 2 - Process to create New Windows Application Project.
Figure: 3 - View of newly created project.
Most of you'll see something similar to what the Figure 3 looks like; however, depends on your current VS 2005 IDE settings, you might see some toolbox hidden or floating. Anyway, you should see the blank Form1 created for you because of new project. Please refer to VS2005 help to customize the look and feel of IDE.
Tip: You can always access the menu View Ø Toolbox or press Ctrl + Alt + X, to make Toolbox window visible. To get the maximum space on designer surface, you may like to use Auto Hide feature of Toolboxes.
Let's set properties of Form1 according to Table 1. In case if property toolbox is not visible in IDE, you may hit F4 key to make it visible. Pease make sure to select Form1 by before applying changes to properties using property toolbox.
Table 1. Properties of Form1
Property Value Text Windows Forms debugging 101 Size 300, 300
Property
Value
Text
Windows Forms debugging 101
Size
300, 300
Let's add controls to newly created Form1
The example is simple. As you can see in Figure 1, we'll have one RichTextBox control to enter and format text. We've two buttons to use for formatting the text and rest two to interact with Database.
We need the following controls on Form1:
Let's start by dragging and dropping above mentioned controls on the Form1.
You can add controls to Form1 in two different ways. First method is to double click on the control; second method is to drag and drop the needed control on the form. The second method gives you more control as it let you drop control on your exact preferred location.
Please make sure your Form1 looks like something similar to Figure 4.
Figure: 4 - Form1 designer surface after adding controls.
Please change the properties of controls on the form according to Table 2. Properties can be change by selecting the control and using properties toolbox. Please see Figure 5 for graphical illustration of the process.
Figure: 5 - Changing properties of controls on Form1.
Table 2. Properties setup of controls on Form1
Control Property Value textBox1 Multiline True Button1 Text Table with no Bug Button2 Text Table with Bug
Control
textBox1
Multiline
True
Button1
Table with no Bug
Button2
Table with Bug
Please make sure after the change of properties on Form1, your form should look similar to Figure 6.
Figure: 6 - Controls on Form1 after changing the properties.
Let's write some C# code to bring life to Form1
Please make sure code behind Form1 looks like the following:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WinDebug101
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
string[] TableOfTwo = new string[10];
int i;
// loop to calculate the table
for (i = 0; i < 10; i++)
{
// 2 x 1 = 2...
TableOfTwo[i] = "2 x " + Convert.ToString(i + 1) + " = " +
Convert.ToString(2 * (i + 1));
}
// loop to display the table
textBox1.Text = @textBox1.Text + TableOfTwo[i] + "\r\n";
private void button2_Click(object sender, EventArgs e)
Convert.ToString(2 * (i + 1));
for (i = 0; i < 11; i++)
}
}}
Code Analysis
Well, as you can see, the code is simple loop to produce table of two. First loop does the calculation and store result in array. The second loop reads through the array and displays the result in multilane enabled textbox. The code inside button1_click event is the "good" code. This code will not create any error and go on to calculate and display the table output.
The code inside button2_click event is the "bad" code. This code will produce a run time error because of the bug we introduce. So, can you spot the bug? Well, if you see the type of error, it is easy to find where is out bug. If you see Figure 1, it says error: Index was outside the bound of the array. This means the loop which display the result is trying to access array outside its limits.
So, the only difference between code behind both button is:
// loop to display the table
for (i = 0; i < 11; i++)
// 2 x 1 = 2...
textBox1.Text = @textBox1.Text + TableOfTwo[i] + "\r\n";}
As soon we try to access 11th physical array element, this bug causes program to halt and results in runtime error. You may also notice that I'm not using Try...Catch purposely here to display the error.
Let's build and run the example
Let's build the project. You can build a project in several different ways, if you just have one project in solution; building solution and project are the same. You can click on small Green Play button on main toolbox or hit F5 on keyboard to start the application in run time. Please also make sure to build using Debug mode. Please see Figure 7.
Figure: 7 - Project Build.
If all goes well, then you should be able to run the application. Let's click on "Table with no Bug" button. Because of this action you will see textbox populate with table of 2. Now, let's click on "Table with Bug" button. Aha, there you go, instead of result, the VS 2005 IDE comes up with a complaint of run time error! Your run time error screen should look similar to the run time error shown in Figure 1.
Let's debug our run-time error
As you can see in Figure 1, when a run-time error occur the execution of program halts where it encounter the error. In our example the execution stops while running loop which displays the table, here is the code snippet:
textBox1.Text = @textBox1.Text + TableOfTwo[i] + "\r\n";
}
When program stops at link inside the loop, what does it means to you as a developer? Well, it is obvious to say, this line has some functionality which is violating something! So, what do you think, what other information is given to developer by IDE to help get rid of the bug?
When an error happens the code throws "exception". This is our first channel of information as to what happened. In our example the type of exception is: "IndexOutOfRangeException". So what does it mean? Well, as u can see since we're using array and type of exception is prompting, something is wrong with index range. I would like to mention this, debugging is an ongoing learning process. The more the errors you will experience first hand the better debugging skills you'll get.
Apart from type of exception, Visual Studio IDE also provides different feedback windows to developer which can help to quickly resolve the error. On such feedback is Locals window. As you can see in Figure 8, we can see the current content of array TableOfTwo[] here. Most of the time just by analyzing the content of variable, one easily spots the bug.
Figure: 8 - Feedback Windows in Debug mode.
Watch window is another such feedback which you can use to specifically query value of any given object. Let's say you like to see the content of 4th physical element of the array. You can do so by switching to Watch window (in this case Watch1) and type TableOfTwo[3] and press enter. You will see that value column will show up with "2 x 4 = 8". Please see Figure 9 for graphical illustration.
Figure: 9 - Feedback Watch window in action.
In many cases we need to go step-by-step till we encounter the error. This way we get better know how of what exactly happen. This process can be done easily while in debug mode. First step is to decide about code location were we need the execution to pause. This way we can take control and move step-by-step till we hit the error.
This step is commonly referred as setting up break point. We can setup break point in two ways. First, to click on left most gray area of code line. Second method is to select the code line and press F9 key. Once break point is set, a Red bullet mark appear on line, suggesting when execution process sees this, it must stop. In our example since we like to go each step in loop to see at which point code is breaking. We've to setup break point at the loop entry code. Please see Figure 10 for the breakpoint setup.
Figure: 10 - Setting up break point.
Once the breakpoint is setup properly, you can step through the code in following ways:
As you can see in Figure 11, we've three ways to step through the code. Step Into means execute the currant line of code and move to next. If next line is call to another method then "Yellow" code pointer move to that code segment. Step Over means "Yellow" pointer move to the next line in the current code segment without stepping into any local methods that might be called by the current line. Finally, Step Out means current method to complete and the execution should halt on the next line of the method that called the current method.
If you like the program execution to continue as normal then you select Debug -> Step Over or hit F5 key. You can also start and stop debug by selecting appropriate command from Debug menu.
Figure: 11 - Stepping through in debug mode.
You can also access all these features with help of Debug Toolbar. Please see Figure 12 for graphical illustration.
Figure: 12 - Debug Toolbar.
Conclusion
As you can see, how simple it is to use powerful debug feature of Visual Studio IDE. With this article I tried to introduce the debugging process. I hope this article will help especially the beginner level audience to get started with debug process. Thank you for reading; as always I'm looking for comments and suggestion. Feel free to drop them at asif.blog@gmail.com.
©2014
C# Corner. All contents are copyright of their authors.
|
http://www.c-sharpcorner.com/UploadFile/asif.blog/WinDebug101CSharp04102007165017PM/WinDebug101CSharp.aspx
|
CC-MAIN-2014-41
|
refinedweb
| 2,373
| 74.59
|
01 October 2007 15:11 [Source: ICIS news]
LONDON (ICIS news)--INEOS NOVA’s joint venture has just been expanded to include NOVA’s STYRENIX unit and other styrenic polymer assets and is expected to post $3.8bn in revenues per annum, the two companies said on Monday.
?xml:namespace>
The expanded joint venture between INEOS and NOVA, which was announced in March, was set to generate earnings from manufacturing sites in the US, Canada, France, Germany, the Netherlands and Sweden, said INEOS NOVA, which is headquartered in Illinois.
“The venture will include production and global sales of styrene, polystyrene, performance polymers as well as expandable polystyrene in ?xml:namespace>
Dylark polymers will not be included in the joint venture and would continue to be manufactured and sold by NOVA Chemicals, said the company.
Prior to the joint venture, Alberta-based NOVA had been planning for some time to either sell STYRENIX or find a joint-venture solution for it.
INEOS is a UK-based chemicals company.INEOS is a UK-based chemicals.
|
http://www.icis.com/Articles/2007/10/01/9066720/ineos-nova-expands-jv-to-include-styrenics-unit.html
|
CC-MAIN-2013-20
|
refinedweb
| 173
| 51.07
|
27 March 2013 18:10 [Source: ICIS news]
WASHINGTON (ICIS)--US pending home sales edged lower in February from January, a key survey said on Wednesday, with the downturn blamed on a lack of available inventory that could further hamper a housing recovery.
In its monthly report, the National Association of Realtors (NAR) said that its pending home sales index (PHSI) fell by 0.4% in February from January, the third decline in the last four months.
The index was at 104.8 in February, the association said, down from the downwardly revised January reading of 105.2.
However, NAR noted that the.
The association's pending sales index is seen as a reliable, forward-looking indicator for near-term expectations in the ?xml:namespace>
The index is measured against a 100 baseline set by NAR in 2001 to represent an average or healthy pace of pending home sales contracts.
NAR chief economist Lawrence Yun said that limited inventory and continuing tight credit requirements are holding back the housing market.
“Only new home construction can genuinely help relieve the inventory shortage,” he said, “and housing starts need to rise at least 50% from current levels.”
However, as the Commerce Department reported on Tuesday, the pace of US new home construction, also known as housing starts, has been weak and rose by only 0.8% last month. data.
US sales of new single-family homes fell again in February, and market confidence among the nation’s home builders declined in March for the second consecutive month.
The US housing sector, especially new home construction, is a key downstream consumer industry for chemicals and res
|
http://www.icis.com/Articles/2013/03/27/9654213/us-pending-home-sales-fall-in-february-could-be-in-a-stall.html
|
CC-MAIN-2014-42
|
refinedweb
| 273
| 52.6
|
Handles the networking lobby. More...
#include <networking_lobby.hpp>
Handles the networking lobby.
This is the lobby screen that is shown on all clients, but not on the server.
It shows currently connected clients, and allows the 'master' client (i.e. the stk instance that created the server) to control the server. This especially means that it can initialise the actual start of the racing. This class is responsible for creating the ActivePlayers data structure for all local players (the ActivePlayer maps device to player, i.e. controls which device is used by which player). Note that a server does not create an instance of this class and will create the ActivePlayer data structure in LobbyProtocol::loadWorld().
implement callback from parent class GUIEngine::Screen
This function is a callback from the parent class, and is called each time this screen is shown to initialise the screen.
This class is responsible for creating the active players and binding them to the right device.
Reimplemented from GUIEngine::Screen.
|
https://doxygen.supertuxkart.net/classNetworkingLobby.html
|
CC-MAIN-2020-16
|
refinedweb
| 165
| 57.98
|
Overview
Atlassian Sourcetree is a free Git and Mercurial client for Windows.
Atlassian Sourcetree is a free Git and Mercurial client for Mac.
hlirc is a High-Level IRC interface. It's modular and tries to implement most basic IRC features without undertaking too much. Instead it provides a few features for module interoperability making it easy to implement even low-level IRC features as modules and use them in other modules.
Please refer to the tests directory (
t) for a more practical approach to
documentation.
IRC
It's an object (actually namespace) which maintains a single connection to an IRC server and contains modules implementing most of its behaviour.
hlirc::new
Creates a new IRC object. It has several methods.
$irc config key ?value?
Set or get a global (i.e. not module-level) configuration value.
$irc module-eval name body
Evaluates some code in the namespace of a module. If the module name isn't
loaded yet then it is loaded upon evaluating
module-eval. Then the code is
executed in the module's namespace.
You can use it to create temporary modules too. Just make name an empty
string and enter the module's body. Note however that temporary modules can't
call
module except for
module require.
$irc log level text
Logs a message.
$irc disconnect
Disconnects from the server.
$irc destroy
Disconnects then destroys the IRC object along with all loaded modules.
$irc connected
Returns true if the IRC object is currently connected.
There's also a way for modules to implement new commands which can be called
later using the IRC object. E.g.
connect is actually implemented in the
connection module.
$irc connect
connection module's command which makes the IRC object connect to hostname and port specified in the module's config.
Modules
::hlirc::define-module name body
Defines a module. Module is basically a namespace and works just as you expect a TCL namespace to work. body can have a few special commands to configure the module in several ways. The following commands (mostly module subcommands) are valid only inside define-module body:
module require dependency
The dependency will always be loaded before this module. All messages will be processed by the dependency first before being handed to this module.
module datadir
This command can be called anywhere inside a module, not just in its toplevel. It returns the full path to a module's own personal directory it can use for storing persistent data etc
module log level text
Logs a message with the module name.
module config key default comment
Defines a configuration value. It will be stored in the configuration file along with the comment. This command has another form which can be called anywhere:
module config key ?value?
It sets or returns (if value is omitted) the module's configuration value.
Wizard
module wizard body
Defines a wizard to configure this module. It's just a Tcl script which will be
run during bot initial start to set the configuration values. A few commands
only available inside
module wizard.
query question ?default? ?predicate? ?error?
It displays question and waits for user input. predicate is then applied to user input and if it yields a false value the error message is displayed and the user is allowed to enter another value.
Commands
It's the interface to hlirc's command parser. To declare a command bot's users can execute on the channel use this command inside the module body:
command name help body
body is a Tcl script which will be executed when a user calls this command. It has one special command to parse the arguments:
match matchspecs body
If the command arguments match the matchsecs the body is executed with
specified arguments bound to local variables. If the arguments don't match the
body is skipped.
match returns true if the arguments match and false
otherwise.
machspecs is a list of matchspecs. Each matchspec can be one of the following:
- A name. The next argument is bound to a ariable with this name.
- A list starting with var. The list's second element should be a variable name. Processed exactly as the previous matchspec.
- A list starting with literal. The list's second ite should be a string which is expected to be at this point in the list of arguments. If there's no such string the match imediately fails.
- A list starting with optliteral. The second element is a string which may be at this point in the argument list.
- A list starting with optvar. Processed like var except if the arguments are already exhausted its value would be the list's third argument.
- A list starting with rest. The second item is a variable name to bind the list of remaining arguments to.
- A list with a single item end. It checks that all arguments are processed. If there are more arguments left the match fails.
Special procs
There are two types of procedures which receive special treatment.
If a procedure name begins with
cmd- then it implements an extension method
for the IRC object this modules is loaded into.
If a procedure name begins with
do- then it implements an event handler.
Event names are the same as IRC message names and a few extra: connected and
eof.
Module built-in commands
irc
Returns the IRC object this module is loaded into. Can be used to call methods or extension methods.
yield-irc ?timeout?
Works like Tcl 8.6's yield but remembers parsed IRC message and implements
timeout. Always use this instead of
yield inside handlers or commands.
A few of the commands can be called only inside a message handler. That is
either a
command or a
do--proc except
do-eof and
do-connected.
action
CTCP action text.
msg
IRC message.
who
Who sent the IRC message.
target
Message's target. Usually its first argument.
additional ?index?
Return an additional argument or all of them if index is omitted.
|
https://bitbucket.org/naryl/hlirc
|
CC-MAIN-2018-51
|
refinedweb
| 1,001
| 67.86
|
Customs takes 30 seconds to walk through. However to get to that stage you have to go through Immigration which can take up to an hour.
If you are booking the flight as a through ticket with your flight to Miami (which you really should), then you won't go through either as you won't come landside. In which case the minimum connection allowed is 90 minutes.
If you are arranging your own connection on a separate ticket (which you really shouldn't), you will have to come through immigration and customs, possibly make your own way to another terminal, and check in and go through security again. Then you will need more like 4 hours.
wirewiper is right in that the minimum connection time is 90 minutes; he may be more risk-tolerant than I, as I would allow at least two hours (if not more) to make an airside connection at Heathrow.
T5 and T3 aren't near one another; should you book a through ticket (and you should) you'll take a bus from T5 Flight Connections to T3, with buses every five to 10 minutes and travel time of up to 15 minutes. There is the potential for queues at T3 Flight Connections Security, not to mention the potential delay of your flight from CDG or a delay in it getting on stand at T5.
The minimum connection time is just that: the bare minimum, considered as a best time for when everything goes to plan. That's not always the case in life, so allow some extra time, which you may or may not need, and reduce one stressor, even a little.
I'd fly in the night before. Your tolerance for risk may be higher, or it may not be you paying for a new flight to Miami should there be an issue and you miss it. In which case you need, as Wirewiper says, to be looking at flight that gets in by 9am latest and 8am much better. I wouldn't do 9am on my money.
American Airlines is partners with BA - this means that if your first flight is on BA you should be able to check your baggage all the way even on separate tickets, which would allow you to transfer airside and never enter the UK (European countries are different in that respect from the USA - we do airside transfers where you don't have to clear Immigration/Customs). But you want to check with BA to make sure.
On a through ticket (i.e., CDG-LHR-MIA all in one booking) it is the airline's responsibility to get you to your final destination if you miss your connection due to a delay. On a through ticket 90 minutes is fine as long as you don't HAVE TO get back to Miami at a specific time.
On separate tickets, with baggage checked through (or with hand baggage only) I always work on a minimum of four hours.
If you're unable to check your baggage all the way then, as a previous poster said, you really want to play safe and get to LHR the night before.
I'd definitely book a BA flight from Paris to LHR as the AA policy is to treat seperately ticketed flights as through ticketed flights where the flight is operated by a oneworld alliance partner. This should mean that if you miss the AA flight then they will still get you to Miami - see link for more details on the AA policy.
aa.com/i18n/…oneworld_tkt_policy.jsp
I am in a similar situation and need advice. Arriving LHR T1 on United fron Washington (IAD) at 0620. Will need to get to BA T5(?) for a connection to Amsterdam. However these had to be separate tickets as the first is free award travel. Is this still a through fare? I was planning not to have to go through immigration, customs, baggage etc. but now I'm confused. Amsterdam departure leaves at 0830.
Thanks in advance.
If you have bought separate tickets it's not a through fare, and it is very unlikely UA will interline your bags from a Star Alliance carrier to a oneWorld carrier especially with separate tickets. To that end you will need to go through passport control (at a very busy time of day at LHR), collect your bags and then schlep across the airport to T5.
Two hours *may* be enough time if all goes very well and you disembark as quickly as possible, but if the flght from PHX is delayed on departure or in getting on stand at LHR you will miss the flight to AMS. You will have to check in at T5 and be through Security no later than 35 minutes before scheduled flght departure or else you will be off loaded.
The landside connection between T1 and T5 will mean a hike from T1 Arrivals to the rail station for the free HEX shuttle to T5 - and those shuttles run just four times an hour. Taking a taxi from T1 to T5 could be a quicker option, but will cost about £10 - 14.
There are a great many potential sticking points for a landside connection, and two hours allows very little time for irrops. If you haven't booked the flight to AMS yet, I'd consider changing it to one that departs after 0930.
"However these had to be separate tickets as the first is free award travel. Is this still a through fare?"
Not if the tickets are booked separately. 2h10m is a lot less time to connect than I would be comfortable with.
I also would be very uncomfortable with such a tight connection, it requires everything to run to schedule. I
Note that if you miss it, the return (if there is one) will also be cancelled so you'll have to buy new, on the day return tickets.
On the upside they are running only about £215 to buy one for today (return) so probably similar to changing flights so you might just decide to chance it, plus its always possible BA will take pity on you and change it for free when you arrive late.
I agree with TravellerPlus, not the best thing to allow no contingency for separately ticketed flights.
On the positive side, my experience of immigration at T1 coming off that flight (and similar) is that it's very fast, even for non-EU citizens. I've waited no longer than 10 minutes in line and often gone straight to an officer. Plus, you'll have a long walk from the gate to the immigration hall, and if you walk fast you could pass as many pax as possible and beat them to the hall.
But, that said, it's still no guarantee that you'll make it to T5 in time for your onward flight, and if the inbound flight is delayed you'd be toast. So look into changing your onward BA flight to later.
|
https://www.tripadvisor.com/ShowTopic-g1-i10702-k6445919-Time_required_between_flights_at_Heathrow-Air_Travel.html
|
CC-MAIN-2017-47
|
refinedweb
| 1,176
| 75.74
|
CustomizedMetricSpecification
Represents a CloudWatch metric of your choosing for a target tracking scaling policy to use with Application Auto Scaling.
For information about the available metrics for a service, see Amazon an example of how creating new metrics can be useful, see Scaling based on Amazon SQS in the Amazon EC2 Auto Scaling User Guide. This topic mentions Auto Scaling groups, but the same scenario for Amazon SQS can apply to the target tracking scaling policies that you create for a Spot Fleet by using the Application Auto Scaling API.
For more information about the CloudWatch terminology below, see Amazon CloudWatch concepts in the Amazon CloudWatch User Guide.
Contents
- Dimensions
The dimensions of the metric.
Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.
Type: Array of MetricDimension objects
Required: No
- MetricName
The name of the metric. To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics.
Type: String
Required: Yes
- Namespace
The namespace of the metric.
Type: String
Required: Yes
- Statistic
The statistic of the metric.
Type: String
Valid Values:
Average | Minimum | Maximum | SampleCount | Sum
Required: Yes
- Unit
The unit of the metric. For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference.
Type: String
Required: No
See Also
For more information about using this API in one of the language-specific Amazon SDKs, see the following:
|
https://docs.amazonaws.cn/autoscaling/application/APIReference/API_CustomizedMetricSpecification.html
|
CC-MAIN-2022-33
|
refinedweb
| 249
| 52.09
|
Edward Loper wrote:
>>
I like the () option as it looks like cast. It is a great idea for
simple type, but when extending it complex type (or with formatting), I
believe it would be hard to read. How would this be translated into the
suggested format?
@param var1: first param.
@type var1: C{int} | C{None}
@param var2: an object
@type var2: L{search<re.search>}
--
Huu Da Tran <huuda.tran@...>
Fidèle esclave des félins
Qui m'insulte, parfois, me dit la vérité.
Qui me flatte, plus souvent qu'autrement, me ment!
> Epydoc is the best thing since the sliced bread happened for Python [...]
Thanks! :)
> I have been wondering if it where possible to make epytext markup even
> simpler. [...]
> 1. Leave out : (other languages don't use it either)
I'm actually fairly partial to that ": myself -- to my eyes, your
examples are hard to read because I don't know where the field body
begins. E.g. in your proposed:
@param int|str a parameter description here
I have a strong tendency to read "a" as an indefinite article, not a
variable name. Also, note that the "type description" doesn't have to
be a single word, or even a simple expression. I want people to be
able to express such notions as "dictionary from int to string" or
"sequence of int" or "nonnegative int," and human language is a great
way to do it. :) And finally, including the ":" explicitly allows us
to implement your suggestion (2) as an optional feature -- we don't
want all the docstrings people have already written suddenly and
mysteriously breaking when they upgrade epydoc!
>
> 3. Use | to separate different possible types
I'm not sure what you intend for the behavior to be here. You can
already write "int|str", and it will be rendered as such in your
output. Do you want the "|" to get translated to "or" in the output?
If not, why not just write "int or str"?
So with this modified proposal (keep ":", allow types as prefix
strings, and just use "or"), your example function would be:
def f(a, b):
"""
@param int or str a: parameter description here
@param module.Class b: parameter description here
@return float: return value description here
""""
An open question is how the "type prefix" string would interact with
epydoc's current support for having a single "@param" that describes
multiple parameters. E.g.:
@def f(x, y):
"""
@param x, y: The coordinates of some point.
"""
We wouldn't want "x," being interpreted as a type for y! This would
be one advantage of a syntax like "@param x (int): ..." that more
explicitly marks the type expression.
-Edward
Hi all,
Epydoc is the best thing since the sliced bread happened for Python which
otherwise lacks naming conventions and such. The goal of documentation is to
make the process simple as possible, so that it wouldn't "hinder" the work
of development and that's what Epydoc does well.
I have been wondering if it where possible to make epytext markup even
simpler. Based on my experiences in PHP and Java formal comment blocks, here
are some suggestions:
def f(a, b):
"""
@param int|str a parameter description here
@param module.Class b parameter description here
@return c float return value description here
""""
Versus (old style)
def f(a, b):
"""
@param a: parameter description here
@type a: int
@type a: str
@param b: parameter description here
@type b: module.Class
@return: return value description here
@rtype: float
"""
I see a consirably win =)
1. Leave out : (other languages don't use it either)
2. Leave out @type, @rtype and describe type inline as the first word of
parameter paragraph.
3. Use | to separate different possible types
These changes can be made compatible with existing Epytext markup with some
smart logic (i.e. new syntax if effective if : is left out).
Now, tell my why this wouldn't be possible or I start to submit patches :)
--
Mikko Ohtamaa
Red Innovation Ltd.
+358 40 743 9707
Every problem is solvable if you can throw enough energy drinks at it
I agree to receive quotes, newsletters and other information from sourceforge.net and its partners regarding IT services and products. I understand that I can withdraw my consent at any time. Please refer to our Privacy Policy or Contact Us for more details
|
https://sourceforge.net/p/epydoc/mailman/epydoc-devel/?style=flat&viewmonth=200802&viewday=15
|
CC-MAIN-2017-30
|
refinedweb
| 724
| 62.38
|
23 September 2009 16:44 [Source: ICIS news]
By John Richardson
SINGAPORE (ICIS news)--Firm crude and naphtha could be the only factors setting a floor for petrochemical pricing in the fourth quarter and early 2010 as demand in China weakens, warned a senior executive with a major Asian producer this week.
“Margins will also get compressed by new start-ups looking for a home. More folks will get hurt in the process,” he said.
Provided there is no major disruption to crude production during this year’s US hurricane season - which runs from 1 June to 30 November - oil could be down to around $45/bbl by October, is one view.
West Texas Intermediate (WTI) for November delivery was at $71.22/bbl on Tuesday.
Storage space in some regions might be approaching full, prompting traders to lose their nerve and short the market, is an argument behind the fears over a collapse.
Nobody disagrees that confidence in futures markets is way out of sync with physical demand; oil and oil-product storage remain at or close to record-high levels.
“The high onshore and offshore inventories of middle distillates worldwide should handle the seasonal (northern hemisphere winter) pick-up in demand,” N Ravivenkatesh of oil and gas consultancy Purvin & Gertz in Singapore said– illustrating just how out-of-kilter markets seem at first glance.
“This means there will be no need to raise refinery operating rates substantially in the fourth quarter.”
But he is beginning to wonder whether the sheer weight of financial speculation, and general economic confidence, will keep equity and commodity markets afloat until real demand for everything catches up.
“Perhaps the problem is we’ve looked too heavily at supply and demand from oil down to finished goods.
“I thought, like a lot of other people, that this would be a bubble; maybe not and so, maybe, we should look more at international capital flows in future,” Ravivenkatesh said.
“If you look at the fundamentals, $20-30/bbl should be deducted from the current oil price because of speculation,” his Purvin & Gertz colleague, Victor Shum, added.
“But this is nothing new, of course. Since 2003 oil prices have moved in inverse proportion to inventory levels.”
His view, too, is that there could well be no dramatic collapse before the fundamentals catch up.
“We might even be entering a new period of price stability,” said the principal senior principal consultant, who is also based in ?xml:namespace>
“Physical tightness will return. This may have already been factored into pricing, meaning that there will be no repeat of crude well in excess of $100/bbl.”
Dated Brent and West Texas Intermediate (WTI) will trade at $65-70/bbl for the rest of year if there are no considerable hurricane disruptions, said the consultancy.
Its WTI forecast for 2010 is an average price of around $73/bbl.
East of Suez naphtha deficits for October will be slightly higher than Purvin & Gertz had predicted in August, Ravivenkatesh added in his September Asian Petrochemical Feedstock Market Outlook.
“Cracker operating rates are higher as a result of reduced ethylene exports from
Both the Jam Petrochemical and Ayra Sasol crackers at Asssaluyeh in
This C2 tightness counteracted earlier downward pressure on Asian operating rates from increased
But he warned that new start-ups in the Middle East and
This downward pressure on naphtha will to some extent be compensated for by higher reformer operating rates in the Middle East and
The total Asian naphtha deficit is expected to be approximately 3.3m tonnes in September and 3.4m tonnes in October.
However, it is forecast to fall to 2.75m tonnes in November and 2.81m tonnes in December.
Here is some more good news:
And on a much smaller level it’s possible that low Asian fluid catalytic cracker (FCC) operating rates could continue to support propylene prices.
FCCs have been running low on weak gasoline demand – another sign of the strange split between confidence and actual consumption.
But here is some bad news: Overall reformer margins will remain positive leading to high operating rates for the remainder of 2010, said Purvin & Gertz.
This is likely to squeeze cracker-based aromatics players.
Benzene, toluene and xylenes (BTX) reformer-based output is expected to increase during the fourth quarter as new plants start-up.
Greater coal-based C6 capacity in
But, it could still be a bubble. Keep your fingers and toes crossed that everyone, including the oil traders, holds their nerves and so avoids a repeat of September 2008.
To discuss issues facing the chemical industry go to ICIS connect
Read.
|
http://www.icis.com/Articles/2009/09/23/9249812/insight+waiting+for+the+fundamentals+to+catch+up.html
|
CC-MAIN-2013-20
|
refinedweb
| 770
| 59.64
|
Web sites and Web Applications today, are very often exposed beyond the borders of your home country, and therefore users speak different languages, and has a different currency, date- and time formats etc. ASP.NET provides you with an entire namespace for handling things like this. That is the System.Globalization namespace, where you will find a lot of classes for handling your every day globalization tasks. I’m not going to cover anything in this namespace now, if you want to get your hands dirty take a look at this video: where you will see how to use local and global resources for your application.
Using a global resource file for a place to store display text on buttons, labels, validation controls etc. is fine. But if you have an e-commerce site, selling products in multiple regions with different languages, you need an extra level. That level is a way to globalize e.g. the name and description of your product. When a user changes language, the name and description of your “display product details page” should change accordingly.
For me, the ideal solution should not result in extra database columns like nameus, nameda, name_es. This would be a very static solution, as you would have to change your database whenever a new language is added to your application. Nor should it require extra tables, so you need to join like hell, when you need to select a product.
I’ve decided to store e.g. the Name values as XML in the database, and parse that XML into a Dictionary
The XML string that goes into my ProductName column in the database table, looks like this:
On my Product object, the Name property is a Dictionary:
|
http://martinnormark.com/designing-for-internationalization/
|
CC-MAIN-2017-13
|
refinedweb
| 289
| 69.31
|
I think most Rubyists have picked up a good trick or two from Jim Weirich. Though it’s only a tiny part of his latest article (Using Flexmock to Test Computational Fluid Dynamics Code), I got excited to see his ‘Existence Test’ in his code:
def test_initial_conditions q = F3DQueue.new assert_not_nil q end
Looks pretty simple, eh? You might be quick to say that this doesn’t do anything. However, it is actually a pretty clever practice. This test makes sure the tests themselves are working as expected. I was already in the habit of starting with a failure, usually something like:
def test_doomed flunk end
The purpose of the above is simply to make sure your tests are picked up within your suite, and aren’t being overlooked by your Rakefile, autotest, or whatever runner you’re using. But the existence test actually goes a little farther. Because you’re initializing an object, you’re making sure that the files you need to be loading are present, that you can build your objects, *and* that your tests are hooked up.
After you’ve got a couple tests passing, you can remove this sanity check or morph it into a setup(), whatever makes sense.
Many people think this is a little paranoid, and most of the time, it is. Still, all it takes is one bad experience coding under falsely passing tests, and you’ll be converted in no time. :)
I don't get it. Unless you're afraid you might have accidentally said "def F3DQueue.new: return nil; end", what does the assertion add?
Sure, put "F3DQueue.new" in there to make sure your class is getting loaded and can instantiate itself. But why the assert_not_nil?
|
http://www.oreillynet.com/ruby/blog/2007/08/the_existence_test.html
|
crawl-002
|
refinedweb
| 287
| 72.97
|
Synthesis from conventional hardware design languages uses a large
number of process loops, each with a nominal thread, but restricts variables
to be updated by one thread, the number of such threads being determined
at compile time. There is no support for mutex variables. The lack of
signed arithmetic is also quite a severe problem for DSP designs in Verilog.
On the other hand, the software approaches to system design uses a thread
where there is a sequence of actions to be done and this thread can flow from
one module to another, using up and down calls, and updating variables inside those
modules under mutex locking. Threads can be dynamically created and terminated ans both
thread and routine handles can be stored in variables.
With these observations in mind, it is not suprising that
software has been easier to create than hardware. CTOV allows the designer
to use the tranche of software techniques when designing hardware.
CTOV is a compiler that reads ANSI C source code
and generates a synthesisable Verilog design which
performs the same function. The places where clock cycles are
consumed are either inferred by the compiler or correspond
to places where the programmer created a call to the built-in routine `cx_barrier'.
A given input design can be compiled and run as a normal C program,
using gcc, or can be compiled with CTOV to a chosen hardware
architecture. The architecture is characterised by the
number of RAMs, adders and multipliers allowed: the compiler works
out how to use these resources on a cycle-by-cycle basis.
It is intended that CTOV is normally run from inside a makefile
and that, for large designs, separate compilations from CTOV (and
other Verilog producing compilers) are combined as instances in a
higher-level Verilog module.
Special features of CTOV are:
Designs can be compiled back and forwards between C and Verilog
using alternately VTOC and CTOV.
For most, existing, large C programs, it is not surprising to learn that CTOV cannot compile
them into hardware. CTOV has various restrictions, the most severe being that
many of the functions of the posix libraries and system call interface are
not available. There are a couple of restrictions on the actual C language code
as well, and these are described in this section.
Using CTOV, the exact number of bits required for data storage must be
determined at compile time. Therefore the C code for compilation may
not use recursive routines or malloc for heap access. All pointer
variables must be compile-time resolvable to specific arrays or
functions. The user can define an array to act as `main memory'
and write his own malloc routine to assign areas within it if desired.
In version 2, the restriction to non-recursive
functions will be lifted.
Floating point arithmetic is not supported at run time in the
generated hardware. All floating point arithemetic is performed at compile
time and then the result is truncated to an integer in the object code.
CTOV is run from a command line or makefile. It reads
one or more C files and special versions of the standard
C library files and include files. The include files are in
the cxincludes directory which forms part
of the distribution.
In a given compilation, the C routine whose name is given by the
command line flage -iroot and all routines called
by it are compiled. The output is a single Verilog module whose name
is given by the -oroot command line option.
The inputs and outputs to the generated hardware are the formal
parameters to the top level module and any free variables which have
been declared to be I/O using an IOMAP macro. SRAM blocks can be
placed outside the generated target module, which is useful for large
RAMs in the FPGA environment, in which case the connections to such SRAM
blocks may also be present as I/O ports to the generated module.
A pair of additional inputs are generated by the compiler for all
designs (except for fully combinatorial designs) `clk' and
`cx_reset'. These are the master clock and the master synchronous,
active high reset. If these signals are alread present in the signature
of the top-level routine then the existing signals are used.
The input design should list them in the order clk, cx_reset as
the first two arguments. Note that this is the order generated
by the companion VTOC program.
Apart from the main input C file(s) and the main output Verilog file,
an additional `.ctl' file may be read in to control the compilation
and a `.rpt' file is written out.
The control file name may be specified with the `-ctl fn' command
line flag. The report file name may be specified with the `-rpt fn'
command line flag.
If no control file is specified, the top `.c' source file is used
read as the control file. Owing to the form of control commands,
they may be embedded by the user inside comments in the `.c' file.
If no report file is specified, the default name is the same
as the `.c' source file but with the suffix changed to `.rpt'.
Note that the report file generated by one compilation is suitable
for direct use as the control file for a subsequent compilation.
However, in practice, users might paste selected lines from a report
file into a manually-maintained control file using a text editor.
So that the control file commands can be easily extracted when they
are embedded in source files or report files, each command starts with
the string `$TTSET' and ends with the string `$'. The command
consists of a number of alphanumeric strings separated by white space
or other punctuations characters, including the vertical
stile used in tables.
CTOV will accept exactly one C filename from the command line. Access
to source code from multiple files in one compilation is either via
system libraries or via #include directives in the C file first specified.
Multiple compilations from CTOV will lead to multiple output
Verilog modules. These can be stitched together, manually, in the
Verilog domain by instantiating them in higher-level modules.
The compiler will automatically select one of the
following three modes of compilation. These are demonstrated in the examples section of this
manual.
A fully combinatorial design needs no clock and so the compiler will
not automatically add the clock and reset nets to the signature port list.
A one cycle design corresponds to a design with no requirement
for a run-time program counter. All assignments to variables can
be made in parallel using Verilog RTL constructs.
A sequenced design requires a run-time program counter. The
compiler generates RTL Verilog (as opposed to behavioural Verilog) and
an additional variable called `tt_statereg' which acts as a program
counter and as a sequencer to schedule accesses to RAM arrays. For
multi-threaded designs where the number of threads does not change at
run-time, one such state register is created per thread. When the
number of threads may change, the compiler generates multiple DFFs and
uses one hot coding to record the thread state where necessary.
The compilation mode and the mapping of barrier statements to values
of tt_statereg is shown in the report file.
The user can use the normal C datatypes: byte, short, int and long int.
These may be qualified as signed or unsigned. In addtion, the
include file < cxtypes.h> has definitions of variables
with explicit widths in bits. For instance a u5
is a five-bit unsigned quantity. For normal C compilation, these
macro definitions expand to the next largest standard C type, but
for CTOV compilation, the compiler takes not of the detailed width.
This can lead to variations in program function if a design relies
on the bits which fall between a CTOV sized variable and the next
largest C variable.
All of the variables in the souce C program are mapped to static
addresses in the generated hardware, either in register variables or
in RAM arrays. Nonetheless, the keyword static has a meaning when
a routine is compiled by CTOV. Taking this example
void xfun(... )
{
static int x = 3; int y = 2;
...
}
Variables in different scopes with the same textual name are given
unique names by appending an integer to the textual name. This action
can be seen in the report file. Where a give subroutine is called
from a large number of places, the local variables will by default be
mapped to unique register names (unless they are declared static).
Making them share the same register is a backtracking optimisation
(see backtracking notes).
Formal parameters to subroutines will generally evaporate in the
compilation process unless they are used also as working variables inside
the body of that subroutine (i.e. are assigned to).
If a program takes the address of a variable, this can safely be used
as a pointer to that variable later on. Where the values of these
pointers do not evaporate at compile time, numeric values are invented
by CTOV and used at run time. The numeric values are shown in the report
file.
The normal C sequencing of variables in memory space is not preserved by
CTOV V1, so performing arithemtic on pointers to anything other than array
subscripts is not supported. This rule will defeats any attemt to implement `varargs.h'.
The addressing of consecutive components of a structure or union is also
not implemented.
Memories must be on chip or offchip. CTOV will generate instances
of memories and the signals to connect to them, but the user must
provide the actual memories in the target technology environment.
The name of a memory always starts `SSRAM' and is then extended
with width, length and port descriptions encoded into part of the
name.
All memories have a clock input and data is stored in a memory
via a write port if the associated write enable signal is high on
the positive edge of the clock. Memories are L words long and W bits
wide and L must be a power of 2. Write ports have a write enable signal
and a W-bit wide input bus. Read ports have a W-bit wide read bus.
A memory may have any number of ports. Each port has
an address bus of log2 L bits. Each port must fit one of
the following forms:
The RW and RWD ports have two sets of data wires, one for reading and
one for writing, but only one set is used during any clock cycle. The
two sets can be merged into a tri-state bus if the user places
suitable tri-state buffers in a wrapper file (pad ring) which instantiates
the module(s) generated by CTOV run(s).
Each output array needs to be delcared and then the ports
can be defined afterwards.
The following command will define an output array called `holya'
of width 32 bits and length 5 words. The minus sign is shorthand
for `onchip'. The alternative allowable value is `offchip'.
declare_output_array - holya 32 5
This declaration will make an entry in the Ram Array Report as
follows. The number of ports and other information is added after the
closing dollars marker and so does not form part of the declaration
command.
CTOV Ram Array Report
*-----------------------------+------+-------+-------+-----------+---------*
| Array command | Mode | Name | Width | Locations | # Ports |
*-----------------------------+------+-------+-------+-----------+---------*
| $TTSET declare_output_array | - | holya | 32 | 5 $ | 2 |
*-----------------------------+------+-------+-------+-----------+---------*
Flags: static=1, register=2, unsigned=4, voltaile=8, const=64
Ports are added to a declared output array using the commands like the
following command, which adds the second port (0 is first) of type read
only to output array 'holya'.
declare_array_port holya 1 RO
Output array holya, width=32, length=5
Ports
*---------------------------------+-------------+-------*
| Port command | Port Number | Class |
*---------------------------------+-------------+-------*
| $TTSET declare_array_port holya | 1 | RO $ |
| $TTSET declare_array_port holya | 0 | WO $ |
*---------------------------------+-------------+-------*
An input scalar or array can be manually mapped to a location in an
output array provided the output array is sufficiently wide. The
locations selected for the mapping should not be in use for other
purposes.
The following command will map input scalar `mm' to location 5 of output
array `holya'. If there is more than one variable in the source code
with this name, all but one will be renamed by addition of a suffix. The new names
can be found in the report file, but may change from one compilation to another,
so if mapto is to be used, it is best to start with unique names.
TODO explain about multiple instances and scoping.
$TTSET mapto_output_array mm holya 5 $
The variable which is mapped (`mm') could equaly be an input
array, in which case the nunmber given becomes the base address of a
sequence of consecutive locations used for the input array in the
output array.
The number '5' could be replaced with a minus sign, in which case
the compiler will chose an otherwise unused location in the output array.
TODO this autoselection is not currently implemented.
The output array name can be replaced with a minus sign, in which
case the compiler will chose an output array to keep the scalar in.
It is inadvisable to allow the comipler to select if low compilation
effort is selected since a poor result is possible.
The final chosen maping of input variables is shown in the `CTOV
Input Register Report' table of the report file. This table is for
information only since it does not contain embedded control commands.
Note that the compiler cannot support generation of logic where
a combinatorial output depends on the value in a RAM array.
TODO explain how to map part of an input array to an output array.
Uninitialised, static arrays in the C source file will default to
onchip SSRAMs with a single RW port.
Initialised arrays in the C source file are converted to ROMs
and cannot be changed at runtime. This is a source language
restriction in CTOV version 1.
If an array has no ports declared, a single RW port is assumed.
If needed, a simulation model in Verilog of a RAM produced by CTOV can be
automatically generated by the CTOV_RAMGEN program which can be
run from the commandline.
CTOV V1 operates by expanding all subroutine calls into a flat
structure before further compilation. For both the top-level routine
and those called below it, input and output can be via free variables
(globals in C) or the parameters. Call-by-value parameters can only
be used as inputs since changes made to the formal parameter inside a
routine do not have side-effects on the outside environment. For
output, a value can be returned by a routine and call-by-reference
can be used to pass out other values.
CTOV supports three modes of compilation and these
support more than three major design styles.
A purely combinatorial design requires no clock or reset input and
has no internal state. This is illustrated here with an AND
gate.
Here;
}
We can generate a four bit counter with clock enable, synchronous
reset and combinatorial indication that the output is 15, with the
following section of C.
//
// A four bit counter, implemented in C, for compilation to Verilog.
//
#include < cxctypes.h>
void ctr4(u1 clk, u1 cx_reset, u1 cen, u4 *coutout, u1 *strobe)
{
static u4 state = 0;
if (reset) state = 0;
else if (cen) state = state + 1;
*coutout = state; // Moore output
cx_barrier(clk);
*strobe = (state == 15) && ~cx_reset; // Mealy output
}
In this example, the first two terminals given by the user are
called clk and cx_reset. Therefore the compiler will not need
to add these to the output Verilog module, meaning the output
module will have the same number of connections as the input module.
The most striking aspect of this section of code is the call the
the subroutine `cx_barrier'. The assignment to strobe on after the
barrier makes this a Mealy output that is a combinatorial function of
the current state and the input values, whereas state is a registered
(Moore) output.
If the barrier statement were missing.... TODO
The output Verilog created from this compilation is ... TODO
Here is an example run of CTOV .
There is no unique, optimal solution to non-trivial compilations.
The compiler makes heuristic choices at many points within its algorithms.
The user can influence the number of choices available and the number
of solutions explored. This alters the trade off between quality of
results and compile time.
The decisions made by CTOV during a particular compilation are
reflected in the report file in many places, but particularly in a
concise decision report table. The information in the decision report
table is not intended to be fully comprehensible by the user but it
can be read in as part for the control file for a subsequent
recompilation, perhaps after a minor modification. The user needs to
be aware that decision information from previous compilations may not
be helpful if there have been significant changes to the source
program or if it is intended to recompile with greater effort or
different metrics: therefore the user should delete or otherwise avoid
feeding the decision information into subsequent comilations in these
circumstances.
A set of basic, standard C library routines is provided in the
directory cxlibc which is part of the standard
distribution. These libraries include basic string routines and
ctypes and so on. The routines are written in standard C.
The system currently requires VTOC to have been installed and that
a soft link to the cv3core binary with the name `ctov' is placed on
the PATH shell variable.
The TTCTOV shell variable should point to a directory containing
the CTOV distribution, including the following directories:
Note that the C preprocessor has the flag TTCTOV defined
when invoked by CTOV and this may be used by the designer to
control compilation if desired. One additional flag can be
passed in from the CTOV command line using the `-CD flag' argument.
The CVMETAPATH variable must include the directory CTOV/sml ahead
of the VTOC entries.
A valid license file called LICENSE.cv3 should be in one of the
directories on the CVMETAPATH. Contact us for license information.
Once installed and setup, the following help message should be
displayed upon executing `ctov'.
CBG/TT CVA EDA CORE (Core release 1.3n shep pg ). Nov 15 1999
usenix:
ctov [ options ] -read fn [ options ]
Normal options are:
-about print version and license information
-o specify output filename
-f read further command arguments from file
-files short for -f files
-I override CVPATH directory list
+libdir+ add to CVPATH directory list
-M override CVMETAPATH directory list
-vm n tell garbage collector the target VM use to n in Mbytes
-hardvm n set hard limit on VM use to n in Mbytes
-vndebug cause large backtrace on any error
-CTOV <.> override CTOV root environment setting
-rpt <.> give name of report file
-ctl <.> give name of mapping and rolling info file
-pathlen n set the pathlength (default 300)
-iroot <.> give name of top level c routine to compile (default is
main)
-oroot <.> give name of output verilog module
-quiet <.> disable progress messages during long compilations
-read <.> give file name to be processed (with or without .c suffix)
-verbose verbose style progress reports
The pathlen parameter is a limit on the number of barrier steps from
the top of the flow graph derived from the input C files to any point
that is actually executed. If the compiler exits with `pathlen exceeded'
error, then the user can try to increase this limit. This situation
may occur when a great deal of loop unwinding is needed or when the
input program is long in the sense of a linear chain of barriers.
|
http://www.cl.cam.ac.uk/~djg11/cvtovpage-real/ctov-manual.html
|
CC-MAIN-2015-35
|
refinedweb
| 3,276
| 60.75
|
For just over a year I’ve been obsessed on-and-off with a project ever since I stayed in the town of Skibbereen, Ireland. Taking data from the 1901 and 1911 Irish censuses, I hoped I would be able to find a way to reliably link resident records from the two together to identify the same residents.
Since then I’ve learned a bit about master data management and record linkage and so I thought I would give it another stab.
Here I’d like to talk about how I’ve been matching records based on the local data space around objects to improve my record linkage scoring.
The data model of the imported data is very linear:
In this post, however, I’m going to be focusing on Houses and Residents and creating relationships between them based on their properties.
Relations to the Head
To view an example of what a census record from 1911 Ireland looks like you can have a look at the McCarthys of 1901 and 1911. Charles is the head of the family with his wife Hannah, mother Ellen, children (two in 1901 and seven in 1911), and a servant (Timothy Walsh in 1901 and William Regan in 1911).
The McCarthys are an almost exact match between two census records between 1901 and 1911. The names, ages, occupations, and relationships all match perfectly.
Unfortunately the story for other records is not so simple. Many times, houses – which to the human eye seem to be the same house – can have wildly varying details. For example, Hannah might go be listed as Hana or Anne in a different census.
Likewise, ages vary a lot more than you might think. In examining the records I regularly found ages varying by a year or two and have even found a few houses with ages off by as much as 10-15 years.
In both censuses, there is a field for residents to fill out called “Relation to Head.” This gives us information about how each resident is related to the head of the house. In the case of the McCarthys, Charles is listed as “Head of Family” in both years. The rest of the family has a nice representation of things that we often see in the data: “Wife,” “Son,” “Daughter,” and “Servant.”
We might be tempted to say, “This person was the head in 1901, so they must be the same person who was the head in 1911.” Often, however, the head of the family can die or retire leaving the role of head of the family to their wife or child.
So, can the “Relation to Head” values still be useful to us to match any given resident from 1901 to another resident in 1911?
First, let’s cover the general process of record linkage I have been using. To find a match for a resident, I start by using an
Elasticsearch server (which contains a duplicate of my Neo4j census data) to quickly find a list of other residents with a match on very rough criteria:
- Is the resident in the other census?
- Does the sex match (or is it
NULL)?
- Is the resident’s age within 15 years of what it would be expected to be in the other census?
- Does the name match, roughly (within an edit distance of 4)?
This comes back with anywhere from zero to hundreds of results. I call these “similarity candidates” and for each one, I create a relationship between the original record and the candidate.
With this list, I can compare the attributes of the two records (using the record_linkage gem I created) to see how closely they match.
The closer their name, sex, age, etc. matches, the higher score they get. Ideally, the real match should have the highest score, but that isn’t always true and can take some tuning.
In addition to this simple comparison of attributes, I have now added a process to take advantage of the similarity candidate relationships to compare family relationships.
Let’s start with this example of a sub-graph pattern:
The relationship
CHILD_OF is created whenever there is a “Son” or “Daughter” in the “Relation to Head” field. Likewise, we can create other gender-neutral relationships like
MARRIED_TO,
SIBLING_OF,
NIECE_NEPHEW_OF, etc….
In this case, the resident in question is the 1901 record for William. When we are evaluating the 1911 record of William as a potential match we can explore other residents in the same house as evidence of similarity.
The diagram above shows that both records have a
CHILD_OF relationship to the two “Charles” records which furthermore are linked via a
SIMILARITY_CANDIDATE relationship. Because of this we can say that there is a greater chance that the two “William” records represent the same person.
This only gives us the ability to find these relationships between the head of the family and other residents. What about generically matching based on the relationship of any two residents of a house?
Let’s say that Charles died sometime between 1901 and 1911. If his wife Hannah takes over as the head of the family, we would have a sub-graph which looks like this:
We could say that when we have the paths
-CHILD_OF-><-MARIED_TO- and
-CHILD_OF-> on either side that we can build our case for a match a bit more. This kind of matching can be used on all of the other residents of the house with
SIMILARITY_CANDIDATE relationships.
For example,
-CHILD_OF-><-CHILD_OF- could be matched to
-CHILD_OF-><-CHILD_OF- even in this case, where the wife becomes the head of the house. Or if a child becomes the head then it could be compared to a
-SIBLING_OF- relationship.
The Code
So how do we actually do this with Neo4j? First let’s take our sub-graph and turn our nodes into variables:
In this example let’s take resident
h1 r1 (house 1, resident 1) as the resident in question and
h2 r1 as the candidate that we want to compare it to. This is the sort of query that Neo4j is wonderful at both performing quickly and making easy to formulate.
Let’s look at part of the Ruby code:
def get_similarity_candidate_relationship_paths self.query_as(:h1_r1) .match('(h1:House), (h2:House)') .match('h1<-[:LIVES_IN]-h1_r1-[sc_1:similarity_candidate]-(h2_r1)-[:LIVES_IN]->h2') .match('h1<-[:LIVES_IN]-h1_r2-[sc_2:similarity_candidate]-(h2_r2)-[:LIVES_IN]->h2') .match('path1=h1_r1-[:born_to|married_to|grandchild_of|niece_nephew_of|sibling_of |cousin_of|child_in_law_of|step_child_of*1..2]-h1_r2') .match('path2=h2_r1-[:born_to|married_to|grandchild_of|niece_nephew_of|sibling_of |cousin_of|child_in_law_of|step_child_of*1..2]-h2_r2') .pluck( :h2_r1, 'collect([path1, rels(path1), path2, rels(path2)])' ).each_with_object({}) do |(r2, data), result| result[r2] = data.inject(0) do |total, (path1, rels1, path2, rels2)| relations1 = relation_string_from_path_and_rels(path1, rels1) relations2 = relation_string_from_path_and_rels(path2, rels2) if relations1 == relations2 1.0 elsif score = (RELATION_EQUIVILENCE_SCORES[relations1] || {})[relations2] score else -2.0 end + total end end end
Here we start with a Cypher query using the
Query API from neo4j.rb. The object upon which we’ve called
get_similarity_candidate_relationship_paths is our
h1_r1 anchor.
Note here that we match paths with a length of either one or two relationships long from between two residents of the same house. Then we return all residents found via the
SIMILARITY_CANDIDATE relationship from our anchor and the family relationship paths aggregated into an Array.
Once the Cypher query returns data we call
relation_string_from_path_and_rels which is a way of transforming the path into a string like
-BORN_TO-><-BORN_TO. This string gives us a simple way to express the path between the two residents as a string.
We then can give a score based on the two paths. If the paths are the same then we say that the score is 1.0. If the pair of paths is something like
-BORN_TO-><-BORN_TO and
-SIBLING_OF-> then we can give a score based on a lookup.
We add these scores up to give us a total score comparing our anchor resident and each of it’s similarity candidates. All with just one query to the database.
Challenges
There are a couple of things that I needed to do to make this work:
Previously, I was simply grabbing one resident at a time, finding all of the similarity candidates, and then creating a set of relationships to link the resident with the candidates and to store the record linkage scores (both the individual scores for fields and the total score).
However, this approach requires all of the candidates in the house to have
SIMILARITY_CANDIDATE relationships in order to compare family relationships. So now I first process all residents for a house to create the similarity candidate relationships and store the record linkage scores and then go through them again with the graph-based comparisons and store that score and update the total.
Beyond that, there is the conceptual problem of determining the scoring when comparing paths. For example, if somebody was
BORN_TO the head one year but their spouse takes over as the head, could we say that they’re
BORN_TO the spouse if they are are a step-child? Family relationships are complicated and don’t always fit neatly into our properties and algorithms.
Conclusion
Most record linkage focuses on the properties of an object, but we need to remember that relationships are data about our entities too. With Neo4j, we have a powerful tool for analyzing those data relationships naturally and quickly.
Additionally I have found that the ability to create relationships on the fly to aggregate calculations like the ones discussed above is a wonderful way to find the best solution quickly.
Want to learn more about how to use Neo4j for your project? Click below to get your free copy of the Learning Neo4j ebook and catch up to speed with the world’s leading graph database.
Keywords: census data cypher data model Data Relationships elasticsearch graph structure Master Data Management neo4j record linkage ruby
About the Author
Brian Underwood , Neo4j Advocate
Brian Underwood wants challenges that give him a chance to make the world kinder, simpler and more interesting. If you can give those challenges to him, you’ll be his new best friend. He loves what he made and the tools he used to make, but his pleasure comes more in the making and the learning of the new. He wants to make useful things that are bold, creative, and beautiful. He wants to make things that have never before existed.
1 Comment
Upcoming Event
Have a Graph Question?
Reach out and connect with the Neo4j staff.Stack Overflow
Community Forums
Share your Graph Story?
Hi Brian,
What a great post, thank you! I am attempting a similar project on health data linkage, which today has become a discipline of its own. So, I’m on the look out for other people that might have done it in graph. I wonder if you have had any experience with it? Thanks again for a great post!
|
https://neo4j.com/blog/graph-structure-record-linkage-with-neo4j/
|
CC-MAIN-2018-51
|
refinedweb
| 1,816
| 60.24
|
Hey Spiceheads,
I believe I've got a pretty interesting one here. First, a little back story. We use Meraki MX for our content filter and firewall. We have it synced with our Active Directory groups to apply content group policies through Meraki.We had been having steady problems with Youtube EDU and a few other content filtering problems. After contacting support, they say a new firmware update will solve the issue. We schedule it for the long weekend and it gets applied(i have no control over the update). I return on Tuesday to find that no one is getting their content group policies. If you can't authenticate, it is setup to give a default group policy, where a lot of things are blocked. After spending a lot of time with Meraki, they say that its on our server and there is nothing they can do. While I was willing to admit that there was a very slim possibly that this was an existing issue on our server, they still wouldn't revert the update.
Where I am at now. (We are running 2008 r2 SP1)
I basically found out that Meraki runs an WMI query on our server for certain event log ID's to see who has logged in and logged off successfully. Every time it was gettting a WMI quota violation. After checking the memory through wbemtest.exe, I saw that it was set at the correct default of 512MB(but converted to bytes). I even raised it to 1024, but have since reverted it because it didn't help the problem. I have ran WMIDIAG and can attach the logs if needed. Now here is where it gets weird, when Meraki is setup to query our server, we are getting over 500 errors from WMIDIAG. When we turn it off, less than 30. Even stranger, we get the same results on three separate servers that were all configured independently of each other. I eventually was able to turn on WMI-Activity logging in the event viewer and saw the following code being run(this is what the meraki query is running).
Start IWbemServices::ExecQuery - SELECT EventCode,InsertionStrings,RecordNumber FROM Win32_NTLogEvent WHERE Logfile = 'Security' AND Type LIKE '%Success%' AND (EventCode=540 OR EventCode=672 OR EventCode=4624 OR EventCode=4768);
It also had some other information about GroupOperationID and User. the namespace it was being run on was \\.\root\cimv2
If anyone has some insight or things to try, please let me know. I'm about at my wits end.
57 Replies
Jan 28, 2014 at 8:47 UTC
I'd be back on the blower to Meraki and get off 1st line, you need some 2nd or third line here.
Could be something as simple as you're not setup quite right at either end, esp if you did the install and not a specialist engineer.
Jan 28, 2014 at 11:58 UTC
I'd try to run that query in PowerShell to see if you get more information. It would look like this
Get-WmiObject -Query "SELECT EventCode,InsertionStrings,RecordNumber FROM Win32_NTLogEvent WHERE Logfile = 'Security' AND Type LIKE '%Success%' AND (EventCode=540 OR EventCode=672 OR EventCode=4624 OR EventCode=4768"
Jan 28, 2014 at 4:12 UTC
I supposedly got 2nd or 3rd tier... I did not install the update, it was pushed to our box.
Jan 28, 2014 at 4:16 UTC
I decided to break down what was going on and I ran this from the wbemtest.exe query. I then replaced each event code and finally ran them all together with OR statements and had no issues. It returned the exact number of objects in the event log(for each eventcode).
Select * From Win32_NTLogEvent WHERE Logfile = 'Security' and Type LIKE '%Success%'
AND EventCode=4624
The only part I wasn't sure I did right, was the "Select *", because I believe that pulls everything from "Win32_NTLogEvent", when they were only pulling a few specific items.
Jan 28, 2014 at 4:19 UTC
The Network Admin and I stayed late last night setting up a brand new sever, with a fresh install of 2008 R2. It did the exact same thing right off the bat. We will definitely be talking to Meraki later today, I just hope we don't get the same run around. Thanks for the replies and I'll keep you posted!
Feb 6, 2014 at 4:48 UTC
1st Post
Did you ever hear back from Meraki? we are having the same issue
Feb 7, 2014 at 6:10 UTC
No, still waiting. Meraki is still saying it's on our server, but Microsoft is saying they can't find anything. Finally got someone at Meraki to listen to me and I sent them a packet capture of traffic between the Meraki box and our server(I have been doing my own packet inspection while I was waiting). Pretty much, as soon as I enable Active Directory authentication, (it says 1-2 minutes to take affect) at the 2 minute mark it bombs the service and I can't run manual WMI queries using wbemtest.exe. I'm going on 2 weeks of this being broken.
What have they told you?
Feb 7, 2014 at 6:42 UTC
Brand Representative for SystemTools Software Inc.
How large, in terms of entries, is your Security event log ? I can't see how to get the records count from Event Viewer, but a query to Win32_NTEventLogFile will get it along with the size.
Where I'm going with this is that WMI is not very efficient at accessing event logs at all, its S.L.O.W. and I wonder if something is causing it to just choke on the amount of processing. There is also a configurable timeout on WMI calls that could also come into play.
Feb 7, 2014 at 6:50 UTC
It was 128MB(which was the default cap). I thought that was way to big, so I shrunk it down to 5MB. When I run the manual query for those 4 specific event ID's it returns about 3200 objects.
Feb 7, 2014 at 6:53 UTC
Brand Representative for SystemTools Software Inc.
And you are running that manual query using WMI or the built-in Event Viewer ?
Feb 7, 2014 at 6:54 UTC
wbemtest.exe(Windows Management Instrumentation Tester)
Feb 7, 2014 at 7:00 UTC
Brand Representative for SystemTools Software Inc.
Out of ideas, but I've never seen a WMI quota violation, either. Looking at the instructions, just make sure you granted the quota to the correct provider, etc. that is having the issue. Time to reboot ?
Feb 7, 2014 at 7:12 UTC
What do you mean by, "Just make sure you granted the quota to the correct provider".
I wish a reboot would fix it, sadly it has not. Without looking at the actual code, I don't think there is anything else I can do on my end. I have exhausted every option, except replacing the Meraki box or reverting the update(which is what I wanted to do in the first place).
Feb 7, 2014 at 7:22 UTC
Brand Representative for SystemTools Software Inc.
Sorry, I misread the instructions. I went through using wbemtest and see the quotas, not much to adjust except memory and few others. The quota error presumably could apply to any of the five or so values...The memory value for MemoryAllHosts was interesting, as if one host eats it all up, then presumably others could run out. Looks like an issue for Meraki...
Feb 7, 2014 at 7:25 UTC
That's exactly right. I even tried increasing the memory, but to no avail. I did not mess with that too much, because I figured that's just throwing memory at the symptom and that a solution should come from Meraki's end.
Feb 11, 2014 at 10:40 UTC
So after troubleshooting with Microsoft for a week and a half, they determined that nothing was wrong with WMI and that something was wrong on Meraki's end! I forwarded that email to my Meraki support contact and I am waiting for a callback. I'll post the resolution when we find one.
Feb 12, 2014 at 6:22 UTC
This is the email I received from Microsoft. As of today, Meraki still doesn't have any answers so we are going to do a conference call with Microsoft. After repeated attempts to get a MX400 sent out to test and see if it resolves the issue(which I think it will), I was denied saying "that wouldn't solve the issue", no technical details, nothing. They also would not let me speak to a systems engineer. Its now been over 2 weeks that this issue has been going on, which just happened to coincide with a firmware update that brought us from 99% functionality to 0%(for content filtering). I'm just very frustrated and I'm normally pretty level headed, usually siding with the poor call center folks. If anyone has any ideas about proceeding with Meraki to get a box sent out, let me know.
Hello James,
This is Dipak Chaudhary from Microsoft. As discussed on telephone I would like to share that there were no issues found with the core WMI Component.
We gathered the following loggings :- WMISPY.WMIDIAG,PERFMON and WMIMGMT and WMIPRVSE process dump.
We also verified WmiRepository and found it consistent.
We did not found any corruption in the logs.
Moreover all the WMI Queries run fine once you disable the Meraki AD Authentication. It clearly indicates that the issue is with Meraki and not with WMI Component.
Kindly engage the vendor as they should drive the case further.
Please revert in case you have a query.
Regards
Feb 12, 2014 at 8:06 UTC
This is from Meraki. (we are having the same exact issues you are)
John,
We could say the same about our Query, that we're sending it repeatedly and that there isn't an issue with this on all AD servers we have been able to setup. The query is the same across our entire customer base. Our logs do not show any corruption or errors. I don't think this type of response necessarily moves us forward.
I don't think we suspect there is something broken about the WMI component itself, but a configuration/setting that causes responses to be slow/timeout? If we can involve Microsoft and see if there is a way to check how many queries are active at once that would probably be more helpful to confirm this theory.
Regardless, we will have an AD server here that we will attempt to break in the same fashion.
Feb 12, 2014 at 8:23 UTC
Glad to see there is someone else in the same boat(well maybe not since it's been a bumpy ride). I don't think its even running the query(from the packet captures and logs i've looked at), I think it's stuck trying to authenticate and bouncing back and forth so much it overloads the service, like a denial of service. The logs are just filled with connected, then not connected seconds after over and over and over again. Turning Meraki AD authentication off, manual queries run fine all day. I turn it on and with in the "apply time"(1-2 minutes) It's down and I can't do anything.
The example I gave was if somethings is spamming traffic at a website and the site goes down, is it the websites fault or the device sending the illegitimate traffic. Something clearly seems to of went wrong with the firmware update and all I want is a box to test and verify this, so we can move forward.
What solutions have you tried and have you come to the same conclusion?
Feb 19, 2014 at 12:19 UTC
I'm quite upset with Meraki. After 3 weeks and contacting Microsoft you know what it was? Your active directory password cannot contain $, @, or ?...what the $@%*. No where in any of the documentation does it say anything like that and don't you think someone would of mentioned this when I first called? So apparently something was changed/not functioning properly in the new firmware update. I'll probably be sending them a bill.Edited Feb 19, 2014 at 3:37 UTC
Feb 19, 2014 at 2:15 UTC
1st Post
Feb 19, 2014 at 3:42 UTC
Still no luck for us. I created a brand new account with no special characters in the name or password. I set it up as a domain admin and listed it as the account under the active directory setting on the mx60 and 80. Wmi is still hogging up the processor and we are running around 90%
Feb 19, 2014 at 3:43 UTC
Ours was on a MX400. When I changed the password back to the old one, it broke everything again. 1. I can't believe this is actually happening(you'd think they'd have their code down). 2. I can't believe they didn't tell me this in the beginning.
From the vast amounts I have been reading from all this, That could be a memory leak issue. Our processor was never above 20%. Something like this:
Feb 24, 2014 at 2:34 UTC
I am not sure that this will help; but.
I use RADIUS Auth through our Meraki's, and discovered that with the setup I inherited there was a 6.x.x.x IP that the testing tool uses to request confirmation of settings. Once I added that as an authorised IP, things were fixed.
I identified it through the Windows event log as per:
I have no idea if this is what you're seeing, but I'm putting it out there as it may help someone.
|
https://community.spiceworks.com/topic/436539-meraki-and-wmi-queries
|
CC-MAIN-2017-43
|
refinedweb
| 2,338
| 71.44
|
NAME
Tickit::Widgets - load several Tickit::Widget classes at once
SYNOPSIS
use Tickit::Widgets qw( Static VBox HBox );
Equivalent to
use Tickit::Widget::Static; use Tickit::Widget::VBox; use Tickit::Widget::HBox;
DESCRIPTION
This module provides an
import utility to simplify code that uses many different Tickit::Widget subclasses. Instead of a
use line per module, you can simply
use this module and pass it the base name of each class. It will
require each of the modules.
Note that because each Widget module should be a pure object class with no exports, this utility does not run the
import method of the used classes.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
|
https://metacpan.org/pod/Tickit::Widgets
|
CC-MAIN-2017-26
|
refinedweb
| 112
| 51.38
|
Hi, I'm in trouble with the "boot from sd" issue.
I have a board that boot from ssp0 sd card. Fortunately I've a eeprom in my pcb.
I've programmed the eeprom with the freescale provided patch:
Patch for the SDK 2010.12 to fix the incorrect polarity when boot mode is set as boot from SD/eMMC on SSP0/1.
but the boot still fail when try to mount root fs.
No filesystem could mount root, tried: ext3 ext2 vfat msdos iso9660 ntfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
Backtrace:
[<c00344a8>] (dump_backtrace+0x0/0x114) from [<c03f1330>] (dump_stack+0x18/0x1c)
r7:c04a59ae r6:00008000 r5:c7c16022 r4:c05663d8
[<c03f1318>] (dump_stack+0x0/0x1c) from [<c03f13ac>] (panic+0x78/0xf4)
[<c03f1334>] (panic+0x0/0xf4) from [<c000902c>] (mount_block_root+0x1d8/0x218)
r3:00000000 r2:00000020 r1:c7c27f60 r0:c04a5a55
[<c0008e54>] (mount_block_root+0x0/0x218) from [<c0009130>] (mount_root+0xc4/0xf c)
[<c000906c>] (mount_root+0x0/0xfc) from [<c00092d4>] (prepare_namespace+0x16c/0x 1c4)
r5:c0029a29 r4:c0565760
[<c0009168>] (prepare_namespace+0x0/0x1c4) from [<c00084f8>] (kernel_init+0x128/ 0x170)
r5:c0028bd8 r4:c0565520
[<c00083d0>] (kernel_init+0x0/0x170) from [<c005010c>] (do_exit+0x0/0x6dc)
r5:c00083d0 r4:00000000
Obviously the sd and the root fs is ok, I've already done all the hardware controls and I'm sure is all right. I'm sure that the boot is from eeprom, because I've controlled it with an oscilloscope.
I've found only a solution, if I make a reset after the kernel panic, the board reboots itself and the boot process is ok.
Anyone have a solution that works for this incredibly (no fix scheduled) problem?
Thanks to all in advance.
Hi Marco
had you updated DDR settings with tool below
Board Bring-up and DDR Initialization Tools
also, had you tried other SD cards and does this SD boot
with i.MX28EVK ?
Best regards
igor
|
https://community.nxp.com/thread/341803
|
CC-MAIN-2018-22
|
refinedweb
| 314
| 68.3
|
I have an admin namespace in my app. I would like to have a layout that would work like app/layouts/application.html.erb, but instead off affecting the entire app it would only affect all the views inside of Admin::* How would this be done? Thanks, Elliott
on 2009-06-06 03:53
on 2009-06-06 07:03
Create a basic admin controller, like this: class Admin::BaseController < ApplicationController layout :admin end Then make all admin controllers inherit from it. And also create an layouts/admin.html.erb file ;) - Maurício Linhares (pt-br) | (en)
on 2009-06-07 22:29
Thanks Maurício. That worked nicely. On Jun 5, 11:02 pm, Maurício Linhares <removed_email_address@domain.invalid>
|
http://www.ruby-forum.com/topic/188770
|
CC-MAIN-2018-34
|
refinedweb
| 118
| 59.19
|
Microsoft Dynamics AX 2009 Programming: Getting Started — Save 50%
Get to grips with Microsoft Dynamics AX 2009 development quickly to build reliable and robust business applications with this book and eBook
When you are done with this article, you should be able to use .NET classes as reference classes in AX through the Common Language Runtime (CLR). The article will also guide you through the process of creating a .NET class in Visual Studio, and how to use it in AX. You will also learn how to use AX logic from external applications by using the .NET Business Connector.
All the Visual Studio examples in this article are written in C#.
Common Language Runtime
You might have done some .NET development before looking into X++ right? Maybe you're even a .NET expert? If so, you must have heard of CLR before. The CLR is a component of .NET that enables objects written in different languages to communicate with each other. CLR can be used in AX to combine functionality from .NET classes and libraries, including the ones you have yourself created in .NET. However, you cannot consume AX objects in .NET by using the CLR. Instead, you will then have to use the .NET Business Connector.
To learn more about the CLR, check out the following link:
One very useful feature in AX when dealing with integration between AX and .NET is the way AX implicitly converts the most common data types. For the data types listed in the next table you do not need to convert the data manually. For all other data types, you will have to convert them manually.
Enums are stored as integers in AX and are treated as integers when they are implicitly converted between .NET and AX.
We prove this by executing the next example that shows the conversion between System.String and str. The same can be done for any of the other data types in the above table.
static void ImplicitDataConversion(Args _args)
{
System.String netString;
str xppString;
;
// Converting from System.String to str
netString = "Hello AX!";
xppString = netString;
info(xppString);
// Converting from str to System.String
xppString = "Hello .NET!";
netString = xppString;
info(netString);
}
X++ is case insensitive, except when dealing with CLR. This means that writing System.string in the previous example will result in a compile error, whereas writing Str instead of str will not.
The result will look like this:
Adding a reference to a .NET class in AX
To be able to use .NET classes in AX you have to make sure that the .NET assembly that you would like to use in AX exists under the References node in the AOT. If you can't find it there, you have to add it by adding a reference to the DLL file that contains the assembly in the AOT under References.
When adding a reference node in the AOT you have to make sure that the DLL exists on all client computers. If there is a client computer in which the DLL does not exist, it will result in compile errors when compiling code on that client computer.
Assembly exist in the Global Assembly Cache
Follow these steps to add a reference that exists in the Global Assembly Cache:
- If the DLL has been added to the Global Assembly Cache, you can right-click on the Reference node in the AOT and select Add Reference.
- In the form that opens (see next screenshot), you should be able to find the desired DLL. Add it by clicking on the Select button.
- When you have selected the desired reference, click on the OK button. The assembly has now been added to the AOT, and can be used when writing X++ code.
Assembly not in Global Assembly Cache
If the file does not exist in the Global Assembly Cache follow these steps:
- Click on the Browse button in the Add Reference form shown above and find the DLL file.
- Click on Open. If the DLL is a valid assembly it will be added to the AOT under References.
Another option is to add the DLL to the Global Assembly Cache first and select it as described in the previous section, Assembly exist in the Global Assembly Cache.
Using a .NET class in X++
After having added a reference to the .NET assembly you want to use in AX, you can start writing the X++ code that will use the assembly.
When referencing the classes in the assembly you will need to write the whole namespace and class name. In my example I'm using an assembly that has been added to the AOT in the SYS layer. The example shows a nice feature that enables AX to send info messages to the Windows Event Log.
This can be particularly useful when you would like to use the Windows Event Log to monitor AX batch Jobs.
First, we add a new static method called writeLogEntry to the Global class:
static void writeLogEntry(Exception e, str caller, int line, str text)
{
// Use the standard .NET class EventLog from
// the System.Diagnostics assembly
System.Diagnostics.EventLog eventLog;
// Also use a .NET enumeration from the
// System.Diagnostics assembly
System.Diagnostics.EventLogEntryType entryType;
System.Exception clrException;
str stack;
Batch batch;
str batchInfo;
;
try
{
// Create a new object of the EventLog class
eventLog = new System.Diagnostics.EventLog();
eventLog.set_Source("Dynamics AX");
// Set the enumeration value based on the Exception
// type in AX
switch (e)
{
case Exception::Info :
entryType =
System.Diagnostics.EventLogEntryType::Information;
break;
case Exception::Warning :
entryType =
System.Diagnostics.EventLogEntryType::Warning;
break;
case Exception::Error :
entryType =
System.Diagnostics.EventLogEntryType::Error;
break;
}
// If the current user is running a batch job
// we can assume that the info message came
// from the batch job and add additional information
// to the event log
while select batch
where batch.Status == BatchStatus::Executing &&
batch.ExecutedBy == curuserid()
{
batchInfo += batch.GroupId + ': '+
classid2name(batch.ClassNumber) + 'n';
}
if (batchInfo)
eventLog.WriteEntry(strfmt("Batch info from AX: %1 nn
The message originated from :%2 nat line %3 nn
Message: %4", batchInfo, caller, line, text),
entryType);
else
eventLog.WriteEntry(strfmt("Info from AX: nn
The message originated from :%1 nat line %2 nn
Message: %3", caller, line, text), entryType);
}
catch(Exception::CLRError)
{
// If not able to write the info to the eventlog
// print an error in the print window instead.
print "EventWriter:
Unable to write entry to the windows eventlog";
}
Then we add a line of code at the end of the add method in the Info class so that the end of the method will look like this:
writeLogEntry(_exception, conpeek(packedAction,2) ,
conpeek(packedAction,3), _txt);
this.addSysInfoAction(_helpUrl, actionClassId, packedAction);
}
return super(_exception, (buildprefix?getprefix():'')+_txt);
}
To test the feature, simply create a new Job that prints something to the infolog:
static void TestEventLog(Args _args)
{
;
info("This is a test");
}
You will now see an infolog message in AX, and if you open the Windows Event Viewer you should see the following message in the list:
Double-clicking on the event will bring up information about the origin of the info and the message that was printed to the infolog in AX.
This example could easily be extended so you can enable or disable the feature for different users and select the level of messages to be sent to the EventLog.
.NET Business Connector
If you have external applications that need to integrate directly to AX logic you can easily achieve this by using the .NET Business Connector. A typical scenario can be that you would like your .NET application to execute some code in AX and have the result sent back to the .NET application.
The .NET Business Connector requires additional licenses. Make sure that the AX installation in which you want to make use of the .NET Business Connector has the necessary licenses before you start developing the solution.
In standard AX, the .NET Business Connector is also used by the Enterprise Portal through the Web Parts in SharePoint so that they can expose AX data and logic directly to the Web. It is also used by the standard Application Integration Framework (AIF).
The way that the .NET Business Connector works is that it offers a set of .NET managed classes that .NET applications use in order to log on to AX and execute methods in AX classes.
Here is a list of the different managed classes that can be used in .NET when you want to integrate to AX through the .NET Business Connector. The list is taken from the Dynamics AX SDK.
>> Continue Reading Working with Microsoft Dynamics AX and .NET: Part 2
About the Author :
Erlend Dalen
Er.
Post new comment
|
http://www.packtpub.com/article/working-with-microsoft-dynamics-ax-and-net-1
|
CC-MAIN-2014-10
|
refinedweb
| 1,443
| 65.93
|
For great speed.
Created attachment 524898 [details] [diff] [review]
patch
Created attachment 524899 [details] [diff] [review]
patch
Created attachment 524930 [details] [diff] [review]
Patch on top of the previous one to make it sorta compile and run
Still no support for item(), so the browser UI is a bit broken.
Created attachment 524931 [details] [diff] [review]
Patch on top of _that_ to not create a new wrapper every time
OK, so with this I see a 262 on my dromaeo firstChild test (instead of 200 with our old impl). But on my synthetic tests we're a bit slower than we used to be on one of them, and crash on the other one.
Created attachment 524933 [details] [diff] [review]
And now without the crashing
This at least runs.
Looking at the timings and profiles, it seems that [n] has gotten a good bit faster and that .length is _really_ slow now. So we should fix that second bit, and then measure some more.
The xpconnect code we added is also slower than it should be, but we can worry about that later. If I try to take the normal fast paths we call JS_WrapObject on our nodelist proxy and that crashes...
Created attachment 524934 [details] [diff] [review]
Without crashing for real
Created attachment 525034 [details] [diff] [review]
Rollup patch
This is as of this afternoon. When combined with the patch from bug 648943, this is about 2x faster than the old code.
Things that still need to be done:
1) Correctly hook up the wrapping process. Right now it's hooked into the wrong place, doesn't use the right prototype object, etc.
2) Implement .item() and probably .namedItem(); need to figure out what the plan is for the latter.
3) Implement expandos.
4) Fix cycle collector integration.
5) Make sure that security-wrapping works correctly.
Plus whatever fixmes are left in the code once we do all of that.
(In reply to comment #7)
> .namedItem()
I'd prefer not to add support for that. In any case, I hope there aren't any plans to change observable behaviour in this bug (except for speed).
> I'd prefer not to add support for that.
Uh... it's required by the spec and web compat. Keep in mind that this bug is about _all_ our nodelist/htmlcollection implemenations. And the latter needs .namedItem.
> I hope there aren't any plans to change observable behaviour
There are, actually. The current observable behavior that [n] keeps returning the node that used to be at that index even if the list length is now <= n will go away.
Per our discussion today, the plan goes like this:
* Add a virtual method on nsWrapperCache to decide what sort of object (proxy or
not, jsclass, proxy handler, etc) to create. Move towards having
nsWrapperCache on all DOM objects and renaming it to dom::Object or domObject
or nsISupportsDOMObject or whatever. This partially addresses item 1 in
comment 7
* Use a separate object for expandos. Have the nodelist c++ object mark the
expando object (need a separate map for this, with CC hooks); have the proxy
own the nodelist.
* Implement security wrappers for the proxy case by just creating a new proxy
that has a handler that knows to not look at the expandos, etc.
* Implement prototypes for security wrappers by basically creating a security
wrapper around the DOM prototype; the proxy will ignore the prototype in this
case anyway, so all we need this for is instanceof.
* For the non-proxy case, we can think about how to best do things, but having
some sort of extended jsclass per C++ class which knows about which things
the C++ class can cast to and how is probably the way to go.
* We'll need explicit hooks for returning non-DOM objects from DOM ones in the
rare cases this happens in.
(In reply to comment #10)
> * Add a virtual method on nsWrapperCache to decide what sort of object (proxy
> or
> not, jsclass, proxy handler, etc) to create.
We might want to add a member instead (since nsWrapperCache doesn't inherit from nsISupports, so we'd add another vtable pointer).
Created attachment 525504 [details] [diff] [review]
Patch as of this morning
Created attachment 525525 [details] [diff] [review]
patch
Created attachment 525532 [details] [diff] [review]
patch
Created attachment 525725 [details] [diff] [review]
patch with item caching (untested)
Based on timing measurements and profiles so far that cache is not working. Rebuilding debug to figure out what's going on.
This also doesn't compile if I do a whole-tree build; I'll try to fix that later tonight. By the way, I have an interdiff of this now, no thanks to bugzilla, but _please_ can we post interdiffs and not whole diffs against m-c? At some point this will need to be reviewed and we will need to break it up into sane chunks; doing that is much easier if we have it in pieces already.
We now have that compiling; item caching helps some, but ICs are needed to really win there (bug 649887).
I pushed a more or less rationalized queue of work so far to
Created attachment 549881 [details]
Some simple performance tests
Created attachment 553152 [details] [diff] [review]
JSAPI changes v1
These are the JSAPI changes that we need for the other patches.
Created attachment 553163 [details] [diff] [review]
JSAPI changes v1.1
Created attachment 553225 [details] [diff] [review]
Main patch v1
Your python files need license headers, and in nsWrapperCacheInlines.h, the Initial Developer is MoFo, not MoCo.
Created attachment 554653 [details] [diff] [review]
Main patch v1.1
Some minor fixes.
Created attachment 554877 [details] [diff] [review]
Main patch v1.2
Merged to trunk and simplified wrapper cache a little bit.
Created attachment 560560 [details]
Generated code example (dombindings_gen.cpp)
Created attachment 560561 [details]
Generated code example (dombindings_gen.h)
Comment on attachment 554877 [details] [diff] [review]
Main patch v1.2
>+++ b/dom/base/nsWrapperCache.h
>+ JSObject* GetExpandoObject() const;
Please document this.
>+ virtual JSObject* WrapObject(JSContext *cx, XPCWrappedNativeScope *scope,
>+ bool *wrapped)
"wrapped" should probably be called "triedToWrap".
And document that the out param is meaningless if non-null is returned.
>+++ b/dom/base/nsWrapperCacheInlines.h
>+ reinterpret_cast<JSObject*>(mWrapperPtrBits & ~kWrapperBitMask);
The "mWrapperPtrBits & ~kWrapperBitMask" pattern appears in a bunch of places here. Can we give it a nice name?
>+nsWrapperCache::RemoveExpandoObject()
We need to document somewhere
>+ if (mozilla::dom::binding::isExpandoObject(obj)) {
Why do we not need to RemoveDOMExpandoObject in the case when |obj| is a proxy?
Documenting the general ownership interaction between the nsWrapperCache, the proxy, and the expando object would be good.
>+++ b/dom/interfaces/html/nsIDOMHTMLOptionsCollection.idl
>+ // FIXME item should just be inherited from nsIDOMHTMLCollection
File a followup bug on this and remove the stuff that doesn't need to be here from this interface?
>+++ b/dom/tests/mochitest/bugs/test_bug633133.html
>-ok(!("" in divCollection), "empty string shouldn't be in the div collection");
>+ok("" in divCollection, "empty string should be in the div collection");
I think the old behavior was correct. Can we have a followup bug on changing it back, and in particular on using js_CheckForStringIndex instead of the GetArrayIndexFromId thing we're doing right now?
>+++ b/js/src/xpconnect/src/codegen.py
Please file a followup to share this code better with quickstubs, ok?
Also, could you attach the generated files that actually get produced in this case?
>+++ b/js/src/xpconnect/src/dombindings.cpp
>+ListBase<LC>::instanceIsListObject(JSContext *cx, JSObject *obj)
>+ // FIXME: Throw a proper DOM exception.
Please file a followup.
>+ListBase<LC>::namedItem(JSContext *cx, JSObject *obj, jsval *name, NameGetterType &result,
This should assert that |obj| is the right sort of object.
>+ListBase<LC>::getPrototype(JSContext *cx, XPCWrappedNativeScope *scope)
>+ JSFunction *fun = JS_NewFunctionById(cx, sProtoMethods[n].native, 1, 0,
This is assuming all the methods take one argument. I think that's true for now, but maybe a followup for getting the arg count from sProtoMethods[n]?
>+ if (!JS_DefinePropertyById(cx, interfacePrototype, s_constructor_id,
>+ OBJECT_TO_JSVAL(interface), nsnull, nsnull, JSPROP_SHARED))
This looks wrong; having a value is not compatible with JSPROP_SHARED. What should the flags here actually be?
>+ListBase<LC>::create(JSContext *cx, XPCWrappedNativeScope *scope, ListType *aList,
>+ if (parent != scope->GetGlobalJSObject()) {
This will always test false; we should be looking at the global of parent on the LHS.
>+CheckForStringIndex(jsid id)
Please file a followup to make js_CheckForStringIndex have this inlining optimization.
>+JSClass ExpandoClass = {
>+ "DOM Expando object",
Maybe "DOM proxy binding expando object"
>+ListBase<LC>::defineProperty(JSContext *cx, JSObject *proxy, jsid id, PropertyDescriptor *desc)
>+ if (JSID_IS_ATOM(id))
>+ id = CheckForStringIndex(id);
You don't need the JSID_IS_ATOM check here.
>+ListBase<LC>::getOwnPropertyNames(JSContext *cx, JSObject *proxy, AutoIdVector &props)
>+ // FIXME: Add named items
Followup, please.
>+ListBase<LC>::delete_(JSContext *cx, JSObject *proxy, jsid id, bool *bp)
Do you need to check whether |proxy| is an XrayWrapper here?
>+ListBase<LC>::enumerate(JSContext *cx, JSObject *proxy, AutoIdVector &props)
>+ // FIXME: enumerate proto as well
Again, followuo?
>+ListBase<LC>::resolveNativeName(JSContext *cx, JSObject *proxy, jsid id, PropertyDescriptor *desc)
Please assert that |proxy| is an XrayWrapper here. Also, why is the JS_NewFunctionById getting passed proxy->getParent() while we use proto->getParent() when setting up the proto normally?
Also, same comment here about "1" as when setting up the prototype.
>+ListBase<LC>::nativeGet(JSContext *cx, JSObject *proxy, JSObject *proto, jsid id, bool *found, Value *vp)
>+ if (!sProtoProperties[n].getter)
>+ return false;
This can cause a return false without throwing an exception on some codepaths (e.g. via ::get()). Please audit the callers and fix as needed.
>+ *vp = proto->getSlot(n);
Can we assert somewhere earlier in this method that the right stuff is true to make this safe?
>+ListBase<LC>::getPropertyOnPrototype(JSContext *cx, JSObject *proxy, jsid id, bool *found,
>+ *found = !vp->isUndefined();
This doesn't seem right if an expando on the proto has the value |undefined|. We probably need to be more careful here.
>+ListBase<LC>::get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *vp)
>+ if (!vp->isUndefined())
>+ return true;
Same issue here as in getPropertyOnPrototype.
>+NoBase::getPrototype(JSContext *cx, XPCWrappedNativeScope *scope)
>+ // will look up a prototype on the global by using the class' name an we'll recurse into
s/an/and/
>+++ b/js/src/xpconnect/src/nsXPConnect.cpp
>+ // FIXME: Provide a fast non-refcounting way to get the canonical
>+ // nsISupports from the proxy.
Please file a followup.
>+++ b/js/src/xpconnect/src/xpcconvert.cpp
>+ if(flat) {
>+ if(!JS_WrapObject(ccx, &flat))
|flat| can only be null if the new bindings are preffed off, right? Please add a comment here about that, and maybe file a bug to resimplify this code once we remove that pref.
>+++ b/js/src/xpconnect/src/xpcjsruntime.cpp
> {
>+ JSAutoRequest ar(cx);
Document that the scope there is for the JSAutoRequest so it goes out of scope before the DefineStaticJSVals call?
>+++ b/js/src/xpconnect/src/xpcprivate.h
>+ static XPCWrappedNativeScope *GetNativeScope(JSContext *cx, JSObject *obj)
>+ {
>+ js::Value v = obj->getSlot(JSCLASS_GLOBAL_SLOT_COUNT);
There should presumably be an assert somewhere here about |obj| being an XPConnect global or something?
>+++ b/xpcom/idl-parser/xpidl.py
>+ elif name == 'setter':
>+ if (len(self.params) != 2):
>+ raise IDLError("Methods marked as getter must take 2 arguments", aloc)
s/getter/setter/
r=me with the above issues fixed.
Comment on attachment 554877 [details] [diff] [review]
Main patch v1.2
Review of attachment 554877 [details] [diff] [review]:
-----------------------------------------------------------------
Peter and I only went over the Xray stuff.
::: js/src/xpconnect/src/dombindings.cpp
@@ +112,5 @@
> +
> + XPCLazyCallContext lccx(JS_CALLER, cx, scope);
> +
> + nsresult rv;
> + if(!XPCConvert::NativeInterface2JSObject(lccx, rval, NULL, helper, NULL, NULL,
Please "harmonize" this style with the rest of the code around here.
@@ +274,5 @@
> +bool
> +ListBase<LC>::instanceIsListObject(JSContext *cx, JSObject *obj)
> +{
> + if (XPCWrapper::IsSecurityWrapper(obj)) {
> + obj = XPCWrapper::Unwrap(cx, obj);
Per our discucssion, if this is a security wrapper, we should instead verify that obj is from the same scope as the getter being called and if so should call obj->unwrap() (thus skipping the security check that XPCWrapper::Unwrap does).
If a caller doesn't have a callee to pass in, then we can fall back onto using XPCWrapper::Unwrap.
::: js/src/xpconnect/wrappers/XrayWrapper.cpp
@@ +1003,5 @@
> +
> + if (!JS_GetPropertyDescriptorById(cx, holder, id, JSRESOLVE_QUALIFIED, jspropdesc))
> + return false;
> + if (desc->obj) {
> + desc->obj = obj;
These should use wrapper instead of obj.
@@ +1007,5 @@
> + desc->obj = obj;
> + return true;
> + }
> +
> + // FIXME Check for recursion?
We don't have to worry about recursion here because we're not calling into a scriptable helper that can do random things, we're only calling into the proxy-implemented hook that we control.
Comment on attachment 554877 [details] [diff] [review]
Main patch v1.2
Review of attachment 554877 [details] [diff] [review]:
-----------------------------------------------------------------
r=jst with these comments and others comments addressed.
::: dom/base/nsDOMClassInfo.h
@@ +204,4 @@
> static PRInt32 GetArrayIndexFromId(JSContext *cx, jsid id,
> PRBool *aIsNumber = nsnull);
>
> +protected:
Maybe just move this method into an already public section to avoid adding public/protected here?
::: dom/base/nsWrapperCache.h
@@ +119,5 @@
> + * is returned then wrapped indicates whether an error occurred, if it's false
> + * then the object doesn't actually support creating a wrapper through its
> + * WrapObject hook.
> + */
> + virtual JSObject* WrapObject(JSContext *cx, XPCWrappedNativeScope *scope,
Given that this is adding a virtual function here we should bump the IID of every interface that inherits this, especially commonly used ones like nsINode and nsIDocument etc.
::: js/src/xpconnect/src/nsXPConnect.cpp
@@ +1539,5 @@
> + return (nsISupports*)xpc_GetJSPrivate(obj2);
> +
> + if(mozilla::dom::binding::instanceIsProxy(aJSObj)) {
> + // FIXME: Provide a fast non-refcounting way to get the canonical
> + // nsISupports from the proxy.
Bug on file for this?
::: js/src/xpconnect/src/xpcconvert.cpp
@@ +1215,3 @@
>
> + return CreateHolderIfNeeded(ccx, flat, d, dest);
> + }
Don't we want to throw here if !flat? I.e. if ConstructProxyObject() fails, isn't that an error case where we want to return rather than proceed and try to wrap etc...?
::: xpcom/idl-parser/xpidl.py
@@ +861,5 @@
> + raise IDLError("Methods marked as getter must take 1 argument", aloc)
> + self.getter = True
> + elif name == 'setter':
> + if (len(self.params) != 2):
> + raise IDLError("Methods marked as getter must take 2 arguments", aloc)
s/getter/setter/ in the error message.
This landed, but it was a bit bumpy.
and a bustage fix (removing an assertion that I planned to remove anyway in the patch in bug 693301):
The final checkin turns on the bindings:
Ideally we'd be able to back out just that last one if there are serious regressions, but we need to fix bug 693258 first, since the current code has a bunch of orange tests if we turn off the bindings.
This broke clang builds, see bug 693323.?
2.18 +// nsGlobalWindow implements nsWrapperCache, but doesn't always use it. Don't
2.19 +// try to use it without fixing that first.
And that?
(In reply to Ms2ger from comment #33)
>?
Copied from xpc_qsXPCOMObjectToJsval. I guess I can file, but I didn't write this code.
> 2.18 +// nsGlobalWindow implements nsWrapperCache, but doesn't always
> use it. Don't
> 2.19 +// try to use it without fixing that first.
>
> And that?
What about it?
This breaks profiledbuild on Linux x86_64. Please see:
Mozilla/5.0 (X11; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0) Gecko/20100101 Firefox/10.0
Mozilla/5.0 (Windows NT 6.1; rv:10.0) Gecko/20100101 Firefox/10.0
I have run the attached performance tests (from comment #19) a few times and I have got the following results:
Win7:
-dromaeo-firstChild.html: 115.53, 125.24, 126, 127.49, 125.37, 126, 127
-test1.html: 1294-732, 1269-825, 1321-733, 1265-707, 1234-736
-test2.html: 1361-1032, 1613-1006, 1647-1006, 1632-1010, 1592-1017
Mac 10.6:
-dromaeo-firstChild.html: 108.134, 114.087, 113.207, 112.662, 114.427
-test1.html: 1641-856, 1602-844, 1612-855, 1587-851, 1646-876
-test2.html: 2181-1319, 2092-1335, 2159-1358, 2081-1360, 2135-1314
Linux 11.10:
-dromaeo-firstChild.html: 56, 112.214, 125.784, 125.748, 125.373, 126.623
-test1.html: 1481-890, 1450-880, 1455-894, 1473-879, 1459-880
-test2.html: 1888-1173, 1780-1143, 1812-1141, 1781-1143, 1830-1141
For the latest released Firefox version (9.0.1) the results are:
Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
Mozilla/5.0 (X11; Linux i686; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
Win7:
-dromaeo-firstChild.html: 86.395, 92.721, 94.339, 94.059, 86.395
-test1.html: 1521-828, 1505-883, 1465-836, 1503-831, 1469-805
-test2.html: 1258-681, 1253-662, 1240-639, 1258-630,1273-673
Mac 10.6:
-dromaeo-firstChild.html: 80.838, 83.168, 83.168, 83.416, 83.416
-test1.html: 1687-1041, 1654-997, 1700-1005, 1641-1019, 1699-996
-test2.html:1493-827, 1459-828, 1527-821, 1489-812, 1526-816
Linux 11.10:
-dromaeo-firstChild.html: 104.477, 106.045, 93.311, 106.256, 106.256
-test1.html: 1572-809, 1411-816, 1402-819, 1405-811, 1428-811
-test2.html: 1532-757, 1398-754, 1395-825, 1384-772, 1388-764
Are there any specs for the results? What ranges should they be? I see that some results are lower on the older version (9.0.1) and some are lower on the new one (10.0). Is this expected?
Also, is there anything else to do to verify this feature (DOM Bindings: Node List and Array Bindings)?
Thank you!
> Is this expected?
For dromaeo-firstChild.html, the number is runs/s. So bigger is better.
For the other two, the number is ms. So smaller is better.
There are no obvious specs for the ranges.
Will someone continue to work to improve the results that are worse on Firefox 10 than Firefox 9?
"Probably". Which ones are those?
From the results I got, times for test1.html on Linux and for test2.html on all platforms are greater on Firefox 10 than on Firefox 9 and as far as I understood from comment #37 it should be the other way around. Isn't this what the bug is about (improve performance/speed)?
Please let me know if there is anything else to do for QA.
Thank you!
Please file bugs on any testcases where there's a slowdown. There wasn't any last time we did the numbers, so it's possible that there's a problem either in the dom binding code or in JS engine changes from 9 to 10. It would be helpful to know which (e.g. by comparing numbers for nightlies from right before/after this landing to the numbers for both 9 and 10 and posting that information in the bugs you file).
Logged bug #717632 for test1 on Linux and bug #717637 for test2 on all platforms.
I'd really appreciate someone doing the testing I mention in the last part of comment 41.
|
https://bugzilla.mozilla.org/show_bug.cgi?id=648801
|
CC-MAIN-2016-26
|
refinedweb
| 3,177
| 57.27
|
Comment on Tutorial - The java Buzzwords By aathishankaran
Comment Added by : saurav
Comment Added at : 2010-04-29 04:39:55
Comment on Tutorial : The java Buzzwords By aathishankaran
i want to know about java related topic in simple. semicolon(*;) is missed in first line..con .close(
View Tutorial By: Reddymalla Babu Sircilla at 2013-02-22 09:01:29
2. Any thoughts on how conservative/liberal to be whe
View Tutorial By: Jon at 2009-05-04 15:29:14
3. Great! Thanks :)
View Tutorial By: Shivang at 2010-10-10 11:53:54
4. Thanks :) It works for me :)
View Tutorial By: Milind at 2011-12-07 10:05:23
5. Sir if i wnna to take the input from user then it
View Tutorial By: Vivek at 2011-05-14 05:56:30
6. Please
Can you help me ^-^
I use th
View Tutorial By: HNO11 at 2011-03-28 11:08:28
7. I do not understand this line:
Map.Entry me
View Tutorial By: hap Og at 2011-11-03 01:42:33
8. How can I execute the JSP program?
Please
View Tutorial By: Suresh at 2013-01-04 06:43:10
9. #include <iostream>
using namespace s
View Tutorial By: Jorgeus at 2012-08-30 09:07:03
10. hi, how do i turn it into a gui with swing allowin
View Tutorial By: psychicjava at 2011-02-06 13:18:08
|
https://www.java-samples.com/showcomment.php?commentid=34870
|
CC-MAIN-2021-49
|
refinedweb
| 239
| 74.49
|
JetBrains has released IntelliJ IDEA 2021.1 featuring support for Java 16, a new preview feature that instantly renders HTML changes, and support for Windows Subsystem for Linux (WSL) 2. It’s also possible to run applications on Docker, WSL 2 or via SSH. Various other improvements include support for Docker, Kubernetes, Kotlin, Git and others.
One of the new Java 16 features supported by IntelliJ is the ability to declare static members within inner classes:
public class OuterClass { class InnerClass { static final String STATIC_MESSAGE = new String("Works in Java 16"); static String staticMethod() { return STATIC_MESSAGE; } } }
Traditional Java bean class files may be converted to Java records. This can be done automatically when all fields are declared as
final. For example, the
Student class shown below is converted to a record by pressing ALT-Enter on the class name and selecting Convert to a record.
public class Student { private final String firstName; public Student(String firstName) { this.firstName = firstName; } public String firstName() { return firstName; } }
public record Student(String firstName) { }
Records don’t have explicit getter methods, such as the
firstName() method shown in the
Student class. However, if a class contains a getter method, such as
getFirstName(), then the generated record will also have the
getFirstName() method as well.
It’s also possible to search for all eligible classes that may be converted to records. Conversion from a record to a class may be used in case the record doesn’t offer the required features.
Pattern matching for the
instanceof operator was always a two-step process. First,
instanceof was used to check if its argument was of the correct type and, second, the object was cast to that specific type. Java 16’s pattern matching removes the need for the cast and IntelliJ can replace the old pattern matching style and remove the cast.
IntelliJ IDEA supports the new Java 16
toList() method and displays it first on the code completion for an instance of the
Stream interface.
Warnings are now displayed whenever an array or a condition has a negative size. Another warning is displayed when the
Collection.toArray() method is used incorrectly to avoid the potential for a
ClassCastException being thrown.
The new HTML preview feature may be opened by clicking on the IntelliJ icon as shown in the picture below. Changes to HTML, CSS and JavaScript are displayed immediately in the preview window.
Run Targets is an IntelliJ IDEA Ultimate feature that provides the ability to run, test, and debug an application on a target. With Run Targets, it’s possible to run Java applications, JUnit tests, Maven, Gradle, Micronaut, Spring Boot and Quarkus (Maven based) projects on Docker, SSH, and WSL.
IntelliJ IDEA can now detect JDKs installed in WSL 2 and, if necessary, download and install a JDK. Once installed, Java projects inside WSL 2 can be compiled and run by the IntelliJ IDEA build system. Maven or Gradle applications in the WSL 2 directory
\\wsl$ may be used in IntelliJ.
Custom Git commit templates may be created for custom messages. Run inspections make it possible to analyze the code before a commit. A file can be copied from one branch to another with the Compare with branch option by selecting the file and clicking on the down arrow.
JSONPath expressions with the Goessner or Jayway syntax are now supported and can be tested via Edit | Find | Evaluate JSONPath Expression. Selecting a JSONPath expression and pressing Alt+Enter may be used to evaluate the JSONPath expression. This new release also supports delimited JSON files such as
.jsonl,
.jslines,
.ldjson and
.ndjson.
The usability of Docker is improved by introducing code completion in IntelliJ’s configuration windows and image names in Dockerfiles. A container may be started based on a Dockerfile and now it may also be stopped by clicking Stop Deploy.
In a multi-stage Dockerfile, a hammer icon is shown for each stage to build only that stage. After adding the Run section in Run/Debug Configuration the icon changes and it will build an image and run a container.
Kubernetes resources may be deleted by opening a configuration file and clicking on the Run icon.
kustomize, Google’s template-free YAML utility for Kubernetes, introduced components in version 3.7.0 and they may be used in IntelliJ by configuring the desired version of
kustomize via Settings/Preference | Languages & Frameworks | Kubernetes.
The code analysis speed and the code completion for Kotlin have been improved. Warnings about inappropriate blocking method calls have been introduced and issues with Kotlin’s language injection feature have also been fixed.
The UX and UI are updated for the HTTP client with the option to copy the response body without the rest of the response. SSL support for client authentication is now available by clicking Add environment file and then Private.
Other new features include:
- Formatting rules for chained method calls can be configured via Settings | Editor | Code Style | Java | Wrapping and Braces | Chained method calls.
- A new save to shelf action stores the users’ changes on the shelf while also keeping them in the local changes.
- On Windows, it’s possible to open a recent project by right-clicking on the IntelliJ IDEA icon.
More details on all of these new features may be found in the what’s new section of the IntelliJ IDEA 2021.1 page.
IntelliJ IDEA, initially launched in January 2001, is used globally by over four million developers. JetBrains recently celebrated the 20th anniversary with a retrospective of all the highlights from the past 20 years.
>
|
https://www.infoq.com/news/2021/04/intellij-idea-2021-released/
|
CC-MAIN-2021-21
|
refinedweb
| 924
| 52.9
|
Icon QML Type
The Icon type represents an icon image source which can have multiple sizes. More...
Properties
- icon : QPlaceIcon
- parameters : Object
- plugin : Plugin
Methods
Detailed Description
The Icon type can be used in conjunction with an Image type to display an icon. The url() function is used to construct an icon URL of a requested size, the icon which most closely matches the requested size is returned.
The Icon type also has a parameters map which is a set of key value pairs. The precise keys to use depend on the plugin being used. The parameters map is used by the Plugin to determine which URL to return.
In the case where an icon can only possibly have one image URL, the parameter key of
"singleUrl" can be used with a QUrl value. Any Icon with this parameter will always return the specified URL regardless of the requested icon size and not defer to any Plugin.
The following code shows how to display a 64x64 pixel icon:
import QtQuick 2.0 import QtPositioning 5.5 import QtLocation 5.6 Image { source: icon.url(Qt.size(64, 64)) }
Alternatively, a default sized icon can be specified like so:
source: icon.url()
Property Documentation
For details on how to use this property to interface between C++ and QML see "Interfaces between C++ and QML Code".
This property holds the parameters of the icon and is a map. These parameters are used by the plugin to return the appropriate URL when url() is called and to specify locations to save to when saving icons.
Consult the plugin documentation for what parameters are supported and how they should be used.
Note, due to limitations of the QQmlPropertyMap, it is not possible to declaratively specify the parameters in QML, assignment of parameters keys and values can only be accomplished by JavaScript.
The property holds the plugin that is responsible for managing this icon.
Method Documentation
Returns a URL for the icon image that most closely matches the given size.
If no plugin has been assigned to the icon, and the parameters do not contain the 'singleUrl' key, a default constructed URL.
|
https://doc.qt.io/archives/qt-5.13/qml-qtlocation-icon.html
|
CC-MAIN-2021-31
|
refinedweb
| 357
| 63.09
|
I have looked through a lot of websites and that i haven't run into any code or tutorial that has went through more knowledge about getting the table names from one database.
Presuming I've 4 Databases and that i want what they are called of all of the tables inside the Database known as mp21, what's the code to do this?
I truly need assistance here. Any is appreciated.
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'
use mp21 SELECT name FROM dbo.sysobjects WHERE xtype = 'U'
In SQL SERVER, you can easily use -
select * from sys.tables
In MySQL this can list all databases:
show databases;
For all these that you can do:
use <database_name>;
after which
show tables;
if you're asking about .internet code you will want SMO :
using Microsoft.SqlServer.Management.Smo; using Microsoft.SqlServer.Management.Common; public static List<Table> GetTables(string connection, string databaseName) { if (String.IsNullOrEmpty(connection)) throw new ArgumentException("connection is null or empty.", "connection"); Server srv = getServer(connection); return srv.Databases[databaseName].Tables.Cast<Table>().ToList(); }
|
http://codeblow.com/questions/get-table-names-from-the-database/
|
CC-MAIN-2019-18
|
refinedweb
| 178
| 51.14
|
19 Aug 2008
Social networks are making it easier to take data and mash it up to create
innovative Web applications. You still, however,
last of a three-part "Creating
mashups on the Google App Engine using Eclipse" series, we will take the
application built in the first two parts and further enhance it. We will add the
ability to view other users of the app and subscribe to their aggregate feeds. We
will then complete the mashup circle by exposing the app as a Web service that can
be used by other mashups.
About this series
In this series, we look at how to get started with the Google App Engine (GAE). In
Part
1, we look at how to get a development environment set up so you can start
creating an application that will run on the GAE. We also saw how to use Eclipse to
make developing and debugging your application easier. In Part
2, we enhance the application by adding some Ajax features. We also saw how to
monitor the application once it was deployed to the GAE. Here in Part 3, we App Engine, you will need to download the App Engine SDK (see Resources). In this series, we also use Eclipse
V3.3.2 to aid in our GAE development (see Resources).
And you'll need the PyDev plug-in to turn Eclipse into a Python IDE.
Subscriptions.
Modeling
To enable subscriptions, we need to allow one user (account) to subscribe to a list of
other accounts. One approach we could take would be to add a list of users to each
account. Each user adds a subscription we could add to this list. The code for this would look something like Listing 1.
Account
user
class Account(db.Model):
user = db.UserProperty(required=True)
subscriptions = db.ListProperty(Account)
There are some advantages to this approach. When we retrieve an account, we get all of
the other accounts that it is subscribed to. This is a common tactic to use with
nonrelational data stores like the GAE's Bigtable: Keep all relevant data together and
do not worry about things like normalization. However, there is a disadvantage to this
approach. What if we want to show who all is subscribed to a particular user. The only
way to do this would be to retrieve all Account models, look
at all the subscriptions, and see if the given user is in the list. Alternatively, we
could keep two lists in each Account model —
one for the subscriptions and one for the subscribers. Instead of taking this approach, we will use a more
traditional many-to-many model, as shown in Listing 2.
subscriptions
subscribers
Subscribe
class Subscribe(db.Model):
subscriber = db.ReferenceProperty(Account, required=True,
collection_name='subscriptions')
subscribee = db.ReferenceProperty(Account, required=True,
collection_name='subscribers')
As you can see, this is similar to a join table you would use with a relational
database. Just because the GAE uses a nonrelational data store (Bigtable) does not mean
that you cannot leverage techniques you have used with relational databases. Now that
we have the data model in place, let's take a top-down look at how these many-to-many
relationships will be created from the end user's perspective.
Subscription management
Our application can store subscriptions, so we just need some way for users to create
subscriptions. To do this, we will create a page for users to add subscriptions (see
Listing 3).
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
xhtml1-strict.dtd">
<html xmlns="" lang="en" xml:
<head>
<meta http-
<title>Aggrogator Accounts</title>
<link rel="stylesheet" href="/css/aggrogator.css" type="text/css" />
<script type="text/javascript" src="/js/prototype.js"></script>
<script type="text/javascript" src="/js/builder.js"></script>
<script type="text/javascript" src="/js/effects.js"></script>
<script type="text/javascript" src="/js/aggrogator.js"></script>
</head>
<body>
<img id="spinner" alt="spinner" src="/gfx/spinner.gif" style="display: none;
position: fixed;" />
<div id="logout">
{{ account.user.nickname }}
<a href="{{ logout_url }}">Logout</a>
</div>
<div class="clearboth"></div>
<ol>
{% for acc in all_accounts %}
<li>
<a href="" onclick="subscribe('{{ acc.user.email }}'); return false;">
{{ acc.user.email }}</a>
</li>
{% endfor %}
</ol>
</body>
</html>
As you can see, this page simply displays all of the accounts in the system. The user
then picks an account to subscribe by clicking on it. You could imagine a more
sophisticated interface. For example, this would become unwieldy with a large number of
users, so a search-based system would be better. Or perhaps a system allowing the user
to import his address book or use APIs from something like OpenSocial to find existing
friends who are already part of the application. The template above needs a list of
users, so let's take a quick look at the controller that creates the model for the page
(see Listing 4).
#Accounts Module
class MainPage(webapp.RequestHandler):
def get(self):
# get the current user
user = users.get_current_user()
# is user an admin?
admin = users.is_current_user_admin();
# create user account if haven't already
account = aggrogator.DB.getAccount(user)
if account is None:
account = aggrogator.Account(user=user)
account.put()
# create logout url
logout_url = users.create_logout_url(self.request.uri)
all_accounts = aggrogator.Account.all()
template_values = {
'account': account,
'admin': admin,
'logout_url': logout_url,
'all_accounts': all_accounts,
}
path = os.path.join(os.path.dirname(__file__), 'accounts.html')
self.response.out.write(template.render(path, template_values))
The controller gets all the data ready for display on the accounts page. Back on the
accounts page in Listing 3, we see that there is JavaScript called when an account is
clicked on.
function subscribe(email) {
new Ajax.Request("/accounts/subscribe", {
method: "post",
parameters: {'email': email},
onSuccess: alert('subscribed to ' + email)
});
}
This JavaScript once again uses the Prototype library to make an Ajax request to the
server. We call the URL /accounts/subscribe. Where is that URL mapped to? The code that
creates the mapping is in the main function of the new accounts module, as shown below.
def main():
app = webapp.WSGIApplication([
('/accounts/', MainPage),
('/accounts/subscribe', Subscribe),
], debug=True)
util.run_wsgi_app(app)
if __name__ == '__main__':
main()
As you can see from the main function, a call to /accounts/subscribe is handled by a
Subscribe controller class. That class is shown in Listing 7.
class Subscribe(webapp.RequestHandler):
def post(self):
# get the current user
user = users.get_current_user()
aggrogator.DB.create_subscription(user, email)
This controller is simple. It gets the current user (the subscriber) and the e-mail
address of the subscription being added. It then calls a new method in the DB utility
class we have used previously. That class handles all our Bigtable-related calls. The
new create_subscription function is shown below.
create_subscription
class DB:
@staticmethod
def create_subscription(user, email):
subscriber = DB.getAccount(user)
subscribee = DB.getAccountForEmail(email)
subscription = Subscribe.gql("WHERE subscriber = :1 AND subscribee = :2",
subscriber, subscribee).get()
if subscription is None:
Subscribe(subscriber=subscriber, subscribee=subscribee).put()
@classmethod
def getAccountForEmail(cls, email):
user = users.User(email)
return cls.getAccount(user)
This function first looks up the Account models for the user
and subscription e-mail. For the latter, it uses the new getAccountForEmail function. This makes use of the GAE's user's API
to look up the User object based on the e-mail, then
querying Bigtable for the account. Once we have both accounts, we check to see if the
subscription already exists. If it does not, we create a new one.
getAccountForEmail
User
Of course, now that we have subscriptions, we want to make use of them in the main
application. Instead of just showing the current user's services, we want to show the
aggregate feed (the user's services and the services from his subscriptions, as
well). To do this, we make a small change in the GetUserServices controller in the main module developed in previous
articles. This is shown below.
GetUserServices
GetUserServices
class GetUserServices(webapp.RequestHandler):
def get(self):
user = users.get_current_user()
# get the user's services from the cache
#userServices = aggrogator.Cache.getUserServices(user)
userServices = aggrogator.Aggrogator.get_services(user.email())
stats = memcache.get_stats()
self.response.headers['content-type'] = 'application/json'
self.response.out.write(simplejson.dumps({'stats': stats, 'userServices':
userServices}))
All we did here was call a new library class: the appropriately named aggrogator class, to get the aggregate services instead of just the
user's. This library code is shown below.
aggrogator
class aggrogator:
@staticmethod
def get_services(username):
accounts = []
primary = DB.getAccountForEmail(username)
accounts.append(primary)
for subscription in primary.subscriptions:
accounts.append(subscription.subscribee)
services = []
for account in accounts:
services.extend(Cache.getUserServices(account.user))
return services
Here is where we can again see our new Subscribe model in
action. In the code, we get the account for the username (by using the getAccountForEmail function we saw earlier), then call its
subscriptions property. In this case, we only use this to get all of the services from
the cache. Later, we will see these services used to create the aggregate feed.
We are almost ready to test the new accounts page. We have to make one last change: We
need to configure our application to send certain URL requests to the new accounts
module. To do this, we edit the app.yaml file and add a new section.
- url: /accounts/.*
script: accounts.py
login: required
This is just a new section of the file. It maps any request that has /accounts/ to the
accounts module. This should appear before the catch-all handler used previously (url:
/.*) so that it takes precedence. Now we can test the application just as before, using
Eclipse and PyDev, and by going to. Make sure you create
multiple accounts so your testing can be interesting.
The aggroGator Web service
Social Web services make it possible to create interesting applications like aggroGator
very easily. The GAE allows us to create such mashups that are also very scalable. So
of course it makes sense to create an API/Web service around our mashup so others can
use it to create their own interesting mashups. This turns out to be quite easy, as well.
For our Web service, we will start by making it a read-only service. The service will
simply provide the aggregate feed for a user (i.e., the same thing one would see in the
aggroGator UI). We will use a simple REST-style URL for this, such as
/api?username=my@email.address. This time, we will start bottom-up. To handle such a
URL, we once again add a section to our app.yaml file.
- url: /api
script: main.py
Notice that we are still sending the /api requests to the main module. Why did we need
a new mapping in app.yaml? We do not want to require authentication for the aggroGator
API. That is the only reason we need the new rule in app.yaml. Since we leverage the
main module, it needs to be modified.
def main():
app = webapp.WSGIApplication([
('/', MainPage),
('/addService', AddService),
('/getEntries', GetEntries),
('/api', AggroWebService),
('/getUserServices', GetUserServices),
], debug=True)
util.run_wsgi_app(app)
if __name__ == '__main__':
main()
All we have done to this function is add one entry to the list of mappings. We are
mapping /api to the AggroWebService controller class. That class is shown below.
AggroWebService
class AggroWebService(webapp.RequestHandler):
def get(self):
self.response.headers['content-type'] = 'text/xml'
username = self.request.get('username')
entries = aggrogator.Aggrogator.get_feed(username)
str = u"""<?xml version="1.0" encoding="utf-8"?><entries>"""
for entry in entries:
str += entry.to_xml()
str += "</entries>"
self.response.out.write(str)
The service starts off by retrieving the username request
parameter. It then uses the aggroGator library we saw earlier, but uses a different
method, get_feed, to get the aggregate entries. The code for that library function is shown below.
username
get_feed
class Aggrogator:
@staticmethod
def get_feed(username):
services = Aggrogator.get_services(username)
entries = []
for svc_tuple in set((svc['service'], svc['username']) for svc in services):
entries.extend(Cache.getEntries(*svc_tuple))
entries.sort(key=operator.attrgetter('timestamp'), reverse=True)
return entries
This library function uses the get_services function we saw in Listing 10 to retrieve the aggregate
services. It then iterates over the services. The code uses a set to make sure that the
services are unique (i.e., if a user had subscribed to two other users who each used
the same service). Because we used a set, we have to use tuple as we can only use an
immutable object. Finally, we sort all of the entries by their timestamp in descending
order (latest entries listed first).
library
get_services
Going back to Listing 14, once we have the list of entries, we then use some simple
string concatenation to create an XML document. We use a to_xml() method on each Entry instance.
This is a new method, shown below.
to_xml()
Entry
class Entry:
def __init__(self, service=None, username=None, title=None,
link=None, content=None, timestamp=None):
self.service = service
self.username = username
self.title = title
self.link = link
self.content = content
self.timestamp = timestamp
def to_dict(self):
return self.__dict__
def to_xml(self):
str = """<entry>
<service>%s</service>
<username>%s</username>
<title>%s</title>
<link>%s</link>
<content><![CDATA[%s]]></content>
<timestamp>%s</timestamp>
</entry>"""
return str % (self.service, self.username, self.title, self.link, self.content,
self.timestamp)
As you can see, the to_xml() method simply uses a string
template and string substitution to create an XML node. Going back to Listing 14, after
we create the XML document as a string, we set the response header for the content type
and send the XML string back to requester. That is all we have to do, and we have
created a Web service that other mashups can now use.
Summary
This concludes Part 3 of the "Creating
mashups on the Google App Engine using Eclipse" series on the Google App Engine. In
this article, we added subscriptions and a UI for creating them. We modified the
existing application to make use of subscriptions, and we created REST-style Web
services to allow other mashups to build from aggroGator. There are a lot more things
we can do from here. We could add comments to the Entry
class and a UI to allow users to comment on entries. We could provide a subscription
view and a personal view. We could extend our Web service so it could allow users to add
to their feeds directly. All of these things are made easier, courtesy of the Google App
Engine and using tools like Eclipse and PyDev in conjunction with the Google App Engine.?
|
http://www.ibm.com/developerworks/opensource/library/os-eclipse-mashup-google-pt3/index.html
|
crawl-002
|
refinedweb
| 2,430
| 59.5
|
Content-type: text/html
XmResolveAllPartOffsets - A function that allows writing of upward-compatible applications and widgets
#include <Xm/XmP.h>
void XmResolveAllPartOffsets (widget_class, offset, constraint_offset)
WidgetClass widget_class;
XmOffsetPtr * offset;
XmOffsetPtr * constraint_offset;
The use of offset records requires two extra global variables per widget class. The variables consist of pointers to arrays of offsets into the widget record and constraint record for each part of the widget structure. The XmResolveAllPartOffsets function allocates the offset records needed by an application to guarantee upward-compatible access to widget instance and constraint records by applications and widgets. These offset records are used by the widget to access all of the widget's variables. A widget needs to take the following steps:.
XmPartResource constraints[] = {
{ BarNmaxWidth, BarNMaxWidth,
XmRDimension, sizeof(Dimension),
XmConstraintPartOffset(Bar,max_width),
XmRImmediate, (XtPointer)100 } }; Instead of putting the widget size in the class record, the widget puts the widget part size in the same field. If the widget is a subclass of the Constraint class, instead of putting the widget constraint record size in the class record, the widget puts the widget constraint part size in the same field. Instead of putting XtVersion in the class record, the widget puts XtVersionDontCheck in the class record. Define a variable, of type XmOffsetPtr, to point to the offset record. If the widget is a subclass of the Constraint class, define a variable of type XmOffsetPtr to point to the constraint offset record. These can be part of the widget's class record or separate global variables. In class initialization, the widget calls XmResolveAllPartOffsets, passing it pointers to the class record, the address of the offset record, and the address of the constraint offset record. If the widget not is a subclass of the Constraint class, it should pass NULL as the address of the constraint offset record. This does several things: Adds the superclass (which, by definition, has already been initialized) size field to the part size field. If the widget is a subclass of the Constraint class, adds the superclass constraint size field to the constraint size field. Allocates an array based upon the number of superclasses. If the widget is a subclass of the constraint class, allocates an array for the constraint offset record. Fills in the offsets of all the widget parts and constraint parts with the appropriate values, determined by examining the size fields of all superclass records. Uses the part offset array to modify the offset entries in the resource list to be real offsets. The widget defines a constant which will be the index to its part structure in the offsets array. The value should be 1 greater than the index of the widget's superclass. Constants defined for all Xm widgets can be found in <XmP.h>.
The parameters for XmResolveAllPartOffsets are defined
below:
Specifies the widget class pointer for the created widget
Returns the offset record
Returns the constraint offset record
XmResolvePartOffsets(3X)
|
http://backdrift.org/man/tru64/man3/XmResolveAllPartOffsets.3X.html
|
CC-MAIN-2016-44
|
refinedweb
| 485
| 51.58
|
Ever needed to create an icon for your Windows Desktop project?
Well, I did, and many times. Nowadays, we can find some nice Websites that provide easy ways to create a Windows Icon file from a PNG image. But, in the past, things were different. Some years ago, before the explosion of the mobile development world, finding a good, and more important, free tool to help create an icon was a really tough deal!
That's why I begun the development of this tool some years ago. And now, I've just updated and uploaded it to GITHUB, in the way that everyone can make use of it and, if want, help in the development process.
In fact, it might not seems to be this way but, the icon of a software is like its profile picture. Our mind associates that tiny picture with our program. So, you should expend more time creating a particular Icon that defines your application.
Think about it!
With this cool open source tool, you will be able to design you application's icon, on your favorite program (Like GIMP, Illustrator, Corel), export it to a PNG image or even a SVG vector and just open Icon Pro and import that image. It will do all the background work, generating all the multiple size frames from that single image.
With a few clicks, your icon will be there for you!
Please, note that, even though I've done lots of researches and studied a lot about icon files, this software might be still not perfect.
If you find a bug, help me out to fix it. Write a reply, tell me what's wrong, let's share some code. Please, don't vote down, the main goal here is to build a simple, free and open source tool to help everyone.
So, this is a WPF application, written in C# (7.1) for Microsoft .NET Framework 4.6.1.
This tool is, basically, a complement for my project described here:
There, you can understand a little bit more about its background.
But, for now, I'm going to tell you the most important things about its background:
It's divided into layers, 3 layers:
CursorBitmapDecoder
CursorBitmapEncoder
IconBitmapEncoder
IconBitmapDecoder
This tool allows you to extract icons from executables (.exe and .dll). This very cool functionality is based on the great article below by Tsuda Kageyu:
This tool can open Windows Cursor files (.cur), but still, there's no implemented functionality that allows you to create one, even though that's already possible with the CursorBitmapEncoder class.
With the use of the great API SVG.NET, this application lets you create an Icon from a SVG vector file. You can, as well, create an Icon file from a PNG image!
In short words, the main functionalities of this program are:
Now, after lots of researches I've successful implemented an very experimental support for opening Animated Cursors. I would like to mention the great article series by Jeff Friesen that helped me a lot understing the structure of the cursor files!
Introduce Animated Cursors to Java GUIs, Part 1 | Let There Be Animated Cursors
On the latest updates, I've included a piece of code from the great article bellow:
IconLib - Icons Unfolded (MultiIcon and Windows Vista supported) - CodeProject
The code I've included is related to the AND mask creation.
Actually, you don't need to write even one single line of code to create an icon, but, in the background, this tool and the libraries behind it, allows you to code things like this:
IconPro.Lib.Wpf.IconBitmapEncoder encoder = new Lib.Wpf.IconBitmapEncoder();
encoder.UsePngCompression = compression;
foreach (Models.IconFrameModel fr in _Frames)
{
encoder.Frames.Add(System.Windows.Media.Imaging.BitmapFrame.Create(fr.Frame));
}
encoder.Save(Output);
encoder = null;
Okay, I know, it's 2017 and now everything is about Mobile Development, and it makes no much sense to publish a project to handle files from the past century. But, I found the development of this tool very fun, and, as it can be useful for someone, I'm publishing it for everyone on GITHUB.
I would like to thanks asiwel for pointing out some issues and bugs. Thanks to him, I've made some changes and fixed some bugs.
There you can find the source code and the release:
I'd like to present the road-map for this tool. Currently, I'm doing improvements on PHASE 2. But there is already som progress towards the PHASE 3. For example, the Core Lib already contains a namespace, called Motion, with some classes to handle Animated Cursor files. Even though that it is on a very experimental stage, this codes lets you open animated cursor files and view its frames. In fact, the core library is already on version 2.2.x while the rest of the codes are still on version 1.x.x.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
I guess I thought using 8 BPP just meant a smaller icon file with fewer colors available? I tend to use indexed color files anyway for icons and simple images. Maybe that is bad?)
Why that makes a difference in the frames sizes, I really have no idea. (All of those "hand-made" icon files I mentioned above contain all the frames sizes and were created from 8 BPP images, I think ... and seem to work fine. Maybe they would be poor or fail on certain hardware???
PS / Oddly, "exporting" (apparently SAVE saves icon files and EXPORT saves icon images) opens a "Browse for Folder" dialog that shows folders/places to save such as Libraries, Network, Control Panel, and my User Name folder (!?!) as well as ordinary desktop folders and the This PC folder, etc.
This seems to me to be a "poor design" or else a bug in that no one would want to accidentally drop a bunch of image files (or anything else) into those system folders. I suggest this be fixed.
Incidentally I think I just noticed another "bug." When you click EXPORT and the "Browse for Folder window is open, it of course has the focus. But if you then click on your app window, giving it the focus, and then click on the X box to close the app, it does close ... but the Browse for Folder window stays open. That is not good. When you close your application, all of the windows and other stuff associated with that running process should close properly as well.
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
|
https://www.codeproject.com/Tips/1213799/Icon-Pro-Create-icons-for-Windows-Desktop
|
CC-MAIN-2018-47
|
refinedweb
| 1,129
| 71.34
|
Type: Posts; User: g.eckert
Couldnt you relate it to driver/stub functions??
/* Main is my driver function */
int main()
{
cout<<"Testing the stubs"<<endl;
stub1();
cout<<"GIMME DA WEIGHT"<<endl;
cin>> weight;
cout<<"GIMME DA MILES"<<endl;
cin>> miles;
chargedMiles= miles/500;
/* round "chargedMiles" UP */
****, I need a spellchecker
This is ' C ' not C++. If there is a plain C board please redirect me. Thanks.
My instructions for the program
Problem 8.11 on page 366 (35 points)
You will need to include time.h,...
dont inline functions just get thrown into the code everyplace they are used? That would be like typing the same piece of code 15 times in your program...
Yes it is ' C ' that I am using. I could not find the "Plain C" board.
I was looking for clarification on what I was doing with the pointers and derefrencing. Making sure that I was describing the...
why are these global???
double force1;
int time3;
double x1, yone, z1;
double x2, y2, z2;
double Mass1;
double Mass2;
double velocityx1;
double velocityy1;
I swear I used
scanf("%d", (ptr + i) ); and the compiler complained about something. It is working now though
Am I correct in description of the following code
int array[5]={0};
int *ptr=array;
...
scanf("%d", &*(ptr + i) );/* Store input at the address of the value at (ptr + i)*/
I just ran your program and this is what printed.
Enter in path of the file.
F:/Html/htmlfiles/graphics3.htm /* <-- I entered a file path */
...
Hey thanks for clearing that up. Explained very well.
This program is for a CPS class and should demonstrate our knowledge of pointers. The directions say, 'write a function to sort an array using...
Could someone explain to me in english what this piece of code does.
Also if you could show equivilant code not using dynamic allocation.
int *myPtr = new int;
The above seems to be...
I continued to try the Project method and I eventually got it to work. I was previously still compiling the files individualy within the project. Then i got it to work by building the entire project....
Hi, I am completly new to Classes in C++. I have been trying to create a simple class and have had all sorts of problems. I am following directions from my textbook and the code looks correct, I have...
Hi, I am making a TicTacToe game. Right now I am trying to design the computer's moves. I want the computer player to check for possible wins, then check for possible blocks and otherwise just make a...
Go to Norway for free, finish the education, then move to where you want to work.
Hey, I have been looking at internships/jobs in the CPS field, mainly software development and I have noticed that many companies require that you submit some sort of "self started" project. I would...
Look for internships that require little or no experience, there are some out there. This will get u enough expierence to move onto something bigger. That is what I will be doing once I finish my...
I once had this virus/problem on my laptop that kept opening my cd tray and no matter what I did i could not stop it. I dont know how it happened or how it was programmed tho.
Well, im not trying to make a game of craps for other people to play nor am i trying to test how well my craps game works. It is a simple simulation of a craps game that keeps statistics on rolls /...
I have this program here that simulates a Craps game and collects statistics about the games. My current design reflects several things i was trying to do.
1. Keeping the "Gameplay" and "Stat...
Here is your code with proper indenting.
int main(void)
{
do
{
cout << “\nWhat is your age? “;
cin >> age_user;
Your right, its not a huge problem i just found it very ugly. Because I would end up passing the arrays through 2 functions.
From main() --> play() --> shootersPoint();
I just re-read the...
Yes i thought about using a struct to group the statistical data but that is basically the same as a class. We could, use classes for this project but we shouldnt. Because the chapter being covered...
Here is an example of how to take multiple input from one line.
#include <iostream>
using namespace std;
int main()
{
int number1=0;
|
http://forums.codeguru.com/search.php?s=b9c412f7e8ddb126dfd8acd965010440&searchid=1921151
|
CC-MAIN-2013-48
|
refinedweb
| 740
| 75.4
|
of
Jehovah's Witnesses
•
T
HE record of violence
a·gainst a religious organization unparalleled
in America since the at-
tacks
on
the
Mormons•
•
American Civil Liberties Union
170 Fifth Avenue
New York City
.,..,181
January, 194 1
Introduction
undersigned believe that the issues raised by the attacks
T onHEJehovah's
Witnesaes constitute a challenge to American
democracy and religious tolerance. Nothing in the beliefs or
practices of Jehovah's Witnesses justifiea the charges of a lack
of patriotism levelled against them. Their refusal on religious
grounds to salute the flag reats upon a Biblical injunction which
they accept literally. In the conflict between loyalty to God and
loyalty to the State Jehovah's Witnesses stand upon the ancient
tradition of putting loyalty to God first.
Though the Supreme Court of the United States has sustained
the right of school boards to expel children who do not aalute
the fiag, the Court has not imposed fiag saluting on others,
though that is the ignorant assumption behind much of the
persecution. The court has in three cases sust ained the rights of
Jehovah's Witnesses to distribute their leaflets on the streets
and house-to-house and to play their phonograph records upon
request.
Yet it is these very activities which have aroused the ire of
so-called patriotic citizens and have led to the outbursts of lawlessness. While ;some of the literature of Jehovah's Witnesses
contains vigorous attacks on all organized religions and thus
arouses hostility, it i3 clearly within the law.
The undersigned clergymen endorse the publication of this
story of a shocking episode of intolerance in American life,
t'efiectlng a tendency against which both officials and citizens
should constantly be on guard.
DR. DWIGHT J. BRADLEY
DR. F REDERICK MAY ELIOT
DR. HARRY EMERSON FOSD1CK
DR. JOHN HAYNES HOLMES
RABBI EDWARD L. ISRAEL
REV. HALFORD E. LuccocK
BISHOP FRANCIS J. McCONNELL
DR. REINHOLD NIEBUHR
REV. CLARENCE R. SKINNER
REV. ERNEST F. TITTLE
The Persecution of Jehovah 's Witnesses
the persecution of the lVIqrmons years ago has
N OTa nysince
religious minority been so bitterly and generally at-
tacked as the members of Jehovah's Witnesses-particularly in
the spring and summer of 1940. While this was the peak of the
a ttacks upon them, hostility and discrimination have been rife
for several years.
Documents filed with the Department of Justice by attorneys
for Jehovah's Witnesses and the American Civil Liberties Union
showed over three hundred thirty-five instances of mob violence in forty-four states during 1940, involving one thousand
four hundred eighty-eight men, women, and children.
The cause of this ext raordinary outbreak was the "patriotic"
fea r aroused by the success of the Nazi armies in Europe and
the panic which seized the country at the imagined inv.a sion of
t he Uni ted States. From California to Maine this emotion ex~
pressed itself in searching out "Fifth Columnists" and "Trojan
Horses"-phrases which sprang into almost immediate popularity to characterize those thought to be opposed t o national
def ense.
Jehovah's Witnesses were the object of immediate and widespread attack, chiefly because of their position on flag saluting,
well advertised by their widespread distribution of the May 29,
1940 issue of the magazine Consolation giving details of t he
hearing before the U.S. Supreme Court of the Gobitis flag salute
case. Following the decision of J une 3, 1940, in which school
boards were upheld in their r ight to expel children of this sect
who refused to salute the fla g, this propaganda was taken by
some as seditious.
Small Town Intolerance
of the attacks occurred in small communities, where
lV1OSTJehovah's
Witnesses are particularly active in spreadlng
their gospel by house-to-house canvassers, selling literature and
4
TEE PzRsECU'IlON oF JzROVAs's WcTNEssts
playing phonograph records of the speeches of their leader,
Judge Jo3eph F. Rutherford.
These publicity tactics are the obligation of Jehovah's Witnesses, whoae hundreds of thousands of members are to be
found throughout the country- and in other lands as well. They
carry their propaganda directly to the people in their homes.
Organized in little groups, traveling by a utomobile, they systematically canvass a community, offering their literature
house-to-house and on the streets. They thus readily attract
attention and arouse opposition.
In smaller communities, intolerance is easily organized and
gets out of hand. Though Jehovah's Witnesses distribute in
the larger cities as well, lawless action in the face of adequate
police forces is impracticable. Only a few of the incidents were
reported from towns of more than five thousand population.
One of the most extraordinary aspects of the persecution of
these Jehovah's Witnesses engaged in the peaceful distribution
of literature, was the charge, made at once when the agitation
against them began, that they were agents of the Nazis. Not a
word in their literature justifies such a charge.
One piece of their literature carries a swastika-but as a
symbol to be attacked. Jehovah's Witnesses are strongly antiNazi. Being an international organization with members in
many countries, and with a strong following in Germany, they
have run foul of the Nazi government, and several tho usands of
their followers are reported to be in concentration camps. In
Germany, as elsewhere, they refuse to salute the flag, holding
that the Bible commands them to worship no symbol but that
of Jehovah.
A Law-Abiding G roup
XCEPT on the sole issue of fiag saluting, the attitude of
E
J ehovah's Witnesses toward governments is to obey every
"righteous" law. Though Jehovah'a Witnesses individually are
opposed to participation in wars between nations, in this coun·
try they have complied with the selective service law. Their
attitude individually toward the law's requirement of partici-
THE PERSECUTION OF JEHOVAH 'S WITNESSES
5
pation in military training and service Ls at this writing an
unsett led question confronting draft boards and appeal agencies.
lt is plain that no charge of lack of loyalty or patriotism can
be rightly or successfully laid against Jehovah's Witnesses. On
flag saluting, they firmly maintain the ancient practice of
"obeying God rather than men"-putting loyalty to the Creator
above loyalty to the State.
But there is a secondary cause of antagonism to Jehovah's
Witnesses. They oppose the all religious systems on the ground
that they pervert the purposes of "Almighty God, expressed in
the Bible." Their pamphlets attack the Catholic Church, Protestants and Jews. Jehovah's Witnesses are not themselves a church
in the accepted sense. They have no creed but the Bible, no
clergymen and no places of worship. They are evangelists for a
brand of Christian fundamentalism and they are zealous in
making converts. It is their evangelism, their attitude to the
flag and to the churches, which have aroused a persecution unparalled in recent years.
Jehovah's Witnesses have sought to obtain what they regard
as their civil rights by proceedings in the courts. Three years
ago they contested an ordinance in a Georgia town requiring
permits for the distribution of lit erature. Permits were refused
to them and they carried the case to the United S tates Supreme
Court, which voided the ordinance. The decision was a landmark
in guaranteeing freedom of the press in terms of the right to
distribute literature on public streets.
Another case in Connecticut was taken to the U.S. Supreme
Court, again involving a state statute prohibiting the canvassing of homes for religious causes without a permit. The
Court voided the statute, thus sustaining Jehovah's Witnesses' rights to canvass homes, to sell tracts, and to play their
phonograph records on request.
Despite those decisions local officials in scores of communities
have continued to prohibit street distribution of literature and
house-to-house canvassing. Since regulat ory local ordinances
have been voided, Jehovah's Witnesses are arrested on more
general charges, such as disturbing the peac~ 1 ya¥rancy, s~llini
without a licen~e, o.nq cHsorqerlr coP.dlJct,
6
THE PERSECUTION OF JEHOVAH'S WITNESSES
The Record of Violence
reach~ d
Y a recital of the extraordinary incidents which
0 NLtheir
peak in May and June of this year will indicate the
extent of the persecution. The following instances are taken
from the volume of testimony presented to the Department of
Justice baaed upon affidavits and reports from the field, and
backed up in practically every instance by press reports.
From an affidavit by Albert Stroebel of Flagstaff, Arizona
dated June 26, 1940:
"On Wednesday evening J une 19th, 1940 my dad
and I drove to Ash Fork from Williams to contact two
fellow workers at a friend's house. I drove up in front
of the house and went up on the porch when three men
stepped into the ya.rd up on the porch and said, 'Are
you looking for anyone ?' -and then, 'will you salute the
flag?' and when I replied that I respected the flag but
was consecrated to do God's will and did not salute or
attribute salvation to the fiag they cried, 'Nazi spy !'
knocked me down, beat me badly, and .finally knocked
me out- then dragged and pushed me across the street
to a service station and again tried to make me salute
the fiag. I was dizzy, befuddled and don't clearly remember anything further except that a considerable
crowd had gathered yelling 'Nazi spy !-Heil Hitler!
-String him up I-Chop his head off I'
" A deputy sheriff appeared later. He took me to a
local jail and put my dad and I in a cell, as he said,
'to protect you from the mob and rest you up.'
"After two hours he took us both to Prescott to the
sheriff's headquarters, arriving there about 9 :00 p.m.,
some one else driving my car down. Upon arrival,
all of Jehovah's Witnesses' literature in my car was
taken in to the sheriff's office and three men spent
about three and a half hours inspecting same. A t
12 :30 a.m., the sheriff or District Attorney said, 'We
find nothing radically wrong in your literature and if
the people would take time to read it they wouldn't
get so hysterical and excited calling you Nazi spies
and the like.' Then they let us go."
THE PERSECUTION OF JEHOV.AH'S WITNESSES
7
Another Cau
an affidavit of Roy Orabb of Prescott, Arizona
F ROM
June 29, 1940:
da~ed
"On Wednesday afternoon June 19th, 1940 after having engaged in Kingdom service ·in Ash Fork for
several hours my brother and I entered a friend 's home
on the main street of the town when we noticed cars
driving up in front of the house. Six cars in all parked
around the house, which is located on a. corner, the
leading car being a blue Plymouth sedan driven by the
local deputy sheriff' named Russell. The cars were there
about ten minutes when about a dozen men got out of
said cars, the deputy sheriff then driving away while
the men started into the house.
"The men entered the house and took my brother
and I out into the street where they produced a U.S.
fiag and said 'you fellows salute this' and when we
declined the assault began-the mob split and 6 or
more jumped on me while the rest, about the same
number, attacked my brother. After we were beaten
up, knocked down and out we were kicked aroundand I have a dim recollection of being dragged around
t he streets by our legs and feet and finally left semiconscious in the street. When we recovered enough to
stand we were driven out of town by the same mob.
"The mob went back to the house of our friends,
got our literature and portable phonographs which
were reported burned. Neither my brother O·r I know
the names of our attackers except one young fell ow,
Bud LaMar of Jerome who took a leading part in
beating up my brother. He is reported to be a French
Catholic and his grandmother resides in Ash Fork.
"We could Identify the ring leaders of the attackers
and in common with other cases of mob violence directed at Jehovah's Witnesses jn Yavapai County have
reported the matter direct to the District Attorney's
office and to Sherift' Robbins in Prescott and requested
that a deputy be sent with us to Ash Fork to enable
us to identify the mobsters without inciting further vio-
8
'THE PERSECUTION OF JEHOVAH 'S WlTNESSES
lence. This was agraed to by under-Sheriff B-0rn la.st
Wednesday, June 26th, but when we appeared at the
sheriff's office for this purpose the foll owing day
Sheriff Robbins was there and he declined t o send the
deputy. Said he'd serve all the warrants we swore
out but wouldn't send a deputy to Ash Fork with us.
Ass 't District Attorney Frank encouraged this stand."
Sheriff R efuses Protection
an affidavit by Millard H. Pemberton of Crocker, MisF ROM
souri, dated July 4, 1940:
"On June 19th, 1940 at 7 p.m., Roy Cadwell, sheriff
of Pulaski County, Missouri, Ed Cusick, proaecuting
attorney and another man came to the trailer and inquired into my work and about saluting the flag. We
oft'ered to play them some records explaining our po:;ition and they would not let us but said they would
come back the next day.
"About 10 :30 p.m. that same night the sheriff and
prosecuting attorney and about nine others came back
fo the trailer, got me out of bed and asked to hear the
records. I played the following records for them: "Instructions," "Remedy," and the "Government & Peace"
series. At the end, the sheriff and prosecuting attorney
said there was nothing wrong with the records, but
because we would not salute the flag, that we should
be run out of the country and they both said they
would not give us any protection. They left about
11:45 p.m.
"About 1 :30 a.m. this same n ight, Howard Shackley, Ted Spears, and Clarence Quisenberr y, Jr., came
back and gave us 45 minutes to leave the county. We
phoned the sheriff for protection and he r efused. My
wife then called the state police at Jefferson City and
they said they would see what they could do. They did
not come, however.
"About 2: 15 a.m Shackley, Spears, and Quisenberry,
Jr., came back again and Howard Shackley shot 10
holes in three of my tires. They then left and again
THE PERSECUTION OF JEHOVAH'S WITNESSES
cam e back in about 30 miru. Thi.s t ime they brought
gasoline to burn the trailer and Howard Shackley
drew a gun on me and threatened me. The state police
were again called and they did not respond. It W!l.S
about 3 a.m. by this time.
About 8 a.m. Carl Brisch and five other men, among
them Clarence Quisenberry and Ben Whickler 1 came
back and said that if we were not out of town by noon,
they would burn the trailer. We left town at 10 :30
11
a.m. 11
Women Beaten
a n affidavit by John
F ROM
dated Oct ober 30 1940:
Q. Adams of Beaumont, Texas,
1
"On September 1st, 1940 B. P. J ones, a resident of
Beaumont, Texas was visiting friends near Jasper,
Texas having brought home some of the children who
had been attending his wife in her illness. While he
was in Jasper he performed a baptismal service for
some of the colored people, he himself being a colored man and one of Jehovah'a Witnesses.
" While walking from one house to another a car
drew up alongside and someone said, 'Hello preacher,
what are you doing up here?' While explaining that
he was here to bring home the girls who had been attending his wife, two more cars drove up; one man
with a shot$un got out of one of the cars and forced
him into one of the cars, whereupon they drove out
the highway and turned off onto a dirt road leading to a cemetery. Upon arriving at the cemetery, one
of the men s·aid, 'We ought to go and get that white
son-of-a-bitch.' (Referring to one of the men who lives
in that vicinity who likewise is one of Jehovah's Witnesses). The man with the gun then said 'Well, let's
go ahead with him now!' The mob then tried to force
Jones to say that he knew the white 'son-of-a-bitch'
that they were alluding to-he did not know the man
as he was only visiting and was not acquainted with
any except the colored people.
9
lO
THE' PERSECUTION OF JEHOVAH'S WITNESSES
"The mob the:n tied Jones' hands behind hh! back
and put a rope around the neck, by which one held him
while another beat him with a wet rope. Two of the
others cut a pofo from one of the trees nearby with
which they took ·their turn at beating him. Wl'len they
quit beating him, the man with the gun said, 'Now
run I' Jones repli1ed, 'No, if you want to shoot me you
can do it. while l( am looking at you.' At this, one of
them said "You got a lot of nerve, eh, nigger?' Then
the mob said the1y would give Jones three minutes to
get his stuff fror.n the house and leave Jasper, whereupon they took him back to the house where he
|
https://www.scribd.com/document/301700278/The-Persecution-of-Jehovah-s-Witnesses-1941
|
CC-MAIN-2018-39
|
refinedweb
| 2,964
| 67.59
|
Hangman Game ProblemYou can try something like this
[code]int main(){
string name; /// Creates a variable called name
...
Question about NullHere you go, null just needed to be in all caps for it to work.
[code]srand(time(NULL)); [/code]
Arrays in functionsYou can do that by
[code] void arrange(){
//place your code to rearrange the array here.
}[/code]
...
Help with function errors codeWhat errors are you getting?
Edit:If you just change the function name the contents would still be ...
Function returning true/false instead of valueThis might help you out.
[code]#include <iostream>
#include <iomanip>
using namespace std;
int OneO...
This user does not accept Private Messages
|
http://www.cplusplus.com/user/Hp_of_Legend/
|
CC-MAIN-2015-27
|
refinedweb
| 109
| 75.4
|
Cerberus monitors OpenShift/Kubernetes cluster health and exposes a go/no-go signal consumable by other benchmark tools. Since introducing Cerberus in the first blog post (OpenShift Scale-CI: Part 4: Introduction to Cerberus - Guardian of Kubernetes/OpenShift Clouds), we have brought in a tremendous amount of enhancements to strengthen the guardian of the OpenShift/Kubernetes clusters. Cerberus has now evolved into a highly scalable and reliable tool with the potential to monitor diverse cluster components. In this blog post, we will be taking a look at all of the enhancements, the reasons we added them, and how the user will be able to use them.
Recent Additions to Monitoring1: Schedulable Masters
It is essential to have dedicated resources for the master nodes in order to ensure high availability of key components such as API Server, Scheduler, Controller Manager, and etcd that always run on master nodes. Therefore, we need to avoid other noncritical workloads from interfering with the functioning of the master services. Taints enable a node to repel a set of pods from getting associated with it. Cerberus checks for masters without NoSchedule taint and warns the user regarding schedulable master nodes.2: Cluster Operators
Operators are pieces of software that run in a pod and are good indicators of unhealthy OpenShift clusters. These operators show multiple status, and we can look specifically at the degraded status to determine its overall health. With the OpenShift distribution set, Cerberus takes a look at all of the cluster operators and verifies that they aren’t degraded.3: Routes
OpenShift should be able to have little or no downtime for a variety of different routes that control the cluster and expose the end user’s applications to the outside world. Being able to monitor how long these routes are down is an important component of a cluster's health. Now, the user has the ability to monitor multiple routes/urls to spot if they are down by providing authorization to access each route.4: User-Defined Checks
The user can bring in additional checks to monitor the components that are not being directly monitored by Cerberus such as checks to monitor status of application pods, database connectivity, and application server status and thus stepping up the significance and functionality of Cerberus.5: Distributions supported
Cerberus can run on Kubernetes and OpenShift distributions with a few tweaks to the configuration file. The user can select an appropriate configuration file based on the distribution. Using the OpenShift distribution runs both Kubernetes and OpenShift checks while the Kubernetes distribution examines the components specific to Kubernetes.
Improved Diagnostics1: Cerberus Alerts on High Kube API Server Latencies
Cerberus queries Prometheus if deployed for KubeAPILatencyHigh alert at the end of each iteration and warns the user if 99th percentile latency for given requests to the kube-apiserver is above 1 second. Higher latency is an indicator of problems in the cluster.2: Cerberus History API
A single go/no-signal could miss flaky nodes, pods, and operators. History API is designed to provide adequate data enabling the user to decide if the cluster is healthy or not. Failures seen in a specific time window are provided to the user in the json format. It consists of information on the type of failure, name, and type of failed component and includes a timestamp when the failure occurred.
- Users can retrieve the node/component failures seen in the past one hour by visiting the history url. Users can pass an optional loopback parameter to retrieve failures seen in the past loopback minutes.
- Users can retrieve the node/component failures between two time timestamps, failures of specific types and failures related to specific components in json format by visiting the analyze url. The user gets the privilege to apply filters to scrape the failures satisfying certain criteria.
History API is available as a Python package to ease the usage in other tools.
Cerberus Scalability
Cerberus is a highly scalable and reliable tool with the ability to monitor the health of 500-plus node clusters in a matter of seconds. Following enhancements were added to boost the scalability:1: Multiprocessing
Cerberus uses multiple cores to reduce the cluster monitoring time.
- It performs all cluster health checks in parallel.
- It monitors the system critical and application components in all namespaces in parallel.
- It tracks pod crash/restart during wait time between iterations in all namespaces in parallel.
- It collects detailed logs, metrics, and events of failed components in parallel.
The graph below shows the time comparisons of health monitoring time by a single process/serial and multiprocessing versions of Cerberus on clusters of different size.
2: Reduction in the Number of API Calls
Cerberus makes a single API call to get the status of all the pods in a namespace instead of iterating through the list of pods and making an API call to get the status of each pod. Similarly, a single API call is used to get the status of all the nodes. Cerberus handles bulk requests in chunks to prevent overloading the API Server by consuming a large amount of resources when there are thousands of objects running in a cluster.
Cerberus Reliability
Cerberus is a highly reliable tool with ability to generate go/no-go signals under scenarios like cluster connection loss, cluster shut down, etcd leader change, rpc error, etc. It has the potential to monitor cluster health till the user terminates Cerberus monitoring.
New Ways on How to Get Started1: Cerberus python package
Cerberus is available as a Python package to ease the installation and usage.
2: Cerberus as a Kubenetes Deployment
Cerberus can be run internally to the cluster as a Kubernetes deployment. However, it is not a recommended option as the pod which is running Cerberus might get disrupted. It is advised to run Cerberus external to the cluster to ensure the receipt of a go/no-go signal is not affected when the cluster is down, Kube API stops serving requests, etc.
Demo
We are always looking for new ideas and enhancements to this project. Feel free to create issues on github or open your own pull request for future improvements you would like to see. Also, reach out to us with any questions, concerns or need help on slack.
Categories
Kubernetes, How-tos, Security, Monitoring
|
https://www.openshift.com/blog/reinforcing-cerberus-guardian-of-openshift/kubernetes-clusters
|
CC-MAIN-2021-17
|
refinedweb
| 1,053
| 50.26
|
In this article, we will look at the difference between map and flatMap in Java. Java 8 stream API provides map() and flatMap() method. Both these methods are intermediate methods and returns another stream as part of the output. Let’s see what is the main difference between map and flatMap() in Java 8.
The main difference between the map and flatMap is the return type. Both produce
Stream<R>. The map produces one output value for each input value where flatMap provides one or more values for each input value. To put it in simple words, a map is for transformation while flatMap is a combination of transformation and flattering.
..
flatMap() = map() + Flattening
The
map() method with Stream API takes a function as an argument. It applies the function on every element and mapping it to a new element. Let’s take an example where we want to return the number of characters for each word in a list. To do this, we need to apply the function to each element of the list. This function job is to accept the word and return the length of the work.
import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class MapExample { public static void main(String[] args) { List words= Arrays.asList("Java Dev Journal","Java", "Spring Boot","Java 8"); List wordCount = words.stream() .map(String::length) .collect(Collectors.toList()); wordCount.forEach(System.out::println); } }
When we run this program, we will have the following output
16 4 11 6
In this code, we passed
String::length method reference to the map function to return the word count for each word.
To understand why we need
flatMap() and what is the difference between map and flatMap in Java, let’s extend out previous example. Let’s try to return a list of unique words for the input:
List words= Arrays.asList("JavaDevJournal","Java");
For this input, we are looking for the following output.
[J, a, v, D, e, o, u, r, n, l]. How would you approach this situation? Let’s see what will be the output if we try below code
List words= Arrays.asList("JavaDevJournal","Java"); words.stream().map( s-> s.split("")).distinct().collect(Collectors.toList());
There is one issue with above approach, our
map() method returns
String[] for each word. The final output of our
map() method is
Stream<String> and the output of the entire statement will be
List<String[]>. This is how the transformation look like
We were looking for a list of unique words but ended up getting a
List<String[]>(List of String array). To handle similar use cases, we need the
flatMap() function. The
flatMap() will map flat the input in to a single stream.Let’s change our code to see flatMap in action:
List < String > words = Arrays.asList("JavaDevJournal", "Java"); List < String > unique = words.stream() .map(s -> s.split("")) .flatMap(Arrays::stream) .distinct() .collect(Collectors.toList());
Let’s see how the flatMap function works while transforming the content.
Out flatMap function will concatenates all the input stream in to a single stream.
In this post, we saw the difference between map and flatMap in Java. We learned when to use map vs flatMap in Java8. The source code for this post is available on the GitHub.
Hello!! Welcome to the Java Development Journal. We love to share our knowledge with our readers and love to build a thriving community.
Good effort to explain but one little correction is required. What I see, in second example after distinct operation stream contains ‘J’ once but in your picture ‘J’ is twice (1st and 6th). If you modify the picture then there would be no confusion.
Thanks Suman for the suggestion, will update it
|
https://www.javadevjournal.com/java/java-difference-between-map-and-flatmap/
|
CC-MAIN-2020-29
|
refinedweb
| 625
| 66.54
|
std::fputc, std::putc
From cppreference.com
Writes a character
ch to the given output stream
stream.
Internally, the character is converted to unsigned char just before being written.
In C, putc() may be implemented as a macro, which is disallowed in C++. Therefore calls to std::fputc() and std::putc() always have the same effect.
[edit] Parameters
[edit] Return value
On success, returns the written character.
On failure, returns EOF and sets the error indicator (see std::ferror()) on stream.
[edit] Example
Run this code
#include <cstdio> int main() { for (char c = 'a'; c != 'z'; c++) std::putc(c, stdout); std::putc('\n', stdout); // putchar return value is not equal to the argument int r = 0x1070; std::printf("\n0x%x\n", r); r = std::putchar(r); std::printf("\n0x%x\n", r); }
Output:
abcdefghijklmnopqrstuvwxy 0x1070 p 0x70
|
http://en.cppreference.com/w/cpp/io/c/fputc
|
CC-MAIN-2015-48
|
refinedweb
| 138
| 58.18
|
how do i increment a string array?
like a becomes b, x becomes y?
ex. Hello world becomes ifmmp xpsme.
This is a discussion on string array within the C++ Programming forums, part of the General Programming Boards category; how do i increment a string array? like a becomes b, x becomes y? ex. Hello world becomes ifmmp xpsme....
how do i increment a string array?
like a becomes b, x becomes y?
ex. Hello world becomes ifmmp xpsme.
An array of chars is actually an array of 1 byte numbers.
The ASCII table lists the character representations of these numbers. If you don't have that chart handy, just look for yourself:
char c = 0;
while(c < 127) {
printf("%c = %i \n", c, c);
getch();
c++;
}
So really, it's just a matter of looping through the string and incrementing the value of each char. That's basically it.
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
If you are using the STL, you can do it with std::string and the transform algorithm:
Code:#include <string> #include <algorithm> #include <iostream> using namespace std; class IncrementString { public: inline char operator()(char c){ return ++c; } }; int main() { string str("Hello World"); cout<<"String before transform: "<<str<<endl; transform(str.begin(), str.end(), str.begin(), IncrementString()); cout<<"String after transform: "<<str<<endl; return 0; }
how about any word inputted in the c++ program? just any other word becomes all the letters in the word incremented
|
http://cboard.cprogramming.com/cplusplus-programming/25505-string-array.html
|
CC-MAIN-2016-07
|
refinedweb
| 272
| 67.25
|
I think you would be better off writing a little authentication code inside
your servlets...
However if you want to modify tomcat, you'll find that stuff in
package org.apache.catalina.authenticator;
public class BasicAuthenticator
all I wanted to to say is that some browsers like IE do their own thing.
Like for example... send this standard challenge to IE repeatedly
response.setStatus(response.SC_UNAUTHORIZED); // I.e.,
401
response.setHeader("WWW-Authenticate", "BASIC
realm=\"User Check\"");
and you'll see after a few tries.... it gives up anyway ;)
not much a Tomcat can do to change that....
----- Original Message -----
From: "Propes, Barry L " <barry.l.propes@citi.com>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Tuesday, April 24, 2007 7:11 PM
Subject: anyone ever altered the Tomcat API to create a Login Attempt limit
in the security constraint?
Any version? 4x. 5x?
I'm actually in the 4.1.3. series, but was wondering which class files I'd
need to revise and customize.
I assume most if not all are in the /catalina/src/share/org/apache/catalina/
repository, and figured something like Authenticator.java or Session.java
might need a method added to it, but wasn't sure what else would need to be
done.
In other words, whereas in its initial state the security constraint will
repeatedly forward/redirect to the Login error page set, I'd like to be able
to create a customized method to send to another (secondary) error page,
telling the user they've been locked out after 6 consecutive, unsuccessful
attempts.
Is this at all possible to do in 4.1 or any other version?
Any feedback is welcomed.
Thanks!
Barry
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
|
http://mail-archives.apache.org/mod_mbox/tomcat-users/200704.mbox/%3C001201c78698$486ea430$0300000a@animal%3E
|
CC-MAIN-2017-17
|
refinedweb
| 313
| 50.94
|
This page was generated from doc/source/methods/TrustScores.ipynb.
Trust Scores¶
Overview¶
It is important to know when a machine learning classifier’s predictions can be trusted. Relying on the classifier’s (uncalibrated) prediction probabilities is not optimal and can be improved upon. Enter trust scores. Trust scores measure the agreement between the classifier and a modified nearest neighbor classifier on the predicted instances. The trust score is the ratio between the distance of the instance to the nearest class different from the predicted class and the distance to the predicted class. A score of 1 would mean that the distance to the predicted class is the same as to the nearest other class. Higher scores correspond to more trustworthy predictions. The original paper on which the algorithm is based is called To Trust Or Not To Trust A Classifier. Our implementation borrows heavily from and extends the authors’ open source code.
The method requires labeled training data to build k-d trees for each prediction class. When the classifier makes predictions on a test instance, we measure the distance of the instance to each of the trees. The trust score is then calculated by taking the ratio of the smallest distance to any other class than the predicted class and the distance to the predicted class. The distance is measured to the \(k\)th nearest neighbor in each tree or by using the average distance from the first to the \(k\)th neighbor.
In order to filter out the impact of outliers in the training data, they can optionally be removed using 2 filtering techniques. The first technique builds a k-d tree for each class and removes a fraction \(\alpha\) of the training instances with the largest k nearest neighbor (kNN) distance to the other instances in the class. The second fits a kNN-classifier to the training set, and removes a fraction \(\alpha\) of the training instances with the highest prediction class disagreement. Be aware that the first method operates on the prediction class level while the second method runs on the whole training set. It is also important to keep in mind that kNN methods might not be suitable when there are significant scale differences between the input features.
Trust scores can for instance be used as a warning flag for machine learning predictions. If the score drops below a certain value and there is disagreement between the model probabilities and the trust score, the prediction can be explained using techniques like anchors or contrastive explanations.
Trust scores work best for low to medium dimensional feature spaces. When working with high dimensional observations like images, dimensionality reduction methods (e.g. auto-encoders or PCA) could be applied as a pre-processing step before computing the scores. This is demonstrated by the following example notebook.
Usage¶
Initialization and fit¶
At initialization, the optional filtering method used to remove outliers during the
fit stage needs to be specified as well:
from alibi.confidence import TrustScore ts = TrustScore(alpha=.05, filter_type='distance_knn', k_filter=10, leaf_size=40, metric='euclidean', dist_filter_type='point')
All the hyperparameters are optional:
alpha: target fraction of instances to filter out.
filter_type: filter method; one of None (no filtering), distance_knn (first technique discussed in Overview) or probability_knn (second technique).
k_filter: number of neighbors used for the distance or probability based filtering method.
leaf_size: affects the speed and memory usage to build the k-d trees. The memory scales with the ratio between the number of samples and the leaf size.
metric: distance metric used for the k-d trees. Euclidean by default.
dist_filter_type: point uses the distance to the \(k\)-nearest point while mean uses the average distance from the 1st to the \(k\)th nearest point during filtering.
In this example, we use the distance_knn method to filter out 5% of the instances of each class with the largest distance to its 10th nearest neighbor in that class:
ts.fit(X_train, y_train, classes=3)
classes: equals the number of prediction classes.
X_train is the training set and y_train represents the training labels, either using one-hot encoding (OHE) or simple class labels.
Scores¶
The trust scores are simply calculated through the
score method.
score also returns the class labels of the closest not predicted class as a numpy array:
score, closest_class = ts.score(X_test, y_pred, k=2, dist_type='point')
y_pred can again be represented using both OHE or via class labels.
k: \(k\)th nearest neighbor used to compute distance to for each class.
dist_type: similar to the filtering step, we can compute the distance to each class either to the \(k\)-th nearest point (point) or by using the average distance from the 1st to the \(k\)th nearest point (mean).
|
https://docs.seldon.io/projects/alibi/en/latest/methods/TrustScores.html
|
CC-MAIN-2020-40
|
refinedweb
| 787
| 53.81
|
User Details
- User Since
- Jul 29 2013, 1:59 AM (323 w, 6 d)
Dec 18 2018
LGTM.
Any ideas for improvement, @JonasToth?
I'd rather have it merged and improve on it later if there are ideas on how to do it better.
Dec 14 2018
Dec 11 2018
A few more ideas for enhancements.
Dec 10 2018
LGTM. But I'm not a code owner here and I don't know if you need an acceptance of one of them.
Great job.
Some more minor remarks. I'll give this check a try to see how it behaves on some of my projects.
I agree that a high rate of false positives is possible (and is a bit of spoiler) but I wouldn't reject this IMO useful check because of that.
Anyway, everything looks pretty clean for me.
Just a few minor remarks and a possible workaround for testing CHECK-FIXES: [[nodiscard]].
Oct 19 2018
Fixed diff.
Oct 18 2018
Applied changes as per comments.
Actually, I can make it an option for this check to skip or not constexpr ifs, WDYT?
Oct 17 2018
Sep 28 2017
Sep 27 2017
Sep 26 2017
Thanks for the changes. LGTM.
Any thoughts on this?
Sep 21 2017
Could you add just one more test for PAS_Middle please? A single line will be just enough.
Otherwise, LGTM.
Sep 20 2017
That's precisely what I've written, but, as I'd said before, such tests pass already without any modification in NamespaceEndCommentsFixer.
This was fixed by and other commits.
Sep 19 2017
I confirm what I observed before: when invoking tests in unittests/Format/NamespaceEndCommentsFixerTest.cpp, the const AnnotatedLine *line parameter in getNamespaceToken gets one big line that includes both namespace and { (something like namespace\n{\n..., whereas in tests invoked from unittests/Format/FormatTests.cpp, there is a separate line with namespace\n and another one with {\n.
Ok. Nice patch. You can close now.
Minor: use FormatToken::isNot instead of !FormatToken::is.
There is one big missing thing here: PointerAlignment. Actually only PAS_Left is taken into account.
There are 3 possible options:
Left: auto& [a, b] = f();
Middle: auto & [a, b] = f();
Right: auto &[a, b] = f();
Sep 18 2017
Sep 15 2017
Sep 7 2017
Aug 29 2017
Fix: use do-while loop.
Extract method.
Fix line endings again.
Revert unintended format changes.
Fix line endings.
Aug 25 2017
Mar 28 2017
Thanks Daniel.
Mar 24 2017
Fix omitted dereference.
Mar 23 2017
Trim spaces only everywhere. Fix test.
Mar 22 2017
Hi Alex, is it OK now?
Trim only spaces.
Mar 9 2017
Hi Alex and sorry for the late reply.
Mar 3 2017
Oct 19 2016
Oct 14 2016
Remove blank line.
Oct 13 2016
Sep 8 2016
Sep 7 2016
For the moment, just a few nitty-gritty comments inline.
What I miss here is (as already pointed by someone) an example on how to write a new module, register it etc.
Jun 13 2016
May 18 2016
Nice job! Thanks for taking my remarks into account.
Some minor remarks. Sorry for being finicky :).
May 3 2016
I'm really interested in the manner this check works when a typedef has multiple declarations in it (same example as in the comment):
typedef int m_int, *m_int_p, &m_int_r, m_int_arr[10], (&m_int_fun)(int, int);
Apr 8 2016
Minor remark.
Nov 9 2015
Ping?
Oct 20 2015
Applied comments.
- AllowShortFunctionsOnASingleLine: true didn't work with BreakBeforeBraces: Linux/Allman.
- Add test checking that non-empty functions in styles with BraceWrapping.AfterFunction = true don't get merged into one line. Fix the merge condition.
Oct 19 2015
Oct 16 2015
Where is the code in the CL that handles extracting that value from a JSON string? Because it looks like you're just building an array list of the trivial non-JSON style names, so why couldn't that be an enum? I don't know mucha bout clang-format, but looking at the comments it seems like the JSON only comes into play when you're reading a .clang-format file, and in that case the value of the enum would be Style.File (until you finish reading that, at which case you set it to Style.LLVM etc).
The Style option is actually passed to clang-format -style parameter and it's clang-format that parses it. It can be a predefined type (one of: 'none', 'file', 'LLVM', etc.) or a JSON (or JSON-like?) string.
Hi Zachary, just to answer your comments. I have done it on purpose not to use enum, because clang-format style can be actually a JSON string, e.g. {BasedOnStyle: "LLVM", IndentWidth: 4}, so it wouldn't translate into an enum (to my knowledge at least). Besides, I would like to have the possibility not to add a new enum value if there is a new style in clang-format.
Please correct me if I'm wrong about enums.
Oct 15 2015
Ping?
Oct 13 2015
Applied comments and done some minor clean up.
Applied Aaron's comments. Removed unused using.
Oct 12 2015
Assume-Filename option will now give an error when there are quotes in the filename.
Add option converters for filenames (prohibiting quotes) and styles (giving a list of predefined styles).
Applied suggestions from comments.
Add FIXME comment.
Escape only '<' and '&'.
Remove unrelated changes from the revision.
Fix description formatting.
Oct 8 2015
Escape XML-reserved characters.
Oct 7 2015
Oct 6 2015
Out of date.
Sep 9 2015
Sep 8 2015
Sep 4 2015
Can you land it please?
I don't have write access.
Sep 3 2015
Corrected in.
|
https://reviews.llvm.org/p/curdeius/
|
CC-MAIN-2019-43
|
refinedweb
| 943
| 77.23
|
I am working on a problem where I am trying to find a palindrome using a stack and queue. Below is the code that I am using to try and determine if a string is a palindrome or not. Right now I am having problems. It seems as though this program is only checking and comparing the first and last character in the string, and as long as they are the same, it is saying "this is a palindrome." For example, I can input "i alskdflkajsfkjasf i" and it will tell me that it is a palindrome. Can anyone tell me what might be the problem? Thanks
#include <iostream> #include <string> #include "stack.h" #include "queue.h" using namespace std; int main() { Stack S; Queue Q; string s ; int i = 0; char string[MAX]; bool RESULT = false; cout << "Enter a line to check for palindrome: " << endl; cin.getline (string,100); while(string[i]!= 0) { S.push(string[i]); Q.addQueue(string[i]); i++; } while(i > 0) { if(S.pop() == Q.frontQueue()) { RESULT = true; } else { RESULT = false; break; } i--; } if(RESULT == true) { cout<<string<<" \nThis is a palindrome\n"; } else { cout<<string<<" \nThis is not a palindrome\n"; } return 0; }
|
https://www.daniweb.com/programming/software-development/threads/96899/palindrome-problem
|
CC-MAIN-2018-05
|
refinedweb
| 199
| 81.83
|
For the sake of genericity, it is often better to make the functor's member operator() a template. That way, we do not have to concern ourselves with the type of the argument to expect as long as the behavior is appropriate. For instance, rather than hard-coding char const* as the argument of a generic semantic action, it is better to make it a template member function. That way, it can accept any type of iterator:
struct my_functor { template <typename IteratorT> void operator()(IteratorT first, IteratorT last) const; };
Take note that this is only possible with functors. It is not possible to pass in template functions as semantic actions unless you cast it to the correct function signature; in which case, you monomorphize the function. This clearly shows that functors are superior to plain functions..
Here is an example of a grammar with a rule r that can be called with 3 types of scanners (phrase-level, lexeme, and lower-case). See the rule, grammar, lexeme_scanner and as_lower_scanner for more information.
Here's the grammar (see multiple_scanners.cpp):
struct my_grammar : grammar<my_grammar> { template <typename ScannerT> struct definition { definition(my_grammar const& self) { r = lower_p; rr = +(lexeme_d[r] >> as_lower_d[r] >> r); } typedef scanner_list< ScannerT , typename lexeme_scanner<ScannerT>::type , typename as_lower_scanner<ScannerT>::type > scanners; rule<scanners> r; rule<ScannerT> rr; rule<ScannerT> const& start() const { return rr; } }; }; three scanners for the list, the following line must be inserted into the source file before the inclusion of Spirit headers:
#define BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT 3
You use grammars and you use lots of 'em? Want a fly-weight, no-cholesterol, super-optimized grammar? Read on...
I have a love-hate relationship with rules. I guess you know the reasons why. A lot of problems stem from the limitation of rules. Dynamic polymorphism and static polymorphism in C++ do not mix well. There is no notion of virtual template functions in C++; at least not just yet. Thus, the rule is tied to a specific scanner type. This results in problems such as the scanner business, our no. 1 FAQ. Apart from that, the virtual functions in rules slow down parsing, kill all meta-information, and kills inlining, hence bloating the generated code, especially for very tiny rules such as:
r = ch_p('x') >> uint_p;
The rule's limitation is the main reason why the grammar is designed the way it is now, with a nested template definition class. The rule's limitation is also the reason why subrules exists. But do we really need rules? Of course! Before C++ adopts some sort of auto-type deduction, such as that proposed by David Abrahams in clc++m:
auto r = ...definition ...
we are tied to the rule as RHS placeholders. However.... in some occasions we can get by without rules! For instance, rather than writing:
rule<> x = ch_p('x');
It's better to write:
chlit<> x = ch_p('x');
That's trivial. But what if the rule is rather complicated? Ok, let's proceed stepwise... I'll investigate a simple skip_parser based on the C grammar from Hartmut Kaiser. Basically, the grammar is written as (see no_rule1.cpp):
struct skip_grammar : grammar<skip_grammar> { template <typename ScannerT> struct definition { definition(skip_grammar const& /*self*/) { skip = space_p | "//" >> *(anychar_p - '\n') >> '\n' | "/*" >> *(anychar_p - "*/") >> "*/" ; } rule<ScannerT> skip; rule<ScannerT> const& start() const { return skip; } }; };
Ok, so far so good. Can we do better? Well... since there are no recursive rules there (in fact there's only one rule), you can expand the type of rule's RHS as the rule type (see no_rule2.cpp):
struct skip_grammar : grammar<skip_grammar> { template <typename ScannerT> struct definition { definition(skip_grammar const& /*self*/) : skip ( space_p | "//" >> *(anychar_p - '\n') >> '\n' | "/*" >> *(anychar_p - "*/") >> "*/" ) { } typedef alternative<alternative<space_parser, sequence<sequence< strlit<const char*>, kleene_star<difference<anychar_parser, chlit<char> > > >, chlit<char> > >, sequence<sequence< strlit<const char*>, kleene_star<difference<anychar_parser, strlit<const char*> > > >, strlit<const char*> > > skip_t; skip_t skip; skip_t const& start() const { return skip; } }; };
Ughhh! How did I do that? How was I able to get at the complex typedef? Am I insane? Well, not really... there's a trick! What you do is define the typedef skip_t first as int:
typedef int skip_t;
Try to compile. Then, the compiler will generate an obnoxious error message such as:
"cannot convert boost::spirit::alternative<... blah blah...to int".
THERE YOU GO! You got it's type! I just copy and paste the correct type (removing explicit qualifications, if preferred).
Can we still go further? Yes. Remember that the grammar was designed for rules. The nested template definition class is needed to get around the rule's limitations. Without rules, I propose a new class called sub_grammar, the grammar's low-fat counterpart:
namespace boost { namespace spirit { template <typename DerivedT> struct sub_grammar : parser<DerivedT> { typedef sub_grammar self_t; typedef DerivedT const& embed_t; template <typename ScannerT> struct result { typedef typename parser_result< typename DerivedT::start_t, ScannerT>::type type; }; DerivedT const& derived() const { return *static_cast<DerivedT const*>(this); } template <typename ScannerT> typename parser_result<self_t, ScannerT>::type parse(ScannerT const& scan) const { return derived().start.parse(scan); } }; }}
With the sub_grammar class, we can define our skipper grammar this way (see no_rule3.cpp):
struct skip_grammar : sub_grammar<skip_grammar> { typedef alternative<alternative<space_parser, sequence<sequence< strlit<const char*>, kleene_star<difference<anychar_parser, chlit<char> > > >, chlit<char> > >, sequence<sequence< strlit<const char*>, kleene_star<difference<anychar_parser, strlit<const char*> > > >, strlit<const char*> > > start_t; skip_grammar() : start ( space_p | "//" >> *(anychar_p - '\n') >> '\n' | "/*" >> *(anychar_p - "*/") >> "*/" ) {} start_t start; };
But what for, you ask? You can simply use the start_t type above as-is. It's already a parser! We can just type:
skipper_t skipper = space_p | "//" >> *(anychar_p - '\n') >> '\n'
| "/*" >> *(anychar_p - "*/") >> "*/" ;
and use skipper just as we would any parser? Well, a subtle difference is that skipper, used this way will be embedded by value when you compose more complex parsers using it. That is, if we use skipper inside another production, the whole thing will be stored in the composite. Heavy!
The proposed sub_grammar OTOH will be held by reference. Note:
typedef DerivedT const& embed_t;
The proposed sub_grammar does not have the inherent limitations of rules, is very lighweight, and should be blazingly fast (can be fully inlined and does not use virtual functions). Perhaps this class will be part of a future spirit release.
Some compilers already support the typeof keyword. Examples are g++ and Metrowerks CodeWarrior. Someday, typeof will become commonplace. It is worth noting that we can use typeof to define non-recursive rules without using the rule class. To give an example, we'll use the skipper example above; this time using typeof. First, to avoid redundancy, we'll introduce a macro RULE:
#define RULE(name, definition) typeof(definition) name = definition
Then, simply:
RULE( skipper, ( space_p | "//" >> *(anychar_p - '\n') >> '\n' | "/*" >> *(anychar_p - "*/") >> "*/" ) );
(see typeof.cpp)
That's it! Now you can use skipper just as you would any parser. Be reminded, however, that skipper above will be embedded by value when you compose more complex parsers using it (see sub_grammar rationale above). You can use the sub_grammar class to avoid this problem.
This technique, I'll call the "Nabialek trick" (from the name of its inventor, Sam Nabialek), can improve the rule dispatch from linear non-deterministic to deterministic. The trick applies to grammars where a keyword (operator, etc), precedes a production. There are lots of grammars similar to this:
r = keyword1 >> production1 | keyword2 >> production2 | keyword3 >> production3 | keyword4 >> production4 | keyword5 >> production5 /*** etc ***/ ;
The cascaded alternatives are tried one at a time through trial and error until something matches. The Nabialek trick takes advantage of the symbol table's search properties to optimize the dispatching of the alternatives. For an example, see nabialek.cpp. The grammar works as follows. There are two rules (one and two). When "one" is recognized, rule one is invoked. When "two" is recognized, rule two is invoked. Here's the grammar:
one = name; two = name >> ',' >> name; continuations.add ("one", &one) ("two", &two) ; line = continuations[set_rest<rule_t>(rest)] >> rest;
where continuations is a symbol table with pointer to rule_t slots. one, two, name, line and rest are rules:
rule_t name; rule_t line; rule_t rest; rule_t one; rule_t two; symbols<rule_t*> continuations;
set_rest, the semantic action attached to continuations is:
template <typename Rule> struct set_rest { set_rest(Rule& the_rule) : the_rule(the_rule) {} void operator()(Rule* newRule) const { m_theRule = *newRule; } Rule& the_rule; };
Notice how the rest rule gets set dynamically when the set_rule action is called. The dynamic grammar parses inputs such as:
"one only"
"one again"
"two first, second"
The cool part is that the rest rule is set (by the set_rest action) depending on what the symbol table got. If it got a "one" then rest = one. If it got "two", then rest = two. Very nifty! This technique should be very fast, especially when there are lots of keywords. It would be nice to add special facilities to make this easy to use. I imagine:
r = keywords >> rest;
where keywords is a special parser (based on the symbol table) that automatically sets its RHS (rest) depending on the acquired symbol. This, I think, is mighty cool! Someday perhaps...
Also, see the switch parser for another deterministic parsing trick for character/token prefixes.
Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at)
|
http://www.boost.org/doc/libs/1_37_0/libs/spirit/classic/doc/techniques.html
|
crawl-003
|
refinedweb
| 1,528
| 55.54
|
So you have written a great application and rolled it out to all your users and a week later you get the dreaded email:
Downloaded your program and I love it but it crashed. Can you please fix it.
You didn't expect details ... did you? So now you go through an extended exchange with the user trying to tie down the bug and eventually you give up and add it to the too hard basket in case someone else experiences the problem.
Of course you could ask the user to install Dr Watson or another tool which captures information when an application experiences an exception but what if the problem is a hang or if you would like internal application state information when the problem occured.
There is a better way. Using the debug toolkit outlined in this article you can get the users to send to you a file which provides:
The trace log not only contains statements you have traced out. When an error occurs such as an exception, a hang or an assert fails the following details are dumped to the trace log so you can get a picture of what was happening:
These are produced based on the following events:
To get all of this you actually need do very little coding and can easily enhance or limit the functionality without the need to modify directly the provided code.
One of the design goals here was to make this class very easy to incorporate into an existing or new application. The main class is CDebugToolkit. It also has some helper classes but you should never need to access them. CDebugToolkit has been designed to form the base class for your own debug toolkit class in which you will override numerous methods and occasionally call methods on the base class. If you find yourself changing CDebugToolkit then either you have found a bug (in which case let us know) or you are providing a generic enhancement which could be used by others (in which case also let us know). In all other circumstances I would hope the functionality could live in the derived class.
CDebugToolkit
By sticking with this approach you should be able to easily incorportate enhancements if/when they are made.
BOOL AddFile(const CString& sFile, const BOOL fTestDLL = FALSE, const BOOL fTestFile = FALSE);
Adds a file to the list of files that will be dumped should a log be required.
Returns FALSE if the file was to be tested and the test failed.
BOOL AddCOM(const CString& sFile, const CLSID clsid, const BOOL fTest = FALSE);
Adds a COM objects to the list of COM objects that will be dumped should a log be required.
Returns FALSE if the COM object was to be tested and it failed.
virtual void Assert(DWORD dwLine, const CString& sFile, BOOL fCondition, const CString& sCondition, const CString& sDescription = "");
Evaluates fCondition. If it is FALSE then it writes trace output with details of the line, the condition and an optional description. See the DT_ASSERT* macros for an easy way to use this function. This is a virtual function so you can always replace it in your derived class.
fCondition
virtual void Trace(const CString& sOut, const DWORD dwFilterFlag = 0xFFFFFFFF, const BOOL fForce = FALSE);
Writes out a message to the trace log. See the DT_TRACE* macros for an easy way to use this function. This is a virtual function so you can always replace it in your derived class.
OnTrace
virtual BOOL DumpToFile(const CString& sFile, const CString& sPre = "");<BR>virtual void DumpToFile(CFile& file, const CString& sPre = "");
Writes all debug information to a log file. These are virtual functions so you can always replace them in your derived class.
Returns FALSE if the file could not be created.
void Delete(void);
Deletes the cicular log file used to track trace output.
void Reset(void);
Calling this function causes the debug toolkit to reload the debug options. Use this function if you want to turn on/off debug capabilities at runtime.
void SetTraceFilter(const DWORD dwFilter)
This function sets the trace filter 32 bit flag which gets and'd with each trace request.
void SetSuspendHang(const BOOL fSuspend)
This function suspends and re-activates the automated hang detection routine. Typically you would suspend this routine when performing particularly long tasks which do not allow the thread to process messages.
static CDebugToolkit* GetDebugToolkit(void)
This function is a static function used to access the single instance of the debug toolkit. This function is used by the DT_ macros to allow you to easily write code to call instance methods.
CDebugToolkit(void);
It is essential you call the base class constructor when constructing your derived class. You should also set any of the Debug Toolkit member variables that you don't like the default values for:
You would also typically add any files and COM objects that you want checking or dumping.
BOOL Initialise(void);
This method should be called from your derived classes constructor just before it returns. It is critical that you have set all options prior to calling this function.
Returns FALSE if an error occured in initialisation.
DT_TRACE[0..3](s, p1, p2, p3)
These macros are shortcuts for calling the Trace method. Using this macro prevents using filtering. This macro is used in an identical manner to MFCs TRACE[0..3] macros.
Trace
TRACE[0..3]
DT_TRACEF[0..3](f, s, p1, p2, p3)
These macros are identical to DT_TRACE[0..3] except the additional f parameter allows you to pass a 32 bit flag field which will be and'd with the trace filter flag and only traced if at least 1 set bit matches.
DT_TRACE[0..3]
DT_ASSERT(b)
This macro is a shortcut for calling the Assert method. This macro is used in an identical manner to MFCs ASSERT macro.
Assert
ASSERT
DT_ASSERTS(b, s)
This macro is a shortcut for calling the Assert method. It extends the DT_ASSERT macro in that it allows you to describe what you are asserting.
DT_ASSERT
These methods have been specifically designed to be overridden in your class that derives from CDebugToolkit. Please do not change the methods directly.
virtual BOOL OnAssert(void);
Called to see if you want the assert handled. If you want the assert handled return TRUE.
virtual void OnEndAssert(void);
Called once the assert has been accepted and handled. Allows you to do some post assert processing such as maybe saving a log file and suggesting the user mail it to you.
virtual BOOL OnException(struct _EXCEPTION_POINTERS *pExceptionInfo);
Called to see if you want to handle the exception. If you want the exception handled return TRUE.
virtual void OnEndException(void);
Called once the exception has been accepted and handled. You need to be very careful what you do here as exceptions usually mean something is quite wrong.
virtual BOOL OnHang(void);
Called to see if you want to handle the hang automatically detected. If you want the hang handled return TRUE. You may want to ask the user if the program appears to have hung ... just in case.
virtual void OnEndHang(void);
Called once the hang has been accepted and handled. Allows you to do some final processing before the task is killed. BEWARE when this method is called you are not running in the main thread.
virtual BOOL OnUserHang(void);
Called to see if you want to handle the user reported hang. If you want the hang handled return TRUE.
virtual void OnEndUserHang(void);
Called once the user reported hang has been accepted and handled. Allows you to do some final processing before the task is killed. BEWARE when this method is called you are not running in the main thread.
virtual BOOL OnTrace(const DWORD dwFilterFlag);
Called to see if you want the trace processed. If you want the trace handled return TRUE.
virtual void OnReset(void);
Called to allow you to change debug toolkit processing options before debugging is restarted.
virtual BOOL OnDelete(void);
Called to allow you to do some processing before the delete request is handled. Return FALSE to cancel the delete.
virtual void OnAbnormalExit(void);
Called to allow you to do some processing when we detect the program did not exit normally last time it was run. This function is usually run prior to completion of the application constructor which limits some of the MFC functionality you can use.
virtual void OnTestDLLFail(const CString& sFile, DWORD dwError);
Called when a DLL could not be loaded. Override this if you want to tell the user that a critical DLL is missing.
virtual void OnTestCOMFail(const CLSID clsid, const CString& sFile, DWORD dwError);
Called when a COM file could not be loaded. Override this if you want to tell the user that a critical COM object is missing.
virtual void OnTestFileFail(const CString& sFile, DWORD dwError);
Called when a file could not be found. Override this if you want to tell the user that a critical file is missing.
virtual CString GetDumpOtherAtEvent(void);
Allows you to provide additional data to write to the trace log when a hang, exception or assert event occurs.
virtual CString GetDumpOtherAtSave(void);
Allows you to provide additional data to write to the log file when it is being written to disk.
virtual void GetOptionDescriptions(CString& sOptionDescriptions);
Allows you to dump in human readable form the options currently in effect.
virtual void ExportOptions(CFile& file);
Allows you to dump in machine readable (but text) form to options currently in effect.
VERSION.LIB
Generate mapfile
Assembly with Source Code
CApplication
CMyDebugToolkit m_mdt;
#include "MyDebugToolkit.h"
CMyDebugToolkit
ASSERT()
DT_
CAUTION: When running your code under the debugger this class will not trap exception events. This is because the debugger takes priority and traps it first.
There is obviously a lot of functionality here but there are also lots of possible enhancements. Should you make any or have any suggestions please let me know.
Here are some possible enhancements I have thought of but either don't have the time or equipment to do.
NOTE: I do post fixes to the code project site but sometimes it can take a few days for them to get there. The latest source is always.
|
http://www.codeproject.com/Articles/434/Debug-Toolkit?fid=510&df=90&mpp=25&sort=Position&spc=Relaxed&tid=193423
|
CC-MAIN-2017-17
|
refinedweb
| 1,703
| 62.88
|
A YAML based, pluggable configuration library inspired by Aeson
Project description
Introduction
Miniscule is a library for flexible YAML-based configuration files, inspired by Clojure’s Aero.
Example
Create a file
config.yaml with the following contents:
server: host: !or [!env HOST, localhost] port: !or [!env PORT, 8000] debug: !env DEBUG database: name: my_database user: my_user password: !env DB_PASSWORD secret: !aws/sm secret
Then, in Python:
from miniscule import read_config config = read_config('config.yaml')
Now,
config holds a dictionary with the structure of the
config.yaml file, in which the tagged fields have been replaced.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|
https://pypi.org/project/descriptive/
|
CC-MAIN-2021-10
|
refinedweb
| 124
| 53.17
|
Patch 6.0.067
Expand Messages
- Patch 6.0.067
Problem: if_xcmdsrv.c doesn't compile on systems where fd_set isn't defined
in the usual header file (e.g., AIX). (Mark Waggoner)
Solution: Include sys/select.h in if_xcmdsrv.c for systems that have it.
Files: src/if_xcmdsrv.c
*** ../vim60.66/src/if_xcmdsrv.c Mon Sep 24 12:02:29 2001
--- src/if_xcmdsrv.c Sat Nov 3 13:56:56 2001
***************
*** 21,26 ****
--- 21,31 ----
# include <X11/Xatom.h>
# endif
+ # if defined(HAVE_SYS_SELECT_H) && \
+ (!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME))
+ # include <sys/select.h>
+ # endif
+
/*
* This file provides procedures that implement the command server functionality
* of Vim when in contact with an X11 server.
*** ../vim60.66/src/version.c Sat Nov 3 14:01:26 2001
--- src/version.c Sat Nov 3 14:01:06 2001
***************
*** 608,609 ****
--- 608,611 ----
{ /* Add new patch number below this line */
+ /**/
+ 67,
/**/
--
An easy way to determine if you have enough teamwork to be doomed is simply to
measure how long it takes from the time you decide to go to lunch together
until the time you actually eat.
(Scott Adams - The Dilbert principle)
/// Bram Moolenaar -- Bram@... -- \\\
((( Creator of Vim -- -- )))
\\\ Help me helping AIDS orphans in Uganda - ///
Your message has been successfully submitted and would be delivered to recipients shortly.
|
https://groups.yahoo.com/neo/groups/vimdev/conversations/topics/26136?o=1&d=-1
|
CC-MAIN-2015-48
|
refinedweb
| 214
| 60.01
|
Arguments!
Arguments are important for all programs. Arguments for programs have nothing to do with shouting, but are additional bits of information supplied to the program when it is run. Open a new Python script
nano arguments.py and type this;
import sys n_arguments = len(sys.argv) for i in range(0, n_arguments): print("Argument %d equals %s" % (i, sys.argv[i]))
Run this script by typing
python arguments.py here are some arguments
What do you see? Can you work out what happened?
In this case you passed four arguments to your script;
here,
are,
some and
arguments. The Python interpreter read those arguments and placed them, together with the name of the script, into a special variable called
sys.argv that you can access from your script (the
sys.argv variable comes from the module called
sys. This is why we have to load (
import) the
sys module at the start of the script using the line
import sys).
Because there can be more than one argument, the
sys.argv variable must be capable of holding more than one value.
sys.argv must be able to hold multiple values. Lists are variables that can hold multiple values. An list is a collection of values that can be accessed by their index. Create a script list.py and write this;
from __future__ import print_function my_list = ["cat", "dog", 261] print(my_list) print(my_list[0]) print(my_list[1]) print(my_list[2]) print("my_list contains %d items" % (len(my_list))) two_dimensional_list = [ [1,2,3], [4,5,6], [7,8,9] ] print(two_dimensional_list[0][2]) for i in range(0, 3): for j in range(0,3): print("%d " % (two_dimensional_list[i][j]), end="") print("\n", end="")
Run this script
python list.py. Can you understand what has been printed and why?
The size of a list (the number of values it contains) can be found by typing
size_of_list = len(list). You can access an individual value within the list using square brackets, e.g.
list[0] is the first value in the list,
list[1] is the second value etc. (Note that we start counting from zero - the first item is at
list[0] not
list[1]).
You can iterate the elements in a list using a
for loop. Each time around the loop, the loop variable will be set to point at another element of the list. If you pass the list to
enumerate() first then the loop is provided with a pair of values: the index of the element and the element itself.
my_list = [3, 5, "green", 5.3, "house", 100, 1] for elem in my_list: print(elem) for i, elem in enumerate(my_list): print("Element %s is %s" % (i, elem))
As well as accessing individual elements in a list looping over all the elements, it is possible to grab subsets of a list by using ’slicing:
my_list = [3, 5, "green", 5.3, "house", 100, 1] print(my_list[-1]) # Get the last element of the list print(my_list[2:5]) # Get elements from index 2 to (but not including) index 5 print(my_list[3:]) # Get elements from index 3 until the end of the list print(my_list[:4]) # Get elements from the beginning to (but not including) index 4 print(my_list[::2]) # Get every other element from the list print(my_list[::-1]) # Get all the elements in reverse order
Inside the square brackets you can have up to three arguments, separated by
:. The first is the starting point for the slice, the second is the stopping point for the slice and the third is the ‘step’.
Exercise
Use the knowledge you’ve gained so far to write a Python script that can print out any times table. Call your script times_table.py, and have it read two arguments. The first argument should be the times table to print (e.g. the five times table) while the second should be the highest value of the times table to go up to. So
python times_table.py 5 12
should print the five times table from 1 times 5 to 12 times 5.
Note that the arguments are loaded into Python as strings. You will need to convert them to integers by using the lines like;
n = int(sys.argv[1])
Answer (don’t peek at this unless you are stuck or until you have finished!)
As an extension, can you think of a way to use lists to print out the times table using words rather than using numbers? To do this you will need to know that you can assign values to a list using the following syntax;
a = [1, 2, 3, 4, 5] b = ["cat", "dog", "fish", "bird"] c = ["zero", "one", "two", "three"]
Answer (don’t peek at this unless you are stuck or until you have finished!)
|
https://chryswoods.com/beginning_python/arguments.html
|
CC-MAIN-2018-17
|
refinedweb
| 796
| 71.65
|
Implement polling in Java with poll() method
Hey Everyone! In this article, we will learn how to implement polling with the help of poll() method java.util.Queue package in Java.
First, let us study the Queue interface present in the java.util package in Java.
Queue interface
The queue interface is present in the java.util package in Java. The queue is an ordered set of elements that follows the First In First Out principle better known as FIFO. It extends the Collection interface. Priority Queue and Linked list classes in Java are present in the Queue interface. There are various methods present in Queue such as add(), peak(), element(), poll()etc.
poll() method in Java
The poll() method is present in the Queue interface (java.util package)
The poll() method is used to remove the element present at the front of the Queue and return it. It deletes the element from the container.
The method returns null when the Queue is empty.
Let’s have a look at the program code to understand it.
Java Code to use poll() method
package program10; import java.util.*; //importing the Queue interface public class Program10 { public static void main(String[] args) { Queue<Character> dq =new ArrayDeque<>(); //add elements to the queue for ( char i = 'a'; i < 'f'; i++ ) { dq.add(i); } //displaying the queue System.out.println("The Queue is "+dq); System.out.println("The element at the front of the queue is "+dq.poll()); System.out.println("The Queue now is "+dq); } }
Output:-
The Queue is [a, b, c, d, e] The element at the front of the queue is a The Queue now is [b, c, d, e]
I hope that the article was useful to you.Leave down comments if any doubts/suggestion.
|
https://www.codespeedy.com/implement-polling-in-java-with-poll-method/
|
CC-MAIN-2020-50
|
refinedweb
| 295
| 76.42
|
02 March 2010 16:28 [Source: ICIS news]
By David Barry
There is an onshore breeze blowing in the North American polypropylene (PP) sector. Tight feedstock supply has caused export business to diminish, and some domestic buyers are beginning to look harder at import options.
?xml:namespace>
As it did for most of 2009, the
Initial hopes for a March rollover faded, and resin buyers now foresee a 3-5 cents/lb increase as feedstock propylene values continue to rise on limited availability.
An unusual blast of cold weather in January 2010 - and the ensuing US Gulf coast cracker outages - certainly helped bring about the current tightness in the olefins markets. But for propylene the problem is also structural.
“The
As propylene prices rise on tighter supply, Congdon says low-value PP applications (which means most exports) will decrease or they will switch to other materials such as polyethylene (PE).
Jim Virosco of Nexant says
“By the end of this year, we’re forecasting [North American] operating rates falling quite a bit as a result of backing out of exports.”
There is plenty of anecdotal evidence that US PP buyers are seeking to extend their resin supply chains overseas, perhaps hoping to smooth out some of the volatility in their resin costs. Market watchers have yet to see extensive importation of PP resin, however.
For one thing, experts say it is easier to ship finished goods like film and fibre roll stock than to ship the pelletized resin. Finished goods imports have been increasing gradually for years, mostly from producers in
North American resin buyers also assume considerable risk that the market could drop out from under them while they have material in transit. The price differential needed to justify PP importation is at least 15-20 cents/lb, a resin marketer said.
So even if buyers successfully negotiate the process of qualifying resin from a foreign manufacturer for their specific application and then managing the complicated logistics, they could lose plenty of money in the process.
It remains to be seen if offshore resin manufacturers will become a major factor in
A more likely consequence of the shifting global PP trade balances will be further capacity closures, says Congdon.
“In the short term there is excess capacity for PP and we expect more plant shutdowns this
|
http://www.icis.com/Articles/2010/03/02/9339290/insight-north-america-polypropylene-approaches-flip-in-trade.html
|
CC-MAIN-2014-49
|
refinedweb
| 387
| 54.26
|
Ubuntu.Components.PageHeadState
PageHeadState is a helper component to make it easier to configure the page header when changing states. More...
Properties
- actions : Action
- backAction : Action
- contents : Item
- head : PageHeadConfiguration
Detailed Description
This example shows how to add an action to the header that enables the user to enter search/input mode:
import QtQuick 2.4 import Ubuntu.Components 1.3 MainView { id: mainView width: units.gu(40) height: units.gu(50) Page { id: searchPage title: "Click the icon" Label { anchors.centerIn: parent text: searchPage.state == "search" ? "search mode" : "normal mode" } state: "default" states: [ PageHeadState { name: "default" head: searchPage.head actions: Action { iconName: "search" onTriggered: searchPage.state = "search" } }, PageHeadState { id: headerState name: "search" head: searchPage.head actions: [ Action { iconName: "contact" } ] backAction: Action { id: leaveSearchAction text: "back" iconName: "back" onTriggered: searchPage.state = "default" } contents: TextField { placeholderText: "search..." } } ] } }
Property Documentation
The actions to be shown in the header with this state.
The back action for this state.
The contents of the header when this state is active.
The head property of the Page which will be the target of the property changes of this State. This property must always be set before the State can be used.
|
https://phone.docs.ubuntu.com/en/apps/api-qml-current/Ubuntu.Components.PageHeadState
|
CC-MAIN-2021-04
|
refinedweb
| 195
| 52.36
|
Levenshtein Fuzzy String Match
Previously I've posted about using the Dice Coefficient as a method to perform a fuzzy match on a string, producing a percentage as a result to measure the amount of similarity between two strings. The Dice Coefficient is a quick way to produce a measurement of similarity, but it does have some drawbacks. With small strings, the amount of similarity is small compared to larger strings. For example "cat" and "hat" come out with a rating of 50% using the Dice Coefficient. With longer strings, the "error" is smoothed. One benefit of the Dice Coefficient is that small runs of characters within the string (and by "small run", I really mean two characters given how the Dice Coefficient functions on bigrams) weigh into the overall rating of similarity. As good as the Dice Coefficient is, simple and fairly quick, it's not the tool for every job.
When dealing with small strings (and small is a relative measurement), the approach created by Vladimir Levenshtein in 1965 has a large benefit over the Dice Coefficient approach. Amazing to realize that the 1965 wasn't a typo; this isn't a new idea or a new problem, but how many software developers in the 21st Century have heard of Levenshteins' algorithm? I'd guess only a small percentage! Yet this is a classic computer science problem, and one that has applications outside of spell checking.
What Levenshteins' algorithm does is count the number of changes that must occur in one string to transform it into another string. Take the example of two strings, "George" and "Geordie"; how many characters would you have to change to transform "George" into "Geordie"? The answer is 2, here's how:
- George -> Georde (substitute the 'g' with 'd')
- Georde -> Geordie (insert 'i' between the 'd' and 'e')
Pretty easy stuff for a human, getting a machine to calculate the answer is another problem. Tracking and measuring the inserting is the really interesting part of the problem and this is what Levenshteins' algorithm does very nicely.
The actual algorithm itself is very simple, requiring a matrix to represent the values as the calculation progresses through both strings. A simple version of the loops results in an O(n2) implementation, but since only very small strings (under 10 characters typically) existed in the problem space I was working within, this was not a huge performance drain.
One modification of the results of the algorithm that I made to produce the goal I had was to produce a percentage instead of a number. This is really only minor tweak to the results to transform the number of edits required into a percentage. To transform the results, I subtracted from 1.0 the number of edits required divided by the length of the longest string. Taking the resulting double value and multiplying by 100 yields a percentage; this step was only done to produce a result that would be meaningful to a user. Using the example of transforming "George" into "Geordie" the result would be: 1.0 * (2 / 7) or 71 (rounded down, remember the goal I had was to produce a fuzzy result and that 71 is close enough). Another example would be transforming "Fred" into "George", almost nothing is the same and 5 edits are required so the result would be 0, 1.0 * (5/6) or 16% as very little is the same and what is isn't in the same position.
Before getting into the loop to calculate the edit distance, check to see if either string is empty. If one is, return the length of the other string. This points out one interesting note about Levelshteins' algorithm, in that the result is always bounded by the length of the longest of the two input parameter strings.
If neither string is empty, then construct the matrix for the calculation. The matrix should be the length of the first input string plus one by the length of the second input string plus one (in the "George" vs. "Geordie" example above, the matrix would measure 7 by 8). Note the "plus one", as these rows are the "seed" values to kick everything off and allow a very simple comparison later. The first column and row will not be modified later as the loops start at the column and row indexed by one, not zero.
Fig 1: Initial Matrix
While looping through the strings, the indexes of both strings are the coordinates of the matrix. Note that the string indexes and the matrix will be off by one as the matrix coordinates start at one and, in the Java code below, the strings start at zero. The actual calculation is interesting as it looks at three cells, the cell to the left, the cell above and the cell to the upper left. The point of the three comparisons is to take the minimum value from any of the three cells, this can be represented simply in Java with a single line of code:
Math.min(Math.min(a, b), c);
Once the matrix is initialized, the remainder of the values may be filled in. Once the entire matrix is filled in, the answer is in the lower right hand cell.
For each comparison, either 0 or 1 is the result. If the two characters are the same, then the result is 0; if they are different, the result is 1. This is used in generating one of the inputs to the selection of the minimum value of the three candidates that will result in the value inserted into the next cell of the matrix. The result of comparing the 'G' to the 'G' would then be 0. The cell above has a value of 1, the cell to the left has a value of 1, and the value of the cell one up and one to the left plus the result of the comparison is 0. Feeding 1,1,0 into the three way minimum results in 0, which is then placed into the cell resulting in a matrix with these values:
Figure 2: Matrix after the first iteration
The result of the first pass would then be:
Figure 3: Matrix after the first pass
Letting the loops run to completion results in a matrix that looks like:
Figure 4: The completed matrix
And the result is 2, as predicted originally.
The Java Code
public class Levenshtein { public Levenshtein() { super(); } public double compare(final String s1, final String s2) { double retval = 0.0; final int n = s1.length(); final int m = s2.length(); if (0 == n) { retval = m; } else if (0 == m) { retval = n; } else { retval = 1.0 - (compare(s1, n, s2, m) / (Math.max(n, m))); } return retval; } private double compare(final String s1, final int n, final String s2, final int m) { int matrix[][] = new int[n + 1][m + 1]; for (int i = 0; i <= n; i++) { matrix[i][0] = i; } for (int i = 0; i <= m; i++) { matrix[0][i] = i; } for (int i = 1; i <= n; i++) { int s1i = s1.codePointAt(i - 1); for (int j = 1; j <= m; j++) { int s2j = s2.codePointAt(j - 1); final int cost = s1i == s2j ? 0 : 1; matrix[i][j] = min3(matrix[i - 1][j] + 1, matrix[i][j - 1] + 1, matrix[i - 1][j - 1] + cost); } } return matrix[n][m]; } private int min3(final int a, final int b, final int c) { return Math.min(Math.min(a, b), c); } }
|
http://georgestragand.com/levenshtein.html
|
CC-MAIN-2019-22
|
refinedweb
| 1,246
| 66.78
|
Hi all,
Here is mu scenario.I am trying to open multiple port on a compute.
I am trying to make the code multi threaded.So here is my code:
import socket import thread from threading import * s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) def handler(clientsock,addr): while 1: data = clientsock.recv(BUFSIZ) if not data: break def openport(port): HOST = socket.gethostname() BUFSIZ = 1024 s.bind((HOST,port)) s.listen(5) print 'Listening on port ',port for n in range(1, 10): thread.start_new_thread(openport, (n,)) while 1: print 'Waiting for connection:' clientsock, addr = s.accept() print 'Connected with: ', addr thread.start_new_thread(handler, (clientsock, addr))
And i am getting following error;
C:\Python27>python m.py Waiting for connection: Traceback (most recent call last): File "m.py", line 21, in <module> clientsock, addr = s.accept() File "C:\Python27\lib\socket.py", line 202, in accept sock, addr = self._sock.accept() socket.error: [Errno 10022] An invalid argument was supplied C:\Python27>
Through this code i want my PC to listen on port 1 to 10.Line 17.It will then start a new thread for that port.And also start another thread if any client connects any of those port.
(Assuming all the selected ports are not in used by another program.)To change the number number of port we have to modify line 17.
So how to solve that.and is there any better way to do that.
Thanks and Regard
Debasish
|
https://www.daniweb.com/programming/software-development/threads/370655/python-socket-problem
|
CC-MAIN-2018-39
|
refinedweb
| 245
| 70.9
|
[I'm sort of loose with the terms field, parameter, and argument here. Forgive me: I think it's still understandable. Also I'm not specifying types here, I'm using Any everywhere. Use your imagination and substitute real types if it helps you.]
Here's version 2 of my proposal:
There have been many requests to add keyword-only fields to dataclasses. These fields would result in __init__ parameters that are keyword-only.
In a previous proposal, I suggested also including positional arguments for dataclasses. That proposal is at... . After some discussion, I think it's clear that positional arguments aren't going to work well with dataclasses. The deal breaker for me is that the generated repr would either not work with eval(), or it would contain fields without names (since they're positional). There are additional concerns mentioned in that thread. Accordingly, I'm going to drop positional arguments from this proposal.
Basically, I want to add a flag to each field, stating whether the field results in a normal parameter or a keyword-only parameter to __init__. Then when I'm generating __init__, I'll examine those flags and put the normal arguments first, followed by the keyword-only ones.
The trick becomes: how do you specify what type of parameter each field represents?
What attrs does ---------------
First, here's what attrs does. There's a parameter to their attr.ib() function (the moral equivalent of dataclasses.field()) named kw_only, which if set, marks the field as being keyword-only. From :
@attr.s
... class A: ... a = attr.ib(kw_only=True)
A()
Traceback (most recent call last): ... TypeError: A() missing 1 required keyword-only argument: 'a'
A(a=1)
A(a=1)
There's also a parameter to attr.s (the equivalent of dataclasses.dataclass), also named kw_only, which if true marks every field as being keyword-only:
@attr.s(kw_only=True)
... class A: ... a = attr.ib() ... b = attr.ib()
A(1, 2)
Traceback (most recent call last): ... TypeError: __init__() takes 1 positional argument but 3 were given
A(a=1, b=2)
A(a=1, b=2)
dataclasses proposal --------------------
I propose to adopt both of these methods (dataclass(kw_ony=True) and field(kw_only=True) in dataclasses. The above example would become:
@dataclasses.dataclass
... class A: ... a: Any = field(kw_only=True)
@dataclasses.dataclass(kw_only=True)
... class A: ... a: Any ... b: Any
But, I'd also like to make this a little easier to use, especially in the case where you're defining a dataclass that has some normal fields and some keyword-only fields. Using the attrs approach, you'd need to declare the keyword-only fields using the "=field(kw_only=True)" syntax, which I think is needlessly verbose, especially when you have many keyword-only fields.
The problem is that if you have 1 normal parameter and 10 keyword-only ones, you'd be forced to say:
@dataclasses.dataclass class LotsOfFields: a: Any b: Any = field(kw_only=True, default=0) c: Any = field(kw_only=True, default='foo') d: Any = field(kw_only=True) e: Any = field(kw_only=True, default=0.0) f: Any = field(kw_only=True) g: Any = field(kw_only=True, default=()) h: Any = field(kw_only=True, default='bar') i: Any = field(kw_only=True, default=3+4j) j: Any = field(kw_only=True, default=10) k: Any = field(kw_only=True)
That's way too verbose for me.
Ideally, I'd like something like this example:
@dataclasses.dataclass class A: a: Any # pragma: KW_ONLY b: Any
And then b would become a keyword-only field, while a is a normal field. But we need some way of telling dataclasses.dataclass what's going on, since obviously pragmas are out.
I propose the following. I'll add a singleton to the dataclasses module: KW_ONLY. When scanning the __attribute__'s that define the fields, a field with this type would be ignored, except for assigning the kw_only flag to fields declared after these singletons are used. So you'd get:
@dataclasses.dataclass class B: a: Any _: dataclasses.KW_ONLY b: Any
This would generate:
def __init__(self, a, *, b):
This example is equivalent to:
@dataclasses.dataclass class B: a: Any b: Any = field(kw_only=True)
The name of the KW_ONLY field doesn't matter, since it's discarded. I think _ is a fine name, and '_: dataclasses.KW_ONLY' would be the pythonic way of saying "the following fields are keyword-only".
My example above would become:
@dataclasses.dataclass class LotsOfFields: a: Any _: dataclasses.KW_ONLY b: Any = 0 c: Any = 'foo' d: Any e: Any = 0.0 f: Any g: Any = () h: Any = 'bar' i: Any = 3+4j j: Any = 10 k: Any
Which I think is a lot clearer.
The generated __init__ would look like:
def __init__(self, a, *, b=0, c='foo', d, e=0.0, f, g=(), h='bar', i=3+4j, j=10, k):
The idea is that all normal argument fields would appear first in the class definition, then all keyword argument fields. This is the same requirement as in a function definition. There would be no switching back and forth between the two types of fields: once you use KW_ONLY, all subsequent fields are keyword-only. A field of type KW_ONLY can appear only once in a particular dataclass (but see the discussion below about inheritance).
Re-ordering args in __init__ ----------------------------
If, using field(kw_only=True), you specify keyword-only fields before non-keyword-only fields, all of the keyword-only fields will be moved to the end of the __init__ argument list. Within the list of non-keyword-only arguments, all arguments will keep the same relative order as in the class definition. Ditto for within keyword-only arguments.
So:
@dataclasses.dataclass class C: a: Any b: Any = field(kw_only=True) c: Any d: Any = field(kw_only=True)
Then the generated __init__ will look like:
def __init__(self, a, c, *, b, d):
__init__ is the only place where this rearranging will take place. Everywhere else, and importantly in __repr__ and any dunder comparison methods, the order will be the same as it is now: in field declaration order.
This is the same behavior that attrs uses.
Inheritance -----------
There are a few additional quirks involving inheritance, but the behavior would follow naturally from how dataclasses already handles fields via inheritance and the __init__ argument re-ordering discussed above. Basically, all fields in a derived class are computed like they are today. Then any __init__ argument re-ordering will take place, as discussed above.
Consider:
@dataclasses.dataclass(kw_only=True) class D: a: Any
@dataclasses.dataclass class E(D): b: Any
@dataclasses.dataclass(kw_only=True) class F(E): c: Any
This will result in the __init__ signature of:
def __init__(self, b, *, a, c):
However, the repr() will still produce the fields in order a, b, c. Comparisons will also use the same order.
Conclusion ----------
Remember, the only point of all of these hoops is to add a flag to each field saying what type of __init__ argument it becomes: normal or keyword-only. Any of the 3 methods discussed above (kw_only flag to @dataclass(), kw_only flag to field(), or the KW_ONLY marker) all have the same result: setting the kw_only flag on one or more fields.
The value of that flag, on a per-field basis, is used to re-order __init__ arguments, and is used in generating the __init__ signature. It's not used anywhere else.
I expect the two most common use cases to be the kw_only flag to @dataclass() and the KW_ONLY marker. I would expect the usage of the kw_only flag on field() to be rare, but since it's the underlying mechanism and it's needed for more complex field layouts, it is included in this proposal.
So, what do you think? Is this a horrible idea? Should it be a PEP, or just a 'simple' feature addition to dataclasses? I'm worried that if I have to do a full blown PEP I won't get to this for 3.10.
mypy and other type checkers would need to be taught about all of this.
-- Eric
|
https://mail.python.org/archives/list/python-ideas@python.org/message/FI6KS4O67XDEIDYOFWCXMDLDOSCNSEYG/
|
CC-MAIN-2022-27
|
refinedweb
| 1,347
| 56.05
|
- Client Socket in Java
This section shows a simple example of using a socket to communicate with another computer. You should type this code in and try it. If you haven't done much network programming, you'll find it a gleeful experience as you network with systems around the planet, and even in space. The space shuttle has a TCP/IP connection to Mission Control, but the spoilsports at NASA keep its address secret.
There is an Internet protocol known as Network Time Protocol or NTP. NTP is used to synchronize the clocks of some computers. Without periodic sync'ing, computer clocks tend to drift out of alignment, causing problems for times they need to agree on, like email and file timestamps. NTP is pretty fancy these days, but a simple part of the protocol involves making a socket connection to a NTP server to get the time.
Our example program will open a socket connection to an NTP server and print out the time it gets back. The way a client asks for the time is simply to make a socket connection to port 13 on an NTP server. Port 13 is the Internet standard on all computers for the time of day port. You don't have to identify yourself or write some data indicating what you want. Just making the socket connection is enough to get the server to give you an answer. Java does all the work of assembling the bytes into packets, sending them, and giving you an input stream with the bytes coming back from the server.
Here is a Java program that connects to an NTP server and asks the time:
import java.io.*; import java.net.*; public class AskTime { public static void main(String a[]) throws Exception { if (a.length!=1) { System.out.println("usage: java AskTime <systemname> "); System.exit(0); } String machine = a[0]; final int daytimeport = 13; Socket so = new Socket(machine, daytimeport); BufferedReader br = new BufferedReader( new InputStreamReader( so.getInputStream() ) ); String timestamp = br.readLine(); System.out.println( machine + " says it is " + timestamp ); } }
The program expects the name of an NTP server to be passed to it on the commandline. There are about 200,000 NTP servers on the Internet. Several national standards organizations allow reading the time via NTP. Table 17-1 gives some addresses for the service.
Table 171 Some Global Timeservers
These servers come and go. Do a web search on "NTP server" for a current list. When you run the program, giving a hostname as argument, you see this:
% java AskTime ntp.adelaide.edu.au ntp.adelaide.edu.au says it is Wed Oct 17 23:20:32 2001
TCP/IP on Windows
Your Java network programs are going to work only if you are using a <Anchor0>computer that has an IP address and a connection to a TCP/IP network.
On a Unix workstation, TCP/IP support is a standard part of the operating system. On Windows 95, you'll need to have the TCP/IP protocol stack (library) installed.
Networking in Windows 9x can be fussy. You'll find that you have to have an active dial-up connection to get any part of it to work.
You can even provide the IP address instead of the server name, and the program will work equally well.
This program demonstrates how easy it is to open a socket connection to a port on another computer using the Java networking library. It's just flat out impressive to write a dozen lines of code that can ask a computer anywhere on the planet to tell you the time. Maybe there's something to this Internet thing, after all.
Sockets are used in client or in server mode. The program above is an example of the client use of socket. The client side initiates the contact. It is like knocking on a door or calling a phone number and starting a conversation with whoever answers.
The server side is just sitting there, waiting on a socket until someone shows up to ask for something. We will show how to write a server socket a little later in the chapter. The next topic is another example of how a client can obtain a service by opening a socket connection and writing to it. The example here is sending email, by writing to the mailserver port which (as another Internet standard) lives on port 25.
|
https://www.informit.com/articles/article.aspx?p=26316&seqNum=3
|
CC-MAIN-2021-43
|
refinedweb
| 738
| 63.49
|
- NAME
- SYNOPSIS
- DESCRIPTION
- EXPORTED FUNCTIONS
- is(actual, expected, [test-name])
- blocks( [data-section-name] )
- next_block()
- first_block()
- run(&subroutine)
- run_is([data_name1, data_name2])
- is_deep($data1, $data2, $test_name)
- run_is_deeply([data_name1, data_name2])
- run_is_deeply([data_name1, data_name2])
- run_is_deeply([data_name1, data_name2])
- run_like([data_name, regexp | data_name]);
- run_unlike([data_name, regexp | data_name]);
- run_compare(data_name1, data_name2)
- delimiters($block_delimiter, $data_delimiter)
- spec_file($file_name)
- spec_string($test_data)
- filters( @filters_list or $filters_hashref )
- filters_delay( [1 | 0] );
- filter_arguments()
- tie_output()
- no_diff()
- default_object()
- WWW() XXX() YYY() ZZZ()
- croak() carp() cluck() confess()
- TEST SPECIFICATION
- FILTERS
- OO
- THE Test::Base::Block CLASS
- SUBCLASSING
- DISTRIBUTION SUPPORT
- OTHER COOL FEATURES
- HISTORY
- AUTHOR
NAME
Test::Base - A Data Driven Testing Framework
SYNOPSIS
A new test module:
# lib/MyProject/Test.pm package MyProject::Test; use Test::Base -Base; use MyProject; package MyProject::Test::Filter; use Test::Base::Filter -base; sub my_filter { return MyProject->do_something(shift); }
A sample test:
# t/sample.t use MyProject::Test; plan tests => 1 * blocks; run_is input => 'expected'; sub local_filter { s/my/your/; } __END__ === Test one (the name of the test) --- input my_filter local_filter my input lines --- expected expected output === Test two This is an optional description of this particular test. --- input my_filter other input lines --- expected other expected output
DESCRIPTION
Testing is usually the ugly part of Perl module authoring. Perl gives you a standard way to run tests with Test::Harness, and basic testing primitives with Test::More. After that you are pretty much on your own to develop a testing framework and philosophy. Test::More encourages you to make your own framework by subclassing Test::Builder, but that is not trivial.
Test::Base gives you a way to write your own test framework base class that is trivial. In fact it is as simple as two lines:
package MyTestFramework; use Test::Base -Base;
A module called
MyTestFramework.pm containing those two lines, will give all the power of Test::More and all the power of Test::Base to every test file that uses it. As you build up the capabilities of
MyTestFramework, your tests will have all of that power as well.
MyTestFramework becomes a place for you to put all of your reusable testing bits. As you write tests, you will see patterns and duplication, and you can "upstream" them into
MyTestFramework. Of course, you don't have to subclass Test::Base at all. You can use it directly in many applications, including everywhere you would use Test::More.
Test::Base concentrates on offering reusable data driven patterns, so that you can write tests with a minimum of code. At the heart of all testing you have inputs, processes and expected outputs. Test::Base provides some clean ways for you to express your input and expected output data, so you can spend your time focusing on that rather than your code scaffolding.
EXPORTED FUNCTIONS
Test::Base extends Test::More and exports all of its functions. So you can basically write your tests the same as Test::More. Test::Base also exports many functions of its own:
is(actual, expected, [test-name])
This is the equivalent of Test::More's
is function with one interesting twist. If your actual and expected results differ and the output is multi-line, this function will show you a unified diff format of output. Consider the benefit when looking for the one character that is different in hundreds of lines of output!
Diff output requires the optional
Text::Diff CPAN module. If you don't have this module, the
is() function will simply give you normal Test::More output. To disable diffing altogether, set the
TEST_SHOW_NO_DIFFS environment variable (or
$ENV{TEST_SHOW_NO_DIFFS}) to a true value. You can also call the
no_diff function as a shortcut.
blocks( [data-section-name] )
The most important function is
blocks. In list context it returns a list of
Test::Base::Block objects that are generated from the test specification in the
DATA section of your test file. In scalar context it returns the number of objects. This is useful to calculate your Test::More plan.
Each Test::Base::Block object has methods that correspond to the names of that object's data sections. There is also a
name and a
description method for accessing those parts of the block if they were specified.
The
blocks function can take an optional single argument, that indicates to only return the blocks that contain a particular named data section. Otherwise
blocks returns all blocks.
my @all_of_my_blocks = blocks; my @just_the_foo_blocks = blocks('foo');
next_block()
You can use the next_block function to iterate over all the blocks.
while (my $block = next_block) { ... }
It returns undef after all blocks have been iterated over. It can then be called again to reiterate.
first_block()
Returns the first block or undef if there are none. It resets the iterator to the
next_block function.
run(&subroutine)
There are many ways to write your tests. You can reference each block individually or you can loop over all the blocks and perform a common operation. The
run function does the looping for you, so all you need to do is pass it a code block to execute for each block.
The
run function takes a subroutine as an argument, and calls the sub one time for each block in the specification. It passes the current block object to the subroutine.
run { my $block = shift; is(process($block->foo), $block->bar, $block->name); };
run_is([data_name1, data_name2])
Many times you simply want to see if two data sections are equivalent in every block, probably after having been run through one or more filters. With the
run_is function, you can just pass the names of any two data sections that exist in every block, and it will loop over every block comparing the two sections.
run_is 'foo', 'bar';
If no data sections are given
run_is will try to detect them automatically.
NOTE: Test::Base will silently ignore any blocks that don't contain both sections.
is_deep($data1, $data2, $test_name)
Like Test::More's
is_deeply but uses the more correct Test::Deep module.
run_is_deeply([data_name1, data_name2])
Like
run_is_deeply but uses
is_deep which uses the more correct Test::Deep.
run_is_deeply([data_name1, data_name2])
Like
run_is but uses
is_deeply for complex data structure comparison.
run_is_deeply([data_name1, data_name2])
Like
run_is_deeply but uses
is_deep which uses the more correct Test::Deep.
run_like([data_name, regexp | data_name]);
The
run_like function is similar to
run_is except the second argument is a regular expression. The regexp can either be a
qr{} object or a data section that has been filtered into a regular expression.
run_like 'foo', qr{<html.*}; run_like 'foo', 'match';
run_unlike([data_name, regexp | data_name]);
The
run_unlike function is similar to
run_like, except the opposite.
run_unlike 'foo', qr{<html.*}; run_unlike 'foo', 'no_match';
run_compare(data_name1, data_name2)
The
run_compare function is like the
run_is,
run_is_deeply and the
run_like functions all rolled into one. It loops over each relevant block and determines what type of comparison to do.
NOTE: If you do not specify either a plan, or run any tests, the
run_compare function will automatically be run.
delimiters($block_delimiter, $data_delimiter)
Override the default delimiters of
=== and
---.
spec_file($file_name)
By default, Test::Base reads its input from the DATA section. This function tells it to get the spec from a file instead.
spec_string($test_data)
By default, Test::Base reads its input from the DATA section. This function tells it to get the spec from a string that has been prepared somehow.
filters( @filters_list or $filters_hashref )
Specify a list of additional filters to be applied to all blocks. See FILTERS below.
You can also specify a hash ref that maps data section names to an array ref of filters for that data type.
filters { xxx => [qw(chomp lines)], yyy => ['yaml'], zzz => 'eval', };
If a filters list has only one element, the array ref is optional.
filters_delay( [1 | 0] );
By default Test::Base::Block objects are have all their filters run ahead of time. There are testing situations in which it is advantageous to delay the filtering. Calling this function with no arguments or a true value, causes the filtering to be delayed.
use Test::Base; filters_delay; plan tests => 1 * blocks; for my $block (blocks) { ... $block->run_filters; ok($block->is_filtered); ... }
In the code above, the filters are called manually, using the
run_filters method of Test::Base::Block. In functions like
run_is, where the tests are run automatically, filtering is delayed until right before the test.
filter_arguments()
Return the arguments after the equals sign on a filter.
sub my_filter { my $args = filter_arguments; # is($args, 'whazzup'); ... } __DATA__ === A test --- data my_filter=whazzup
tie_output()
You can capture STDOUT and STDERR for operations with this function:
my $out = ''; tie_output(*STDOUT, $buffer); print "Hey!\n"; print "Che!\n"; untie *STDOUT; is($out, "Hey!\nChe!\n");
no_diff()
Turn off diff support for is() in a test file.
default_object()
Returns the default Test::Base object. This is useful if you feel the need to do an OO operation in otherwise functional test code. See OO below.
WWW() XXX() YYY() ZZZ()
These debugging functions are exported from the Spiffy.pm module. See Spiffy for more info.
croak() carp() cluck() confess()
You can use the functions from the Carp module without needing to import them. Test::Base does it for you by default.
TEST SPECIFICATION
Test::Base allows you to specify your test data in an external file, the DATA section of your program or from a scalar variable containing all the text input.
A test specification is a series of text lines. Each test (or block) is separated by a line containing the block delimiter and an optional test
name. Each block is further subdivided into named sections with a line containing the data delimiter and the data section name. A
description of the test can go on lines after the block delimiter but before the first data section.
Here is the basic layout of a specification:
=== <block name 1> <optional block description lines> --- <data section name 1> <filter-1> <filter-2> <filter-n> <test data lines> --- <data section name 2> <filter-1> <filter-2> <filter-n> <test data lines> --- <data section name n> <filter-1> <filter-2> <filter-n> <test data lines> === <block name 2> <optional block description lines> --- <data section name 1> <filter-1> <filter-2> <filter-n> <test data lines> --- <data section name 2> <filter-1> <filter-2> <filter-n> <test data lines> --- <data section name n> <filter-1> <filter-2> <filter-n> <test data lines>
Here is a code example:
use Test::Base; delimiters qw(### :::); # test code here __END__ ### Test One We want to see if foo and bar are really the same... ::: foo a foo line another foo line ::: bar a bar line another bar line ### Test Two ::: foo some foo line some other foo line ::: bar some bar line some other bar line ::: baz some baz line some other baz line
This example specifies two blocks. They both have foo and bar data sections. The second block has a baz component. The block delimiter is
### and the data delimiter is
:::.
The default block delimiter is
=== and the default data delimiter is
---.
There are some special data section names used for control purposes:
--- SKIP --- ONLY --- LAST
A block with a SKIP section causes that test to be ignored. This is useful to disable a test temporarily.
A block with an ONLY section causes only that block to be used. This is useful when you are concentrating on getting a single test to pass. If there is more than one block with ONLY, the first one will be chosen.
Because ONLY is very useful for debugging and sometimes you forgot to remove the ONLY flag before commiting to the VCS or uploading to CPAN, Test::Base by default gives you a diag message saying I found ONLY ... maybe you're debugging?. If you don't like it, use
no_diag_on_only.
A block with a LAST section makes that block the last one in the specification. All following blocks will be ignored.
FILTERS
The real power in writing tests with Test::Base comes from its filtering capabilities. Test::Base comes with an ever growing set of useful generic filters than you can sequence and apply to various test blocks. That means you can specify the block serialization in the most readable format you can find, and let the filters translate it into what you really need for a test. It is easy to write your own filters as well.
Test::Base allows you to specify a list of filters to each data section of each block. The default filters are
norm and
trim. These filters will be applied (in order) to the data after it has been parsed from the specification and before it is set into its Test::Base::Block object.
You can add to the default filter list with the
filters function. You can specify additional filters to a specific block by listing them after the section name on a data section delimiter line.
Example:
use Test::Base; filters qw(foo bar); filters { perl => 'strict' }; sub upper { uc(shift) } __END__ === Test one --- foo trim chomp upper ... --- bar -norm ... --- perl eval dumper my @foo = map { - $_; } 1..10; \ @foo;
Putting a
- before a filter on a delimiter line, disables that filter.
Scalar vs List
Each filter can take either a scalar or a list as input, and will return either a scalar or a list. Since filters are chained together, it is important to learn which filters expect which kind of input and return which kind of output.
For example, consider the following filter list:
norm trim lines chomp array dumper eval
The data always starts out as a single scalar string.
norm takes a scalar and returns a scalar.
trim takes a list and returns a list, but a scalar is a valid list.
lines takes a scalar and returns a list.
chomp takes a list and returns a list.
array takes a list and returns a scalar (an anonymous array reference containing the list elements).
dumper takes a list and returns a scalar.
eval takes a scalar and creates a list.
A list of exactly one element works fine as input to a filter requiring a scalar, but any other list will cause an exception. A scalar in list context is considered a list of one element.
Data accessor methods for blocks will return a list of values when used in list context, and the first element of the list in scalar context. This is usually "the right thing", but be aware.
The Stock Filters
Test::Base comes with large set of stock filters. They are in the
Test::Base::Filter module. See Test::Base::Filter for a listing and description of these filters.
Rolling Your Own Filters
Creating filter extensions is very simple. You can either write a function in the
main namespace, or a method in the
Test::Base::Filter namespace or a subclass of it. In either case the text and any extra arguments are passed in and you return whatever you want the new value to be.
Here is a self explanatory example:
use Test::Base; filters 'foo', 'bar=xyz'; sub foo { transform(shift); } sub Test::Base::Filter::bar { my $self = shift; # The Test::Base::Filter object my $data = shift; my $args = $self->current_arguments; my $current_block_object = $self->block; # transform $data in a barish manner return $data; }
If you use the method interface for a filter, you can access the block internals by calling the
block method on the filter object.
Normally you'll probably just use the functional interface, although all the builtin filters are methods.
Note that filters defined in the
main namespace can look like:
sub filter9 { s/foo/bar/; }
since Test::Base automatically munges the input string into $_ variable and checks the return value of the function to see if it looks like a number. If you must define a filter that returns just a single number, do it in a different namespace as a method. These filters don't allow the simplistic $_ munging.
OO
Test::Base has a nice functional interface for simple usage. Under the hood everything is object oriented. A default Test::Base object is created and all the functions are really just method calls on it.
This means if you need to get fancy, you can use all the object oriented stuff too. Just create new Test::Base objects and use the functions as methods.
use Test::Base; my $blocks1 = Test::Base->new; my $blocks2 = Test::Base->new; $blocks1->delimiters(qw(!!! @@@))->spec_file('test1.txt'); $blocks2->delimiters(qw(### $$$))->spec_string($test_data); plan tests => $blocks1->blocks + $blocks2->blocks; # ... etc
THE
Test::Base::Block CLASS
In Test::Base, blocks are exposed as Test::Base::Block objects. This section lists the methods that can be called on a Test::Base::Block object. Of course, each data section name is also available as a method.
name()
This is the optional short description of a block, that is specified on the block separator line.
description()
This is an optional long description of the block. It is the text taken from between the block separator and the first data section.
seq_num()
Returns a sequence number for this block. Sequence numbers begin with 1.
blocks_object()
Returns the Test::Base object that owns this block.
run_filters()
Run the filters on the data sections of the blocks. You don't need to use this method unless you also used the
filters_delay function.
is_filtered()
Returns true if filters have already been run for this block.
original_values()
Returns a hash of the original, unfiltered values of each data section.
SUBCLASSING
One of the nicest things about Test::Base is that it is easy to subclass. This is very important, because in your personal project, you will likely want to extend Test::Base with your own filters and other reusable pieces of your test framework.
Here is an example of a subclass:
package MyTestStuff; use Test::Base -Base; our @EXPORT = qw(some_func); sub some_func { (my ($self), @_) = find_my_self(@_); ... } package MyTestStuff::Block; use base 'Test::Base::Block'; sub desc { $self->description(@_); } package MyTestStuff::Filter; use base 'Test::Base::Filter'; sub upper { $self->assert_scalar(@_); uc(shift); }
Note that you don't have to re-Export all the functions from Test::Base. That happens automatically, due to the powers of Spiffy.
The first line in
some_func allows it to be called as either a function or a method in the test code.
DISTRIBUTION SUPPORT
You might be thinking that you do not want to use Test::Base in you modules, because it adds an installation dependency. Fear not. Module::Install takes care of that.
Just write a Makefile.PL that looks something like this:
use inc::Module::Install; name 'Foo'; all_from 'lib/Foo.pm'; use_test_base; WriteAll;
The line with
use_test_base will automatically bundle all the code the user needs to run Test::Base based tests.
OTHER COOL FEATURES
Test::Base automatically adds:
use strict; use warnings;
to all of your test scripts and Test::Base subclasses. A Spiffy feature indeed.
HISTORY
This module started its life with the horrible and ridicule inducing name
Test::Chunks. It was renamed to
Test::Base with the hope that it would be seen for the very useful module that it has become. If you are switching from
Test::Chunks to
Test::Base, simply substitute the concept and usage of
chunks to
blocks.
AUTHOR
Ingy döt Net <ingy@cpan.org>
Copyright (c) 2006, 2008, 2009, 2011, 2014. Ingy döt Net. Copyright (c) 2005. Brian Ingerson.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See
|
https://metacpan.org/pod/release/INGY/Test-Base-0.62/lib/Test/Base.pm
|
CC-MAIN-2016-18
|
refinedweb
| 3,236
| 63.8
|
Malaysia Portfolio Investment Calls and Stock Market Update (3 Jun 2020)
Disclaimer: This research should be used purely for informational purposes and is my own personal opinion. I bear no responsibility to whatever investment decisions taken by anyone with regards to this research.
Market Performance: KLCI is up in line with other markets in the Asia region, possibly pushing the 1550 level this week.
The Kuala Lumpur Composite Index (KLCI) today advanced by 2.0% to end at 1539 points, pushing the market towards the next psychological level at 1550 points. All markets were up notably Singapore (+3.4%), Indonesia (+1.9%), Philippines (+3.7%), Germany (+3.7%), and Hong Kong (+1.4%).
Market Outlook: More positive as Eurozone economic data indicates improving sentiments.
Markets around the world continued to rally on the reopening of economies and the perception of the recovery from Covid-19. Economic data from the Eurozone today indicates that sentiments are improving, with the unemployment rate coming out stronger-than-expected at 7.3% compared to forecast of 8.2%. On the supply side, the Composite Purchasing Manager’s Index (for more information on PMI, click on the link here ) came in stronger-than-expected at 31.9 (Forecast: 30.5). The sense of optimism in the markets are now growing in spite of the fact that 2Q economic datas are expected to be the worse, possibly extending into 3Q. I believe we are getting complacent to the realities on the ground, with various organisations around the world confirming that the current recession will even be worse than the 2009 financial crisis. Regular lockdowns of economies will be the norm for everyone moving forward, as small clusters of infections have proven to spread faster and wider than we have anticipated. While oil prices have subsequently recovered from April’s disastrous rout, they are still low when compared to historical prices. Tensions between the United States and China is still expected to escalate even further.
Portfolio Performance: Portfolio returns increased, while still outperforming the KLCI index.
To date, the portfolio of companies I am keeping track on has improved to 15.3% return (2 Jun 2020: 13.2%), outperforming the KLCI index at 12.3%. This indicates an alpha of +3.0% for today (2 Jun 2020: +3.1%). (Note: Alpha is a measure of how much higher or lower the portfolio performs against the market. A positive alpha indicates that the portfolio outperforms the market and vice versa)
From a sectoral point of view, the manufacturing stocks in my portfolio continues to outperform the other sectors, registering 28.0% returns to date. This is followed by Banking (+14.5%), Retail (+14.1%), and Construction (+13.8%).
The higher returns today was supported mainly by daily returns from Alliance Bank (+7.8%), Affin Bank (+8.1%), CIMB (+4.4%) and Cahya Mata Sarawak (+4.3%). You can have a look at the companies I am keeping track on in the Google Excel sheet here or the table below.
|
https://hosuwei1992.medium.com/malaysia-portfolio-investment-calls-and-stock-market-update-3-jun-2020-11e1a083c731?source=post_internal_links---------1----------------------------
|
CC-MAIN-2022-27
|
refinedweb
| 501
| 58.89
|
Supreme Court Judgments
Subscribe
Commnr. of Customs,
New Delhi Vs. M/S. Sony India Ltd. [2008] INSC 1617 (23 September 2008)
Judgment
"REPORTABLE"
IN THE SUPREME COURT
OF INDIA CIVIL APPELLATE JURISDICTION CIVIL APPEAL NO. 8236 OF 2002
Commissioner of Customs, New Delhi .... Appellant Versus Sony India Ltd. ....
Respondent
V.S. SIRPURKAR, J.
1.
An
Order by Customs, Excise & Gold (Control) Appellate Tribunal (hereinafter
called "the Tribunal" for short), allowing the appeal filed by M/s
Sony India Ltd. (the respondent herein), is in challenge at the instance of the
appellant herein. The said appeal was filed challenging the order-in- original
dated 30.1.1999, passed by Commissioner of Customs, Inland Container Depot,
Tughlakabad, New Delhi, wherein the said Authority had confirmed the said
differential duty demand of Rs.42,89,75,196/- under the Proviso to Section
28(1) of the Customs Act, 1962 (hereinafter referred to as "the
Act"). The penalty was also imposed amounting to Rs.30,19,92,183/- under
Section 112(a) read with Section 114(a) with interest under Section 28 AB of
the Act. By the order of the Commissioner, 2 the import of several parts of
Colour Television (hereinafter called "CTV" for short) made by the
appellant for the period from April 1995 to 1997 were treated as import of
complete CTV Sets for the purpose of assessment by the Commissioner.
2.
Initially,
there was difference of opinion amongst the two Learned Members of the Tribunal
on the application of Rule 2(a) of the General Rules for Interpretation under
First Schedule of Import Tariff, on the basis of which the order-in-original
was passed. Accordingly, the following questions were referred to the larger
Bench of the Tribunal:- .)?"
Ultimately, the
larger Bench seems to have agreed with the view expressed by the Ld. Member
(Judicial) to the effect that components imported by the appellant could not be
treated as complete CTV Sets. The larger Bench also held that the duty demand,
direction for confiscation and imposition of penalty were unsustainable in law.
Accordingly, the order-in-original 3 passed by the Commissioner was set aside,
allowing the appeal. It is this order of the larger Bench of the Tribunal,
which is in challenge before us.
3.
Shri
Vikas Singh, Ld. Additional Solicitor General (ASG) of India, painstakingly
took us through the impugned order of the Tribunal, as also to the records
including the Show Cause Notice dated 4.3.1997. The main plank of the argument
is based on that Notice, whereunder the Revenue asserted the evasion of duty on
the part of the respondent on the CKD components and also proposed their
confiscation under Section 111(m) of the Act. In addition, the Revenue also
asserted that the respondents had contravened the provisions of the Exim Policy
1992-97 by importing CKD liable for confiscation under Section 111(d) of the
Act.
4.
The
Show Cause Notice further refers to an exhaustive list of components imported
by the respondents which go into the manufacture of reliance is placed on the
First Purchase Order No. IN-31PI-10 dt.
27.11.1994 placed by
Sony India Pvt. Ltd. on Sony International (Singapore) Ltd. It was on the basis
of this order, which was treated to be Show Cause Notice also gives not only
the quantity actually imported, but 100 such components and it was the
assertion on the part of the Revenue 4 order was placed on 27.11.1994. There
are some other assertions regarding some other items, which were once used, but
discontinued to be used, probably with an idea to show that the components
mentioned in the at S.Nos. 93, 94, 95, 97 and 98 could not be considered to be
the therefore, is that though the respondent was importing the CKD Kits of said
imports were being shown as the imports of the components of the liable to pay
not only the differential duty, but also the penalties on account of the
clandestine imports. A reference was also made in paragraph 8 of the Show Cause
Notice to Rule 2(a) of the General Rules for the Interpretation of the First
Schedule to the Customs Tariff Act, 1975 and it was conveyed that any reference
in a heading to an article should be taken to include a reference to that
article in complete or unfinished, if the incomplete or unfinished article has
the essential character of the complete or finished article. It was on this
basis that the respondent was accused of misdeclaration of imported goods, as also
breach of the Exim Policy. A reference in the said Show Cause Notice was made
to the reply dated 20.9.1996. However, relying fully on Rule 2(a), it was
asserted that the respondent was guilty of misdeclaration and confiscation of
the imported CKD Kits. In short, the assertion was that though the respondent
had 5 imported the CKD Kits and had placed order therefor, numbering 1500 in
all, in that order, it had paid a lesser duty, showing it as import of
components, on which there was lesser duty, and as such, the respondent had
breached the provisions of the Act and had made itself liable for the
confiscation and imposition of differential duties and also the penalties.
Shri Vikas Singh, Ld.
ASG heavily relied on Rule 2(a), which was referred to by us in the earlier
part of the judgment. In addition to this, the assertion of Shri Singh was that
the question was considered by this Court and decided in favour of Revenue in a
decision reported in (2007) 10 SCC 114 & Anr.
5.
Shri
V. Lakshmi Kumaran, learned counsel appearing on behalf of the respondent,
however, pointed out that the Tribunal had correctly deduced that the
components imported by the respondent could not amount to the CKD Kits.
According to him, there was no evidence available to suggest that the
respondent had used these very components Revenue that these components could
and did form the complete CKD Kits complicated manufacturing process involved,
according to which the components which were imported, had to be treated and
processed before 6 not only the customs duty was paid on these components,
treating them as components, but the respondent had also paid substantial
excise duty on Revenue that these were not merely the components, but amounted
to the disputed the interpretation, put forward by the Revenue on Rule 2(a) and
asserted that Rule 2(a) was not even applicable in the present case. We were
taken through number of entries and the notes by the learned counsel. He also
relied on number of decisions of this Court, as also the High Courts and
finally submitted that the decision in Phoenix International Ltd. Case (cited
supra) was not applicable to the facts of the present case, as the said
decision turned on its own facts, peculiar to that case. It is on this backdrop
that we have to consider the questions involved.
6.
The
Learned ASG opened up his arguments by a proposition that the issue involved in
the present Appeal is covered fully by the judgment of this court in Phoenix
International Ltd. Case (cited supra). We would first consider as to whether
all the issues are closed in favour of the Revenue in that judgment. This was
the case, where various parts of the shoes, namely shoe uppers, outer soles,
insoles and sock liners were imported by M/s. Phoenix Industries Ltd.
("PIND" for short) in the same container. It was the claim of the
Revenue that they could be considered as the import of the shoe in SKD (Semi
knocked down) condition. However, the importer 7 had declared them only to be
the components. It was on that basis that the matters proceeded. The Court
first came to the conclusion that a synthetic shoe consists of the vital parts,
namely, the synthetic shoe uppers, outer soles, insoles and sock liners. M/s
Phoenix International Ltd. ("PIL" for short) had the license under which
it was entitled to import synthetic shoes uppers, PVC compounds and natural
rubber. However, the importer PIL had imported 5215 pairs on 16.1.1996 on a
declared value, while on the same day, PIND imported soles and insoles
numbering 5151 pairs. The Court noted that while PIL had imported synthetic
uppers under DEEC Scheme, the PIND had imported the soles under Exim Policy,
1992-97.
Therefore, the
Department was satisfied that there was an attempt to mislead by importing the
above items separately through two different companies, but in fact, it
amounted to the import of the complete synthetic shoes in SKD form. The Court
also noted that all the cartoons were placed in one container with the marking
of "Phoenix" without specifying whether the container was meant for
PIL or PIND. The Court also noted that in the Show Cause Notice, it was claimed
that the import orders had been placed by the above two companies with the same
supplier in Bangkok and that both the import orders were signed by Mr.
Bhupinder Nagpal, General Manager of PIL. It was also alleged in the Show Cause
Notice that import invoices filed by the two companies referred to the same
proforma invoice dt. 2.11.1995, which was placed by Mr. Bhupinder Nagpal on
behalf of both the companies. The Court also further noted that in the Show
Cause Notice, it was specifically pointed out that the consumer items were
placed 8 in the negative list vide Para 156(A) of Exim Policy, 1992-97 and
under the said Para, the consumer goods in SKD form or ready-to-assemble condition
were required to be imported under specific import license and that the
synthetic shoe amounted to a consumer item and as such, had required specific
import license and, therefore, it was further alleged in the Show Cause Notice
that the importer had imported the goods in SKD form or ready-to-assemble
condition without specific import license. The Court further noted that in the
Show Cause Notice, it was further alleged that the PIL had resorted to the
above subterfuge by importing the uppers of "Reebok" shoes in their
own name and the remaining three components in the name of PIND in order to
bypass restriction imposed by Para 156(A) of Exim Policy. The Court also noted
that the Department had alleged in the Show Cause Notice that a loan of Rs.11.7
crores was advanced by PIL to PIND which was interest free loan during the year
ending 31.3.1995 and a loan of Rs.7.7 crores was also advanced to the same
company, which was also interest free during the financial year ending
31.3.1994. The Court noted that it was under these circumstances it was alleged
that the good imported were not parts or the components, but, were SKD goods,
liable to be assessed as complete finished goods under Tariff Sub-heading
6404.19 of the First Schedule of the Customs Tariff Act, 1975 and was liable to
the higher duty ad valorem and countervailing duty at 15% ad valorem. The Court
further referred to the replies sent by PIND and PIL and came to the conclusion
that in that case, the intention would play important role, since it was the
case of duty-evasion on imports. The Court came to the 9 conclusion that it
was clear that the entire device of bifurcation was arranged in order to bypass
the restrictions imposed vide Para 156(A) of the Exim Policy and the importer
had found out the device for evading the import duty. The Court further
wondered as to why the three units of PIL did not import all the four items
when it was in complete charge of manufacturing the said shoes. The Court,
therefore, came to the conclusion that the bifurcation was unnatural and it was
cleared that if the imports of two companies, namely, PIND and PIL were
clubbed, it was nothing, but the import of the shoes, which was in the negative
list. The Court wrote the finding that:
"Therefore, it
is clear that the above device of importation of one item by PIL and three
items by PIND was a subterfuge/fictitious arrangement intended to deceive the
Department and fraud on Para 156(A) of Exim Policy, 1992- 97."
It was under these
circumstances that the Court came to the conclusion that the imports made by
the two companies were fraudulent and with the sole objective to deceive the
Department.
7.
Though,
the Ld. ASG heavily relied on this case to draw a parallel with the present
case, we are of the clear opinion that the principles emerging out of the
decision of Phoenix International Ltd. Case (cited supra) would have to be
restricted to the facts in that case. Unlike in Phoenix International Ltd. Case
(cited supra), there is no allegation of fraud against the present assessee.
There is a complete absence of any such device or "subterfuge" in the
present case, nor is there any allegation 10 of the sort. Again the further
point of differentiation is that in that case, the Court was dealing with the
consumer goods like shoes and that was included in the negative list, whereas,
the CKD in the present case (if at all it is to be CKD which was imported), was
not in the negative list, it was in the restricted list. In our opinion, the
other differentiating feature and the most important one, in our opinion, is
that while the parts imported by the assessee in this case could be
independently used as the spare parts or sold in the market, that was not the
case in Phoenix International Ltd.
Case (cited supra),
at least there is no finding to that effect in Phoenix International Ltd. Case
(cited supra). It was very fairly admitted by the Ld. ASG that the parts
imported could be independently utilized or sold in the open market, which was
not the case with the parts involved in Phoenix International Ltd. Case (cited
supra). The Ld. ASG also very fairly admitted that there was a specific fraud
alleged and proved on the basis of which the Court came to the conclusion that
this was nothing, but a device to deceive the Revenue. We cannot also ignore
the factual panorama in Phoenix International Ltd. Case (cited supra) where all
the parts imported both by PIL and PIND came in one and the same container on
one and the same day, which was not the case here, as the parts in the present
case came during 22 months on different dates in 94 consignments. A feeble
attempt was tried to be made by the Ld. ASG to suggest that all these imports
were based on a single order dated 27.11.1994, in which the figure of 1500 is
found to be ordered. However, it 11 was pointed out by Mr. V. Lakshmi Kumaran
that in the present case, there is no specific finding that all the parts
imported could manufacture 1500 imports. On the backdrop of all this, we would
have to conclude that the Phoenix International Ltd. Case (cited supra) must be
restricted to the facts involved therein, which cannot be matched with the
facts in the present case. In the Phoenix International Ltd. Case (cited
supra), it was clear that the imports of the components perfectly matched with
the number of shoes, which could be prepared from those imported components.
There is a finding to that effect in the decision of Phoenix International Ltd.
Case (cited supra). However, on that backdrop, when we see the list of
components as mentioned in the Show Cause Notice, it is clear that out of the
100 imported components, the number does not match least 21 items. This is
another distinguishing feature. In our opinion, therefore, the arguments of the
Ld. ASG that the Phoenix International Ltd. Case (cited supra) decides the
question involved here in favour of Revenue, must be rejected.
8.
Ld.
ASG drew our attention to the order passed by the Commissioner, who had held
that there was a violation of Exim Policy for period after 25.3.1996. It was
pointed out that the Commissioner had relied on Rule 2(a) and on that basis, he
held that the said violation was 12 after 25.3.1996. As per Rule 2(a), the
components imported had to be the duty was paid only on the basis of the fact
that it was a duty on components only.
8A. It must be better
to see some facts. It must be remembered here that the respondent had clarified
that in the first year of operation with the respondent Sony India Ltd., a
wholly owned subsidiary of Sony Corporation, Japan, after liberalization in
1991 wanted to set up a large They had clarified in their application before
the Foreign Investment Promotion Board ("FIPB" in short) that in the
first year of operation, there will be no indigenization and there will be a
gradual increase in indigenization. It was on that basis that the respondent
obtained industrial license from the Secretariat of Industrial Approval
("SIA" for short) and applied for import license for CRT and PCB,
since the same were in the restricted list. All the other components were
freely importable in India.
The respondent
obviously used Sony Singapore as their indenting agent because Sony Singapore
had a close proximity with the approved vendors of Sony Corporation situated in
countries like Japan, Taiwan, Thailand, Indonesia, Malaysia, China etc. All
these vendors supplied the components on the basis of Minimum Order Quantity
(MOQ) for the optimum utilization of containers, as also for the reduction in
the transport costs, standardizing the manufacture and dispatch procedures. The
13 advanced licenses were issued by the Director General of Foreign Trade
(DGFT) for import of components duty free by availing the benefit of
notification 79/65-Cus dt. 31.3.1995. A Duty Entitlement Exemption Certificate
(DEEC) passbook was also maintained and it was on this basis that over a period
of 22 months, 94 Bills of entry were filed for importing the various
components, concerning the present case.
8B. The components
were assessed under different tariff headings by applying Section Note 2 to Section
XVI. It is an admitted position that the PCBs which were in the restricted
list, were further processed to convert them into Motherboard, which was to be
used in the assembly line for the consumption on payment of excise duty and a
percentage of them were also exported under bond. There is also no complaint
about the indigenization and it is the case of the respondent that they cleared
52,640 crores. As promised, the respondent also made the exports and the
entries to that effect were made in the DEEC Pass book.
8C The concerned Show
Cause Notice dated 4.3.1997 was restricted respondent and it was proposed to
club all these 94 consignments. A detailed reply was filed and it was asserted
by the respondent that there was no violation of Exim Policy, since the goods
were not in CKD/SKD 14 condition. It was then asserted by the respondent that
Rule 2(a) could not have been invoked, as it was tried to be done, since the
import took place over a period of 22 months in 94 lots in containers
containing different parts sourced from different countries. As has already
been stated earlier, the Commissioner applied Rule 2(a) for the period
subsequent to 25.3.1996.
There is a clear
finding given by the Commissioner that before 25.3.1996, there was no breach of
Exim Policy by the respondent. Therefore, it is clear that everything depended
upon the applicability of Rule 2(a) and it was solely on that basis that the
breach of Exim Policy also was alleged for the period prior to 25.3.1996 when
the said Rule came to the anvil. It must be noted here that against the finding
of the Commissioner that there was no breach of Exim Policy by the respondent
prior to 25.3.1996, there is no appeal filed by the Revenue and that finding
had become final. Therefore, all the difference, which was made, was owing to
Rule 2(a). We have already clarified that it is for this sole purpose that Rule
2(a) was relied upon by the Department, because such reliance alone could
justify the and as such, it would attract more duty. There is no difficulty in
holding that the imports were perfectly in order and under the proper import
license. At this juncture, we must also appreciate the finding of the
Commissioner that the goods imported were sourced from different countries and
the imported components were not in CKD form, at least prior to 25.3.1996.
9.
It
is then only due to Rule 2(a) that these components are being Singh, Ld. ASG.
We would, therefore, consider the implication of Rule 2 (a). Rule 2(a) is as
under:- "Any reference in a heading to an article shall be taken to
include a reference to that article incomplete or unfinished, provide."
The Ld. ASG,
therefore, suggests that the articles though were not the every such component,
would have to be taken as an import of CTV. The Ld. ASG heavily relied on the
second part of the Rule, starting from words "It was also to be taken to
new reference............." He says that every component whether it is
complete or finished and which is presented in unassembled or dis-assembled
condition, would have to be taken as the completely illogical and again that is
not the import of the language of the Rule. If the argument of the Ld. ASG has
to be accepted, then we would have to concentrate only on the later part of the
Rule, ignoring the first part of the Rule and such dissection, in our opinion,
is not possible. The sine qua non for the application of this Rule is that any
imported article, which is 16 "as presented", must have the essential
character of the complete or finished article." This condition cannot be
ignored and we cannot allow the reading only of the second part beginning with
words "It was also to be taken to new reference..........." for
application of the Rule. The Rule must apply as a whole. Ld. ASG was not able
to point out as to how the first condition can be satisfied in the present
case. A mere PCB or a CRT, in our opinion, under any circumstances, cannot be
held to have essential character of the CTV. It is only when this first
condition is satisfied that the remaining clause would have to be read and
thereby, the words "that article" used in the later part would have
to pass the test of the opening words of the clause "as presented, the
incomplete or unfinished article has the essential character of the complete or
finished article". Once this condition is satisfied then the further
clause is activated, suggesting that even when such article is in disassembled
or unassembled condition, it would still be taken to be a complete article.
Therefore, essentially the second part would come into play provided the
component parts intended to make up the finished product are all presented for
customs clearance at the same time which is not the case here.
10.
In
Phoenix International Ltd. & Anr. (supra) these conditions in Rule 2(a)
were fully satisfied inasmuch as the spare parts of the shoes could formulate
into a full pair of shoes. Though the learned Judges did not refer to that
specifically in their judgment, the facts clearly suggest that Rule 2(a) was
fully applicable in that case. This is one more reason why 17 the decision in
Phoenix International Ltd. & Anr. is different on facts from the present
case.
11.
Again
the meaning of terms "as presented" in Rule 2(a) would clearly imply
that the same refers to presentation of the incomplete or unfinished or
unassembled or dis-assambled articles to the customs for assessment and
classification purpose. It is also a settled position in law that the goods
would have to be assessed in the form in which they are imported and presented
to the customs and not on the basis of the finished goods manufactured after
subjecting them to some process after the import is made. In the reported
decision in Vareli Weaves Pvt. Ltd. v. Union of India [1996 (83) ELT 255 (SC)]
the question was as to whether the countervailing duty was liable to be left on
the imports made by the assessee at a stage they would reach subsequent to
their import after undergoing a process. It was contended that such goods could
be subjected to duty only in the State in which they were imported. It was held
that the countervailing duty must be levied on goods in the State in which they
are when they are imported. This was on the basis of Section 3 of the Customs
Tariff Act. Though there is no reference to Rule 2(a), in our opinion, the same
Rule should apply subject ofcourse to the applicability of the Rule. We have
already held that the Rule is not 18 applicable. Similar view was taken in
Dunlop India and Madras Rubber Factory Ltd. v. UOI [1982 (13) ELT 1566 (SC).
12.
Shri
Lakshmikumaran argues on the basis of a German Court decision on which the
Tribunal also relied upon. According to the learned counsel in that decision
Rule 2(a) was considered and the Court took the view that the article is to be
considered to be imported in unassembled or disassembled where the component
parts, that is the parts which may be identified as components intended to make
up the finished product are all presented for customs clearance at the same
time. The interpretation that we have given to Rule 2(a) would mean that Rule
2(a) would be applicable only and only if all the components which are intended
to make a final product would have to be presented at the same time for customs
clearance. Such is not the case in the present situation where the goods have
been brought in 94 different consignments.
13.
In
Union of India v. Tarachand Gupta & Sons [(1971) 1 SCC 487] the question
was whether in respect of the goods covered by Entries 294 and 295 of Schedule
I, the import could have been treated under Entry 294. The Court held that when
the Collector examines the goods imported under a licence in respect of goods
covered by Entry 295, he has to ascertain as to whether the goods 19 are parts
and accessories and not whether the goods though parts and accessories are so
comprehensive that if put together would constitute motocycle and scooters in
CKD condition. The court further held that it cannot be said that if the goods
were so covered by Entry 295 that when lumped together they would constitute
other articles, namely, motor-cycles and scooters in CKD condition. Such a
process, if adopted by the Collector, would mean that he was inserting in Entry
295, a restriction which was not there and that would tantamount to making a
new entry in place of Entry 295. The Court explained the term "CKD"
in para 11 and observed in para 12 that merely because the goods imported, if
assembled, would make motor-cycles and scooters in CKD condition, it would not
mean that there was breach of Entry 294 if the imports under Entry 295 was a
valid import. What is important for the present case are the observation in
para 13 to the following effect:
"Therefore, the
mere fact that the goods imported by them were so complete that when put together
would make them motor-cycles and scooters in CKD condition, would not amount to
a breach of the licence or of Entry 295.
Were that to be so,
the position would be anomalous as aptly described by the High Court. Suppose
that an importer were to import equal number of various parts from different
countries under different indents and at different times, and the goods were to
reach here in different consignments and on different dates instead of two
consignments from the same country as in the present case. If the contention
urged before us were to 20 be correct, the Collector can treat them together
and say that they would constitute motor-cycles and scooters in CKD condition.
Such an approach would mean that there is in Entry 295 a limitation against
importation of all parts and accessories of motor-cycles and scooters. Under
that contention, even if the importer had sold away the first consignment or
part of it, it would still b e possible for the Collector to say that had the
importer desired it was possible for him to assemble all the parts and make
motor-cycles and scooters in CKD condition....."
Relying on this case
and referring further to the case of Girdhari Lal Bhansidhar v. Union of India
[(1964) 7 SCR 62] which was distinguished in Tara Chand's case, the learned
counsel also drew our attention to the judgment in Sharp Business Machines v .
CCE, Bangalore [(1991) 1 SCC 154] as also the judgment of the Division Bench of
the Calcutta High Court in the case of Union of India v.
HCL Ltd. (unreported
order). On this basis the learned counsel says that the imports made in 94
consignments could not have been clubbed together for the purposes of holding
that there was a breach by the importer of the Exim Policy. The complaint of
the learned ASG was that all these judgments do not refer to Rule 2(a) as Rule
2 (a) was not on the anvil when these judgments were delivered. That may be
true but the principles of law emerging would still apply.
Therefore, the
clubbing of all 94 consignments of different dates was not permissible.
14.
We
have already held that in this case the goods brought were to take a view that
the goods were in unassembled or dis-assembled particularly when there is no
finding recorded anywhere on facts that argument that the goods brought in
different consignments separately on the basis of valid import licences would
not attract the import duty as if they were the finished goods. We have already
referred to this aspect vis-`-vis the facts in Phoenix International's case
where the goods were brought in one and the single congignment and they were
all brought together though they were imported by two companies, i.e., PIND and
PIL fraudulently.
15.
Shri
Lakshmikumaran, learned counsel for the respondent also drew our attention to
the HSN Explanatory Notes as it stood prior to 1997 which is as under:
"(VII) For the
purpose of this Rule, `articles presented unassembled or disassembled means
articles the components of which are to be assembled either by means of simple
fixing devices (screws, nuts, bolt, etc.) or by riveting or welding, for
example, provided only simple assembly operations are involved."
22 Learned counsel
further points out that in a decision in CCE v. Woodcraft [(1995) 3 SCC 454]
this Court took the view that HSN Explanatory Notes should be referred to for
understanding the true scope and meaning of expressions used in the Customs
Tariff. He further points out that the Revenue did not dispute the fact that
complicated processing of imported Shri Vikas Singh, learned ASG also did not
dispute this fact during the debate before us that a complicated process had to
be exercised before specific finding by the Tribunal on this issue. In that
view since the concerned Explanatory Note was applicable, there would be no
question of treating these notes to be in unassembled or disassembled condition
since a complicated process had to be exercised and then before it could be
further amended by adding the words "no account is to be taken in that
regard of the complexity of the assembly method. However, the components would
not be subjected to any further working operation for completion into the
finished stage". It is an admitted position that this amendment was not
there and therefore, the complexity of the assembly method would have to be taken
into consideration atleast in case of the present goods since the concerned
period is pre 1997 period. The Tribunal has correctly held that the HSN
Explanatory Notes to Rule 2 (a) had to be applied while considering the
relevant Tariff Entry. It 23 has also correctly held after considering the
whole process that the process involved in the user of the components is the
complex manufacturing process during which many components are subjected to
working operation requiring sophisticated machinery and skilled operators.
Further it has correctly assessed the effect of the amendment of HSN
Explanatory Notes which came on 14.3.1997. We approve of the finding given by
the Tribunal in para 25 of its order which takes into account the fact that
there was no amendment to Clause (v) while this is amended to the effect that
complexity of the assembly method was made irrelevant. However, it was made
clear that the components would not be subjected to any further working
operation for completion in the finished state. The Tribunal has referred in
details to the manufacturing process to show that some of the components
require further working operation for completing the manufacturing process and
further that CTV is not a machine which is presented in assembly for the sake
of convenience of packing, handling or transport. We are, therefore, in
agreement with the finding that even applying the amended HSN Explanatory Notes
the position would be no different.
16.
Our
attention was invited to a very interesting decision reported in Modi Xerox
Ltd. v. CCE, New Delhi (1998 (103) ELT 109] which 24 was confirmed by this
Court in 2001 (ELT) A 91 (it must be noted that the decisions in Woodcraft
Products is specifically confirmed in this decision). In this case, the
Tribunal had relied on Tara Chand's case as also the CC v. Mitsuny Electronics
Works [1987 (13) ELT 345 (Cal. HC)] which we have made reference in the earlier
part of this judgment. The Tribunal had held that the fax machine in completely
knocked down condition imported by the appellant being not a fax machine but
part thereof, the benefit of exemption under notification No.59/88/Cus. Dated
1.3.1988 would not be available.
Very interestingly,
it was claimed by the importer that it had imported the fax machine and not the
components obviously because the duty payable on the components was more. The
Tribunal came to the conclusion that in view of Section Note 2 to Section XVI
Rule 2(a) would not apply and confirmed the import of goods as components.
While interpreting
Explanatory Note to Rule 2(a), the Tribunal had held that this Rule would apply
only when the imported articles presented in unassembled or disassembled can be
put together by means of simple fixing device or riveting or welding. It came
to the conclusion that fax machines were not the type of goods which were
normally traded or transported in knocked down condition and therefore, the
imports were that of the components and not of fax 25 machines. Shri
Lakshmikumaran also invites our attention to the fact that Chapter 64 dealing
with footwear does not have a note similar to Note 2 in Section XVI. Thus this
position would render support to the proposition that Rule 2(a) would apply
only when the imported articles presented unassembled or disassembled can be
put together by means of simple fixing device or by riveting or welding. We
have already pointed out in the earlier part of our judgment that the
complicated process would be required for the user of those parts.
17.
Lastly,
we must take stock of the argument of Shri Lakshmikumaran that Section
Interpretative Rule 2(a) would not be applicable at all in this case. For this
he invited our attention to Rule 1 of Interpretative Rules as also to the
decision in Simplex Mills v.
Union of India [2005
(181) ELT 345 (SC)] wherein this Court had held in para 11 as under:
sector or
chapter Notes". If neither the heading nor the notes suffice to clarify
the scope of a heading, then it must be construed according to the other
following provisions contained in the Rules. Rule-I gives primacy to the
Section and Chapter Notes along with terms of the headings. They should be
first applied. If no clear picture 26 emerges then only can one resort to the
subsequent rules."
Relying on this the
further contention of the counsel is that Section Note 2 of Section XVI
provides mandate for classification of the parts of machines falling under
Section XVI. In terms of Rule 1 of Interpretative Rules, invocation of Rule
2(a) for certain categories of For this the learned counsel relied on the
decision in Modi Xerox (supra). In that view the learned counsel says that Rule
2(a) would not be applicable at all. This question needs no consideration here
particularly in view of the interpretation that we have given to Rule 2 (a). On
facts, we have already found that Rule 2(a) would not be applicable to the
present case since there is no question of the goods applicability of Section
2(a) on this account need not be gone into in this judgment.
18.
We
also approve of the reliance by the Tribunal on the reported decision in Susha
Electronics Industries v. CC [1989 (39) ELT 585], Trident Television Pvt. Ltd.
v. CC [(1990) 45 ELT 24], Vishal Electronics Pvt. Ltd. v. CC, Bombay [1998 (102
ELT 188], Sharp 27 Business Machines (supra) and the judgment of the Calcutta
High Court in HCL Ltd. (supra).
19.
Accordingly,
we are of the clear opinion that the Tribunal's judgment needs no interference.
We accordingly confirm the same and dismiss the present appeal. In view of the
important question of interpretation involved in the matter, we do not propose
to inflict any costs.
.......................................J.
(Ashok Bhan)
....................................J.
(V.S. Sirpurkar)
New
Delhi;
Back
|
http://www.advocatekhoj.com/library/judgments/index.php?go=2008/september/144.php
|
CC-MAIN-2018-30
|
refinedweb
| 6,408
| 54.66
|
Archive
Retheming and Branding The Blog….
Technical difficulties at WordPress
It appears WordPress is having “a moment”… CSS customization is down and our blogs have reverted to the OTB formatting. Bleh.
More information at.
Fun times.
Update: Fix’d.
Migrating to a new Web Gallery.
Creating a Countdown Image Handler in ASP.NET
I love WordPress—it’s by far one of the best packaged blogging engines I’ve come across and has kept my DIY tendancies at bay for several years now. With the structure of WordPress, however, comes restrictions. My biggest complaint is that I can’t place JavaScript tools or components on my page.
In the past few months, one thing I would have liked to have was a little “countdown” to graduation, the holidays, whatever. That’s brilliantly simple with JavaScript. Meh. 😦 I looked at a few other sources, but they required registration and made the images HUGE.
So, this afternoon while catching up on my Top Gear obsession on BBCA, I coded up a quick HttpHandler.
You can see an example of the image created by this on the right side of the blog—the Graduation countdown ticker.
The handler accepts two optional variables, width and height, and two required variables, eventText and eventDate.
By default, the width of the image is 100px and the height is 120px—about the size of a standard small banner.
For this code, the most important namespaces are System.Drawing and System.Drawing.Imaging.
First, we need to create a new Bitmap image to hold our graphic.
Bitmap imageBitmap = new Bitmap(width, height);
Next, create a drawing pad, of sorts, in a Graphics object and associate it with our new bitmap image.
Graphics graphicObject = Graphics.FromImage(imageBitmap);
graphicObject.FillRectangle(
new SolidBrush(Color.White), 0, 0, width, height);
Since, by default, the background is Black, call FillRectangle (from 0,0 to the max width and height) to fill the background with White.
Our next task is to create a border around the image. I chose a black border with a 2px width. The draws are in order of top, left, right, and bottom lines. Note: I’m sure there’s a better way to do this by creating an empty rectangle or something…
Pen borderPen = new Pen(Color.Black, 2);
graphicObject.DrawLine(borderPen,
new Point(0, 0),
new Point(width, 0));
graphicObject.DrawLine(borderPen,
new Point(0, 0),
new Point(0, height));
graphicObject.DrawLine(borderPen,
new Point(width, 0),
new Point(width, height));
graphicObject.DrawLine(borderPen,
new Point(0, height),
new Point(width, height));
Our final touch is to put the text onto the image.
Font textFont = new Font(“Arial”, 8, FontStyle.Bold);
SolidBrush textBrush = new SolidBrush(Color.Black);
string imageText = eventText + “: “ + countdown.Days + “d”;
graphicObject.DrawString(imageText,
textFont,
textBrush,
new PointF(2, 2),
null);
To “type” onto an image, create a “font brush” with the assigned color, font face, and size. Instead of drawing a line or shape, use DrawString. The fourth paramenter(new PointF(2,2)) specifies where to begin the text—you can get more creative than this and figure exact locations based on image size.
Finally, use the context supplied by the ProcessRequest method to return the image to the consumer.
context.Response.ContentType = “image/gif”;
imageBitmap.Save(context.Response.OutputStream, ImageFormat.Gif);
That’s it!
If you’re interested in the source code, the link is at the top of the post—download and enjoy! As I update the code, I’ll post it up. This has lots of room for improvement, but is a nice starting point for those who want to put a dynamic image on their hosted blogs. 🙂
WordPress Supports Code!
.
|
https://tiredblogger.wordpress.com/category/wordpress/
|
CC-MAIN-2017-34
|
refinedweb
| 609
| 67.65
|
Conservapedia talk:What is going on at CP?/Archive49
Contents
- 1 "legions in the genital region"
- 2 Conservapedia: Atheism
- 3 By who's definition?
- 4 Parthian Barrage
- 5 CP loves them sources!
- 6 Conservative's About:Atheism obsession
- 7 Parthian thread
- 8 Pregnancy....
- 9 Tee hee Ha Ha ...
- 10 Just how damaging for kids is being homeschooled?
- 11 guns
- 12 Attn. Conservapedia sysops
- 13 Andy of course
- 14 A Reply to the Gentle Peeps at this Site
- 15 Reply to the reply to the reply .......
- 16 PZ Myers and the Gentleman at etc.
- 17 Did anyone notice...
- 18 Oooh....Burnage
- 19 Who Conservapedians Model themselves on
- 20 Ken starts a long list
- 21 Hypothetical Cancer
- 22 Conservatives Dont use or own wallets
- 23 Insults/ban reasons CP hasn't used yet
- 24 Flop
- 25 Has it packed up again
- 26 In regards to Ken's latest atrocious essay...
- 27 Wow
- 28 Wait, what?
- 29 Rob Knox
- 30 Ken's next promotion?
- 31 Liberal Venom
- 32 Multiculturalism
- 33 Ken reaches new levels of censorship by deleting the article wherein everyone's asking an awkward question.
- 34 2 bits of news for da price of 1
- 35 Phil's latest
- 36 closet homosexual
"legions in the genital region"[edit]
Wow, Ken must have spent a night at the bathhouse. --Kels 22:20, 22 May 2008 (EDT)
- Fuck me, I never even noticed the typo - I thought it was pretty WTF to begin with, but now it's just epic. PFoster 22:26, 22 May 2008 (EDT)
- I updated the WIGO to address Ken's imaginary genital legions Exasperate me!Sheesh!Not the most impressive contributor here 22:39, 22 May 2008 (EDT)
Come to that, who the hell is this "Dr. Earl Hawk" of Louisiana, anyhow? I can't find the name at all on Google, let alone anything to do so-called "pornography addiction", or pornography in any sense. Or to do with genital warts. Or even with Louisiana! Does he exist? Is he even still alive? The stuff quoted in the article sounds like it came out of the 50's, so who knows? --Kels 22:47, 22 May 2008 (EDT)
- I got the sense that the "legions" in question, given the nature of the "addiction" in question, may have had more to do with chafing than warts, if you follow. and we all know how painful that would be...PFoster 22:55, 22 May 2008 (EDT)
- So pornography, not masturbation even, causes some sort of physical abnormality... Guys I'm pretty sure that's psrody or however you spell that. UchihaKATON! 23:56, 22 May 2008 (EDT)
- No, it inspires activity which causes some sort of physical abnormality...PFoster 00:08, 23 May 2008 (EDT)
- people, people, people. How naive can you get? Clearly genital legions is conservative code for circle jerks, a phrase that Andy and his lil' legions are no doubt quite familar with . . . (so sorry) Exasperate me!Sheesh!Not the most impressive contributor here 08:04, 23 May 2008 (EDT)
I'm going to start a band named 'Legions in the genital region' now. It's just that awesome. -Judas Reward 09:08, 23 May 2008 (EDT)
- May I suggest Masturbatory Legion? Exasperate me!Sheesh!Not the most impressive contributor here 09:11, 23 May 2008 (EDT)
- Not to mention blindness . . . 204.248.28.194 09:59, 23 May 2008 (EDT)
- I'm a little surprised he hasn't brought hairy palms into it. --Kels 10:08, 23 May 2008 (EDT)
- I believe that Dr. Tony Hawk MD might have confused "legions" with "scabby areas from friction burn". Did anybody happen to catch My name is Earl last night? I think it's hilarious that they just take some country-fried good ol' boy doctor as a reliable source. Grandoise 10:21, 23 May 2008 (EDT)
- Did Ken Freudian slip onto a cliff again? Diff link or it didn't happen. NightFlareSpeak, mortal 21:43, 23 May 2008 (EDT)
Conservapedia: Atheism[edit]
Conservapedia: Atheism
With Ken's almost unprecedented enthusiasm in promoting his precious article-child, this slice of Conservapedia might actually end up attracting a modicum of attention. Would be a worthwhile effort to write a full-length, RationalWiki style refutation of the article? His article's only advantage (if any) is that it's so broad that no one he harasses could possibly be bothered to respond to all of its points in their full inanity. A custom-made anti "anti-atheism" article would effectively counteract that. Furthermore... attention for Conservapedia's atheism article could be syphoned off towards our refutation of it. I'm sure the notion that all of his boasted advertising success was indirectly popularizing one our articles would get Ken rather... excited.
Please answer if there's any interesting in adding at all to such an article (or if we already have one in progress and I've forgotten!) UchihaKATON! 23:04, 22 May 2008 (EDT)
- Ehehe... sorry about that Susan ^_^" UchihaKATON! 23:24, 22 May 2008 (EDT)
- Atheism is Ken's pride and joy. He and Andy are likely to get quite upset (in a legal way) if we just reproduce the text here, aren't they? I know we've done this before, but it's always been with articles that were a lot less important to CP than this one. I'd just like to check with Our Great Leaders to see if we're OK from a legal point of view with this. What do you think? ~ Jellyfish! (Talk • Contribs • Logs) 23:27, 22 May 2008 (EDT)
Jelly, that's a reasonable point... Considering how Ken has been demanding every atheist on the internet refute his dozen-or-so page mess, it would be incredibly hypocritical for him to complain when someone finally does so in a point-by-point article side-by-side with the original. But I suspect avoiding hypocrisy is not a top concern on his list... neither, for that matter, is actually engaging in any sort of substantial debate. Whether he has any legal foundation for such complaints is another matter, and I'd guess - like Gulik - probably not. UchihaKATON! 23:42, 22 May 2008 (EDT)
- Thanks! You know, now I think of it, vandals love trying to replace our pages with that article, so maybe that counts as permission... :D ~ Jellyfish! (Talk • Contribs • Logs) 23:44, 22 May 2008 (EDT)
Alright, I'm hitting the sack now (I always seem to start projects past 10 PM...) but the initialized article is here. Feel free to add to it, work on formatting or even move it to a different space. I'll be back on tomorrow to try and keep things moving. UchihaKATON! 00:26, 23 May 2008 (EDT)
- The #1 way they claim to differ from WP is allowing broader reuse of their material. We could copy a WP article here to refute it, if we wanted to, so I see no reason why we can't do the same for CP. Of course, this assumes they are not hypocrites, which is sort of like assuming black is white, but I think it's worth a go. DickTurpis 09:32, 23 May 2008 (EDT)
- Andy's a very, very poor lawyer, who failed immediately after getting out of the hothouse they were keeping him in at Harvard. His idea of rights on his stuff is, "You can use it for the glory of Conservatives, but I'll send you a laughably ineffective lawsuit threat if you use it for something that makes me look bad". Completely unenforceable. --Kels 09:36, 23 May 2008 (EDT)
Has this refutation article been made? If not, please do so, I want to help contribute to it. They would have no case for copyright infringement, since they say "Conservapedia grants a non-exclusive license to you to use any of the content (other than images) on this site with or without attribution." And despite their claims to the contrary, they can't revoke such a license at their whim when they would like to do so. They would only be able to give and reclaim permission on such things if they were retaining their copyright, but there they explicitly release it.--70.126.243.83 23:19, 23 May 2008 (EDT)
- It's at User:Uchiha/Conservapedia:Atheism. Refute! ~ Jellyfish! (Talk • Contribs • Logs) 23:22, 23 May 2008 (EDT)
By who's definition?[edit]
CP Main Page: For the first time in American history we have two hard-core Leftists running for the Democratic Party nomination "Hillary and Obama are Marx twins who only differ in race and gender." By any non-American definition (apart from, probably, Burma's) both Democratic Candidates are fairly Right Wing. They make the British Conservative Party look leftist anyhow.
ContribsTalk 08:03, 23 May 2008 (EDT)
- Agreed. Apparently they don't teach homeschoolers left from right. Exasperate me!Sheesh!Not the most impressive contributor here 09:15, 23 May 2008 (EDT)
- Whoever wrote that obviously hasn't read Marx, and doesn't know what they're talking about. Nor do they know anything about the 'Democratic' candidates, who are right wing, and fairly authoritarian. If they were actually Marxists, I might support them more, though I don't believe that anything further than Socialism is possible, or will be possible, for centuries. And they're not even close to socialists either, or even social democrats. -Judas Reward 09:17, 23 May 2008 (EDT)
- Substitute "left" and "Marx" with "boogeyman" and it'll make a lot more sense. I said the same thing about the word "terrorist" only a few days after 9-11, and it's served me well since then. --Kels 09:34, 23 May 2008 (EDT)
- Oh yes, and where are these Marxists who fought the US in the Cold War? I don't seem to recall any. Not to mention that, while the USSR did lose the Cold War, so did everybody else. And technically, if you replace them with 'Frenchmen', it seems to make more sense somehow. -Judas Reward 10:30, 23 May 2008 (EDT)
Parthian Barrage[edit]
Apparently Az's Partian shot has gone into Round Two, as he tries once again to appeal to Andy's sense of reason. Unfortunately for him, like Peter Sellers' real self, Andy's had that surgically removed. --Kels 08:26, 23 May 2008 (EDT)
- Shorter Andy: Your staying around for debate is an example of Liberals (which you now are) running away from debate. And I did answer your questions, look at this example where I totally dodged two of them and ignored the rest. --Kels 10:50, 23 May 2008 (EDT)
- Jesus tapdancing, bowl-smoking Christ! He's trolling by bringing up classroom prayer! Aziraphale, call him out on that. You've seen him do that on Dawkins talk page and that... one debate page... that I forget what it is. He's ignoring everything else so he can pin that ONE thing and stick to it. NorsemanWassail! 11:07, 23 May 2008 (EDT)
- My long-standing strategy for traps (it comes from too much D&D, but surprisingly works well in life, too) is simply to barrel into the trap, set it off, and deal with the results. Tap-dancing AROUND traps is what causes people to get off of their own message and give the trap-setter the advantage, in my opinion.
- I'm not there to try and debate him on things he wants to talk about; I want answers to my questions. I'm already doing a middling-to-poor job, although the last couple exchanges I've tried to drag in a course correction. Az 12:27, 23 May 2008 (EDT)
- I'm already doing a middling-to-poor job, No - you're playing a game that nobody can win - he won't answer your questions, will only debate the things he wants to debate on the terms that he sets, and will ignore and or block you (or put his fingers in his ears and go "LA LA LA") whenever his idiocy is expoosed. Don't bother - play the lottery instead. Your chances are better.PFoster 12:32, 23 May 2008 (EDT)
- Actually, he did clearly and concisely answer the two points I was offered. Now the rubber meets the road - laying out the case against the bad sysops. Az 13:30, 23 May 2008 (EDT)
- Ah, I was thinking "Liberals tend to cut off and censor debate while conservatives don’t? I’m not so sure about that. Take a look:" was you, but I was wrong - still he seems to not have taken long to bring the conversation around to you hating on classroom prayer and wanting the gummint to pay for abortions - familiar ground for him...PFoster 13:39, 23 May 2008 (EDT)
-
- An even better anti-trap strategy is to get the party paladin to barrel into it and deal with the results. --AKjeldsenCum dissensie 13:24, 23 May 2008 (EDT)
- -embarassed look- I may, perhaps, occasionally, from time to time, play the paladin. *grin* Az 13:28, 23 May 2008 (EDT)
- Ah. Well, keep up the good work, then. Where would everyone else be without our dear
easily manipulatedheroic paladins? --AKjeldsenCum dissensie 13:33, 23 May 2008 (EDT)
- Well now, all pallies aren't created equal. --Kels 17:54, 23 May 2008 (EDT)
- LOL that's awesome. :) I don't play one anymore, been DMing (in the paladin-less Arcana Evolved, for that matter) for years. But yeah, when I got to run just one character, the last one was a paladin who could be counted on to find out what was behind the door... by opening the door. :p Hey, why have high saves and a d10 hit die if you aren't going to use them? Az 18:48, 23 May 2008 (EDT)
And so it goes.
Shorter Andy: If you won't let me derail the conversation, I can't be bothered with it. --Kels 14:36, 23 May 2008 (EDT)
- One difference in style is that conservatives tend to continue searching for the truth, while liberals tend to cut off and sometimes even censor debate I wonder what it feels like to live a life utterly devoid of self-examination? Thankfully, the soon-to-be-re-banned Jaguar called him on it immediately. --Gulik 15:04, 23 May 2008 (EDT)
- Holey socks, I got back on. I couldn't resist calling Andy on his BS. Take a look before they delete it. --Gulik 16:53, 23 May 2008 (EDT)
- Banninated by the S-Dawg hisself. I feel honored. The reason given was "Talk pollution". I fully expect the irony of this to soar over his head. --Gulik 17:58, 23 May 2008 (EDT)
- Deleted your comment but deceitfully concealed the fact by simultaneously replying to John & using that as edit comment.
ContribsTalk 18:17, 23 May 2008 (EDT)
- That's Andy. Class all the way. :-P --Gulik 18:19, 23 May 2008 (EDT)
CP loves them sources![edit]
Does anyone else find it highly amusing that whenever CP posts any sort of news, they inevitably link to a blog quoting a news site rather than the actual news site. I guess that just shows what they consider reliable sources. Oh and Laura Ingraham is a fucking idiot ("if you turn your back on someone (who isn't even speaking), you're against free speech"). Retard. She'd fit in quite well over at CP. DickTurpis 09:54, 23 May 2008 (EDT)
- The media is liberal. Conservative blogs that quote liberal articles magically transform them into conservative news. Rational Edthink! 10:15, 23 May 2008 (EDT)
Conservative's About:Atheism obsession[edit]
It seems to me he's just begging for attention, trying to call out Austin Cline but being too cowardly to confront him by himself [1]. I've searched that site and couldn't find anything related to Conservapedia (correction - anything earlier than 2007), or his atheism article in specific. It's like me going to the end of my street and putting up slanderous flyers about someone who doesn't even know me. Something tells me that he's trying to get someone else to point out the article to Austin because he 1) can't do it by some reason (banned from their forums, etc. etc.) or 2) thinks the article is so popular, he doesn't need to, thinking some adamant believer will do the work for him.
I just have this nagging notion that if someone DID post the article to Austin and got his attention, it'd be ripped apart piece by piece. Or, maybe Kenny (off his meds, that WIGO reminds me of Kenny sniffing cat piss to get high on South Park) is expecting his article to be ignored, so he can continue goading them as if he "won", but then removes/burns any sort of challenge if it's picked apart, removing any evidence of his buffoonish hype. After all, posting the challenge on THEIR forums means you can't do whatever you please to make it seem like nothing happened.
Also, it's funny how he's only challenging on the grounds of the atheism article, when a quick search around the site would clearly refute itself by the sheer monstrosity of nutjob views they have over there. NorsemanWassail! 10:57, 23 May 2008 (EDT)
- Oh, Kenny's been posting there all right. He's commenter "Mark Davidson". It's the same trick he's tried to pull on Pharyngula and about a hundred other places. There are a couple of places he's insterted links back in the comments over the past month or so. --Kels 11:11, 23 May 2008 (EDT)
- That blows most of the stuff I just said for not knowing. :P Guess I'll do a bit more searching, as I really want to see some squirming. Thanks, Kels. :D NorsemanWassail! 11:18, 23 May 2008 (EDT)
- Here's a nice example. Rational Edthink! 11:27, 23 May 2008 (EDT)
- Oh, that's why he's calling others. He's all alone. lol NorsemanWassail! 11:33, 23 May 2008 (EDT)
- Most relevantly, Austin Cline's response to "Mark Davidson's" post (immediately below it in Ed's link) indicates that he is already aware of Conservapedia:
...are you just posting them here because you wrote them are shilling for part of a Conservapedia which you wrote? ...
Don’t simply quote yourself as if you were an independent authority for your own views
- Cline doesn't need to refute Ken's precious atheism article, he's already bitch-slapped him.
Radioactive afikomen Please ignore all my awful pre-2014 comments. 11:41, 23 May 2008 (EDT)
By the way, your attempts at link-spamming will fail because search engines don’t index the comments here. Thanks for trying — it has been amusing, I won’t deny it, but all the time and effort you’ve spent on that has been wasted. So there is no need to find excuses to include links back to your own Conservapedia articles. It won’t help any more than trying to use passive-aggressive tactics to get me to link to your irrelevant and unimportant articles in the hopes of having them rise up in search engine rankings.
- Owned! Man, I should post all the comment links on my userspace. NorsemanWassail! 12:02, 23 May 2008 (EDT)
- This is great! Thanks, Kels, for clueing us in. Rational Edthink! 12:25, 23 May 2008 (EDT)
Hmm, looks like Ken wants to "count coup" against Cline, for some obscure reason, and claim victory when Cline refuses to "debate". Problem is, it's pretty obvious the difference between "I won't debate because I have no case" and "I won't debate because you have no case". --Kels 18:35, 23 May 2008 (EDT)
Parthian thread[edit]
It's fun to see the debate continue over the whole "public school kids are the dumbest" debate on the main page Talk, since Poor Ed's gone and deleted the original item that Karajou posted for "being a misquote" in the first place. --69.248.132.97 16:27, 23 May 2008 (EDT)
Pregnancy....[edit]
Nothing like watching two probable socks trying to out-CP each other...PFoster 17:01, 23 May 2008 (EDT)
Tee hee Ha Ha ...[edit]
Conservapedia: The Conservative Alternative 5/23/2008
Quote: If you're looking for information on issues important to conservatives, there's a great new resource available. Conservapedia.com, which is similar in format to its controversial counterpart, Wikipedia, has information available on topics ranging from atheism, to homosexuality, to the theory of evolution and so on.
Whereas Wikipedia is riddled with hard-core pornography, gratuitously graphic videos and other objectionable material, Conservapedia bills itself as, "The Trustworthy Encyclopedia." Sure, you can find information you need for reports on controversial topics, but you can do your research in a family-friendly, cyber-environment confident that your children aren't going to be unwittingly exposed to obscenity.
Interestingly, as Wikipedia presents much of its information from a liberal perspective, Conservapedia takes a straight forward, "Just the facts Ma'am," approach. However, Conservapedia lives up to its name. An accurate presentation of conservative values and perspectives is presented.
unquote :concerned women of America
ContribsTalk 18:28, 23 May 2008 (EDT)
Just how damaging for kids is being homeschooled?[edit]
I realise its pretty bad when at a young age (Around 6-14), but after that a kids ability to think independently begins to develop. Does being homeschooled and fed the same biased and tilted nonsense by the likes of Andy (Whose recent cult-like utterings terrifies me for the future of American Kids) damage children to the point of no return. I felt a weird sense of dread when I read some of his comments. I always felt like these were people who I didn't agree with but still could respect, to some degree, but after reading Andy's comments they seem little more than a cult to be honest. MarcusCicero 19:22, 23 May 2008 (EDT)
- "nutjobs" in fact ? :)
ContribsTalk 19:28, 23 May 2008 (EDT)
- I don't think they realise how isolated the US is with these Andyesque ideas - they're becoming more & more like the isolation wing of the hospital.
ContribsTalk
- Good jab :-) MarcusCicero 19:32, 23 May 2008 (EDT)
- One has only to read some of the contributions of his home scholars to realise how indoctrinated they are (although, come to think of it there haven't been many lately). I've had discussions with AKj about "Give me a child to the age of 10 and I'll give you the man" & agreed to differ.
ContribsTalk 19:40, 23 May 2008 (EDT)
- "Give me a child to the age of 10 and I'll give you the man"? No comprendo.
Radioactive afikomen Please ignore all my awful pre-2014 comments. 19:57, 23 May 2008 (EDT)
- I think it's a variation on "give me a child to the age of ten and he's mine for life." Silly Radioactive man. ~ Jellyfish! (Talk • Contribs • Logs) 19:59, 23 May 2008 (EDT)
- A phrase I haven't heard 'til now.
Radioactive afikomen Please ignore all my awful pre-2014 comments. 20:00, 23 May 2008 (EDT)
- I think you can probably work it out, in context. ~ Jellyfish! (Talk • Contribs • Logs) 20:01, 23 May 2008 (EDT)
(Undent) ->One has only to read some of the contributions of his home scholars to realise how indoctrinated they are... And one only has to read Foucault's Discipline and Punish to see how indoctrinated all the kids who go to public school are. Indoctrination is the primary goal of the education sysytem, don't kid yourself about this. The only question is: what shape do you want your kids' indoctrination to take. There's a lot I see wrong with Schlafly-style homeskooling, but there's a lot I see wrong with public schools, and private schools too, for that matter. I haven't reproduced, but if I did, I would have serious reservations about sending my kid to school to get educated, and would gladly consider alternatives, if there were any that weren't the kind of homeskooling we all have in mind here...PFoster 20:08, 23 May 2008 (EDT)
- Mmm. Honestly don't think my generation in the UK were indoctrinated & the only malign influences I see now in (UK) schools are peer pressure & commercialisation. Correct me if I'm wrong.
ContribsTalk 20:16, 23 May 2008 (EDT)
- Of course you were indoctrinated-we all were; that's the only way we can get society to work. Without a certain amount of deference to authority, an acceptance of logic/science/mathematics, and especially language the transmission of a sense of the foundational values that society needs to reproduce itself (the need for money, work, police, politics, ets) and countless other ideas that we inculcate young people with, the whole system, a system that is designed to reproduce itself mostly for the benefit of some as opposed to others, would fall apart.The "commercialisation" you mention is but one manifestation of how the system works - as is the "peer pressure." PFoster 20:22, 23 May 2008 (EDT)
- Don't think you can put that down to school as much as to society generally. - Thinking: back in a while.
ContribsTalk 20:40, 23 May 2008 (EDT)
- PFoster, I'm sure you're aware of it, but... your definition of indoctrination in this context is likely much broader than the one assumed. Yours essentially just describes... conditioning a person to be able to function in society. Perhaps we need to try and draw a distinction? UchihaKATON! 20:53, 23 May 2008 (EDT)
- Uchicha - my definition of indoctrination is more akin to "ensuring the reproduction of a society as shaped by the exercise of power in a certain way." or something like that - and I'm not sure that this is the forum to debate everything that entails, but: If you think Schlafly's kids are the only ones being indoctrinated, or that public school kids aren't being indoctrinated, you're wrong. If Foucault doesn't convince you, think of what Althusser wrote about the ideological state apparatus, for example....PFoster 20:58, 23 May 2008 (EDT)
I gotta say, while I find Andy's worship of homeschooling and complete condemnation of public school deplorable, I do think rationalwiki has too much of a bias against homeschooling as a whole. The thing about homeschooling is it is whatever an individual parent makes of it. Clearly homeschooling entirely based on shielding a child from anything that may seem to contradict the bible is bad, but homeschooling, if done well, can yield very good results, academically. Does anyone seriously doubt the personal touch and having a one to one student to teacher ratio is not an advantage? Teachers have been saying, quite rightly, that small classes generally yield better results; a homeschool environment is the very essenance of that. The real problems with homeschooling are the Schlafly "let's teach everyone to hate liberals" approach, the social element and lack thereof (which is not always a problem, but it can be), and the very fact that it cannot work for most people. You'd suddenly have to turn millions of people from other jobs into educators, which isn't exactly the most productive way for scoiety to function. Add to that the fact that a very, very small percentage of the population is qualified to teach half a dozen subjects at the high school level and you have a system that is not workable in any widespread use. But when the problems are addressed and handled, I see no reason to condemn a system outright just because of its advocacy by a single small minded hypocrite. DickTurpis 00:22, 24 May 2008 (EDT)
- Dick - It sounds like what you're describing is essentially the difference between "educating your children," which is a measured and logical approach to, well, educating your children, and "homeskooling," which is, well, problematic. PFoster 00:28, 24 May 2008 (EDT)
- Everyone "educates their children" in some form. No one relies on schools to teach their children everything. I'm talking about removing children from public school to educate them at home, with parents acting as teacher. If done well, I have no real problem with this, though, without regulation, there is no way for external parties to verify the level of education they actually recieved (not that grades and test scores are a perfect measure of this either). When Andy talks about homeschooling, he generally is referring to his style of Christianity-dominated brainwashing. Yet when he cites prominent homeschoolers, he draws on anyone who was ever educated outside of a public school. That's most people throughout history, as mandatory public schooling is a relatively recent development. The whole definition of what homeschooling actually is a bit tricky, in some ways, which is why I'm using the most general sense of the term, and by that definition, there are good examples and bad ones. I don't see how promotng nor condemning them as a whole really is an accurate approach. DickTurpis 00:48, 24 May 2008 (EDT)
- Dick, the larger problem with homeschooling isn't the education itself. School is designed to be equal parts education and socialization. By isolating kids from the latter, they lose valuable social lessons. Where do kids learn what they want to look for in a friend? Where do they find their interests, and where are they to learn to make independent choices? Some things are expected in school, just as they're expected in the workplace. There will always be bullies, there will always be jerks, there will always be drama queens. The fact is, school is there to give real world experience in a safe environment. Many kids who I know personally that have been homeschooled are kept away from the world and those dangerous liberals, and therefore, have no experience. To rely on a small anecdote, a friend of mine who was homeschooled up until 9th grade was so socially behind and so unused to new ideas, she had a major freak out when she entered high school. After graduation, she had completely lost her rational mind. She dropped out of college because she couldn't handle the independence needed to succeed, she started dating some jerkoff she met at a party, moved in with him, moved out, then went back to him. Last I heard she was pregnant at the age of 20. I would argue, very fiercly, that had she not been secluded from the world, she could easily have been success in college. SirChuckBObama/Biden? 2012 02:32, 24 May 2008 (EDT)
- Oh, you can always find stories like that; it's hardly any different from Andy's horror stories about public schools. It all comes down to the hows and the whys of homeschooling. There are programs for homeschool kids in many places where they interact with one another and learn social skills. Andy's classes are, I guess, a very scary version of that. Certainly if someone is being homeschooled in order to keep them away from evil liberals and their ideas, that is a big problem. That is the Andy version, and the one he assumes in practiced by everyone else who homeschools. That is not the case though. There are a fair number of people are the far left who homeschool their kids. If they do it to shelter their kids from evil conservatives and their ideas, then it really isn't better, but such sheltering is not the only reason to homeschool. No one, I think, doubts the benefit of private tutoring, and with a proficient parent you can get some excellent results. The social element can be handled outside of school as well; schools do not have a monopoly on social interaction. Indeed, at some point, some sort of classroom-like environment is necessary, as I don't know how many people can teach algebra, trigonometry, calculus, biology, chemistry, physics, literature, US history, world history, economics, politics, art, music, and other subjects at a high school level. And if such a person can, I would think it likely they would use those skills in a career, where they could undoubtedly earn a lot of money. If done right (and I have no idea what percentage is done right) I have no problem with homeschooling. It's the complete condemnation of public schools that I really disapprove of. DickTurpis 10:30, 24 May 2008 (EDT)
- One could argue indoctrination is prevalent in every walk of life. Rousseau's model of education in Emile, although a little naieve, is probably ideal. Instead of teaching at a person, the student must be allowed to ask questions and develop his intellectual capicities. This would probably only work in a homeschooling environment.
- I think homeschooling can be OK, but at the moment its being used by the far right to insulate themselves from the world. Far right parents have children, and they really stuff this fundamentalist stuff down their throat from a young age. This is the essence of indoctrination. On the other hand, my relatively moderate Catholic upbringing (Mass on Sunday, everyone half asleep etc.) along with a childhood spent playing Gaelic Football (And the associated laddishness with that) and watching TV; Is that form of 'indoctrination' really any worse? All those factors have shaped my worldview and personality today...
- Indoctrination is an issue that people make too much of. PFoster is right, we are all indoctrinated in some sense. The far left would have it that the Public School system in the US indoctrinates kids to serve the nation and the capitalist system; the far right has it that it teached the kids all sort of Liberal/Atheist/Anything-we-disagree-with in order to undermine the Christian faith... Both fringes are wildly taking things out of proportion! And I'll close my point at that. MarcusCicero 07:34, 25 May 2008 (EDT)
guns[edit]
what a freaking moron Ace McWicked
- Yeah, that whole conversation is in a class by itself. We've got two people who LIVE there telling Andy he's flat-out wrong, and he's completely ignoring it and just reciting his talking points. It's like watching a badly-designed conversational AI hit a snag. --Gulik 02:08, 24 May 2008 (EDT)
Attn. Conservapedia sysops[edit]
On May 14, someone named Johnnycomelately edited your Ronald Reagan article to read that Reagan was "the father of modern political discourse." This, in case you're too dense to realise it, is trolling and vandalism...and not to put too fine a point on it, you may be too dense to realise this, as at least five of you (Kettlelick, EdPoor, DeanS, Learntogether and DanH) have edited the article since then, restoring the vandalism on at least one occasion. Reagan was a lot of things, but "father of modern political discourse" was not one of them. The article dedicated to one of your most important political icons is a joke, and you've looked silly for a week and a half now...PFoster 23:36, 23 May 2008 (EDT)
- Hi, Crocoite!!! *waves*....PFoster 08:49, 24 May 2008 (EDT)
Andy of course[edit]
this is of course about Andy. Firstly I would like to apologise for bringing this up again but Az mentions it also. He has really shown, plainly, what Andy is all about. Reading Az and Andy's discussion shows what type of ignorant, bull headed person he is. But above all it shows just how deluded and sad he is. Ace McWicked 02:00, 24 May 2008 (EDT)
- I'm torn. It does show how sad and deluded he is. It's almost pitiable. On the other hand, the whole event just goes to show how far Andy will twist and malign the conversation/facts to slander (at least in his own mind) someone who he once sided with. It makes it seem as if there is no end to what he will do to demonize someone he disagrees with. I know this is just a function of his delusion; he has to turn everyone who disagrees even slightly with him into a full-out enemy to maintain his persecution complex, etc. At the same time, I can't feel any empathy for that kind of person, no matter how "sick" they are. I do feel for Az, though. I'm not sure if he started the conversation for closure or if he thought he really could help. If it's the former, this is not the closure he deserved.
- I am surprised at how PJR came through in the conversation though. I never expected such (what's the word?) balls, I suppose. --Arcan ¡ollǝɥ 06:06, 24 May 2008 (EDT)
- Props to AZ for summing up trying to discuss "anything" with Andy so perfectly: "I've felt like a magician showing a card trick to a dog. You're interested alright, but you clearly have no idea what's going on." That one is brilliant, and the context (Andy's previous 3-4 displays of willful ignorance) was chosen wonderfully. ħψɱ
₦
14:14, 24 May 2008 (EDT)
A Reply to the Gentle Peeps at this Site[edit]
Message from PJR to us [2], in case you haven't seen it over there yet. --PsygremlinWhut? 07:32, 24 May 2008 (EDT)
Reply to the reply (not that he's likely to read it...)[edit]
- Thanks PJR :) You've always been the most resonant voice of reason at CP, in my less-than-humble opinion. It's nice to demonstrate that our two wikis can ocassionally communicate in a civil manner, even if our ways of thinking sometimes seem to be incompatible. I'd be interested in discussing your argument in that post, as there are a couple of places where I disagree or can't really see your logic, but since you don't have an account here it would be a pretty inefficient discussion, really. All the best, ~ Jellyfish! (Talk • Contribs • Logs) 07:57, 24 May 2008 (EDT)
- Sorry JF but reason? - someone who believes that the entirity of living organisms was created by JuJuman-in-the-sky 6000 years ago - reason? The guy, however polite, is a nutter!
ContribsTalk 08:40, 24 May 2008 (EDT)
- Well, he makes his points calmly, though I disagree with many of them, not the least being: " Christianity is correct, and this is objectively determinable. " He seems to be specifically responding to something specific here though. What was it?--Bobbing up 08:43, 24 May 2008 (EDT)
- To the best of my knowledge, he's referring to the section about him in the latest archive of talkWIGO. Took me ages to find what he meant! ~ Jellyfish! (Talk • Contribs • Logs) 08:58, 24 May 2008 (EDT)
- Someone commented above about his contribution to the Aschlafly/Aziraphel debate. Addendum Oh & Pal slagged off his consigning all us non-believers to eternal damnation.
ContribsTalk
- Polite & calm != reasoned. Nutter = nutter, even if he's nice!
ContribsTalk 08:52, 24 May 2008 (EDT)
- "As for my "scary" worldview: I think the matter is overstated, but it provides lots of motivation! What's yours?" That's why he believes it: because otherwise he'd just curl up & die. (nutter)
ContribsTalk 09:05, 24 May 2008 (EDT)
- Firstly, I think it's commendable that PJR is mature enough to frame his religion as one view among many (even if he does then state that his view is that it is "objectively determinable", which is a little baffling and seems to suggest an odd definition of "objective"). And secondly, please stop equating viewpoints you don't understand with mental illness. This is the twenty-first century. ~ Jellyfish! (Talk • Contribs • Logs) 09:08, 24 May 2008 (EDT)
- Understand? How can anyone understand it? It is a mental illness - believing in something that's manifestly untrue & defending it against all evidence is loopy. Where do you draw the line? Is the Time Cube guy also sane? How about the guy who believes he's Napoleon? Society tolerates some but they're all out of the same mould.
ContribsTalk 09:19, 24 May 2008 (EDT)
- Wrong. Mental illness isn't some magic spell you can invoke to explain away anything you don't comprehend. Besides which, believing something that is manifestly untrue is a very common, almost mundane way of thinking. ~ Jellyfish! (Talk • Contribs • Logs) 09:33, 24 May 2008 (EDT)
- What's to comprehend - the guy's wrong in his whole "worldview" - don't keep telling me I don't understand/ comprehend -
ContribsTalk 09:43, 24 May 2008 (EDT)
- By that I meant only that you don't see the logic in his argument. And he may well be wrong, but to suggest that makes his whole reasoning irrational is a massive oversimplification. ~ Jellyfish! (Talk • Contribs • Logs) 09:50, 24 May 2008 (EDT)
- Too right I don't see the logic in his argument - you can't see what's not there! As his premises are fatally flawed (God, Christianity being true because Christianity says it's true, the Bible ditto ) there can be no logical derivation from them.
ContribsTalk 10:00, 24 May 2008 (EDT)
- I see: he's wrong because you disagree with him, and moreover he's irrational because he's wrong. This is barrels of fun. We must do this again sometime :) ~ Jellyfish! (Talk • Contribs • Logs) 10:07, 24 May 2008 (EDT)
- If he could demonstrate 1 (one) non-self-referencing piece of evidence for his views then .... Until then, yes you're right!
ContribsTalk 10:18, 24 May 2008 (EDT)
- I know it's not my place to judge people as being "good" or "bad," especially since I'm an English teacher and should know better adjectives. However, there are so many sysops over there that I would consider "bad people," not mislead, not deluded, but genuinely wretched stock. PJR has never fallen into that category for me. Even though I disagree with him, and I think he is misguided, he's always struck me as a "good" person. He lives for his faith. Maybe that is a pitiable position in its misguidedness, but I don't see it as something to actively deride. Whereas others argue out of sheer xenophobic hatred, that doesn't seem to be his position, even if he's xenophobic himself. While I'll never agree with his views, I have come to respect him as a person. I don't know, maybe he's just my "pet sysop," but I'd rather talk to him than scream at the others any day. --Arcan ¡ollǝɥ 09:23, 24 May 2008 (EDT)
- Thanks, Arcan. You managed to sum up what I was getting at. ~ Jellyfish! (Talk • Contribs • Logs) 09:33, 24 May 2008 (EDT)
- Mega-dittos, Rush! DickTurpis 10:52, 24 May 2008 (EDT)
- I'm with Susan. A nutter is a nutter even if it has been house-trained (housebrokenfor those in the good ol' US of A). Auld Nick 10:34, 24 May 2008 (EDT)
Far be it from me to defend religion in any of its forms, but believing something which cannot be demonstrated by the scientific method does not necessarily make one insane. It may well make you wrong - but being wrong is not the same as being insane.--Bobbing up 10:51, 24 May 2008 (EDT)
- "Is the Time Cube guy also sane? How about the guy who believes he's Napoleon? Society tolerates some but they're all out of the same mould." When all the evidence points otherwise, but you stick uncritically to a view, what are you?
ContribsTalk 10:59, 24 May 2008 (EDT)
- Mildly irritating. ~ Jellyfish! (Talk • Contribs • Logs) 11:06, 24 May 2008 (EDT)
- Many people believe you can catch a cold by being cold. They are wrong, but many simply won't accept it. Are they insane?--Bobbing up 11:04, 24 May 2008 (EDT)
- They haven't "researched" the topic like PJR claims to have - so no - they're misinformed.
ContribsTalk 11:10, 24 May 2008 (EDT)
It seems to me, on any topic other than religion, PJR is actually kind of a normal person. I imagine I could meet him, have a few conversations with him, and think he's a decent guy, and, as long as religion doesn't come up, I could even see eye-to-eye on some matters with him. This assumes he doesn't work religion into every conversation (something you can't do with Andy, as it seems the first thing he does upon meeting anyone is find out their position on school prayer). It sounds like on some issues, like gun control, he might be even left of me. Obviously he takes religion very seriously, and he's clearly thought it through extensively. I actually respect that, in a way. I think if you're going to be a religious person, and purport to believe Christian doctrine (as so many do) you really need to think it through, and if you're going to believe it, you actually have to believe it (which, it seems, not so many do). If you do a poll of Americans and ask how many believe the Bible is the literal truth, you will likely get a substantial percentage saying yes (I'm not going to bring in Schlafly statistics and make up a number), depending on how the question is asked. Whereas if you bring those same people to a museum and show them a rock that is 50,000 years old, how many of them will say or think "impossible! The world is only 6,000 years old! 7,000 tops!"? Some, but not that many. People often just don't think things through, and hold contradictory beliefs. Not PJR. When he believes something, he believes the bejeezus out of it. And if you believe in a religion like Christianity, it's kind of an important thing. If you believe in Christianity, but it's not a very important aspect of your life, then ur doin it rong. So I can't condemn him when 250 some million people in this country alone believe the same thing, only in a lame, half-hearted "sure, whatever, if that's what the Bible says" way. I'm convinced he's wrong, and he's convinced I am. So be it. At least, it seems, the Christianity he practices is not the hate-filled Falwell variety, but one that emphasizes the positive aspects (and there are some; I'm not about to pretend there aren't). Also, while obviously no one has ever proved Christianity (or any other religion) is true, no one has, or ever will, prove it entirely false either. And even if they did, I'm sure they'd only move the goalposts. DickTurpis 11:26, 24 May 2008 (EDT)
- The example of PJR shows that you don't have to be a jerk to be a conservative Christian -- the other sysops just happen to be jerks. I suspect that he doesn't enjoy the hostility and incivility displayed by the rest of the 'team' there, but he's taken the decision to collaborate with the regime, so he deserves to be tarred with the same brush. Barnaby 12:19, 24 May 2008 (EDT)
- He's just masking his jerkiness with civility, he still want to turn the U.S. into a Christian nation and, having done that bit of violence against American ideals, who knows what nastiness he would then find reasonable and lawful -- certainly a purge of homosexuals, for instance, would be in order. Don't be fooled by nice manners. Exasperate me!Sheesh!Not the most impressive contributor here 12:40, 24 May 2008 (EDT)
- All other points aside (because really, what's the point walking into the shitstorm of anger here?) can I just point out that he's not terribly interested in toppling the US at the moment; he's Australian, and in fact has been consistent in his mild annoyance with all of the US-centricism. At least accuse him of being a fanatical zealot in the right country. Az 14:39, 24 May 2008 (EDT)
- Ah, that's completely different. Exasperate me!Sheesh!Not the most impressive contributor here 15:15, 24 May 2008 (EDT)
Interesting point, Sheesh. But has PJR ever really weighed in strongly on the homosexuality issue? I'm sure he's against gay marriage and such, but there's a huge difference between opposing gay marriage and putting gays into cattle cars and saying bye bye. Ken is more in the latter circle, and Ed has even said that gays should be in prison or in an insane asylum, but I can't recall PJR make any comments along any such lines at all. DickTurpis 17:15, 24 May 2008 (EDT)
- Nah, you're right. I can't recall him saying anything that nasty and that is duly noted. And yet, CP as a monolithic project seems to have the more radical stance and PJR is part of that project QED . . . Exasperate me!Sheesh!Not the most impressive contributor here 17:38, 24 May 2008 (EDT)
- I'm not really sure I go with the guilt by association in cases such as these. I mean, most of the users here were once involved with CP (myself included) until they decided we were not welcome there. CP is not homogenous, as we can see from disagreements between folks over there. RW isn't either, and I disagree with views expressed here not infrequently. PJR has stood up to the asshole contingent on occasion. I just wish he would do it more. — Unsigned, by: DickTurpis / talk / contribs
Re diverting to PJR's reply to replies[edit]
I want to talk about this part:
I don't think I've ever said that a government should "actively promote" one religion over another, but I have said that they should endorse Christianity. But this is on the grounds that (a) Christianity is correct, and (b) this is objectively determinable. (Note that when I say "objectively", I'm not talking about scientific "proof". Rather, the sort of reasonable conclusions that one can draw, that I explain in my Essay: Accuracy vs. neutrality on Conservapedia.) Atheists, conversely, reject both those points, and from their point of view, I can understand their objection to a government endorsing Christianity. Can they see the grounds for a government endorsing Christianity on the premise that (a) and (b) are true?
- endorse versus actively promote would seem the functionally the same
- Christianity is correct: lots of American citizens believe that say, The Goddess, or Gaia are also correct. Lots believe that other cultures or races are inferior. They think those views are correct too.
- this is objectively determinable. Note that when I say "objectively", I'm not talking about scientific "proof". Rather, the sort of reasonable conclusions that one can draw, that I explain in my Essay: Accuracy vs. neutrality on Conservapedia.): These reasonable conclusions are simply rationalizations. Given a set of incorrect assumptions and erroneous data I can objectively reason that bumble bees can't fly. Given the correct assumptions I can reason that bumble bees can fly. None of this is going to effect the bumble bee however.
- can they see the grounds for a government endorsing Christianity on the premise that (a) and (b) are true?: Assuming (a) and (b) were true, sure. But they aren't very likely to be true and so we can't work on those assumptions. We could just as easily assume that humanity was seeded by a race of noble aliens (a) and that we need to recombine by attacking and eating three other people (b). on the premise that (a) and (b) are true we should endorse murder and cannibalism.
Exasperate me!Sheesh!Not the most impressive contributor here 12:40, 24 May 2008 (EDT)
Note - the original discussion that I believe PJR is replying to is located here.
BTW Philip, if you're reading this, I don't actually dislike you per se. UchihaKATON! 14:26, 24 May 2008 (EDT)
- Got to agree. I don't dislike PJR on a personal level. I thoroughly disagree wtih his stance on religion, and boggle at the mental contortions he has to go through to mold reality to fit the awkward structure he's faced with. And, as before, I find it hard to accept the description of "reasonable" while supporting what Andy and the others are doing. It's admirable when he actually disagrees, though, and I give him credit for that, at least. --Kels 16:04, 24 May 2008 (EDT)
- <incoherent rant> Trouble with being a member of an organisation is that you are inevitably classed with the rest of them. I wouldn't object to being grouped with the rest of the Ratwikians (although there's probably some who wouldn't want to be grouped with me!). By staying where he is & failing to stand against the worst excesses PJR is digging himself deeper into the mire. It is quite possible that Ken (for instance) would disagree with PJR on creationism (I don't recall him being defensive about it). They're a disparate collection of nutters (sorry) held together by the contempt which the rest of the world has for them. PJR is probably a really nice man, kind to kids & pets & a great raconteur but his creationism is outside all bounds of sense and the fact that he claims to have researched it for years only makes me more convinced that he is "not all there ". </incoherent rant>
ContribsTalk 18:02, 24 May 2008 (EDT)
What strikes me about PJR's reply is that, to summarise it, he seems to be trying to argue that Christianity is correct because the Bible says so, which is rather circular reasoning, and, as such, is really asking us if we can at least see the argument that the US government should endorse Christianity, as it's correct, given the premise that Christianity is correct. Well, if Christianity was objectively proven, once and for all, to be the one correct religion, I could see why the US government should endorse it. However, that simply hasn't happened. As for his comments about the teaching of evolution in schools, one of the things that he quite specifically mentions Christianity is not proven by is scientific proof, yet, for some bizarre reason, he seems to think that something other than evolution, presumably creationism in one guise or another, should be taught in classrooms. Speaking personally, I would have absolutely no objection to creationism being taught in classrooms - as long as it was taught as 'things that some people believe due to their religion', not science. In the UK, from what I hear, there are 'religious education' classes, where pupils are taught the basics of just about all the 'major' religions in an entirely objective manner. If US schools started something similar (which, of course, would mean finding a way around any First Amendment concerns), this would be an ideal place to teach creationism. Zmidponk 16:09, 25 May 2008 (EDT)
Reply to the reply to the reply .......[edit]
No Phil, I won't take you on on your own terms. All I will do is say: If you can demonstrate to my satisfaction that there is the possibility of creationism by a GOD being more likely than evolution from basic chemical constituents then I'll never comment on your absolute nuttery ever again.
ContribsTalk 11:01, 26 May 2008 (EDT)
PZ Myers and the Gentleman at etc.[edit]
Haha, hey Ken! He noticed you. My favorite part? In the complete and utter dismissal of your inanity, he doesn't even link to your site. --Arcan ¡ollǝɥ 10:39, 24 May 2008 (EDT)
Did anyone notice...[edit]
The kid on the left side of the screen at about the 5 second mark of this video? He's wearing a Che shirt. Oh, the irony....PFoster 11:35, 24 May 2008 (EDT)
- I'm going to guess that what the shirt actually says is "Communism killed 100 million people and all I got was this lousy t-shirt". You can't really tell from just seeing the top. DickTurpis 11:38, 24 May 2008 (EDT)
- Ah. never seen that one. these crazy kids with their hair and their music.... My bad. PFoster 11:40, 24 May 2008 (EDT)
- Then again, the image doesn't really match this one which has Che at the bottom, not the top. I wonder. Andy would never allow his students to wear a Che shirt in class, would he? Certainly not when they're being filmed for....um...youtube? DickTurpis 11:41, 24 May 2008 (EDT)
- It's from a CBC doc...and if it IS a legit Che shirt, that's just the kind of smaratass kid that cracks me up. Totally awesomePFoster 11:44, 24 May 2008 (EDT)
- Reminds me of the kid suspended for wearing a Pepsi t-shirt on his schools "Coca Cola Day". [3] DickTurpis 11:46, 24 May 2008 (EDT)
- That video is awesome. What high school teacher would use WP to teach world history anyway? I thought they had, um, "textbooks" and such? What's fun about watching it is realizing what really goes on at CP, and why people really go there, while Andy drones on about their pageviews (which have to be at least 20% bot-generated by now!) as if they confer legitimacy. ħψɱ
₦
14:01, 24 May 2008 (EDT)
- Human, you are totally clueless. There'e no way that 20% of CP's page views are bot generated. It's actually about 60% according to my stats.
GenghisRationalWiki GOLD member 17:01, 26 May 2008 (EDT)
- Oh God that video is sooooooo disturbing. That windowless room looks like it's about six hundred feet underground. Perhaps it's in Colorado Springs, not New Jersey, and it's in the NORAD facility?
- Fairly sure the Chr shirt is straight. A little later you see wide shot of the whole class with the kid in the front row. I can't see any text at all on his shirt - just a picture of Che! Respect! RedDog 15:40, 24 May 2008 (EDT)
- Actually I think the Che picture has a line through it, like a stop sign. Though I did like Andy's explanation of why there's so many articles on Conservapedia about anal fissures. Charles SubLunar (mr) 16:18, 24 May 2008 (EDT)
- Yeah, I'm pretty sure that is an anti-Che t-shirt a la the cross-out ghostbusters logo. A better picture is seen on this page. DickTurpis 17:03, 24 May 2008 (EDT)
- It definitely is. I must say that the fact that there's only one marginally cute girl in the class did make me happy, however. --Linus(plot evil tech) 22:31, 24 May 2008 (EDT)
- Oh, and the girl in question is our good friend Deborah, I believe. --Linus(plot evil tech) 22:40, 24 May 2008 (EDT)
- Interesting. On what do you base that hypothesis? DickTurpis 22:59, 24 May 2008 (EDT)
- 1. She looks Irish. 2. Her affect would suggest that she's heavily involved, and thus… Obviously, I'm not certain, but it seemed like a good guess to me.
- My comment got lost (in EC), I think she is more likely to be Bethany. PFoster, these people have signed affidavits allowing their likenesses to be used in the media (otherwise this video would not exist). Sorry, they are fair play. ħψɱɐ₦
23:11, 24 May 2008 (EDT)
- If we're talking about the one who does most of the talking, Fuzzy Kettleticket says its Sharon. I guess he'd know. And if it's a secret, he let it out of the bag, not any of the rest of us. now, if you're talking about the one marginally cute one, well, I'm not especially big on rating the looks of teens, but if there was one, I would have guessed another was being discussed. Not to call Sharon ugly or anything. All of them actually looked normal enough. DickTurpis 23:33, 24 May 2008 (EDT)
- I meant, Sharon, actually… aargh. --Linus(plot evil tech) 10:24, 25 May 2008 (EDT)
- I don't really want to argue with you Human - and I AM being a GIANT HYPOCRITE seeing as I brought up the kid in the Che shirt in the first palce - but I think there's a line between making comments about what we see in the video--which is pretty much fair game, it was on teevee and all - and trying to link that with real world/real life people that we see on the CP. So I won't do it. Everyone's happy.PFoster 23:15, 24 May 2008 (EDT) PS - I also come from a country where it is illegal, for instance, for the media to name juvenile defendants in court cases - or even their parents so as to protect their identities - so that sort of shapes my thinking on this...PFoster 23:18, 24 May 2008 (EDT)
- Well, FIRST and foremost, please feel free to argue with me. What am I. teh frickin' assfly or something? I'm just a person on this site. I understand the whole "protection of minors" thing - but my argument is that for this video to exist, WAIVERS WERE SIGNED (sorry for the shouting). As I understand it, this was part of a CBC documentary, and as such, followed all kinds of legal intricacy - including permissions by children or their guardians for their appearance in the video. Perhaps CBC would even release the information contained in such releases (I think they'd have to?). This is not "us" as RW "outing" some innocent kid. This is us seeing the idiots spouting garbage and wanting to know who they are - they have made their stance in public, all I ask is, "who are they"? ħψɱɐ₦
23:29, 24 May 2008 (EDT)
(UNDENT) - Seriously, dudes - leave the kids out of it. They're kids. Pick on Andy and Ed all we want, but playing "spot the homeschooler" seems a little uncool to me....PFoster 23:03, 24 May 2008 (EDT)
- Yes, I concur. I'm sorry. :( --Linus(plot evil tech) 23:07, 24 May 2008 (EDT)
Funny, that a video that talks about homeschoolers takes place in a classroom, just like a private school (or the basement of one). How, exactly does this become homeschooling? Although by Andy's definition anything that's not a public school is homeschooling, but I could count the number of people who believe his definitions on the thumbs of one foot. --Kels 16:01, 24 May 2008 (EDT)
- "I don't have to live with what's printed in the newspaper." Andy's self-deception explained. Also, why doesn't he have the lapels of his shirt *outside* his jumper? Is this a fashion I missed? Charles SubLunar (mr) 16:22, 24 May 2008 (EDT)
- Maybe he was "helping one of the students with their homework" when the camera crew arrived, and tossed it on in a hurry? --Kels 16:47, 24 May 2008 (EDT)
ID characters[edit]
Obviously, the geek in the pullover and glasses with the droning voice is none other than our dear friend, Assdrew Shufflefly. Can anyone identify any of the rest of the cast? Who is the young woman who is so proud that they surpassed Limbaugh's hits? (A couple of times, and on the weekend, when his show is not pumping hits live[4]) Who is NotCheFan? When was the CBC documentary and where is more of it? ħψɱɐ₦
20:07, 24 May 2008 (EDT)
- I guessed at the third query above, which is totally not the right place to do so. --Linus(plot evil tech) 23:09, 24 May 2008 (EDT)
- Here's the thing. These kids, and their psychopathic "teacher" have signed contracts allowing their appearances - this was a CBC documentary, right? Not a "spy cam" in Andy's basement. Whoever was present is now FAIR PLAY. They have entered the adult world of "discussion of issues" and "this is what I think". I am all for "protecting the children" from over-exposure - but they have made their stance in our public world, and argue, on CP, (by default) that they are "right" and someone else is "wrong". Bring it on, kids. Surely your parents know you were on TV and the Webbything, right? Was there informed consent to these TV appearances? I suspect so. ħψɱɐ₦
23:15, 24 May 2008 (EDT)
- Agreed and yet they are still just kids, so perhaps we should let the who's who thing go and simply focus on what was said Exasperate me!Sheesh!Not the most impressive contributor here 00:07, 25 May 2008 (EDT)
- I'd just like to point out that any linking between visual image and a CP user name hardly constitutes an outing of their identity. As far as RW is concerned they are still virtually anonymous. Their Facebook, MySpace, Bebo or whatever pages will give far more away about where they live, and what they do. If it is felt that they are are somehow exposing themselves to danger on teh intertubes then it is a serious dereliction of duty by their parents and any criticism should be directed at them. Personally, I think Andy puts them in danger by making them sysops and thus giving them greater exposure to obscenity than if they were just regular readers or editors. Ans surely the masses of detail about homosexuallity and gay life-styles currently available on CP are beyond the bounds of decency for an allegedly family-friendly site.
GenghisRationalWiki GOLD member 17:12, 26 May 2008 (EDT)
- I agree. A minor is part of a website in which she releases minimal personal information about herself...a minor agrees to be part of a public video, also in which very little information about her is revealed. Saying that person A and person B are the same person doesn't reveal any new information about the person that she hasn't already made public. Nevertheless, we should keep comments about them to a minimum, and keep the focus on what they say rather than who they are. Nor should we reveal any information about them that they have no revealed themselves (should we somehow be in a position to do so). Fuzzy Kettleticket is probably the only one in a position to do so, and I assume he won't. DickTurpis 20:25, 26 May 2008 (EDT)
Oooh....Burnage[edit]
At about 1:21 of the brainwashed video, this girl is saying how Wikipedia didn't talk about Issac Newton's religion. I dug up research and it turns out the actual article, not even a section but the actual article was created on October 12, 2005. Assfly's site was first polluting 13 months later on November 22, 2006. This Newton thing was cited as one reason they did it. So.....does that make 50 percent of conservapedia void in Schlafly's eyes? --*Gen. S.T. Shrink* Get to the bunker 13:40, 24 May 2008 (EDT)
- It was really hard to get through that... the whole time, I was remembering a Saturday Night Live sketch where Jimmy Fallon was impersonating Pat O'Brien and opened with "Welcome back, I'm Pat O'Brien and I don't breathe through my nose EVER." Funny stuff man, funny stuff SirChuckBObama/Biden? 2012 13:51, 24 May 2008 (EDT)
- They sure have their talking points down, don't they? Allegedly WP is so full of anti-American and anti-Christian bias that it knows no bounds, but when they interview that girl (could that be Bethany of Sharon, I wonder) it's the same thing they've said 100 times before "they don't give enough emphasis to Newton's piety" and "they don't credit Christianity enough with the Renaissance." Add "they use BCE! (sometimes)" and I think they've covered it. (And by the way, Andy, wp:1 BCE on Wikipedia redirects to wp:1 BC, so guess which the preferred use is?) DickTurpis 16:58, 24 May 2008 (EDT)
- Oh, that's SharonS (at 1:21). Candlewick 17:00, 24 May 2008 (EDT)
Favorite moments: 2:27 - Are those Cliff's Notes?; 2:40 - He just looks so creepy! Sandman 17:03, 24 May 2008 (EDT)
- Yeah, that shot of him in the background at 2:40 really creeped me out the first time I watched it. Not sure exactly what it is about it, but him standing behind all these students, tucked away in the dark with a creepy expression. Scary. DickTurpis 17:09, 24 May 2008 (EDT)
Haha, I wonder just how much it burns Andy's buscuits that at least one (I haven't checked them all) of the sites that Jinxmchue cited also gives links to our version of the Atheism article? Ken must be so proud. --Kels 07:39, 26 May 2008 (EDT) Jesus its bizzare. Whats with the music? Ace McWicked
Who Conservapedians Model themselves on[edit]
(One of) The greatest comedian(s) of the 20th century, Peter Cook, invented E. L. Wisty "A dire, bland, know-it all". It is apparent that every (adult) member of Cp has taken their example from this character. Brits will be more familiar with him although Americans will possibly know him through his later (unnamed) incarnation in dialogues with Dudley Moore
ContribsTalk 18:19, 24 May 2008 (EDT)
- Is that the "Do you know you have four of miles of tubing in your stomach" sketch from the filmThe Secret Policeman's (Other) Ball?PFoster 18:25, 24 May 2008 (EDT)
- Yes! There's LOADS of E L Wisty on You Tube - although not necessarily by name.
ContribsTalk 18:30, 24 May 2008 (EDT)
- I bought a book of Cook's skits and writings a few years back when I was visiting England, and was disappointed that I couldn't see them performed, as I'm sure they're even funnier with his dry delivery. That was before youtube, though. I'm surprised I haven't thought to look for them there before now. Thanks for the idea. (Incidentally, did anyone else find the Beyond the Fringe DVD a little disappointing?) DickTurpis 20:14, 24 May 2008 (EDT)
Ken starts a long list[edit]
Articles on Conservapedia from Conservatives Sources - 2 in 14 months. ----
- Oh, that's fun. He adds the CreationWiki article, which includes substantial contributions by...a couple of CP editors. Isn't that cheating?
Hypothetical Cancer[edit]
"If 2 out of the top 20 developed breast cancer at a young age, wouldn't that be alarming? That approach presents a good intellectual challenge." ([5]) Yes Andy and if 2 out of the top twenty Premiers of Australia were green space aliens, wouldn't that be alarming? That approach presents a good intellectual challenge.
ContribsTalk 20:40, 24 May 2008 (EDT)
-
- This whole thing makes me mad.
- If you look, you'll notice that only 10 people were diagnosed since the year 2000 to the year 2006. That's an average of 10/7 people per year = 1.42 people per year out of a supposed (500) and that's with a HUGE amount of assumptions. Conservapedia reports that the number of people on average who are diagnosed before 30 is 1 out of 2525, or about 2 out of 5000, or about .2 out of 500. Anyway, only one of those 10 people is even under the age of 30, and that's Anastacia, diagnosed in 2002. One event is not statsically significant. If we go back as far as they go, that's 1972 to 2006, 35 years. 21 people/35 years = .6 people diagnosed out of 500 (Assuming that from 1972 to 2006, no one left or entered Hollywood) or 1.2 out of 1000. Their average age of diagnosis is 37.4, at which point the national average is about 1 in 217 women. So Hollywood is well under average. As my "facts" are all based off of "Andy's" facts, the only way I can be wrong is if Andy's "facts" are wrong, which would never happen. ThunderkatzHo! 21:28, 24 May 2008 (EDT)
Now Andy is saying if he had a list of the most popular female musicians we could analyize them and see if maybe 2 of the top 20 had cancer. Well, Andy, 20 is too small a sample population to give meaningful results, but what the hell, I did a bit of research for you and here are the 60 female recording artists with at least 50 million records sold worldwide. That would, by sales, make them the most popular in the world (source: had to use Wikipedia, sorry: [6]):
- Anni-Frid Lyngstad (ABBA)
- Agnetha Fältskog (ABBA)
- Alla Pugacheva
- Celine Dion
- Cher
- Madonna
- Nana Mouskouri
- Wei Wei
- Whitney Houston
- Liz Mitchell (Boney M)
- Marcia Barrett (Boney M)
- Maizie Williams (Boney M)
- Karen Carpenter (The Carpenters)
- Dalida
- Dionne Warwick
- Dolly Parton
- Donna Summer
- Stevie Nicks (Fleetwood Mac)
- Janet Jackson
- Joni James
- Mariah Carey
- Mireille Mathieu
- Patti Page
- Teresa Teng
- Tina Turner
- Valeriya
- LaVern Andrews (Andrews Sisters)
- Maxine Andrews (Andrews Sisters)
- Patti Andrews (Andrews Sisters)
- Britney Spears
- Fairuz
- Gloria Estefan
- Mina
- Alanis Morrisette
- Anne Murray
- Ayumi Hamasaki
- Barbra Streisand
- Debbie Harry (Blondie)
- Andrea Corr (The Corrs)
- Sharon Corr (The Corrs)
- Caroline Corr (The Corrs)
- Miwa Yoshida (Dreams Cone True)
- Enya
- Hibari Misora
- Kylie Minogue
- Linda Ronstadt
- Olivia Newton-John
- Marie Osmond (The Osmonds)
- Petula Clarke
- Reba McEntire
- Marie Fredrikson (Roxette)
- Sade
- Shakira
- Shania Twain
- Judith Durham (The Seekers)
- Victoria Beckham (Spice Girls)
- Melanie Brown (Spice Girls)
- Melanie Chisolm (Spice Girls)
- Geri Halliwell (Spice Girls)
- Emma Bunton (Spice Girls)
No sure who here has had breast cancer, but I'm sure some have, as the overall statistics are 1 in 8 or something. If someone wants to post this over there, he might find it useful. Or not. DickTurpis 22:01, 24 May 2008 (EDT)
- I think what Andy is trying to say is that such people are the cancer. Really, the same technique he used to equate the theory of relativity with moral relativism.
Radioactive afikomen Please ignore all my awful pre-2014 comments. 23:29, 24 May 2008 (EDT)
- re: the list. I'm sooooo out of touch? Who the hell, to give two examples out of many, are Alla Pugacheva or Wei Wei. Exasperate me!Sheesh!Not the most impressive contributor here 00:05, 25 May 2008 (EDT)
- This is an international list. I think the one is a popular Russian and one is a popular Chinese singer. I could have removed such examples, but as Andy made it clear that it has nothing to do with Hollywood, just singing a lot or something, so they qualify. DickTurpis 00:43, 25 May 2008 (EDT)
Poking about the nation lists[7][8][9] that are there, some additional names to toss on the list:
- Laura Pausini
- Nana Mouskouri
- Anna Vissi
- Despina Vandi
- Katy Garbi
- Glykeria
- Angela Dimitriou
- Elena Paparizou
- Eleftheria Arvanitaki
- Alexia
- Marinella
- Natassa Theodoridou
- Peggy Zina
- Elli Kokkinou
- Lara Fabian
- Dani Klein
- Evi Goffin (Lasgo)
- Axelle Red
- Lio
- Kate Ryan
- Jeanine Deckers
- Sandra Kim
- Reba McEntire
- Natalie Maines (Dixie Chicks)
- Martie Maguire (Dixie Chicks)
- Emily Robison (Dixie Chicks)
- Laura Lynch (Dixie Chicks)
- Robin Lynn Macy (Dixie Chicks)
- Linda Ronstadt
- Almeda Berkey (Mannheim Steamroller)
- Roxanne Layton (Mannheim Steamroller)
- Faith Hill
Realize thats only 4 countries (Greece, Belgium, Brazil, US). Side note, I bet it would annoy Andy if someone was to go through and create articles for the various artists (especially the obscure ones) that are on his list. He complains about WP having articles on pop artists. Some others (going through my itunes)
- Dido
- Shannon Noll
- Amy Lee (Evanescence)
- Vikki Thorn (The Waifs)
- Norah Jones
- Yoko Ono
- Dar Williams
- Jewel
- KT Turnstall
- Lisa Loeb
- Loreena McKennitt
- Mindy Smith
- Sara Watkins (Nickel Creek)
- Sarah McLachlan
- Tori Amos
- Kathleen Edwards
Hmm... Hall of fame...
- Debbie Harry (Blondie)
- Aretha Franklin
- Ruth Brown
- Gladys Knight
- Etta James
- Janis Joplin (died age 27)
- Laurie Brown (The Kinks)
- Brenda Lee
- Michelle Phillips (The Mamas & the Papas)
- Cass Elliot (The Mamas & the Papas - died age 32)
- Joni Mitchell
- Zola Taylor (The Platters)
- Bonnie Raitt (The Ronettes)
- Veronica "Ronnie" Bennett (The Ronettes)
- Estelle Bennett (The Ronettes)
- Nedra Talley (The Ronettes)
- Shirley Owens (The Shirelles)
- Doris Coley (The Shirelles)
- Beverly Lee (The Shirelles)
- Addie 'Micki' Harris (The Shirelles)
- Patti Smith
- Cleotha Staples (The Staple Singers)
- Yvonne Staples (The Staple Singers)
- Mavis Staples (The Staple Singers)
So, thats just a few more. --Shagie 02:58, 25 May 2008 (EDT)
- Oh we could go on forever. I'm sure there are thousands of successful female recording artists through the last 60 plus years. I only used my list because it had objective criteria which Andy said he was specifically seeking and therefore couldn't preen the healthy ones with contrived excuses ("hasn't toured recently") while making sure to maintain the few who did have cancer. Those are the 60 best selling female artists, as far as we can tell (Patti Scialfa of the E Street Band might qualify as well, the list includes Springstein, but doesn't specify his band). I'd like to expand it a bit to get a larger sample size, so I guess we'd need a list of artist with sales between 25 and 50 million or something. DickTurpis 09:53, 25 May 2008 (EDT)
It might just be easier to list conservatives with [body part] cancer and show conservativism causes this. Then again, he'd just change the definition of conservativism....-Shangrala 11:48, 25 May 2008 (EDT)
Conservativism must cause anal cysts![edit]
See: Rush Limbaugh.
This is SCIENCE! --Gulik 12:07, 25 May 2008 (EDT)
Clueless and cluelesser[edit]
"By the way, there is no way that there are a half million touring female singers. The entire New York City area, as large and entertainment-oriented as it is, can probably support only a handful on any given weekend." So sayeth Andy on 15:30, 24 May 2008 (sorry no diff link for you). First sentence included for context. NYC, the biggest and richest metro area in the world, can only support a "handful" of paid female singers on any given weekend? Don't get out much, do you, Andy? If we just consider that opera and musicals probably cause cancer just as effectively as balladeering, how many female singers do you think are getting paid every night on Broadway alone? For singing? ħψɱɐ₦
15:15, 25 May 2008 (EDT)
Conservatives Dont use or own wallets[edit]
hahahaha Ace McWicked
- Wow. Just, wow. Andy, 8 * 6 = 48. 8 * 5 = 40. Keep it simple, stupid, eh? At least get the math right. Minimum wage? Isn't that a liberal thing? Surely you are against that, and this clueless teenager should better toil in a poultry farm for $2.50 an hour (the min. when teh assfly & I were kids, surely it's good enough for you?) for 16 hours? PS, Andy, did your daddy (or your mommy) beat you for losing the $40, you idiot? If so, I think you deserved it. ħψɱɐ₦
00:12, 25 May 2008 (EDT)
- The moral of this story: If you lose $40, suck it up, bitch! Who spends months worrying about losing $40? What the hell is wrong with you? --Arcan ¡ollǝɥ 02:19, 25 May 2008 (EDT)
- No kidding... I mean, really, how has Andy, with his very successful mother ever had to worry about losing forty dollars...and there is a certain irony about him screwing up such a simple math error when his general response to getting pwned on the math pages is "My Mathematical abilities speak for themselves...." By the way.. notice something odd about these two edits... Hi Andy, ya Bastard SirChuckBObama/Biden? 2012 03:14, 25 May 2008 (EDT)
- I suspect a deeply traumatic personal experience is behind this one. I also note that the math has been corrected at CP. Hi! :) ħψɱɐ₦
03:58, 25 May 2008 (EDT)
- Yes: One, he killed off the minimum wage and went for the totally socialist liberal "prevailing wage" phrase. And two, yah FK fixed the loser math. ħψɱɐ₦
04:00, 25 May 2008 (EDT)
- Worse than the 8 * 6 error is the fact that Andy appears to believe that not losing more money is the same as gaining money - one wonders if this is how Andy justifies the bills for Conservapedia. It's ok mom - by throwing money at my blog you're saved the expense of me making an even bigger ass of myself in the real world. --Charles SubLunar (mr) 04:10, 25 May 2008 (EDT))
- You took the words out of my mouth (see below) :-)
ContribsTalk 10:13, 25 May 2008 (EDT)
- It's simple. The dude was mocked by the media, and the media is liberal. Duh! Oh, wait, nevermind, it's because without competition, the flop would've never been invented! This shows that capitalism obviously works. -Judas Reward 10:42, 25 May 2008 (EDT)
Insults/ban reasons CP hasn't used yet[edit]
"Not a team player." Anyone else have any ideas?
Radioactive afikomen Please ignore all my awful pre-2014 comments. 05:08, 25 May 2008 (EDT)
- They don't use "sock of Jellyfish" nearly enough. I want infamy, dammit. ~ Jellyfish! (Talk • Contribs • Logs) 05:11, 25 May 2008 (EDT)
- "Called Schlafly a fag" MC 86.45.194.60 07:26, 25 May 2008 (EDT)
- "Used reasoned, rational argument that I don't understand." --PsygremlinWhut? 07:47, 25 May 2008 (EDT)
- "Excessive conservative bias." --AKjeldsenCum dissensie 07:48, 25 May 2008 (EDT)
- Under investigation by the FBI RedDog 08:02, 25 May 2008 (EDT)
- "too right" note the double entendre < / toggle self promotion off > Exasperate me!Sheesh!Not the most impressive contributor here 08:03, 25 May 2008 (EDT)
- "Doesn't believe our lies" Exasperate me!Sheesh!Not the most impressive contributor here 08:04, 25 May 2008 (EDT)
- "Good point, well made. Now eat shit and die, librul!!11!!1!"
- "Coulter-style rant"
- "Pointed out the flaws in Andy's logic"
- "For great justice" --Robledo 09:07, 25 May 2008 (EDT)
- "Bohdan" ħψɱɐ₦
15:19, 25 May 2008 (EDT)
- To intimidate and harrass. --AKjeldsenCum dissensie 18:16, 25 May 2008 (EDT)
"Sock of Barikada." :( Barikada 18:14, 25 May 2008 (EDT)
Flop[edit]
What's particularly Conservative about the Fosbury flop?
ContribsTalk 10:09, 25 May 2008 (EDT)
[Comment moved from above section on Conservative parables, now that we have this section]:)
(From Cp's source:
Education
high school: Medford (Medford, Oregon), 1965
undergraduate: Oregon State (Corvallis, Oregon), 1969
Public schooler?)
ContribsTalk 10:21, 25 May 2008 (EDT)
- Maybe he "homeschooled" himself into athletism, like James Watt into engineering. NightFlareSpeak, mortal 13:37, 25 May 2008 (EDT)
- Note that Oregon State University is state-funded. I can't help but get the feeling that Dick Fosbury is actually a liberal.
Radioactive afikomen Please ignore all my awful pre-2014 comments. 16:24, 25 May 2008 (EDT)
Has it packed up again[edit]
I'm getting a lot of errors. Is CP working for you guys or does Andy need to put another 50p in the meter? RedDog 11:58, 25 May 2008 (EDT)
- Me too "The server at is taking too long to respond." I was puting it down to my connection, but everywhere else is OK.
ContribsTalk 12:08, 25 May 2008 (EDT)
- I can't connect either. Maybe Ken's Homosexuality article finally used up all available server space? --Gulik 12:11, 25 May 2008 (EDT)
- Oh well, guess I can watch that Conservapedia video again. At 2:40 you can see him looming in the background behind his students, ready to strike upon his victim with severe groomings. NorsemanWassail! 12:13, 25 May 2008 (EDT)
- No luck here either. I need my lulz!!! Auld Nick 12:22, 25 May 2008 (EDT)
- Maybe they're trying to hide all the signs of vandalism? Even I can't get on. =-= Candlewick 12:31, 25 May 2008 (EDT)
- Do you guys have access in a way that we don't? PFoster 12:33, 25 May 2008 (EDT)
- Hey, Kettle Ticket, Have you emailed Andy - we're in danger of suffering withdrawal symptoms here (thank G for Yerranos)
ContribsTalk 13:11, 25 May 2008 (EDT)
- His "public" email is always flooded with unread emails. And I do not dare to email his "personal/client" email. Candlewick 14:06, 25 May 2008 (EDT)
In regards to Ken's latest atrocious essay...[edit]
Ken, just because a few people on a Christian fundamentalist website talk about Nietzsche's insanity being caused by his atheism doesn't mean that there's "been debate on the subject." Smart people wouldn't debate that question because it's a step away from debating whether or not fairies exist. ...and not the kind of "fairies" you're always writing about. PFoster 13:27, 25 May 2008 (EDT)
- Also, the only non-Christian blog reference you gave doesn't seem to deal with the question of atheism as a cause of Nietzsche's insanity. How is that a debate? PFoster 13:31, 25 May 2008 (EDT)
Wow[edit]
"AdenJ, you're right. My tone was insulting and I apologize. I hope you accept my apology.-- Aschlafly 09:17, 25 May 2008 (EDT)" [10]
Way to go, Andy. (It's only fair to notice signs of humanity/humility, since we rip on his every flaw...) ħψɱɐ₦
15:01, 25 May 2008 (EDT)
- Aye. Unreserved and with good grace. Credit where it's due: *applauds* --Robledo 17:03, 25 May 2008 (EDT)
Quite the big step for Andy. He is still wrong on the issue though. I bet he doesnt know where NZ even is. Ace McWicked
- Yeah, fair enough, he acknowledged he was wrong, good show Andy. However, I'm betting he doesn't learn from it. But then maybe I'm wrong. DogP 18:48, 25 May 2008 (EDT)
- actually he acknowledged that his tone was hostile, not that he was wrong. Further, he didn't respond to the questions asked. So while it is a step forward. It is a baby step Exasperate me!Sheesh!Not the most impressive contributor here 09:31, 26 May 2008 (EDT)
Wait, what?[edit]
Am I reading this wrong ? If 36% of Americans who believe that the theory of evolution is valid are liberals, how does Conservative figure that most people who believe that the theory of evolution is valid are liberals? Does that not mean that 64% -a big majority- of evolutionists are Conservatives? In what universe is 36% most? PFoster 17:26, 25 May 2008 (EDT)
- His universe, obviously.
Radioactive afikomen Please ignore all my awful pre-2014 comments. 17:29, 25 May 2008 (EDT)
- He misread the article. It says that Liberals are the most likely of the groups queried to believe only in evolution, wit 36% of them doing so. --AKjeldsenCum dissensie 17:42, 25 May 2008 (EDT)
- Also, he apparently skipped page 2, which says a clear majority at 67% of all Americans think that both evolution and religious beliefs are valid. Oh hai, quote mining. --AKjeldsenCum dissensie 17:45, 25 May 2008 (EDT)
- Ah. what is this "reading the article" of which you speak? PFoster 17:46, 25 May 2008 (EDT)
- For "read," please read: "skimmed through the article looking for exploitable statistics." --AKjeldsenCum dissensie 17:50, 25 May 2008 (EDT)
Just for fun (an odd definition of fun, I know), check out this diff of all changes to the ToE article since
Andy's figleaf the Student Panel decided there wouldn't be any major revisions to the article. Looks pretty major to me. --Kels 18:24, 25 May 2008 (EDT)
- Those are "all changes"? Those aren't even 430 edits! Going by the posting time of the Panel decision, THIS is the diff you're looking for: "935 intermediate revisions not shown." (Well, technically, one diff is missing, but I loved Conservative's edit summary there since it really adds to the irony: "super minor change. no real difference") --Sid 18:43, 25 May 2008 (EDT)
- That's weird. I went from April 9/07, and even gave him the benefit of a doubt by starting at the end of the day, and comparing it to today. I don't know what's happened. --Kels 18:53, 25 May 2008 (EDT)
- You probably checked the first diff on the 2nd page (on a 500 diffs-per-page) of the history, rather than the 1st. NightFlareSpeak, mortal 19:18, 25 May 2008 (EDT)
Rob Knox[edit]
That total moron Andrew Schlafly has replaced the Hollywood Values entry. The man (?) is beneath all contempt.
ContribsTalk 19:07,)"
- Shorter Andy: If he'd just got a good night sleep and left his brother to die, I wouldn't be picking on him. But that's not blaming the victim so much as blaming the victim. --Kels 19:09, 25 May 2008 (EDT)
- Improved! 9,000,000 points awarded! --AKjeldsenCum dissensie 19:11, 25 May 2008 (EDT)
This latest rob knox comment by Assface is repugnant. Why shouldnt people be allowed out drinking until late without being stabbed. What horrid man he is. Ace McWicked
WarenG only got a 2hour block from ASSfly! Is he mellowing in his old age?
ContribsTalk 20:08, 25 May 2008 (EDT)
What a vile man he is. Absolutely disgusting. — Unsigned, by: 86.45.194.60 / talk / contribs
- I'm sorry, but if I met Schlafly on the street, I'd knock him down & bite his balls off before feeding them to him. The man's got no redeeming features whatsoever.
ContribsTalk 20:31, 25 May 2008 (EDT)
He is totally vile. Abhorrent even. Ace McWicked 20:36, 25 May 2008 (EDT)
- And now the loathsome Dan weighs in to blame the 16 year old brother: "His brother is probably the real example of Hollywood values here for being there at that particular time. The inclusion is no problem if you view it from that angle. DanH 20:42, 25 May 2008 (EDT)"
ContribsTalk 20:48, 25 May 2008 (EDT)
- ...et tu, Dan? --Sid 21:04, 25 May 2008 (EDT)
- Does Jamie Knox, Rob's brother, even have anything to do with Hollywood/acting/singing? NightFlareSpeak, mortal 21:12, 25 May 2008 (EDT)
- Dan is shamed into retraction.
ContribsTalk 21:22, 25 May 2008 (EDT)
- I was thinking of the wording "Dan steps back from evil", but that works too. Andy really is a ghoulish, vile man with some serious mental issues. I'm still wandering around the talk.origins articles, and he was pretty insane back in '99 and 2000 too. Outside of rampant ideology, I can't imagine why anyone would want him teaching children. --Kels 21:28, 25 May 2008 (EDT)
- Schlafly, who is after all the expert on law, questions the lack of disclosure of the alleged assailant's name. This happened in the UK Asshole! We don't allow prejudging by the media here! (Even though we're a liberal country) ("The newspapers have not been forthcoming about the identity of the murderer, even though a room full of people saw him and he was promptly arrested, presumably with blood on his clothing. Odd, wouldn't you say?--Aschlafly 21:13, 25 May 2008 (EDT)" )
ContribsTalk 21:27, 25 May 2008 (EDT)
-
- "NightFlare", if that is your real name, you're clueless. You most likely think that "Hollywood" actually can be found on some map. If you fail to realize that "Hollywood" includes everybody who ever had any connection to somebody who earned money by singing, dancing or acting, I will pray for you. Something that evil liberals like you will never do. --Aschlafly --Sid 21:33, 25 May 2008 (EDT)
- ...wow, CONSERVATIVE removed the "multiculturalism" bit from the main page? What is this, the Twilight Zone? --Sid 21:37, 25 May 2008 (EDT)
- "Yes, and when the name is released, the person involved "is assisting the police in their enquiries." And Everybody Knows What That Means, don't they?--TerryHTalk 21:46, 25 May 2008 (EDT)" Sorry Terry, once they've been charged, they can't be questioned at all!
ContribsTalk 21:50, 25 May 2008 (EDT)
- Damn those liberals and all their nonsense about "due process"! --AKjeldsenCum dissensie 08:25, 26 May 2008 (EDT)
Ken's next promotion?[edit]
Conservative starts on Creationism.
ContribsTalk 19:30, 25 May 2008 (EDT)
And he creates and, within minutes, protects Bible Scientific Foreknowledge. Yup - it's Ken's new focus.
ContribsTalk 20:23, 25 May 2008 (EDT)
- A quick check tells me that he has often edited the CreationWiki version of that article. So it's hardly a "new" focus, strictly speaking. Still quite interesting. So far, he managed to implicitly assert that the Bible predicted AIDS and the Gay Bowel Syndrome! Way to go, man! --Sid 21:12, 25 May 2008 (EDT)
Liberal Venom[edit]
An interesting chat is going on on the main page talkpage. Andy reckons conservatives never spout vitrol (venom) at liberals. Someone should mention, I dunno, Limbaugh, Coulter and O'Reilly for starters. Ace McWicked
- Remember. Whatever you do, don't mention Fred Phelps. NightFlareSpeak, mortal 20:05, 25 May 2008 (EDT)
Dont mention Fred Phelps! You'll get them all excited. I wish I could jump at the moment but this IP of mine is currently blocked. Ace McWicked
- Apparently somebody (or two somebodies) already took care of that. Banhammered in 3... 2... UchihaKATON! 14:58, 26 May 2008 (EDT)
Multiculturalism[edit]
or Racism as we know Terry's interpretation of it over here very interesting - not!
ContribsTalk 21:55, 25 May 2008 (EDT)
Augh! I give up, I was trying to explain racism and I get block threats!!! DLerner 22:27, 25 May 2008 (EDT)
Here in Oz (the country, not the prison) we have them too. Back in Detroit had lots of them. Bunch of wankers. DLerner 22:44, 25 May 2008 (EDT)
- It seems that Schlafly's getting soft - two apologies in one day.
ContribsTalk 22:47, 25 May 2008 (EDT)
- Maybe, just maybe, he's getting decent. Quote, pleez kan I haz? ħψɱɐ₦
01:09, 26 May 2008 (EDT)
- What I find kinda...suspicious...is that Andy left the comment for the original poster to remove instead of immediately memory-holing it. That, and the fact that the guy didn't get any sort of block or reprimand of any sort is a bit of unusual behaviour from Andy and his thugs. --Kels 07:45, 26 May 2008 (EDT)
- I suspect the poster in question is one o' dem homeschoolers in da video. Maybe even che-boy hisself? 08:55, 26 May 2008 (EDT)
Ken reaches new levels of censorship by deleting the article wherein everyone's asking an awkward question.[edit]
Ken reaches new levels of censorship by deleting the article wherein everyone's asking an awkward question. Seriously though, that's the most blatant example of "You caught me out, so I'm burning the evidence" I've ever seen. (for posterity, Ken had been socking on an atheist website as Mark Davidson. He was called on it several times & eventually deleted both article & talk page. without ever admitting his deviousnessnessness)
[11] (I know it's WIGOed but It's worth a mention)
ContribsTalk 09:47, 26 May 2008 (EDT)
- Utterly pathetic isn't it? He goes to someone else's website under an assumed name and starts link spamming in the most pathetically transparent way. He lays down a gauntlet supposedly for a debate (but more likely just to link spam). When others call him out what does he do? Backtracks rapidly and attempts to destroy the evidence! Just about the most blatent admission of defeat (except without the courage of explicitly admitting it) I've seen to date on CP. The olympic gold medalist in internet cowardice goes to Ken! RedDog 10:19, 26 May 2008 (EDT)
- The best part is Cline's responses that catch him link-spamming and such. It was a total shut-out, Kenneh never had a chance. He didn't even have the balls to go on the forums section either; he just spouted off little insignificant challenges in comment areas (the droning on about stuff tells me he didn't even relate to the article in question, just picking a fight, but I can't honestly tell :P). It blew up in his face and we all saw it. Mmmm, yes Ken, cry. "Your tears sustain me [us]" (Stewie Griffin) NorsemanWassail! 10:57, 26 May 2008 (EDT)
- Ken reinstates the article but then goes totally MAD, sticking pictures of hunting trophies on the page !!!!!!!!! (sorry about the ! but !!!!)
ContribsTalk 14:26, 26 May 2008 (EDT)
- He took it down. Pity--I found his delusions of adequacy highly amusing. --Gulik 14:38, 26 May 2008 (EDT)
- It's becoming depressingly easy to shame them into retraction.
ContribsTalk 14:44, 26 May 2008 (EDT)Conservapedia has been defeated by a little cat representing only a little part of atheists' power, and along with the Atheism article at Conservapedia goes the campaign by its author, closet homosexual Ken DeMyer, to raise awareness to the Atheism article at Conservapedia. The Atheism article at Conservapedia was meant to be the article of the year at Conservapedia but now it is only another blog entry. I cite the following by Richard Dawkins: "We are all atheists about most of the gods that humanity has ever believed in. Some of us just go one god further."
- He just wants the attention. His spamming "Operations", the public announcements of having sent private mails, the public announcements of soon sending mails, the "T0 gentlemen" shout-outs, the "15 edit build-up and complete removal five minutes later" editing style... it all adds up. --Sid 14:48, 26 May 2008 (EDT)
Does Conservative honestly think that he can succeed where others fail miserably? That somehow, he is the first person in the entire to world to present convincing enough arguments to "destroy" atheist websites? His ego is amazing. And pride is one of the seven deadly sins, so I expect to see Conservative struck by lightning anytime soon. ThunderkatzHo! 14:53, 26 May 2008 (EDT)
No wait guys, Mark Davidson made an account on CP! So he must be real, even though it is pretty unusual someone so intimately familiar with the articles there so as to quote them didn't have an account already! NEVER MIND, FALSE ALARM!--70.126.243.83 16:03, 26 May 2008 (EDT)
- I'm actually curious if that sock was made by Ken (to defend his claim that he actually has a "grassroots" campaign and that dozens of different people eagerly spam sites for him) or by somebody else. --Sid 16:20, 26 May 2008 (EDT)
- I'm betting on Ken at the instigation of Schlafly, who was probably a bit pissed off with his socking up & obvious concealment of it.
ContribsTalk 16:43, 26 May 2008 (EDT)
- I still find it amazing that all these "funny" pictures that Ken posts, and his missives to"gentleman at another site" are the work of a middle-aged man rather than a pimply teen sniggering at Playboy.
GenghisRationalWiki GOLD member 17:18, 26 May 2008 (EDT)
- This gets a a question that's been bugging me for a while - does Andy really care about these sorts of shenanigans? Remember: CP is strongly linked to his homeschooling project. What risks is he taking for the credibility of the homeschooling project (in the eyes of the people who believe in it, not in other eyes) when an obvious loose cannon like Conservative is sharing bandwidth with his students -- or more importantly to me, with a guy like Terry who made Metapedia-esque comments about Africans having murderous revenge as a cultural phenomenon?PFoster 16:51, 26 May 2008 (EDT)
- Risks? None, probably. Those entrusting their kids to Andy's tutelage are likely already familiar with, and approving of, his sainted mother and her own special brand of batshit insanity. Once you've made that leap, there's nothing on CP to make you so much as blink. --Robledo 17:26, 26 May 2008 (EDT)
I lol'd. And at this... which has been there for awhile. o_0UchihaKATON! 17:14, 26 May 2008 (EDT)
I'm a little amazed that Ken leaves his "challenge" to Austin Cline up, given how much of a sham it reveals his linkspamming project is. If people were actually coming and being convinced by his Atheism article, then surely at least one of them that wasn't a sock of Ken himself would have gone and tried out a few lines. But nope, not a thing. Ken's efforts have gotten him nothing but detractors, and a few begrudging linkbacks, probably from people thinking "okay, okay, now shut the hell up". --Kels 19:12, 26 May 2008 (EDT)
- In a burst of irony, it appears that Ken's promo efforts get more time in the spotlight than the article - a typical indicator of a failed marketing/astroturfing campaign. People openly mock his decision to promote the article to "Article of the Year" status and his "awareness" project. Congratulations, Conservative, in the end, you hurt Conservapedia more than RationalWiki ever could! --Sid 08:03, 27 May 2008 (EDT)
Moer Sensorship[edit]
Ken replaces a Mark Davidson dig.
ContribsTalk 08:13, 27 May 2008 (EDT)
- Come to that, what the hell does this mean? I looked at Cline's page and it's the same as always, there's two new articles at the top, you press a button and get the archive. Same as last time I looked. Does Ken not know how a blog works? --Kels 08:19, 27 May 2008 (EDT)
-
- Does Ken think that Cline is even slightly bothered by the witterings of a loathsome little creep who won't even use his real name/identity when posting to his site?
ContribsTalk 08:22, 27 May 2008 (EDT)
- That's the problem with all the work Ken's been doing, spamming his article hither and yon. He's getting views, but precious few of them are anything but atheists and similar coming to see the freaks, and leaving either with a sad shake of the head or a laugh. Hell, I'd bet most of the people already on his side are probably embarrassed by lousy articles like that.
- Hey Ken! Here's a challenge for you! Stop spamming and trying to game the search engines for, let's say three weeks, then see what the results are in terms of search engines. If your rank and pageviews stay up, then you've actually got some repeat visitors, which presumably is the point. If not, then you'll have to admit that almost all of the results of your dishonesty is flash in the pan and mockery. Which hurts CP and anti-atheism. Either way, you'd get three weeks of people not laughing at you (as much). --Kels 08:25, 27 May 2008 (EDT)
- I think the "damage" has been done already - those blogs and comments and forum threads will be archived for eternity, so I don't think the article will slip much if left unattended for a few weeks. And of course Ken would eagerly accept such a challenge: According to him, nobody has any scrap of evidence or even an implied hint that he is Ken, Creationist, Peter Moore, DJ, DJJ, Darren777, jonathondickenson, Mark Davidson, etc. So he'll proclaim that he never did anything to spam, and his Atheism article rose just because thousands of other people are motivated to promote it! Following his perception of what can be proven (read: "nothing, because I never admitted it"), he will declare himself to be the winner, even while
his socksother people spam the hell out of it in order to game Google. --Sid 08:43, 27 May 2008 (EDT)
- Whee! I got me blocked for slagging off Ken. (Who apparently thinks that mockery = satire)
ContribsTalk 08:46, 27 May 2008 (EDT)
- Haven't counted but Ken seems to have thousands of identical Austin Cline refs all over the Wiki - he constantly updates them to be identical - weird or what?
ContribsTalk 09:08, 27 May 2008 (EDT)
- Is it spamming when it's your own website that you're littering with spam-like waffle?
ContribsTalk 09:43, 27 May 2008 (EDT)
- Good heavens! I hadn't looked at the main page talk over there since yesterday at least, but what a friggin' mess! Well, if we weren't able to make a mockery of CP, Ken's doing a bang-up job in our place! --Kels 09:57, 27 May 2008 (EDT)
He's just being silly now (12:27, 27 May 2008 (EDT)) about one edit every 5 minutes - I'd count 'em up but can't be bothered.
ContribsTalk 12:27, 27 May 2008 (EDT)
2 bits of news for da price of 1[edit]
Another reply from PJR.
And cover up? What cover up? 8 x 6 = 40, if you allow for taxes, folks. [12]. Why can the man just admit he made a
misto myst musta typo? But we'll warn those who correct our maths, oh yes... [13] --PsygremlinWhut? 10:51, 26 May 2008 (EDT)
- I don't really follow the PJR story too much and don't really have an opinion on what he seems to be getting at- but maybe one of his interlocutors can tell this guy that we do let people take out accounts here at RW and tend not to block dissenters, so maybe instead of his waving semaphore flags a la "to the gentlemen at another
websitesnarky little blog" approach, he can actually, like, post that stuff here?PFoster 11:00, 26 May 2008 (EDT)
Message for PJR If you're not afraid of the wrath of Andy, then come over here and talk to us like a normal person. It's stupid for you to not come over here where you can easily make an account and won't be blocked for it, but instead send love letters from CP. It's not even worth reading and responding unless you actually make that little effort. Addendum Ken doesn't do it because he doesn't get search engine benefits for his pet articles. What's your excuse? --Kels 15:18, 26 May 2008 (EDT)
- Yeah I've always wished PJR would do that. Reach accross the divide. Be the bigger man. Talking can only help surely? I don't expect to change his mind about anything and I have no respect at all for his beliefs or views. But I think he's a decent sort of bloke and it would be great to try to get some understanding. But I guess that's just because I'm an aging hippy. RedDog 15:27, 26 May 2008 (EDT)
What I don't get is that, if PJR is so confident of how his 'evidence' is so valid and objective, why doesn't he just post what it is, either over there or over here, so we can all judge this mysterious 'evidence' for ourselves, instead of trying to finagle certain conditions? If it's as solid as he seemingly thinks it is, it will stand on it's own merits. If it's not, it won't. Zmidponk 15:29, 26 May 2008 (EDT) Oh, and Philip, you may deny using the argument that Christianity is correct because the Bible says it is, but all the 'evidence' I have ever seen you submit on this matter is only valid if you accept the preconception that the Bible is irrefutably true. So you do use it. Zmidponk 15:52, 26 May 2008 (EDT)
- Message for PJR If this is how you'll insist on communicating, what the heck, I'll bite. Remember your two premises? And the agreement that, hypothetically, if they were true, the government could endorse Christianity? Here's the catch: that only works if everyone agrees they're true. It isn't true just because you think it's true (or because you think you can prove it's true). Who would be the authority over which religion (if any) is correct, anyway? UchihaKATON! 17:23, 26 May 2008 (EDT)
- There is no such authority, and no such agreement, so I see little point to your argument. And no - you are not allowed to simply dismiss perspectives that don't matter. As a matter of fact, 2 + 2 only equals 4 because everyone agrees on it. UchihaKATON! 17:25, 26 May 2008 (EDT)
- Sheisse. Didn't save WarrenG's password so FrancisG's is still there - but blocked! I see the creepy sycophan: Learn Together's sticking his oily wordage in. " 'Nutter' = One who has a viewpoint that you are already sure is absurd - if you actually took the time to look into the issue.": Sorry, was that supposed to meansomething? Go on then Phil: Show us your "Evidence" untainted by Bible or Christianity and we'll all kowtow to the true master.
ContribsTalk 17:39, 26 May 2008 (EDT)
Philip, if you're reading this, I do wish you would open an account here so you could have a reasoned debate/discussion about various issues without this indirect diplomacy going on. Bohdan, Ed, Rob, Fuzzy Kettleticket, and even Ken have all done so in at least a minimal manner. I'd be happy to do so at CP but 1) my account was blocked long ago for nothing other than being a part of this website (a clear violation of difference 15), and 2) the 90/10 rule prohibits too much debating, and ideological blocks are rampant as well. Sure, I think some of your ideas are a bit nutty, but you think mine are. So be it. I have no doubt there are various people here you want nothing to do with, and well, you should feel free to ignore them. In my view, even the worst offenders here are not half as bad as Karajou, Crocoite, Ed, and Andy (on a bad day, is that guy bi-polar?) to say nothing of TK (glad to see he's been less active). I, for one, am curious to see this evidence of yours (I hope it's better than the offerings of Ken and Yerranos). I seriously doubt you'll convince me I'm wrong, and, of course, there is little chance any of us will convince you of anything, but that doesn't mean there's nothing to be gained for anyone. Well, think about it. DickTurpis 18:07, 26 May 2008 (EDT)
- There's an essay namespace at your disposal, too. I'll support a "See also" link in the YEC article. --Robledo 18:17, 26 May 2008 (EDT)
- I would support something by PJR in the Essay namespace, or User for that matter. I'd rather see him come here and have real conversations with people instead of that childish coy "ooh, I can't officially recognize you but I'll send you little messages" ping-poing nonsense. --Kels 18:42, 26 May 2008 (EDT)
- That is the issue Kels. The ping-pong nonsense serves him by allowing him to make a empty gesture towards reasonableness while still clinging safely to the belfry, away from the embarrassment of direct discourse. Perhaps if you offered to make him a sysop here so he could block and ban anyone who asked uncomfortable questions he'd be more willing. As for "the evidence: he has made amply clear that he sees the hand of god in everything QED god exists. I've got the same sort of issue: I see the foot of Chuck Norris in everything QED Chuck Norris exists. everything else on his front is pure hand waving, and he knows it, and he knows that would come out almost immediately over here QED he won't be here. Too inconvenient a truth. All of that aside, I personally would pledge to treat him with the same respect that he treated me i.e. worlds better than anyone with differing opinions get treated over at CP. I doubt that will sway him. Nothing for him to gain. Exasperate me!Sheesh!Not the most impressive contributor here 19:24, 26 May 2008 (EDT)
- For goodness sake PJR step accr5oss the divide and let's speak like adults. Everyone who reads your talk page knows you're reading this. It seems so childish not to post directly. Why won't you do it? Atheists (which I thin k most of us are) are as disperate as theists. I'm sure you could find an accord with at least some of us. I doubt very much that we could ever reach an agreement but it would be great to talk to each other. Be a peacemaker. Be the bigger man. 217.41.92.46 02:37, 27 May 2008 (EDT)
- I watched last week's Channel 4 Dispatches documentary about fundie christians in the UK, and how they are slowly gaining influence in the corridors of power. The part that made me quite angry was when it was shown how, in the faith schools, children are being indoctrinated in YEC views. Indeed, one kid was shown taking a "science" exam, where the correct answer to how long the Earth took to be created was six days. The kids are blameless here, but the parents, and fundamentally, the government are inexcusibly at fault for allowing this to happen.
- So I don't buy the line that YECers - in particular PJR - can be "decent blokes" because that makes them sound essentially harmless. It's people like this that would return us to the dark ages if they had half a chance. No different to the Taliban. It was people like Galileo who asked "what if church doctrine and the bible are wrong" that gave us the world we live in today. Without science, without people who dare to ask questions that religion cannot answer, the world would be no more advanced than in the 1600s.
- Imagine a world without satellite navigation (requires space flight, requires relativity, etc.), for example. That's a world that should not exist, even in my worst nightmares.
- </rant> Bondurant 04:41, 27 May 2008 (EDT)
- < Well said Bondurant, a pernicious nutter is still a nutter even if he's the politest guy on Earth. Just because these things are someone's deeply held religious beliefs is no reason to treat them as anything but the absolute claptrap that they are. That such things should be mentioned in school as anything but a "creation myth" is revolting. I cannot begin to put into words my loathing of these people. </endorsement>
ContribsTalk 05:15, 27 May 2008 (EDT)
- You can be flat out wrong and hold potentially dangerous views but still be a decent bloke. Just a very badly misguided one. Have you watched Jesus Camp? That made me furious. I found it hard not to cry when I saw really good kids with loads of energy and personality struggling to repeat a rhetoric which at least one of them clearly could not believe. I think it's one of the most moving and frightening documentaries I've seen. These kids may well grow up to be deeply dangerous nutters - but I would argue that many of them will still be decent people. PJR does not need or want my charity but I think he is misguided (as he doubtless thinks I am if he reads this). I think his world view is devisive and dangerous. But I think he is a decent bloke - if only he would open his eyes to the world around him he would realise the error of his ways (in my opinion). I honestly believe his intentions are good. He may still be a nutter (I say "may" - I actually don't know, he could be a troll or a paradist or a hundred other things for all I know so I do not call him a nutter myself) but as long as his intentions are good, which I believe they are then he is a decent bloke. Even if his intentions are dangerous and misguided, which I also believe they are. 217.41.92.46 05:47, 27 May 2008 (EDT)
[Undent] Again, I disagree. While in the minority, as YECers are, I'm sure they will seem like nice, decent people. Put them in a position of power (goat forbid) and they will gladly destroy the secular nature of any national institution, such as education. Do you think PJR would hesitate for a heartbeat to remove anything from the national curriculum (or whatever each nation's standards of education are called) references to astronomy, geology, history, physics or social studies that went against the YEC view. No, of course he wouldn't. That nice-at-heart, reasonable guy would look a little different then. Bondurant 06:09, 27 May 2008 (EDT)
- I don't know. Well Phillip, Would you? In defense of my opinions though I did infer that I considered his beliefs to be "deeply dangerous" for exactly the reason you stated above. A misguided person is not always a bad person. All right - I admnit it. I'm a wooly minded liberal who tries to see the good in everyone. 217.41.92.46 06:13, 27 May 2008 (EDT) Sorry - just realised I wasn't logged on 217.41.92.46 is me! RedDog 06:14, 27 May 2008 (EDT)
- If I am being too harsh, then it is in conjoining the notion of PJR (the man) with YEC (the
bowelmovement). Personally, I don't see the difference, but I am sure he is a polite individual, especially in comparison to the scum over at CP that make capital out of somebody being murdered, like Rob Knox. Bondurant 06:20, 27 May 2008 (EDT)
- PS. I should add that the Dispatches documentary came as a shock to me, as I had thought that the UK was above influence from YECers. But they are active in this country, and - worse still - being funded in part by American organisations. I will no longer have that complacent attitude that "it couldn't happen here" Bondurant 06:30, 27 May 2008 (EDT)
- Bondurant, kindly STOP saying what I want to say, and doing it so much better. You realise the weasel ways of these people - they get in on something apparently unimportant and next thing you know they're forbidding anything connected with real science. YOU CANNOT ALLOW REASONABLENESS TO TAKE THE PLACE OF REASON!!!!!
ContribsTalk 06:25, 27 May 2008 (EDT)
- It was the Blair/Brown Education funding thing that let 'em in - City Colleges, or whatever they call them, funded by anyone with the money!
ContribsTalk 06:33, 27 May 2008 (EDT)
- Ok, ok. I give up already! I do recognise the dangers of these people but I believe that by using words like "despise" we end up becoming them. I do not want reasonableness to replace reason, but that doesn't mean I can't recognise reasonableness when I see it (which is a very rare commodity in itself over at CP). I am also well aware the road to metaphorical hell is paved with good intentions. But at least having good intentions is a start! Hang on - I started this by saying "I give up" then I noticably didn't give up at all. All I want here is a reasonable discussion between rational adults. I would invite PJR to join to step out of the shadows and join the discussion openly. I hope if he does he (as a person) would be treated with respect even where his views, beliefs and opinions may not be. Right then. NOW I give up! RedDog 06:51, 27 May 2008 (EDT)
- I pre-invoke Godwin's Law: Hitler (probably) seemed reasonable at the start.
ContribsTalk 06:56, 27 May 2008 (EDT)
- (Oh and before the storm: .")
ContribsTalk 06:59, 27 May 2008 (EDT)
(undent) I'm a little late to this, but I think PJR likes to think of himself as a nice, reasonable guy. So if he somehow came to power, he probably wouldn't gut education and public institutions. No, he'd quite happily sit idly by while other people did that sort of dirty work. And of course the changes he would make would set the groundwork for such people to do their inestimable damage to society. After all, that's the "reasonable" way to do things, and we've seen that tendency in him already, writ small. --Kels 08:28, 27 May 2008 (EDT)
- This is really why I'd like to have PJR here, I've at times tried to represent his views as well as I could, but I don't always do it accurately (sorry if I misrepresent you, Philip, I'm doing my best to try to understand your views), but I believe he has stated that he is not against teaching evolution entirely, as he sees it as an important idea that people should understand in this day and age. Perhaps the way I think religion should be (and is) taught in school, in which you teach about religions in history and social studies classes, because a working knowledge of the major religions is an important part of understanding the world and the course of history. Of course, teaching about evolution from a YEC perspective is not likely to produce great scientists, but it's a step above banning the teaching of evolution entirely. Perhaps a small step, depending on exactly how it would be handled in our theoretical PJRocracy. Again, Philip, why not get an account here? Or, if you really want to stay away, is there a "neutral ground" where discussions could take place?
- Oh, and in response to something you posted in your response (see how annoying this method of communication is?), we "evolutionists" will allow weakening of our "evolution is true view" when compelling scientific evidence leads us in that direction (the theory has changed since Darwin's time, you know), not merely from some theological argument. Cheers. DickTurpis 10:39, 27 May 2008 (EDT)
Phil's latest[edit]
"The current problem is that most of you simply have next to no idea about what creationism teaches, and are therefore arguing from a state of ignorance."
Correct me if I'm wrong, but creationism teaches that there's a "GOD" who made everything. Correct? - Err .. no there isn't!
ContribsTalk 11:14, 27 May 2008 (EDT)
- Which creationism? Aren't they all equally (in)valid?
- I like the one with the elephants on a turtle's back, personally (or was that Terry Pratchett?) Bondurant 11:27, 27 May 2008 (EDT)
Hey PJR - I thought you might have a point, so I read your Conservapedia article on creationism to see what extensive details I was missing.
Hmm. Or maybe you meant the somewhat wordier intelligent design article? I doubt it, they're not supposed to be the same thing after all. UchihaKATON! 11:37, 27 May 2008 (EDT)
closet homosexual[edit]
I kinda thought we were above using "gay" as an insult - even with people who have written horrible things about homosexuality...PFoster 19:12, 26 May 2008 (EDT)
- The insult in this context (I'm assuming you mean the thumbnail above) is in accusing somebody of being what that person condemns and that he's in denial about it, not simply mocking somebody being homosexual. NightFlareSpeak, mortal 19:32, 26 May 2008 (EDT)
- I see the difference - but insults are in often in the perception of the target...I'm not going to make a big deal about it - just express a vague sense of disapproval and then go watch the Red Wings beat the penguins...PFoster 19:34, 26 May 2008 (EDT)
|
https://rationalwiki.org/wiki/Conservapedia_talk:What_is_going_on_at_CP%3F/Archive49
|
CC-MAIN-2019-22
|
refinedweb
| 20,834
| 70.73
|
Type: Posts; User: Cucus
Joints is initialized in another class, here's de header
#ifndef ROBOT_H
#define ROBOT_H
#include "vector"
#include "joint.h"
Hi,
I'm trying to add "Vertex" elements to a vector. However, when I try to execute the program, I have an error: Error -1073741819 (or C0000005)
What does this error mean? Can you help me to...
Sorry, error typing, i've not finished the text already ^^
You can see here the code of each function:
MenuPrincipal::open()
{
QString fileName = QFileDialog::getOpenFileName(this);
...
Hi, i'm doing an application with Qt/OpenGL and i have some problems with auxiliar functions to open files in Qt.
I receive these errors:
ISO C++ forbids declaration of "open" with no type
ISO...
|
http://forums.codeguru.com/search.php?s=3cfdd3120124ce16a514e5e81cef8f23&searchid=7940601
|
CC-MAIN-2015-40
|
refinedweb
| 122
| 63.59
|
Some Doubts
Hi folks,
I'm getting started my studies about JavaFx, then I'm trying make little things but I'm having some problems.
This code bellow:
import javafx.ui.*;
import java.lang.*;
var nums = [1,2,3,4];
var numsGreaterThanTwo = nums[. > 2]; <= Here
When I compile it, appears: incompatible types: "expected Number, found Boolean in nums[<<.>> > 2] "
that references the instruction indicated above.
Thanks,
thanks for the info, but how about the previous
list[indexof . > 0]
thanks, but do you know why change that? Seems previous usage more convenient :(
Chris Oliver sent out an e-mail listing the most recent changes to the JavaFX Interpreter. One of the changes was:
"Syntax changes: sequence indexing versus predicate is now distinguished syntactically. The . operator is now obsolete;"
See
Unfortunately, the docs are a bit out-of-date. Try this instead:
----
var nums = [1,2,3,4];
var numsGreaterThanTwo = nums[x|x > 2];
println(numsGreaterThanTwo);
// some fun alternate ways to do the same thing:
var numsGreaterThanTwoAlso = select x from x in nums where x > 2;
println(numsGreaterThanTwoAlso);
var numsGreaterThanTwoThird = foreach (x in nums where x > 2) x;
println(numsGreaterThanTwoThird);
----
Pat.
Message was edited by: pforhan... fix syntax error
|
https://www.java.net/node/672270/atom/feed
|
CC-MAIN-2015-40
|
refinedweb
| 197
| 66.13
|
At this point one thing probably has become obvious to you. There are a number of areas in cryptography that, in order for communication to take place, require two implementations to have the same idea about how algorithms are implemented as well as have a common language for exchanging required parameter information for those algorithms.
This chapter introduces ASN.1, which is a language designed for just this purpose. By the end of this chapter, you should
Finally, you will see how to use the EncryptedPrivateKeyInfo class defined in the JCE, as well as see what is taking place when it does its job.
Abstract Syntax Notation 1, or ASN.1, came out of the standards developed by ISO and CCITT ( renamed ITU-T at the start of the 1990s) when work was being done on Open Systems Interconnection (OSI) standards. Work on OSI started in the early 1980s when, reputedly, hundreds of people used to attend the standards meetings. The primary design goal for ASN.1 was to provide a standard notation for use in specifying protocols that was concise in its encoding. Prior to the rise of the Internet, its use was mainly in the area of telecommunication standards, but we now see it in widespread use for describing key encodings, secure protocols, and algorithm parameters. The main standard defining it is X.680, and there are an additional six standard documents that build on X.680: X.681, X.682, X.683, X.684, X.691, and X.693. You'll find details of these listed in Appendix D, but as you can see, put briefly , ASN.1 is big!
It is not an easy thing to sum up in a few pages either. Most people who write about it tend to sprinkle quotes from H. P. Lovecraft's The Mountains of Madness into the commentary , as well as biblical offerings from the story of the Tower of Babel , in an attempt to help their readers work through the mysteries of ASN.1 and how it is used. True, it can be baroque, almost unfathomable in places, but it has a long history and has actually solved a lot of the problems associated with the building of universal protocols. So, while I doubt it is the final word on the problem of universal communication, it definitely has a lot to offer.
More importantly, in the case of cryptography, almost every standard you are likely to make use of, such as the PKCS standards and the PKIX RFCs, uses ASN.1 somewhere. Although this does not mean you have to understand ASN.1 in depth, it does mean you need some knowledge of it and how it works. Understanding something about it also gives you insight into some of the design decisions that were made when the Java cryptography APIs were developed and why various classes work together the way they do.
Still, as I have mentioned, both ASN.1 and its syntax can seem kind of weird and it is best approached with a sense of humor. To put you into the right frame of mind, I would remind you of Chancellor Gorkon's claim in Star Trek VI: The Undiscovered Country : "You have not experienced Shakespeare until you have read him in the original Klingon." I would not go as far as comparing most cryptographic standard documents to Shakespeare, but ASN.1 is definitely the original Klingon!
It is not necessary to add any new functionality to the Utils class for this chapter. However, as I will be extending it again in later chapters and to keep the examples regular, I'll define a new version of the Utils class to start the chapter5 package with. This new version is simply an extension of the one used in Chapter 4 and looks as follows :
package chapter5; /** * Chapter 5 Utils */ public class Utils extends chapter4.Utils { }
Create the new chapter5 package and type the Utils class in.
Now you are ready to proceed.
The underlying syntax of ASN.1, or at least the bit you have to deal with, is quite simple. There are three things you need to be able to recognize when you are trying to read an ASN.1 module:
As with Java, there are two commenting styles used in ASN.1, one for block comments, which are delimited by /* and */, and one for single-line comments, which start with -- and end with -- .
Unlike Java, ASN.1 block comments can contain other block comments. The block comment syntax is newer than the line comment syntax, so for historical reasons, you will often see multiple lines of line comments used where a block comment could have been used otherwise .
Object identifiers, often referred to as OIDs for short, provide a unique handle for an object or ASN.1 module in the ISO/ITU-T universe. They were introduced into ASN.1 to make it possible to construct a globally unique namespace, which also made it easy for organizations to be allocated part of that namespace, which they could then extend as required. For this reason, the best way to think of the structure of an OID is like it is a path , or arc, through a tree.
For example, the RSA Security algorithm that you are using when you call Signature.getInstance() with SHA256withRSA has an object identifier associated with it that goes like this:
iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 11
with the leftmost end representing where you start at the root of the tree. In its short form, this OID would be seen as "1.2.840.113549.1.1.11", and looking at the OID definition, you can see that RSA Security was assigned the OID "1.2.840.113549" by the U.S. branch of ISO. After that, RSA Security started its own branch, assigning the OID "1.2.840.113549.1" to its PKCS standards, and then further assigning OID "1.2.840.113549.1.1" to PKCS #1 and finally getting to the algorithm, which has simply been given the number 11, resulting in the OID for SHA-256 with RSA encryption: "1.2.840.113549.1.1.11". You can see another way of looking at the assignments that were done up to RSA Security in Figure 5-1.
Figure 5-1
There are three primary branches, or arcs , on the object identifier tree, all of which you will see used from time to time. The assignments are the ITU-T ”the number 0, ISO ”the number 1, and joint ISO/ITU-T organizations with the number 2. After that how the space is carved up becomes quite arbitrary, as the primary arc owners allocated numbers at the next level down to other organizations as they needed to. That said, despite the apparently arbitrary nature of how an OID gets created, the numbers are globally unique and serve the purpose of providing identification for ASN.1 modules, data types, algorithms, and just about anything else you can imagine. The only complication is that, because OIDs are based around organization rather than subject, in some cases you will notice the same cryptographic algorithm will be referred to by different OIDs.
A module is typically structured along the following lines:
ModuleName { ObjectIdentifier } DEFINITIONS Tagging TAGS ::= BEGIN EXPORTS export_list ; IMPORTS import_list ; body END
ModuleName and ObjectIdentifier have values that are used to identify the module being described. For example, the module defined in RFC 3161 (Time-Stamp Protocol) starts as follows :
PKIXTSP {iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) id-mod-tsp(13)}
This tells you the name of the module is PKIXTSP and that it is associated with an object identifier, which in its basic form will be 1.3.6.1.5.5.7.0.13.
Tagging tells you the tagging environment for the module. You will read about tagging in more detail a bit later, but you can expect to see one of IMPLICIT, EXPLICIT , or AUTOMATIC . If no tagging environment is specified, as in the TAGS :: = is missing altogether, you can assume tagging is EXPLICIT . In the case of RFC 3161, you will see the following:
DEFINITIONS IMPLICIT TAGS ::=
This means the default tagging type for the module is IMPLICIT . The "::=" symbol looks a bit like an assignment but more correctly reads as "is defined as." Later you will see that definitions can follow it, but in this case nothing follows it, as everything between the BEGIN and END is included.
The export_list is the list of types that this module defines that other ASN.1 modules can import. If EXPORTS is missing altogether, it means that everything defined in the module can be imported by another one. If you see the export list missing ”that is, you just see EXPORTS ; ”it means nothing is available for export.
The import_list is the list of types that are being imported into the module and where they are from. This is the thing that is of the most interest to you. If you are trying to implement a particular protocol or algorithm suite and are using an ASN.1 module as your reference, the import_list tells you where to look for definitions that are not in the module you are using as your primary reference point. An example of an import list, also from RFC 3161, is as follows:)} ;
As you can see, the component imports just follow a format of
import_item FROM source
where import_item is the type, or value, being imported and source is the name and OID for the module where import_item has been defined. Note the semicolon on the end of the collection of imports; it terminates the IMPORTS statement. Anything you read after the semicolon is a local definition. Of course, if the IMPORTS statement is missing, you should have all the information you need in the ASN.1 module in front of you.
Now consider body . It is terminated by the keyword END and it is the body where all the type and value definitions that the ASN.1 module provides are. Here are some examples taken from the body of the module defined in RFC 3161:
id-ct-TSTInfo OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) ct(1) 4} TSAPolicyId ::= OBJECT IDENTIFIER
The first line defines a value. In this case, it is saying id-ct-TSTInfo is of the type OBJECT IDENTIFIER and has the OID value 1.2.840.113549.1.9.16.1.4. Looking at the line also gives you the basic syntax for ASN.1 value definitions:
name type ::= value
where name is the name you want to refer to value with, type is the type of the value, and then value is specified in whatever notation is appropriate for the particular type given by type .
The second definition defines a new type that can be used in the module. What it is saying is that where you see TSAPolicyId , you are looking at a special case of OBJECT IDENTIFIER . As you can probably see, the basic syntax is
newType ::= type
where newType is the new type being created and type is the existing type it is based on. As with other languages, types you define can be used to build other types and definitions.
ASN.1 names can consist of upper-and lowercase letters, numbers, and dashes (the "-" character). Like any language, there are also a couple of conventions for creating names. Module names and type names all start with uppercase letters, whereas names for everything else start with lowercase letters .
A lot more can go into an ASN.1 module, but this gives you enough to make sense of the various RFCs, PKCS documents, and other standards ”so I will stop here. The next thing you need to do is look at the basic types that are available.
Broadly speaking, ASN.1 types fall into three categories: simple types, string types, and structured types. The string types are further subdivided into two more categories, those that just deal with raw bits and those that represent specific character encodings. The structured types consist of two container types ” SEQUENCE and SET ”that allow you to build complex structures using all the categories of type.
I will start with the simple types, which are used to represent fundamental values such as booleans, integers, and dates. I will then deal with the string and structured types.
The simple types in ASN.1 are
There are no real surprises with most of these:
BOOLEAN encodes a true or false value.
ENUMERATED is a special case of INTEGER that can be used to represent signed integers of any magnitude. Note that I said signed ” INTEGER values are encoded as two's-complement numbers , high byte first in "big endian" format.
You can think of NULL in a similar way to the Java null , although there is a slight twist, as it is ASN.1's way of distinguishing a value set to nothing, rather than absent, which you will see later is also a possibility.
You have already learned what object identifiers are in the section on basic ASN.1 syntax. Not surprisingly, OBJECT IDENTIFIER is the type they are given.
UTCTime and GeneralizedTime are two that deserve some special attention; both are used to define a "Coordinated Universal Time," but UTCTime has only a two-digit year. GeneralizedTime has a four-digit year. Both objects represent time as strings of ASCII, with major differences being that GeneralizedTime has a four-digit year and can represent seconds to an arbitrary precision, whereas UTCTime has a two-digit year and cannot go any lower than seconds in its resolution. Although it should be obvious how a GeneralizedTime is used, a question remains: How do you deal with the two-digit year in UTCTime?
One interpretation of UTCTime is that the two-digit year is interpreted as spanning the century starting from 1950 to 2049, but others are also used. A UTCTime can also be interpreted as going from 1900 to 1999, or as being on a sliding window, as in if it's 2005, the digits 55 to 99 are interpreted as indicating 1955 to 1999, and 0 to 55 is interpreted as meaning 2000 to 2055. How you work this one out depends on the standard you are working with, but you will be relieved to know that for the most part people have settled on the meaning that maps 50 to 99 as 1950 to 1999, and 00 to 49 as 2000 to 2049.
The two bit string types are BIT STRING and OCTET STRING .
BIT STRING allows you to store an arbitrary string of bits of an arbitrary length. For this reason there are two components to a bit string: The first is a string of octets that contains the actual string of bits and 0 to seven pad bits to make the string a multiple of 8 bits in length, and the second is a pad count that records how many pad bits were added. A bit string can be of zero length.
OCTET STRING allows you to store a string of octets and maps quite nicely onto a Java byte array.
ASN.1 has many character string types, almost all of which appear in some standard or another. The character string types are as follows :
As you go through the different character string types, you will see that the distinctions made between each type are all based on what characters can be in a string of the particular type being considered , as the character range goes from a restricted 7-bit character set to a full 32-bit character set. Once you have had the experience of looking at a range of ASN.1 modules, you will probably realize that the use of a particular character string type is as much a reflection of the hardware and software that was available when the module was being written as it is a reflection of the mind of the module writer.
The BMPString takes its name from the "Basic Multilingual Plane," which contains all the characters associated with the "living languages," with a fixed 16 bits per character. Its character set is the one represented by ISO 10646, the same set represented by the Unicode standard. It is quite a natural fit with the Java programming language and now sees extensive use.
The GeneralString and the GraphicString are actually related, so I will discuss them together. Both string types are related to the character sets described in the International Register of Coded Character Sets detailed in ISO 2375. The GraphicString can contain any one of the printing characters that appear in the register, but not the control characters. A GeneralString can contain control characters as well. Since the arrival of Unicode, use of these two types is becoming rarer and rarer.
The IA5String takes its name from an old ITU-T recommendation "International Alphabet 5." ASCII is actually a variant of this alphabet, and these days the type is considered to cover the whole of ASCII with its character set.
The NumericString can contain the digits 0 to 9 and the space character.
The PrintableString can contain a limited range of ASCII characters, which consists of the uppercase letters "A" to "Z", the lowercase letters "a" to "z", the digits "0" to "9", and the following other characters: " " (space), "'" (apostrophe), "(,)" (comma in parentheses), "+", "," (comma), "-", ".", ":", "=", and "?".
The TeletexString was originally known as the T61String , as it was originally based on the character set specified in CCITT Recommendation T.61 for Teletex. It is an 8-bit-per-character type, but there is the added feature that the ASCII ESC character starts an escape sequence that changes which actual characters are represented by the character stream that follows. The way this works is that each escape sequence should cause a display device to change the lookup table used for interpreting characters to the one indicated by the escape sequence. This allows the TeletexString to be used to support a wide range of languages, but it also makes it very difficult to interpret if you are on the receiving end of one.
The UniversalString is another update for internationalization. It was added to ASN.1 in 1994 to allow for the representation of strings made up of 32-bit characters. It is very rare to see one of these, as most modern languages are built on Unicode so there is not a lot of native support. Nonetheless, you will run into them occasionally; just hope you will not have to display the contents of an arbitrary UniversalString using Java just yet.
The UTF8String takes its name from "Universal Transformation Format, 8 bit," the same encoding that is often discussed with Java. This character string type works nicely with Unicode while still allowing the representation of the full character set possible in a UniversalString . It is the recommended string type for full internationalization, so you will see these used increasingly.
The VideotexString was designed to accommodate characters that can be used to build simple images. The strings are a mixture of pixel information and control codes, where an 8-bit character is typically considered to contain a 3 —2 array of pixels. Fortunately, the type was designed for use with videotext systems, and, to date, I have never had to deal with one of these in a standards document involving cryptography.
The VisibleString could originally contain only characters that appeared in ISO 646, and occasionally you will even see it referred to as an ISO646String . Since 1994 it has been interpreted as containing plain ASCII, but unlike an IA5String , it includes only the printing characters plus space. No control characters are allowed.
Reading through this list you have probably realized that the broad coverage of character sets that some of these string types purport to represent makes them, for want of a better phrase, simply scary. Fortunately, it is very unusual to encounter the more bizarre ones, largely due to the standardization of some of the simpler string types on variants of ASCII and the growth of Unicode. So take a deep breath , relax, and read on.
ASN.1 has two structured types: SEQUENCE and SET .
You will also see these used as SEQUENCE OF and SET OF . When you see the OF keyword, the SET or SEQUENCE will only contain ASN.1 objects of the type specified afterwards. For example:
Counters ::= SEQUENCE OF INTEGER
indicates that an object of type Counters contains only 0, or more, ASN.1 objects of type INTEGER .
As for the difference between a SEQUENCE and a SET: A SEQUENCE specifies the order of its components in its declaration, whereas a SET is an unordered collection. For example:
DigestInfo ::= SEQUENCE { digestAlgorithm AlgorithmIdentifier, digest OCTET STRING }
tells you that an ASN.1 object of type DigestInfo is a sequence with two elements, the first of which is an AlgorithmIdentifier , the second an OCTET STRING . On the other hand, if you created a similar example for a SET , as in:
InfoSet ::= SET { digestAlgorithm AlgorithmIdentifier, digest OCTET STRING }
it just means you will find the two component types in the SET , but not necessarily in that order. For the most part, uses of SET will look like this:
attrValues SET OF AttributeValue
which is considerably easier to make sense of.
Two annotations can be applied to types. One is OPTIONAL , which when applied to a field means it can be left out totally. The other is DEFAULT , which specifies the value for field if it is not present.
You will see both of these in the context of SEQUENCE and SET objects, for example:
VersionedData ::= SEQUENCE { version INTEGER DEFAULT 0, data OCTET STRING OPTIONAL }
DEFAULT tells you that the value may be left out of the encoding of the SEQUENCE . If it is, you should set the value of the version field in whatever Java object you are representing your VersionedData object with the value 0.
The data field, however, is marked as OPTIONAL , which means it can be left out. As you might also have an encoding that has not included the version field because it is set to its default value of 0, the possible lengths of a SEQUENCE representing a VersionedData object are as follows:
Note that being OPTIONAL and absent is not the same as setting the field to NULL . In fact you cannot use NULL here anyway, as the field has to contain a type of OCTET STRING . As I hinted at earlier, unlike in Java, where null is a value you can assign to any extension of Object, NULL in ASN.1 is a specific value.
Every encoding of a standard ASN.1 type has a default tag value of one octet already, which serves the purpose of allowing someone parsing a byte stream containing ASN.1-encoded objects to work out how to interpret the bytes following. You can see the tag values for some of the common types that are specified for BER encoding in Table 5-1. The default tag value occupies the lower five bits (bits 5-1) of the available eight in the octet, and there are modifiers that can be applied to the default tag value.
The most important of these modifiers for you is bit 6, which if set means the type is a constructed type. What this means is that the byte stream following will be made up of other ASN.1 objects that need to be assembled to make up the object being parsed. I'll deal with this in more detail when you look at BER encoding, but for now it's enough to know that SEQUENCE and SET are always marked with the constructed bit. Therefore, although the tag value for SEQUENCE is 0 —10 and SET is 0 —11, the encoded values you will encounter will be 0 —30 to indicate a SEQUENCE follows and 0 —31 to indicate a SET , because both these types are composed of one or more other ASN.1 objects.
Bits 8 and 7 specify the class of the tag. As I'm currently talking about default types, these bits will both be zero, which indicates they are in the UNIVERSAL class, which generally means the actual tag value is for one of the predefined ASN.1 types. The other tag classes are CONTEXT-SPECIFIC, PRIVATE , and APPLICATION . The bit values associated with each class are as follows:
You can ignore PRIVATE and APPLICATION because, as their names suggest, they are used in specific ASN.1 modules designed for specific applications. So at least in the case of the ASN.1 modules you deal with in cryptography for open standards, you will never run into them, and if you did, interpreting them would be dependent on the documentation accompanying the module. CONTEXT-SPECIFIC , on the other hand, is the default class of tagging and by far the most common, so I will concentrate on the CONTEXT-SPECIFIC class of tags here.
In addition to the predefined tag values, ASN.1 also allows the users to specify their own tag values. The syntax used to specify a tagged type in ASN.1 follows the pattern:
[ (class) number ] (TagStyle) Type
where the parameters in (), class and TagStyle , are optional and Type is the type that the tag in this context now represents. If class , which can be one of APPLICATION, CONTEXT-SPECIFIC , or PRIVATE , is left out, it is considered to be the default, that is, CONTEXT-SPECIFIC . So, if you see something like
encodedKey [1] OCTET STRING
you can tell that encodedKey is an OCTET STRING , which has the CONTEXT-SPECIFIC tag of value 1, done using the default style of tagging for the module. If the IMPLICIT or EXPLICIT keywords appear for TagStyle , then they override the tag style for the module, for that tag only, to be either IMPLICIT or EXPLICIT . The tag style for the module is determined by the tagging environment that has been specified in the DEFINITIONS block of the ASN.1 module, and as I mentioned earlier, it can be one of three tagging possibilities: AUTOMATIC, EXPLICIT , and IMPLICIT .
For small value tags, from 0 to 30, the actual value of the tag is stored in the bottom five bits, where the value associated with a normal ASN.1 tag goes otherwise . For tag values from 31 to 127, the bottom five bits are all set to 1 and the next octet is used to contain the tag number. If the number is higher than 127, the top bit of the next octet is set to 1 and the number is stored in seven-bit chunks , with the top bit of each octet being set to 1 if there is another chunk to follow.
By way of example, if you ignore whether bit 6 gets set for the moment, an ASN.1 object that has been given a 0 tag, as in has [0] in front of its type, will be the byte 0 —80. If it has been tagged with [32] , the tag will take two bytes ”0 —9f to indicate a tag greater than 31, and 0 —20 to give the actual value of the tag. Finally, if it has been tagged with [128] there will be three bytes of tag ”0 —9f, 0 —81 to give the first seven bits of the value with the bit 8 set to indicate another byte follows, and 0x00 to give the next seven bits of the value with bit 8 not set to indicate it is the last seven bits of the tag value.
The next sections review the three tagging environments, EXPLICIT, IMPLICIT , and AUTOMATIC , in the context of tags created in the CONTEXT-SPECIFIC class.
EXPLICIT Tagging
If you see nothing in the definition's block of an ASN.1 module, or you see
DEFINITIONS EXPLICIT TAGS ::=
then the default tagging style for that module is EXPLICIT . You might also see something like this:
encodedKey [1] EXPLICIT OCTET STRING
which means regardless of the default tagging for the module, encodedKey is an explicitly tagged OCTET STRING with the tag value 1.
EXPLICIT tagging actually wraps the underlying encoding, so it is the easiest to interpret. By "wrap" I mean that an explicitly tagged object has another object around it that serves the purpose of carrying the tag value. The easiest way to understand this is to start looking at the actual bytes produced during an encoding. For example, looking at the encodedKey definition again, assuming you started with 32-byte array when you made it, printing one in hex might give you the following bytes in the header:
a1 22 04 20...
where 0 —a1 tells you that you have a constructed (bit 6 is set), context-specific (bit 8 is set), tagged object with the tag value 1 (the bottom five bits) with a body of length 34 bytes (0 —22). The body then starts with 0 —04, a universal tag that is for an OCTET STRING , and the OCTET STRING also has a body of length 32 bytes (0 —20), which is the bytes that you started with.
Note that the constructed bit (bit 6) is set in the byte starting the tag header ”it is what tells you there is another encoding wrapped in the encoding of the tagged encoding. You will see how important the constructed bit becomes in interpreting tagged objects when you look at IMPLICIT tagging next.
IMPLICIT Tagging
Often you will see
DEFINITIONS IMPLICIT TAGS ::=
at the start of an ASN.1 module. If you see this, it means that the tagging style in the module is IMPLICIT . You may also see a declaration like
keyEncoded [1] IMPLICIT OCTET STRING
This also indicates that you are looking at an IMPLICIT tag.
The IMPLICIT tag style takes its name from the fact that the original tag value associated with the object it tags is overridden so the original tag value is now only implicit from the context in which the encoding is interpreted. As you will see, this can also introduce a certain amount of ambiguity.
Once again, the best way to deal with this is to look at the bytes produced in the header. This time the 32 byte value for the octets making up the encoded key gives the following header:
81 20 ...
This time you have a tagged object, with the tag value 1, which is 32 bytes in length. What happened to the OCTET STRING tag? Yes, it is gone. It has been replaced with the tag number you specified (0 —01), marked in the tag byte as CONTEXT-SPECIFIC (0 —80), thus giving you 0 —81.
Without getting into a debate about the merits of this tagging style, you can see how important it is to handle it correctly. Just how vital this is becomes obvious when you look at what can happen with the encoding for an ASN.1 structure that might be defined as follows:
TroublesomeSequence ::= SEQUENCE { encoding1 OCTET STRING, encoding2 [0] OCTET STRING OPTIONAL }
which is used in the following context:
troublesome [1] TroublesomeSequence
Now imagine that you encode a value for troublesome with both encoding1 and encoding2 created using 32-byte octet strings. The header for troublesome will look as follows:
a1 44 04 20 ...
Note that this time the byte starting the header ”0xa1 ”has bit 6 set indicating that the value is constructed. This has happened because the IMPLICIT tag is overriding the tag value of a constructed type, in this case a SEQUENCE . After the tag byte, you then have a length byte and you can see the 0x04 indicating your first octet string. So far, so good.
Now make it more interesting. The encoding2 field in TroublesomeSequence is OPTIONAL , meaning it can be left out. So I will now look at the header for the encoding of troublesome , where only encoding1 has been set to a 32-byte value and encoding2 has been left out. Doing this gives the following bytes in the header:
a1 22 04 20 ...
Now look back at the example for EXPLICIT tagging and see if you can find a difference. Yes, there is no difference. It is not possible to tell the difference between a particular ASN.1 base type with a tag of type EXPLICIT and a tagged SEQUENCE , or SET , of type IMPLICIT containing only one member that is of the same base type as used in the EXPLICIT case.
This leaves you with the following general rule, which you will be reminded of again later.
AUTOMATIC Tagging
You will see this only in the DEFINITIONS section of the module. In the particular world you are looking at, AUTOMATIC is very rare ”if you do see it, it means that everything in a SEQUENCE or SET is automatically tagged, with the first element tagged as 0. The tags are added using the IMPLICIT style unless the item that would be tagged is already tagged, or is a CHOICE item.
This one is almost better left to using an ASN.1 tool for dealing with it. If you have to deal with one by hand, the best way is to print the module out and then record what the tag values should be by hand. After that, cross your fingers and hope that you haven't missed one or tagged a CHOICE item by mistake.
The CHOICE type indicates that the ASN.1 field, or variable, will be one of a group of possible ASN.1 types or structures. If you are looking for another equivalent, the CHOICE type is very similar to a union in C or Pascal, the difference being that tagging is normally used to resolve any possible ambiguities . For example, looking at
SignerIdentifier ::= CHOICE { issuerAndSerialNumber IssuerAndSerialNumber, subjectKeyIdentifier [0] SubjectKeyIdentifier }
you can see that a SignerIdentifier can be either of the type IssuerAndSerialNumber or an object with a 0 tag of the underlying type SubjectKeyIdentifier .
The zero tag will be applied with the IMPLICIT style ”that is, it will override the default tag value for whatever type makes up a SubjectKeyIdentifier . This leads to an interesting issue about choice types that was touched on in the discussion on the AUTOMATIC style of tagging. Because choice types contain tag values that are used to distinguish which item in the CHOICE is represented, any object of type CHOICE is never tagged using the IMPLICIT style. I will repeat this as well; it is important!
The CLASS type was introduced in 1994 because of problems with the ANY syntax and ASN.1 macros, partly a result of the ambiguities they made possible in definitions, and also because the syntax was almost impossible to deal with properly if you were trying to write an automated tool. Strictly speaking, the ANY type is no longer supported, although as you will see, it still lives on. It represents the one non backward-compatible change made in ASN.1's history, and even 10 years on, we still seem to be coming to terms with it.
The effect is that prior to 1994, where you would have written
AlgorithmIdentifier ::= SEQUENCE { algorithm OBJECT IDENTIFIER, parameters ANY DEFINED BY algorithm OPTIONAL }
you now write
ALGORITHM-IDENTIFIER ::= CLASS { &id OBJECT IDENTIFIER UNIQUE, &Type OPTIONAL } WITH SYNTAX { OID &id [PARAMETERS &Type] } AlgorithmIdentifier { ALGORITHM-IDENTIFIER:InfoObjectSet } ::= SEQUENCE { algorithm ALGORITHM-IDENTIFIER.&id({InfoObjectSet}), parameters ALGORITHM-IDENTIFIER.&Type({InfoObjectSet}{@.algorithm}) OPTIONAL }
You'll see the definition using CLASS in PKCS #1. The definition using ANY appeared in X.509. The {@.algorithm} in the second definition provides the equivalent to the DEFINED BY algorithm . It tells you that for a given value of the algorithm field, the parameters field is constrained to the associated parameter value in InfoObjectSet .
Now look at the parameterization in the definition of AlgorithmIdentifier , the actual structure that contains ASN.1 values, as in:
AlgorithmIdentifier { ALGORITHM-IDENTIFIER:InfoObjectSet } ::= SEQUENCE {
The purpose behind this is to make the following definition possible in PKCS #1:
DigestInfo ::= SEQUENCE { digestAlgorithm DigestAlgorithm, digest OCTET STRING } DigestAlgorithm ::= AlgorithmIdentifier { {PKCS1-v1-5DigestAlgorithms} }
where PKCS1-v1-5DigestAlgorithms is defined as:
PKCS1-v1-5DigestAlgorithms ALGORITHM-IDENTIFIER ::= { { OID id-md2 PARAMETERS NULL } { OID id-md5 PARAMETERS NULL } { OID id-sha1 PARAMETERS NULL } { OID id-sha256 PARAMETERS NULL } { OID id-sha384 PARAMETERS NULL } { OID id-sha512 PARAMETERS NULL } }
or, in common language, the possible values for a PKCS #1 digest algorithm identifier.
I have glossed over the fact that if you look at the actual PKCS #1 document, you will see that id-md2, id-md5 , and so on are defined with the type OBJECT IDENTIFIER , but you now have the general idea.
There are currently five encoding methods recognized for encoding ASN.1 objects into streams of bytes:
I mention all of them for completeness, as you can see the number of methods indicates that people have had a few goes at producing encoding methods to date and there is probably still more to be written. Fortunately, the only two methods of interest are BER encoding and DER encoding.
BER stands for Basic Encoding Rules. As you've probably guessed from the example encodings you've seen so far, BER encoding follows the tag-length-value (TLV) convention. A tag is used to identify the type, a value defining the length of the content is next , and then the actual value of the content follows.
BER encoding offers three methods for encoding an ASN.1 object:
Simple types employ the primitive definite-length, bit and character string types will employ whatever method is most expedient, and structured types employ one of the constructed methods. If an object is tagged with the IMPLICIT style, the encoding used is the same as that used for the type of the object being tagged. If an object is tagged with the EXPLICIT style, one of the constructed methods will be used to encode the tagging.
How is it decided which method is most expedient? Strictly speaking, the decision is made on the basis of whether you know how long the encoding of the object will be when you start writing it out. However, in some cases, standards do specify BER indefinite-length, so in situations like that, you will end up with objects that are indefinite-length encoded regardless of whether it would have been possible to hold the object in memory. To fully understand what this means, you need to take a look at the three methods in more detail.
The Primitive Definite-Length Method
The definite-length methods all require that you know the length of what you are trying to encode in advance. The primitive definite-length method is appropriate for any nonstructured type, or implicitly tagged versions of the same, and an encoding of this type is created by first encoding the tag assigned to the object, encoding the length, and then writing out the encoding of the body.
You'll look at how the bodies are encoded in more detail later, but how the encoding of the length is done is worth looking at here. If the length is less than or equal to 127, a single octet is written out containing the actual length as a 7-bit number. If the length is greater than 127, the first octet written out has bit 8 set and bits 7-1, represent the number of octets following that contain the actual length. The length is then written out, one octet at a time, high order octet first.
For example, a length of 127 will produce a length encoding with 1 byte of the value 0 —7f, a length of 128 will produce a 2-byte encoding with the values 0 —81 and 0 —80, and a length of 1,000 will produce a 3 byte encoding ”0 —82, 0 —03, and 0 —e8. This is the simplest method of encoding and, as you will see, is required for DER encodings.
The Constructed Definite-Length Method
Length octets in this case are generated the same way as for the primitive definite-length method, but the initial byte in the tag associated with any object encoded in this fashion will have bit 6 set, indicating the encoding is of the constructed type.
As you would imagine, the regular structured types such as SEQUENCE and SET , or implicitly tagged objects derived from them, are still encoded as the concatenation of the BER encoding of the objects that make them up. Likewise, explicitly tagged objects are encoded using the BER encoding of the object that was tagged. Where this does become different is when bit string and character string types, or implicit types derived from them, are encoded using the constructed definite-length method.
When this happens, the original bit string, or character string, is encoded as a series of substrings that are of the same base type as the constructed string. For example, if you are trying to encode a byte array using the constructed definite-length method as an OCTET STRING , the encoding will start with an OCTET STRING tag with bit 6 set indicating that it is constructed. Then, after the length octets, the body of the encoding will be made up a series of smaller OCTET STRING encodings using the primitive definite-length method, the sum of which will be the byte array that you were originally trying to encode.
You might use this method where you have several values that make up a single ASN.1 type that exist separately prior to creating an encoding of the ASN.1 type. For example, an e-mail address may be defined as a single ASN.1 type but be assembled from parts " name " + "@" + "domain" prior to encoding, which can be encoded as substrings of a constructed string representing the full address.
The Constructed Indefinite-Length Method
Unlike the previous two methods, the constructed indefinite-length method does not require you to know the length of the encoding you are trying to construct in advance. With this method, the encoding of the tag value follows the same procedure as for the constructed definite-length method; however, the length is written out as the single octet of the value 0 —80, and instead of being able to use the length of the encoding to determine when you reach the end of the contents in the body of the encoding, there is an end-of-contents marker ”two octets of the value 0 —00, which actually equate to tag 0, length 0. Other than the requirement for and the presence of the end-of-contents marker, encoding of objects is handled in much the same way as for constructed definite-length.
This method of encoding is useful where the length of the value is not known at the time the tag and length for the value is encoded. This method is common when encodings are very large and memory or efficiency constraints prevent the entire value being buffered to determine its length before encoding it.
The Distinguished Encoding Rules, or DER, are so called because they make identical data within identical ASN.1 definitions reduce to identical binary encodings. This is particularly important in security applications where the binary data will be digitally signed. There is also an interesting covert channel made possible with BER encodings where equivalent, but different BER encodings can be used to transmit extra information. For example, an octet string representing encrypted data could be represented using a constructed method where the length of the substrings making up the encrypted data could be used to leak information about either the data itself or the key used to encrypt it. As DER always reduces a value to the same encoding no matter what, such a covert channel is not possible.
DER adds the following restrictions to BER encoding to make this possible:
DER encoding is the most common form of encoding you will encounter, and it is also the simplest to perform. The only area of complication is the sorting of the objects contained in SET objects. A DER-encoded SET is sorted by ordering the objects inside it according to their encoded value in ascending order. Encodings are compared by padding them with trailing zeros so they are all the same length, with the result that a DER-encoded SET will be ordered on the tag value of each object. Be careful about relying on this, though. A BER-encoded SET is not necessarily sorted, so if you are trying to write code to handle both BER-and DER-encoded SET objects, it is a mistake to rely on the ordering taking place.
The Bouncy Castle ASN.1 API evolved to deal with the ASN.1 binary encoding and binary decoding requirements of the other Bouncy Castle APIs and the provider implementation. As such, although it does not represent a full implementation of ASN.1, it does cover most of the issues that seem to arrive when dealing with cryptographic protocols and structures.
The main package for the API is org.bouncycastle.asn1 , and there are a variety of packages off org.bouncycastle.asn1 that contain classes for assisting with the implementation of various message and data formats. For example, org.bouncycastle.asn1.pkcs has classes for use with the PKCS standards, org.bouncycastle.asn1.cms has classes for supporting the ASN.1 objects in RFC 3852, and org.bouncycastle.asn1.x509 has classes for supporting the ASN.1 objects used in X.509.
The org.bouncycastle.asn1 package has a few simple ideas underlying it to support the encoding requirements you run into with cryptographic protocols. The following conventions apply:
The need for having the DEROutputStream behave the way that it does is quite important. Two common issues arise when you are working with other implementations of protocols and also in the general sense when you are generating hashes and signatures.
The general issue of being compatible with other implementations is that a lot of implementations seem to ignore the requirement to support BER encoding even when it is specified in the documentation for the standard that is apparently being implemented. So on more than one occasion, you may find yourself having to convert an object that is BER encoded into one that is only DER encoded. The property DEROutputStream has of forcing DER encoding makes this conversion quite simple.
For example, imagine you have a BER-encoded object in a byte array called berData that you want to convert to a DER-encoded object in a byte array that you will call derData . Using the Bouncy Castle ASN.1 API, you can achieve the conversion to DER with the following lines:
ASN1InputStream aIn = new ASN1InputStream( berData ); ByteArrayOutputStream bOut = new ByteArrayOutputStream(); DEROutputStream dOut = new DEROutputStream(bOut); dOut.writeObject(aIn.readObject()); derData = bOut.toByteArray();
If you run into a problem where, say, you have a PKCS #12 file from one product that refuses to import into another, there is a good chance it is the inability of the second product to deal with BER encoding that is the problem.
In a similar vein, standards that specify methods for calculating digital signatures, hashes, or MACs on ASN.1-encoded data will often specify that it must be calculated on the DER encoding of the objects. You can use virtually the same technique to do the conversion, depending on how you have everything set up. The only difference might be that you need to iterate on aIn.readObject() if berData contains more than one object.
The object hierarchy in the ASN.1 base package works as follows . The root object for all the simple types, bit string types, and structured and tagged types is DERObject . As it turns out, a better name would have been ASN1Object, but originally, it seemed you might be able to get away without dealing with BER, so when you see the name you can think of it as a chance to learn from example. There is no escaping it!
At the moment, a number of types have both BER and DER encoding implementations, and they have parent implementations that following the convention of starting with ASN.1. Most types produce DERcompatible encodings. Currently the following implementations are associated with the following ASN.1 types:
All these objects provide implementations of Object.equals() and Object.hashCode() .
Only the object names starting with DER or BER provide constructors, and these are pretty much what you would expect. The constructors for classes corresponding to the bit string types can take byte arrays, with DERBitString also being able to take the number of pad bits. There are constructors for the classes corresponding to the character string types that can take String objects, except for DERUniversalString , which will only take a byte array, because Java is not able to represent 32-bit characters directly. There are constructors for the time-based classes that take Date objects. A DERObjectIdentifier can be constructed from a String representation of an OBJECT IDENTIFIER; the constructor for DERBoolean simply takes true or false.DERInteger and DEREnumerated both take int and BigInteger . The constructors for the tagged object types take a tag number, a flag specifying whether the tagging is explicit or not, and the object to be tagged.
Finally, the BER and DER types supporting SEQUENCE and SET can be either constructed as structures that have a single object inside them by using a constructor that takes a single encodable object or as structures that contain multiple objects by using an ASN.1 API equivalent to Vector or ArrayList , the ASN1EncodableVector class.
You will also notice that the base classes for each type usually have two getInstance() methods on them. The getInstance() methods come in two flavors. The first simply takes an object and returns whatever the base type is. This is a convenient method to enable you to avoid casting and other conversions that can be necessary when manipulating ASN.1 objects. The other method takes an ASN1TaggedObject and a boolean argument, the purpose of which is to say whether the tagging present on the ASN1TaggedObject is explicit, in which case the boolean is true , or implicit, in which case the boolean is false. It is this getInstance() pattern that is used throughout the ASN.1 API to deal with the complications that might arise due to implicit tagging with the various types.
The main issue with tagging, as you saw earlier, is that if an object is implicitly tagged, the actual tag the object is meant to have is implicit from the context in which its encoding appears. For the most part, without knowledge of what has been encoded originally, the best you can tell from the actual encoded information is that you have a tag value associated with a bunch of bytes. The exception to this is if the tag is marked as constructed, but even then the best you can do is tell you have a bunch of objects, or possibly just one object, which may in fact be inside an explicitly tagged SET or SEQUENCE .
From the point of view of programming this, a few simple examples would help. For example, say you created a BIT STRING from a byte array that represented a string of bits that was a multiple of 8, and then wanted to create an implicitly tagged version of it with the tag value 1. You could do this with the following code:
DERBitString bits = new DERBitString( byteArray , 0); ASN1TaggedObject taggedBits = new DERTaggedObject(false, 1, bits);
To recover bits from the tagged object you would then use the following:
bits = DERBitString.getInstance(taggedBits, false);
Likewise if bits was actually wrapped in a SEQUENCE because you were trying to encode the following structure:
WrappedBits ::= SEQUENCE { bits BIT STRING }
and you were trying to implicitly tag the outer sequence as well with a tag value of 1. You might end up with the following fragment instead:
DERBitString bits = new DERBitString(byteArray, 0); ASN1Sequence wBits = new DERSequence(bits); ASN1TaggedObject taggedWBits = new DERTaggedObject(false, 1, wBits);
and this time recovering it from the tagged object would be as follows:
wBits = ASN1Sequence.getInstance(taggedWBits, false); bits = (DERBitString)wBits.getObjectAt(0);
As I mentioned earlier, it is the use of false that tells the API that it is dealing with an implicitly tagged object. If, instead, the tagging used in the code fragments was explicit, you would replace every occurrence of false with true .
So that covers the basics. Before you go on to look at some real examples, you'll try creating an ASN.1 structure of your own.
Imagine you are trying to create a Java object implementing the following ASN.1 structure using DER encoding:
MyStructure ::= SEQUENCE { version INTEGER DEFAULT 0, created GeneralizedTime, baseData OCTET STRING, extraData [0] UTF8String OPTIONAL, commentData [1] UTF8String OPTIONAL }
The first thing you can notice is the presence of tagging. In this case the tagging is not specified in the actual structure, so you need to know what tagging environment you are in. You therefore look at the DEFINITIONS block in the module the structure appears in and see this:
DEFINITIONS IMPLICIT TAGS ::=
So you know tags have to be handled implicitly.
The other thing you can notice is the use of a DEFAULT. As mentioned earlier, in a DER-encoded object, a field that's set to its default value must be left out of the encoding. In a BER-encoded object it may or may not be present. In this case, you are using DER, so you must ensure that you do not include the version field in the encoding if it is set to its default value. In general, though, it is a good idea to adopt the following policy for BER as well.
The final thing to note is the use of OPTIONAL . You have to take into account that one of, or both of, extraData and commentData might not be present in the encoding, and that, while they have the same base types, the tagging is used to distinguish them.
So now that you know what you are up against, take a look at the code.
Try It Out: Implementing an ASN.1-Based Java Object
This example is quite large, so I'll go through it in stages. The first step is to provide the necessary imports and to extend the general-purpose class that the API uses for creating ASN.1 objects ” org.bouncycastle.asn1.ASN1Encodable. So here is the basic class header:
package chapter5; import java.util.Date; import org.bouncycastle.asn1.*; /** * Implementation of an example ASN.1 structure. *
* MyStructure ::= SEQUENCE { * version INTEGER DEFAULT 0, * created GeneralizedTime, * baseData OCTET STRING, * extraData [0] UTF8String OPTIONAL, * commentData [1] UTF8String OPTIONAL } *
* */ public class MyStructure extends ASN1Encodable { private DERInteger version; private DERGeneralizedTime created; private ASN1OctetString baseData; private DERUTF8String extraData = null; private DERUTF8String commentData = null;
Now you need at least one constructor that will allow you to create the object from an ASN1Sequence that you might have just read from an ASN1InputStream. Note that doing this is a little involved, because any one of three fields in the actual sequence may be missing from the encoding. If the version field was its default value, it will be left out, and the extraData and commentData fields are optional, so they may be missing as well. What follows is a simple way of dealing with the optional fields; in some circumstances, you might want to include code that confirms the order the optional fields appear in the sequence as well, rather than simply recognizing them.
/** * Constructor from an ASN.1 SEQUENCE */ public MyStructure( ASN1Sequence seq) { int index = 0; // check for version field if (seq.getObjectAt(0) instanceof DERInteger) { this.version = (DERInteger)seq.getObjectAt(0); index++; } else { this.version = new DERInteger(0); } this.created = (DERGeneralizedTime)seq.getObjectAt(index++); this.baseData = (ASN1OctetString)seq.getObjectAt(index++); // check for optional fields for (int i = index; i != seq. size (); i++) { ASN1TaggedObject t = (ASN1TaggedObject)seq.getObjectAt(i); switch (t.getTagNo()) { case 0: extraData = DERUTF8String.getInstance(t, false); break; case 1: commentData = DERUTF8String.getInstance(t, false); break; default: throw new IllegalArgumentException( "Unknown tag" + t.getTagNo() + "in constructor"); } } }
Having written a constructor to get you from the ASN.1 world to the Java world, you now also need a constructor to get you from the Java world into a form where you can produce an ASN.1 binary encoding. The following is just a basic one, as you can imagine you might write convenience constructors depending on how you, or your fellow developers, were likely to use the class. As you might also imagine, this constructor is simpler than the one that builds from an ASN1Sequence , although you are still checking for the presence, or not, of optional fields.
Note that you are also creating the internal objects so they will encode in DER format, regardless of whether the object is written to a DEROutputStream or an ASN1OutputStream .
/** * Constructor from corresponding Java objects and primitives. */ public MyStructure( int version, Date created, byte[] baseData, String extraData, String commentData) { this.version = new DERInteger(version); this.created = new DERGeneralizedTime(created); this.baseData = new DEROctetString(baseData); if (extraData != null) { this.extraData = new DERUTF8String(extraData); } if (commentData != null) { this.commentData = new DERUTF8String(commentData); } }
I have skipped the get() methods altogether, as they are obvious. The last fragment you need to look at is the implementation of the abstract ASN1Encodable.toASN1Object() method and the end of the class. When ASN1OutputStream.writeObject() is called, the toASN1Object() method is invoked to produce an object that can then be encoded on the stream. You should note that while the code again checks for the presence of the optional fields before adding them to the ASN1EncodableVector , which will be used to create the DERSequence object, you must also check the value of the version field and only include it if it is not its default value.
/* * Produce an object suitable for writing to an ASN1/DEROutputStream */ public DERObject toASN1Object() { ASN1EncodableVector v = new ASN1EncodableVector(); if (version.getValue().intValue() != 0) { v.add(version); } v.add(created); v.add(baseData); if (extraData != null) { v.add(new DERTaggedObject(false, 0, extraData)); } if (commentData != null) { v.add(new DERTaggedObject(false, 1, commentData)); } return new DERSequence(v); } }
Now you can try a simple test class. The test class dumps the ASN.1 binary encoding that is generated for each version of MyStructure you create to the screen as hex. It does this by using the convenience method ASN1Encodable.getEncoded() that MyStructure inherits to generate the byte encoding. See what you get.
package chapter5; import java.util.Date; /** * Test for MyStructure */ public class MyStructureTest { public static void main(String[] args) throws Exception { byte[] baseData = new byte[5]; Date created = new Date(0); // 1/1/1970 MyStructure structure = new MyStructure( 0, created, baseData, null, null); System.out.println(Utils.toHex(structure.getEncoded())); if (!structure.equals(structure.toASN1Object())) { System.out.println("comparison failed."); } structure = new MyStructure(0, created, baseData, "hello", null); System.out.println(Utils.toHex(structure.getEncoded())); if (!structure.equals(structure.toASN1Object())) { System.out.println("comparison failed."); } structure = new MyStructure(0, created, baseData, null, "world"); System.out.println(Utils.toHex(structure.getEncoded())); if (!structure.equals(structure.toASN1Object())) { System.out.println("comparison failed."); } structure = new MyStructure(0, created, baseData, "hello", "world"); System.out.println(Utils.toHex(structure.getEncoded())); if (!structure.equals(structure.toASN1Object())) { System.out.println("comparison failed."); } structure = new MyStructure(1, created, baseData, null, null); System.out.println(Utils.toHex(structure.getEncoded())); if (!structure.equals(structure.toASN1Object())) { System.out.println("comparison failed."); } } }
And here is the output:
3018 180f31393730303130313030303030305a 04050000000000 301f 180f31393730303130313030303030305a 04050000000000 800568656c6c6f 301f 180f31393730303130313030303030305a 04050000000000 8105776f726c64 3026 180f31393730303130313030303030305a 0405000000000 0800568656c6c6f 8105776f726c64 301b 020101 180f31393730303130313030303030305a 04050000000000
I have highlighted every second object's encoding with bold so that it is easier to see where the encoding of one object starts and finishes. You will look at this in more depth in the following section.
How It Works
There have been a few of steps to make all this happen. The first is you have extended ASN1Encodable to create an object suitable for passing to an ASN1OutputStream and you have implemented the toASN1Object() method to construct a DERSequence object that contains the primitive types you want to encode. The second is that you have written a constructor that allows you to take the types that you normally use in Java programming and convert them into their ASN.1 counterparts. Likewise, you provided a constructor to get you from the ASN.1 view of the MyStructure object, where it exists only as a sequence, back to the Java viewpoint. The only thing missing are the get() methods, and in this case you would just add whatever was appropriate to the application you were trying to develop.
Having a closer look at the output of the example also gives you more of an insight into what is going on when the encoding is being generated.
Starting at the beginning, you can see the tag for a SEQUENCE ”0 —10 ”Ored together with the value indicating a constructed type 0 —20 (bit 6), giving you the value 0 —30. The next byte is the length byte, and after that the values making up the internals of the SEQUENCE start to appear. Looking at the first four lines, you can see that the first encoding appearing in the sequence is that of a GeneralizedTime , which starts with a tag of 0 —18. This has happened because, in the first four cases, the version field has its default value so is left out. On the fifth line, you can see the first object in the sequence is an INTEGER , tag 0 —02, and this has happened because the version field is now 1 ”a value different from its default of 0.
As you would expect, the GeneralizedTime is always present, and you also see the OCTET STRING (tag 0 —04) making up the baseData field. Then you come to the UTF8Strings , which would normally start with a tag of 0 —0c. However, because of implicit tagging, it starts with 0 —80 in the case of the extraData field, which has a tag value of 0, and 0 —81 in the case of the commentData field, which has a tag value of 1. The easiest place to see this is to look at the difference at the end of the encoding on lines 2 and 3 where, on line 2 the commentData field is absent, and on line 3 the extraData field is absent.
At this point you should have a basic understanding of what is happening when an ASN.1 structure you have seen the definition for is encoded. Before you go on to look at some real-world structures, I will just diverge briefly to mention the classes that can be used to examine structures for which you only have the encoded object.
The API also provides a general-purpose class that allows you to get a, more or less, human-readable dump of an ASN.1-encoded object. You can find it in the package org.bouncycastle.asn1.util; it is called ASN1Dump . It has a single method on it called ASN1Dump.dumpAsString() , which takes a single ASN.1 encodable object and returns the hierarchy it contains as a String object.
There is also an associated utility class called Dump in the same package. It contains a main method, which takes a single argument being a file that you want to run the ASN1Dump class over. Running a command like this:
java org.bouncycastle.asn.util.Dump id.p12
will dump out every ASN.1 object found in the file id.p12.
Try It Out: Using ASN1Dump
Let's try a simple example that builds on the work you did in the last section and see what ASN1Dump produces:
package chapter5; import java.util.Date; import org.bouncycastle.asn1.util.ASN1Dump; /** * Example for ASN1Dump using MyStructure. */ public class ASN1DumpExample { public static void main(String[] args) throws Exception { byte[] baseData = new byte[5]; Date created = new Date(0); // 1/1/1970 MyStructure structure = new MyStructure( 0, created, baseData, "hello", "world"); System.out.println(ASN1Dump.dumpAsString(structure)); structure = new MyStructure(1, created, baseData, "hello", "world"); System.out.println(ASN1Dump.dumpAsString(structure)); } }
When you run the example, you should expect to see the two structures get dumped out as follows:
DER Sequence GeneralizedTime(19700101000000GMT+00:00) DER Octet String[5] Tagged [0] IMPLICIT UTF8String(hello) Tagged [1] IMPLICIT UTF8String(world) DER Sequence Integer(1) GeneralizedTime(19700101000000GMT+00:00) DER Octet String[5] Tagged [0] IMPLICIT UTF8String(hello) Tagged [1] IMPLICIT UTF8String(world)
As you can see, you have two SEQUENCE objects, both of which conform to the structure outlined in the previous section.
How It Works
ASN1Dump takes an object that extends ASN1Encodable and traverses its structure, building up an indented tree view of the internals of the object.
There is one thing a little odd about the output, though. As I have said previously, correctly working out what an implicitly tagged object is requires knowledge of the structure being parsed. In the previous output, the ASN1Dump class has correctly identified what is contained in the tagged objects. What is going on?
The answer, of course, is that it's cheating. As the tagged object has been constructed from the real objects involved, ASN1Dump can tell what type it is. Try adding the following lines to the example and running it again (you will need to import org.bouncycastle.asn1.ASN1InputStream as well):
ASN1InputStream aIn = new ASN1InputStream(structure.getEncoded()); System.out.println(ASN1Dump.dumpAsString(aIn.readObject()));
You will see the following extra lines of output:
DER Sequence Integer(1) GeneralizedTime(19700101000000GMT+00:00) DER Octet String[5] Tagged [0] IMPLICIT DER Octet String[5] Tagged [1] IMPLICIT DER Octet String[5]
This makes more sense. As the implicit tagging has overridden the tag for the UTF8String , the best the ASN1Dump class can do is recognize the implicitly tagged objects as being of the type OCTET STRING . Still, the ASN1Dump class is doing the best it can, and it does provide you with a basic analysis tool for dealing with ASN1-encoded messages. Having come this far, it is time to look at how ASN.1 applies to real-world situations in the JCA and JCE.
I have already mentioned objects of the type AlgorithmParameters as usually having an ASN.1 equivalent. As it happens, public and private keys that return X.509 and PKCS#8 as their formats also return encodings created using ASN.1 when their Key.getEncoded() method is called and it is an ASN.1 object that is inside a PKCS #1 V1.5 signature when it is encrypted using an RSA private key.
Because these are all Java objects you are already familiar with, and you are going to be dealing with more ASN.1-based objects later in this book, now have a look at what goes on with these objects from the point of their ASN.1 binary encoding.
There are a couple of structures that show up frequently enough in the ASN.1 modules associated with cryptography that they deserve mentioning before you start looking at some examples. The first is called AlgorithmIdentifier and originally appeared in X.509; the second is Attribute and originally appeared in the ISO/ITU-T useful definitions module. You will have a look at these common structures first, because they will provide you with some background when it comes to dealing with the examples.
The AlgorithmIdentifier Structure
The AlgorithmIdentifier structure serves simply to hold an object identifier representing a particular algorithm and an optional parameters structure that holds the parameters required. You will encounter a few variations of the structure, as some people define it for themselves , but even the variations usually boil down to this basic ASN.1 structure:
AlgorithmIdentifier ::= SEQUENCE { algorithm OBJECT IDENTIFIER, parameters SomeASN1Type OPTIONAL }
Pre-1994 the SomeASN1Type would have been ANY DEFINED BY algorithm. These days, of course, you will see a CLASS definition to show the linkage between the OBJECT IDENTIFIER representing the algorithm and the parameters field's actual type. This tells you that any ASN.1 structure can occupy that field and that the value you find there will depend on the value of the algorithm field.
One further thing you need to know: For historical reasons, the optional parameters field is often set to NULL instead of being left out, so you will often see a standard that specifies that the parameters field must be set to NULL rather than being left out. This happened because when the 1988 syntax for AlgorithmIdentifier was translated to the 1997 one, the OPTIONAL somehow got left out. Although this was later fixed via a defect report, whatever you do, if you are creating an AlgorithmIdentifier and you see parameters are NULL , make sure you include the NULL . Empty is not the same as NULL .
The Attribute Structure
The Attribute structure is another general structure that you will see a lot. The following definition is from RFC 3852:
Attribute ::= SEQUENCE { attrType OBJECT IDENTIFIER, attrValues SET OF AttributeValue } AttributeValue ::= ANY
Astute readers will remember that in the earlier discussion on the basics of ASN.1, support for ANY was withdrawn in 1994. The fact that RFC 3852 was published in 2004, some 10 years later, stands as a testimonial to how much of an upheaval that withdrawal caused. Versions of Attribute based on the use of the CLASS type and parameterization are starting to appear as well; see the ASN.1 module for PKCS #7 V1.6 as an example. However, the definition from RFC 3852 will be sufficient for the purposes here.
As you can see, the Attribute structure is basically a tagged SET , the content of which is determined by the OBJECT IDENTIFIER in the attrType field.
In the case of most block ciphers, such as AES in CBC mode, the only parameter value that is likely to be required in the parameters field of an AlgorithmIdentifier representing an encoding is the IV, and for most algorithms, it is defined as:
IvParam ::= OCTET STRING
So how do you convert an IV into its ASN.1 binary encoding using the JCA? Let's take a look at one approach.
Try It Out: Encoding an IV with ASN.1
Here is a basic example that uses an IvParameterSpec and an AlgorithmParameters object to create an ASN.1 binary encoding of an IV. Try running it.
package chapter5; import java.security.AlgorithmParameters; import javax.crypto.spec.IvParameterSpec; import org.bouncycastle.asn1.ASN1InputStream; import org.bouncycastle.asn1.util.ASN1Dump; /** * Example showing IV encoding */ public class IVExample { public static void main(String[] args) throws Exception { // set up the parameters object AlgorithmParameters params = AlgorithmParameters.getInstance( "AES", "BC"); IvParameterSpec ivSpec = new IvParameterSpec(new byte[16]); params.init(ivSpec); // look at the ASN.1 encodng. ASN1InputStream aIn = new ASN1InputStream(params.getEncoded("ASN.1")); System.out.println(ASN1Dump.dumpAsString(aIn.readObject())); } }
When you run the example, you should see the following output:
DER Octet String[16]
This output conforms to the ASN.1 description you saw for an IV earlier.
How It Works
The AlgorithmParameters class is the key to generating ASN.1 binary encodings for parameters. In this case, you have initialized the params object with an IvParameterSpec containing the IV you want to produce an encoding for. Then you called AlgorithmParameters.getEncoded() , explicitly requesting an ASN.1 binary encoding.
As you have already seen, you can also recover the AlgorithmParameters object for a particular cipher you have just used by calling Cipher.getParameters() , which will return an object that is already initialized. Likewise, this returned object's getEncoded() method will also return the ASN.1 binary encoding for the parameters. You will see an example of this a bit later.
I mentioned in the last chapter that PKCS #1 V1.5 signatures also included a structure around the hash, in addition to the padding that was applied. Like the IV parameters, the structure is very simple and is known as a DigestInfo object. It holds details of the message digest algorithm used to create the hash in the signature, as well as the actual bytes making up the hash that was calculated during the signing process. When a signature is sealed with a private key, the hash it contains is exported as the DER encoding of a DigestInfo structure. It is this encoded string of bytes that then has padding applied before encryption with the private key produces the final signature.
Earlier in this chapter, you looked at the DigestInfo structure when I was discussing the use of the ASN.1 CLASS type in the definition of AlgorithmIdentifier . The structure was defined as follows :
DigestInfo ::= SEQUENCE{ digestAlgorithm DigestAlgorithm, digest OCTET STRING } DigestAlgorithm ::= AlgorithmIdentifier { {PKCS1-v1-5DigestAlgorithms} }
As you can see, the DigestAlgorithm type is an AlgorithmIdentifier . There is one twist here, though; the extra bit at the end in the braces, namely:
{ {PKCS1-v1-5DigestAlgorithms} }
told you something about this particular extension of AlgorithmIdentifier . Its set of possible values comes from another structure called PKCS1-v1-5DigestAlgorithms , which consists of a list of object identifiers, parameter pairs that represent the current range of PKCS #1 V1.5 signature types supported by PKCS #1. I won't repeat the possible values here, as you can find them in the original discussion on the CLASS type; however, I will mention that is the encoded form of the possible values listed in PKCS1v1-5DigestAlgorithms , which you will find inside the plaintext of PKCS #1 V1.5 signatures. So much for the background; you'll see now if that is the case.
Try It Out: Looking Inside a PKCS #1 V1.5 Signature
Try the following example. As you can see, it uses the regular Signature class to create a byte array containing a signature created using SHA-256 and RSA. However, in the verification part, it uses a Cipher to unlock the signature and then parses the structure contained in the decrypted block, checking the section containing the hash that was calculated when the signature was created against one generated for the same data using SHA-256.
package chapter5; import java.security.*; import javax.crypto.Cipher; import org.bouncycastle.asn1.ASN1InputStream; import org.bouncycastle.asn1.ASN1OctetString; import org.bouncycastle.asn1.ASN1Sequence; import org.bouncycastle.asn1.util.ASN1Dump; /** * Basic class for exploring PKCS #1 V1.5 Signatures. */ public class PKCS1SigEncodingExample { public static void main(String[] args) throws Exception { KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA", "BC"); keyGen.initialize(512, new SecureRandom()); KeyPair keyPair = keyGen.generateKeyPair(); Signature signature = Signature.getInstance("SHA256withRSA", "BC"); // generate a signature signature.initSign(keyPair.getPrivate()); byte[] message = new byte[] { (byte)'a', (byte)'b', (byte)'c' }; signature.update(message); byte[] sigBytes = signature.sign(); // verify hash in signature Cipher cipher = Cipher.getInstance("RSA/None/PKCS1Padding", "BC"); cipher.init(Cipher.DECRYPT_MODE, keyPair.getPublic()); byte[] decSig = cipher.doFinal(sigBytes); // parse the signature ASN1InputStream aIn = new ASN1InputStream(decSig); ASN1Sequence seq = (ASN1Sequence)aIn.readObject(); System.out.println(ASN1Dump.dumpAsString(seq)); // grab a digest of the correct type MessageDigest hash = MessageDigest.getInstance("SHA-256", "BC"); hash.update(message); ASN1OctetString sigHash = (ASN1OctetString)seq.getObjectAt(1); if (MessageDigest.isEqual(hash.digest(), sigHash.getOctets())) { System.out.println("hash verification succeeded"); } else { System.out.println("hash verification failed"); } } }
Running the example, you should see the following:
DER Sequence DER Sequence ObjectIdentifier(2.16.840.1.101.3.4.2.1) NULL DER Octet String[32] hash verification succeeded
So you found the correct hash value and the signature hash verified as expected. Looking at the dump, you can see the OBJECT IDENTIFIER value for SHA-256 and then a 20-byte OCTET STRING , which is the actual SHA-256 hash that was calculated.
How It Works
As I mentioned earlier, the byte array that gets padded during signature calculation is actually a DER encoding of a DigestInfo object. The signature is then a representation of the padded DER encoding that has been encrypted with the private key. Decrypting the signature with the public key gives you back this DER-encoded stream, and if you look at the section of the output representing the ASN.1 dump, you can see that stream produces at the top level a single sequence that contains two objects, the first of which is itself a sequence.
If you look back at the definition for an AlgorithmIdentifier , you can see that the OBJECT IDENTIFIER giving the value for algorithm field is 2.16.840.1.101.3.4.2.1. If you look it up in a registry of identifiers, you will discover this is for the algorithm SHA-256. The other thing you can tell from the dump is that the parameters field in the AlgorithmIdentifier is the value NULL , which you would expect, as the digest does not require any input other than the data it is supposed to verify. Of course, it could have been left out altogether because the field is optional, but this is another one of those moments where you have to allow for history.
Although PSS signatures themselves do not contain an ASN.1 structure, they do have algorithm parameters. PSS algorithm parameters are interesting to look at, because it possible for every field in their corresponding ASN.1 structure to be set to their default values. The structure used for PSS parameters is defined in PKCS #1 and, after some simplifying, looks something like this:
RSASSA-PSS-params ::= SEQUENCE { hashAlgorithm [0] HashAlgorithm DEFAULT sha1, maskGenAlgorithm [1] MaskGenAlgorithm DEFAULT mgf1SHA1, saltLength [2] INTEGER DEFAULT 20, trailerField [3] TrailerField DEFAULT trailerFieldBC } HashAlgorithm ::= AlgorithmIdentifier MaskGenAlgorithm ::= AlgorithmIdentifier TrailerField ::= INTEGER
I won't go into the specifics of the default values here, but they are also the ones represented by PSSParameterSpec.DEFAULT , so you would expect that creating a PSS signature with the default parameter set and retrieving its AlgorithmParameters would produce an empty SEQUENCE in its ASN.1 binary encoding.
Try It Out: Encoding PSS Parameters
Here is a simple example using parameters with the Signature class that allows you to have a look at the encodings being produced. Strictly speaking, the setting of the default parameters is not necessary, as the Signature.getInstance() method returns a Signature object that already has parameters set. However, it does show how the use of algorithm parameters is different with the Signature class compared to the Cipher class. Have a look at the example, run it, and see what it produces.
package chapter5; import java.security.AlgorithmParameters; import java.security.Signature; import java.security.spec.PSSParameterSpec; import org.bouncycastle.asn1.ASN1InputStream; import org.bouncycastle.asn1.util.ASN1Dump; /** * Example showing PSS parameter recovery and encoding */ public class PSSParamExample { public static void main(String[] args) throws Exception { Signature signature = Signature.getInstance("SHA1withRSAandMGF1", "BC"); // set the default parameters signature.setParameter(PSSParameterSpec.DEFAULT); // get the default parameters AlgorithmParameters params = signature.getParameters(); // look at the ASN.1 encodng. ASN1InputStream aIn = new ASN1InputStream(params.getEncoded("ASN.1")); System.out.println(ASN1Dump.dumpAsString(aIn.readObject())); } }
Running the example produces the following output:
DER Sequence
indicating you have an empty sequence.
How It Works
The call to Signature.getParameters() returns an AlgorithmParameters object that is set to contain the default parameters for creating a PSS signature. As they are default parameters, you would expect none of the fields in the RSASSA-PSS-params to be included in the encoding, and consequently the SEQUENCE will be empty, which is what the output indicates.
An interesting thing to do here is to change one of the parameters and see how the encoding changes. In Chapter 4 I mentioned that PSS signatures can be created with a zero salt size . You can configure the Signature object used in the example by changing the call to setParameter() from
signature.setParameter(PSSParameterSpec.DEFAULT);
to
signature.setParameter(new PSSParameterSpec(0));
You should see the following output:
DER Sequence Tagged [2] Integer(0)
This output indicates that the sequence is no longer empty. It is now carrying a 0 value for the saltLength field, which has a default value of 20.
I have already touched on the fact that the encoded forms of public and private keys contain a considerable amount of structure in them, and as it happens, the language used for describing these structures is ASN.1. Looking at it in the same manner as with other Java specification objects, an encoded form of a key is simply a value object, so as you would imagine, the JCA provides wrapping objects that can wrap the encoded forms and then be used to convert them back into keys using the KeyFactory class.
Because there are different ASN.1 structures built for handling public and private keys, the JCA provides two classes for wrapping key encodings. The first one you will look at, used for wrapping public key encodings, is the X509EncodedKeySpec. The second one, used for wrapping private key encodings, is the PKCS8EncodedKeySpec .
The X509EncodedKeySpec Class
The java.security.spec.X509EncodedKeySpec class takes its name from the origins of the structure used to wrap public keys. It has a single constructor on it that takes a byte array that should contain a DER encoding of the structure that appears in the key block of an X.509 certificate. This is the encoding that should be returned by a public key that has a return value for Key.getFormat() of X.509.
The structure for representing a public key was also defined in X.509 and is named SubjectPublicKeyInfo . In ASN.1 it appears as follows:
SubjectPublicKeyInfo ::= SEQUENCE { algorithm AlgorithmIdentifier, subjectPublicKey BIT STRING }
You can see it has two elements: an AlgorithmIdentifier , which in this case is used to signify what algorithm the key is for, and then a BIT STRING , which is used to store an encoding of the key material.
The reason for the BIT STRING is that, as you have seen already, asymmetric keys generally require different parameters depending on the algorithm, and as it should be possible to use the same basic structure to wrap anything from elliptic curve to RSA keys, a BIT STRING was settled on as the most general object to use. So, while the examples that follow will deal only with RSA keys, the principles can be applied to the encoding of any public key. It is just a matter of knowing what underlying structure goes in the subjectPublicKey field.
So, how do you deal with RSA public keys? As it turns out, X.509 also defined a structure for RSA public keys, which is also included in PKCS1. The ASN.1 definition is
RSAPublicKey ::= SEQUENCE { modulus INTEGER, publicExponent INTEGER }
and the subjectPublicKey field in a SubjectPublicKeyInfo structure is simply a BIT STRING wrapping a DER encoding of the previous structure.
This leaves you with the algorithm field. You need a specific AlgorithmIdentifier to indicate that the content of the subjectPublicKey field is an RSA public key. In the case of RSA, the OBJECT IDENTIFIER you use in the algorithm field of the AlgorithmIdentifier is
rsaEncryption OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1 }
and the parameters are defined as having the value NULL . (Remember, this is very different from empty; this means the parameters field is expected to have the NULL value in it.) Using the Bouncy Castle APIs, the Java equivalent for the AlgorithmIdentifier would be
AlgorithmIdentifier rsaKey = new AlgorithmIdentifier( PKCSObjectIdentifiers.rsaEncryption, new DERNull());
So when Key.getEncoded() is called on an RSA public key, the key material is encoded into the ASN.1 RSAPublicKey structure, the DER encoding of the structure is then converted into a BIT STRING , and the resulting BIT STRING and the RSA-specific AlgorithmIdentifier are then used to assemble the SubjectPublicKeyInfo object. The SubjectPublicKeyInfo object is then written out as a DERencoded stream and returned in a byte array.
So having retrieved the byte array from Key.getEncoded() , how do you convert it back into a public key? You will find out now.
Try It Out: Using the X509EncodedKeySpec
Try the following example. It generates a small RSA key pair and then takes the output of Key.getEncoded() for the public key and uses it to create an X509EncodedKeySpec , which is then used to regenerate the original key. Along the way, it uses Bouncy Castle's ASN.1 package to dump out the underlying structure, so you can compare what gets generated to the previous discussion.
package chapter5; import java.security.*; import java.security.spec.X509EncodedKeySpec; import org.bouncycastle.asn1.ASN1InputStream; import org.bouncycastle.asn1.util.ASN1Dump; import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; /** * Simple example showing use of X509EncodedKeySpec */ public class X509EncodedKeySpecExample { public static void main(String[] args) throws Exception { // create the keys KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA", "BC"); generator.initialize(128, Utils.createFixedRandom()); KeyPair pair = generator.generateKeyPair(); // dump public key ASN1InputStream aIn = new ASN1InputStream( pair.getPublic().getEncoded()); SubjectPublicKeyInfo info = SubjectPublicKeyInfo.getInstance( aIn.readObject()); System.out.println(ASN1Dump.dumpAsString(info)); System.out.println(ASN1Dump.dumpAsString( info .getPublicKey())); // create from specification X509EncodedKeySpec x509Spec = new X509EncodedKeySpec( pair.getPublic().getEncoded()); KeyFactory keyFact = KeyFactory.getInstance("RSA", "BC"); PublicKey pubKey = keyFact.generatePublic(x509Spec); if (pubKey.equals(pair.getPublic())) { System.out.println("key recovery successful"); } else { System.out.println("key recovery failed"); } } }
You should see something like the following output:
DER Sequence DER Sequence ObjectIdentifier(1.2.840.113549.1.1.1) NULL DER Bit String[26, 0] DER Sequence Integer(193768625448396182147878757503948840199) Integer(65537) key recovery successful
As you can see from the ASN.1 dump information, the SubjectPublicKeyInfo structure (the first sequence) and the ASN.1 RSAPublicKey structure (the second sequence) are what we expected. Recreating the key has worked as well.
How It Works
You used the org.bouncycastle.asn1.x509.SubjectPublicKeyInfo object in the example to make life easier for yourself in reconstructing the encoded public key so you can print its contents. Like any class in the org.bouncycastle.asn1.x509 package, it is simply a value object. The main reason you use it here is that it has a convenient method called SubjectPublicKeyInfo.getPublicKey() that reconstructs the ASN.1 object encoded in the subjectPublicKey field of the ASN.1 structure.
The next step in the example is the creation of the X509EncodedKeySpec from the same encoded information that you just dumped. As you did with the other key specification objects for asymmetric algorithms, you simply create a KeyFactory of the right type and call the KeyFactory.generatePublic() method to create the public key.
The string representation of the object identifier can also be used to create the SecretKeyFactory . For example, rather than creating the SecretKeyFactory with the line:
KeyFactory keyFact = KeyFactory.getInstance("RSA", "BC");
you could have instead written
KeyFactory keyFact = KeyFactory.getInstance( info.getAlgorithmId().getObjectId().getId(), "BC");
This can be very useful if you do not know the name of the algorithm beforehand, or in situations where you may have a variety of different types of encoded key types and you are trying to minimize the amount of code required to handle them.
The PKCS8EncodedKeySpec Class
Like the X509EncodedKeySpec class, the java.security.spec.PKCS8EncodedKeySpec class also takes its name from the standard responsible for it. RSA Security's PKCS #8 entitled "Private Key Information Syntax" deals with encoding private keys, both with and without encryption, and the PKCS8EncodedKeySpec is designed to deal with private keys that have not been encrypted.
PrivateKeyInfo is the name of the structure for dealing with encoded private keys that have not been encrypted. Calling Key.getEncoded() on an object representing a private key that returns PKCS#8 if you call Key.getFormat() will return the DER encoding of a PrivateKeyInfo structure representing the material required to construct the private key.
The full definition of PrivateKeyInfo , defined in PKCS #8, reads as follows:
PrivateKeyInfo ::= SEQUENCE { version Version, privateKeyAlgorithm PrivateKeyAlgorithmIdentifier, privateKey PrivateKey, attributes [0] IMPLICIT Attributes OPTIONAL } Version ::= INTEGER {v1(0)} PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier PrivateKey ::= OCTET STRING Attributes ::= SET OF Attribute
A look through the ASN.1 tells you a few things: The version number is currently always zero; the type PrivateKeyAlgorithmIdentifier is a renaming of AlgorithmIdentifier , which in this case is a similar structure to the one you are used to; and the privateKey field contains an OCTET STRING .
Note that the attributes field is implicitly tagged with the value zero. Assuming you had an ASN1Sequence object, called seq , that represented a PrivateKeyInfo object, you would need to take the implicit tagging into account, and the optional nature of the field with some code like this:
if (seq.size() == 4) { attributes = ASN1Set.getInstance( (ASN1TaggedObject)seq.getObjectAt(3), false); }
First you check if the attributes field is present. If it is, you recover the ASN1Set that the attributes field represents by using the static ASN1Set.getInstance() method for tagged objects and set the second argument, which determines the type of tagging to use, to false . The false parameter indicates implicit tagging. As I mentioned before, this is important because if the attributes field has only one element in its SET , attempting to parse the field assuming explicit tagging will make the field appear to be an explicitly tagged version of the structure represented by the element. The fact it is meant to be a SET containing that element will disappear.
So take a look at what happens when you try to wrap an RSA private key in a PrivateKeyInfo structure. First, the privateKeyAlgorithm field holds the same contents as the algorithm field in the SubjectPublicKeyInfo field for an RSA public key(you use the OBJECT IDENTIFIER rsaEncryption with the parameters field set to NULL . As with the RSA public key, there needs to be another structure to provide a DER-encoded object to go in the OCTET STRING represented by the privateKey field of the PrivateKeyInfo structure. In the case of an RSA private key, PKCS #1 defines a structure called RSAPrivateKey , which looks as follows:
RSAPrivateKey ::= SEQUENCE { version Version, modulus INTEGER, publicExponent INTEGER, privateExponent INTEGER, prime1 INTEGER, prime2 INTEGER, exponent1 INTEGER, exponent2 INTEGER, coefficient INTEGER, otherPrimeInfos OtherPrimeInfos OPTIONAL } Version ::= INTEGER { two-prime(0), multi(1) } (CONSTRAINED BY {-- version must be multi if otherPrimeInfos present --}) OtherPrimeInfos ::= SEQUENCE SIZE(1..MAX) OF OtherPrimeInfo OtherPrimeInfo ::= SEQUENCE { prime INTEGER, exponent INTEGER, coefficient INTEGER }
The structure is pretty close to what you would expect. You have a collection of INTEGER objects representing a regular RSA private key that uses Chinese Remainder Theorem and an optional extra field for a sequence of extra values on the end in case the key is a multi-prime one. The value MAX is applicationdependent, but you can expect in most provider implementations it will be big enough for the number of OtherPrimeInfo structures held by any encoded keys you are using.
More formally , a look at the comment in the constraints on the Version value tells us that a call to Key.getEncoded() on a Java object implementing RSAPrivateCrtKey should produce a two-prime version with the version field set to 0. An RSAMultiPrimePrivateCrtKey , on the other hand, will produce a multiversion with the version field set to 1 with the extra coefficients for a multi-prime RSA private key in the sequence represented by otherPrimeInfos . If it was a multi-prime key, you will find that the OtherPrimeInfo structures making up the sequence have the values corresponding to those in the RSAOtherPrimeInfo objects associated with the Java instance of the key.
So, how do you use this knowledge in Java? The first thing you should look at is the mechanism for creating a private key using a KeyFactory . As you would expect, it is just the same as for a public key. Given a Java object privKey , which implements the RSAPrivateKey interface, you can create a PKCS8EncodedKeySpec by writing
PKCS8EncodedKeySpec pkcs8Spec = new PKCS8EncodedKeySpec(privKey.getEncoded());
Having created the pkcs8Spec object, you can then re-create the private key as follows:
KeyFactory keyFact = KeyFactory.getInstance("RSA", "BC"); PrivateKey priv = keyFact.generatePrivate(pkcs8Spec);
The Bouncy Castle APIs also provide a wrapper class that allows you to dump the internals of the structure returned by the encoding of a private key. You can find the class in the org.bouncycastle.asn1.pkcs package and its name is PrivateKeyInfo . If you wanted to try dumping the contents of Key.getEncoded() for an object implementing the PrivateKey interface, you could use the following code fragment:
ASN1InputStream aIn = new ASN1InputStream(priv.getEncoded()); PrivateKeyInfo info = PrivateKeyInfo.getInstance(aIn.readObject()); System.out.println(ASN1Dump.dumpAsString(info)); System.out.println(ASN1Dump.dumpAsString(info.getPrivateKey()));
and you should see the contents of the PrivateKeyInfo structure printed out, followed by the contents of the structure encoded in the string of octets contained in the privateKey field of the PrivateKeyInfo structure.
When you are exporting private keys, the normal reason is to make them available to another application, or perhaps persist them on disk. Given that it is a private key you are dealing with in this case, you will often want to encrypt the DER-encoded data representing the private key as well. PKCS #8 also provides a structure for putting together an encrypted coding for a key. It builds on the PrivateKeyInfo object, and the JCE provides a class that allows you to construct and manipulate the encrypted coding directly. The class you use for this is the EncryptedPrivateKeyInfo class.
The EncryptedPrivateKeyInfo Class
The javax.security.EncryptedPrivateKeyInfo class allows you to package encrypted private key data with details of the encryption algorithm used to create it. The class takes its name from a structure of the same name defined in PKCS #8, where it is defined as follows:
EncryptedPrivateKeyInfo ::= SEQUENCE { encryptionAlgorithm AlgorithmIdentifier, encryptedData EncryptedData } EncryptedData ::= OCTET STRING
Other than the fact that the octets held in the encryptedData field represent an encrypted encoding of a PrivateKeyInfo object, this is a very simple structure. You have the encryptionAlgorithm field, which contains an AlgorithmIdentifier describing the algorithm used for encryption and any parameters that might need to be passed to another cipher trying to implement the same algorithm, and then you have the encrypted data enclosed in an OCTET STRING .
You'll now review some of the methods on the EncryptedPrivateKeyInfo class so you can see how it is built on top of the PKCS #8 EncryptedPrivateKeyInfo structure.
EncryptedPrivateKeyInfo()
The EncryptedPrivateKeyInfo class has three constructors on it. One is used to create the object from a byte array that contains an ASN.1-encoded PKCS #8 EncryptedPrivateKeyInfo structure. The other two are used for creating an EncryptedPrivateKeyInfo object that will be used to produce the ASN.1 binary encoding of the structure in PKCS #8.
Encrypted Private KeyInfo.get Alg Parameters()
This method returns an AlgorithmParameters object, which carries the parameters information that is needed, together with the key to initialize the cipher used to decrypt the private key. As you have probably already guessed, this is the same information that is carried in the parameters field of the AlgorithmIdentifier in the PKCS #8 EncryptedPrivateKeyInfo structure.
Encrypted Private Key Info.get Key Spec()
The getKeySpec() method takes an appropriately initialized cipher and returns a PKCS8EncodedKeySpec that contains the encoding for the PKCS #8 PrivateKeyInfo object that was encrypted when the EncryptedPrivateKeyInfo object was created. You can then pass the key specification to a KeyFactory and create a private key suitable for use with the provider you are using.
Encrypted Private Key Info.get Encoded()
This method returns the ASN.1 binary encoding of the EncryptedPrivateKeyInfo structure defined in PKCS #8 as a byte array. If you are exporting one of these objects, the data returned by this method is the one you want to use. Do not confuse getEncoded() with the EncryptedPrivateKeyInfo.getEncryptedData() method. That method only returns the value of the encryptedData field, so, as you would expect, it does not include any of the information about the encryption algorithm used.
Now take a look at how this all goes together.
Try It Out: Using EncryptedPrivateKeyInfo and PBE
The following example builds not only on the discussion of the PKCS8EncodedKeySpec and the EncryptedPrivateKeyInfo class, but also on the previous discussion about the AlgorithmParameters class and password-based encryption. Try running it and then read on.
package chapter5; import java.security.*; import java.security.spec.PKCS8EncodedKeySpec; import javax.crypto.Cipher; import javax.crypto.EncryptedPrivateKeyInfo; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; /** * Simple example showing how to use PBE and an EncryptedPrivateKeyInfo object. */ public class EncryptedPrivateKeyInfoExample { public static void main(String[] args) throws Exception { // generate a key pair KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "BC"); kpg.initialize(128, Utils.createFixedRandom()); KeyPair pair = kpg.generateKeyPair(); // wrapping step char[] password = "hello".toCharArray(); byte[] salt = new byte[20]; int iCount = 100; String pbeAlgorithm = "PBEWithSHAAnd3-KeyTripleDES-CBC"; PBEKeySpec pbeKeySpec = new PBEKeySpec(password, salt, iCount); SecretKeyFactory secretKeyFact = SecretKeyFactory.getInstance( pbeAlgorithm, "BC"); Cipher cipher = Cipher.getInstance(pbeAlgorithm, "BC"); cipher.init(Cipher.WRAP_MODE, secretKeyFact.generateSecret(pbeKeySpec)); byte[] wrappedKey = cipher.wrap(pair.getPrivate()); // create carrier EncryptedPrivateKeyInfo pInfo = new EncryptedPrivateKeyInfo( cipher.getParameters(), wrappedKey); // unwrapping step - note we only use the password pbeKeySpec = new PBEKeySpec(password); cipher = Cipher.getInstance(pInfo.getAlgName(), "BC"); cipher.init(Cipher.DECRYPT_MODE, secretKeyFact.generateSecret(pbeKeySpec), pInfo.getAlgParameters()); PKCS8EncodedKeySpec pkcs8Spec = pInfo.getKeySpec(cipher); KeyFactory keyFact = KeyFactory.getInstance("RSA", "BC"); PrivateKey privKey = keyFact.generatePrivate(pkcs8Spec); if (privKey.equals(pair.getPrivate())) { System.out.println("key recovery successful"); } else { System.out.println("key recovery failed"); } } }
Assuming all went according to plan, running the example will produce the message:
key recovery successful
As usual, the RSA key size is absurdly small for reasons that it will fit better when you look at the ASN.1 structures a bit further on. Other than that, after the key generation, there is a lot going on. Therefore, you will work through the example step-by-step.
How It Works
The first stage is familiar from the discussion in Chapter 2 about password-based encryption and the discussion on key wrapping in Chapter 4. You set up a PBEKeySpec , create a SecretKeyFactory to handle it using the PKCS #12 algorithm PBEWithSHAAnd3 -KeyTripleDES-CBC. The PBE algorithm uses a mixing function similar to the one you looked at in Chapter 3 and SHA-1 to create three DES keys and an IV, which are then used to initialize a Triple-DES cipher operating in CBC mode.
Having initialized the Cipher object appropriately with the key generated by the SecretKeyFactory , you then used the Cipher.wrap() method to create the byte array that contains the encrypted version of the encoding of the private key. Next, you construct the EncryptedPrivateKeyInfo in the following manner:
EncryptedPrivateKeyInfo pInfo = new EncryptedPrivateKeyInfo( cipher.getParameters(), wrappedKey);
As you saw earlier, Cipher.getParameters() returns an AlgorithmParameters object. One feature of this object is that it has an AlgorithmParameters.getEncoded() method on it that returns an encoded form of the parameters it contains. In this case, the getEncoded() method returns the DER encoding of the following structure, which is defined in PKCS #12:
pkcs-12PbeParams ::= SEQUENCE { salt OCTET STRING, iterations INTEGER }
The pkcs-12PbeParams structure carries the salt and the iteration count that you initialized the PBEKeySpec object, pbeKeySpec , with. It is the SEQUENCE represented by the pkcs-12PbeParams structure that serves as the parameters field in the AlgorithmIdentifier contained in the encryptionAlgorithm field of the PKCS #8 EncryptedPrivateKeyInfo object. You can dump out this structure by adding
System.out.println(ASN1Dump.dumpAsString( new ASN1InputStream(cipher.getParameters().getEncoded()).readObject()));
which will produce the following extra output:
DER Sequence DER Octet String[20] Integer(100)
As you can see the iteration count is 100, and if you dumped out the contents of the OCTET STRING , you would find it contained the bytes making up the salt that you passed in to the PBEKeySpec originally.
The only apparently missing ingredient is the OBJECT IDENTIFIER that is required to populate the algorithm field contained in the AlgorithmIdentifier inside the encryptionAlgorithm field. Funnily enough if you were to add
System.out.println(cipher.getParameters().getAlgorithm());
to the line after the call to cipher.wrap() in the example, you would see the following extra line printed in the output:
1.2.840.113549.1.12.1.3
which happens to be the value of the OBJECT IDENTIFIER defined in PKCS #12 for PBEWithSHAAnd3-KeyTripleDES-CBC. This last piece of information then allows the EncryptedPrivateKeyInfo object you are creating to fill in the encryptionAlgorithm field of the ASN.1 structure it contains.
The last step in the example is where you recover the encrypted private key that is stored in pInfo , our EncryptedPrivateKeyInfo object. In this case, you only have to initialize the PBEKeySpec as follows:
pbeKeySpec = new PBEKeySpec(password);
as the other parameters are stored in the AlgorithmParameters object that is extracted from the EncryptedPrivateKeyInfo object. After the pbeKeySpec is converted to a key and the cipher is initialized for decryption, a PKCS8EncodedKeySpec is retrieved from the EncryptedPrivateKeyInfo object and the original private key is recovered. As you would expect adding the following lines:
ASN1InputStream aIn = new ASN1InputStream(pkcs8Spec.getEncoded()); PrivateKeyInfo info = PrivateKeyInfo.getInstance(aIn.readObject()); System.out.println(ASN1Dump.dumpAsString(info)); System.out.println(ASN1Dump.dumpAsString(info.getPrivateKey()));
after the point where pkcs8Spec is set produces the following extra output:
DER Sequence Integer(0) DER Sequence ObjectIdentifier(1.2.840.113549.1.1.1) NULL DER Octet String[100] DER Sequence Integer(0) Integer(193768625448396182147878757503948840199) Integer(65537) Integer(176280162144807927893221216887705181313) Integer(16432478544733070881) Integer(11791807603515952679) Integer(5879506071310035233) Integer(6852660091055565157) Integer(6468103171312594380)
The first ASN.1 dump is that of the PrivateKeyInfo structure, and it contains an AlgorithmIdentifier structure whose algorithm field has been set to the OBJECT IDENTIFIER for RSA encryption, indicating that the PrivateKeyInfo structure contains an RSA key. The second ASN.1 dump is the private key encoded as a version 0 RSAPrivateKey structure from PKCS #1, which simply contains the value making up the private key in much the same way as the RSAPrivateCrtKeySpec class does.
There is one thing in the example worth further discussion. When you created the encrypted byte array to initialize the EncryptedPrivateKeyInfo object with, you did the following:
cipher.init(Cipher.WRAP_MODE, secretKeyFact.generateSecret(pbeKeySpec)); byte[] wrappedKey = cipher.wrap(pair.getPrivate());
which returns a byte array containing the encrypted form of the ASN.1-encoded PrivateKeyInfo object that was returned by the private key's Key.getEncoded() method. You could have used the following instead:
cipher.init(Cipher.ENCRYPT_MODE, secretKeyFact.generateSecret(pbeKeySpec)); byte[] wrappedKey = cipher.doFinal(pair.getPrivate().getEncoded());
The reason this was not done is to draw attention to the fact that if you were using a provider based on a hardware cryptographic device and the device has been set up not to publish private keys outside of it ”often the very reason for having one ” Key.getEncoded() on the private key might actually return null because the device forbids the operation. The reason this might happen is that the provider will be expecting developers to use the wrapping mechanism instead, as it allows the provider to encrypt the private key information before it leaves the safety of the device.
This chapter looked at ASN.1, its binary encodings, and how they are used by a variety of classes in the JCA and JCE to allow you to pass data structures around in an application-independent manner. Building on this, you have also had a closer look at how public and private keys are encoded and how to make use of the EncryptedPrivateKeyInfo class.
Over the course of the chapter, you learned
ASN.1 has uses that go well beyond just the encoding of algorithm parameters and asymmetric keys. It is also used to provide messaging formats and provides the method for encoding X.509 certificates, which are a fundamental part of most public key infrastructure (PKI) solutions. The next chapter looks at how X.509 certificates are constructed , as well as how to use the JCA classes that support them.
Answers
Introduction
|
https://flylib.com/books/en/1.274.1/object_description_in_cryptography_using_asn1.html
|
CC-MAIN-2022-21
|
refinedweb
| 17,306
| 53.1
|
java.lang.Object
weblogic.cluster.singleton.SimpleLeasingBasisweblogic.cluster.singleton.SimpleLeasingBasis
weblogic.cluster.singleton.ReplicatedLeasingBasisweblogic.cluster.singleton.ReplicatedLeasingBasis
public class ReplicatedLeasingBasis
LeasingBasis that delegates to replicated remote instances.
Lampson and others advocate that high-performance,
high-availability distributed systems utilize hierarchical lease
managers. The reasoning is that consensus algorithms are generally
slow and costly - this is true of both Paxos and our
DatabaseLeasingBasis - and therefore cannot accomdate fast
failover. Instead the primordial lease manager (PLM), is identified
utilizing Paxos or some other consensus mechanism and long leases,
and is used to manage short leases for some other master lease
manager we shall call the hierarchical lease manager (HLM). The
general principal is that the identification of the PLM is slow but
does not rely on singleton state. The HLM is essentially singleton
state that is managed through leases rather than consensus and can
therefore be fast. The HLM owns the state for the duration of its
lease. It may replicate that state elsewhere, or write it to stable
storage, for fault-tolerance but it is still the owner for the
duration of the lease. Other parties with some interest in the
state agree to abide by the lease interval also avoiding
split-brain syndrome.
In order for failover of the HLM to occur failure must be detected and a new HLM elected. The new HLM needs to have access to the old HLM's state. The HLM is leasing relatively quickly and so missed heartbeats can be detected relatively quickly. The new HLM can be elected by other candidate HLM's constantly trying to aquire the HLM lease from the PLM. The candidate HLM's can have access to the primary HLM's state through a replication framework.
In the caching scenario the HLM is not really a lease manager but instead contains partition location information. A client would manipulate a paritioned map by first inquiring of the HLM where a partition resides. Once the location information is known the partition is contacted directly. In order to provide fault tolerance the partition state needs to be synchronously replicated and the HLM needs to determine which copy is the copy-of-record. This can be achieved once again by the primary and secondary leasing against the HLM. This is exactly the scenario we just described for the HLM. One might wonder why we cannot collapse the partition leasing into the HLM and indeed we can, the issue is one of scalability.and fault-tolerance.
Let us consider the case of the partition owners leasing directly against the PLM first. Any cache operation first needs to determine the partition location and then perform the operation. Determining the partition location means that either (a) the caller contacts the PLM to get this or, (b) the partition table is replicated to all servers. (a) is clearly a single point-of-failure. The partition table would have to be maintained in stable storage and the failover time would equate to the server reboot time for the PLM. (b) is a non-sequitur, the state can be replicated, but it cannot be consulted since all copies are, apart from that of the PLM, not authoritative. For the replicated copies to be authoritative the consensus algorithm would have to be run on the partition table itself - a costly operation.
Let us now consider the case of the partition owners leasing against the HLM which in turn leases against the PLM. Partition location information would be determined by contacting the HLM. How does a server know where the HLM resides? In the first instance the server gets this from the PLM. This is not a lease, merely a bootstrap to the HLM. Once the HLM (and the HLM's secondary) is located a server does not need to contact the PLM again unless both the HLM and HLM secondary fail simultaneously. All well and good, but suppose the PLM fails instead. The master HLM's lease will expire and it will be unable to renew it. In this instance a failure detector can be used to determine the outcome of its current lease.
Failure detectors can be implemented in practice by having the failure detector probe each process regularly; an unresponsive process p is placed on the list and a broadcast message is sent to all processes (including p) announcing its death. If p is has not actually crashed, then it will eventually refute its death announcement. Chandra and Toueg show that this weak and unreliable model of failure detectors allows the consensus problem to be solved.
In our case it the master HLM should assume that the PLM has failed and announce it to interested parties. If the PLM has not failed then it will refute the claim, or if the PLM is not contactable by the master, but is contactable by the secondary then the secondary will refute the claim. In this case the master should relinquish its lease since the secondary will have already obtained the lease. If no-one refutes the claim then the master can continue to hold its lease until the consensus algorithm has elected a new PLM. For N HLM's we can tolerate N-1 failures. Thus if we want more reliability we need mor replicas.
public static final String BASIS_NAME
public ReplicatedLeasingBasis(String leaseType) throws IOException
IOException
protected static Map getReplicatedMap(String leaseType) throws IOException
IOException
|
https://docs.oracle.com/cd/E17904_01/apirefs.1111/e13941/weblogic/cluster/singleton/ReplicatedLeasingBasis.html
|
CC-MAIN-2019-35
|
refinedweb
| 896
| 52.9
|
Lorin Thwaits A geek says what? Lorin Thwaits Subtext 2009-01-02T09:34:37Z "Cannot connect SampleGrabber" error when using CapDVHS to capture Sony HDV video 2009-01-02T09:33:22-06:00:00 2009-01-02T09:34:37Z I've got a couple HDR-HC1 cameras, one from Japan and one from the US, and really like the video quality that comes out of 'em. As long as the scene is well-lit, the results are good.<br /> <br /> Annoyingly using CapDVHS I could only capture HDV video from the Japanese one. I haven't taken the time to figure out why until just today. It was easy enough in the past to just always used the Japanese camera to capture HDV content. Well, today I got curious and took a moment to figure out what the problem was. Very simple indeed, just the i.LINK CONV setting was ON when it should have been OFF. Here's what it should look like in the menu:<br /> <br /> <img alt="picture showing i.LINK CONV turned off in the menu of an HDR-HC1" src="" /><br /> <br /> After making that selection, instead of showing up in CapDVHS's list as "unknown video #1", it shows up as an HDR-HC1. And capturing works great!<img src="" width="1" height="1" /> 3 Galactic hookers likely mistake Earth for the nearby planet Aphroditius 2008-04-22T04:03:32-05:00:00 2008-04-22T20:37:59Z <p><font face="Arial">Four.)</font></p> <p><img alt="" src="" /></p> <p><font face="Arial".</font></p> <p><font face="Arial".</font></p> <p><font face="Arial".</font></p> <p>(OK, there is actually a little grain of truth to this story... Last night I witnessed <a href=""><strong>this phenomenon</strong></a>, which is now the second UFO sighting I've had. I just wanted to find a fun way to explain what the heck those pulsing red lights could be. Plus I didn't do anything interesting for April Fool's this year, until now!)<font face="Arial"></font></p><img src="" width="1" height="1" /> 5 My image got stretch marks 2008-03-27T04:26:10-05:00:00 2008-03-27T04:28:13Z <div>When playing back content from my 3D camcorder, if you aren't wearing shutter glasses then the result is pretty blurry and bland looking. After putting on the glasses, the scene jumps to life. So while putting together a sample photo to promote how it works, I wanted to superimpose a better 2D image, and stretch it over the existing image of a screen in the photo. It had been awhile since I've done anything real with math, so I took a half hour and figured out a couple equations to do the mapping, and wrote a program to do the translation for each of the pixels into the quasi-3D space of the monitor screen, ending up with this result:</div> <p><img alt="" src="" /></p> <p>(The superimposed image doesn't look that believable here, but when I resized the picture down a bit, it looked better.)</p> <p.</p> <p>Here's the formulas that do the mapping to create the result seen above:</p> <p>destX=((lrx - llx) * (srcX / srcWid) + llx - ((urx - ulx) * (srcX / srcWid) + ulx)) * (srcY / sHt) + (urx - ulx) * (srcX / srcWid) + ulx</p> <p>destY=((lry - ury) * (srcY / srcHt) + ury - ((lly - uly) * (srcY / srcHt) + uly)) * (srcX / sWd) + (lly - uly) * (srcY / srcHt) + uly</p> <p>And here's what all my crazy variable names mean:</p> <p><strong>srcWid</strong> = source image width<br /> <strong>srcHt</strong> = source image height<br /> <br /> <strong>srcX</strong> = source X coordinate<br /> <strong>srcY</strong> = source Y coordinate<br /> <strong>destX</strong> = destination X coordinate<br /> <strong>destY</strong> = destination Y coordinate<br /> <br /> Coordinates that define the location of the destination image:<br /> <strong>ulx</strong> = upper left corner of the image, x coordinate<br /> <strong>uly</strong> = upper left corner of the image, y coordinate<br /> <strong>urx</strong> = upper right corner of the image, x coordinate<br /> <strong>uly</strong> = upper right corner of the image, y coordinate<br /> <strong>llx</strong> = lower left corner of the image, x coordinate<br /> <strong>lly</strong> = lower left corner of the image, y coordinate<br /> <strong>lrx</strong> = lower right corner of the image, x coordinate<br /> <strong>lry</strong> = lower right corner of the image, y coordinate</p> <p.)</p> <p>Anyone out there a math whiz that can think of an easy way to "go the other way", in other words in the two equations above, <strong>solve for srcX and srcY</strong>? I found it kinda challenging. A fun brain challenge more than anything else. My hotshot math whiz brother may find the answer, who knows.</p><img src="" width="1" height="1" /> 1 3D Camcorder, anyone? 2008-03-12T02:22:30-05:00:00 2008-04-04T05:11:23Z <p><font face="Arial">If you have one of these, you can capture *amazing* full-color high definition 3D video:</font></p> <p><font face="Arial"><img alt="" src="" /></font></p> <p><font face="Arial">The general idea is:</font></p> <p><font face="Arial">1. Record a scene with two high definition camcorders running at the same time. Have them mounted on a </font><font face="Arial">board, pointed the same direction, and spaced about 1 foot apart.</font><font face="Arial"><br /> 2. Acquire the footage into a computer and edit the streams to synchronize them with each other </font><font face="Arial">to within 1/30 of a second. You now have two streams, one for the left eye </font><font face="Arial">and one for the right.<br /> 3. Use a filter to combine the two matched streams such that </font><font face="Arial">the left eye content is on top, and right eye content is on the bottom. This would normally end up with a pretty tall video, 1440x2160. But it has to be stretched back down to half the original height, 1440x1080.<br /> 4. On a computer with a CRT monitor (must be a high-end CRT, not LCD), set the </font><font face="Arial">resolution to SXGA+ (1400x1040), True Color, and 60Hz vertical refresh.<br /> 5. Put a frequency doubler inline on the video signal that makes the </font><font face="Arial">vertical refresh cook along at </font><font face="Arial">120Hz. Each frame being displayed is shown as a 1400x520 progressive slice, stretched to fit the whole screen. Some CRTs can't scan that fast, so you have to try out high-end units until you find one that can actually go that fast.<br /> 6. Synchronize LCD-based shutter glasses to oscillate between left eye and right eye along with the new 120Hz vertical refresh. Each eye gets 60 frames per second, and video is remarkably realistic, and looks really, really smooth.<br /> <br /> </font><font face="Arial">I'm considering also trying a setup with a couple LCD panels to display the video stream, along with mirrors to allow a person to see the playback. Something like this:</font></p> <p><img alt="" src="" /></p> <p><font face="Arial">I've submitted this contraption to be shown at the next <a href="">Maker Faire</a>,.</font></p><img src="" width="1" height="1" /> 4 Want to cut your electric bill by $300 a year? 2008-02-28T04:05:36-06:00:00 2008-02-28T14:09:51Z <p><font face="Arial">Over a million Japanese homes have a cutting-edge appliance that I'll bet you (along with 95% of America) have never even heard of. No -- it's not a singing toilet seat with a remote control, butt warmer, and built-in bidet. Why... here's one of those gleeking now:</font></p> <p><img alt="" src="" /></p> <p><font face="Arial">So I bet that most of you have heard about -- and some out there even used -- that particular Japanese contraption. Instead, the contraption I speak of is a heat pump that you add on to your water heater. It saves about $350 a year on the electric bill! The Japanese models are quite sleek, and resemble the condenser unit of a split air conditioner, as seen on the left in this picture:</font></p> <p><img alt="" src="" /></p> <p><font face="Arial">That larger thing to the right is the hot water tank itself. They make 'em rectangular over there, not cylindrical.</font></p> <p><font face="Arial">The Japanese models are fairly advanced, and the refrigerant of choice is actually not freon but instead CO2! You know the slight cooling effect you feel when you first crack open a 2 liter and the "air" rushes out of it? Well, that effect is put to work in a Japanese HPWH. Here's a diagram:</font></p> <p><img alt="" src="" /></p> <p><font face="Arial">They have a fun name for these CO2-based heat pump water heaters: "Eco Cute". And you know the Japanese -- when they're excited about something they draw up cartoons with corny mascots -- in this case "Tankman" and "Pumpu"!</font></p> <p><a href=""><img alt="" src="" /></a></p> <p><font face="Arial">Even though there are more than a million of these installed in Japan, strangely here in the States these awesome CO2-based models are not available. Instead over here there are only a handful of very small shops making heat pump water heaters (commonly abbreviated HPWH) using standard refrigerator compressors, so they use R-22 or R-134a. Most of those shops seem to be struggling to make enough sales to keep afloat. I think if only people knew more about the technology then the market would explode, since the payback happens in only about 3 years. After that it's saving you money. At any rate, being the environmental nut that I am I wanted in on this trend.</font></p> <p><font face="Arial">After Googling around awhile for HPWH I found a guy in Florida that was selling some American-made units for just $550 each, and sent him a fat cashier's check. A couple weeks ago the thing arrived, and last weekend I got around to trying it out. Here's a look under the hood:</font></p> <p><img alt="" src="" /></p> <p><font face="Arial">Water gets pumped in from the tank with that brown pump on the right, circulates through the black oval-shaped heat exchanger in the middle, and goes back to the tank. The heat exchanger is kept hot from the R-22 being pumped into it by the compressor. Heat is dumped out through the curved evaporator with all its fins, seen in the bottom of this pic.</font></p> <p><font face="Arial">Most HPWH models are designed to be connected to an existing electric water heater, and this was no exception. Here's the important electrical connections to deal with:</font></p> <p><img alt="" src="" /></p> <p>At first before connecting everything to the water heater I just wanted to turn it on and see it work. So I put the unit in a bucket of cold water and connected just the 220V electrical connections. Nothing happened. I was pretty discouraged, and got out the multitester and schematic diagram. Then I found out that in order to run this HPWH unit at all, it must, must, <strong>must</strong> be connected to a resistive load on the other side. Turns out all I needed to do was just put the hot water heater in the circuit, which allows the 5-minute timer to get energized and actually do its thing. 5 minutes later a little relay tripped, which in turn juiced the coil for the main contactor, and everything jumped to life. It was very welcome to feel tons of cold air pumping out the top of it. Within a few minutes that bucket of water was pretty hot.</p> <p>So now it's been installed for a week. I need to make a better mount for it in my garage, and vent the cold outlet air to the outside for the winter months. Seems to be doing the trick anyway.</p><img src="" width="1" height="1" /> 5 Ever crack the screen of a favorite gadget? 2008-02-14T07:00:50-06:00:00 2008-02-14T07:22:26Z <p:</p> <p><img alt="" src="" /></p> <p:</p> <p><img alt="" src="" /></p> <p!</p> <p><img alt="" src="" /></p> <p>As usable as this was, it still wasn't as useful as a good screen would be. So I called to check on the price for a replacement -- $130. Ouch. Too much.</p> <p>I figured Sony probably made some other cameras with the same exact screen, so I researched a little to find the models that have a 2.7" wide screen with <font face="Arial">123200 dots. All these models looked like good candidates:</font></p> <p><font face="Arial">DCR HC47<br /> SR52<br /> SR72<br /> DVD202<br /> DVD203<br /> DVD306<br /> DVD404<br /> DVD703<br /> PC1000</font></p> <p>After hunting around on eBay for a broken one with a good screen, I <a href="">found a DVD203</a>:</p> <p><img alt="" src="" /></p> <p:</p> <p><img alt="" src="" /></p> <p>To detach the four other connections it was best to gently push both sides with a screwdriver.</p> <p><img alt="" src="" /></p> <p>Here's a look at the electronics inside the screen for both cameras:</p> <p><img alt="" src="" /></p> <p.</p> <p>With the main connection detached, I took out the whole screen assembly from the donor cam, and removed the three black screws holding everything together. Here's the three main layers that result:</p> <p><img alt="" src="" /></p> <p:</p> <p><img alt="" src="" /></p> <p>After pulling out just the screen assembly from this mix and detaching the three connections going to the circuit board, I was ready to drop it into the HDV camera. Here's a look at the separate parts before putting them back together:</p> <p><img alt="" src="" /></p> <p.</p> <p:</p> <p><img alt="" src="" /></p> <p>Once it's as far as it should be, the connector can be pushed back down to secure it, and it ends up looking like this:</p> <p><img alt="" src="" /></p> <p>After getting everything back together, it worked perfectly on the first try.</p> <p><img alt="" src="" /></p> <p>Nice to be back in action again.</p> <p>LCD screens have certainly changed the world. Hard to find a device these days that doesn't use one somewhere. But dang they're fragile. If you have something with a broken screen, perhaps this tutorial will inspire you to try your hand at fixing it!</p><img src="" width="1" height="1" /> 6 The type or namespace name 'Pkcs' does not exist in the namespace 'System.Security.Cryptography' 2008-02-12T08:05:31-06:00:00 2008-02-12T08:21:54Z <p>I had an error that was been driving me up the wall, <strong>CS0234: The type or namespace name 'Pkcs' does not exist in the namespace 'System.Security.Cryptography'</strong>. This always happened while developing a web application in Visual Studio 2005 and wanting to use code that deals with certificates. During development Intellisense would find the <strong>System.Security.Cryptography.Pkcs</strong> namespace just fine. But it couldn't be found at runtime. I had registered the <strong>System.Security</strong> assembly, and the project always built just fine. The resulting assembly seemed perfectly normal. But no matter what I tried, even reinstalling the .NET framework on the machine, would make that dumb error go away.</p> <p>Well, after more tinkering I found out the issue is all in the web.config. If you <strong>(1)</strong> install the normal payware version of Visual Studio 2005 and then <strong>(2)</strong>>:</p> <pre><font color="#0000ff" size="1"><p><font color="#0000ff" size="1"></font><font color="#008000" size=">></font></font> </p></font></pre> <p>I just modified it to include the assembly reference like this:</p> <pre><font color="#0000ff" size="1">">><br /><</font><font color="#a31515" size="1">assemblies</font><font color="#0000ff" size="1">><br /><</font><font color="#a31515" size="1">add</font><font color="#0000ff" size="1"> </font><font color="#ff0000" size="1">assembly</font><font color="#0000ff" size="1">=</font><font size="1">"</font><font color="#0000ff" size="1">System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A</font><font size="1">"</font><font color="#0000ff" size="1">/><br /></</font><font color="#a31515" size="1">assemblies</font><font color="#0000ff" size="1">><br /></</font><font color="#a31515" size="1">compilation</font><font color="#0000ff" size="1">></font></p></font></pre> <p>Now at runtime everything works great!</p><img src="" width="1" height="1" /> 1 Simplifying security cofiguration between web and database servers 2008-02-07T03:49:17-06:00:00 2008-02-07T03:49:17Z <p><font face="Arial">A question was posed to our user group's listserv yesterday. After typing up a response I saw that I had written a short novel on the subject, and thought it may be of use to those outside our group. First the question posed:</font></p> <p> </p> <blockquote><font face="Arial">> My employer doesn't want to expose it's production databases to the world, so they sit safely behind a firewall. The production web servers want to talk to those databases, so we open the right ports to let them talk through matching, local machine user accounts. This way if the production environment accounts were compromised, domain privileges don't exist for these users, so the individual account cannot do anything with the internal domain (i.e. can't bring down the whole corporate network). Brilliant! Except...<br /> > <br /> > Problem: This solution requires us to replicate user accounts across every machine and we're getting more and more of them as we grow. It's a burden and it's also a QoS (Quality of Service) and security risk in its own right, because access is subject to account synchronization. What if password policy (like expiration) isn't enforced on an account? What if one machine in the web farm isn't synch'ed and we suddenly lose connectivity?<br /> > <br /> > There are controls that help mitigate risk with the current solution, but I have to believe there is a better way. Can someone explain alternatives to me in non-network-geek English?<br /> </font></blockquote> <p> </p> <p><font face="Arial">The environment you describe is pretty common in the corporate world, with the majority of ports, including 135 / 137 / 139 for NetBIOS, 53 for DNS, and 88 / 464 / 500 / 3268 / 3269 for Kerberos, blocked by a firewall. Corporate policy usually restricts you from joining any externally-facing web servers to an internal domain. So basically you are the one that ends up doing the work that a domain controller would otherwise be doing, synchronizing everything, all in the name of better security.</font></p> <p><font face="Arial">Speaking of security, let's consider it to be kind-of like a war, us against hackers. Our web servers are at the very front lines, the "tip of the spear", and are the ones most likely to be compromised. If a web server falls into enemy hands, the security info it knows about can be obtained through "interrogation" by the enemy. So if the web server was part of a domain, a hacker could search that domain for resources. This is risky, as many computer names and user names would then be exposed. The same kind of information you see when you go to add NTFS permissions to a file or folder, and click "Advanced", then "Find Now". You can then see a list of users, groups, and computers. It's too big a risk to take for most organizations. Comparing it to war, sensitive intelligence is kept from those on the front lines, thereby limiting your exposure if someone gets captured. So you end up doing all those "need to know" security updates manually to the machines on the front lines.</font></p> <p><font face="Arial">So how can we simplify administration for security between web servers and SQL servers? There's a couple of options I can think of.</font></p> <font face="Arial"> <p><br /> Option 1 -- Add a domain<br /> Some corporate policies will let you set up a separate domain just for your SQL and web servers, so all those common "need to know" security details for the machines on your front lines can be easily set up. There's little risk of sensitive data from the internal domain making its way to the outside because there's a real separation there. No trust relationships between the inside and outside domains. Having a separate domain greatly simplifies setting up web farms. It's also essential to have your SQL server nodes joined to a domain when configuring database clusters. If the web servers and SQL servers are on the same domain or trusted domains then it's much simpler to use SQL server in "Windows Authentication" mode. So let's explore this option a little further. Here's a diagram:</p> <p>____________________<br /> Internal corporate network<br /> Your Vista / XP computer is sitting on a desk in here somewhere<br /> ____________________</p> <p> |<br /> | Firewall allowing SQL requests only one direction<br /> | (OK, maybe also terminal services connections<br /> | in order to simplify administration via port 3389.)<br /> V<br /> ____________________<br /> * Domain Controllers for web environment (at least 2)<br /> * SQL server(s)<br /> ____________________</p> <p>A<br /> |<br /> | Firewall allowing SQL, Kerberos, and NetBIOS requests<br /> | (ports 53 / 88 / 135 / 137 / 139 / 464 / 500 / 3268 / 3269,<br /> | plus whatever custom port you use for SQL.)<br /> V<br /> ____________________<br /> * Web servers joined to the "web" domain. Each machine is "multi-homed" (has 2 network adapters), with one connection to the network above, and one connected below.<br /> ____________________</p> <p>A<br /> |<br /> | Firewall allowing HTTP and HTTPS<br /> |<br /> V</p> <p>vvvvvvvvvvvvvv<br /> The Internet<br /> ^^^^^^^^^^^^^^</p> <p>In this case note that the domain controllers and SQL server(s) would use an IP addressing scheme that does not route on the Internet, like 10.x.x.x, or 192.168.x.x. Also each web server would have an IP on this network.</p> <p>If a web server were compromised then there would still be risk of an attacker discovering computer names and IP addresses of other web servers and database servers. Also account names used on that separate "web" network. But no risk that they would discover that same information on the corporate network. You may want to explore this option to simplify your day-to-day administration. Adding a new web server to the environment is as simple as having it join the domain, and then establishing file replication service (FRS), ROBOCOPY scripts, or something similar to synchronize files and permissions.</p> <p>If data in the SQL servers has to be accessible on the corporate network then you could set up a firewall allowing just requests from the corporate network to be answered by the database servers, and then only on one port. (Often better for this not to be the default of 1433!) As long as you use a good firewall then it's pretty strong security, and very low risk of the corporate network getting exposed. No domain-specific information would traverse the wire.</p> <p>In addition to the 3 firewalls shown above, you can also establish IPSec for even better security. This would be especially useful between the corporate environment and the segment with SQL / domain controllers. Also somewhat useful between SQL and web servers because a compromised web server could potentially sniff network traffic going between other web servers and the database server, exposing sensitive data. But bear in mind that you take a performance hit when using IPSec, so enabling this between web servers and database servers would slow down requests.</p> <p><br /> Option 2 -- Enable "Mixed" mode on your SQL server(s)<br /> This one is quick and dirty. It avoids the need to configure special Windows accounts at all, and has you change out your connection strings to use SQL logins. It's functionally similar to what we saw with Option 1 in that security for the externally-facing resources is maintained separately from any internal credentials. In Option 1 it was done in a totally separate domain. In this option it's done by simply leveraging the security system baked into SQL server. But then the security credentials have to be exposed in the connection string. This doesn't protect the data in your SQL server nearly as well since a compromised web server could then give the attacker access to passwords used by the SQL service, potentially giving more access than in a scenario where the SQL server uses only Windows authentication. Because of this many corporate security policies do not allow SQL server to be configured in mixed mode. At least this option is simple, not requiring any additional hardware in your scenario.</p> <p>With this option the SQL server(s) are still on the corporate network, so a major consideration is to harden the machines as much as possible. Disable risky extended stored procedures. This is more than just xp_cmdshell. What about xp_runweb, xp_regread, and xp_regwrite? Not to mention xp_dirtree and xp_enumgroups. Here's a fairly good checklist of security stuff for SQL server:</p> <p><a href=""></a></p> <p>A sideline note -- especially important now that Windows Server 2008 has gone gold -- IIS 7 can simplify permissions when deploying websites. Instead of setting up NTFS permissions and having to copy them between web servers, you can use URL Authorization to configure the security right in the web.config. This way all you need to do is copy the files onto the web server and you're done. No more messing with NTFS permissions.</p> <p>Hopefully this info will help you to find an easier way to administer your web environment!</p> </font><img src="" width="1" height="1" /> 4 Hey Dick -- At this point exactly who is terrorizing who??? 2008-01-23T16:46:06-06:00:00 2008-01-23T17:11:31Z <font size="2"> .</p> <p.</p> <p?</p> <p>Why of all days did I pick today to rant? Well, today we have <a href="">Dick Cheney pressuring Congress to maintain the wiretap measure</a>..</p> <p <a href="">pack of lies that was spun</a>.</p> <p>We have the rest of the primaries coming up soon. Super Tuesday is just around the corner. I think that the one candidate that can best pull us out of this ridiculous mess is <a href="">Ron Paul</a>. .</p> </font><img src="" width="1" height="1" /> 1 Introducing the $1800 MacBook Air 2008-01-15T06:33:43-06:00:00 2008-01-15T07:09:37Z <p>At the MacWorld keynote this morning Steve Jobs saved the best for last. Of the 4 major things he spoke about, the final thing was the announcement of the crazy-small <a href="">MacBook Air</a>. This is the world's thinnest notebook, sporting an LED edge-lit screen, custom Penryn processor, and all that weighing only 3 lbs. Small enough to fit in an envelope:</p> <p><img alt="" src="" /></p> <p>(Steve carried it out on stage in an envelope actually.)</p> <p><img alt="" src="" /></p> <p>MacBook Air specs:</p> <table cellspacing="0" cellpadding="0"> <tbody> <tr> <td style="FONT-SIZE: 10pt" valign="top" width="433"><br /> <br /> <ul> <li>A claimed 5 hours of battery life. The battery actually consumes about 2/3 of the lower portion, pretty much the entire slender area of the machine! (We can probably expect an honest 3 hours of use) </li> <li>0.16" to 0.76" wedge. (The thickest part of the MacBook Air is thinner than the thinnest part of the Sony TZ series.) </li> <li>Magnetic latch </li> <li>13.3" widescreen display with 1280x800 resolution </li> <li>Ambient light sensor to automatically adjust the display and keyboard backlighting </li> <li>Full-sized keyboard </li> <li>Multi-touch gestures available on the trackpad. (Pinch zoom and rotate by twirling a finger around your planted thumb.) </li> <li>1.8" 80 gig hard drive, or 64 gig SSD as a pricey option </li> <li>1.6 GHz or 1.8 GHz Core 2 Duo (low-energy Penryn type in a CUSTOM package made just for Apple!) </li> <li>Connectors include power, USB 2.0, Micro-DVI, and audio </li> </ul> </td> <td><img alt="" src="" /></td> </tr> <tr> <td colspan="2"><img alt="" src="" /></td> </tr> </tbody> </table> <p>In other news from the keynote, <font face="Arial">Apple has released their version of Home Server, which they call <a href="">"Time Capsule"</a>. They are also trying to redefine video rentals with what ends up being movie rentals in a simple iTunes-like interface. </font <a href="">Apple TV appliance</a> got a software update and a $70 price cut, now $230. Watch out NetFlix and Blockbuster!</p><img src="" width="1" height="1" /> 2 Phishers now setting up fake 800 numbers? Man they're getting gutsy these days. 2007-11-09T03:30:09-06:00:00 2007-11-09T04:01:41Z <div> <p>Got this phishing message in the email this morning:</p> <div style="BORDER-RIGHT: red 2px dashed; BORDER-TOP: red 2px dashed; PADDING-LEFT: 10px; BORDER-LEFT: red 2px dashed; BORDER-BOTTOM: red 2px dashed"> <p><strong>Subject:</strong> Case ID: DXA6E9JK</p> <p><strong>Body:</strong><br /> Dear Bank of America Military Bank customer,</p> <p>We regret to inform you that we have received numerous fraudulent e-mails which ask for personal<br /> information. Please remember that we will never ask for personal information through e-mail or websites.</p> <p>Because of this we are launching a new security system to make Bank of the Cascades cards more secure<br /> and safe. To take advantage of our new consumer Identity Theft Protection Program we had to<br /> deactivate all Debit/ATM cards.</p> <p>To reactivate your card please call (800) 609-0579 and follow the steps.</p> <p>Reactivation is free of charge and will take place as soon as you finish the process.</p> </div> <p>Wow, phishing scammers with a fake (800) number. That's kinda gutsy, don'tcha think? Shouldn't it be fairly easy to catch them? Here's an MP3 recording of what you get when you call:</p> <p><a href=""><img alt="" boder="0" src="" /></a></p> <p?</p> <p>I'm just surprised that even though they ask for card number, PIN, and expiration date, they don't ask for the 3-digit security code on the back of the card.</p> </div><img src="" width="1" height="1" /> 4 Has anyone gotten Virtual Machine Additions to work under 2008 Server Core RC0? 2007-11-01T22:37:17-05:00:00 2007-11-01T22:37:17Z <p."</p> <p>Looking at the setup log, it seemed like permissions may be an issue. But the setup process was running as an elevated Administrator on the machine. (Seems like you can't run anything as LUA in Server Core.)</p> <p>Undeterred, <font face="Arial">from another full Server 2008 installation that had Virtual Machine Additions installed I copied the driver files from the Program Files folder. This is from version 13.803 of VMA. Then I tried this:</font></p> <pre>C:\><strong>pnputil -i -a "c:\Program Files\Virtual Machine Additions\*.inf"<br /></strong>Microsoft PnP Utility<br /> <br />Processing inf : msvmmouf.inf Successfully installed the driver on a device on the system.<br />Driver package added successfully.<br />Published name : oem0.inf<p> </p> <p>Processing inf : msvmscsi.inf<br />Successfully installed the driver on a device on the system.<br />Driver package added successfully.<br />Published name : oem2.inf</p> <p>Processing inf : VirtualAudioDevice.inf<br />Failed to install the driver on any of the devices on the system : The required<br />section was not found in the INF.<br />Processing inf : vmadd_xp_drv.inf<br />Failed to install the driver on any of the devices on the system : No more data<br />is available.</p><p><br /></p><p>Adding at least one driver package failed!</p> <p>C:\></p></pre> <p>For those that aren't familiar with the new pnputil command, it basically allows you to add and update drivers without having to use Device Manager. Earlier beta builds used to have a similar tool called drvload that had limited functionality.</p> <p:</p> <p> </p> <pre>C:\><strong>pnputil -d oem0.inf<br /></strong>Microsoft PnP Utility<p> </p> <p>Driver package deleted successfully.</p> <p>C:\></p></pre> <p> </p> <p>After a reboot, things were back to where they were before, with no VMA. So that's everything I've tried. If anyone has any ideas of how to get VMA running under Server Core RC0, I'd be very interested to hear about it.</p><img src="" width="1" height="1" /> 5 If I got $143 a year from every single person in America, I could do alot of spying. 2007-10-30T12:14:44-05:00:00 2008-02-29T13:40:19Z <p>43 billion dollars is kind-of a hard amount to put your finger on. Until you divide it by America's population and see that it's $143 for every <font face="Arial">man, woman, and child. Hard to believe there's so much budget allocated to spying. That</font>'s almost half of what will be spent on the war in Iraq during this year -- which equates to $324 from every one of us. If the war really does end by 2017 as some hope, it will cost every one of us over $7000. Maybe more.</p> <p>All this spending makes it easy for me to understand how our dollar is so utterly screwed. Compared with the British Pound it's at the lowest value in over 26 years. For the next decade I'll bet Europe's economy is king. I just can't understand why Asia hasn't taken off as fast. We've been neck and neck, but ever since the half-point drop in the interest rate back in September the Yen started on its way up. Hmm, Yen seems like a good investment right about now.</p> <!-- BEGIN TRAN INSERT [Resort] (name,location) VALUES ('Whistler-Blackcomb','BC') INSERT [Resort] (name,location) VALUES ('Mt Hood','Oregon') INSERT [Resort] (name,location) VALUES ('Alyeska','AK') INSERT [Resort] (name,location) VALUES ('Willamette Pass','Oregon') INSERT [Resort] (name,location) SELECT 'name1','loc1' UNION SELECT 'name2','loc2' UNION SELECT 'name3','loc3' SELECT * FROM Resort WHERE location='AK' DELETE [Resort] WHERE location='AK' COMMIT TRAN - Tim's questions about how to find duplicates in a database SELECT name,location,COUNT(*) FROM Resort GROUP BY name,location HAVING COUNT(*)>1 SELECT DISTINCT name,location FROM Resort - Day 1 afternoon- The Skiing sample - Setting up the database SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[State]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[State]( [StateID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL, [name] [varchar](100) NULL, PRIMARY KEY CLUSTERED ( [StateID] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DannysScript]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROC [dbo]. ' END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Hypotenuse]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROC [dbo].[Hypotenuse] @a FLOAT, @b FLOAT, @c FLOAT OUTPUT AS SET @c = SQRT(SQUARE(@a) + SQUARE(@b)) ' END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Resort]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[Resort]( [ResortID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL, [name] [nvarchar](1000) NULL, CONSTRAINT [PK_Resort] PRIMARY KEY CLUSTERED ( [ResortID] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ResortState]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[ResortState]( [StateID] [int] NULL, [ResortID] [int] NULL ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[MarysView]')) EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[MarysView] AS SELECT * FROM State WHERE stateID<11 ' GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[AddResort]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROC [dbo]. ' END GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_ResortState_Resort]') AND parent_object_id = OBJECT_ID(N'[dbo].[ResortState]')) ALTER TABLE [dbo].[ResortState] WITH CHECK ADD CONSTRAINT [FK_ResortState_Resort] FOREIGN KEY([ResortID]) REFERENCES [dbo].[Resort] ([ResortID]) GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_ResortState_State]') AND parent_object_id = OBJECT_ID(N'[dbo].[ResortState]')) ALTER TABLE [dbo].[ResortState] WITH CHECK ADD CONSTRAINT [FK_ResortState_State] FOREIGN KEY([StateID]) REFERENCES [dbo].[State] ([StateID]) USE Skiing SELECT * FROM Resort SELECT * FROM ResortState INSERT INTO ResortState (stateID, resortID) VALUES (5455,30) INSERT INTO ResortState (stateID, resortID) VALUES (5456,30) SELECT * FROM State INSERT INTO State (name) VALUES ('Oregon') UPDATE ResortState SET stateID=1 WHERE resortID=30 AND stateID=5455 DELETE FROM ResortState WHERE stateID=5456 AND resortID=30 INSERT INTO State (name) VALUES ('British Columbia') SELECT * FROM ResortState UPDATE ResortState SET stateID=3 WHERE resortID = 30 AND stateID = 1 INSERT INTO State (name) VALUES ('Washington') SELECT scope_identity() INSERT INTO ResortState (stateID, resortID) VALUES (scope_identity(),30) select * FROM [DB-SERVER\Taco].Skiing.dbo.State SELECT State.name AS 'State', Resort.name AS 'Resort' FROM State JOIN ResortState ON State.stateID = ResortState.stateID JOIN Resort ON Resort.resortID = ResortState.resortID SELECT * FROM Resort WHERE resortID IN (SELECT resortID FROM ResortState WHERE stateID=1) INSERT INTO ResortState (stateID, resortID) SELECT 1 AS 'State',resortID FROM Resort WHERE (resortID <> 30 AND resortID <> 34) SELECT * FROM ResortState SELECT * FROM Resort ALTER TABLE Resort DROP COLUMN stateID - Here's a look at the relationships in this database SELECT s1.name,s2.name FROM sysreferences JOIN sysobjects AS s1 ON sysreferences.fkeyid = s1.id JOIN sysobjects AS s2 ON sysreferences.rkeyid = s2.id SELECT Resort.name, State.name AS Expr1 FROM Resort INNER JOIN ResortState ON Resort.ResortID = ResortState.ResortID INNER JOIN State ON ResortState.StateID = State.StateID DECLARE @x INT SET @x=1 WHILE @x <= 5000 BEGIN INSERT Resort (name) VALUES (CAST(newID() AS VARCHAR(500))) SET @x = @x + 1 END select COUNT(*) FROM Resort select TOP 100 * FROM Resort INSERT State (name) VALUES ('Lala land') INSERT ResortState (stateID, resortID) SELECT 6, resortID FROM Resort WHERE resortID >= 38 SELECT State.name, COUNT(*) FROM State JOIN ResortState ON State.stateID = ResortState.stateID GROUP BY State.name - Day 2- Establishing the Library sample SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Author]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[Author]( [authorID] [int] IDENTITY(1,1) NOT NULL, CONSTRAINT [PK_Author] PRIMARY KEY CLUSTERED ( [authorID] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Member]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[Member]( [memberID] [uniqueidentifier] NOT NULL CONSTRAINT [DF_Member_memberID] DEFAULT (newid()), [firstName] [nvarchar](50) NULL, [lastName] [nchar](100) NULL, [phone] [char](20) NULL, CONSTRAINT [PK_Member] PRIMARY KEY CLUSTERED ( [memberID] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MediaType]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[MediaType]( [meditTypeID] [int] IDENTITY(1,1) NOT NULL, [name] [nchar](10) NOT NULL, [allowedCheckoutDuration] [int] NOT NULL CONSTRAINT [DF_MediaType_allowedCheckoutDuration] DEFAULT ((30)), CONSTRAINT [PK_MediaType] PRIMARY KEY CLUSTERED ( [meditTypeID] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BookAuthor]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[BookAuthor]( [bookID] [int] NULL, [authorID] [int] NULL ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CheckOut]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[CheckOut]( [memberID] [uniqueidentifier] NULL, [bookID] [int] NULL, [dueDate] [datetime] NULL, [checkOutDate] [datetime] NULL ), [title] [nvarchar](500) NULL, [isbn] [bigint] NULL, [mediaTypeID] [int] NULL, [allowedCheckoutDuration] [int] NULL CONSTRAINT [DF_Book_allowedCheckoutDuration] DEFAULT ((30)), CONSTRAINT [PK_Book] PRIMARY KEY CLUSTERED ( [bookID] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] END GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_BookAuthor_Author]') AND parent_object_id = OBJECT_ID(N'[dbo].[BookAuthor]')) ALTER TABLE [dbo].[BookAuthor] WITH CHECK ADD CONSTRAINT [FK_BookAuthor_Author] FOREIGN KEY([authorID]) REFERENCES [dbo].[Author] ([authorID]) GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_BookAuthor_Book]') AND parent_object_id = OBJECT_ID(N'[dbo].[BookAuthor]')) ALTER TABLE [dbo].[BookAuthor] WITH CHECK ADD CONSTRAINT [FK_BookAuthor_Book] FOREIGN KEY([bookID]) REFERENCES [dbo].[Book] ([bookID]) GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_CheckOut_Book]') AND parent_object_id = OBJECT_ID(N'[dbo].[CheckOut]')) ALTER TABLE [dbo].[CheckOut] WITH CHECK ADD CONSTRAINT [FK_CheckOut_Book] FOREIGN KEY([bookID]) REFERENCES [dbo].[Book] ([bookID]) GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_CheckOut_Member]') AND parent_object_id = OBJECT_ID(N'[dbo].[CheckOut]')) ALTER TABLE [dbo].[CheckOut] WITH CHECK ADD CONSTRAINT [FK_CheckOut_Member] FOREIGN KEY([memberID]) REFERENCES [dbo].[Member] ([memberID]) GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_Book_MediaType]') AND parent_object_id = OBJECT_ID(N'[dbo].[Book]')) ALTER TABLE [dbo].[Book] WITH CHECK ADD CONSTRAINT [FK_Book_MediaType] FOREIGN KEY([mediaTypeID]) REFERENCES [dbo].[MediaType] ([meditTypeID]) - Day 2- Filling the library sample with some data select CAST('1-2-2000' AS DATETIME)+5 INSERT INTO MediaType (name) VALUES ('Hardback') INSERT INTO MediaType (name) VALUES ('Paperback') INSERT INTO MediaType (name) VALUES ('CD') INSERT INTO MediaType (name) VALUES ('DVD') INSERT INTO MediaType (name) VALUES ('Audio Book') INSERT INTO MediaType (name) VALUES ('Magazine') INSERT INTO MediaType (name) VALUES ('Reference') INSERT INTO MediaType (name) VALUES ('Newspaper') INSERT INTO MediaType (name) VALUES ('Vinyl') INSERT INTO MediaType (name) VALUES ('8-track') INSERT INTO MediaType (name) VALUES ('Braille') INSERT INTO MediaType (name) VALUES ('Comics') INSERT INTO MediaType (name) VALUES ('VHS') INSERT INTO MediaType (name) VALUES ('Laserdisc') INSERT INTO MediaType (name) VALUES ('HD-DVD') INSERT INTO MediaType (name) VALUES ('Blu-Ray') INSERT INTO MediaType (name) VALUES ('Beta') select * FROM Member DELETE Member WHERE memberID NOT IN (SELECT memberID FROM Checkout) DELETE Member FROM Member LEFT OUTER JOIN Checkout ON Member.memberID = Checkout.memberID WHERE Checkout.memberID IS NULL select * FROM INSERT Member (firstName) VALUES ('Lorin') INSERT Member (firstName) VALUES ('Tim') INSERT Book (title) VALUES ('Gladiator') - Day 2 - backup and restore select * FROM Member INSERT Member DEFAULT VALUES if 1=1 PRINT 'Hello' BACKUP DATABASE Skiing TO DISK='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\Library.bak' WITH DIFFERENTIAL RESTORE HEADERONLY FROM DISK='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\Library.bak' RESTORE FILELISTONLY FROM DISK='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\Library.bak' WITH FILE=7 RESTORE DATABASE JoeSchmoe FROM DISK='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\Library.bak' WITH FILE=7, MOVE 'Skiing' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Skiing_new.mdf', MOVE 'Fast' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Fast_new.mdf', MOVE 'Huge' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Huge_new.mdf', MOVE 'Skiing_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Skiing_Log_new.mdf' BACKUP LOG Skiing TO DISK='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\Library.bak' WITH NO_TRUNCATE DROP DATABASE Library RESTORE DATABASE Library FROM DISK='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\Library.bak' WITH NORECOVERY, FILE=1 GO RESTORE LOG Library FROM DISK='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\Library.bak' WITH NORECOVERY, FILE=2 GO RESTORE LOG Library FROM DISK='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\Library.bak' WITH FILE=3 GO DECLARE @datePartThingie VARCHAR(10) SET @datePartThingie = 'month' EXEC('Print DATEPART('+ @datePartThingie +',''2005-2-3'')') Print 'Hello' Day 2- Security- Setting up a view for Mary DROP TABLE State DROP VIEW MarysView CREATE VIEW MarysView AS SELECT * FROM State WHERE stateID<11 Select * FROM MarysView Day 2- Security- What Mary did to test out her view SELECT * FROM State SELECT * FROM MarysView INSERT MarysView (name) VALUES ('MarysState') SELECT * FROM #MyTempTable Day 3- AM- Finding how much space each column uses select * FROM Book EXEC sp_columns Book sp_columns Resort select * FROM syscolumns SELECT name FROM Resort SELECT AVG( CAST(LEN(name) AS FLOAT) ) FROM Resort SELECT AVG( CAST(DATALENGTH(name) AS FLOAT) ) FROM Resort ALTER TABLE Resort ALTER COLUMN name NVARCHAR(1000) DBCC DBREINDEX (ResortState) DBCC CHECKDB select * INTO #MyTempTable FROM Resort WHERE resortid BETWEEN 100 AND 200 SELECT * FROM #MyTempTable SELECT * FROM Resort JOIN ResortState ON Resort.ResortID = ResortState.ResortID JOIN State ON State.StateID = ResortState.StateID WHERE State.name='Oregon' select top 1 resortID, name, location FROM Resort Day 3- A simple example of a sproc- how to find the hypotenuse CREATE PROC Hypotenuse @a FLOAT, @b FLOAT, @c FLOAT OUTPUT AS SET @c = SQRT(SQUARE(@a) + SQUARE(@b)) GO DECLARE @hypotenuse FLOAT EXEC Hypotenuse 3,5,@hypotenuse OUTPUT PRINT CAST(@hypotenuse AS VARCHAR(50)) + ' hypotenuse' Day 3- Danny's sproc ALTER PROC GO DECLARE @var BIGINT EXEC DannysScript '2008-5-6', 'S', @var OUTPUT SELECT @var select * FROM tempdb.dbo.sysobjects DROP TABLE #newcalender if exists (SELECT name FROM tempdb.dbo.sysobjects WHERE SUBSTRING(name,1,12)='#newcalender') PRINT 'It''s there!' Day 3- A more real-world example of sprocs SELECT * FROM Resort SELECT TOP 5 * FROM ResortState WHERE resortID>61677 SELECT TOP 5 * FROM State WHERE stateID IS NULL ALTER PROC GO EXEC AddResort 'Fernie','British Columbia' DELETE ResortState WHERE stateID IS NULL Day 3- Replication How to enable Agent XPs, which is required for replication use master go EXEC sp_configure 'show advanced options','1' RECONFIGURE EXEC sp_configure exec sp_configure 'Agent XPs','1' select * INTO Resort2 FROM Resort WHERE 1=0 select * FROM Resort2 --><img src="" width="1" height="1" /> 3 Windows 2008 Server Core is worth a look 2007-10-30T06:02:37-05:00:00 2007-10-30T06:07:41Z <p>I've been experimenting with the Server Core version of Windows Server 2008 for a project I'm working on. You may be aware that Win2K8 ships with this great new streamlined "Server Core" mode that you can select during setup. Installation is lightining-fast, just 10 minutes on my Core 2 Duo machine. (And that's including the 2 reboots, hardware detection, and everything!) You end up with only a very minimal set of GUI tools, including notepad and regedit. The thing is lean and mean, and can run very well in just half a gig of RAM. You can still copy some Windows executables into the environment and have them run. Here for instance is Solitaire running under Server Core:</p> <p><img alt="" src="" /></p> <p>While this simple GDI-centric app works, others will not. One of the major limitations is that no trace of Internet Explorer is available. At first this probably doesn't sound like that big a deal, perhaps even a welcome change for a server environment. But before you start rejoicing, consider that all of the Common File Dialogs, like File Open and Print, come from Internet Explorer. Okay, so easy enough to install an older standalone version of IE to bring this functionality back, right? No. All you will get is an error message about how the terminal server needs to be in application installation mode to continue. If you try to do the common "CHANGE USER /INSTALL" trick from the command line to fool it, it comes up with a message about terminal servers in remote administration mode can't be set to install vs execute. I didn't find an easy way to install Internet Explorer anyway, but I didn't try very hard either.</p> <p>Another limitation with not having IE around is that all of Microsoft's versions of the .NET Framework (the ones for Wintel boxes anyway) require Internet Explorer 5.01 or later. You can still install Mono from Miguel deIcaza and team, and it will serve out ASP.NET content using XSP pages. But for those that prefer the standard configuration of ASP.NET 2.0 that comes out of the box with Server 2008, that's not possible with Server Core... yet. But there is talk of creating an updated version of the .NET 2.0 framework that will work in Server Core for ASP.NET.</p> <p>Another limitation related to IIS 7 is that all those cool new hooks available in integrated pipeline mode can only be used with native code, so no managed modules. And you can't do remote administration since it also relies on the .NET Framework. IIS 7 is still a great high-performance architecture when running under Server Core, but just not as convenient as when it's on a system that can run managed code.</p> <p>The final limitation with not having the .NET Framework onboard is that PowerShell is not available. So needless to say, I'm really looking forward to a custom release of the .NET Framework designed for Server Core!</p> <p>On the upside, what you get is a great little server platform with a really small footprint. You can make it a domain controller, DNS server, DHCP, IIS with FastCGI, and so on. No SQL or Exchange since they also require IE and the .NET Framework. It's quite possible that SQL and Exchange will never be supported on servers using this kind of small footprint.</p> <p>When administering, you get a couple of handy GUI-based tools to help you out. First, MSINFO32, which won't let you change settings, but does let you at least visualize how the machine is configured:</p> <p><img alt="" src="" /></p> <p>You get basically a read-only view of device manager, the services running on the system, and many other handy tidbits of info available through WMI. For services this is a very handy view to know what's running, and the short names you need to use with NET START and NET STOP.</p> <p>Second, you get the always useful Notepad program. The standard File / Open and File / Save dialogs have been changed out to use the old-school 32-bit API calls that were first made available back in Windows NT 3.1:</p> <p><img alt="" src="" /></p> <p>Third, you still get regedit! The good one that lets you change permissions. It's also modified to work with the older common file dialogs, so you can import and export whole keys:</p> <p><img alt="" src="" /></p> <p>A final tool worth mentioning is a command line tool that you can only get in Server Core. It's <strong>oclist</strong>, which is designed to help you out when you use <strong>ocsetup</strong>:</p> <p><img alt="" src="" /></p> <p>Consider that since you don't have access to Server Manager (which is the new Add Remove Windows Components thing in Server 2008), it's harder to install stuff. Imagine how annoying it would be to figure out the cryptic command line junk needed to install and uninstall features of Windows just using <strong>ocsetup.exe</strong> and <strong>pkgmgr.exe</strong> blind. It would be a nightmare. Fortunately you can run this tool, <strong>oclist</strong>, to see exactly what features are available to install, and it shows them in a hierarchy that describes the dependencies involved.</p> <p>There's no facility to upgrade a Server Core install to a full install of Server 2008, or vice-versa, but you can at least copy the <strong>oclist</strong> tool over to another machine that's running the full Server 2008, and then run it to see all the cryptic names of exactly what is installed on that system. This allows you to more easily replicate that same server scenario on the smaller-scale Server Core. Note that the full (non-Core) install of Server 2008 has LOTS more stuff that gets listed when using oclist.</p> <p>One final thing to mention is that although the full Control Panel is not available, you get two of the applets, the timeDate.cpl and intl.cpl:</p> <p><img alt="" src="" /></p> <p>Everything runs as the elevated Token. No Vista-style "whack-a-mole" with UAC popups. Notice that the command prompt itself is running elevated all the time. I don't even think you can start a process as LUA.</p> <p>All in all I'm impressed with this option for Windows. Kind-of reminiscent of the good ol' DOS days when we were all rooted in the basics, and the command line was king. I expect lots of shops will take advantage of this lightweight and secure environment.</p><img src="" width="1" height="1" /> 4 Arriving in Ireland 2007-10-05T05:04:54-05:00:00 2007-10-07T06:07:00Z <p:</p> <p> <img alt="" src="" /><br /> View of the ocean from the hostel where I'm staying<br /> <br /> <img alt="" src="" /><br /> Lots of cows out here!<br /> <br /> <img alt="" src="" /><br /> Here's the hostel.<br /> <br /> <img alt="" src="" /><br /> This is the bus driver who took me from Ennis to Doolin. He really got a kick out of my electric scooter!<br /> <br /> <img alt="" src="" /><br /> Here's the only garage in town, where I aired up the scooter tires. (Didn't want to fly with them inflated since they could pop depending on how the baggage compartment is pressurized.)<br /> <br /> <img alt="" src="" /><br /> A group of 20 children went to a field to play stick-ball<br /> <br /> <img alt="" src="" /><br /> More Irish children, happy to go and play<br /> <br /> <img alt="" src="" /><br /> Lots of old buildings around, like this<br /> <br /> <img alt="" src="" /><br /> Many only have one or two walls left. This is hundreds of years old.<br /> <br /> Loving the scenery. Time now for me to go grab a bite to eat.</p><img src="" width="1" height="1" /> 2
|
http://geekswithblogs.net/lorint/Atom.aspx
|
crawl-002
|
refinedweb
| 9,286
| 62.38
|
Hi, I have noticed that using
torch.mm operation using tensor with
sparse_csr layout is significantly slower in pytorch 1.10.2 than in pytorch 1.9.1.
Here is a small code sample I’ve used to test it:
import timeit print(torch.__version__) torch.manual_seed(1233) crows = torch.randint(0, 50, (1000000,)).cumsum(0).int() crows[0] = 0 cols = torch.randint(0, 100000, (crows[-1],)).sort()[0].int() mock_vals = torch.rand_like(cols, dtype=torch.float) csr_mat = torch._sparse_csr_tensor(crow_indices = crows, col_indices=cols, values=mock_vals) dense_mat = torch.rand(csr_mat.shape[-1], 20) print(timeit.timeit("torch.mm(csr_mat, dense_mat)", globals=globals(), number=100))
In pytorch version 1.9.1, this code yields:
1.9.1+cpu 1.9244596790522337
In pytorch version 1.10.2 (same machine), almost same code yields (except this time I use
torch.sparse_csr_tensor instead of
torch._sparse_csr_tensor):
1.10.2+cpu 5.861249879002571
As you can see there is a significant difference in times between those versions. I would like to upgrade to pytorch 1.10.2 but I would also like to use sparse_csr matrix format as it provides speed up in my project. However I’d expect that matrix multiplication would be faster for newer pytorch version. Have I overlooked something?
|
https://discuss.pytorch.org/t/why-is-torch-mm-for-sparse-csr-tensor-slower-in-1-10-2-than-1-9-1/144787
|
CC-MAIN-2022-21
|
refinedweb
| 208
| 56.11
|
I often see people in newsgroups saying how wonderful Visual Studio is, and they often claim it’s the “best IDE in the world”. Strangely enough, most go silent when I ask how many other IDEs they’ve used for a significant amount of time. I’m not going to make any claims as to which IDE is “the best” – I haven’t used all the IDEs available, and I know full well that one (IDEA) is often regarded as superior to Eclipse. However, here are a few reasons I prefer Eclipse to Visual Studio (even bearing in mind VS 2005, which is a great improvement). Visual Studio has much more of a focus on designers (which I don’t
tend to use, for reasons given elsewhere) and much less of a focus on making actual coding as easy as possible.
Note that this isn’t a comparison of Java and C# (although those are the languages I use in Eclipse and VS respectively). For the most part, I believe C# is an improvement on Java, and the .NET framework is an improvement on the Java standard library. It’s just a shame the tools aren’t as good. For reference, I’m comparing VS2005 and Eclipse 3.1.1. There are new features being introduced to Eclipse all the time (as I write, 3.2M4 is out, with some nice looking things) and obviously MS is working on improving VS as well. So, without further ado (and in no particular order):
Open Type/Resource
When I hit Ctrl-Shift-T in Eclipse, an “Open Type” dialog comes up. I can then type in the name of any type (whether it’s my code, 3rd party library code, or the Java standard library code) and the type is opened. If the source is available (which it generally is – I’ve used very few closed source 3rd party Java components, and the source for the Java standard library is available) the source opens up; otherwise a list of members is displayed.
In large solutions, this is an enormous productivity gain. I regularly work with solutions with thousands of classes – remembering where each one is in VS is a bit of a nightmare. Non-Java resources can also be opened in the same way in Eclipse, using Ctrl-Shift-R instead. One neat feature is that Eclipse knows the Java naming conventions, and lets you type just the initial letters instead of the type name itself. (You only ever need to type as much as you want in order to find the type you’re after anyway, of course.) So for example, if I type “NPE”, I’m offered
NullPointerException and
NoPermissionException.
Note that this isn’t the same as the “Find Symbol” search offered by VS 2005. Instead, it’s a live updating search – as you type, the list is updated. This is very handy if you can’t remember whether it’s ArgumentNullException or NullArgumentException and the like – it’s very fast to experiment with.
There’s good news here: Visual Studio users have a saviour in the form of a free add-in called DPack, by USysWare. This offers dialogs
for opening types, members (like the Outline dialog, Ctrl-O, in Eclipse), and files. I’ve only just heard about it, and haven’t tried it on a large solution yet, but I have high hopes for it.
Sensible overload intellisense
(I’m using the word intellisense for what Eclipse calls Code Assist – I’m sure you know what I mean.) For some reason, although Visual Studio is perfectly capable of displaying the choice of multiple methods within a drop-down list, when it comes to overloads it prefers a spinner. Here’s what you get if you type
sb.Append( into Visual Studio, where
sb is a
StringBuilder
variable:
Here’s what happens if you do the equivalent in Eclipse:
Look ma, I can see more than one option at once!
Organise imports
For those of you who aren’t Java programmers, import statements are the equivalent to using directives in C# – they basically import a type or namespace so that it can be used without the namespace being specified. In Visual Studio, you either have to manually type the using directives in (which can be a distraction, as you have to go to the top of the file and then back to where you were) or (with 2005) you can hit Shift-Alt-F10 after typing the name ofthe type, and it will give you the option of adding a using statement, or filling in the namespace for you. Now, as far as I’m aware, you have to do that manually for each type. With Eclipse, I can write a load of code which won’t currently compile, then hit Ctrl-Shift-O and the imports are added. I’m only prompted if there are multiple types available from different namespaces with the same name. Not only that, but I can get intellisense for the type name while I’m typing it even before I’ve added the import – and picking the type adds the import automatically. In addition, organise imports removes import statements which aren’t needed – so if you’ve added something but then gone back and removed it, you don’t have misleading/distracting lines at the top of your file. A feature which isn’t relevant to C# anyway but which is quite neat is that Eclipse allows you to specify how many individual type imports you want before it imports the whole package (e.g.
import java.util.*). This allows people to code in whatever style they want, and still get
plenty of assistance from Eclipse.
Great JUnit integration
I confess I’ve barely tried the unit testing available in Team System, but it seems to be a bit of a pain in the neck to use. In Eclipse, having written a test class, I can launch it with a simple (okay, a slightly complicated – you learn to be a bit of a spider) key combination. Similarly I can select a package or a whole source directory and run all the unit tests within it. Oh, and it’s got a red/green bar, unlike Team System (from what I’ve seen). It may sound like a trivial thing, but having a big red/green bar in your face is a great motivator in test driven development. Numbers take more time to process – and really, the most important thing you need to know is whether all the tests have passed or not. Now, Jamie Cansdale has done a great job with TestDriven.NET, and I’m hoping that he’ll integrate it with VS2005 even better, but Eclipse is still in the lead at this point for me. Of course, it helps that it just comes with all this stuff, without extra downloads (although there are plenty of plugins available). Oh, and just in case anyone at Microsoft thinks I’ve forgotten: no, unit testing still doesn’t belong in just Team System. It should be in the Express editions, in my view…
Better refactoring
MS has made no secret of the fact that it doesn’t have many refactorings available out of the box. Apparently they’re hoping 3rd parties will add their own – and I’m sure they will, at a cost. It’s a shame that you have to buy two products in 2005 before you can get the same level of refactoring that has been available in Eclipse (and other IDEs) for years. (I know I was using Eclipse in 2001, and possibly earlier.)
Not only does Eclipse have rather more refactorings available, but they’re smarter, too. Here’s some sample code in C#:
If I select the last middle lines of the first method, and use the ExtractMethod refactoring, here’s what I get:
Note that second method is left entirely alone. In Eclipse, if I have some similar Java code:
and again select Extract Method, then the dialog not only gives me rather more options, but one of them is whether to replace the duplicate code snippet elsewhere (along with a preview). Here’s the result:
Note the change to
doSomethingElse. I’d even tried to be nasty to Eclipse, making the variable names different in the second method. It still does the business.
Navigational Hyperlinks
If I hold down Ctrl and hover over something in Eclipse (e.g. a variable, method or type name), it becomes a hyperlink. Click on the link, and it takes you to the declaration. Much simpler than right-clicking and hunting for “Go to definition”. Mind you, even that much
isn’t necessary in Eclipse with the Declaration view. If you leave your cursor in a variable, method or type name for a second, the Declaration view shows the appropriate code – the line
declaring the variable, the code for the method, or the code for the whole type. Very handy if you just want to check something quickly, without even changing which editor you’re using. (For those of you who haven’t used Eclipse, a view is a window like the Output window in VS.NET. Pretty much any window which isn’t an editor or a dialog is a view.)
Update! VS 2005 has these features too!
F12 is used to go to a definition (there may be a shortcut key in Eclipse as well to avoid having to use the mouse – I’m not sure).
VS 2005 also has the Code Definition window which is pretty much identical to the Declaration view. (Thanks for the tips, guys :)
Better SourceSafe integration
The source control integration in Eclipse is generally pretty well thought through, but what often amuses me is that it’s easier to use Visual SourceSafe (if you really have to – if you have a choice, avoid it) through Eclipse (using the free plug-in) than through Visual Studio. The whole binding business is much more easily set up. It’s a bit more
manual, but much harder to get wrong.
Structural differences
IDEs understand code – so why do most of them not allow you to see differences in code terms? Eclipse does. I can ask it to compare two files, or compare my workspace version with the previous (or any other) version in source control, and it shows me not just the textual
differences but the differences in terms of code – which methods have been changed, which have been added, which have been removed. Also, when going through the differences, it shows blocks at a time and then what’s changed within the block – i.e. down to individual words, not just lines. This is very handy when comparing resources in foreign languages!
Compile on save
The incremental Java compiler in Eclipse is fast. Very, very fast. And it compiles in the background now, too – but even when it didn’t, it rarely caused any bother. That’s why it’s perfectly acceptable for it to compile (by default – you can change it of course) whenever you save. C# compiles a lot faster than C/C++, but I still have to wait a little while for a build to finish, which means that I don’t do it as often as I save in Eclipse. That in turn means I see some problems later than I would otherwise.
Combined file and class browser
The package explorer in Eclipse is aware that Java files contain classes. So it makes sense to allow you to expand a file to see the types within it:
That’s it – for now…
There are plenty of other features I’d like to mention, but I’ll leave it there just for now. Expect this blog entry to grow over time…
81 thoughts on “Visual Studio vs Eclipse”
Bahar Limaye sounds like a paid astroturfer.
ThatPerson> That’s a pretty significant accusation. I don’t see Bahar’s comment as being any more biased than many of the other comments to this post which show a clear preference for one platform over another.
Jon
Skeet: you are not the suitable person to compare Eclipse and VS. You are a fanatic.
A fanatic? Hardly. The “fanatics” are the ones who claim that one development platform is the best without having experienced any others.
Which of my points do you actually dispute?
(It’s nice to see that VS2008 improves on some of these things, btw – although “VS2005+ReSharper” still beats “VS2008 on its own” from my experience so far. Fortunately ReSharper works with VS2008 too…)
Jon
I have the following Installed:
Visual Studio 6
Visual Studio .NET 2003 (Lots of Add-Ins)
Visual Studio 5 (Lots of Add-Ins)
Eclipse Europa 3.3 (J2EE Package + CDT + TPTP)
NetBeast 5.5 (+Profiler + CDT + Ent. Pack + UML)
Delphi 7 (LOTS of Add-Ins)
My JVM is the latest Java 6 version (all updates). I believe everything on my machine has every update installed that is available for it (unless I missed something a couple of days ago).
Eclipse is slower than all of them. I think it has something to do with the way it loads plugins, and the way the plugins tie to the IDE – but I’m unsure because I’m not an Eclipse developer (or any RCP developer at that). I think my projects are big enough for a good comparison.
Also, My experience has been that Visual Studio .NET 2003 is faster than Visual Studio 2005 (P4 HT 2.8GHz, 1GB RAM, 160GB 7200RPM HD, XP Pro). Eclipse is slower than even NetBeans.
Fruitless arguments of what is faster than what won’t accomplish nothing. There are so many factors that aspect speed (especially start-up/shut-down and you never know when the Framework/Platform decides to Garbage collect unless you force it to [I wrote little apps to do that for me :P]).
It’s just dumb and very unintelligent to argue about it IMO.
Visual Studio 5 = Visual Studio 2005.
Excuse the typo.
I used for the last 4 years VS, and Eclipse for two years now… the two are not even comparable in my book.
I love .Net, for the web its better than Java, but for Application development ill still take Java. VS is exclusively for .Net whilst Eclipse is for almost anything you want, it is so extensible that the sky is the limit. Eclipse way way outperforms VS in almost every feature including performance, debugging, profiling. The refactoring tools are so incredible I have seen nothing to match.
Features like the test and performance tools platform and the web tools platform allow you to running and debugging Servlet containers like Tomcat within eclipse. The perspectives available in eclipse including extensions for CVS, SVN, resource and package views, a web view, and so many more… there is just so much in eclipse feature wise it makes VS look pale!! Eclipse is a platform, VS is an IDE, why compare them?
Peter
The only Java IDE that can compare to Visual Studio is NetBeans ATM. Eclipse lags horribly behind NetBeans when it comes to out of the box functionality and “personality” integration. NetBeans looks like it’s on its way to becomming a better multi-language developer’s tool than Eclipse ATM.
NetBeans is the Visual Studio of the Java world. A role it acquired when Borland/CodeGear bastardized their JBuilder into another Eclipse abomination…
I like Eclipse’s Licensing-Model :)
I disagree with Hrm… (who should use his real name instead of hiding behind a fake one).
I’m a C++ developer for a large company and Eclipse is a better solution due to space constraints I’ve put on VMs. Here’s a small overlook.
Netbeans + JDK (required) (not including CPP Plugin or compiler) = 351 MB
Eclipse + CDT + JRE (required) + Compiler (MinGW + msys) = 232.9 MB
If you want a compiler with netbeans then it is going to cost you more disk space. So I’d say that netbeans is harsher on the resources than Eclipse.
AND – I can simply download an empty shell of eclipse and then add in the C++ compatibility. When I was trying netbeans (after that comment you posted) I uninstalled it immediately (almost) after installing it because of the resources it took to run it; I didn’t even bother to install the CPP plugin because that means even more resources gone. Not only that but you have to install the whole Java Programming IDE and then install the CPP plugin for programming in C++. With Eclipse you don’t have to install the Java programming IDE, just the platform that can run it. And then the CDT (C Dev Tools) plugin and compiler. Which instructions are easy enough to follow.
My final ratings for you after that comment…
Eclipse – A+ for being small and a good solution for most constraints
NetBeans – A- for taking up so many resources but it is still a great IDE for those who want to use it.
I’ll stick with Eclipse.
SAM
Sorry I did a size miscalculation.
Netbeans + JDK (required) (not including CPP Plugin or compiler) = 480 MB
Eclipse + CDT + JRE (required) + Compiler (MinGW + msys) = 232.9 MB
You use Eclipse as your primary C++ Development Environment? Lol.
I don’t see why my name has anything to do with it. Obviously you missed the point of my post, and you think Disk Space is a resource worth worrying about on desktop developer systems…
In a thread comparing VS to Eclipse where VS has an install size of 2-4.5 GB…
Yea, you got me there… Refactor much C++ code in that Eclipse IDE? Lol…
Don’t be so religious, it’s only a program :P
And with NetBeans 6.0 (you should have known this if you have ever heard of the betas/RCs) you can have a base NetBeans with just the bits that you want. The IDE was totally modularized like that, yo!
So the install size won’t be anything near what you stated. Not even close.
Doesn’t change my opinion that Eclipse is a Gorilla, I just finished trying to use it again and had to delete the directory because I cannot dedicate 50% of my computer’s resources to an IDE.
Eclipse’s argument autocompletion is smarter than VS’s, from what I’ve seen – if you’ve got local variables “name” and “town” (both strings) and you call a method with parameters called “name” and “town” it will intelligently guess which should be which. It can be incredibly fast.
Not at all true. If you use a method with parameters, bob and john it will put them in the autocompleted line. It doesn’t matter what local variables you have. It just so happens that often it coincides with variables that you’re using in your method.
Um, no. All you’ve got to do is check “Guess Filled Method Arguments” in the preferences, and it works. For instance, with this code:
public class Test
{
public void check()
{
String theTown = “Reading”;
String theName = “Jon”;
String theCountry = “UK”;
}
public void firstMethod(String town, String name)
{
}
public void secondMethod(String name, String town)
{
}
public void thirdMethod(String name, String country)
{
}
}
If within check() you type first-(CTRL+SPACE) it fills in:
firstMethod(theTown, theName)
If you type second-(CTRL+SPACE) it fills in:
secondMethod(theName, theTown)
If you type third-(CTRL+SPACE) it fills in:
thirdMethod(theName, theCountry)
Try it!
Jon
@Memi – Please don’t take WSAD as indicative of anything. WSAD is nothing like the regular Eclipse – it has many badly written plugins and is very far behind Eclispe (last I say ESAD used Eclispe 2.0 when Eclispe was on 3.0). I have colleagues who were forced to use WSAD at a client’s and who eventually moved to Eclipse because WSAD demanded 2GB of RAM back in 2005.
I’ve used Eclipse for years now. I just downloaded the trial version of VS 2008 Pro. I wanted to try VS since we’ve pretty much migrated to Windows and SQL Server as the basis of our software development (I hope for tighter integration and better performance in the deployed app).
I found this blog, because I was searching for a way to do some of the tasks in VS that I’m familiar with in Eclipse. Is it true that there’s no Quick Fix in VS? I also noticed that the VS editor didn’t seem to highlight compiler errors as I type. Is there an option for this?
I’m going to stick with VS for the trial period and see how much of my current distaste is just lack of familiarity — not knowing how to accomplish the same task in VS — rather than missing features.
I may end up using VS because of .Net integration with Windows, but I suspect I’ll be pining for the development features of Eclipse.
Eclipse is nice but VS2005 is better I try Eclipse for tester and at the beginning I found many good things but is slow and very heavy and pay atention over .net mono, dotgnu (linux)
I think comparing features of Eclipse to VisualStudio2K5 can only be fairly done when comparing the same languages.
For my work (C++ on Windows), I find VS2K5 to do everything I expect of a Windows IDE. The look and feel, shortcuts, drag and drop code, responsiveness, and finally GUI development are all in line with what I expect.
Not long ago, I was doing technology research for a large project and was tasked with deciding the IDE/Language we would work in. I was able to try virtually every professional IDE (great fun!) on the market. In addition I had to get a feel for what the team liked.
The most prominent were: VS2K5/NetBeans/SunStudio/Eclipse/VSExpressEditions
It was my experience that the Windows developers (C++) prefered VS2K5 hands down, followed by NetBeans and Sun Studio. My guess is that all of those IDEs had a similiar look and feel to other MS products. My personal favorite was the ExpressEditions since they seem to run very fast and light but were lacking heavy features that perhaps “real” software engineers demand. My second was VS2K5 followed by NetBeans. Reason?
Well, I took a bit to reopen Eclipse right now and really focus on what turns me away from it.
First, the startup time. This seems to be VERY different depending on platform/configuration. On my laptop, VS2K5 takes 15s. Desktop it takes 4s. On my alternate box it takes 10s. All are minimum 3.0Ghz Machines with at least 1GB-2GBRam. Eclipse by comparison takes upwards of 45 seconds on my laptop, upwards of 45 on another XP box and 20 seconds on the last. I find this performance strange and perhaps to blame for the perception amongst some devs that Eclipse is slow. Although, I do not believe Eclipse could ever get much faster then VS2K5 when configured similiarly as one is C++MFC and the other is Java.
Second, look and feel. First off, I’ve always hated the Eclipse start page, of course you can change/disable it. I find the colors/layout of VS2K5 to be more what I expect from an windows/IDE. Windows in eclipse seem fat and bloated. I tend to have to shrink everything right away to get viewing room. On my original 17inch. I had about 4 inches of ‘coding’ room when Eclipse launched by default. By comparison, VS2K5 in C++ gives you about a bit over 1/3 of your screen by default. Now, on a 22′, this isn’t as much of a problem but I always feel like space is being wasted. This is the same with the intellisense. I don’t want 20 lines in my face, I want 1 line and I can decide if I want to ‘turn the page’ or not. I actually prefer the VS2K5 method. Intellisense also seems to be timed better in VS2K5 in that the popups appear quicker.
Third GUI development, I really and truly thing that C# GUI development is as perfect as it gets in GUI development. As one user above put it, “it’s actually relaxing to develop in C#”. Even tiny things like the layout tools do wonder for producing a stunning application.
Fourth, 3D/Game/visualization development. One of our projects here was to introduce the capability to view data in a 3D visualization (it gives the client a way to correlate data which wouldn’t immediately be apparent). Using DirectX or OpenGL with VS2K5 is the easiest thing since slice bread. Configuration is a breeze and this can be expected from MS to MS products (Direct3D). I would not even want to attempt doing hardcore 3D development in anything else. Perhaps this is why virtually every game in existence was developed using VC++6.0. But, let’s not get too off topic.
As you can see, the majority of my points have to do with usability of the IDE and how it affects your coding experience. I like something lightweight, with intellisense, and a fast compiler, nothing more, nothing less. This is why at home I use Express Versions!
Ultimately, it all depends on the developers background, objectives, experience level and how often they use the common and more obscure tools in the IDE. Very subjective indeed.
no matter how good is my IDE i can’t even code a single beautiful code, i guess i need an IDE that can do the programming for me (i just think what i want the program to do and the code with be made for me) (hahaha) THAT’S THE BEST IDE THAT I WANT TO SEE!
Eclipse suck ;)
Many of the points made above are only valid in the context of VS being used with C#. When VS is being used with VB for example, talk of add-ins like Resharper are irrelevent. This discussion is not comparing IDE’s at all, it is comparing “IDE plus my favourite language”.
I code in VB – I dont even know what refactoring is, it’s just an alien term to me :-)
Why is talk of ReSharper irrelevant when VS is being used with VB? ReSharper is certainly available to help VB.NET developers as well as C# developers. It doesn’t have quite as many features for VB.NET developers, but certainly plenty to recommend it.
Likewise, although you may not be familiar with refactoring, that doesn’t mean that it wouldn’t help you, and the better the refactoring support is, the more potential help it will be to you. It’s quite possible that you’re using some features I would deem to be part of refactoring support, but just don’t apply the term to it. Things like intelligent renaming of a class (with that change being reflected in all the code which uses it).
Jon,
Thanks for clearing up the auto complete thing for me. Really helps a lot.
Another big thank you is for bringing up DPack. I didn’t notice it first time I read through this article. The only thing that is driving me to pull my hair out in VS is lack of ^O. The lack of outline view and refactoring (although resharper solves this) is annoying but not essential. ^O is essential. Maybe you should put around DPack. *ducks*
I am of the opinion that the speed of startup and shutdown shouldn’t be taken into consideration for using an IDE. Both VS2k8 and Eclipse stay open for days at a time so a 1 minute startup time is irrelevant. What is relevant is if the intellisense drop down takes longer than it would for me to type the class name. In other words, for short classes it’s got about half a second to appear. On my laptop (P4 1.8 + 1gig doing far more than it should) both IDE’s have reasonable response times when you’re working in them.
A big bug bear when it comes to VS is that it seems MS have deliberately kept functionality *OUT* of the IDE, allowing plugin developers to sell their stuff to you. ReSharper is something that should be baked into the IDE but isn’t. Why?
I run a MacBook with a 2.0 Intel Core Duo Processor and 2 gbs of ram…and eclipse CRAWLS at times. not just loading, which is a painful minute long ordeal, or closing, which i can’t even measure because it crashes so often i find mself force quitting, but even while coding. Opening a source file causes my ENTIRE computer to hang, not just the program itself. Maybe it’s just the mac version since my colleagues do not have this problem, but I end up seeing most people with Macs prefer VIM over eclipse.
I completely agree I recently transfer my platfor from MS to Java. And I can already see how facinating the Eclipse is. Free IDE that is far more superior than the paid one
Blogger is still as biased as ever, and this blog post is still about as irrelevant as it was over a year ago.
@Hrm:
Yes, clearly being the author of C# book and a C# MVP, I’m *obviously* biased towards Java…
Care to make any *technical* comments which make your point, instead of just ad hominem attacks?
Jon
Hi
while debugging (C program in my case) I found VS has a better feature. for example when I place the mouse on a structure variable var1 of a struct temp, Visual studio fetches the value of temp.var1 and displays it, while eclipse just says ‘No symbol “var1” in current context’, If posted this at but no one seemed to be there to respond. If I am wrong or if there is a solution, please let me know (ramprasad85@gmail.com) Thank you
LikeLiked by 1 person
what a about the missing Back Button in Visual Studio? I really miss that!
I would go with Visual Studio since it will probably have better built-in support. Visual Studio and Eclipse are both excellent IDEs with a wealth of features.For one, Eclipse is cross-platform whereas Visual Studio only runs on Windows.
|
https://codeblog.jonskeet.uk/2005/12/22/visual-studio-vs-eclipse/?like_comment=9530&_wpnonce=cf2bafff8f
|
CC-MAIN-2021-43
|
refinedweb
| 5,072
| 70.33
|
template class for subjects (cfr. Observer Design Pattern). More...
#include <observer.hh>
template class for subjects (cfr. Observer Design Pattern).
You must declare the subject of the observations with:
class my_observed_sbj : public subject<my_observed_sbj>
Than you should call notify() manually or automatically from every method that changes the subject status.
Only attached observers (cfr. attach() and detach() methods) will be notified.
Attach a new observer to this subject.
Detach a new observer to this subject.
Notify all attached observers.
When this method is called every observed_subject::update method is called and "this" subject is passed as a param.
Return to METSlib home page
|
http://www.coin-or.org/metslib/docs/stable/0.5/html/a00035.html
|
CC-MAIN-2013-20
|
refinedweb
| 103
| 54.59
|
Given a multiple-choice test of 10 questions with 5 possible choices (A-E). The answers are given in a text file a long with the student names. Write a C++ program that does the following:
1.Reads the key answers to an array from the input file. The key is the first line in the file
2.For each student read his/her answers and compare their answers with the key array
3.Stores each the answers of each student in an array of (chars)
4.Sends this array to a function to compute number of correct answers per student
5.Computes % of correct answers for each student
6.Stores the scores in an array of (ints)
7.Displays the list of the students along with their scores (counts and percentages)
My code is not reading the names and grades correctly. I am also unsure of how to calculate the grades of the students. Here is the beginning of my code below.
# include <cmath> # include <iostream> # include <iomanip> # include <cstring> # include <cctype> # include <fstream> # include <string> using namespace std; int main() { string x; string temp[1] = {x}; char y = 0; char key[10] = {y}; string a; string name[1] = {a}; char b = 0; char grade[10] = {b}; ifstream fin; fin.open("fin.txt"); for( int i = 0; i < 10; ++i) { fin >> x; fin >> y; } while (fin) { for( int j = 0; j < 10; ++ j) { fin >> a; fin >> b; if (grade[0] = key[0] ) ; if (grade[1] = key[1] ) ; if (grade[2] = key[2] ) ; if (grade[3] = key[3] ) ; if (grade[4] = key[4] ) ; if (grade[5] = key[5] ) ; if (grade[6] = key[6] ) ; if (grade[7] = key[7] ) ; if (grade[8] = key[8] ) ; if (grade[9] = key[9] ) ; // Need some type of function to cout their grade } } system ("pause"); return 0; }
|
https://www.daniweb.com/programming/software-development/threads/400940/reading-from-file-to-an-array-and-computing-the-grades
|
CC-MAIN-2017-43
|
refinedweb
| 301
| 78.99
|
Given an array of n elements, where each element is at most k away from its target position, devise an algorithm that sorts in O(n log k) time. For example, let us consider k is 2, an element at index 7 in the sorted array, can be at indexes 5, 6, 7, 8, 9 in the given array.
Examples:
Input : arr[] = {6, 5, 3, 2, 8, 10, 9} k = 3 Output : arr[] = {2, 3, 5, 6, 8, 9, 10} Input : arr[] = {10, 9, 8, 7, 4, 70, 60, 50} k = 4 Output : arr[] = {4, 7, 8, 9, 10, 50, 60, 70}
We can use Insertion Sort to sort the elements efficiently. Following is the C code for standard Insertion Sort.
C
Java
Python3
# Function to sort an array using
# insertion sort
def insertionSort(A, size):
i, key, j = 0, 0, 0
for i in range(size):
key = A[i]
j = i-1
# Move elements of A[0..i-1], that are
# greater than key, to one position
# ahead of their current position.
# This loop will run at most k times
while j >= 0 and A[j] > key:
A[j + 1] = A[j]
j = j – 1
A[j + 1] = key
The inner loop will run at most k times. To move every element to its correct place, at most k elements need to be moved. So overall complexity will be O(nk)
We can sort such arrays more efficiently with the help of Heap data structure. Following is the detailed process that uses Heap.
1) Create a Min Heap of size k+1 with first k+1 elements. This will take O(k) time (See this GFact)
2) One by one remove min element from heap, put it in result array, and add a new element to heap from remaining elements.
Removing an element and adding a new element to min heap will take Logk time. So overall complexity will be O(k) + O((n-k)*logK)
C++
C
Python3
Output:
Following is sorted array 2 3 6 8 12 56
The Min Heap based method takes O(nLogk) time and uses O(k) auxiliary space.
We can also use a Balanced Binary Search Tree instead of Heap to store K+1 elements. The insert and delete operations on Balanced BST also take O(Logk) time. So Balanced BST based method will also take O(nLogk) time, but the Heap bassed method seems to be more efficient as the minimum element will always be at root. Also, Heap doesn’t need extra space for left and right pointers.
Please write comments if you find any of the above codes/algorithms incorrect, or find other ways to solve the same problem.
|
https://tutorialspoint.dev/language/c-and-cpp-programs/nearly-sorted-algorithm
|
CC-MAIN-2020-40
|
refinedweb
| 450
| 65.76
|
This post describes how to use an Android Listview endless adapter. There are some situations where an Android app with a ListView have to load new data as the user scrolls down. This is the case of an endless adapter. An endless adapter, in other words, is an adapter that loads more data when a user reaches the ListView end. This kind of adapter is useful when there is a large number of items and we don’t want to show them all to avoid a long loading time. This post explains how to implement it.
To implement a Listview endless adapter it is necessary:
- a custom listview
- a listener
- a custom adapter
If you prefer to download the Android app source code directly you can use this link:
In this case, the custom adapter is very simple and we can replace it with something more complex or use the standard android adapter.
Custom Listview endless adapter component
To implement an Android Listview endless adatper it is necessary to code a component that holds the business logic. In this component, we have to find a way to check if the user scrolled all the item inside the ListView and he/she reached its end. Let us begin.
The first step is creating a custom component so we can extend the standard ListView behavior.
public class EndlessListView extends ListView implements OnScrollListener { .. @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { ... } @Override public void onScrollStateChanged(AbsListView view, int scrollState) {} }
At line 1, we extends ListView and implements OnScrollListener to get notified when the user scrolls on the ListView. At line 4, we override onScroll method, called during the scroll. When we reach the ListView end we have to show a view that informs the user to wait until the all the data is loaded. We can use a “trick” to show the wait indicator, we can exploit the ListView footer. We can add and remove it as we need. To make our component configurable we can simply set a view to use a footer:
public void setLoadingView(int resId) { LayoutInflater inflater = (LayoutInflater) super.getContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); footer = (View) inflater.inflate(resId, null); this.addFooterView(footer); }
Let’s focus on the onScroll method. Here we have to check if the firstVisibleElement plus itemCounts (the number of items show inside the ListView) is greater that the total number of items. If this condition is verified then we can fire the event to load more data:
@Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if (getAdapter() == null) return ; if (getAdapter().getCount() == 0) return ; int l = visibleItemCount + firstVisibleItem; if (l <= totalItemCount && !isLoading) { // It is time to add new data. We call the listener this.addFooterView(footer); isLoading = true; listener.loadData(); } }
At line 12, we simply add the footer to inform the user we are loading more data, then at line 13, we set a true a boolean attribute to not fire the event again while we are still loading the data and then we call the listener.
As you can see the listener is very simple:
public static interface EndlessListener { public void loadData() ; }
Just one more thing, when the loading data process is finished our custom ListView must be informed so that we can refresh the items and remove the footer:
public void addNewData(List<String> data) { this.removeFooterView(footer); adapter.addAll(data); adapter.notifyDataSetChanged(); isLoading = false; }
At line 4, we call notifyDataSetChanged to inform the adapter that the dataset is changed.
Test Listview endless adapter: component
To test the custom component we can create a simple layout including our custom"> <com.survivingwithandroid.endlessadapter.EndlessListView android: </RelativeLayout>
and we need a main activity so that :
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); lv = (EndlessListView) findViewById(R.id.el); EndlessAdapter adp = new EndlessAdapter(this, createItems(mult), R.layout.row_layout); lv.setLoadingView(R.layout.loading_layout); lv.setAdapter(adp); lv.setListener(this); }[/xml]</pre> At line 7, we set the footer view then at the line the adapter and at the end we set our activity as a listener for our custom ListView. To emulate the internet loading data, we can simply create an AsyncTask and make our thread sleeps for some seconds. Notice that in the onPostExecute: <pre>@Override protected void onPostExecute(List<String> result) { super.onPostExecute(result); lv.addNewData(result); }
At line 4, we add the new loaded data.
Summary
At the end of this post, you learned how to use a custom adapter to build an endless ListView.
My relatives all the time say that I am wasting my time here at
net, but I know I am getting experience all the time by reading thes good
articles.
|
https://www.survivingwithandroid.com/android-listview-endless-adapter-2/
|
CC-MAIN-2020-05
|
refinedweb
| 786
| 53.41
|
During.
We seem to be missing a link to the forum itself :-)
Good point, added!
and brainstorm.forum.kde.org isn't working any more as well.
the page looks really amazing. the forum was a really great idea.
This is fixed now, address is working again.
New UI looks fantabulous...great job
The new design has a fixed-with layout which makes it impossible to use on a mobile device (since I need to scroll for each line). I'm getting used that KDE websites consistently fail on that part, but at least I can bring it up again ;)
Good point! Will suggest it to the rest of the team.
Hello,
when forum was launched last october you have been very enthusiasic about MyBB.
Why did you change the forum software?
Cheers,
Mark
Btw: Pretty nice style
The main reason is the change in the team. When the forums started there were just Ingo and Rob (which later retired from admining).
Now we're a lot more, so needs and workflows changed: there was also a theme change planned so we took the opportunity to switch to a system most of the team was more comfortable with.
Very very smart design :)
There's one thing though, the list of topics can do with a bit of love. The most important bit of it are the topic names of course because that's what you use to identify threads *and* access them as they're also links. They're not highlighted in any way other than a blue font.
I also think the grey box at the top is far too big for the content it has (at least when not logged in).
I have done some css tweaks to illustrate my point:
Bodge stylish css:
@namespace url();
@-moz-document domain("forum.kde.org") {
a.topictitle { font-weight: bold !important; }
ul.linklist li {display: inline; margin-right: 2em !important;}
ul.linklist li a {font-weight: bold !important; }
.linklist {position: relative; float: right;}
.linklist {position: relative; float: right;}
.panel-mid { min-height: 3em; }
}
Of course it would need proper styles but hope you catch what I mean :)
... for the suggestion. Indeed it looks nice, and i will integrate it into the next rollout.
About bold topictitles, not sure, though. That is used to highlight updated or new topics.
Good point... maybe can be had both ways? how about bold for topic titles, and a different (darker?) row colour for new/updated topics?
|
https://dot.kde.org/comment/106527
|
CC-MAIN-2016-50
|
refinedweb
| 411
| 84.57
|
LWG issue 233 concerns the semantics of the "hint" in the insert member of associative member containers. The current standard reads:
There are two things wrong with this requirement.
The first imperfection is arguably a simple "think-o" in the original standard. It should have stated before instead of after. How else is one to suggest that an element should be inserted before the first element? And with after semantics, what does after end() mean? Whereas with before semantics, every valid iterator used as a hint into a container has a well defined meaning, and any location can be specified.
The second problem reflects a lost opportunity. Especially in the case of multimap, but also even in multiset, just because two keys are equivalent, it doesn't mean that there is no extra information in the value_type. And the order in which those elements appear within the equal_range may impart vital information to the client. For example it might be that elements later in an equal_range represent elements that were inserted at a later time than prior elements in the equal_range. And that information may be important to the client. There is no need for the client to also have to store a time stamp for this purpose if he can simply control the ordering of elements within an equal_range.
The current proposed resolution was last actively discussed in the late 2001 / early 2002 time frame. This is significant because at that time, the LWG was only fixing defects, and specifically not entertaining design improvements. It is now 2005 and the committee is entertaining improvements for C++0X. And one of the big improvements that can be made in this area is to give the clients of associative containers control over the ordering of elements within an equal_range.
For example, what should the following code output?
#include <map> #include <string> #include <utility> #include <iostream>(0, "zero")); m.insert(value_type(1, "one")); m.insert(value_type(2, "two")); display(m); m.insert(m.find(1), value_type(1, "ONE")); display(m); }
The current standard isn't really clear, but implies:
(0, zero) (1, one) (2, two) (0, zero) (1, one) (1, ONE) (2, two)
That is, the new element is inserted after the current "equal element". With such an implementation, there is no way to store a (0, ZERO) such that the new element becomes the first element in the sequence:
(0, zero) (1, one) (2, two) (0, ZERO) (0, zero) (1, one) (2, two)
The current proposed resolution does not solve this problem. It simply swaps the word adjacent for after to clarify that an implementation is allowed (but not required) to first check prior to the hint. This gives library vendors leeway, but does not give the client control of equal_range ordering.
A brief survey of current library implementations reveals differing behavior. Though as the text in LWG issue 233 argues, all implementations can be seen as conforming on this point.
The following libraries
Dinkumware
gcc prior to version 4
Metrowerks CodeWarrior
STLport
output:
(0, zero) (1, one) (2, two) (0, zero) (1, ONE) (1, one) (2, two)
Rogue Wave, and possibly gcc 4.0 output:
(0, zero) (1, one) (2, two) (0, zero) (1, one) (1, ONE) (2, two)
That is, today control over equal_range ordering, if it can be obtained at all, is not portable (even across different versions of the same library). And the current (adjacent) resolution to LWG issue 233 is set to cement that fact.
This paper proposes to make the output of the code example above deterministic by specifying that before semantics should be used instead of adjacent or after semantics, both for consistency with sequence containers, and so that insert before or after any element in the sequence can be specified (including before begin()).
If this proposal is accepted then the above program will portably display:
(0, zero) (1, one) (2, two) (0, zero) (1, ONE) (1, one) (2, two)
This is new functionality, not available in C++03 (at least not portably). This paper submits that this new functionality is valuable, and costs virtually nothing in terms of code size, computational expense, or vendor effort. Clients of std::multiset and std::multimap will be able to view equal_range's as sub-sequences within the container. And will be able to control the order within those sub-sequences throughout the lifetime of the container.
Note that specifying before semantics does not prohibit an implementation from checking after the hint. It only means that implementations must prefer the before location. A subsequent after check could optionally be implemented at the vendor's discretion.
The specification of before semantics is a giant step forward but only gives the client partial control over the ordering within an equal_range. If the hint turns out to be wrong, the client still looses control over where within an equal_range the new element will be inserted.
Andrew Koenig proposed in 2000 the "as close as possible to hint" rule:.
This allows code to always append (or prepend) an equal range with something as simple as:
m.insert(m.end(), value_type(an_int, the_string));
or
m.insert(m.begin(), value_type(an_int, the_string));
Without this suggestion, the semantics of append (or prepend) to an equal range is somewhat more cumbersome to code:
int an_int = key; m.insert(m.upper_bound(an_int), value_type(an_int, the_string));
If inserting a nearly sorted range into a multimap/set (and for
whatever reasons you cannot use the iterator-range insert member), then Andrew's
suggestion becomes more than just a more convenient interface; it becomes
computationally more efficient while ensuring that equal ranges within the
source remain stable as they are inserted into the multiset or
multimap target.
For example:
while (inserting) { ... int key = obtain_int(); ... string value = obtain_string(); m.insert(m.end(), value_type(key, value)); }
vs.
while (inserting) { ... int key = obtain_int(); ... string value = obtain_string(); m.insert(m.upper_bound(key), value_type(key, value)); }
When the key's are encountered in nearly sorted order (and starting with an empty container), then the former loop has O(N) complexity while the latter loop has O(N*log(N)) complexity. If one executed the former loop in order to maintain efficiency, but without the "as close to the hint as possible" rule implemented, then for those few cases where end() turned out to be a bad suggestion, the stable order of equal ranges is no longer guaranteed. To reestablish that guarantee, you must code the more expensive loop with a call to upper_bound for each iteration. Or alternatively one could manually code one of the algorithms presented below (essentially passing responsibility for efficient code from the library vendor to the client).
Once the client is able to fully specify where within an equal_range a new element is inserted, there must be some guarantee that the resulting equal_range is stable throughout the lifetime of the container. LWG issue 371 addresses this concern and provides additional motivation for requiring such stability:
As client code iterates through a multimap or multiset and selectively erases elements, if the ordering of the elements (even within an equal_range) is not stable during this process, then the client could unknowingly avoid iterating over some of the elements in a container. This would break well established idioms:
multimap<int, int> m; ... multimap<int, int>::iterator i = m.begin(); while (i != m.end()) { if (pred(i)) m.erase (i++); else ++i; }
Fortunately binary tree algorithms are designed to preserve in-order order. Node rotations used to rebalance trees (be they AVL, red-black or whatever) do not reorder elements, even if they are equivalent. An implementation would have to go to extra expense, both in terms of code size and in terms of run time computation, in order to change the relative order of elements within an equal_range. Therefore the current status-quo is that all current implementations have the characteristic that equal_range's are stable.
During the course of writing this paper several people expressed to me the desire to make the "insert without hint" function deterministic with respect to equal_range's. My first impression was "not gonna' happen." Not because it was too expensive, or too difficult, but because it would be too controversial in that it would overly restrict vendor options in implementation.
However after further reflection I have changed my mind.
The well-referenced book "Introduction To Algorithms" by Thomas H. Cormen, Charles E. Leiserson and Ronald L. Rivest describes binary tree options in detail, including the red-black and AVL balancing algorithms. The general (non-balanced) algorithm for inserting into a binary tree is given as:
And the balanced-tree algorithms (whether red-black or AVL) start with this unbalanced insert and then proceed to fix up invariants in the tree structure which are broken by the insert. (Disclaimer: red-black is discussed in much more detail than AVL, but I believe the assumption above is valid).
There are two interesting things to notice about this algorithm:
The first point highlights that to find the point of insertion one must traverse the full height of the tree. Finding an equivalent element mid way down, or even at the root, does not preclude the need to navigate down to the leaves of the tree. So even if an entire tree consists on one very long equal_range, if you're going to insert anywhere into that tree, you must still navigate from the root to the leaves, no matter what your equal_range insertion strategy.
The second point highlights that "insert without hint" and "insert at upper bound" can be the exact same operation, with the exact same cost. Indeed, inspection of the original HP implementation reveals the basic Coren/Leiserson/Rivest algorithm. Glancing at the May 1997 issue of CUJ, article "Implementing Associative Containers" by P. J. Plauger reveals the same heritage. A glance at a recent gcc implementation again confirms this trend. Finally a recent survey of current practice confirms that all current implementations of multi_map always insert at the upper bound of an equal range when using the "insert without hint" member function.
#include <map> #include <string> #include <iostream> #include <utility>")); display(m); }
The following implementations:
Dinkumware
gcc
Metrowerks CodeWarrior
Rogue Wave
STLport
output:
)
That is, all existing implementations implement "insert without hint" as "insert at upper bound."
Therefore this paper proposes to standardize existing practice to the benefit of clients by guaranteeing that the "insert without hint" functions of the associative containers append to any existing equal_range in the container.
One understandable reaction to the "as close to the hint as possible" suggestion was a concern that it would cause undue inefficiency either computationally, or in code size. However, this concern turned out to be unwarranted. The suggestion can be simply and efficiently implemented with the following algorithm (on the left) which makes use of the existing lower_bound and upper_bound logic. The existing "ignore hint if wrong" algorithm is presented on the right for comparison. The number of comparisons required to decide if the hint is valid is also listed for each algorithm.
The logic for the two algorithms is very similar, requiring exactly the same tests. The only difference is the use of lower_bound or upper_bound to guide insertion instead of "insert without hint" when x > *p or when x < *(p-1) respectively.
For those implementations wanting to include an after check, the above algorithms can be slightly modified to accommodate. Note that this extra check will only affect complexity, and not the relative order within an equal_range (for the left hand algorithm). Once the after position is in need of checking, the algorithm on the left is going to place x at lower_bound(x), and the only question that remains is whether it will be done with constant or Log(N) complexity.
In either case (with or without the after check), the "insert as close to hint as possible" algorithm is not significantly more complicated nor any less efficient than the "ignore hint if wrong" algorithm (same number of calls to the comparison operator and same complexity in each case).
The differences between the algorithms with and without the "as close as possible to hint" rule are independent of the type of tree. That is, there is nothing red-black specific that is being proposed. The only change in the algorithms is the use of (insert at) lower_bound and upper_bound in place of "insert without hint".
There may still be a concern that "insert without hint" can be cheaper than "insert before upper_bound" or "insert before lower_bound". However the previous section in this paper argues that with respect to all current implementations "insert without hint" and "insert before upper_bound" are exactly the same thing. Furthermore the Coren/Leiserson/Rivest algorithm for inserting (at upper bound) can be trivially modified to insert at the lower bound instead:
Therefore this paper asserts that there is absolutely no extra computational expense proposed herein.
Note: The "as close as possible to hint" rule has no effect on the algorithms used to insert into containers with unique keys. When x does not yet exist in a container, lower_bound, upper_bound and "insert without hint" all refer to the same location. And when x does already exist in a unique-key container, no insertion is performed.
Metrowerks has implemented this proposal (with the additional after check) since 2001.
This proposal seeks deterministic and functional behavior which gives clients complete control over the element order within an equal_range of a multiset or multimap, in some cases providing a significant computational savings, and in no case burdening the client with additional expense. Such control may enable clients to use these standard facilities in more situations, and in more efficient ways.
Paragraph 7:
Paragraph 8:
-8- The insert members shall not affect the validity of iterators and references to the container, and the erase members shall invalidate only iterators and references to the erased elements.
Thanks to Andrew Koenig for submitting LWG issue 233 in the first place, and for originally suggesting the "as close to hint as possible" feature. Thanks also to John Potter who showed how the "insert as close to hint as possible" rule is not nearly as complicated or expensive as I had first feared.
Thanks to Alberto Barbati, Jerry Coffin, Beman Dawes, Raoul Gough, Russell Hind, Christopher Jefferson, Bronek Kozicki, Daniel Krügler, Branimir Maksimovic, Guy Middleton, Nicola Musatti, John Potter, Larry I Smith and Maxim Yegorushkin for helping with the survey of current practice.
This paper acknowledges the work of the prior LWG issue 192 which was pretty much right on target, just ahead of its time.
|
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1780.html
|
crawl-001
|
refinedweb
| 2,427
| 50.67
|
Summary:.
As an example of this, today I'm going to share some Java Swing source code where I create a translucent JFrame. To make it a little more interesting/real, I've added a a JTextArea and JScrollPane to show you how it works, and how it looks.
Create a transparent JFrame with one magic line
Actually, creating a transparent JFrame on Mac OS X is no big deal, at least not as long as you're using the right software versions. The only line of code you really need is shown here:
editorFrame.getRootPane().putClientProperty("Window.alpha", new Float(0.8f));
This special Window.alpha property -- which is Mac OS X specific -- lets you set the translucency level of your JFrame or JWindow. If you're not shipping your product to other users on a variety of other systems where you need to check the operating system and revision level, this is all you have to do.
You can set this
Window.alpha property anywhere between
0.0 and
1.0, with the lowest values making your window almost invisible. I'll show the effect of different settings shortly.
My Java translucent JFrame source code
I've written an example Java/Swing application to demonstrate this JFrame transparency effect on Mac OS X, and I'm sharing the source code here. Most of the code is boilerplate Java Swing code, but here's a quick description of it:
- I create a
JFrameobject named
editorFrame.
- I create a
JTextArea, place that in a
JScrollPane, and place that in the center panel of the
JFrame's default
BorderLayout.
- I set the
Window.alphasetting, as shown above.
- I center the
JFrame, and then make it visible.
Given that introduction, here's my sample Java code:
package com.devdaily.swingtests.transparency; import javax.swing.*; import java.awt.BorderLayout; import java.awt.Dimension; /** * Creates a translucent frame (jframe) on Mac OS X. * @author alvin alexander, devdaily.com */ public class MacTranslucentFrame { public static void main(String[] args) { new MacTranslucentFrame(); } public MacTranslucentFrame() { SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame editorFrame; editorFrame = new JFrame("Java Mac OS X Translucency Demo"); editorFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); // this is what sets the transparency/translucency on Mac OS X editorFrame.getRootPane().putClientProperty("Window.alpha", new Float(0.8f)); // create and add a scroll pane and text area JTextArea textArea = new JTextArea(5, 30); JScrollPane scrollPane = new JScrollPane(textArea); textArea.setText("Hello, world"); scrollPane.setPreferredSize(new Dimension(300, 185)); editorFrame.getContentPane().add(scrollPane, BorderLayout.CENTER); editorFrame.pack(); editorFrame.setLocationRelativeTo(null); editorFrame.setVisible(true); } }); } }
Sample screenshots
Here are a few sample screenshots of this application running. I set the translucency at three different levels for these shots:
0.8f,
0.6f, and
0.4f. The application is running in front of a blue background, with a folder intentionally placed behind the
JFrame.
Here's the translucency with a setting of
0.8f:
Here's roughly the same screen shot with a translucency with a setting of
0.6f:
And finally here's roughly the same screen shot with a translucency with a setting of
0.4f:
This is a very cool effect for Java Swing applications on the Mac platform. I've written my own custom editor that I use on the Mac, and this is one of those nice effects that gives an application a little extra "something" that customers appreciate.
|
https://alvinalexander.com/blog/post/jfc-swing/how-create-transparent-translucent-java-frame-jframe-mac/
|
CC-MAIN-2020-16
|
refinedweb
| 561
| 50.63
|
Challenge
Kiran has a problem. He's working on a project and doesn't know how. Let's help
My Solution
Kiran wants to build a "circle with arcs" chart, but he's having trouble. He asked for help so here we are :)
I livecoded this one from the Paris airport so there's no sound in the video. I was too shy to narrate my actions in the middle of a busy Starbucks. Maybe next time.
Anyway, to build an arc circle like this, we can take many cues from how you would build a piechart. Arcs are still arcs: They're round, have an inner and outer radius, and represent a datapoint. We can layer them on top of each other with a band scale feeding into radiuses.
Like this 👇
First you need a dataset
We fake the dataset because Kiran didn't provide one.
// 5 percentages represent our datasetconst data = d3.range(5).map(_ => ({name: Faker.hacker.verb(),percentage: 75 * Math.random(),}));
5 datapoints, fake name with faker, and a random chunk out of 75%. Tried going full 100 at first and it didn't look great at all.
Then you need a parent component
const CircleArcs = ({ data, maxR }) => {const rScale = d3.scaleBand().paddingInner(0.4).paddingOuter(1).domain(d3.range(data.length)).range([0, maxR]);return (<g><Circle cx={0} cy={0} r={maxR} />{data.map((d, i) => (<Arc d={d} r={rScale(i)} width={rScale.bandwidth()} key={i} />))}</g>);};
A functional component will do. Create a band scale for the radiuses. Those cut up a given space into equal bands and let you define padding. Same scale you'd use for a barchart to position the bars.
The band scale is ordinal so our domain has to match the number of inputs,
d3.range takes care of that. For our dataset that sets the domain to
[0,1,2,3,4].
Scale range goes from zero to max radius.
Render a
<Circle> which is a styled circle component, loop through the data
and render an
<Arc> component for each entry. The arc takes data in the
d
prop, call
rScale to get the radius, and use
rScale.bandwidth() to define
the width. Band scales calculate optimal widths on their own.
We can use index for keys because we know arcs will never re-order.
The parent component needs arcs
That's what it's rendering. They look like this
const Arc = ({ d, r, width }) => {const arc = d3.arc().innerRadius(r).outerRadius(r + width).startAngle(0).endAngle((d.percentage / 100) * (Math.PI * 2));return (<g><Label y={-r} x={-10}>{d.name}</Label><ArcPath d={arc()} /></g>);};
A D3 arc generator defines the path shape of our arcs. Inner radius comes from
the
r prop, outer radius is
r+width. Unlike a traditional pie chart, every
arc starts at angle zero.
The end angle makes our arcs communicate their value. A percentage of full circle.
Each arc also comes with a label at its start. We position those at the
beginning of the arc using the
x and
y props. Setting their anchor point as
end automatically makes them end at that point.
const ArcPath = styled.path`fill: white;`;const Label = styled.text`fill: white;text-anchor: end;`;
Styled components work great for setting pretty much any SVG prop 👌
And the result is a circle arc chart thing. Wonderful.
For #ReactVizHoliday Day 14 we solved the @kiran_gaurang challenge: How do you build a arc circle chart thing— Swizec Teller (@Swizec) December 22, 2018
Solved live from the Paris airport because free wifi in France gets 3000kb/s upload 👌
👉 pic.twitter.com/QwDAS7L63o
|
https://reactfordataviz.com/cookbook/15/
|
CC-MAIN-2022-40
|
refinedweb
| 607
| 77.13
|
SocketAddress class. More...
#include <SocketAddress.h>
SocketAddress class.
Representation of an IP address and port pair.
Definition at line 37 137 of file SocketAddress.h.
Get the human-readable IP address.
Allocates memory for a string and converts binary address to human-readable format. String is freed in the destructor.
Get the raw IP bytes.
Definition at line 119 of file SocketAddress.h.
Get the IP address version.
Definition at line 128 of file SocketAddress.h.
Get the port.
Definition at line 146 of file SocketAddress.h.
Test if address is zero.
Copy address from another SocketAddress.
Set the raw IP address.
Set the IP address.
Set the raw IP bytes and IP version.
Set the port.
Definition at line 101 of file SocketAddress.h.
Compare two addresses for equality.
Compare two addresses for equality.
|
https://os.mbed.com/docs/mbed-os/v6.13/mbed-os-api-doxy/class_socket_address.html
|
CC-MAIN-2021-49
|
refinedweb
| 135
| 56.93
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.