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
Securing your environment by enforcing and utilizing digitally signed scripts is easy with the features built into Windows and Windows Scripting Host (WSH). Last week we discussed digitally signing your scripts within VBScript. Digitally signing scripts allows you to verify who authored a script as well as ensure that the script has not been altered since the script was originally signed. By enforcing the use of digital signatures within your scripts, you can increase the security of your environment and add an additional layer of protection from many of the script-related attacks that are common today. This week we demonstrate how to enable the enforcement of digitally signed scripts within your Windows environment. Enforcing digitally signed scripts requires the modification of the registry. Please make sure you know what you're doing before attempting modification of the registry. To enforce digitally signed scripts you must create a new REG DWORD key called TrustPolicy in the registry under the following hive: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings\ The following values are possible for this key: 0 = All scripts can run and there is no warning 1 = A warning dialog box is displayed showing the security status of the script. Unsigned scripts can still run 2 = Scripts require verification of the signature before a script can be ran. Unsigned scripts cannot run To import these settings into your registry, create a file called EnforceSig.reg and paste the following into the file: --------------- Copy section after this line ---------------- Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Script Host\Settings] "UseWINSAFER"="0" "TrustPolicy"=dword:00000000 -------------------------- End Copy ------------------------- Note: The UseWINSAFER line is only required on Windows XP. After you paste this text into the file and save it, you can run it to import the settings above into the registry. Notice that I have set "TrustPolicy" to 00000000 by default. If you want to restrict the settings, change this to 00000001 or 00000002 as noted above. Also note that there has been some confusion over the use of script signing support in Windows XP. Windows XP includes a new policy type called Software Restriction Policy (SRP). To use the backward compatible Script Trust Policy, you must first disable SRP. To disable SRP: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Script Host\Settings\TrustPolicy a) WINSAFER set to 1 = SRP will be used, and "TrustPolicy" will be ignored b) WINSAFER set to 0 (or not present) = the "TrustPolicy" setting will be used. Next week we will show you how to programmatically sign your VBScripts.
http://www.itworld.com/article/2784534/windows/vbscript---enforcing-the-use-of-digital-scripts.html
CC-MAIN-2016-40
refinedweb
420
51.18
As has been widely reported, the district court in the Oracle v. Google case has issued an order holding that the "structure, sequence and organization" (SSO) of 37 J2SE 5.0 API packages is not copyrightable. Oracle is expected to appeal. The API packages at issue, comprising over 600 classes and over 6,000 methods, form part of the 166-package class library bundled with Sun's J2SE 5.0 JDK and JRE products. The accused 37 of the 168 packages in the Android Froyo platform's Dalvik class library substantially replicate the namespace hierarchy, class declarations, and method declarations of these J2SE packages, and provide equivalent functionality. Oracle claimed that this replication was copyright infringement, despite the fact that Google's implementations of the classes and methods were independently developed. From a source code perspective, 97 percent of the corresponding 37 API packages in the two platforms was dissimilar. No US court had previously examined the copyrightability of APIs, let alone the SSO of a set of APIs. As was true of the recent SAS v. WPL case in the EU, the issues here principally involved the distinction between copyrightable expresson and noncopyrightable idea. Section 102(b) of the 1976 Copyright Act codifies this distinction, stating that copyright does not "extend to any idea, procedure, process, system, method of operation, concept, principle, or discovery". In asserting an SSO infringement theory, Oracle was drawing on a line of cases that had recognized a residual copyright interest in software where there was no literal copying of source or object code. As the court explained, judicial support for nonliteral software copyright infringement theories peaked in the 1980s. Since then, courts have been more cautious, mindful of 102(b) and the need to prevent extension of patent-like monopolies to the copyright sphere. The holding There were two parts to the court's holding. First, the court addressed Java platform APIs on an individual level. The court held that anyone could replicate the functionality of the API classes and methods, using identical declarations, so long as the implementations did not copy from the original version. The court made much of the fact that Java's syntactic rules mandated use of identical declarations (modulo class and method names) in order to develop an independent implementation that would provide the same functionality as the original. Under the merger doctrine, where there is only one way of expressing a given idea, no one can claim copyright ownership of such expression. While it was not necessary to replicate the names used in the API packages, names are themselves not copyrightable. Despite the emphasis on Java syntax, the court's reasoning seems applicable to APIs generally, as well as to typical varieties of the technically distinct category of web services APIs. The court then addressed the copyrightability of the 37 API packages as a whole. Oracle claimed that it was copyright infringement to group the various packages, classes and methods in the same taxonomic manner as the J2SE class library. Nothing in the Java language dictated any particular organization in order to provide equivalent functionality. However, the court considered the J2SE organization to be a noncopyrightable utilitarian "command structure" for carrying out specified functions. Moreover, interoperability considerations suggested that the 37 API packages as a whole were a 102(b) "system" or "method of operation". Essentially, the court concluded that it was necessary for Google to provide the same "command system" with the same taxonomic organization, names and functional specifications in order for some of the massive amounts of existing third-party Java code to be easily portable to Android, since such existing code assumed the availability of common Java platform APIs. Relevance for open source It is an interesting peripheral fact that both Oracle and Google release versions of the relevant class library codebases to the public under open source licenses. Source code for the Dalvik class library, which is based on a subset of the late Apache Harmony project, is available under the Apache License 2.0. Oracle has continued Sun's post-2006 practice of releasing source code for versions of the Java SE class library under GPLv2 with the Classpath Exception, as part of the OpenJDK project. The Classpath Exception, which transforms GPLv2 into an MPL-like weak copyleft license, was adapted from the license for the GNU Classpath project. GNU Classpath (which remains in active development) and Apache Harmony, both of which aimed to produce complete independent implementations of core Java class libraries, are legacies of years of tension between the free software developer community and Sun over the latter's efforts to maintain control over Java, one lasting effect of which was a cultural isolation of the open source Java ecosystem. The issue of API copyrightability has deeper historical resonance. Much of the history of free software has been characterized by efforts to develop replacements for elements of dominant or popular proprietary platforms, systems and protocols. This is seen not only in the various free JVM and Java compiler and runtime projects, but also in the earlier efforts to develop unencumbered clones of Unix (GNU, late versions of BSD and their descendants, and Linux). "Interoperability" in the sense meant in the Oracle v. Google order may be seen as an objective of many such projects. During the late 1980s and early 1990s, pivotal years for the development of free alternatives to proprietary Unix, the free software developer subculture was aware and fearful of judicial recognition of nonliteral infringement theories in software copyright cases. While the influential Richard Stallman was prominent in calling attention to the dangers of "interface copyright", his critics accused him of advancing a theory similar to interface copyright in his interpretation of the GPL as applied to software libraries. (The introduction of the LGPL was, in part, a product of this conflict.) But both pro-copyleft and anti-copyleft camps were united by a basic belief that law should not be used to prevent the development of unencumbered interface-compatible reimplementations of proprietary software. The Oracle v. Google decision on API copyrightability, which one suspects validates the policy intuitions of most developers, is well within the spirit of that belief. 12 Comments Oracle lost the patent phase of the trial. Oracle lost the copyright phase of the trial. Google's supporters, including me, are celebrating Google's victory. There is another victory here for open source that is not so obvious but may be even more important than the two listed above. When Oracle sued Google Oracle not only failed to obtain any money but they lost the majority of the patents that they used in this case. This puts those companies who are contemplating attacking open source with software patents on notice (again) that by doing so they are risking losing their software patents. Lawyers may not have a clue about prior art which does not appear in the patent records but the open source community sure does. --------------------------------- Steve Stites Yet another loss. Oracle has been ordered to pay Google's legal fees which amount to about $300,000.... ------------------------------ Steve Stites The problem is not the copyrightability of the API but the fact that Google advertized programmers trying to convince them that the Google-made implementation was fully compatible with the JDK/JRE specs. Google has created a compatibility nghtmare that costs a lot to application developers and defames the name of the Java platforms. We MUST say that the Android SDK is definitely NOT compatible with the Java JDK. The abuse made by Google is in saying that the development would be the same. Google broke the contract offered in Java "Develop once, deploy anywhere". As long as Google will not satisfy the compatibility test, or will reject bug reports related to its own implementation in the Adroid DSK, Google should not abuse the names and should instead use its own package names. The Android platform is definitely not compatible. Applications have to be redeveloped and retested specifically for Android, the test on other mobile platforms certified (e.g. Nokia) are not enough. Google lies to developers and to customers of devices running Android. It even created its own compatibility test, just as a commercial tactic to create another non-open marketplace for mobile applications. So the copyright abuse is really in the abusive use of the Java reference name for too long. We know that Google lied to everyone (even to the court) and decided to abuse the name, just to refuse to open its own new proprietary platform. Remember this : Android is definitely NOT open, much less than Java. Google did not even want to get a licence in order to be able to integrate its specification in the Open platform to ensure the compatibility contract "develop once, deploy anywhere". So Android applications now can no longer be deployed on Java platforms (mobiles, set tob boxes, TVs, media center appliances), and Java applications can no longer be deployed on Android devices. Google has created its own **closed** platform when insisting that it would be compatible with Java. Do you really defend Google's closed platform here ? And the breach not really in terms of copyright but in trademarks and on Google's Android developer sites ? If Oracle provided the TCK with an acceptable terms of use, then google would just implement java se or me. What oracle cares about is only to keep control and get the money. Oracle gets much less control than what Google does with Android (which is all about controling the Google Apps Store and monetize it MUCH more than what Oracle does with really open licences). But Google did not want any one of the available licences for Java (oncluding those that come at no cost). Google wanted to promote its own new standard, and broke the interoperability, rejecting also the ISO standard specifications, rejecting the GPL principles. Just compare the licence now wanted by Google for using its Andoid SDK : it is FAR WORSE for everybody than any available licences proposed by Oracle for Java. The whole problem is there: Google had the choice, including with open licences. And rejected it. It wanted to get things outside of those licences as if it was a property thing. But the main problem for everyone is that Google broke the interoperabiity, and REFUSED to adapt its SDK to cooperate with the open Java community. Who's more open ? Certainly not Google. What was asked to Google was to participate to the community if he wanted to influence the content of the JDK but also get official long term support for his propose extensions. And The community could have had a voice to tune what Google proposed, to make sure that Java would remain portable and not limited to Android. There's absolutely NO community voice n the Android SDK. All is proprietary and decided by Google alone, that then forces all developers to follow his OWN decisions in the Android SDK. And force all developers to redevelop their apps for Android, testing them explicitly for Android. Google has even failed to make Android portable with itself ! The upward upgradability which is a clear advantage of the Java platform is no longer true in Android alone. I insist: the Android platform is a CLOSED platform because NOBODY else than Google can support it and because Google constantly includes new barriers including across its versions, forcin even the Androif developers to get new trainings, rebuild their apps, ultil Google will finaly vampirize those apps by creating its own version that will be the only one maintained across versions. Effectively Google plays now the same closed game that Microsoft used in Windows (much less problematic today, Winphones are almost out of the market), then by Apple (with IOS). Java was designed to work on all platforms. But now even Google blocks a compliant Java VM from running on Android devices (because it would mean that the same apps that may run on iPhones and Nokia could run on Android without changes) : this would mean that Google would no longer have controls on the contents available on mobile devices, meaning more competition between content providers and no more dependency with smartphone builders. No more need to wait indefinitely for a firmware update by the OSM manufacturer. The VM would run correctly, would upgrade seemlessly, and applications would still work on these updated VMs. This is simply impossible with proprietary OSes like Android (and iOS, WinPhone)and on other devices (directly on your HDTV, or in your settop box, with a much wider market of apps working everywhere on all our screens). I insist: the problem is not the copyrightability of an API but what kind of services this API is suppose to be used for. Google promises all sorts of things (including copying the documentation of the JDK from Oracle/Sun, and most of its Java source code), but fails in every other aspects. the Android VM is NOT working like Java. This means that Goofle lied even to customers and developers by republishing the JDK documentation WORD FOR WORD, but refusing to make the Android VM working as promissed in this copy. This is a clear defamation of the work made by Oracle/Sun and its open community to specify it and make it interoperable under clear design patterns. Google did not even needed to reject Java to develop its own application market (now renamed Google Play, because Apple won against Google that called its Appstore like what Apple did for his iPhones/iOS platform). Do you only know that Java works in open licences ? Including independant distributions where many core classes have been rewritten differently (including critical ones such as those involved in performance such as Security classes, 2D/3D rendering, audio/video codecs, and interoperability classes with lots of services like XML, HTML, CSS, web services, and high wuality mathematical packages (that DON'T run correctly on Android which produces wrong results, something that has never happened since several decenials in Java !) "The problem is not the copyrightability of the API but the fact that Google advertized programmers trying to convince them that the Google-made implementation was fully compatible with the JDK/JRE specs. Really? Can you provide a link? Google has created a compatibility nghtmare that costs a lot to application developers and defames the name of the Java platforms. How does this 'cost' developer? How does a product called 'android' defame a separate product called 'java'? That's like saying the Microsoft's impmentation of SQL defames MySQL's implementations. Droid and Java are two separate implementaions of similar concepts as are MS-SQL and mySQL-SQL... "Android SDK is definitely NOT compatible with the Java JDK" Where is the expectation that they would be? The abuse made by Google is in saying that the development would be the same. Can you point to a reference where Google stated that developing java on a Sun E10K would be the same as developing in Android for a cellphone? Really? REALLY? Google broke the contract offered in Java "Develop once, deploy anywhere". I want to see a copy of this contract. RODA doesn't exist in Oracle's implementation java (lookup "headless" sometime, or their implmentation of serial communications). You seem to be stuck on this idea that java and android are the same. Wheras they are only similar. "As long as Google will not satisfy the compatibility test, or will reject bug reports related to its own implementation in the Adroid DSK, Google should not abuse the names and should instead use its own package names. So no one else can have a 'System' class or an IO class? I don't think sun was particularly original with coming up with those names. "The Android platform is definitely not compatible. Applications have to be redeveloped and retested specifically for Android, the test on other mobile platforms certified (e.g. Nokia) are not enough. Welcome to the real world of software developement and configuration management. This is why my company is still using a 12 year old version of Windows - and java compatibility is not going to fix that either. And why I have to have 4 versions of Oracle's jInitiator on my pc to run Oracle e-business. Google lies to developers and to customers of devices running Android. It even created its own compatibility test, just as a commercial tactic to create another non-open marketplace for mobile applications. What did they say that was a lie? Anyway, I believe that there are more aps for Android than for any other mobile platform, so I am not sure delopers are having a hard adopting the Android platform. Btw: Where is it written the Google MUST provide and 'open' platform? "We know that Google lied to everyone (even to the court) and decided to abuse the name, just to refuse to open its own new proprietary platform. We know that they lied? I wasn't there, so how would I know that? Were they sight for contempt? What "lies"? Show us the attribution of you claims? Remember this : Android is definitely NOT open, much less than Java. Is it supposed to be open? So what if it isn't? I don't know what point you are trying to make. Do you think that Oracle ERP, webcenter, or iFiles is 'open'? Google did not even want to get a licence in order to be able to integrate its specification in the Open platform to ensure the compatibility contract "develop once, deploy anywhere". Why would Google want their smart phone os to be run on TV tuners, DVR's, Camcorders, Torque Wrench Controlers, etc? Who says they have to? Who would expect that they would? One of my biggest beef with software vendors is how 'generalized' their enterprise software is - I end up paying to have the needs of asprin factories addressed in my software for running a CNC mill. A cell phone OS should work best on a cell phone. So Android applications now can no longer be deployed on Java platforms (mobiles, set tob boxes, TVs, media center appliances), and Java applications can no longer be deployed on Android devices. Google has created its own **closed** platform when insisting that it would be compatible with Java. You mean they did the same as Apple, RIM & Microsoft? Shame on them. And yet they are far and away the most popular OS, go figure. Do you really defend Google's closed platform here ? And the breach not really in terms of copyright but in trademarks and on Google's Android developer sites ? Listen, you have to defend them. You cannot have freedom only for some people (open source or nothing). If Google, or anyone for that matter want's to create software who are we to critisize? We're not foced to use it. The Open source community should be left alone to inovate, and so should comercial industry. Google, as far as I can tell, is not bent on a campaign of stamping out the competition. Google is not extorting licencing fees from unsuspecting users, Google's search engine does not pop-up in my Explorrer window every time I mis-type a URL or path. I am not a google slappy-fan, I actually don't even have an Android phone, but having dealt with Oracle's products and their people, I really don't find much sympathy for them in any of their misfortunes The whole point of APIs is vendor's try to provide a tool that locks developers into their technology. Saying that Google is closed while Oracle is open forgets that Oracle takes over companies just to force Oracle down the throats of their customers at an ever increasing price. Thinking that Oracle is not going to do that to Java is naive. Does this API judgement mean we can clone O/S interfaces (kernel calls and libraries) with impunity? Modulo of course, avoiding patented solutions in implementations. Does this API judgement mean we can clone O/S interfaces (kernel calls and libraries) with impunity? The decision includes it its motivation the fact that the "copied" API is that of a programming language, and that using the same API structure, calls, etc. (which are nevertheless implemented differently) is technically necessary for trying to achieve interoperability, .i.e.: writing Java programs that have a chance to work on both platforms, and that this is not a violation of copyright. Extending this reasoning to OS interfaces requires a next step, but that is not such a big step IMHO. It would be no problem if the API implemented did really perform the same thing, with the same security levels and paradigms. The Andoid version violate several of these paradigms, notably they don't throw the documented exceptions (they could throw derived exceptions), but often silently return a default value without signaling anything to the application. When exceptions are expected to check the security of some applicationso that the exception handler will give an alternate execution path that is expected and only capable to produce the correct result, or when applications are not prepared to receive siliently a NULL default value so that now they fail by generating fatal errors when attempting to reference them, this is a severe problem. Given that these Android API are different, they should definitely not use the same class names (or should be in separate replacement packages, allowing then application developers to create support classes for either platforms and easier testing to be compatible to both oin a single unified code). This is not possible. The Android implementation is not an independant implementation, it breaks all Java programming paradigms : write once, deploy everywhere, with an upward compatibility that the Java promissed. And here it is definitely not a question of bugs (that could be identified, and should be corrected, allowing also the development of temporary workarounds if the platform is clearly identifiable, using a custom classloader that will solve or workround some known bugs in specific versions) If Google had particopated to the normal developement of the Java platform, it would benefit from all bug corrections that will now affect both platforms independantly and that will add up to more bugs for all applications and all users. This is a loss of time, when everything was open on the Java platform (including for corrections that were documented in one place accessible to everyone). The GNU classpath for example complies to the Java platform, even if it still does not support everything. It has its uses and limitations that are now documented in the JDK, and that also allows the Java platform to develop new standard libraries in upper layers that solve common problems that are hard to solve cleanly between the implementations. These addons then can be optimized and be prefered to solve all these problems, including using "hidden" workaround as part of their internal implementation, without affecting the blackbox API. An in fact, most of the implementations that are now part of the standard JVM distributions have been contributed by the Java community, The decision to choose one impelmentation to another was a long process where each API was scrutinized with the best current practices and knowledges collected by the community (all these researches and developments are easily accessible to everyone, including the history : there's nothing like this in Android where its platform and its evolution is discussed secretely by a few mysterious people). Hello Philippe, I am not a Java programmer (I prefer other languages), so I can't comment on the problems you mention, and I am not discussing that they may be real technical issues for the Java programming community. I share with you the idea that if something is called "Java" it should behave as "Java" is supposed to. If it does not, it is a bug, or an implementation mistake, and not counterfeiting a copyright. Also note that it is much easier to do a consistent implementation, running everywhere in almost the same manner, avoiding much of the problems you mention, if you are the only one implementing something. In relation to this news, and the intellectual property concerns it addresses, I believe this is a great decision and precedent created for open source projects, whether it is for implementing another Java, or any other programming language as free software. There has been a similar decision recently in Europe by the Court of Justice of the European Union in Case C-406/10 SAS Institute Inc. v World Programming Ltd, 2 May 2012 about a programming language for statistical analysis.... And I can only be happy that such type of decisions are shared elsewhere in the world. Reading the decision of the judge of the US District Court for Northern California, you can see that the court has made a real effort to understand what is a programming language, what is an API, in order to apply legal principles on what can be protected through copyright, and what can't. That's a remarkable work that this American judge has done. Java was cobbled together from existing technology. There was nothing new about when it came out. A close examination would show Oracle is vulnerable to the same accusations it is leveling.
https://opensource.com/comment/34083
CC-MAIN-2017-22
refinedweb
4,228
50.57
* import java.util.Vector; 43 44 /** 45 * This is the symbol table entry for the #include statement. 46 **/ 47 public class IncludeEntry extends SymtabEntry 48 { 49 protected IncludeEntry () 50 { 51 super (); 52 repositoryID (Util.emptyID); 53 } // ctor 54 55 protected IncludeEntry (SymtabEntry that) 56 { 57 super (that, new IDLID ()); 58 module (that.name ()); 59 name (""); 60 } // ctor 61 62 protected IncludeEntry (IncludeEntry that) 63 { 64 super (that); 65 } // ctor 66 67 public Object clone () 68 { 69 return new IncludeEntry (this); 70 } // clone 71 72 /** Invoke the Include type generator. 73 @param symbolTable the symbol table is a hash table whose key is 74 a fully qualified type name and whose value is a SymtabEntry or 75 a subclass of SymtabEntry. 76 @param stream the stream to which the generator should sent its output. 77 @see SymtabEntry */ 78 public void generate (Hashtable symbolTable, PrintWriter stream) 79 { 80 includeGen.generate (symbolTable, this, stream); 81 } // generate 82 83 /** Access the Include type generator. 84 @returns an object which implements the IncludeGen interface. 85 @see IncludeGen */ 86 public Generator generator () 87 { 88 return includeGen; 89 } // generator 90 91 //d44810 92 /** Set the fully-qualified file specification of this include file. */ 93 public void absFilename (String afn) 94 { 95 _absFilename = afn; 96 } 97 98 //d44810 99 /** Access the fully-qualified file specification of this include. 100 @returns a string containing the path of the include file. */ 101 public String absFilename () 102 { 103 return _absFilename; 104 } 105 106 /** Add an IncludeEntry to the list of files which this included 107 file includes. */ 108 public void addInclude (IncludeEntry entry) 109 { 110 includeList.addElement (entry); 111 } // addInclude 112 113 /** Get the list of files which this file includes. */ 114 public Vector includes () 115 { 116 return includeList; 117 } // includes 118 119 static IncludeGen includeGen; 120 /** List of files this file includes */ 121 private Vector includeList = new Vector (); 122 //d44810 123 /** Absolute file name for .u file generation. */ 124 private String _absFilename = null; 125 } // class IncludeEntry
http://checkstyle.sourceforge.net/reports/javadoc/openjdk8/xref/openjdk/corba/src/share/classes/com/sun/tools/corba/se/idl/IncludeEntry.html
CC-MAIN-2018-13
refinedweb
326
53.51
Features/GTK3/Porting Contents - 1 Porting an existing activity to GTK3 - 1.1 Preparation - 1.2 Cleanup, adopt to API changes in the sugar-toolkit - 1.3 Port the activity from GTK2 to GTK3 - 1.4 Make a release - 1.5 Tips to Activity Developers Porting an existing activity to GTK3 This is a guide to porting an existing activity from GTK2 to GTK3. It also shows the changes to use the new Sugar toolkit that also now uses GTK3. This guide uses the hello-world activity as a simple example. Preparation Before you start porting your activity you are encouraged to branch off a stable branch. This will allow you to keep on doing stable releases on the stable branch and new releases on the master branch. The latest release was version 3. We highly recommend that you use the 'sugar-0.94' as the stable branch name because this will keep the repositories consistent and eases the development work. In git you can create a branch like this: git branch sugar-0.94 This creates a local branch, as you can see by running 'git branch'; you should see the following: [erikos@T61 helloworld]$ git branch * master sugar-0.94 The 'sugar-0.94' branch is only available locally, as you can see by running 'git branch -r' which shows the remote branches: [erikos@T61 helloworld]$ git branch -r origin/HEAD -> origin/master origin/master origin/sucrose-0.84 The only branch available besides the master branch is the 'sucrose-0.84' branch. Let's push now our new branch to the remote repository to make it available for others: git push origin sugar-0.94 The branch is now listed as a remote branch. You can verify as well on your gitorious page. [erikos@T61 helloworld]$ git branch -r origin/HEAD -> origin/master origin/master origin/sucrose-0.84 origin/sugar-0.94 You can switch now between those branches using 'git checkout <branch>'. And you can use 'git branch' to see which branch you are on (the one with the * before is the branch you are currently on). git checkout sugar-0.94 git checkout master Cleanup, adopt to API changes in the sugar-toolkit This should be done only on the master branch! In the new sugar-toolkit we have removed old API, you should adjust your activity accordingly: - the keep button has been removed completely - the old-style toolbar has been removed Port the activity from GTK like this: from gi.repository import Gtk def _destroy_cb(widget, data=None): Gtk.main_quit() w = Gtk.Window() w.connect("destroy", _destroy_cb) label = Gtk.Label('Hello World!') w.add(label) w.show_all() Gtk.main() For porting your activity you do have to change your calls for accessing widgets and services in the new GTK3 sugar-toolkit as well. The new namespace is called sugar3, trying to reflect that GTK3 is the underlying technology. For example the import of the base activity class has to be changed from from sugar.activity import activity to from sugar3.activity import activity The changes that were needed to port the hello-world activity can be seen in this commit. Ok, let's do these changes now for your activity. Make sure you are in your master branch using the 'git branch' command (the master branch should have a '*' before it). Make your changes, commit them ('git commit -a') and push them to the remote repository ('git push origin master'). Tools There are tools to help you do the porting. There is a script in the pygobject repository for porting called pygi-convert.sh, more info about the script can be found in the PyGObject Introspection Porting guide. If you are having trouble finding how a particular GTK class/method/constant has been named in PyGI, run pygi-enumerate.py and grep the output. (this app lists all identified methods and constants). Constructor considerations With PyGI it is possible to use Python-like constructors, or "new" functions e.g. the following are (usually) equivalent: label = Gtk.Button() label = Gtk.Button.new() However, the first form is preferred: it is more Python-like. Internally, the difference is that Gtk.Label.new() translates to a call to gtk_label_new(), whereas Gtk.Label() (the preferred form) will directly construct an instance of GtkLabel at the GObject level. If the constructor takes parameters, they must be named. The parameters correspond to GObject properties in the API documentation which are usually marked as "Construct". For example, the following code will not work: expander = Gtk.Expander("my expander") The (confusing) error is: TypeError: GObject.__init__() takes exactly 0 arguments (1 given) The solution is to go to the GtkExpander API documentation and find the appropriate property that we wish to set. In this case it is label (which is a Construct property, further increasing our confidence of success), so the code should be: expander = Gtk.Expander(label="my expander") Combining the two points above, if you wish to call a construct-like function such as gtk_button_new_with_label(), you do have the option of calling Gtk.Button.new_with_label(), however if we check the GtkButton properties we see one called "label" which is equivalent. Therefore gtk_button_new_with_label("foo") should be called as: button = Gtk.Button(label="foo") HBox, VBox, pack_start and pack_end. These parameters can be specified either as positional arguments or as named keyword arguments, however all 4 must always be specified. Some developers prefer keyword arguments, arguing that the following: box.pack_start(widget, expand=True, fill=False, padding=4) is much more readable than: box.pack_start(widget, True, False, 4) However, these functions are called extremely often; any mildly seasoned GTK developer will have memorized the order and meaning of the parameters. Some developers therefore prefer to avoid the extra work of dropping in hundreds of keyword arguments throughout the code and just use the positional ones. This is really up to you. If you are using pack_start with the default values (expand=True, fill=True and padding=0), you can avoid using pack_start (and the parameter pain that it brings with it) by just using .add for some added cleanliness, e.g. box.pack_start(widget, True, True, 0) can be replaced with: box.add(widget) This is as far as you need to go for now. However, in GTK3, GtkVBox and GtkHBox have been deprecated, which means they might be removed in GTK4. The replacement is to use GtkBox directly, and you may wish to make this change now. e.g.: vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) However, it must be noted that if GtkBox is used directly (instead of using GtkHBox/GtkVBox), the default value of expand is now False. The implications of this are: - You need to check your .add() calls, as previously they would behave as pack_start with expand=True, but now they will behave as expand=False (you need to change them to use pack_start with expand=True to retain the old behaviour) - Every single pack_start call that has expand=False and padding=0 (and any value of fill) can be converted to .add() for cleanliness. Make a release Versioning If you do new releases the versioning of the GTK2 and GTK3 release should be different. For GTK2 releases you should use dotted versions for new development releases major versions. Let's have a look at hello-world as an example. The latest release of hello-world was version 3. Bug fix releases should be named 3.1 then 3.2 and so on. The new releases for the new development branch should be starting with a major number, in this case 4.) Taking a screenshot and making a thumbnail To make a screenshot of the window: width, height = window.get_width(), window.get_height() thumb_surface = Gdk.Window.create_similar_surface(window, cairo.CONTENT_COLOR, width, height) thumb_width, thumb_height = style.zoom(100), style.zoom(80) cairo_context = cairo.Context(thumb_surface) thumb_scale_w = thumb_width * 1.0 / width thumb_scale_h = thumb_height * 1.0 / height cairo_context.scale(thumb_scale_w, thumb_scale_h) Gdk.cairo_set_source_window(cairo_context, window, 0, 0) cairo_context.paint() thumb_surface.write_to_png(png_path_or_filelike_object)
https://wiki.sugarlabs.org/index.php?title=Features/GTK3/Porting&oldid=71402
CC-MAIN-2020-10
refinedweb
1,333
58.69
Hi,: #ifndef BREAD_H #define BREAD_H namespace bread_name{ class bread { public: void geta(); private: int m_a; int m_b; }; } #endif and i write like this in panda.cpp #include "bread.hpp" using namespace bread_name; namespace panda{ int func() { bread test; test. return 0; } } Now i can get completions using semantic, but if i moved the "using namespace bread_name" inside the declaration of namespace panda, just like this: #include "bread.hpp" namespace panda{ using namespace bread_name; int func() { bread test; test. return 0; } } The completions will not show up. Since the codes above can be compiled, i think maybe there's something wrong with semantic's analyzing?: Possible completions are: int geta () void set (int,int) void test (int haha) Known members of bread: public int geta () void set (int,int) void test (int haha) private int m_a int m? Thank you very much, for your great job for cedet, it really helps a lot when i'm coding. And i hope it will be better :) On Tue, Nov 25, 2008 at 12:02 AM, Eric M. Ludlam <eric@...>wrote: > Hi, > > I now know more about this problem. > > The main issue is that bread.cpp is incomplete. When main() is > parsed, semantic can't know where it really ends. If the idle > scheduler goes off, this is detected, and the buffer is put into an > "unparsable" state, and no more incremental parsing will occur until > you type stuff. > > If instead you use M-x bovinate, then the incomplete syntax is > assumed to have an "end" at the end of the buffer. This is the wrong > answer, of course, as Emacs can't know that, but it will get you > started, and has a side effect of making this example work. > > The idle scheduler behaves as it does because it will disable slow > stuff while you are hacking up new code. Once you are done, it will > catch up, and enable this sort of thing again. If it did not, and you > edited the first of say, 100 fcns, then if you type > > if() { > foo. > > it would wipe out everything it knows about fcns showing up after that > line, and the completion would fail. Thus, once you finish typing the > curly } for the close of the if, it will then get the new state of the > current function refreshed in the tag list. > > The other style is used if a buffer is first brought up. It will just > do it's best to get you going. > > As such, this problem isn't really fixable. > > This issue needs you to subtly change how you type. When creating a > new file, type like this: > > #include "whatever.h" > > main () { > } > > then after you do that, go back and change it to: > > main () { > bread haha; > haha. > } > > and things will work as predicted. I changed the way I type a long > time ago, and that's why I don't see this issue. > > -- Zhiqiu Kong (孔直秋) View entire thread
http://sourceforge.net/p/cedet/mailman/message/20891646/
CC-MAIN-2014-23
refinedweb
489
81.43
Eight Greats of XML.com 1999 As I wrote last week, 1999 has been a terrific year for XML. It has also beenmay I be so bold as to suggesta great year for XML.com. In this article, I've gathered together some of the most interesting, controversial, and useful articles published by XML.com this year. January: Namespaces There can be few W3C recommendations with a higher per-word controversy ratio than the XML Namespaces. Issued in January, the recommendation has spawned some of the most involved developer discussions this year, including the infamous "XHTML 3 Namespaces" debate. While initially conceived as a mechanism for enabling names belonging to different applications to be distinguished within a document, the Namespace recommendation opened up larger issues. Those issues included the question of whether a URI associated with a namespace resolved directly to a schema defining that vocabulary associated with the namespace, or whether the namespace URI was free of any semantics. This was one of the core questions at the heart of the XHTML debate. Even the W3C's Director, Tim Berners-Lee, weighed into the discussion on the XML-DEV mailing list. In January, XML.com ran two articles on XML Namespaces. The first, from Mark Walter, reported on the adoption of the recommendation; the second, from Tim Bray, gave a simple explanation of what the recommendation meant. - Namespaces in XML Adopted by W3C (Mark Walter) - XML Namespaces by Example (Tim Bray) March: Microsoft Releases Internet Explorer 5 This year, Microsoft's Internet Explorer 5 became the first (and, at the time of writing, only) released browser with native support for displaying XML. IE5 enabled display of XML using either of the two W3C-supported style technologies, CSS or XSL (to be more accurate, an XSL similar to the Working Draft at the time the browser was released). Whether you love or hate Microsoft, there can be no doubt that the inclusion of XML support in IE5 enabled many developers to find immediate real-life uses for XML, and encouraged much experimentation with the technology. The fact that the XSL support was not updated as the Working Draft evolved was a bugbear to many developers who feared that an "MS-XSL" might become a de facto standard before the final XSL recommendation was issued. Microsoft has recently confirmed its intention to support the XSLT recommendation (now that it is stable) and one hopes that the danger of a dual XSL standard is now minimized. In March, Tim Bray took his shiny new IE5 browser for a spin, and applied the real-world test of trying to write an XML document for production on XML.com. - XML Support in IE5 (Tim Bray) May: XSL Considered Harmful War broke loose on XML.com in May as Michael Leventhallaunching an angry reaction to Ken Holman's exploration of XSL, published earlier in the monthlambasted XSL as the "most hideous and unwieldy language imaginable." Among other points, Leventhal suggested that XSL provided no functionality that couldn't already be achieved by the DOM or CSS. Leventhal's article provoked lengthy debate both in mailing lists and in the XML.com forums. Although his contention that XSL "stands absolutely no chance of acceptance by the Web community" has not been borne out in reality (although one might suggest it is still too early to tell), it is true that XSL(T) has not always proved an easy fit for web developers. I suspect that from time to time the old debate will raise its head once more. - XSL Considered Harmful (Michael Leventhal) September: XML 1.0 Conformance Testing With vendors spitting out XML tools left, right, and center, which one should you use? One measure of a tool's quality is its conformance to the XML 1.0 specification. With interoperability high on the XML agenda, your XML processor ought to be able to read and write standard XML. Armed with the XML conformance tests from OASIS, David Brownell embarked upon the appreciable task of assessing the XML 1.0 conformance of XML parsers. The results he found were moderately disappointing: "Few processors passed all the XMLTEST cases, much less the whole OASIS suite. The class median on this open book test was about eighty percent, which suggests that many implementors just haven't applied any real effort to getting conformance right." Since the publication of these results, many vendors (reporting Brownell's article as being helpful) have applied more effort to enhancing the conformance of their parsers. Recently, David applied these tests to Microsoft's MSXML.DLL parser, which wasn't tested in the first article. - Conformance Testing for XML Processors (David Brownell) - Conformance of Microsoft's MSXML.DLL (David Brownell) October: Where the Web Leads Us In October, XML.com took a slight diversion from its usual course and published Tim O'Reilly's keynote address to the Tokyo Linux World (given in September). O'Reilly's address covered the major issues impacting today's Web: Linux, Open Source, XML. As Dale Dougherty, XML.com's publisher, said: "I'd argue that XML itself would not make sense to anyone without this greater context in which open standards and open source have emerged." The article itself proved very popular, drawing attention from Slashdot. O'Reilly concluded his article by saying "Open source has been one of the engines of enormous change in the computer industry, and it will be the engine of even greater change as we go forward." This statement has repeatedly been proved true in the world of XML: open source implementations have brought XML technology to a wider audience and lead the way for many new innovations. - Where the Web Leads Us (Tim O'Reilly) October: James Clark's expat You cannot stay long in the XML world without hearing the name of James Clark. Technical lead on the original XML 1.0 specification activity, and prolific author of open source XML and SGML tools, James Clark inspires respect among the XML community. He has been called simultaneously the worst and best thing to happen to XML. Best, for his energy and provision of reliable software, and worst, because a manager or client will tend to say "Well, if James Clark can do it, why can't you?" Why not indeed? Ask anyone who's posted to XML-DEV or the XSL-List claiming to have found a bug in any of Clark's software.... Arguably, expat has been the most successful so far of Clark's tools. Its name a subtle pun on Clark's own expatriate status (he is a Briton living in Thailand), the C-based XML parser has been used to provide the XML support in many projects, including the Mozilla web browser and the PHP web scripting language. In October, Clark Cooper presented a tutorial on using expat in applications. - Using Expat (Clark Cooper) November: Simplifying XML Is XML, itself a great simplification of SGML, too complicated? Don Park certainly thought so. In November he proposed a simplified form of XML, dubbed SML for "Simplified (or Stupid) Markup Language," and posted it on the XML-DEV mailing list. His suggestion found great sympathy with a certain section of the community, predominantly those using XML for data-exchange (as opposed to document markup) applications. As you might imagine, however, Park's suggestion was not without its opponents, and another long-running debate was spawned. One of the major arguments against an SML was that every application writer wants different things simplified, so there is no agreement on what such a simplified language might contain. Another concern was that a new variant on XML would impede the acceptance of XML itself. Robert La Quey, a proponent of SML, wrote a feature for XML.com on the SML initiative. In turn, Rick Jelliffe provided a critical assessment of the SML proposals. The SML group has now created its own mailing list, SML-DEV, to pursue its aims. - Simpletons vs. DocHeads: Simplifying XML (Robert La Quey) - Simplified Markup Language: Your Responses (Feedback from the XML.com forums) - Goldilocks and SML (Rick Jelliffe) December: Showtime - XML'99 Providing a fitting end to the year, XML'99 was the best-attended XML show yet. Over 2,200 attendees traveled to Philadelphia for the four day conference, of which XML.com was a proud co-host. During the week we provided daily coverage, bringing readers a taste of the tutorials, conference sessions, and the expo. Simon St.Laurent, Lisa Rein, and myself reported from the floor, and Digitome's Sean McGrath contributed a version of his tutorial on Python and XML. The show itself was remarkable for the earnestness and thoughtfulness of the attendees, many of whom were developers applying XML in real-world situations and sharing their experiences. That's All For This Year We hope that you've found XML.com an enjoyable and helpful resource this year. As ever, we welcome comments about the site, article proposals, criticism, and even praise! Please send them to me at edd@xml.com. Thanks for reading. Edd Dumbill Managing Editor, XML.com
http://www.xml.com/pub/a/1999/12/bestof/index.html
crawl-003
refinedweb
1,520
53.1
Hi Martin - Interface types, as they appear to Python, all have a single argument constructor that you can use to "cast" an object to a particular interface. Because System.Activator.GetObject() has a return type of object, the runtime returns the object as its true runtime type to Python (which happens to be MarshalByRefObject). So I think all you need to do is an "explicit cast": remoteObj = System.Activator.GetObject(IToy, url) mytoy = IToy(remoteObj) mytoy.someMethod(...) Hope this helps, Brian Lloyd brian at zope.com V.P. Engineering 540.361.1716 Zope Corporation > -----Original Message----- > From: pythondotnet-bounces+brian=zope.com at python.org > [mailto:pythondotnet-bounces+brian=zope.com at python.org]On Behalf Of > Martin Richard > Sent: Tuesday, December 28, 2004 3:57 PM > To: pythondotnet at python.org > Subject: [Python.NET] AttributeError: 'MarshalByRefObject' object has > noattribute ... > > > This is python 2.3. > > I start a toy .NET service. This is a C-sharp executable. > > In the C-sharp files, this code exists: > > namespace foo > { > public class Toy : MarshalByRefObject, IToy > ... > } > > In python, after loading an assembly, I can successfully do either: > from CLR.foo import Toy > from CLR.foo import IToy > > I can get a string for the url of the service from the config file. > > I then try: > # using Toy also gives the same result > remoteObj = System.Activator.GetObject(IToy, url) > > and it returns this for remoteObj: > <CLR.System.MarshalByRefObject object at 0x0090D090> > > If I try to invoke a method on remoteObj, I get this error: > AttributeError: 'MarshalByRefObject' object has no attribute > 'methodName'. > > It is almost as if the remoteObj has not been cast to the correct type > (Itoy). But if I do remoteObj.ToString() it returns 'foo.Toy'. > > If I just try to instantiate a local instance of Toy -- > t = Toy() > -- this succeeds, and I can successfully invoke the method that fails on > the remoteObj. > > Any ideas why the remoteObj is failing? > > Thanks, > > Rick > > > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > >
https://mail.python.org/pipermail/pythondotnet/2004-December/000229.html
CC-MAIN-2017-17
refinedweb
327
61.02
Update 2018-03-06: It works! Check out the repo for the most up-to-date information. ----------------------------------------------------------- This visual studio project compiles and creates a dll, but the dll fails to load in TouchDesigner (follow the README instructions). For reference I'm looking at this example ... es/capture Here's an overview of the modifications from the OpenGLTOP in C:\Program Files\Derivative\TouchDesigner099\Samples\CPlusPlus\OpenGLTOP OpenGLTOP.h - Code: Select all bool hasStarted = false; // declare a private variable OpenGLTOP.cpp - Code: Select all // at the very top of the file #include <librealsense2/rs.hpp> // Include RealSense Cross Platform API rs2::pipeline pipe; - Code: Select all // inside the execute function if (!hasStarted) { hasStarted = true; pipe.start(); } Later, the missing pieces would involve - Code: Select all rs2::frameset data = pipe.wait_for_frames(); data.get_depth_frame(); // and rendering into the context Teach a man to fish so that I can do this for the 100 other "Kinect replacements" coming out
http://derivative.ca/Forum/viewtopic.php?p=44385
CC-MAIN-2019-35
refinedweb
156
59.09
This article was written and submitted by an external developer. The YouTube API team thanks Ben Longoria for his time and expertise. Ben Longoria, University of Wisconsin - Madison, Academic Technology February 2009 - Introduction - The Lay of the Land - Using Movie.as - Using MovieSprite.as - What Can I Call, What Do I Get? - Conclusion Introduction Figure 1: TubeLoc Chromeless Player Demo Wow. In just about a month, as of this writing, the YouTube Player API will be one year old. How many internet years is that? There have been a number of great projects built on the API. You only have to follow the YouTube Developer API Blog to see that there are a host of people that have done great things with it. The current set of YouTube API player applications are written in ActionScript 2, and while this still remains a great language to use, a lot of people are now using ActionScript 3 and/or Flex. The issue is that you have to jump through a few hoops to get ActionScript 2 applications to communicate with ActionScript 3 applications. "But wait...I think I've heard this before--isn't there already something for this?" you may ask. A good number of people have already figured out how to do this and have kindly dropped their wisdom into the YouTube API Developer Forums. There have also been the AS3 Chromeless Wrapper and Flex Embedded Player projects to make this easier for developers to use. I wanted an easy, simple way to reuse the Player API functionality solely in ActionScript 3 or MXML. A Flex-free class for those Flex-allergic projects, and an easy-to-use Flex component for those Flex-loving projects. TubeLoc satisfied both requirements TubeLoc (a mashup of YouTube and LocalConnection) is an ActionScript 3 library that serves as an adapter to the YouTube ActionScript 2 Player API. You can easily add YouTube video functionality to your ActionScript 3 or Flex applications with either the full-chrome or the chromeless YouTube players. TubeLoc uses the LocalConnection class in communicating with an ActionScript 2 mediator SWF. The ActionScript 2 SWF communicates with the official YouTube API player. So how do we use this thing? The Lay of the Land First, you should download the current release of the library from the Google Code project. After unpacking the release zip archive, you will find an as3 directory within. Under this is the src directory which includes some sample classes. Feel free to use those as a starting point. Under com/enefekt/tubeloc in the src directory there are two files. The Movie.as is what you can use in your Flex projects, and the MovieSprite.as is what you can use in your ActionScript 3 projects. In com/enefekt/tubeloc/event there are various event classes for the different notifications that can be sent from the player. Before trying the examples in this tutorial, make sure that the src directory in the as3 directory is in your class path. The process to do this is different depending on what you use to develop with, so check the documentation for your development environment. Once you have compiled your demo or application, you will need the ActionScript 2 SWF that communicates with the YouTube Player API. You can find this SWF in the release archive here: as3/lib/as2_tubeloc.swf. Just make sure it is alongside the HTML file that is embedding your SWF application, like so: my_app/ my_app.html as2_tubeloc.swf my_app.swf Note: You can change the path to this SWF using the playerWrapperUrl property with the library. Using Movie.as Let's look at how to use the Flex version of TubeLoc. We'll look at the full-chrome player (with all the controls) first, then at the BYOC chromeless player. This is how you use the full-chrome player in MXML: <tubeloc:Movie I know, I know, painful right? Not at all! So let's get crazy and do the chromeless: <tubeloc:Movie We're adding to the pain with one more attribute, that's it. So here is what the whole MXML file would look like: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns: <!-- TubeLoc Movie Component --> <tubeloc:Movie </mx:Application> Note: In the mx:Application element, we add the tubeloc namespace with the package for the Movie component. After doing this, we can use the component as demonstrated. Later we'll look at what is available to set and call on this component. Using MovieSprite.as Now let's look at how to use the ActionScript 3 version of TubeLoc. This version requires no classes from the Flex framework, and uses only Flash Player native classes. We'll look at how to do the full-chrome player first, then the chromeless player. Here is a full example:ed extends Sprite { private var youtubeMovie:MovieSprite; public function MainChromed() { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; youtubeMovie = new MovieSprite("7tTNOX8jfno"); + MovieSprite.CHROME_HEIGHT; } } } First, we import the necessary TubeLoc classes. Then, in the constructor we create an instance of the MovieSprite class, and pass our video id into MovieSprite's constructor. Next, we add an event listener for the PlayerReadyEvent. In the onPlayerReady event handler, we set the size of the movie. Note: Since we are using the full-chrome player, we are taking advantage of a static property CHROME_HEIGHT on the MovieSprite class. This helps us to size the movie taking the chrome's height into consideration. OK, so what about the chromeless player?eless extends Sprite { private var youtubeMovie:MovieSprite; public function MainChromeless() { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; youtubeMovie = new MovieSprite(null, true);; youtubeMovie.loadVideoById("7tTNOX8jfno"); } } } So what's different? In the constructor, we pass null for the video id, and the second true parameter tells the MovieSprite class that we're going chromeless. You'll also notice a difference in the onPlayerReady event handler. Here is where we load our video by id, using the loadVideoById method. What Can I Call, What Do I Get? So what all is available to call, and what events to we have to work with? In the release archive you downloaded there is full code documentation to get the details. As a quick overview, for both Movie.as and MovieSprite.as you have these methods: seekTo(seconds:Number, allowSeekAhead:Boolean=true):void setVolume(volume:Number):void getVolume():Number unMute():void mute():void clearVideo():void setSize(width:Number, height:Number):void loadVideoById(videoId:String, startSeconds:Number = 0):void [Chromeless player only] cueVideoById(videoId:String, startSeconds:Number = 0):void [Chromeless player only] stopVideo():void playVideo():void pauseVideo():void destroy():void In addition to these methods, in the Movie.as component, you have access to these properties: playerReady:Boolean chromeless:Boolean videoId:String stateDescription:String currentTime:Number duration:Number videoUrl:String videoEmbedCode:String volume:Number Here are the events you can subscribe to. You can find more details in the documentation. onError onStateChange onMovieStateUpdate onMovieProgress onPlayerReady onPlayerUnload Conclusion I hope this article helped you integrate YouTube functionality and content in your Flash applications. There's a limitation to keep in mind as you're developing with TubeLoc: You can't have two YouTube players on the stage at the same time. Hopefully this will be remedied in due time. So please, when you do find bugs or some feature lacking, visit the Google Code project and report it in the issue tracker. Thanks for reading! Author Bio. You can find his blog at, and read his contributions to InsideRIA. This work is licensed under a Creative Commons Attribution 3.0 United States License.
https://developers.google.com/youtube/articles/tubeloc?hl=zh-tw
CC-MAIN-2022-27
refinedweb
1,269
65.32
SYNOPSIS#include <sys/types.h> #include "dpns_api.h" int dpns_delreplicasbysfn (int nbfiles, const char **sfns, const char **guids, int *nbstatuses, int **statuses) DESCRIPTIONdpns_delreplicasbysfn deletes entries associated with a list of sfns and corresponding lfn if last replica. An extra check may be obtained by specifying a list of guids. - nbfiles - specifies the number of file names in the array sfns. - sfns - specifies either the Site URLs or the Physical File Names for the list of replicas. - guids - specifies the list of Grid Unique IDentifiers (optional). Can be NULL. - - The named file or replica does not exist. - E2BIG - Request too large (max 1 MB). - ENOMEM - Memory could not be allocated for marshalling the request or unmarshalling the reply. - - sfns, nbstatuses or statuses is a NULL pointer. - EINVAL - nbfiles is not strictly positive or the length of one of the guids exceeds CA_MAXGUIDLEN. - ENAMETOOLONG - The length of sfn exceeds CA_MAXSFNLEN. - SENOSSERV - Service unknown. - SEINTERNAL - Database error. - SECOMERR - Communication error. - ENSNACT - Name server is not running or is being shutdown. AUTHORLCG Grid Deployment Team
http://manpages.org/dpns_delreplicasbysfn/3
CC-MAIN-2021-21
refinedweb
171
53.58
The Inventory page provides a metrics-driven view of your entire infrastructure grouped by the resources that you are monitoring. All monitored resources emitting a core set of infrastructure metrics are displayed to give you a quick view of the overall health of your infrastructure. To access this page, go to Observability > Metrics. The Inventory page is displayed by default. An overview of the hosts that you are monitoring and the current CPU usage for each host are displayed in a waffle map of one or more rectangular grids. Alternatively, you can change this map view to a table view. Without leaving the Inventory page, you can view enhanced metrics relating to each host running in your infrastructure. On the waffle map, select the host to display the host metrics overlay. For more information, see Host details. Filter related resourcesedit To help you get started with your analysis faster, you can change the high-level view from hosts to Kubernetes pods, Docker containers, or AWS, which includes EC2 instances, S3 buckets, RDS databases, and SQS queues. When you hover over each resource, the metrics specific to that resource are displayed. You can sort by resource, group the resource by specific fields related to it, and sort by either name or metric value. For example, you can filter the view to display the memory usage of your Kubernetes pods, grouped by namespace, and sorted by the memory usage value. You can also use the search bar to create structured queries using Kibana Query Language. For example, enter host.hostname : "host1"` to see only the information for host1. To examine the metrics for a specific time, use the time filter to select the date and time. Add custom metricsedit If the predefined metrics displayed on the Inventory page for each resource are not sufficient for your specific use case, you can add and define custom metrics. Select your resource, and from the Metrics view filter, click Add metric. You can also group your resources by custom fields. Select your resource, and then click Group by > Custom field. Analyze resource metricsedit When you have searched and filtered for a specific resource, you can drill-down to analyze the metrics relating to it. For example, to view the metrics relating to a particular Kubernetes pod, click on the pod displayed in the high-level view, and then select Kubernetes Pod metrics. Integrate with Logs, Uptime, and APMedit Depending on the features you have installed and configured, you can view logs, traces, or uptime information relating to a specific resource. For example, in the high-level view, when you click a Kubernetes Pod resource, you can choose: - Kubernetes Pod logs to view corresponding logs in the Logs app. - Kubernetes Pod APM traces to view corresponding APM traces in the APM app. - Kubernetes Pod in Uptime to view related uptime information in the Uptime app. Most Popular Video Intro to Kibana Video ELK for Logs & Metrics
https://www.elastic.co/guide/en/observability/7.13/view-infrastructure-metrics.html
CC-MAIN-2022-40
refinedweb
490
62.38
Hi, I was wondering anyone one can help me please? I am trying to write a program that read from a csv file called matches.csv. A single football match can end with a win or a draw: in first case the winner team get 3 points and the loser none, in the second case of draw each of the two teams get 1 point. For example, the first line of the file matches.txt is as follow: In the file it contains the following data. 17/08/2013 Arsenal Aston Villa 1 3 24/08/2013 Aston Villa Liverpool 0 1 This means that a match has been played on the 17/08/2013 where Arsenal scored 1 goal while Aston Villa 3 goals: thus Arsenal got 0 points while Aston Villa 3 points. How can I structure my output to make it make it read Position Team Played Points 1 Aston Villa 2 3 2 Liverpool 1 3 3 Arsenal 1 0 Code : import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Teams { public static void main(String[] args) { String fileName = "matches.csv"; File file = new File(fileName); try { Scanner inputStream = new Scanner(file); while (inputStream.hasNext()) { String data = inputStream.next(); System.out.println(data); } } catch(FileNotFoundException e) { e.printStackTrace(); } } }
http://www.javaprogrammingforums.com/%20whats-wrong-my-code/37035-read-csv-files-organising-data-java-printingthethread.html
CC-MAIN-2015-06
refinedweb
217
73.37
As explained before, I’ve decided to scratch my own itch and write an independent Apple Watch client for the smide.ch bike sharing service. The first step to getting from the idea to the final watch app wasn’t actually involving the Watch at all: Before I could get started, I needed to know how the existing smide clients actually work and how to talk to their server. Then I wanted to have a unit-tested library that I could use from the Watch Frontend. On top of that library, I wanted to have a command-line client for easier debugging of the library itself. And only then would I start working on the frontend on the watch. Preliminaries So as the Developer Beta 1 for XCode 11, WatchOS 6 and Catalina rolled out, the first few days of development I spent reverse-engineering the official Smide Client. As always, the easiest solution was to just de-compile their Android Client and lo and behold, they are making use of retrofit to talk to their server which lead to a very nice and readable interface documentation right in my decompiler Armed with this information, a bit of grepping through the rest of the decompiled code and my trusty curl client, I was able to document the subset of the API that I knew I was going to need for the minimal feature-set I wanted to implement. In order to have a reference for the future, I have documented the API for myself in the OpenAPI format This is useful documentation for myself and if I should ever decide to make the source code of this project available, then it’ll be useful for anybody else wanting to write a Smide client. Moving to XCode: SmideKit Now that I had the API documentation I needed, the next step was to start getting my SmideKit library going. Even though there are tools out there that generate REST clients automatically based on an OpenAPI spec, all the tools I looked at produce code that relies on third-party libraries, often Alamofire. As XCode 11 was in a very rough shape already on its own, I wanted to minimize the dependencies on third-party libraries, so in the end, I’ve opted to write my own thin wrapper on top of URLSession SmideKit is a cross-platform (by Apple’s definition) library in that the code itself works across all of Apple’s OSes, but there are individual targets for the individual OSes But by manually setting the Bundle Name to $(PRODUCT_NAME) in the individual Info.plist files, I can make sure that all projects can just import SmideKit without any suffixes. As this library is the most crucial part of the overall project, I have written unit testes for all methods to make sure we correctly deal with expiring tokens, unresponsive servers and so on. The command line client The first user of SmideKit would be a macOs command-line frontend called smidecli. It would offer various subcommands for listing bikes, booking them and ending bookings. Here’s a screenshot of me booking a bike Going from nowhere to the working command-line client has taken me the whole period of Beta 1. Two weeks is a long time but between my actual day job and my newly put upon me parenting duties, my time was a bit limited. Still. It felt good to go from nowhere to writing a library, writing a command-line frontend and then actually using it to book a bike. On the other hand: None of the code written at this point had anything to do with the announcements of WWDC. All work done could just as well have been done on the old SDKs. But still: Having a good foundation to stand on, I was sure was going to pay off. Next time: Adventures in Beta 2 One thought on “Fun with SwiftUI – Beta 1”
https://blog.pilif.me/2019/08/01/fun-with-swiftui-beta-1/
CC-MAIN-2021-04
refinedweb
660
60.18
Having explored the workings of Lift's Box, you can understand the usage of Full when the previously shown code sets the values of both LiftRules.ajaxStart and LiftRules.ajaxEnd. The following line shows a simple example of how to create a full Box with a String value: val fullBox = Full("I have a String") As you might guess, if you leave both LiftRules.ajaxStart and LiftRules.ajaxEnd with an Empty value, Lift will disable the execution of JavaScript at the beginning of an Ajax request and when it ends. Lift favors heavy use of Box, so it is a good idea to use it instead of Option when you work on a Lift Web application. This approach maintain consistency with the framework philosophy. The following line establishes a rule that sets the default character encoding for requests to UTF-8 instead of the default platform encoding: LiftRules.early.append(_.setCharacterEncoding("UTF-8")) In previous versions, Lift treated templates as XHTML and generated XHTML to the Web browser. However, Lift 2.2 introduced support for HTML 5, so you can define templates in HTML 5 and Lift will generate HTML 5 to the Web browser. (Obviously, it is convenient to work with HTML 5.) Because the default rule was to use XHTML for backward compatibility with previous Lift versions, it is necessary to add the following rule to use HTML 5 for both the parser and serializer: LiftRules.htmlProperties.default.set((r: Req) => new Html5Properties(r.userAgent)) Finally, the boot method initializes the jQuery module. Lift includes a bundled version of jQuery, but you easily replace it with your desired version. There is also some code to build the SiteMap that defines navigation and access control. However, I'll leave Lift's SiteMap feature for later discussion and focus on Lift snippets. Working with Lift Snippets to Inject Dynamic Content The lift_blank project includes a basic class in the code.snippet package called HelloWorld. I won't use that class; instead, I'll add two other classes to demonstrate two different ways of generating dynamic content for a single view. The Listing Two shows the code for a new TrendTopic.scala file that defines the TrendTopic class with a hottest method. You must place the file in src/main/scala. I've included the most frequently used imports when you write Lift snippets. Listing Two. package code package snippet import scala.xml.{NodeSeq, Text} import net.liftweb.util._ import net.liftweb.common._ import code.lib._ import Helpers._ class TrendTopic { // Replace the contents of the element with id "hottest" with the hottest trend topic def hottest = { //I'll uncomment the following line later //to demonstrate parallel execution and lazy loading features //Thread.sleep(3000) "#hottest *" #> "Functional programming" } } Listing Three shows the code for a new Game.scala file that defines the Game class with a render method. You must also place the file in src/main/scala. Listing Three. package code package snippet import scala.xml.{NodeSeq, Text} import net.liftweb.util._ import net.liftweb.common._ import code.lib._ import Helpers._ import net.liftweb._ import http._ class Game { // Replace the contents of the elements with id "gameName" and "highestScore" // with the game name received as a parameter and its highest score def render(in: NodeSeq): NodeSeq = { //I'll uncomment the following line later //to demonstrate parallel execution and lazy loading features //Thread.sleep(2000) val cssSel = "#gameName *" #> "Invaders" & "#highestScore *" #> randomInt(15000) cssSel(in) } } In /src/main/webapp, you will find an index.html view that includes code to render dynamic content generated by the HelloWorld class. The following lines replace the content of index.html with a new view that includes the necessary markup code to render pieces of dynamic content with the previously added TrendTopic and Game Scala classes. <!DOCTYPE html> <html> <head> <meta content="text/html; charset=UTF-8" http- <title>Home</title> </head> <body class="lift:content_id=main"> <div id="main" class="lift:surround?with=default;at=content"> <h2>The hottest trend topic</h2> <p> <span class="lift:trendTopic.hottest"><span id="hottest">Hottest trend topic goes here</span> </span> </p> <h2>The highest scores</h2> <p> <span data-<span id="gameName">Game's name goes here</span> <span id="highestScore">Highest score goes here</span> </span> </p> </div> </body> </html> I've reused the index.html view because it is already included in the SiteMap, so you can easily type container:start in SBT and navigate to to view the Web page with the rendered dynamic content of the snippets (see Figure 3). Figure 3: The index.html view displaying the results of rendering the two snippets. The view is an HTML page with many specific class attributes: <body class="lift:content_id=main">: Indicates that the element with idequal to maincontains the actual page content. <div id="main" class="lift:surround?with=default;at=content">: Defines the element with the actual page content, invokes a Lift snippet that surrounds the divwith a template named default, and inserts this divand its children at the element with idequal to contentin the defaulttemplate. The markup makes Lift wrap the default chrome around the div. Within the div with id equal to main, there are two markups that render content provided by Lift snippets with a different syntax: <span class="lift:trendTopic.hottest"><span id="hottest">Hottest trend topic goes here</span> </span>:The class attribute lift:trendTopic.hottestmakes Lift create an instance of the TrendTopicclass and execute its hottestmethod to transform the HTML included in the span. A class attribute with lift:mySnippetwill look for the MySnippetclass and call the default method by convention: render. You can specify the desired method when you don't want to use render. For example, lift:mySnippet.runwill look for the MySnippetclass and call the runmethod. You can also use a prefix of l:instead of lift:, so l:mySnippet.runis equivalent to lift:mySnippet.run. Notice that the markup defines a spanwith an idequal to hottestwithin the main span. The hottestmethod will replace the contents of this span. <span data-<span id="gameName">Game's name goes here</span> <span id="highestScore">Highest score goes here</span> </span>: The classattribute that I described earlier is the preferred mechanism to invoke Lift snippets. However, you can find Lift applications that rely on the data-liftattribute to perform the same action. The data-liftattribute gamemakes Lift create an instance of the Gameclass and call the default method by convention: render. With the data-liftattribute, you can also specify the desired method. For example, data-lift="game.run"will look for the Gameclass and call the runmethod. Notice that the markup defines a spanwith an idequal to highestScorewithin the main span. The rendermethod will replace the contents of this span. The hottest method of the TrendTopic class replaces the contents of the element with an id equal to hottest with the hottest trend topic, " Functional Programming." The method is just a single line. In the original content, I included an additional line because I'll use the same snippet for other cases. However, the hottest method could be defined with any of the following equivalent lines: def hottest = "#hottest *" #> "Functional programming" def hottest: CssSel = "#hottest *" #> "Functional programming" The method creates a CSS selector transform of type net.liftweb.util.CssSel that puts the "Functional programming" String value in the element whose id is equal to hottest and was part of the span that invoked the snippet. In this case, after the method returns the CSS selector transform, Lift produces the resulting scala.xml.NodeSeq (DOM) output. The #> method transforms a NodeSeq (DOM) based on rules. Snippet methods take the original template XML, process it, and return the new processed version. The render method of the Game class replaces the contents of two elements with the following ids: gameName and highestScore. In this case, the method takes a NodeSeq as input and returns a NodeSeq output by applying a specified CSS selector transform to the input: def render(in: NodeSeq): NodeSeq = { val cssSel = "#gameName *" #> "Invaders" & "#highestScore *" #> randomInt(15000) cssSel(in) } Notice the use of the & method to combine the CSS selector transforms. Lift takes advantage of the way you can name and call methods in Scala to easily build a DSL with CSS selector transforms. Once you get used to the symbols of the different methods, you will find the code easy to write, maintain, and read. The in parameter of the render method contains the element that includes the snippet call with all its children as a sequence of XML elements (a NodeSeq). The render method uses the CSS selector transforms to process the NodeSeq received as an input, and returns a new NodeSeq that Lift will use to replace the original content. Of course, I've provided a very simple example of the way you can work with snippets in Lift. However, I'm sure that you'll see how easy it is to do whatever you want with the content you receive as input. Obviously, processing the sequence of XML elements and returning the output will usually require a greater effort and more time than in this example. For more complex scenarios, Lift provides interesting features such as parallel execution and lazy loading. I'll explore them in the next article, next week. In addition, trend topics and highest scores usually change after a few minutes. Thus, they represent a great opportunity to explore server pushes in Lift with Comet. I'll also dive deep on Comet, wiring, and REST support in the next installment. This way, you will have a good idea of many important features offered by Lift and you can decide whether it is a good fit for any of your Web projects based on Scala. Gaston Hillar is a frequent contributor to Dr. Dobb's.
http://www.drdobbs.com/jvm/an-algorithm-for-compressing-space-and-t/jvm/building-web-applications-with-lift/240159451?pgno=2
CC-MAIN-2015-40
refinedweb
1,646
56.45
Where to find string.h?? fatal error C1083: Cannot open include file: 'string/string.h': No such file or directory fatal error C1083: Cannot open include file: 'string/string.h': No such file or directory Use #include <string> or #include <string.h>. The solution is that you should use <..> instead of '..'. Hope it helps did the same but that does not work it does not work Asked: 2016-02-24 03:39:35 -0500 Seen: 89 times Last updated: Feb 24 '16 Mat to String and back in OpenCV4Android quotation marks surrounding string during writing to file with FileStorage in Qt possible to convert value of a Point to string? opencv c++ Detect fixed string in the image Convert 3 channel BGR image to bytes string in C++ [closed] FacemarkLBF Params model_filename error Why is it safe to pass cv::String& accross DLL boundary?
https://answers.opencv.org/question/88426/where-to-find-stringh/?comment=88628
CC-MAIN-2019-47
refinedweb
144
77.57
Problem compiling a package then accessing it simon fletcher Ranch Hand Joined: Aug 04, 2012 Posts: 50 posted Aug 04, 2012 13:35:59 0 I am using the latest version of JDK. I use Windows Notebook to write source files. I compile them and run the class files in a DOS window. Everything works fine until I try and use my own packages. I'll explain what I did recently. There are four very basic files being used. It doesn't matter what they are but I'll quickly say what they are anyway. One creates rectangle objects (just points that designate corners). Another takes a number and randomly decides whether it will be negative or positive (for the x and y values). Another creates the points. The forth contains a main which instantiates four rectangle objects. There are no GUI's or graphics, or anything advanced. Very basic. Step1: I created the first three source files in a folder called Ch5Q1, which is here: C:\Documents and Settings\SKF\My Documents\Java\Ch5Q1 The three source files that would get packaged all had package Ch5Q1; as the first line of each file: Step2: While making the current directory the same as the one the source files to be packaged are in, I created a package using the following in a DOS window: javac -classpath "C:\Documents and Settings\SKF\My Documents\Java" *.java The three source files appeared to compile successfully, producing three class files in the Ch5Q1 directory. This is the package, I'm assuming. Step 3: In a directory called Ch5Q2 (located C:\Documents and Settings\SKF\My Documents\Java\Ch5Q2), I created a source file, called FourRecs.java, that uses the three classes of the Ch5Q1 package. This source file has the line import Ch5Q1.*; in it, on the first line. After this, I don't know what to do to compile and then run FourRecs. Everything I have done so far has resulted in either the thing not compiling or not running if it does compile. All the classes are defined as public. If I don't use packaging and importing and, with all four source files in the same directory, compile FourRecs.java using javac FourRecs.java all four source files compile and FourRecs runs perfectly. I've recomoiled and run it several times this way and it always works. My questions are, upon completeing step three, what should make the current directory be, and what should I enter in the DOS window to compile the package? Then, what should the current directory be and what should I enter to compile FourRecs.java, the source file that uses the package? And finally what would I enter to run the FourRecs class file? I have tried packaging several other basic programs I've made, all ones that work when not packaged, and had the same negative results. When I import java packages that come with the JDK, it works fine. If more information is needed, please let me know. Thanks. Campbell Ritchie Sheriff Joined: Oct 13, 2005 Posts: 36452 15 posted Aug 04, 2012 14:29:06 0 Welcome to the Ranch If you are only at the chapter 5 stage, you are probably better off not using package names in the first place. You would have to tell us the package declarations you are using, but putting .class files inside a folder and then importing from a package of the same name doesn’t sound right. I would refer you to the Java Tutorials , and search for some old posts, eg this one . When you have your .class files with package names, they must be in a file structure corresponding to those package names. So you might be better // commenting out the package names, and those import statements. Note some books add package names in the files you download, but that is because you might download several hundred files and get confused without package names. Stevens Miller Ranch Hand Joined: Jul 26, 2012 Posts: 373 1 I like... posted Aug 04, 2012 14:34:08 0 This is precisely the kind of thing that had me gnashing my teeth when I first learned Java (if that's any comfort to you). Unlike most C environments, Java doesn't have a "linker" that binds up everything into one executable for you (the ".jar" archive is distantly similar, but not the same and, anyway, you aren't using that here). At run time, the Java Runtime Environment will try to find any classes it needs as and when your program needs them. So, you need to specify the path(s) where those things can be found. In your case, you've created classes in java\Ch5Q1, in a package called Ch5Q1 (and good for you for making your package and directory names match, as that's one thing I didn't know I had to do at first). To compile code that uses those classes, you need to tell the compiler where to find them. If your current directly is java\Ch5Q2, then you can compile with javac -cp .. *.java This tells the compiler that the starting point for any imports will be the parent of your current directory. The compiler will look there for a directory matching the package name you imported from (that's why your package names and directories have to match). While still in the same directory, you need to run the main() method in a class file you compiled in that directory (using the command above). But, you also need to tell the JRE where to find class files it might need during the run of your program. You might think that this would work: java -cp .. FourRecs But, unlike the javac command, the JRE won't look in your current directory (you're going to be surprised, at some point, to learn that the JRE pretty much has no idea what a "current directory" is). So, you need to add your current directory (or, wherever your startup class resides) to the list of directories in your classpath, like this: java -cp .;.. FourRecs That ought to run. To be more explicit, here are (sort of) your steps. Step One - Save this file as "Rec.java" into java\Ch5Q1: package Ch5Q1; public class Rec { public void RecSaysHi() { System.out.println("Rec says hi!"); } } Step Two - Compile it like this: javac Rec.java Step Three - Save this file as "FourRecs.java" into java\Ch5Q2: import Ch5Q1.*; public class FourRecs { public static void main(String[] args) { System.out.println("Hello world."); Rec r = new Rec(); r.RecSaysHi(); } } Step Four - Compile it like this: javac -cp .. FourRecs.java Step Five - While still in java\Ch5Q2, run your program like this: java -cp .;.. FourRecs The local policy in these forums is not to give the answer, but to guide the person to it. However, I found this remarkably hard to figure out and, when I did, I did it by finding a Web page somewhere that just spelled it out for me. It's one of those things you just have to know, because, well... you just have to, that's all. Hope that helps. simon fletcher Ranch Hand Joined: Aug 04, 2012 Posts: 50 posted Aug 04, 2012 14:58:57 0 Thanks for everyone's help. I've been trying to figure this out, on and off, for weeks and I eventually, very shortly afterposting this question, realized where my problem lay. When I was executing the FourRecs.class file, I wasn't properly using the classpath. I wasn't including the current directory of FourRecs. I was entering: C:\Documents and Settings\SKF\My Documents\Java>java -classpath "C:\Do cuments and Settings\SKF\My Documents\Java" FourRecs instead of: C:\Documents and Settings\SKF\My Documents\Java>java -classpath ".;C:\Do cuments and Settings\SKF\My Documents\Java" FourRecs One tiny little missed detail and I now have teeth that are ground down to nubs and no more hair to pull out. Thanks again for you help. simon fletcher Ranch Hand Joined: Aug 04, 2012 Posts: 50 posted Aug 04, 2012 15:04:54 0 As an extention to the idea of packaging, I read (and can't find where I read it) that it's possible for one to turn one's own packages into .jar files, place these into the ext directory of JDK, import them as normal, and then not have to use -classpath when executing. Has anybody used this and know how to do this? Campbell Ritchie Sheriff Joined: Oct 13, 2005 Posts: 36452 15 posted Aug 04, 2012 15:12:59 0 You don’t need a linker if you have all the packages in the right folder structure, and go to the root of that directory structure. You need to specify a classpath if you are using external .jars, however. I still think it is best to omit package names until you have more than about twelve classes in your application; you don’t need them if you are at the stage of such small apps. Campbell Ritchie Sheriff Joined: Oct 13, 2005 Posts: 36452 15 posted Aug 04, 2012 15:19:04 0 Don’t put your work inside a JDK installation folder. At least that’s a rule of thumb. What will happen to your work when you uninstall Java and install a new version? Another cheat: you can dispense with a classpath if you unzip dependency .jars into your own folder structure. With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. subject: Problem compiling a package then accessing it Similar Threads Ant X JavaDoc Ant X JavaDoc Error when running a class Setting the classpath Command line, Env Variables All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter JForum | Paul Wheaton
http://www.coderanch.com/t/589002/java/java/compiling-package-accessing
CC-MAIN-2014-15
refinedweb
1,650
71.85
I created a video a while ago that discussed how to implement a progress bar in a windows form application. It used the System.Thread class library and the the BackgroundWorker class. With the release of .NET 4, there is a new. easier way to implement this. In this example, I have added the progress bar to the status bar and a start button in the WPF XAML code. <Grid> <Button Content="Start" Height="23" Click="buttonStart_Click" HorizontalAlignment="Right" Margin="0,15,15,0" Name="buttonStart" VerticalAlignment="Top" Width="75" /> <StatusBar Name="StatusBar1" VerticalAlignment="Bottom" Background="Black" Margin="0,0,0,0" /> </Grid> To add a progress bar to the status bar, I add the following code to the buttonStart_Click method in the code-behind. ProgressBar progressBar = new ProgressBar(); progressBar.IsIndeterminate = false; progressBar.Orientation = Orientation.Horizontal; progressBar.Width = 419; progressBar.Height = 20; Duration duration = new Duration(TimeSpan.FromSeconds((30))); DoubleAnimation doubleAnimatiion = new DoubleAnimation(200, duration); StatusBar1.Items.Add(progressBar); I should make a comment about setting the duration. You would want the progress bar to complete in about the same time the code you program runs completes. This is very specific to what you program is doing. One example I can give is perhaps your program will process a number of files in a directory. Calculate that it will take about 2 seconds per file to process. Then multiply that number by about 20 – 30% to give you additional time, just in case some files were big. This could give you a ball park figure of the TimeSpan you need to set. In order the get a smooth running progress bar, you need to code it to run on a different thread than the thread which is performing your actual work. I do this by using the Task namespace from the Task Parallel Library which was newly released with .NET 4. Action MainThreadDoWork = new Action(() => { //add thread safe code here. //Confirm thread will not use GUI thread System.Threading.Thread.Sleep(20000); }); The second thread will start my progress bar. Action ExecuteProgressBar = new Action(() => { progress.BeginAnimation(ProgressBar.ValueProperty, doubleAnimatiion); }); The third thread will wait for the first thread to complete and then re-enable the start button and hide the progress bar. Action FinalThreadDoWOrk = new Action(() => { buttonStart.IsEnabled = true; StatusBar1.Items.Remove(progress); }); Lastly, I use the Task class to start the threads. Task MainThreadDoWorkTask = Task.Factory.StartNew(() => MainThreadDoWork()); Task ExecuteProgressBarTask = new Task(ExecuteProgressBar); ExecuteProgressBarTask.RunSynchronously(); MainThreadDoWorkTask.ContinueWith(t => FinalThreadDoWOrk(), uiThread); Even though, it is possible to do the same with a BackgroundWorker thread, this is the new approach provided in .NET 4. It is always a good idea and necessary to stay current.
https://www.thebestcsharpprogrammerintheworld.com/2017/01/15/progress-bar-multithread-in-wpf-using-c/
CC-MAIN-2021-04
refinedweb
444
51.24
3.16.7-ckt21 -stable review patch. If anyone has any objections, please let me know.------------------From: Paolo Bonzini <pbonzini@redhat.com>commit f5f3497cad8c8416a74b9aaceb127908755d020a upstream.On 32-bit systems, the initial_page_table is reused byefi_call_phys_prolog as an identity map to callSetVirtualAddressMap. efi_call_phys_prolog takes care ofconverting the current CPU's GDT to a physical address too.For PAE kernels the identity mapping is achieved by aliasing thefirst PDPE for the kernel memory mapping into the first PDPEof initial_page_table. This makes the EFI stub's trick "just work".However, for non-PAE kernels there is no guarantee that the identitymapping in the initial_page_table extends as far as the GDT; in thiscase, accesses to the GDT will cause a page fault (which quickly becomesa triple fault). Fix this by copying the kernel mappings fromswapper_pg_dir to initial_page_table twice, both at PAGE_OFFSET and atidentity mapping.For some reason, this is only reproducible with QEMU's dynamic translationmode, and not for example with KVM. However, even under KVM one can clearlysee that the page table is bogus: $ qemu-system-i386 -pflash OVMF.fd -M q35 vmlinuz0 -s -S -daemonize $ gdb (gdb) target remote localhost:1234 (gdb) hb *0x02858f6f Hardware assisted breakpoint 1 at 0x2858f6f (gdb) c Continuing. Breakpoint 1, 0x02858f6f in ?? () (gdb) monitor info registers ... GDT= 0724e000 000000ff IDT= fffbb000 000007ff CR0=0005003b CR2=ff896000 CR3=032b7000 CR4=00000690 ...The page directory is sane: (gdb) x/4wx 0x32b7000 0x32b7000: 0x03398063 0x03399063 0x0339a063 0x0339b063 (gdb) x/4wx 0x3398000 0x3398000: 0x00000163 0x00001163 0x00002163 0x00003163 (gdb) x/4wx 0x3399000 0x3399000: 0x00400003 0x00401003 0x00402003 0x00403003but our particular page directory entry is empty: (gdb) x/1wx 0x32b7000 + (0x724e000 >> 22) * 4 0x32b7070: 0x00000000[ It appears that you can skate past this issue if you don't receive any interrupts while the bogus GDT pointer is loaded, or if you avoid reloading the segment registers in general. Andy Lutomirski provides some additional insight: "AFAICT it's entirely permissible for the GDTR and/or LDT descriptor to point to unmapped memory. Any attempt to use them (segment loads, interrupts, IRET, etc) will try to access that memory as if the access came from CPL 0 and, if the access fails, will generate a valid page fault with CR2 pointing into the GDT or LDT." Up until commit 23a0d4e8fa6d ("efi: Disable interrupts around EFI calls, not in the epilog/prolog calls") interrupts were disabled around the prolog and epilog calls, and the functional GDT was re-installed before interrupts were re-enabled. Which explains why no one has hit this issue until now. ]Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reported-by: Laszlo Ersek <lersek@redhat.com>Cc: Borislav Petkov <bp@alien8.de>Cc: "H. Peter Anvin" <hpa@zytor.com>Cc: Thomas Gleixner <tglx@linutronix.de>Cc: Ingo Molnar <mingo@kernel.org>Cc: Andy Lutomirski <luto@amacapital.net>Signed-off-by: Matt Fleming <matt.fleming@intel.com>[ Updated changelog. ]Signed-off-by: Luis Henriques <luis.henriques@canonical.com>--- arch/x86/kernel/setup.c | 8 ++++++++ 1 file changed, 8 insertions(+)diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.cindex 78a0e6298922..56788204d85e 100644--- a/arch/x86/kernel/setup.c+++ b/arch/x86/kernel/setup.c@@ -1177,6 +1177,14 @@ void __init setup_arch(char **cmdline_p) clone_pgd_range(initial_page_table + KERNEL_PGD_BOUNDARY, swapper_pg_dir + KERNEL_PGD_BOUNDARY, KERNEL_PGD_PTRS);++ /*+ * sync back low identity map too. It is used for example+ * in the 32-bit EFI stub.+ */+ clone_pgd_range(initial_page_table,+ swapper_pg_dir + KERNEL_PGD_BOUNDARY,+ KERNEL_PGD_PTRS); #endif tboot_probe();
https://lkml.org/lkml/2015/12/9/229
CC-MAIN-2020-45
refinedweb
562
50.02
The code form of a SCF function developed in Java is generally as follows: package example; public class Hello { public String mainHandler(KeyValueClass kv) { System.out.println("Hello world!"); System.out.println(String.format("key1 = %s", kv.getKey1())); System.out.println(String.format("key2 = %s", kv.getKey2())); return String.format("Hello World"); } } Create the parameter KeyValueClass class: package example; public class KeyValueClass { String key1; String key2; public String getKey1() { return this.key1; } public void setKey1(String key1) { this.key1 = key1; } public String getKey2() { return this.key2; } public void setKey2(String key2) { this.key2 = key2; } public KeyValueClass() { } } As Java has the concept of package, its execution method is different from other languages and requires package information. The corresponding execution method in the code example is example.Hello::mainHandler, where example is identified as the Java package, Hello the class, and mainHandler the class method. In the sample code, the input parameters used by mainHandler have two types: String and Context, and the return is in String type. The former type of the input parameters identifies the event input parameter, while the latter the function runtime information. Currently, types supported for event input parameters and function returns include Java base types and POJO type; the function runtime is currently in com.qcloud.scf.runtime.Context type, and its associated library files can be downloaded here. byte, int, short, long, float, double, char, and boolen) and Stringtype. Context, you need to use com.qcloud.scf.runtime.Context;in the code to import the package and include the jar package when it is packaged. public String mainHandler(String name). Note: The event structures of input parameters passed in by certain triggers have been defined and can be used directly. You can get and use the Java libraries through the Cloud Event Definition. If you have any questions during use, you can submit an issue or ticket for assistance. Contact our sales team or business advisors to help your business. Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable. Was this page helpful?
https://intl.cloud.tencent.com/document/product/583/12214
CC-MAIN-2022-27
refinedweb
344
51.04
BINYAMIN NETANYAHU'S comparison of the threat of a nuclear Iran to the Nazi Holocaust makes some Israelis cringe. "The year was 1944," the Israeli prime minister told thousands of American-Jewish activists at the annual policy conference of AIPAC, the pro-Israeli lobby, in Washington on March 5th. In 1944, American Jews implored the Roosevelt administration to bomb Auschwitz. "Such an operation would be of such doubtful efficacy," said Mr Netanyahu quoting the American state department's response; "such an effort might provoke even more vindictive action by the Germans." Just hours earlier, as everyone in the hall knew, Mr Netanyahu had been urging Barack Obama to bomb Iran's nuclear plants, or at least support Israel's bombing them, before they manage to produce a weapon. If Tel Aviv were hit in response by Iran and Hezbollah's (conventional) missiles and Israeli civilians were killed and injured as a result, so be it. The nuclear threat was infinitely more dangerous. "A new low in cynicism or hysteria," wrote Ofer Shelach, an Israeli military commentator, in Maariv, an Israeli newspaper, the next day. "Jews were being shipped to their deaths every day in their tens of thousands. The only way to act was to bomb the death camps, no matter how many died in the bombing. This is the analogy invoked by the man who commands… one of the most costly and powerful military machines in the world, paid for by our taxes, equipped by the U.S.…." For Mr Netanyahu, of course, that is precisely the point. "2012 is not 1944," he proclaimed to his cheering audience. "The American government today is different… The Jewish people are also different. Today we have a state of our own." Beyond the controversial Hitler-Ahmadinejad analogy, Mr Netanyahu was walking a delicate line in Democratic Washington in his implied criticism of Franklin Roosevelt's failure to respond to the Jewish imprecations of the second world war. Beyond that, too, there was a subtext even more pointed and poignant that has been largely missed in Israel. It will not, however, have been missed by many in that Washington Jewish audience and by Jews across America. The timidity of the American Jewry during the Holocaust was, and still is, the subject of bitter dispute between Mr Netanyahu's political mother-movement, the Revisionist Zionists, and the Jewish/Zionist mainstream in America and in then-Palestine, now Israel. In the mid-20th century, American Jews were at their demographic apogee, numbering some 3.65% of the overall population. They were concentrated heavily in the electorally critical states of the North-East. They almost all voted Democrat. But from the autumn of 1942, when word of the "Final Solution" first reached them, they had held back and hesitated, loth to wield their considerable political power publicly in support of rescue schemes in occupied Europe. Not until 1944 did the American Jewish leadership at last summon the courage to ask Roosevelt to bomb Auschwitz. The tiny Revisionist movement in America at that time—whose chief activists were Palestinian Jewish fighters sent over before the war to raise funds for the anti-British Irgun—accused the mainstream of pusillanimity, of failing to wield Jewish political clout to press the Roosevelt administration to save Jews. Copious scholarly literature now exists on the subject, much of it sympathetic to the Revisionist standpoint. This dispute over what America's Jews could have done to save other Jews—Bibi's father, Professor Benzion Netanyahu, was one of its protagonists during the war years—left a profound mark on the Revisionist movement, which later morphed into Israel's Likud Party, led first by Menachem Begin and now by Mr Netanyahu. It was not only Roosevelt who failed the Jews, the Israeli prime minister was, in effect, saying in his speech. It was the American Jewish leadership of that time. Then, as now, the counter-argument was that to shout and pressure too forcefully would be to court the accusation that the Jews were pushing Roosevelt to conduct a "Jewish war". It would provoke domestic American anti-Semitism. Mr Netanyahu's position now, like that of his political (and biological) forbears, is that mortal danger trumps domestic political dangers. To him, the present fear is not only or mainly that Iran would nuke Tel Aviv but that its vaunted ability to do so would lead to a brain- and talent-drain from the Jewish state, undermining its viability in the long term. Hence a key line in his speech: "As prime minister of Israel, I will never let my people live in the shadow (italics added) of annihilation." Readers' comments The Economist welcomes your views. Please stay on topic and be respectful of other readers. Review our comments policy. Sort: "Bombing Auschwitz" was never considered, if only because it was politically completely untenable for American airplanes to do the SS's work for it. The proposal was to bomb the rail lines leading into Auschwitz. Peter Novick, in The Holocaust in American Life, cogently criticizes the assumption that such bombing would have worked. The Allies had much experience bombing rail lines all over Europe and had learned that it was usually fruitless, since they were easily restored with unskilled labor. In other words, to bomb them once would imply being willing to bomb them many times, a diversion of planes, fuel and crews the Allies were not willing to endorse. Has any nation come forward to trade places with Israel? Assuming Israel has nuclear weapons, since the birth of this nation, she has had to fight many wars, pray tell, why has she not used her nuclear might? All this political crap just to divert publics attention from the real issues at hand. Bibi is trying to salvage his collapsing coalition. The income inequality in Israel is all time high just short of civil unrest. Iran is slowly turning into a failed state. The "Allmighty religous leadership" is in conflict with the political leadership of Ahmadinejad just short of a revolt. All this bullshit from these political parties just to stay in power. Crazy politicians and their lunacies to stay in power and people across the world paying extra $$ at gas stations. Israel should also come clear about its own non-declared nuclear weapons. Israel never threatened anyone with nuclear power. In fact, they never acknowledged to have one - they don't need to come clean. They are already clean with their intent to protect their country from hate filled neighbors.. Israel has made a decision on having NUCLEAR AMBIGUITY … that's their decision to make. However, it's clear that Israel possesses Nuclear Weapons and has weaponized them. That is, they are both land based and submarine based … No first strike could 'take out' Israel … there will be a 2nd Strike capability. As we speak … Israel's submarines are off the coast of Iran with their nuclear cruise missiles … So what do they need to show you? How big theirs is? It's big … that's all! Neither did Iran threaten anyone with nuclear weapons, since they don't even have them.Yet Israel is openly threatening to attack it. The Supreme Leader has said: 'The Zionist Entity is a cancer that must be removed' … 'The Zionist entity must be removed from the map' With this kind of talk … there's no need for the details … when the leadership of an Islamist Fascist State has made it their ISSUE … when they have funded terror proxies to attack Israel (Hezbollah … Hamas … Islamic Jihad) … when they have given them weapons and weapons training (Hezbollah … Hamas … Islamic Jihad) … whent hey have given them instructions on where and when to ATTACK (Hezbollah … Hamas … Islamic Jihad) … Israel pays attention … they don't have ADD … they're quite aware of the threat! If you're in Iran … keep your head down! Keep your head down in Iran … Haeckelist! Here's a column at the Commentator Blog:... It should answer ANY questions on what the Iranian leadership is thinking. These scumbags cannot be allowed to continue to lead the Iranian People. As usual … the Muslims are being lead by thugs … in Iran’s case ‘religious’ thugs … they’ll get their comeuppance … it’s called Karma … What they wish on somebody else will be visited on them instead! Nonsense. Israel threatened both the USSR and the USA with its intention to use nuclear weapons in the Yom Kippur war and overtly displayed preparations for satellites to see. The US was blackmailed into sending unprecedented weapons supply and the USSR blackmailed into not sending combat troops. It is a fair position for Israel as a country threatened with "annihilation" by nutty neighbours from time to time to have a tactical nuclear deterrent, but why do they need to have intercontinental missiles capable of hitting Beijing, Sydney or any European or American city? Could this be further blackmail? What very few people dare to say is that the very idea of a "Jewish state", that is, based on a religion which is based purely on blood, is inherently exclusivist and undemocratic towards non-Jews. Israel needs to find a way to be both home to the Jewish people and genuinely inclusive. You said: "Israel needs to find a way to be both home to the Jewish people and genuinely inclusive." FYI … to be Jewish encompasses 3 things: God … Torah … Israel God - Belief in the ONE GOD Torah - Belief in the Bible Israel - Belief in the PEOPLEHOOD OF THE JEWISH PEOPLE To be a Jew is belonging to the JEWISH PEOPLE … it's not ONLY about a religion … As a non-believer myself … I still believe in the Jewish People … believe they have a right to live in the State of Israel in Peace & Security … The State of Israel is a liberal democratic state … under the 'rule of law' … where all citizens are EQUAL before the law … with a Separate Judiciary … independent Police … thriving CIVIL SOCIETY … where all religious groups are FREE … Arab/Muslims … Christians … Bahais … Druze … Jews … et al and there is NO DISCRIMINATION BEFORE THE LAW. Get yourself an education! Read something from an unbiased source. Don't believe what you hear … read and learn with your own mind … Israel is NOT PERFECT … no democratic country is perfect … but ALL CITIZENS EXPERIENCE FREEDOM like those who live in the West … Israel is the furthest outpost of the LIBERAL WEST … there is no other Middle East nation that comes close … NONE … ZERO … NADA! QUOTE: Israel needs to find a way to be both home to the Jewish people and genuinely inclusive. It is already an inclusive country. The only fact is, Anti-Israeli elment don't want to admit it. Why is it that no one … and I mean anyone who is not Jewish … can't understand that to be Jewish … DOES NOT MEAN YOU ARE NECESSARILY ONLY A FOLLOWER OF THE JEWISH RELIGION? If you're an Italian … does that mean you must be Catholic or be a follower of Catholicism? If you're an American … does that mean you must be Protestant or be a follower of Protestantism? Why is the concept of being Jewish so difficult for non-Jews to get? We are a People as well! It's one way we can express our being Jewish … not the only way but ONE WAY! Is it difficult in order to keep the flame going of anti-Semitism? That is, Jews can never be Italian? Jews can never be American? Why can't we be hyphenated Italians or Americans? Why is that a given for others but not Jews? Are we a 'caste' … are we like American negroes of the pre-Civil Rights era? I don't get it. Being Jewish is … many things … including be a member of the Jewish People. The decision of the Jewish diaspora communities to keep - for millennia - separate identities from the rest of these particular societies made them often appear as an 'alien element' within the midst of others. It is this element of 'Jewishness' which created tensions . . . also throughout history. If this "otherness" is maintained in a "low profile" manner, it will be accepted nowadays; if the disparity is exercised in a power-seeking way, it will quickly be perceived as "fifth-column activities". (*) (*) Read for more explanation what I mean with that, "The Israel Lobby and U.S. Foreign Policy", by John Mearsheimer, Professor of Political Science at the University of Chicago, and Stephen Walt, Professor of International Relations at the Kennedy School of Government at Harvard University, published in late August 2007. BTW, the book was a New York Times Best Seller of 2007. Yes, of course Jews can be Italian or American. But that is not what we are talking about. Can non-Jews become Jews? Yes they can. You can marry a Jew … or decide on becoming a Jew and go through a conversion. It's not rocket science … you wanna be a member of the tribe … you gotta join! It's easy! What are you talking about? … it's been over 200 years that Jews were 'allowed to emerge' from the ghettos of Europe. Look it up. As far as the West is concerned … Jews are part of the fabric of EVERY Western State they live in … reaching the HIGHEST OFFICES … in business … the arts … the law … medicine … HI-TECH … and GOVERNMENT … Do you know anything about what you speak? Jews are civic leaders … that do not favour one group over another … NO EXCEPTIONS Jews in America are only a tiny percentage of the population … YET … AN OVERWHELMING PERCENTAGE OF AMERICANS FAVOUR … ISRAEL'S POSITION OVER THE ARAB/MUSLIM POSITION! This is a fact! Look it up! As for Walt/Mearsheimer … those bigots have made a business out of their 'Lobby' book … but the book was roundly 'panned' by all rational Political Scientists … they didn't do research … they did 'mud slinging' … hence the sales … 'Jews is news' I recently attended a lecture at the Munk School of Global Affairs in Toronto recently where another Political Scientist has written a paper that savages their so-called conclusions … it'll be coming out soon in a book form. At least it will be well researched … rather than the W/M rant! Whoever "D.L. from Jerusalem" is, one thing leaves no doubt in the readers' mind: he is no friend of Israel. Twisting facts and spilling endless innuendos, D.L. manages unsurprisingly to demonize Israel and underline the "innocence" of all Arab nations in starting the many wars against Israel merely because it is a Jewish state in the middle of an Arab neighborhood. It also implies that Israel should do nothing about the Iranian unbelievable threat, for the 21st Century, to "wipe the Jewish state off the face of the earth". Some strange people somewhere imagine that 1700 years of persecution can be repeated without the risk of an Armageddon. Sorry, but this will never happen. Netenyahu is one of the biggest obstacles to peace in the Middle East and the world. His Iran-Nazi Germany comparison is patently false. Actually Iran has been a protector of the Jewish people at various points in its history, and there is still a several thousand strong Jewish community that remains there. If Iranians hate Jews so much, why aren't all the Iranian Jews moving to Israel? Israelis need to get rid of this egregious individual as their leader. Quite the contray: Israel needs more such individuals and so does the Western world if it intends to survive. Otherwise ... too bad for human civilization. Netanyahu is an ass but there are 350,000 Iranian Jews that live in Israel only 25,000 Iranian Jews left in Iran. 25,000 is not a small number. Kind of disproves the whole Nazi Germany analogy completely. Israel needs this guy only if it wishes to be in a state of perpetual war. Humankind definitely does not need more individuals like him: a violent, narrow-minded, war-monger. Israel was in a "perpetual state of war" with its Arab neighbors well before Netanyahu was even born. And, as everybody knows, the war was not the choice of the Jewish state but of the Arab nations who tried to invade Israel on the day it was created but were all 'beaten to a pulp' on the field of battle. In fact, the Arab nations, without exception, showed a flagrant disrespect for the United Nations' decision – but then this is history. If you chose to ignore the truth, you are doing so at your own moral risk. Sorry. Jews in Iran are there, because they are prevented from leaving the country. They only way they can do it. very quietly and under wrap sell their assets. Travel to Turkey as tourists, then go to the Israeli consulate in Istanbul to ask to immigrate to Israel, Iranian Jews … you wanted to know about Iranian Jews … Here’s something just off the wire: The reality shows otherwise! During the Netanyahu government the amount of dead Palestinians and Jews has dropped nearly to 0 Sad, tragic and discouraging because everyone involved, the ME nations , Europe, and relatively sane Americans in leadership positions could be speaking up for rational policy choices to defuse the situation. Adding to the danger Iran is not playing its cards in its own self interest. The spotlight though is on the Israeli right wing who simply have forgone rational, logical thinking or anything remotely in the arena of strategically justifiable judgement. That a noisy don't know what the hell they are talking about contingent of right wing Republicans who are largely in thrall of a crack pot reading of the Bible hold an exaggerated amount of influence over whacked out and cowardly politicians adds to the possibility of an avoidable disaster. Where is the voice of reason outside of some timid rather simplistic editorials? In my naivety and ignorance I cannot help but question the apparent lack of mediating action on the part of the pan Arab countries. In light of the universal Islamic indignation over so many legitimate and illegitimate complaints why is there no visible movement toward formulation of stabilizing policy? Obviously religion is a major obstacle which begs the same question. Whatever happened to all for one and one for all? One would think if persons of influence and power are willing to fund military and sometime undeniable terror ventures they would put a little more effort into saving Muslim lives, though maybe not. It appears the concept has evaporated not only in the ME but globally. Not to overstate the obvious but how is it that so many fail to see the danger a world of divergent groups without the slightest inclination to solve problems poises for the continuation of a desirable quality of life for any people, or even survival? Polarization everywhere we look makes it appear we are experiencing the death of a will towards problem solving. It is the ultimate irony that most claim their position is in the service of some imagined god conceived in prehistoric times. Admittedly the past is never past and that is exactly why individuals and nations have to make the decision to drive towards pragmatic solutions in the present. What cannot be changed is over. Sane rational people have never been faced with a greater responsibility to speak up. Iran has 25,000 Jews, and in the Iranian constitution Jews are equal to Muslims and Christians. If Iran was serious about racial extermination, don't you think they would have started at home already? That "Israel has to be wiped of the map" was obviously meant as a call to the end of a zionist racialist and apartheid structure now in place, not a call for genocide. Haecklist, You need to stop listening to useful idiots Like Juan Cole who regularly repeats that crap. Iran is a holocaust denying antisemitc regime that has been rallying the conservative based with “Death to Israe"l rallies since 1979. It funds Hamas and Hezzbolah and has killed Jews through out the world in terrorists acts. You can guarantee most of the Iranian Jews have left the country and soon like all Muslim ME nations, there will be no Jews. Thank you for pointing me to Juan Cole. I did not know him. For others, apparently, he is an Iran expert at Michigan University. Here is his award-winning blog: Under Sharia Law … Muslims are NOT EQUAL to Jews or Christians … they are DHIMMIS The Jews of Iran … the ones that are left … are silent … because they are stooges of the regime … they are not independent actors … if they were free to make decisions … MOST WOULD LEAVE … there are always those that never want to leave despite their position. The Iranian constitution protects Jews and Jews are represented; one seat is reserved for a Jew in the Majlis. Iran is home to the largest population of Jews in the Middle East outside of Israel. There are 350,000 Iranian Jews in Israel, close to 100,000 in the US and 25,000 in Iran. It does not take a rocket science to figure that Jews are not welcome in Iran when one looks at the numbers. As far as Juan Cole is concerned, what he says is similar to what Jimmy Carter says. Carter has been paid $10,000,000 by the Saudis who also have contributed millions to ME study programs at Universities throughout the country for academics to bad mouth Israel. Their schills and will do whatever they are told to keep the money coming in. Google it. They are HOSTAGES … short and simple. Can they emigrate FREELY? Can they sell their homes and remove their possessions … and take it with them where ever? Can they speak to Israel and their families by phone? Can they receive letters from Israel? Their lives are circumscribed by the fascist Islamist state! Who are you kidding? Ok, then here are two more professors at very well respected Universities in the US: But I'm sure you'll just blame this on the Saudi oil money as well. As a matter of fact, I'm sure Saudi Arabia is the real one weilding power in the US from behind the scenes. It's all probably just a big plot to get the US to go to war with Iran. Those tricky Saudi's!! What are you a 'shill' for the Saudi gov't? Of course the Saudis wield power in the USA … THEY HAVE $$$$ AND ARE QUITE ADEPT AT GETTING WHAT THEY WANT. Didn't they get the USA to attack Iraq? for Kuwait? Where's the thanks we get for that? Where's the $$$ indemnification we got for that effort? Who is zoomin' who? Do you doubt that after 9/11 and the Saudis were caught 'RED HANDED' … not only funding the project … not only manning the project … BUT after 9/11 … the Saudi Ambassador had the 'chutzpah' to ask and get the USA to allow a PLANE to fly around the USA to pick up Bin Laden's family members! Hello? The USA allowed a plane … THE ONLY PLANE ALLOWED TO FLY … [remember ALL PLANES WERE GROUNDED] … and you tell me the Saudis have no 'PULL" … SHLEP … HAVEN'T GREASED THE WHEELS … in the highest offices of the USA? WAKE UP! Money talks … BS walks … The Saudis have plenty of $$$$ more than anyone else on Planet Earth … they get what they want … and they want 'the head of the snake cut off' … the USA will pull through all right … just you watch!7 The Saudis have funded ALL MIDDLE EAST STUDIES DEPARTMENTS … and they're preaching their views … in those departments … The Saudis have funded ALL THE NEW MOSQUES … and they're preaching Wahabi anti-West hate at the West … Look it up! Islamism … radical Islam … is a fascist political twisting of Islam … and it's being spread by Saudi Imams in Mosques in Europe & the USA … Walt & Mearsheimer … and their discredited rants … are not believed by a majority Americans … their ideas are not proven by scientific research … but by innuendo and smears … In Toronto … I just attended a lecture at the Munk Centre … the Political Scientist … tore their work to shreads … it will be published shortly in a small book. Perhaps it won't be a 'best seller' like their 'tome' … but that's due to … 'JEWS IS NEWS' … thanks for the vine! That book has gotten only 1 good review......from Juan Cole ! Look at the reviews from NYT, Chicago Sun Times, LA Times, Economist or any review on Amazon, the book is trash. HItchens called it “filled with no new ideas that and something that smelled foul”. Haeckelist, you know only too well (but love to repeat it while hidden behind your ridiculous nic) that the "zionist racialist (sic) and apartheid structure" is but a newer version of the old "Protocols". The venom that drips from your lips convinces no one except that envious that one can easily find in any 'on-line trash bin'. The civilized world is aware that Israel has to face Hamas, Fatah, Hezbollah, Al-Aqsa Martyrs' Brigades, Islamic Jihad Movement in Palestine, apart from many other terrorist groups, all hoping to destroy the State of Israel - if only they could. To this one can add a newcomer - Ayatollahs' Iran. If needed, Israel will take them all and still win - like it always did. You accuse Israelis with crap like "apartheid" & "Genocide" - yet you yourself sound worse then that. Accusations of the "Protocols"...wow. So again proving that critics of Israel dare always accused of anti-semitism. As for your list of terrorist groups. You are not seriously saying that Israel is defending its existence against these groups right? I am sure your Merkava tanks, F-16s, and 3 billion dollars in US military aid ensures you can handle, and have proved to be able to handle, a couple of hotheads with AK's. Haeckelist: Yes, as it happens, critics of Israel ARE antisemites - much as they like to pose as ... whatever. It is a matter of fashion: after 1700 years of faithful performance in this field, it is impossible to change what these people learn from their parents, who learned from their parents and so on - from time immemorial. Why is it that Hindus or Buddhists, for example, do not have similar ideas, points of view, postures and above all behaviour? As far as "hotheads with AK", there are also hundreds of rockets supplied mostly by Iran, bomber-boys, and other similar 'toys' that people like you, hidden behind a computer, don't have to face for the time being, nor their families. May I take this oportunity and bid you a final bye bye. This thread is getting to be tireing just like most of comments. Critical example By Israeli PM , the PM remember history CRITICALLY , Israel is Salt for the world; I think I would have been doing the same if I was Israel's prime leader. It all make sense for Israel to act in this way if they have to maintain them selves as a nation though small but capabilities to out smart any other notorious countries especially Muslim Nations. You're saying it is necessary to commit war crimes and steal land to maintain Israel? Maybe you should join the IDF terrorist group ....they will certainly let you kill many children and civillians. "Notorious countries especially Muslim nations". Wow. Imagine the uproar of bigotry if someone said "Notorious Jewish country". Some perspective for you. Don't generalise an entire nation with the few evils in it, for they exist in each other nation as well. Kindergarten common sense. The Land belongs to Israel as far as my knowledge is concerned ( my knowledge is based on Bible ), why Iran tried to harm Israel ? is the land belong to Iran ? why Saddam Hussein of Iraq? Syria ? etc etc ; anyways Israel have power to defend !!!!( my fear may be Israel to depend on God of Israel, God of Abraham( not abram) , to depend on the LIVING GOD !!! He promised , Has a eternal covenant .God Mercy , Peace, Grace upon them; To me, it seems more like Israel depending on the US and UK, not God. The USA & Britain … have not participated in any wars Israel has fought with the Arab/Muslims [The 1956 War was fought by Israel against Egypt INDEPENDENT of the British/French forces) … they did the 'grunt' work and got to the Sinai Canal WITHOUT any aid.] So … help me with this one BTGSB? I am genuinely sorry. I should have not oversimplified things. Of coarse I can not just extrapolate deeds of few to a whole nation. But still I must say countries like Iran acquiring Nuclear weapon does posses a severe threat to Israel. You know the history and just can't deny that. So all the noise Israel is making about Iran acquiring Nuclear Arsenal does is justified from my point of view and again I will iterate that in this context if I would have been the leader of Israel, I would have acted the same way. No way, I am not even close to that. You have totally misinterpreted me. My concern is just limited to this issue of Iran occupying Nuclear weapon and Israel making (in my point of view) right noises. Friend do not forget what has happened to this people in past and why at the first place Muslim nations are against of existence of Jews in the first place. They have not been able to defend them selves in past, now they can and rightly they should do so. Still, I apologize if my words hurt your sentiments. You said: "You're saying it is necessary to commit war crimes and steal land to maintain Israel?" No Israelis are guilty of war crimes … so you need to RETRACT your comment! No Israelis have stolen land … so you need to RETRACT your comment! You make comments … as if they're FACTUAL … but they are NOT FACTUAL … Stick to the facts … the only terrorists in this conflict are Arab/Muslims … Hamas … PRC … Islamic Jihad … et al These thugs are non-state actors … their 'resistance' continues unabated … until the IDF … OBLITERATES THEM! LOL Last week … 27 shahids were newly made … wanna keep score? Let me know Mike. Oh you're right, sorry I was mistaken. God came down from the heavens on a golden chariot and delivered high tech weapons to the Israeli's. Right after he manifested himself as the UK government and key decision makers in the UN to partition Palestine in the first place. I am terribly sorry I forgot all about that. Oh … so you mean weapons sales? Don't Arab/Muslims get weapons? Egypt … Jordan … Syria … prior to attacking Israel? Did they use bows and arrows? Stones? It's what you DO with those weapons! Why is it that Syrian Pilots have NEVER been successful in dogfights with the IAF? Why do they INVARIABLY crash and burn? BTW … Israel is a major ARMS PRODUCER … nothing they should be proud of BUT they had a need and you know what they say … "Necessity is the mother of invention" Why even those Arab/Muslims in Gaza know this … digging tunnels to 'import' Grad Missiles and making homegrown Qassam's! But Israel is doing a 'little bit' better on that score! Israel is better … jumps higher … because they have a more intelligent population! More graduates … more hi tech start ups … more motivated … more opportunities … they are a member of the OECD … What Arab/Muslim state can say that? Don't be sorry … "Now's not the time for your tears" Bob Dylan Read history - all the British and American archives were released several years ago. All the documents have been read by by scholars all over the world. It was a tri-lateral co-ordinated attack by the Britain, France and Israel. The problem is Israel does not release any documents - everything is kept secret to hide the truth. A liberal democracy??? What a joke. YOU'RE THE JOKE! Israel has archives and many, many historians! It's the Arab/Muslims that DON'T allow their archives to be plumbed! This is a fact! The Arab/Muslims have something to hide … therefore they don't allow their governmental dealings to see the light of day. Love your Arab/Muslim takkiyeh … but it won't pass for truth … Toronto, cut the crap about stolen land. Israel was created through legal action of UN. You can not accuse such country for their sovereign right to protect their land and their people from those who openly and continually tell the world of their ultimate goal to kill all the Jews and loot their properties. Went to the British Library to check this point. For the 1956 attack on Egypt, the full archives of America (including General Eisenhower's records) and Britain are available. My French research associate has sent me the French records. Israel's records do not exist. Based on the America, British and French records it was a fully planned invasion by the three countries. Incidentally, the whole conspiracy is fully disclosed in the writings of Sir Anthony Nutting (the British Minister of State in 1956) plus the detailed records relating to the subsequent resignation of Anthony Eden (the British Prime Minister). The secret agreement between Israel, France and Britain was made in Sevres (in France) on October 22-24, 1956 - three days of meetings and discussions - followed by a formal signed document!!! The complete details of the "Protocol of Sevres" are available. It is a signed document - David Ben-Gurion signed on behalf of Israel. There are 3 copies of this document - Israel's copy is available in the Ben-Gurion Archives. It is sad that you conceal the truth merely to make a point. It is also very offensive that you constantly write "Arab/Muslims" without thinking - there are 1.8 billion Muslims - the Arabs are a minority. Clearly you are bigoted - and certainly you are a racist!!! You should not bother writing any facts for people of this kind of mentality. It's not as if they don't already know these, things. It is how you say, they will cover the truth, twist stories, pretty much do ANYTHING to prove their point. I mean for God's sack, Tzatz over there is trying to say that Saudi Arabia weilds power in America from behind the scenes. I mean how can you take someone like that seriously? Thank you, BTGSB. Good advice. I agree the "deny and occupy" mentality does not do any research on issues. They merely like to shout down any opinion that is contrary to their mindset by writing posts in block letters. What Israeli war crimes? Show me any other army that drops leaflets and telephones people to warn them of an impending attack precisly to avoid civilian casualties? Yes war crimes are being committed, by the terrorist groups in Gaza who deliberatly place their weapon factories and rocket launching sites next to and in Mosques schools and other civilien centres. You are completely blinded by your own propaganda Wow. Self-congratulations … nice job boys … You said: "The problem is Israel does not release any documents - everything is kept secret to hide the truth. A liberal democracy??? What a joke." Then you talk about "Israel's copy is available in the Ben-Gurion Archives." Huh? Archives? I thought the Israelis hid everything and didn't give access to their archives? You contradict yourself! All I said was during the 1956 Sinai Invasion … it was the Israelis who made it to the Suez Canal ON THEIR OWN … they cut through the Egyptian 'Army' like they were going through 'Soft Cheese' … you see the Arab/Muslim Egyptian Army wasn't very good! You said: "Went to the British Library to check this point." LOL Did you need a constitutional? Don't get out much? Jolly good … lol You said: "I mean for God's sack, Tzatz over there is trying to say that Saudi Arabia wields power in America from behind the scenes." No … that's impossible … I've never heard of the Saudi Lobby? You mean … the Saudis have an embassy in Washington? I'll have to google … Saudi Lobby … to prove it to myself !!! Hmm. 10.8 MILLION ENTRIES … maybe I'll need to look that up! I am going to contradict myself and reply to this. Not because I believe it will make any difference in your opinion, but because TE is one of the only news sites my job does not block out and down time gets pretty boring. Let's go back to what brought Saudi Arabia in all this in the first place. I had posted a link to a paper that two American professors wrote about the relationship between Israel and the USA. You then tried to write it off by saying that the Saudi's are behind all people in academia that are not pro-Israeli. You then go on to talk about how the Saudi's were the real culprits of 9-11 and they used their political clout to blame others. So are you suggesting that we invaded two nations for absolutely no reason, knowing full well that the Saudi's were behind those attacks? And you have the nerve to call others conspiracy theorists... Hey I just googled llama and got 219,000,000 results. So that's it, I figured it out. It's those pesky llama's that are behind all this terrorism and Anti-Israeli rhetoric in the US acamemic arena!!! I say the US wages war on all llama's around the world. That'll teach those damn llama's to mess with us again!! I guess you have quite a few problems with the English language.........Basic facts are either ignored or not understood by you. Your government does not release any records about 1956 and/or other sensitive subjects like the ethnic cleansing of the original inhabitants of Palestine. The "Protocol of Sevres" was signed by 3 countries. I have seen Britain's copy. Your country's copy is available in the Ben Gurion archives.....However, I am given to understand that access to this document is denied. A few academics and jounalists claim to have seen it there. As for 1956 war, it ready does not matter what the Zionist army did or did not do. Why were they there in the first place!!! Egypt was fully within their rights to nationalise an asset, just like any country. The age of gunboat diplomacy is over. It seems that you are cocky about your army. Here again you might be out of date. Given the way your foreign policy is heading, you might have to face the Turkish military at some stage. The best policy for Israel would be to recognise that it is located in the Middle East. Consequently, it is clear that Israel's long term future will be bleak if it continues to treat all its neighbours will such rabid hostility and racially-motivated disdain. Constantly appealing to the US for help and support is a very short sighted policy for several reasons. US public opinion is getting fed up of overseas military interventions, particularly after the ill-fated wars in Iraq and Afghanistan. Furthermore, Asian super powers like China, Russia and India will assert their naval presence in the Middle East. The world is fast changing from a unipolar structure into a multi-polar structure. It's not about llamas … so don't start a crusade just yet. It's you who is obfuscating! You who is trying to deny the SAUDI LOBBY is powerful and getting access to the White House and getting things they want done … DONE BY THE USA. Gulf War I was a PRIME EXAMPLE. Denying that Saudi Arabia is building Mosques throughout Europe and America … preaching the Wahabi version of Islam … a hateful … anti-West … anti-Semitic … form of Islam. If you … an American Muslim denies this … you're denying knowledge that is 'common knowldege' … In addition, the Middle East Studies Departments are being flooded with funds from the Saudis … and guess what … the professors are towing a political line … that is … in line with the Arab/Muslim agenda … that is, anti-Israel … anti-colonialism … based on a belief in Orientalism as preached by Ed Said … If you don't know this stuff … that's on YOU … maybe you should google … OSTRICH … becasue you've got your head in the sand! You asked: "Why were they there in the first place!!!" See: Here’s the gist of it:. You can look up the rest … However, I’m reminded of the story … 'A pagan (non-believer) approached Hillel [a Pharisee, a contemporary of Jesus] and asked "Teach me the Torah while standing on one foot." Hillel replied, "What is hateful to yourself, do not to your neighbour. That is the whole Torah and the rest is commentary. Now go and study." Haha oh I get it!! because ostriches burry their heads in the sand. That was clever Tzatz, how in the world did you come up with that one? Must of been your Western education backed by the Saudi's. You are good with one thing, shouving words in my mouth. When did I ever say that Saudi Arabia does not have political clout in the US? I know they do, hell I get to see their rediculous marble embassy every morning and afternoon on my way to work and on the way home. I know very well the kind of treatment Saudi's get here in the US. I also know the kind of crap they try to preach all around the world with their mosques and translations of the Koran. However your claim that their political clout is strong enough to take the US military, in all it's might, to war half way around the world and influence professors in the highest levels of education is just stupid. I'm sorry and I don't mean to be offensive, but come on seriously?? If that were really the case, then western ideology as we know it would be obsolete, gone, history. If the Saudi monarchy can really take us to war, multiple times and is currently dragging us into a conflict with Iran, then they would have overall authority in our country. Which would mean the Suadi monarchy is the most powerful force in the world. Is that really the claim you are making? What I did was make an appeal much like Walt & Mearsheimer … did about the Israel Lobby. Now which tail is it that wags the USA? The Saudi Lobby or the Israel Lobby? Didn't you 'buy into' their rant? Well didn't you? So … no I'm not making that claim … but if the interest of the USA is/was restoring Kuwait … then it was done. It may have been in the Saudi interest AS WELL … since they would've been next on the target list. So what is it? Saudi Lobby? or Israel Lobby? OR JUST PLAIN OLD AMERICAN INTEREST?????? Thank you for the Zionist version of the events of the 1950's. I was well aware of these issues. That is the micro picture - the macro picture (which is more relevant) needs to be understood in greater detail. Therefore, all of this needs to be put into the context of bi-polarism, the Cold War and the creation of post-colonial alliances. Complex - and hard to summarise. Out of the ashes of WW2, there were 3 major political consequences. First, the demise of Britain and France as global powers. Starting in 1947 (the independence of India and Pakistan) both Britain and France began to lose their colonies very rapidly. Second, the emergence of the USA and Russia as global super powers. Both of them started competing with each other for "friends and allies". This plus "nuclear disparity" led to the Cold War. Third, the newly emerged independent countries unwittingly fell into the trap of "taking sides" with either the USA or Russia. However, out of all this mayhem there emerged a large group of countries who felt that they should not take sides and remain "non-aligned". The non-aligned movement was led by some very powerful personalities - e.g., Nehru (India), Tito (Yugoslavia), Seokarno (Indonesia), Nasser (Egypt), etc. All of them (and others in the non-aligned movement) were very nationalistic, anti-imperialist and had a built-in hatred of countries who were "super-aligned" - e.g., at that time, both Pakistan and Iran become very much aligned with the USA. With disasterous consequences for both of them!!! Israel was (and is) "super-aligned" with the USA. On top of that, Israel was populated by people from various corners of the globe, whose only claim to that piece of land was a few verses from an ancient text. Nobody had heard of such superstitious practices and unbelievable justifications in modern history!!! The Suez Canal was an important water connection for the colonial powers - e.g., for Britain as a connection to India, for France as a connection to Indo China, etc. Israel was (and is) viewed as an attempt to plant a "friendly" colonial state to further the interests of a world where colonies were seeking (and gaining) independence. Hence, the shipping issues!!! Had the Zionists potrayed themselves as an anti-Western/Middle Eastern people with a secular self-image/policies and a desire to assimilate with the culture of Palestine, the course of post-colonial history in that region would have been different!!! Thank you for the ‘Progressive’ or 'Fractured Fairytales' version of events … You said: “Israel was (and is) "super-aligned" with the USA” It was the USA that told Israel to stand down … remove themselves from the Sinai and Gaza in 1956! … from the 1950’s to the 1970’s … the USA … was not Israel’s ‘special friend’ … it was only after the 1967 War and especially after the 1973 War … that the USA became Israel’s ‘special friend’ … NOT BEFORE! You said: ‘On top of that, Israel was … in modern history!!” You are wrong. After WWI … the Great Powers … dispossessed the Ottoman Empire of its Arab/Muslim domains … at the San Remo Conference in 1920 … Britain was given the Mandate over Palestine which had as its Mission Statement … enshrined in its corpus … the Balfour Declaration … according to that legally binding agreement … the lands comprising today's … Israel … JUDEA and SAMARIA (aka, the West Bank) … and Jordan were to be nurtured as the homeland of the Jewish People! The League of Nations – ALL 51 States – VOTED UNANIMOUSLY TO APPROVE THE PROJECT. There is no doubt … the State of Israel has International Law on its side for laying claim to all of Judea & Samaria … but I’m satisfied … their claim is ‘not superstitious’ … You said: “Had the Zionists potrayed themselves as an anti-Western/Middle Eastern people with a secular self-image/policies and a desire to assimilate with the culture of Palestine” Huh? You’re telling the Israelis how to portray themselves … that is, how to behave? Who are you? Zeus? Should they behave like the other predominant culture and remain ILLITERATE … ECONOMICALLY DESTITUTE … MURDEROUS … TRIBAL … CLANNISH … THUGS? Is this the ‘culture’ you are asking the Israelis to assimilate into? [BTW … The Israelis think they make better hummus than the Arab/Muslims! Just ask them! LOL] Frankly, the Jewish State is secular … democratic … gay positive … where all religions are given equality before the law … where the CIVIL SOCIETY is robust … where the Judiciary is asked to judge whether governmental actions are LEGAL and stopping those that are not deemed so! Wake up! The Israelis are under constant attack by virtue of the fact they exist as a sovereign state. It matters not how large or small that state is … except for the fact that it can defend itself … failing that circumstance … the Arab/Muslims would have already perpetrated the ‘removal from the map’ of the Jewish State … as a matter of fact … all PA text books do not show a Jewish State ONLY a single state of Palestine … the day the incitement against Jews/Israelis/Zionist STOPS is the first day one could/can imagine a future of peaceful relations … NOT BEFORE. So you connivingly told lies on here just to try and get me into a game of circular logic and try to show me up as a hypocrate? It was a good attempt, I'll give you that much. However, all you did was end up contradicting yourself. You totally dismissed the paper by the two American professors due the the "Powerful Saudi Influence" in the country. While I know that Saudi's do get somewhat "Special Treatment" I don't believe that ANYONE who writes anything that isn't 100% pro-Israeli is paid for by the Saudi's, as you tried to claim. Then you contradicted yourself with your comment above. If you go back and read that paper, which I am sure you never did in the first place, you will see that it isn't anti-Israeli at all, but that wouldn't matter to you now would it? If he isn't agreeing with you 100% then you dismiss it as Anti- this or Anti-that rhetoric. Plain old American Interest? It is hard to judge your comment because now nothing you say can not be taken seriously. You have proven that you will lie, twist words, or say just about anything to prove a point that is simply not valid. Which one is it Tzatz? Are the Arabs "Monstrous?" Or should we take their word on Iran? Are they uneducated un-civilized barbarians? or are they cunning enough to infiltrate the US educational system at its highest level to produce propaganda? Are they terrorists? or are they savy lobbiests swaying our military to attack their unwanted neighbors? because I don't think invading and occupying Iraq or Afghanistan was to the interests of the US, nor were they to the intersts of any of the Arabs. Maybe the Monarchy benefited from removing Saddam from power, but that's it. What happened in Iraq and Afghanistan was a damn shame! We accomplished nothing and you sit here and try to make the claim that we attacked those countries instead of Saudi Arabia, the real culprit, according to one of your previous posts. Or were you lying about that all together? Your arguments are no longer credible and the best thing about it is, I didn't have to prove you wrong. You proved yourself wrong. Pure hypocrate, that's all you are and that's all you will ever be so long as you continue to blindly hate billions of people for absolutely no reason, other than having a different opinion. Oh my … you caught me? I am a fool to be caught by someone as cunning as you. But let me attempt to clarify … for you … so that you're clearer in YOUR thoughts … You said: "You totally dismissed the paper by the two American professors …" W & M are not being dismissed by me … they're being dismissed by MOST LEADING SCHOLARS … I attended a lecture recently at the Munk Center where the Poli Sci Prof … tore their 'conclusions' to shreds … there is NO TRUTH in their 'so-called research' … they took a magazine article … definitely NOT A RESEARCH PROJECT … and expanded it because it got good press … but then again why wouldn't it get good press … JOOS IS NEWS! the Lobby is another avenue of attack on Jews! "It isn't anit-Israeli?' HUH? The rest of your comment beginning … "Are the Arabs "Monstrous?" Or … a different opinion." I'm not anti-Arab or anti-Muslim … I'm anti-Islamist … PERIOD. Iran is lead by Islamists … Turkey's government is lead by Islamists … Egypt's elected parliament is 70+% Islamist … People are people … unfortunately the Arab/Muslim world is filled with ILLITERATES … FILLED WITH UNEMPLOYED YOUTH WITH EMPTY HEADS … FILLED WITH DISCRIMINATION against Women, gays, Christians and FILLED WITH THE MOST VILE ANTI-SEMITIC RANTS that fill their Media DAILY! But I'm anti-Islamist … since Islamists are ANTI-WEST … ANTI-AMERICAN … ANTI-ISRAEL/ZIONISTS/JEWS I won't make any politically correct renunciation of my 'take' … it's just my 'take' … I believe it's true … and unimpeachable! Islamists are what the Taliban represent … therefore the USA is fighting them … But we agree on one thing … the USA should never have gotten into Iraq and Afghanistan … at least not in the manner they have … if they needed to get rid of Sadaam Hussein … then kill him in a surgical strike … don't put 'boots on the ground' in an Arab/Muslim country … THERE'S NO SUPPORT … YOU ARE AN INFIDEL/OUTSIDER and can never be accepted … the same is true in Afghanistan … we need to get out ASAP NOT ONE MORE SOLDIER NEEDS TO DIE … NOT ONE! Only use drones and special OPS … not BIG numbers of troops Furthermore … we should resist aiding and giving $$$ to any Arab/Muslim country … stop ALL AID PROGRAMS TO THESE STATES … we don't know with whom we are dealing and until we have a clear picture to whom and what we're doing … STOP THE AID $$$$ … including to Egypt You said: "… you continue to blindly hate billions of people for absolutely no reason …" Arab/Muslims do not share our values … they do not share our 'way of life' … they even resist these upon becoming immigrants … thus … there's issues with Muslims in Europe NOT ASSIMILATING … these issues surrounding 'multiculturalism' are now being discussed openly in Europe … Holland just declared 'multiculturalism' a failed program … and instituted NEW REQUIREMENTS for immigrants (aimed specifically at Muslims) … Cameron … Sarkozy … Merkel … have each made MAJOR SPEECHES on failed Multiculturalism in their individual states … with their comments directed MAINLY AT MUSLIMS! SO DON'T POINT YOUR FINGER AT ME! I'm not the only one noticing what's going on. I'm against Islamists … that's all … they must be defeated … meaning they must be sought out and KILLED … THEY WILL NOT CEASE AND DESIST … we must root them out. I'm not against Islam or Muslims per se If I were that cunning, then you wouldn't be a fool to be caught by me. It would be expected. However, I am not that cunning and you were not "Caught" by me. You were caught by yourself. I was just cunning enough to notice it. I am an Islamist Tzatz. Are you threatening my life? I live my life by the rules written in the Koran. I pray 5 times a day, I don't eat any meat unless it is Halal or Kosher (if a Christian brand starts sloughtering in traditional Christian ways, I would eat their meat as well), I fast during Ramadan, I give alms, I have not yet made a pilgrimage to Mecca but it is high on my priority list, and I believe in the oneness of God. I also go to happy hour with co-workers, I attend Christmas parties (give and recieve Christmas gifts), I celebrate new years, pay my taxes in full every year. What is it about my life style, which is Islamic, that you are against? Am I too on your hitlist because I define myself as an Islamist? You are deeply confused. I am not pointing a finger at anyone. Notice I have never, ever, said anything Anti-Israeli, in spite of reading all the Anti-Islamic comments from you. It is you who points the finger, at quite a large group of people I might add. You always speak as if you have power to make orders. I am going to assume, and please correct me if I'm wrong, that you are NOT in any position of power. Therefore most of your comments are irrelevant. All people like you and I can do, is stop hating others for a difference in opinion or life style choice. That is all we can do to help the peace effort. I have done my part so I can sleep comfortably every night, and that's all that really matters to me. The rest of these debates on this website is, as I said earlier, a way to kill downtime at work, nothing else. I do not wish to try and change your opinion or views, I am smart enought now to know you just can't change people. Either learn to accept them and live with them, or die fighting a pointless fight. By the way, your comments about Muslims in Europe are a joke, just like the rest of your comments. Europe is looking for the new "Jew" to blame their problems on. The EU was a failed model, at least the way they have been carrying it out. Multi-culturalism did fail in Europe, because the Europeans are not nearly as good as us Americans to assimilate others into their culture. Americans are the best people, maybe in the history of the world, to do this. We cannot expect people of a lesser ability to do the same as us. We don't have this problem here in the US, why do you think that is? Aside from that, notice how the countries that are passing legislation against Islam are having the biggest problem. Doesn't seem like a coincidence to me. I know it's pointless making that argument with you, but it should provide for an entertaining response. either way, your arguments still wouldn't be credible to me. You said: "Am I too on your hitlist because I define myself as an Islam. THE WRITER IS DANIEL PIPES. As a resident of Canada … multiculturalism is what I've grown up with here in NORTH AMERICA … However, things are changing. Quebec's law against the head scarves … and the 9/11 Mosque 'blowback' … shows that while ostensibly easy going … there is/will be a blowback if the majority culture feels its being PUSHED. In Europe, never a good place for minorities, it's even more pronounced … the non-assimilating Muslim population … are only behaving as 'themselves' … they are self-satisfied and not looking to become 'Frenchmen' … 'Dutch' … 'Danish' … et al They want to remain Turks … Algerian … etc I have no problem with it … but I have a problem with ISLAMISTS … since they seek to change the society I LIVE IN. I'm happy with the 'rule of law' … equality … 'freedom' … I don't want anyone or any idea that could strip these from the society in live in. That's the bottom line. As far as the ME is concerned … well … Islamists are gaining ground in government … [that disturbs me] and they already rule two countries … [Turkey and Iran] … this is a 'malignant' intrusion into the life of Arab/Muslims that I think is negative to their 'growth' as world citizens. There can be no peace between Islamists and Jews/Zionists/Israelis. Therefore I see a long period of sustained clash … really the CLASH OF CIVILIZATIONS … Islamists vs Israel/The West I won't be mollified by your "learn to accept them and live with them" … the fact is … they won't 'learn to accept ME and live with ME' !!! You can practice your religion … it's not on me … [As an aside … a number of years ago … before HALAL meat became readily available here … I was at/near the Kosher Section … and I saw an obvious Muslim looking to buy some chicken … I approached him to say … Kosher Chicken is more expensive and he might be better off looking in the other MEAT SECTION … when the Muslim said he was told to buy Kosher if he couldn't buy Halal! I laughed at that one.] It's not about Muslims … it's not about Islam, the religion … IT'S ABOUT ISLAMISTS … a radical fascist political means of organizing society. I'm against Islamists/Islamism! These types won't change their spots … they need to be eliminated … stopped … BINYAMIN NETANYAHU'S comparison of the threat of a nuclear Iran to the Nazi Holocaust doesn't makes some Israelis cringe. Everyone is perfectly agree with him in G-d chosen land. The Jews of Israel use the Holocaust as blackmail, to be allowed free hunting of defenceless Muslims in the Gaza and Palestine. The Europeans and Americans seem to fall for it. After all it was one of their lot that was responsible for that act. Perhaps they should drop in on Afghanistan and see if their paranoia affords them a shield of invulnerability. Iran is not anything close to a Nazi like regime, that is a ridiculous analogy. That's as ridiculous as saying AIPAC/Israel dictate US foreign policy. Iran is a leading sponsor of terror and AIPAC has some leverage but the desires and influence of each is overated greatly by NeoCons and AntiSemites. You said: "… to be allowed free hunting of defenceless Muslims in the Gaza and Palestine …" You are using inflammatory language to display your bias AGAINST Israel … Israelis are NOT HUNTING … they're seeking out and destroying terrorists … absent the resistance to Israel … there could be/might be 'quiet' on the border. Israel is the homeland of the Jewish People … not because of the Holocaust … but because the Great Powers in 1922 said so … and the UN in 1947 voted for it to happen … It's a regional military heavyweight … it's not about to 'disappear' To those arguing for a preëmptive attack: Anyone care to explain how this attack (which is a horrible idea no matter how you look at it) might be carried out? ...so don't say airstrikes. At this point the only weapons at our disposal that we know can penetrate Iran's bunkers are words. Better to exhaust those, I think, before we go throwing pebbles against the sides of their fortresses. Iran … CANNOT BE INVADED … it's territory is impervious to a ground assault … it's like Afghanistan but with more mountains! Therefore … the only way it will be 'invaded' is by 'smart bombs' … included in that will be 'special forces' … to go where they need to go to 'finish off the nuclear sites' … Of course, the USA will exhaust all avenues BEFORE going to the military option … Let's not forget … we're still maybe 12 to 24 Months before military action is necessary … in the meantime … sanctions will continue to bite AND regime change is still possible … though improbable! We'll have to see how it plays out. Good informational article. Thanks for the link. Why were the words "in the shadow" in italics? Anybody explain?? Because Israel is not actually facing annihilation, just living "in the shadow" of annihilation, which causes a brain drain and talent drain, because those capable of leaving may rather do so. About the much-ballyhooed staements by the Iranian leadership to destroy Israel.If countries went to war every time a politician opened his stupid mouth, we would all have been turned to glass long ago. "My fellow Americans, I'm pleased to tell you today that I've signed legislation that will outlaw Russia forever. We begin bombing in five minutes." Dear masala, there was not only 'one' 'much-ballyhooed' statement, but plenty of those, everyday, by not only one politician, but all Iranians in charge. More than that, Iran did a lot of damage giving arms, trainment and mone to hezbollah (wich controls Lebanon) and hamas. So, there is a quite real danger. A bit after Saint Ronnie promised to bomb the Russians, his administration illegally gave arms to the Iranians despite an arms embargo. 'Boys will be boys' … The fact is … the USA was arming 'both sides' … Iraq & Iran in the same war! Nice bit of … 'a plague on BOTH your houses'!!! Remember … the Iranian arms issue … became a 'political issue' in the USA … called the 'IRAN-CONTRA AFFAIR' … the Reagan administration wanted to fund the Contras against the Commies in Nicaragua … but they were caught in doing so … remember Oliver North? Anyways … it was Israel as I recall … which sold the weapons to Iran (on behalf of the USA [THAT'S WHAT FRIENDS ARE FOR]) … But your comment about "every time a politician opened his stupid mouth" is puerile … we should be cognizant of what leaders of fascist state's say … they don't need to ask parliament to go to war … they don't need to ask ANYONE … the SUPREME LEADER … can look in the mirror and ask the 12th IMAM … and 'presto flasho' the missiles are flying! That's the difference! When Rob Ford … the mayor of Toronto … says something stupid … NO ONE CARES! But when the Supreme Leader says something … … … That's right - Israel sold hundreds of anti-tank and anti-aircraft missiles to the Iranians on behalf of the Reagan administration. It's called Real Politik! You may not like those you're dealing with … sorta like businessmen lining up to kiss the Saudi king's ring … in order to get OIL Licenses … you gotta wash those lips with a lotta soap afterwards … but the $$$ is good. 'Businessmen may drink my wine' … Bob Dylan But let me recall … that it was Ahmadinejad himself … when he was JUST AS NASTY ONLY YOUNGER … as a Basiji SS Troop Leader … who handed the 'little boys' aged 10-12 YR OLD … a 'plastic' lock and key … around their necks … and told them to walk on the lands where the Iraqis had laid land mines … in order that … THE KIDS WOULD SACRIFICE THEMSELVES … ADULTS SENDING OUT CHILDREN FOR THE JOB … hold me back I just had lunch and I'm about to throw up! Yes … trust these people with Nuclear Weapons … BUSCADOR First of all America did NOT give Israel nuclear bombs! Any Nuclear capability was obtained with the help of South African and their own scientists. Secondly you are entirely mistaken that Israel seeks to attack, invade, destroy or otherwise dominate the middle east. On the contrary it has throughout its history sought to live in peace with its neighbours. Unfortunately, the Arab countries have consistantly maintained war footing with Israel and it is the Arabs who seek to push the jews into the sea or worse!! Using the excuse of fighting Israel for the sake of the Palestinians is just a means of trying to justify their aggresive bloodlust. There are one and a half million Arabs living in Israel as Israeli citizens, When surveyed as to whether they would prefer to live under the Palestinian Authority if given the chance, 85% declined the invitation! And there you have it! They know that they have more rights, better education, better economic opportunities and better life styles as Israeli citizenst then in any other Middle East State! Its time the rest of the Palestinians stopped relying on their Arab "Brothers" to kill all the Jews for them and started to work with their Israeli "cousins" so that they too can acheive their ambitions for a better life. That survey is bandied about as if it is the last word on Israel's happy, grateful, spoiled-for-choice Arabs. But I suspect that as usual the devil is in the precise question and context. Any people asked if they prefer to stay in their homes or face mass deportation due to geopolitical games would probably choose to sit tight. But don't let that stop you from concluding what a wonderful, tolerant place Israel is. I won't … just ask the OECD … which Arab/Muslim country is a member of the OECD BTW? The Israeli Arabs want to live in Israel because of ONE issue … FREEDOM FREEDOM that is lacking in all other ARAB/MUSLIM states … and that includes the 'newly' Arab Spring states of Egypt, Libya, Tunisia and Syria. You can't hold your nose forever … you can try but when you're ready to 'smell the roses' … you'll understand that the issue of FREEDOM … is the MOST important issue on Planet Earth … America … the West … Israel … have freedom … Russia … China … Iran … the Arab/Muslim World … LACK FREEDOM !!! I envy you just a bit (sigh...) - it must be so sweet and simple to live in a comic book, completely black-and-white world... The comics I read … as a kid … were all in FULL COLOUR … you must be talking about the 'graphic novels' … that are in vogue these days! (sigh…) It's your world that's in B & W … [while I studied photography and loved B&W … in the real world … we need to see life 'as it is' …] You said: "… stay in their homes or face mass deportation …" Oh you mean 'population exchange' … like those practiced at the same time as Israel/Palestine was conceived like in Pakistan/India? Let me know if there's anymore Refugee Problem in India/Pakistan? Is there a Pakistani Refugee ISSUE? BTW … how many million passed back and forth between India & Pakistan? How many died in that mess? Let us know. For that matter … what about the division of Pakistan into East & West (much like the WB & Gaza) … How did that work out? In the end … how many died in that carnage of MUSLIM ON MUSLIM VIOLENCE? Let me know. LOL You said: "… what a wonderful, tolerant place Israel is …" You mean the Arab/Muslim ME is a tolerant wonderful place? Like the Copts in Egypt have a swinging time? OR … the Christians in Iraq? OR … the Kurds in Turkey, Syria or Iraq? OR … you get the point? Israel in comparison is a 'safe haven' for minorities … who are FREE … EQUAL before the law … and able to access ALL the ammenities of a FIRST WORLD STATE. Tolerant … what do you know about it? So trade with apartheid was normal for Israel? How fitting. They have and had so much in common. Why didn't you say so before? tzatz "israeli arabs" ie palestinians want to live in israel because it's their original homeland Why is it that you pretend that Israel does not govern the WB and Gaza? They have the overall police power and completely control their trade. They are under the Israeli umbrella and yet none of them have rights or FREEDOM. Do not forget they make up the majority of the land of Zion. By MILITARY GOVERNANCE … these territories were occupied in a defensive war … waged by JORDAN … when the war ended the lands were Militarily occupied … THEY STILL ARE … HOWEVER … the PLO/PA … have made many agreements with Israel and they essentially GOVERN most of the WB and Hamas governs Gaza independently … Absent the Arab/Muslims living on these lands … I'm sure Israel would accept/take them as their own … since as you rightly point out … Judea and Samaria are the Land of Zion … but since Israel wants to maintain itself as both a Jewish & Democratic State … it will need to accept a 'half a loaf' … these lands will be returned to the Arab/Muslim sovereignty when there will be a FINAL END OF CONFLICT SETTLEMENT … WHICH WILL INCLUDE PEACE … BORDERS … SECURITY ARRANGEMENTS … ET AL NOT BEFORE … let's hope it will be soon … but I'm not optimistic it will be soon … I think it will need a 'younger' generation to realize that 'resistance' is useless and the betterment of the People paramount. Up to today … the older generation only wants to keep the status quo … 'resistance' and lining their own pockets with EU/UN/American $$$$ … the new generation needs to think about the PEOPLE … is that what the Arab Spring has taught us? No, KALBAGH, it was NOT normal for Israel to be trading with apartheid South Africa! Nor was it normal for a country of 5 million people to be surrounded by 300 million Arabs in 22 countries plus 70 million Iranians, whos express desire and ambition was to murder every last Jew in Israel. Leave it out! Israel is not party to the NPT....Iran is Persian and speak Farsi...They are not the aggressors here! The people of Israel do not want war with Iran...This is another over-reach from bibi to divert attention away from their egregious actions toward the Palestinian people and the fact that his coalition is falling apart! The OECD is a meaningless club. China, the 2nd largest economy in the world is not a member. Likewise, India, the largest democracy in the world is not a member. Brazil (whose economy is larger than the UK) is not a member. Greece is a failed economy with a junk bond credit rating is a member. Enter the real world, where a mere .25% decline in China's GNP growth rate, causes the $ and Wall Street to fall!!! People and nations that do not study history are destined to repeat it. And pride comes before a fall. The Jews were evicted from most European countries (Spain, Germany, etc.) - the reason may lie in the non-acceptance of other cultures by the Jews themselves. With attitudes like yours, Israel will be a small blip in history. I am sure that there are liberal Jews - they must speak now to ensure Israel's long-term survival!!! The OECD is only ONE MEASURE of a nation's economic viability! But it's a club that boasts many of the top nations on Planet Earth … for Israel comprised of only 7 MILLION People (6 Million Jews) it is a remarkable achievement! That's all. You said: "… Jews were evicted from …" Didn't do well in history? Don't have the time to read the 'big' books? You'd rather state: " … the reason may lie in the non-acceptance of other cultures by the Jews themselves …" What does that mean? Who cares? … it's precious! You hope there are 'liberal Jews'? LOL Define them to me? Are they the kind that when the Nazis came knocking on the door … they said … but … but … no 'we're liberal Jews'? Are they the kind that when Hezbollah sends rockets at population centers and it lands on a 'liberal Jews' head' … they say … but … but … 'we're liberal Jews'? "As it is" has it right. The fact is, few years ago, when conversations about land swap between Israel & PLO were in progress. Few leades of Arab-Israelis were inciting the people against their governnment. Avigdor Lieberman had offered a novel solution. His proposal to the Arabs-Israelis who live in Wadi Ara'a (bordering with the West Bank. "If you prefer to join your Palestinians brethren. By all means, we will be happy to grant you your wish. All needed, is to relocate our borders with the PLO in WB west few hundred meters - such that, you will become citizens of new state Palestine w/o even losing any of your properties." 85% disagreed, as they did not want to live under corrupt government of PLO & fundamentalist of Hamas. In 1938 Joseph Kennedy, the U.S. Ambassador to Britain told Hitler that Germany was hurting her own cause, not so much because they wanted to get rid of the Jews but rather by the way they set out to accomplish this purpose with such a lot of noise; "At home in Boston, for instance, there are clubs to which no Jews had been admitted in fifty years...people simply avoided making a fuss about it." He went on to say that he himself understood their policy on Jews completely. Kennedy went as far as to insinuate that the democratic policy of the United States was a Jewish production. What's your point Hamoudi? I think his point was, it's hard to pretend your on the moral high ground when you have imperfections yourself. By you, I meant any nation wanting to go to War with Iran because of some "moral cause", not meaning to sound aggressive. Is that what you took from Hamoudi's history lecture? Just askin'? The agenda in the Middle East is not Israel related issues, just stay aside for some time. There is already uncompleted Arab Spring, especially Syrian clashes bear its fruit by overthrowing Assad, Egypt should transform to real republic regime.. Why does Israel always want to be at the core of the agenda? Does it have any complex psych like a child who wants to get attention from others? Isn't it obvious? Israel is not the core of the Arab/Muslim Problem. The Arab/Muslims are at war … with themselves! Read Lee Smith: The Strong Horse The Arab Spring is really the dawning of the Islamists … Islamists have nothing to provide for the problems that are wreaking havoc in the Arab/Muslim Middle East. 50% of the population is under the age of 24 (with no 21st C job skills) 50% of the population is ILLITERATE 50% of the population is DISCRIMINATED (including Women and minorities … Christians … Druze … Bahais … Shias … et al) The Islamists don't have a clue how to create an economic environment to transform the states of the ME … the problem is MODERNITY … they can't grasp the changes necessary to transform these places … Oh so I get it … you're a Muslim bigot? Is that it? A Muslim anti-Semite? Isn't it obvious? LOL Not quite. Good try though. Cat got your tongue? Spell it out? IF you can't spell in English then I'll have to use Google Translate. Your BS only needs to be shown 'the light' … your sickness is a disease that's rampant in the places you call home! Ver geharget! Hey man, you are funny... even in the face of such a menace... that's what they don't get about us... we are happy, or, just want to try to be... we never intended to do any harm but just to live and let live... Thanks. Ehrlicher Fein dist besser als falscher Freund! Tschüss. Gay kack offen yam … nidricher shvein hoont! While I am very sympathic to the position taken by Israel, but I also believe that China and Russia have a part to play within the UN Security Council as well. Mr. Obama is not provoking a war at this time, but sanctions must be intensified even further in order to bring Iran to its knees. And this is precisely why it won't work. No nation, in the history of the world, has let itself be "brought to its knees" peacefully. How about bring Iran to an agreement? That can be an option as well. But really, no one nation must threathen another nation to wipe it off the map. There are other methods to resolve conflicts and disputes. perhaps the time has come for the Arab world to sit down and negiotate with Israel. And for the Jewish State to give in some critical concessions in order to achieve lasting peace. But negiotations must be of integrity and building goodwill on ALL sides. What's the fuss about? Iran doesn't need the NUKE for destroying Israe. Iran needs the NUKE in order to remain an Islamist State. Absent the NUKES … Iranian Ayatollahs/ICRG believe they will be overthrown! The NUKE will also provide cover for their 'involvements' in the Sunni Arab/Muslim affairs … The NUKE will make an Arms Race the next logical step for Saudi Arabia, Egypt, & Turkey … All these emanate from the acquisition of NUKES by Iran It ain't on the table! Read my lips … the Ayatollah/ICRG will be stopped … either by regime change or an attack … Meir Dagan has said … the Iranians are still a couple of years away from the technology … and maybe longer with the weaponization (ICBM's) … so there'll be enough time to get the job done. But rest assured the Iranians will not acquire NUKES … So by your logic, Iran would want the bomb because Israel has it. And Israel wants it because someone else has it. Where does the insanity end? BTW...There is still absolutely no hard evidence of an Iranian bomb or program for it. They have also repeatedly stated that they do not want the bomb. Nuclear NON-PROLIFERATION is the goal of Planet Earth. The immediate goal is NO MORE NUCLEAR POWERS … no more countries with Nuclear Weapons! From this … line in the sand … we can hope to go backwards to ZERO NUCLEAR WEAPONS … but we have to STOP NOW! BTW … Which statements of the Ayatollahs/Iranian Leadership do you believe? Ayatollah Khamanei … when he said … 'the Zionist entity is a cancer that needs to be excised' Ahmadinejad … when he said … 'remove the Zionist entity from the map' Rafsanjani … who said … 'one Nuclear Bomb on Israel would destroy the country' BTW … the IAEA … the present DIRECTOR GENERAL Amano has said: "… there are also … other facilities which are not declared, and we have the indication or information that Iran has engaged in activities relevant to the development of nuclear explosive devices." You must be thinking about the previous IAEA Chief … Mohamed el Baradei … now there's a trustworthy fellow! LOL Your goal is unrealistic. Why would any country disarm themselves when other countries with histories of ignoring sovereignty have these weapons? I'm not disagreeing with you … BUT NUCLEAR NON-PROLIFERATION is the bottom line TODAY … NO MORE NUCLEAR POWERS ATTAINING NUCLEAR WEAPONS !!!! Once that has been achieved … we can work on nuclear disarmament … slowly but SURELY … the Soviets & Americans made advances on this issue … it's imperative if MANKIND IS TO CONTINUE ON THIS PLANET. NO MORE NUKES … NO MORE NUKES … NO MORE NUKES IN THE HANDS OF ISLAMISTS!!!! If man abandoned every unrealistic goal we would still be living in caves. Don't count your chickens before they're hatched! Communism was an unrealistic goal, and look how the pursuit of that killed millions of people due to famine. The Ayatollahs/ICRG will not achieve NUKES or weaponization (ICBM's w/NUKES attached) … this has been spelled out clearly as the USA & Israel (among other nations) … RED LINE Don't count on it. Iran will not be allowed to achieve this goal. Nuclear disarmament will never happen. Do you really believe any of the nations who currently have one would give them up? even if they do, where's the guarantee they won't just hide some, or re-produce them once other have gotten rid of them. Nukes are simply the new technology in weaponry. That would have been like trying to get rid of the pistol when that was first invented. Impossible. Keeping Iran from getting a nuclear technology is also impossible, unless you are advocating an all out war with Iran. Which would be illegal by any international law standard. Say what? "illegal by any international law standard" … If Iran is going to go for a NUKE and/or weaponize NUKES … they will be attacked. What you're failing to see is that Iran is a fascist Islamist State. They will NOT BE ALLOWED to acquire Nuclear weapons. NON-PROLIFERATION … is a goal … not an easy goal … but a goal nevertheless. Otherwise … we're doomed to having a nuclear war/nuclear winter … forget Global Warming … a Nuclear Arms Race in the Arab/Muslim Middle East is a nightmare scenario. These excitable types with a finger on the trigger is NOT going to be allowed. There are Great Powers on Planet Earth … the USA is the current Policeman … the leader of that state has said he's not for containment … he's for ending the rush to a NUCLEAR WEAPON. That's HIS red line. I'm OK with that. Whatever years I've got left to play golf … I'd like to know it won't be disturbed by radioactive fallout. It would definitely hurt my handicap. LOL Iran is 'crusising for a bruising' … it's as plain to see as … Again, Iran has repeatedly mentioned that they are not pursuing a weapon and there is still absolutely no hard evidence that they are. So yes, attacking them in any way would be illegal. What you fail to see is that getting rid of their nuclear program would be impossible without an all out war. I mean getting rid of it for good, not just delaying it. The US will not be able to be the world policeman forever. We are losing our credibility and it seems we are making new enemies every day. God knows what kind of monster we created in Afghanistan or Iraq and what kind of implications that will have for us in a few years. I would suggest we find a new way to deal with Iran, because the military option will spell sure disaster for everyone. Currently, Israel is the only nation in the ME with nukes. So before you complete your dream of getting rid of all nukes, try convincing them to drop theirs. good luck... That's a puerile answer … they're not giving up the NUKES they have … they're not illegal … BUT … Iran has signed onto a treaty that makes their acquisition of NUKES … illegal … they signed !!!! Therefore the IAEA must inspect and control their nuclear technology program … The IAEA … believes they're going for a NUKE and so does the USA … Britain … France … Israel … I don't have to go further down the list of nations … these are ENOUGH FOR ME! We didn't create monsters in Iraq OR Afghanistan … these places are monstrous! The Arab/Muslim Middle East is monstrous!! Haven't you noticed on your TV Screen this last year? Come on … we've all been a witness to the craziness! The Ottoman Empire … hid the MIDDLE EAST from our view for centuries … when the veil was lifted in the last 100 years … the dysfunctionality … the obscurantistism … the depravity … has now been exposed over time. Especially since 9/11 … the learning curve of the West has been slow but methodical … we can't quite grasp how 'medieval' the thinking is in this 'backward' place … but each day we're getting to know the people more and more. The war that's going on is between the various and sundry groups WITHIN the Arab/Muslim ME … they are at war with each other … the Arab/Israeli Conflict is hardly the issue … it's been made an issue BECAUSE the population is being 'played' … that's what you get when: 50% of the Population is ILLITERATE without 21st C job skills 50% of the Population is under the age of 24 50% of the Population is DISCRIMINATED … including Women and Minorities (Christians, Druze, Kurds, Armenians, Alawis, Bahais, et al) Dealing with Iran by military means … would ONLY SPELL DISASTER for the Ayatollahs/ICRG … the rest of the Arab/Muslim ME would make a hugh sigh of relief … remember the Saudi Arabian FM admonishing Obama to 'take the head of the snake'!!!! Regime change in Iran could/would prevent a military option. Ahhh Tzatz, leave it to you to jump from calling for nuclear non-proliferation to...well to your comment above. I'm not going to get into what is happening in the ME/Arab world. That was not the topic, please stay on topic. All I need to do at this point is copy and paste some of your comments to show your hypocracy: "The Arab/Muslim Middle East is monstrous" "remember the Saudi Arabian FM admonishing Obama to 'take the head of the snake'!!!!" - So you are now taking advice and using the words of such "monstrous" people to justify your cause. If the first statement above was true, then the Saudi FM's comments should have been an indication that attacking Iran would NOT be a good idea. So Israel's nukes are not illegal because they did not sign a paper...Let's apply that logic to another scenario. Let's pass out a contract to every US citizen. The contract will say that killing someone is illegal. All who sign it must abide by the law that murder is illegal. If you do not sign it, then kill away. Hey after all, you didn't sign it. Does that make any sense? If we agree, as an international community, that having nukes is a bad thing, then that needs to be applied accross the board. Anything else is hypocracy and just proves that you place Israel above other nations when it comes to the standard of conduct. And you still don't see how Israel has any hand in insuring there will never be peace in this region of the world? I didn't make Iran sign on to the IAEA … THEY FREELY SIGNED ON BTW … ISRAEL … the USA … BRITAIN … among others DID NOT SIGN ON … Frankly … Iran could now tear up their agreement to the IAEA but that wouldn't look very good … it might in fact make it CRYSTAL CLEAR their intention to go for NUKES … You said: "… then the Saudi FM's comments should have been an indication that attacking Iran would NOT be a good idea." I don't get your logic? The Arab/Muslim ME is monstrous … in the plain fact … governments use their army/police/various security forces … to rape … kill … torture … terrorize … the innocet citizens of each individual state! Assad & co are Monsters Ben Ali was a Monster Gaddafi was a Monster Mubarak was a Monster I could go on … but you get the drift … what the Saudi FM said was to attack Iran … what's not clear about what he said? Sorry … I'm not trying to be difficult … I don't understand your point. tzatz - - Khamenei has issued a fatwa against possession by Iran of nukes or any other WMD. Then he should open up all the Nuclear Sites … so that the IAEA can carry out their inspections unfettered!!! It's the IAEA that is nervous … of ya … under the previous head of the IAEA … Mohammed El Baradai … he obfuscated and 'worked' with his Muslim brothers … but NOW we have someone from the FREE WORLD … Khamanei has made many statements … it's important to recognize … those as well … He said: 'Israel is a cancer that needs to be expunged' … the previous 'Supreme Leader' Khomanei said: "We will remove the Zionist entity from the pages of history' So which statements of the Supreme Leader do you believe? I believe … and most of the FREE WORLD … believes … the Iranian regime is going for NUCLEAR WEAPONS … it's just a 'hunch' but guess what … unless all the sites are open and inspected and are subject to 'spot' inspections … his words are WORTHLESS! Anyways … those are the requirements of the IAEA … if they remove themselves from the IAEA commitments … they're GOING FOR NUKES! They've put themselves in the Catch22! Poor chess players … tzatz - Ahmadinejad and Khamenei both have made clear they expect Israel to fail, and thereby "vanish from the map" by natural causes, and NOT BY MILITARY ATTACK FROM OUTSIDE. tzatz - Saudi Arabia and Iran both support a Middle East free of nukes. Perhaps a majority of Israelis do too. You said: "… by natural causes, and NOT BY MILITARY ATTACK FROM OUTSIDE …" Natural causes? Like a plague? Like a earthquake/Tsunami? Like Chicken Pox? What do you mean? Of course the Iranians think that Israel will 'disappear' by Military means! They support Hezbollah which waged war in 2006 … They support Hamas whose charter states it will never recognize or live with a sovereign Jewish State They support Syria who is the only 'front-line' state NOT TO SIGN A PEACE AGREEMENT and has in the past 10 years attempted to get a NUCLEAR DEVICE of their own ILLEGALLY (paid for by Iran) Let me know what you mean. tzatz - - Syria has offered peace to Israel for decades. Iran on March 15th (ABC News, report by Christiane Amanpour) confirmed it does not seek destruction of Israel BY MILITARY MEANS. Israel will destroy itself, in the manner of the Soviet Union. Syria & Israel … nearly made Peace in 2008 … the Turks were the intermediaries … I attended a lecture by one of the 'main' Israeli delegates … he said it was down to … the issue of where the border on Lake Kineret was to be finalized … then the Gaza War ended all talks … You know what? It was fated to happen that way. Any peace deal is USELESS with the likes of the Arab/Muslim states surrounding Israel … Egypt wants to look at the treaty … perhaps Jordan will want ammendments once the King falls to the MB … so what good is a treaty … if ONLY one side keeps the peace agreement? As far as Iran's boasts … these are merely the last sputterings of a dying regime … the sanctions are really biting … the people are REALLY upset at the regime for getting them into a terrible 'pickle' … the Ayatollahs CAN'T BACK DOWN since their self-image is at stake … a CATCH-22 if I ever saw one … Ayatollah Khamanei has ordered the Syrians to pass ADVANCED anti-aircraft missiles to Hezbollah … they've been observed by both the USA & Israel spy satellites … the WMD's (CHEMICAL/BIOLOGICAL) will be next … maybe Iran is cooking up another fight on the NORTHERN BORDER of Israel as a sideshow! Keep the pressure off Syria and/or Iran … for the attention of the Arab/Persian Muslim People … The Israelis don't want to get involved with Hezbollah but if they're pushed … they WON'T HESITATE to destroy Lebanon … pity! It will be Nasrallah who will be 'dug' out of his underground lair … and beheaded! Literally! Israel is more dyanmic that you give it credit for … tiny but wiry … did you ever underestimate a wiry opponent? That's what you've got when you 'MESS WITH THE ZOHAN' … lol Bibi Netanyahu tries to avoid facing the simple fact that Israel's largest security problem flows from its failure to get out of the West Bank. Well said. What's the issue with Israel still in the West Bank? From 1948 to 1967 … Jordan controlled the West Bank … The Arab/Muslim indigenous population didn't howl and moan! They didn't protest when Jordan ANNEXED the territory to JORDAN … But they can't 'stomach' the occupation by the IDF? Well … my answer is … 'get to the table' … make a deal … Concessions and Compromises … NO RIGHT OF RETURN NO OFFENSIVE MILITARY MAJOR JEWISH SETTLEMENT BLOCS INSIDE ISRAEL with offsets for Arab/Muslims inside present day Israel Border to be adjusted … see above … in order to make them defensible and secure as per UN 242 Absent those types of compromises & concessions … the status quo is what will continue. NO FREE RIDES for the Arab/Muslims on the West Bank and Gaza. No need to love your enemy as yourself … A high wall and secure borders will do just nicely! Logical border is 1949 Armistice line (Green Line). Perhaps with a trade or two of teritory. No need for Jews to leave Palestine, but compensation would be payable. Sounds like something already cooked up … as in the Clinton Parameters of 2000 AND Olmert's offer in 2008 to Abbas … In both cases … they were rejected by the Arab/Muslims … Arafat in 2000 and Abbas in 2008 … why compromise or make concessions when the International Community continues to pour $$$ at your feet for being intransigent! Besides … someone inside would 'pop you off' … kill you … if you made a deal with the Israelis! The Israelis are willing and able to make such a deal … it's un-doable TODAY … this group of leaders is NOT READY TO MAKE THE SACRIFICE! The settlements in the West Bank WILL NOT BE GETTING SMALLER as time goes by … change is the HUMAN CONDITION … therefore … the need to 'get to the table' is imperative. There's lots going on now to distract the Israelis but as we've just seen in the recent Gaza flare-up … there's no getting around it … the Arab/Muslims of Gaza & the West Bank need to live under their own leadership … separate and apart from Israeli intrusion … [except when attacked]. This last exercise from my POV was a mistake. But mistakes are made when you have hostilities brewing 'just below a boil' … "What's the issue with Israel still in the West Bank?" Have you not been paying attention to local, regional and international objections? “From 1948 to 1967 … Jordan controlled the West Bank...they didn't howl and moan...nor protest when it annexed the territory." Well that’s obvious, they saw the Jordanians as fellow Arab protectors against the new Israeli state... A misplaced faith as it turned out. “But they can't 'stomach' the occupation by the IDF?” Would you tolerate being indefinitely administered and maltreated by armed forces you saw as alien and hostile? They may take their time but even the Russians and the Americans occupations eventually end. “Well … my answer is … 'get to the table' … make a deal..” They have but unfortunately it’s been a one sided series of negotiations that leaves them with less land and status each time. No right of return. Sorry, that's “NO RIGHT Of RETURN.” Why? Isn't that the very thing the modern Israel is founded upon? If people that haven’t lived there for a millennia have the right of return then why not those that have and their descendents? Which part of that demand involves concession and compromise? “NO OFFENSIVE MILITARY.” Sorry but does this include the IDF? “MAJOR JEWISH SETTLEMENT BLOCS INSIDE ISRAEL with offsets for Arab/Muslims inside present day Israel” I'm not entirely sure what this encompasses but I hope it doesn't mean that more Palestinian land is to be bartered away in exchange for land previously annexed or confiscated. “Border to be adjusted … see above … in order to make them defensible and secure as per UN 242” Obviously this means redrawing the border to secure and defend illegal West Bank settlements, which due to their placement is extremely problematic if not essentially a validation of the land grab. It is good however to see a reference to enforcing UN resolutions but do you mean to extend that to all UN resolutions? “Absent those types of compromises & concessions … the status quo is what will continue.” The above are neither compromises nor concessions, they are demands. Status quo implies a static situation but that is not what new settlements entail. “NO FREE RIDES for the Arab/Muslims on the West Bank and Gaza.” Do you mean no right of self determination or are you advocating a transport policy? How about no free rides for anybody. Obviously there will be a renegotiation then of the water rights in the region in line with that sentiment as well a revisiting of the municipal zoning and approvals of settlements. Or did you just mean that to apply to Palestinians? “No need to love your enemy as yourself … A high wall and secure borders will do just nicely!” Fortunately, as the Berlin wall displayed, concrete can be pulled down and borders become matter of fact. I only hope the high walls that surround your mind can as easily become obsolete. Blah … blah … blah The deal offered in 2000 & 2008 … along with the Clinton Parameters … are the framework … NO RIGHT OF RETURN NO OFFENSIVE MILITARY ARMY MAJOR JEWISH SETTLEMENT BLOCS (with offsets) BUT … what's more important … what are you going to do with HAMASTAN? They refuse anything but the disappearance of the Jewish State! So as I've said … there will be no deal at this time … the Arab/Muslims need NEW leadership … one that is willing to do something for the benefit of their people … Abbas & co are useless 'apparatchniks' … Haniyeh & co useless 'Islamist ideologues' … a more pragmatic youthful group needs to take command of the people's interests … since the average age of the Arab/Muslims is under 24 … WE NEED A YOUTHFUL LEADERSHIP! As far as the Israelis? They'll be waiting … but the settlement construction is continuing … you can't expect that to stop! One of these 2 groups … Israelis vs Arab/Muslims … is moving forward as fast as they can … groovin' on the 21st C. The. Abdel- - Every Arab country has agreed to accept Israel within its pre-1967 broders. If Israel has "hostile" neighbors, that is largely Israel's own fault. So what's your point … Abdel? That Americans aren't good with geography? You know there was a comedy show (Rick Mercer Reports) in Canada … the host went to American cities and interviewed people on the street and made up some silly stuff about Canada and asked the American if he know about it or to speak about it. It was funny … and Canada shares a huge border with America. America is a 'special' place in this world … even if they're 'weak' on geography! You said: "Every Arab country has agreed to accept Israel within its pre-1967 broders …" When did they say this? When did they accept Israel within 1967 borders (which ARE NOT THE BORDERS)? Do you mean the Arab Peace Plan? The one that states … the Right of Return for Arab refugees into Israel? This is a non-starter! Let me know. BTW … did HAMAS agree to accept Israel within 1967 'borders'? Did the Muslim Brotherhood? Let me know. tzatz - - Yes, Hamas as part of previous unity government accepted 2002 Saudi peace plan. Obviously, "right of return" is a non-starter. Real question is: will Israel get out of the West Bank, to save itself? tzatz - - You apparently assume illegal immigrants cause changes in borders. So what if 500,000 Jews find themselves living in Palestine? Most of the 'illegal immigrants' live in the suburbs surrounding JERUSALEM … Jerusalem can never be a DIVIDED CITY again … there is NO SUCH ANIMAL ON PLANET EARTH … a capital divided between 2 countries? Where and when? However … the issue of Right of Return will be settled with $$$ for both Jews and Arab/Muslims … The border issues could be settled via the Clinton Parameters … in fact … they were settled between the parties … BUT … there's a lack of will ON BOTH SIDES at this point … the Arab/Muslims aren't ready to commit to the Compromise and the Israelis aren't thinking the issue is #1 on the list (Iran and the outcome of the 'Arab Spring' are more demanding presently) … The Bible said: 'to every thing there is a season, and a time to every purpose under the heaven' That time is coming … when the leadership of the Arab/Muslims are more interested in their people than in their own bank accounts! When will that time be? … 'the answer is blowing in the wind' tzatz - - Israeli delusions of keeping most of the illegal colones of Jews in the West Bank threaten the long-term security of Israel. Israel should take the deal the Palestinians offered at Taba, Egypt in January 2001. I'm sorry Tzatz, but your a Zealot and as with the historical name sake, the absolute faith in the rightousness of the cause and corresponding inability to compromise in the name of peace contains within it the seeds of self destruction and misery for all. The same way, that invading the Lebanon to irradicate the PLO resulted in the rise of the Hezbollah, the harsh treatment in the occupied territories and maginalising of the P.A. resulted in the rise of Hamas and the Siege of Gaza in the Peace Flotilla and the break with Turkey. Which all brings to life John Milton's refrain "For what can war but endless war still breed." The military solution is seductive but ultimately doesn't deliver. The US is facing this truth at present in relation to Afghanistan and Iraq. P.s. Normally I make it a rule not to reply to posts that capitalise whole sentences as it indicates a rude intolerance; a lapse I'm beginning to regret. The deal is Taba was offered to Barak who was in the midst of an election campaign … guess what came next? Intifada II … the one that Sharon ended with the clampdown on the WB and the creation of the SEPARATION WALL … don't you know your history? The Arab/Muslims should have taken the deal offered in June 2000 at Camp David w/Clinton & Barak or in December 2000 when the Israeli Cabinet approved the Clinton Parameters BUT Arafat said NO. WHAT ABOUT OLMERT'S OFFER IN 2008? Look … if timing is everything … the time is not now for a deal. The Arab/Muslim ME is going through an upheaval … Iran is a problem … this is no time to make a deal with the locals … they are divided between Hamastan & the WB … they can't even agree with each other … how do you expect Israel to make a deal where the Arab/Muslims will not launch attacks? Rmember … if they separate (Israel & the WB) and there's an incident … there'll be war … not a police round-up … war … The Arab/Muslims are not ready for an end of conflict settlement. There's NO CHANCE that there will be peace now … not for sometime. NO CHANCE. Didn't you get the memo? Hezbollah was an Iranian proxy … a plant nurtured by Iran to push their anti-Zionist agenda … the Israelis need to enter the 'fray' in Lebanon … in order to remove the missile threat of the PLO … But … Lebanon is a hornet's nest … there's a respite and then … there's a need for another 'smackdown' … 'Are you ready to rumble?' "resulted in the rise of Hamas" … What are you? The fractured fairytale historian of the Arab/Muslims? Hamas is an offshoot of the Muslim Brotherhood … they are/were/will be part of the Peoplehood of the Arab/Muslims … because 'that's how they roll' … it's not because of Israel … it's because they're MUSLIMS! As for "John Milton's refrain" … tell that to the Germans and the Japanese! War is hell and war is misery but war makes one think twice about the consequences of another 'smackdown' … Since 2006 … it's been 6 years of QUIET from the Lebanon … care to guess why? PS … it's not because Hezbollah won the war (they didn't) [You know it's funny … Sadat sold his Egyptian People the story that HE won the 1973 Yom Kippur War … that's why he told his people that he could make peace since he WON … ya right] I'm not an advocate for more war … but it's inevitable when your adversary believes 'next time' they'll win … Arab/Muslims have an infinite belief that Allah will provide them with victory … they're thinking like the devout Muslims they are … when they get their asses kicked … it's hared for them to reconcile but they throw together some BS and away they go … they're good for another while … I agree the USA should get out of Afghanistan tomorrow … they won that war 8 Years ago … get out and don't look back … take all the $$$ and give it to the States that need it BACK HOME. Zionist? You called me a Zionist? You talkin to me? Memo, do mean the one from the IDF Spokesperson's unit? No I didn't call you a Zionist, I likened you to a zealot. Look it up. "there's a need for another 'smackdown' … 'Are you ready to rumble?'" "it's because they're MUSLIMS!" Everytime you shout an opinion at me you diminish both our IQ's. Don't flatter yourself! lol Easy saying... hard to do... to let hamas send rockets from Judea and Samaria also ? Problem here is that people simply don't see the map and size of Israel, or pretend not to see. Geography must be a 'hard' subject for more than just Americans. BTW … this morning in discussing the latest Gaza rockets aimed at Beersheva … with my son … I suggested it was like the Arab/Muslims shooting a gun at you and they miss … what would YOU do … would you say 'oops you missed' take another shot or would you take dead aim and kill those that fired at you? Let me know. Cuz I know what the Israelis are thinking … and that's why there are funerals in Gaza today! Why is the "right of return" (of people who had homes and lands located within Israel) a non-starter?? Very few people (including myself) can understand this. I would imagine that such a right would be very logical and would end one of the main reasons for this perpetual conflict!!! Did you have a straight face when you wrote this? Just asking? There is no RIGHT OF RETURN. BTW … the war ended in 1948 … that was … 64 YEARS AGO Between 600,000 to 750,000 Arab/Muslims left their homes freely/were driven out by events/were driven out by Israel … this is TRUTH. That's what happened. After the war … the Arab/Muslims DID NOT WANT to make PEACE … they continued to use the Arab/Muslim Refugees as a POLITICAL TOOL … they didn't settle them in their various countries … in order to foment HATE for Israel/Zionists/Jews … up until TODAY. BTW … AT THE SAME TIME after 1948 … between 700,000 to 850,000 JEWISH REFUGEES … were thrown out/had their businesses stolen/forced to leave without their property … FROM ARAB/MUSLIM STATES: Egypt … Libya … Tunisia … Algeria … Yemen … Morocco … Iraq … Syria … et al These Jewish Refugees landed in Israel (the POOREST ONES MAY I ADD … THE RICH ONES LEFT FOR EUROPE OR AMERICA) … in effect … there was a POPULATION EXCHANGE … ARAB/MUSLIM REFUGEE for JEWISH/SEPHARDIC REFUGEE There will never be a return of the Arab/Muslim refugees to Israel. You're either naive … clueless … or an Arab/Muslim apologist. In any case, this has been clear in all discussions between the PA and Israel … NO RIGHT OF RETURN … the Arab/Muslim PA KNOW THAT … WHY DON'T YOU? Last word, no returns. Carlos65 - - The idea is for Israel to make peace with the Palestinians. Ergo, no rockets being sent from Palestine. And, perhaps tens of thousands of peacekeepers will be needed for a number of years. But Israel needs to get out of the West Bank for its own sake. Tzatz - - Israel needs a deal, and the January 2001 offer made at Taba, Egypt was accompanied by detailed maps. This is a deal Israel should take, for its own sake. Alternative is to try to take even more land, and put the entire programme into jeopardy. The West Bank belongs to the Land of Judea (Ancient Israel) and the East Bank to the so-called made up Hashemite Kingdom of Jordan founded by the British in 1921, and was recognized by the League of Nations as he Emirate of Transjordan. The Syrian state was established after the First World War as a French mandate. In fact the Arab Johnnies-come-lately came up from the sandy South, occupied and almost eradicated Ancient Egypt and had it not been for Napoleon who stopped the destruction in the nick of time and Jean-François Champollion we would not have known anything about the land of the Pharaohs. The Jews having defeated the British who did their worst trying to stop the re-establishment of the Jewish nation now have only "The tiny." All the Arab countries today were the creation of the British (ref: the real Lawrence of Arabia) and the French out of what was the Kingdom of Ammon, the Kingdom of Israel and the kingdom of Judah. I'm not disputing that Garvagh … Taba was as close as December 2000 and Olmert's offer in 2008 … The issue is … timing … Will the PA give up the Right of Return? The Israelis have already shown they can remove settlers … having done so in the Sinai and Gaza … so what's holding things up? The timing is bad right NOW … Point #! … in case you haven't noticed … the Arab Spring BS … is changing the dynamics of the ME … Israel needs to watch this/wait this out … Point #2 … Iran and their Nuclear Program needs to be handled in the next 36 months FOR SURE! After that … I can see a deal going down … Compromise & Concessions … ISRAEL is a strong power with friends … they're not about to be intimidated or pushed into a deal that's not right! They'll make the deal … but the timing is wrong right now. You may not want to hear that … but the WB & Gaza … aren't that important … Israel's got them 'under control' presently … tzatz - - Very limited "right of return". But border of Palestine will be the Green Line, with a possble trade of one or two parcels. Seucurity wall needs to be on the border. Alternative, of course, is one-state, with non-Jews ultimately taking control. The proposal has been approved by the Israeli Cabinet in 2000 December … it's called the CLINTON PARAMETERS … LOOK IT UP! Arafat … declined Imagine had he said YES … there would not have been INTIFADA II … and a Peace Agreement in place for a DECADE … Arafat SAID "NO" … in 2000 Abbas SAID "NO" … in 2008 to Olmert The contours of the deal are known to both sides … the timing right now is not propitious … it'll be towards the end of Obama's next mandate or the next President if he pushes the Arab/Muslims to the table … it's about the Arab/Muslims putting down their WEAPONS … the Israelis cannot/will not put themselves in ANY militarily compromised position … it's a matter of trust/takkiyeh … after decades … we can call it trust … NOT BEFORE … Abdel -- If Israel keeps the West Bank, the country ultimately will be re-named Palestine. Maybe this is what you want? Straight face - yes!!! Naive, clueless, an Arab apologist - certainly not!!! Let us get get these petty issues out of the way - since you like to be very abusive to people who disagree with you. Now on the issue of the Muslim and Christian population of Palestine prior to the arrival of the Zionists. Very detailed records on this issue are available from a variety of sources - e.g., Turkish, British, American, UN, and several recognised academics. It is clear that communities who lived in Palestine have been evicted by a very theocratic state. By using violence, majority communities have been reduced to helpless minorities by the Jewish people. The methods used are somewhat similar to Nazi Germany. Israel and Iran are both theocratic states - both need to transform themselves into modern democratic and secular states. The only difference between Iran and Israel is clear and stark. Iran is a historical entity dating back hundreds of centuries. Israel is a transplanted man-made state which was born out of European guilt for centuries of Jewish ethnic cleansing. I am surprised that the Jews blame the Germans - the Romans and the Spanish were equally repressive of the Jews. Therefore, till Israel agrees to the right of return, the Jewish state will face hostility and opposition. Not only from all the countries in the Middle East, but from liberal intellectuals all over the world. From New York to Beijing!!! This hostility will not be resolved by denying nuclear weapons to Iran. India, Pakistan China and Russia (in Asia) all have the bomb - soon Turkey, and possibly, Egypt will want to go nuclear. The problem of modern technology is that it spreads. That is why a nuclear-free world is the only way civilisation will progress. Likewise, global bodies like the UN will need to be strengthened. The current method of "occupy and deny" is very silly - specially come from people who pretend to be educated and enlightened!!! You said: "… that communities who lived in Palestine …" The Arab/Muslims who lived in Mandate Palestine in 1947 … began a CIVIL WAR with the Jewish inhabitants … after the November 1947 vote of the UN to divide the land into 2 STATES … one Arab and one Jewish! In 1948 … after the Jewish State declared its independence in May 1948 … 5 Arab/Muslim Armies attacked the nascent state in a war of 'annihilation' … during that war … 650,000 Arab/Muslims became refugees … as a result of: A] leaving the battlefield on their own B] leaving the battlefield because they were told to by the AHC and were sure of victory/would return shortly to their homes C] left the battlefield because they were PUSHED OUT by Israeli Military Necessities … They will NEVER return to their prior homes … it is 64 YEARS after the battle … A] there is not ONE INSTANCE OF REFUGEES continuing this long to live in 'refugee camps' … B] there is no ONE INSTANCE OF REFUGEES having a UN Agency dedicated to their needs … C] there is not ONE INSTANCE OF REFUGEES being defined as those who lived in Mandate Palestine FOR ONLY 2 YEARS PRIOR TO THEIR DISPLACEMENT and D]there is not ONE INSTANCE OF REFUGEES being defined so that their children and grandchildren and greatgrandchildren are considered REFUGEES AS WELL … The only reason this exists is so that the Arab/Muslim States … could use these refugees as a Political Tool … TO KEEP THEIR 'RESTIVE' POPULATIONS FROM CONCENTRATING ON THEIR OWN INTERNAL PROBLEMS … in order to focus their attention at the 'Israeli Issue' … You said: "Israel and Iran are both theocratic states - both need to transform themselves into modern democratic and secular states" Israel is a liberal democratic state … it is a member of the OECD … it has a thriving Arab/Muslim, Christian, Druze, Bahai, GAY … and Jewish life … equal before the LAW … with an independent Supreme Court … independent Police force … and an active CIVIL SOCIETY … advocating for the rights of all citizens … Arab/Muslims are EQUALLY represented in the Knesset … Israel's parliament … since they are elected on a proportional representation model … EACH VOTE COUNTS! You said: "Israel is a transplanted man-made state …" All states in the Arab/Muslim Middle East are man-made by the same Great Powers that legitimized the Jewish State of Israel! Syria was a FRENCH MANDATE … IRAQ was a BRITISH MANDATE … Saudi Arabia was granted independence after WWI by the GREAT POWERS … BRITIAN/FRANCE/AMERICA … as were the other countries of the Arab/Muslim Middle East! You don't like the fact the Jews are sovereign in the Jewish State … that's on YOU. They will never cede their sovereignty … like they will never allow Iran to acquire a NUCLEAR WEAPON. tzatz - - No need to remove illegal Jewish colonists in the West Bank. Big need for Israel to accept it must get out of the West Bank. Or, get ready for Palestinian majority a few decades from now. As I've said … time and again … I believe there can be COMPROMISE & CONCESSIONS on borders … the major settlements & the suburbs of Jerusalem will be INSIDE the line and offsets offered to the Arab/Muslims from present day Israel … It's been discussed in all the major meetings … both sides know what the deal will look like … it's the TIMING THAT'S IMPORTANT … Unfortunately … the timing is not right at this point! Too many issues going on … Syria … Islamist Dynamic in Egypt … Iran … too many issues … the WB & Gaza will have to wait its turn! But … as long as nothing 'crazy' happens from the WB and they continue to progress economically under Fayaad … improve CIVIL SOCIETY … and get rid of the 'old boys' of the PA … there will be a deal that will get done! Hamastan is already on its own. Russia should therefore give back Japan's northern territory they nicked and occupied towards the end of WWII and return to its pre-1945 borders. The Channels Islands back to France, the Canary Islands to Morocco, St Pierre & Miguelon to Canada, Llivia back to France and the Begium neigbourhood of Baarle-Nassau to The Netherlands, etc. Hostility exists because the Arabs who came up from the sandy south do not want to return to Israel the land they occupied in the ancient land of Judea. It is in the sworn declaration of Islamism intention to wipe Israel from the face of the earth just as Nazism wanted and almost did to the Jews. In fact, Jordan and Syria should take back all the Arab refugees (the so-called Palestinians) they thrown out and dumped on the West Bank. The Emperor Hadrian, the one who built Hadrian's Wall to keep the Scottish barbarians out whilst they were civilizing the English, suppressed the Jews in Judaea and renamed it Syria Palestina in the year 135. The British Foreign Secretary Ernest Bevin in using the Royal Navy to blockade Jewish refugees from returning to the land of Judaea in 1945 re-coined the name Palestine in his attempt to prevent the re-establishment of the State of Israel. The West Bank will be renamed as an integral part of Greater Israel. Not only Americans but a lot of people have no idea where they are relative to where they are going because they never bothered to look at a map. If we would only look at the pathetic size of Israel compared to the vast waste land of Islamic occupation we may perhaps begin to realize how unfair and ridiculous it is to make such a song and dance about residential real estate developments in the West Bank and even on the Golan Heights. abdel - - British mandate for Palestine was created just after the First World War. "Israel" is the invented state, created in 1948-49. Maybe the solution is to call the entire country Palestine. Abdel - - ALL ARAB COUNTRIES agree to accept Israel within its "pre-1967" borders. Insane Greater Israel programme puts Israel at risk needlessly. tzatz - - Israel needs to abandon its delusion that illegal immigrants can cause changes to its borders. The Israelis are not going to leave the suburbs surrounding Jerusalem EVER … those living there will remain in Israel … the border will be adjusted accordingly … the same for the other major Jewish settlement blocs … Offsets inside present day Israel will be offered … Olmert in 2008 gave 98% of the WB & Gaza back … Barak in 2000 gave 94% back … it's number that's very close to 100% … We're talking about a deal where CONCESSIONS & COMPROMISES need to be made by both sides! Anyways the Israelis are willing as shown in their offers above (both turned down) … the deal will not get done NOW … not until … Iran is handled and the tumult in the Arab World is settled down some … TIMING IS EVERYTHING … the deal is not going to get done at this time … tzatz - - "Iran is handled"? You apparently want Iran smashed so Israel can keep more of the West Bank. Green Line should be the border. Otherwise, Palestinians perhaps should just keep the entire area west of the Jordan, all the way to the sea (Mediterranean). Iran wants the BOMB … in order to push its agenda … anti-Israel/anti-West/anti-America … Israel will be on the 'defensive' … as Hezbollah … Hamas … continue to 'peck' at Israel with incursions … missiles … short of a MAJOR WAR … knowing Iran 'has their back'!!! That's why Iran will be stopped before a NUKE is developed! As far as the Arab/Muslims on the WB? I have said again and again … now's not the time for a deal! Hamas is today NOT TALKING TO THE PA BECAUSE THEY THINK THE MB WILL SPONSOR THEM AND GIVE THEM COVER IF THEY ANOTHER ROUND WITH ISRAEL … they think that Israel will 'think twice' befor going to War with Hamastan! So … nows not the time for a deal. As for the PA and the WB? As I've said … Jerusalem is now the UNDIVIDED CAPITAL of Israel … its surrounded by suburbs … Jewish Suburbs … maybe there'll be some accommodation made for the PA in Jerusalem (something token) but that's about it. The next border will NOT BE the Green Line … but some adjustment of the Green Line where Israel will claim perhaps 6% of the WB with offsets given to the PA … the major JEWISH SETTLEMENT BLOCS will therefore STILL BE INSIDE ISRAEL … the current Separation Wall is close to what the Israelis will settle for in the end. Of course … there will be other issues to settle including security issues … but even the PA is waiting for better times … maybe they figure Iran will help them 'push their agenda' … or maybe once the situation in Egypt or Syria settle down … even they could help 'push' their agenda against the Israelis … the PA alone … feels unable to influence the Israelis … they're looking for a BIG BROTHER to help them get what they want as a outcome … That's my take. Not now … but in the next couple of years … after Iran and the so-called Arab Spring! You said: "… "Israel" is the invented state …" ALL the states of the Arab/Muslim Middle East ARE INVENTED SINCE WORLD WAR I Prior to WWI … all the lands were part of the Ottoman Empire … which collapsed and was vested of its territories … Iraq … was a BRITISH MANDATE Syria … was a FRENCH MANDATE Jordan … was part of the BRITISH MANDATE … Saudi Arabia … was given its independence after WWI ALL THE COUNTRIES ARE 'INVENTED STATES' … the Jewish State is no different … so what's YOUR POINT? Maybe the solution is … to have the Arab/Muslim population of the WB and Israel … MOVED to other Arab/Muslim states like … Jordan (the real Palestinian State) … Syria … Egypt … Lebanon … Iraq … et al This would solve 2 problems … Israel would remain demographically Jewish … the Arab/Muslims would be 'happier' being ruled by other Arab/Muslims … tzatz - - The solution is for Israel to get out of the West Bank. Alternative will be for Jews to accept majority rule of non-Jews, in unitary state. The Nejd (nucleus of Saudi Arabia) was independent of the Ottoman Empire, prior to the First World War. tzatz - - You have zero evidence Iran "wants the bomb". Zero. Iran just last week offered to stop enriching to 20 percent. This strongly indicates no desire to build nukes. And 16 US intelligence agencies agree there is no evidence gov't of Iran has decided it wants nukes. As far as Saudi Arabia goes … the Nejd was independent? Ok so what? The Ottoman Empire kept the Arab/Muslims OUT OF SIGHT of the rest of the world. After WWI … the so-called veil was lifted … NOW A HUNDRED YEARS LATER … we see that these people … these poor pitiful souls are so backwards and 'UN-MODERN' … As the Bob Dylan song goes … YOUR OLD ROAD IS RAPIDLY AGIN' GET OUT OF THE NEW ONE IF YOU CAN'T LEND A HAND FOR THE TIMES THEY ARE A CHANGIN' The majority of Israelis … believed in 'getting out of the West Bank' … at one point … that was prior to Intifada II and the pullout from Gaza … since then … they're much less willing to move out of the WB … fearing that rockets and mayhem will originate from the vacated WB … that's the dilemma The method to their madness is as follows: If Fayaad continues to make strides with both the CIVIL SOCIETY and the ECONOMY … building up infrastructure and showing the people that there is some worth to 'this life' … then the Israelis CAN REMOVE THEMSELVES AND MAKE PEACE WITH THAT TYPE OF LEADERSHIP … However … it's not clear that either Fayaad will be such a leader or whether the progress towards a CIVIL SOCIETY without 'resistance'/terror as a policy will continue or win out! It's still not certain! Frankly … there are 2 different states … the WB & GAZA … there's NO COHESION between … only animosity they can't be reconciled! Anyways … now is not the time for a deal … it'll have to wait for [a] more progress by Fayaad and [b] more progress on solving the Iranian issue & the Arab Revolution issue … Patience … is a virtue … the status quo … suites the Israelis and Fayaad … tzatz - - Israel needs to comprehend it cannot change borders by growing illegal colonies of Jews in the West Bank. Hamas rockets, in wake of Israeli withdrawal, owed a great deal to continuing illegal colonisation of the West Bank. What do you think Hamas should have done to register significant objection to attempted theft of large portions of the West Bank? You back Hamas? That Islamist Terror Organization? What's the WB got to do with it? Hamas 'had' the opportunity to create a state of their own in Gaza … a model of peace … industry … INSTEAD … they became a JIHADI DEN … a THUG STATE … an ISLAMIST HATE STATE … Hamas missed the opportunity … it's OVER! We know who Hamas is! We know what Hamastan has become! The future is about to land on the Arab/Muslim ME … its awakening into the 'new' Middle East … it's far from clear where its going to end up … BUT … Israel will end up stronger … the 'Strong Horse' in the Middle East … Borders will need to be adjusted to serve THEIR INTERESTS … Arab/Muslims will need to adjust their wavelength to that 'bit of news' … Jewish sovereignty is a necessity … Arab/Muslims are not able to live under Jewish sovereignty … there will have to be major adjustments in the coming decades … no border is firm … adjustments will have to be made for the sake of Peace and Security. tzatz - - Hamas was created in part to ensure Fatah did not "sell out" the Palestinian cause. Hamas will accept Israel within its pre-1967 borders. Israel creates the image of itself as a cancer by growing illegal colonies of Jews in the West Bank. The foolish Israeli policies in the West Bank provoked Hamas in Gaza. Hamas … by their own admission … is an Islamist organization … whose prime interest is the elimination of Israel … they do not accept Israeli sovereignty on 1 sq. inch of the Middle East … YOU KNOW THAT! What are you trying to do … spread Arab/Muslim takkiyeth? Hamas says they'll accept an Israeli withdrawal to the 1967 borders? IN THE MEANTIME … WHILE THEY PREPARE FOR THE NEXT STAGE OF WAR FROM CLOSER TO THE HEARTLAND OF ISRAEL AND IN A BETTER POSITION TO DO SOME DAMAGE … TO ISRAEL'S POPULATION CENTERS … that's all they want. That's why there's no deal on the WB … in the near future … There will NEVER BE A DEAL AS LONG AS HAMAS HAS ANY SAY IN GOVERNMENT AND ADOPT A 'RESISTANCE' POLICY … Don't you get it? The Israelis can wipe the floor with the Arab/Muslims … medieval-style … they don't because they are following their 'best behaviour' … acting within the conventions set by the West … not by the rules of the Arab/Muslim ME!!!! You Arab/Muslims will have to settle for 'envy' at the sovereign Jewish State … there will be NO DEAL WITH HAMAS OR ITS ISLAMISTS! The most Hamas and its adherents can hope for is a quick and painful death! Inshallah. tzatz - - Israel is seriously delusional if it thinks it can have peace and not accept Hamas. Hamas accepted 2002 Saudi peace plan. Israel failed even to respond to that offer. HAMAS … are Islamists … their charter says they don't accept a sovereign state of Israel … on 1 sq. INCH of the land … Hamas may have accepted the Saudi Peace Plan … but it calls for a 'Right of Return' of 6 MILLION REFUGEES … that's not even delusional … it's psychotic! No … Zahar & co. will be 'sleeping with the fishes' soon enough … they'll get their chance for a street naming in Rafah or some shopping mall in Gaza City. You know once upon a time … I hitch hiked to Gaza … took a 'sherut' with a bunch of Arab/Muslims into Gaza for an afternoon … not much shopping to do … and you know … I DIDN'T LIKE IT … it was like the Wild West … three were some Israelis who came into town in their jeep … packing guns et al … it was not my kind of scene … BUT I learned … GAZA IS NOT ISRAEL … therefore … when years later Sharon made the move to evacuate all Israelis … I was pleased … I said to myself … build a wall … all the Israelis are out … if the Arab/Muslims attack again now that there's NO MORE 'OCCUPATION' … then flatten the place … carpet bomb them … but the Israelis didn't listen and they're still 'fooling around' with Hamastan … But if … Hamas gets 'lucky' and some civilians are killed … watch out … there will be hell to pay! tzatz - - Your concern about "right of return" is unwarranted. Obviously Israel will not accept anything other than severely limited right of return to Israel within pre-1967 borders. You do not like it, but Israel must get out of the West Bank for its own sake. And Hamas is not going away. We agree … "… Israel must get out of the West Bank for its own sake …" Hamas may not go away … but they'll have to sign on to the Quartet's 4 POINT PROGRAM … Since they have said 'THEY CANNOT' … there's nothing left to discuss. Is there? tzatz - - Netanyahu wants to keep the West Bank. If Israel agrees to get out of entire West Bank, Hamas will accept the Quartet's conditions. No they wouldn't … their Charter says NO CHANCE … THEY WON'T RECOGNIZE A JEWISH SOVEREIGN STATE ON ANY LAND. You're dreaming in technicolour … Hamas says … get out and we'll call it a 'hudna' … that's Arab speak for a cease fire until we're strong enough to beat you so we'll gather enough arms and training until that day! It's not even in the realm of possiblity. Furthermore, the Israelis have built suburbs around Jerusalem … effectively detaching it from the WB … so that's not going to be returned either There are other major Jewish Settlement Blocs that will be incorporated inside Israel with offsets given the Arab/Muslims … the deal is … the Arab/Muslims will receive ~ 94% to 96% of the land … NO OFFENSIVE ARMY NO RIGHT OF RETURN Thats' the deal … we're NOT IN A 'SHOOK' … A BAZAAR … The Israelis will need to 'feel' safe and secure behind their defensive wall … don't you get it? It's not about the so-called Palestinians … it's about the Israelis … they're the one that need to 'feel' safe and secure … The Arab/Muslims must ALL offer to sign on to the deal as per the Saudi Peace Plan … otherwise … NO DEAL! tzatz - - Palestinians will accept 22% of what was Palestine in 1947. This is a very generous concession to Israel. Fair value exchanges of territory. Otherwise, shouldn't they seek a unitary state and demand equal rights? Not necessarily Garvagh … like the USA & Canada … who have indigenous populations … organized NOT LIKE THE LIBERAL DEMOCRACIES WHICH SURROUND THEM! In Canada … the indigenous natives live on reserves … which are governed under their own laws … their own police … vote in their leaders … BUT DON'T PARTICIPATE IN CANADA'S GOVERNMENT … These indigenous natives … live on the reserves and have their own special benefits … but NO FOREIGN POLICY against Canada's … no separate Armed Forces only Police! Maybe Israel needs to allow the Arab/Muslims the same type of situation. Remember … the indigenous population … at the creation of the nation states of Canada and the USA … were hostile to the settlers/settlements of the Canadians and the Americans! They've calmed down since then but they still live apart from the rest of Canada EXCEPT when they leave the reservations … but they lose their benefits/rights and become citizens of Canada. It's a method that could work for all parties … Arab/Muslims and Israelis! What do you think? tzatz - - I think Israel should try to have less discrimination within Israel, on grounds of religion. Not more. Israel should accept 2002 Saudi peace plan, with severe restriction on right of return (within Israel, within pre-1967 borders). Israel and Palestine can then negotiate and changes of borders. You said: "I think Israel should try to have less discrimination within Israel, on grounds of religion. Not more." I don't live there … when I did … I was privy to VERY LITTLE discrimination against ARAB/MUSLIMS … I remember being on a bus that entered the AIRPORT … and they especially targeted the Arab/Muslims 'looking' people on the bus to exit … and be searched while we dropped off the passengers to the terminal … you can call that 'RACIAL PROFILING' … I'm certainly not against it. It certainly aided in keeping terror incidents to a minimum. I read a blog post today …-... So Israel’s democracy is imperfect? So is everyone else’s. The fact is democratic states change … make rule changes … laws … as time goes on and the circumstances change. Look at the USA vis a vis the Civil Rights Movement … from 1865 to 1967 was a hundred year process of continually improving the living conditions and laws to improve the conditions of a minority group … culminating in legislation which has transformed a group … but still there’s discrimination … see the Sanford killing last week in Florida … The Western democracies are a work in progress … attempting to make the lives of ALL their citizens better … that’s the real point … Israel is in the same position … I’m for a peaceful solution to the Arab/Israeli Conflict … both sides need to Compromise and make Concessions … I don’t believe the Arab/Muslims are ready for that … they believe their ‘protectors’ … Iran or Egypt or Syria (in former times) … support them and encourage them NO TO COMPROMISE OR MAKE CONCESSIONS … I don’t see a deal in the short term … tzatz- Every Arab country accepted the 2002 Saudi peace plan, and Iran indicated it would too (provided the Palestinians accepted it). #1 … the Israelis will not return to the 1967 GREEN LINE … there will have to be adjustments with offsets offered #2 … there can be NO RIGHT OF RETURN to Israel only to the new 'Arab/Muslim' state #3 … the Israelis have outlined their minimum security arrangements in order to relinquish their hold on Judea and Samaria … which include monitors along the Jordan Valley … a Police Force w/o Military strike capability among others #4 … Jerusalem will remain the undivided Capital of Israel … there will be some token offered the Arab/Muslims regarding the Mosques on the Temple Mount tzatz - - All Israeli troops and police will have to get out of the West Bank. All. Very limited right of return. Old City of Jersulaem can perhaps be separately administered. When and if there's a deal … Israelis don't want to administer or have troops in Judea & Samaria … the PA should have their own Police force … but • there will be monitors along the Jordan Valley … either troops or sensors or both • Jerusalem will remain the undivided Capital of Israel • NO right of return But … that's between the parties to discuss the details … it just seems logical that there will be NO OFFENSIVE ARMED CAPABILITY for the Arab/Muslim state! Let them sit down together and make a deal. It's the only way forward. tzatz - - Very limited right of return. No offensive military capability. Monitors or peacekeepers, or both, in large numbers for many years. Old City in separate administration. Palestine gets 22% of what was Palestine in 1946. Are you working for the PLO … err PA? Anyways … they'll have to decide between them … in eyeball to eyeball negotiations … Just keep in mind … the Arab/Muslims are NOT in a position of power … remember to keep that in mind … Frankly … there will be NO OFFENSIVE MILITARY CAPABILITY for the WB … that's a for sure … NO RIGHT OF RETURN … NOT ONE … tzatz - - Israel's true friends tell it to make a deal while it can, and get out of the West Bank. Ehud Olmert in Washington last week said time is not on Israel's side. Which is true.
http://www.economist.com/blogs/newsbook/2012/03/israel-and-iran
CC-MAIN-2013-20
refinedweb
23,443
68.3
Crunch's implementation of top is efficient because it prunes results in the map to ensure that the minimum set of intermediate data is sent over the shuffle. More importantly, this example hints at the fact that Crunch operations are composable. That is, top works with any PTable at any stage in the pipeline. Contrast this to MapReduce, where reusable, composable libraries are not common (in Hadoop itself, ChainMapper and ChainReducer allow mappers and reducers to be chained together, but they are awkward to use and only work in the context of a single job). The final part of the Crunch program writes the final result to the output directory specified by args[1]: writeTextFile(topk, args[1]); run(); The run() method executes the entire pipeline that we constructed. I can run the Crunch pipeline in a similar way to the way we ran the MapReduce job: % $HADOOP_HOME/bin/hadoop jar target/hadoop-drdobbs-1.0.0-job.jar com.tom_e_white.drdobbs.crunch.TopK data outputc 10 % cat outputc/part-r-00000 [doctor,5327002] [dobbs,114] Running the pipeline over the full dataset on a cluster reveals the top words (excluding punctuation) in the book dataset are the, of, and, to, in, and a. % hadoop jar target/hadoop-drdobbs-1.0.0-job.jar com.tom_e_white.drdobbs.crunch.TopK data outputc 10 % hadoop fs -cat outputc/part-r-00000 [",21396850115] [the,18399669358] [.,16834514285] [of,12042045526] [and,8588851162] [to,7305545226] [in,5956669421] [a,5422911334] ["""",3312106937] [-,3285590930] Anatomy of a Hadoop Cluster Let's turn now to running these tools on real Hadoop clusters. What does a typical Hadoop cluster look like? For a small Hadoop cluster consisting of a few machines, the answer is typically similar to Figure 1. Figure 1: A typical small Hadoop cluster. A single master machine (top) runs the HDFS namenode and secondary namenode, as well as the MapReduce jobtracker. The remaining machines run HDFS datanodes and MapReduce tasktrackers. Each of these processes is a Java daemon, with the following responsibilities: - The HDFS namenodemanages the filesystem namespace for the cluster. Information about the filesystem tree and metadata for all the files is stored in memory and persistently on disk in two files: the namespace image and the edits log. - The HDFS secondary namenoderuns a periodic checkpointing function to generate a new namespace image so that the edits logs don't become too large. Note that the secondary namenodedoes not adequately guard against failure of the primary. For that, HDFS has to be set up to run in a high-availabilty configuration (to be discussed shortly). - HDFS datanodesare responsible for storing and retrieving blocks (fixed-size chunks of files, typically 128 MB). Datanodessend periodic heartbeats to the namenodeto report the list of blocks that they are managing, and carry out the namenode's instructions (sent in the heartbeat reply), such as replicate blocks to other datanodesor delete old blocks. - The MapReduce jobtrackermanages all the jobs that have been submitted to the cluster. It is responsible for scheduling the jobs according to the cluster policy. The jobtrackerarchives completed jobs and makes details about them available to clients that may ask for logs or other information about job runs. - MapReduce tasktrackersrun the map and reduce tasks on behalf of clients. Each tasktrackerperiodically sends heartbeats to the jobtrackerindicating whether it is ready to run a new task (each tasktrackerhas a preconfigured number of slots that it can run tasks in). If ready, then the jobtrackerwill allocate it a task. Tasks are run in a new JVM for isolation. Tasktrackersalso run a HTTP server to serve map outputs to reduce tasks in the shuffle phase of MapReduce. On a larger cluster, the master roles are run on separate machines because memory capacity of the master is usually the limiting factor (memory usage by the master daemons is a function of cluster size and usage). Also, by separating roles, hardware failures have less of an impact. That being said, as described so far, the namenode is a Single Point of Failure (SPOF) in Hadoop. This SPOF can be avoided by running two namenodes in active-standby configuration, so that if one fails, the other can take over as the active node and clients can continue to read and write data without interruption. Such a high-availability (HA) configuration also requires a ZooKeeper ensemble (typically three nodes), which elects the active namenode, and a shared storage service such as a set of journal nodes to store the edits log. With HA, the complexity of the cluster is increased, but many real-world clusters actually run a variety of extra services in addition. For example, Figure 2 shows a cluster running Hive, HBase, Flume, and Oozie services, in addition to HDFS and MapReduce. (Note that Pig and Sqoop do not appear because they do not have a cluster component they are both client-side programs.) Figure 2: A larger Hadoop cluster. While running a small cluster with just a few services is feasible using manual scripts, when it comes to a larger cluster like the one in Figure 2, dedicated cluster management software such as Apache Ambari or Cloudera Manager is a must. Data Application Pipelines We've seen in detail some of the different ways to run queries on data in Hadoop. In any real-world Hadoop application, there are wider questions, such as how does data enter the system and how are production jobs run? There is no single answer to these questions, but some patterns have emerged as Hadoop has become more mainstream. For data sources that produce real-time events, like sensor data or transaction logs, a typical data pipeline is shown in Figure 3: Figure 2: A Hadoop pipeline for real-time events. Flume agents collect and aggregate the events and send them to HDFS, then on a periodic basis Oozie triggers Hive jobs to produce reports, or to transform the data for further downstream analysis. This pattern is explored in depth in the article Analyzing Twitter Data with Apache Hadoop by Jon Natkins. For online data in a relational database, Hadoop performs some traditional ETL tasks (using Sqoop, Oozie, and a tool like Pig, Hive, Cascading, or Crunch for transformation). In addition, it provides ad hoc query access to the original data. Note that Hadoop complements existing BI tools: Traditional data marts still have a role for rich business analytics over recent or high-value data that is the output of the ETL process. Such a pipeline is illustrated in Figure 4. Figure 4: A Hadoop pipeline for a data mart. For a more detailed discussion of Hadoop's role in BI systems, I recommend the article Big Data's New Use Cases: Transformation, Active Archive, and Exploration by Amr Awadallah. Where To Go From Here As illustrated in this series, there are lots of different ways to get started with Hadoop. The easiest is to download a Hadoop VM and try out some of the tools on a single node. The next step is to try a multi-node cluster to get a feel for processing larger datasets. These days, there are many freely downloadable open datasets that are helpful. The list curated by Hilary Mason is a great starting point. After that, you might build a more complex Hadoop application pipeline using tools such as Flume, Sqoop, and Oozie to round out the overall data flow. You'll soon find that processing large datasets is made considerably simpler by using Hadoop. Enjoy! Hadoop: Writing and Running Your First Project
http://www.drdobbs.com/jvm/an-algorithm-for-compressing-space-and-t/jvm/introduction-to-hadoop-real-world-hadoop/240153375?pgno=2
CC-MAIN-2016-36
refinedweb
1,252
59.74
Windows Data Alignment on IPF, x86, and x64 Kang Su Gatlin Microsoft Corporation March 2006 Applies to: Microsoft Visual C++ Microsoft Windows XP application development Microsoft Windows Server 2003 application development Summary: Gives developers the information they need in order to confront data alignment problems critical to the performance of 64-bit and 32-bit applications developed for the Microsoft Windows XP and Microsoft Windows Server 2003 platforms. (17 printed pages) Contents Introduction What Is Data Alignment? Why Is Alignment a Concern? Data Alignment Exceptions and Fix-Ups Compiler Support for Alignment Some Quick Tips on How to Avoid Alignment Issues What About Instruction Alignment? Conclusion Introduction Intel and AMD have introduced a new family of processors, the Intel Itanium Processor Family (IPF) Architecture and the x64 Architecture. These processors join the IA-32 Intel Architecture family in the Microsoft Windows desktop/server world. With Microsoft Visual C++ and Microsoft Windows on these platforms, you can get incredible performance, but this good performance is contingent upon certain programming practices. One of these programming practices is proper data alignment. Proper data alignment allows you to get the most out of your 64-bit and 32-bit applications—and on the Itanium, it is often not only a matter of performance, but it can also be a matter of correctness. In this document we explain why you should care about data alignment, the costs if you do not, how to get your data aligned, and what to do when you cannot. You will never look at your data access the same way again. What Is Data Alignment? All variables have two components associated with them: their value, and their storage location. In this article our concern is the storage location. The storage location of a variable is also called its address, and it is the integer (the mathematical term integer, not the data type) offset in memory where the data begins. The alignment of a given variable is the largest power-of-2 value, L, where the address of the variable, A, modulo this power-of-two value is 0—that is, A mod L = 0. We will call this variable L-byte aligned. Note that when X > Y, and both X and Y are power-of-two values, a variable that is X-byte aligned is also Y-byte aligned. In Listing 1, we give a code example to illustrate where variables get stored/aligned. Don't worry if you do not understand why things are aligned where they are. You will understand all of this by the end of the paper. We do encourage you to have fun and play with the example (reorder the local variables and class member variables, and then see what happens to the addresses). Listing 1. Data alignment example #include <stdio.h> int main() { char a; char b; class S1 { public: char m_1; // 1-byte element // 3-bytes of padding are placed here int m_2; // 4-byte element double m_3, m_4; // 8-byte elements }; S1 x; long y; S1 z[5]; printf("b = %p\n", &b); printf("x = %p\n", &x); printf("x.m_2 = %p\n", &x.m_2); printf("x.m_3 = %p\n", &x.m_3); printf("y = %p\n", &y); printf("z[0] = %p\n", z); printf("z[1] = %p\n", &z[1]); return 0; } In Listing 2, we show the output of what Listing 1 might print. Remember that this is just what it prints on my computer. Your computer will almost certainly print different numbers. That is to be expected. Listing 2. Output from example in Listing 1 So, from the example in Listings 1 and 2, you can now see how each of the variables is aligned. The char, b, is aligned on a 1-byte boundary (0xB1 % 2 = 1). The class, x, is aligned on an 8-byte boundary (0x98 % 8 = 0). The member, x.m_2, is aligned on a 4-byte boundary (0x9C % 8 = 4). x.m_3 is on an 8-byte boundary, as is y. z[0] and z[1] are also 8-byte aligned (we omit the modulo math for those last sets of variables, because it is straightforward). If we look at the class S1, we see that the whole class has become 8-byte aligned. The packing within the class is not optimal, because there exists a gap of 4 bytes between elements x.m_1 and x.m_2, although x.m_1 is merely a 1-byte element. The Itanium and x64 compilers provide for data items of natural lengths of 1, 2, 4, 8, 10, and 16 bytes. All types are aligned on their natural lengths, except items that are greater than 8 bytes in length: those are aligned on the next power-of-two boundary. For example, 10-byte data items are aligned on 16-byte boundaries. The x86 compiler supports aligning on boundaries of the natural lengths of 1, 2, 4, and 8 bytes. Next we give a relatively simple way to determine the alignment of a given type. To do this, use the __alignof(type) operator. (The macro equivalent is TYPE_ALIGNMENT(type)). This operator returns the alignment requirement of the variable/type passed to it. Stack Alignment On both of the 64-bit platforms, the top of each stackframe is 16-byte aligned. Although this uses more space than is needed, it guarantees that the compiler can place all data on the stack in a way that all elements are aligned. The x86 compiler uses a different method for aligning the stack. By default, the stack is 4-byte aligned. Although this is space efficient, you can see that there are some data types that need to be 8-byte aligned, and that, in order to get good performance, 16-byte alignment is sometimes needed. The compiler can determine, on some occasions, that dynamic 8-byte stack alignment would be beneficial—notably when there are double values on the stack. The compiler does this in two ways. First, the compiler can use link-time code generation (LTCG), when specified by the user at compile and link time, to generate the call-tree for the complete program. With this, it can determine regions of the call-tree where 8-byte stack alignment would be beneficial, and it determines call-sites where the dynamic stack alignment gets the best payoff. The second way is used when the function has doubles on the stack, but, for whatever reason, has not yet been 8-byte aligned. The compiler applies a heuristic (which improves with each iteration of the compiler) to determine whether the function should be dynamically 8-byte aligned. Note A downside to dynamic 8-byte stack alignment, with respect to performance, is that frame pointer omission (/Oy) effectively gets turned off. Register EBP must be used to reference the stack with dynamic 8-byte stack, and therefore it cannot be used as a general register in the function. Structure and Union Layout The layout with respect to alignment in structures and unions is dependent on a few simple rules. We can break structure and union alignment into two components: inter-structure/union alignment, and intra-structure alignment. (There is no intra-union alignment.) Inter-structure/union alignment is the simpler case. The rule here is that the compiler aligns the structure with the largest alignment requirement of any of the members of the structure. Unions follow the same rule. Intra-structure alignment works by the principle that the members are aligned by the compiler at their natural boundaries, and it does this through padding, inserting as much padding as necessary up to the padding limit. The padding limit is set by the compilation switch /Zpn. The default for this switch is /Zp8. The programmer can use the #pragma pack at the point of declaration of the structure, to also set the padding limit from that point in the translation unit onward. That is, it does not affect structures declared prior to the #pragma pack. Access to structure members that are packed may result in access to data that is unaligned. The compiler inserts the fix-up code for these members, which means that the access will not result in an exception, but it will result in slower and more bloated code. (The fix-up code and exception may not make sense yet, but you will understand them by the end of this article.) The padding limits (#pragma pack and /Zpn) should be used with care. Unless most of your work consists of simply moving data, without reading or writing particular elements, or you are space constrained, the trade-offs involved with using padding limits that violate the alignment rules usually do not work in the programmer's favor. Why Is Alignment a Concern? Okay, so now you know what it means for a variable to be aligned. Why do we care about alignment? Well, as you may have guessed, the reason is performance. On the Itanium platform, the reason is correctness as well, due to the way misalignment is handled. Now the question is, Why? What is the underlying reason that we care about alignment? Certainly, no computer architect arbitrarily decided to make our lives difficult. No, but these alignment issues are, in fact, a remnant of architectural trade-offs made by computer architects. On most modern RISC-based designs, data can be accessed only at the boundary defined by the natural length of the data being requested. This fills the destination register with the data of that length. The implication of this is that the computer gets data in natural-length chunks from addresses that are a product of the natural length. What this further implies is that reading data from addresses that are not a product of the natural length will be problematic (it may slow down or crash the application). For example, a 32-bit computer with a word boundary starting at 0 can load data from bytes at location 0 to 3 in one load, or 4 to 7 in one load, or 40 to 43 in one load, but NOT 2 to 5 in one load (because bytes 2 to 5 span two words). What this means is that if the computer actually needed to retrieve the 32-bit value from location 2 to 5, it would have to retrieve the data from 0 to 3, and also retrieve the value from location 4 to 7, and then perform some operations to properly extract and shift the bytes that it needs. Depending on the computer system, either the operating system or compiler does this for you. If they do not, then the hardware can raise an exception (and you do not want that to happen; as a worst case, it could crash). When the software bails you out, this not only requires some extra logic, but it also takes extra memory accesses. In fact, for many applications on modern computers, the memory system is the performance bottleneck, thus making extra memory requests very costly. In the particular example of this paragraph, it will take two memory accesses to get the 32-bit value from 2 to 5, rather than the one memory access it would take to get the 32-bit value from an aligned address. See Figure 1, because a visual representation might help to make more sense of this potentially tricky topic. Figure 1. Loading bytes at addresses 2 to 5 Figure 1 shows: a) loading the first word (bytes 0 to 3); b) extracting bytes 2 to 3 from the loaded word; c) loading the second word; and d) extracting the first two bytes from the second loaded word and appending it to the previously extracted bytes. This notion of data alignment goes beyond the word-size of the given computer architecture, extending up the memory hierarchy, through the multiple levels of cache, translation lookaside buffer, and pages. Each of these, like the 32-bit words, has an associated unit chunk size. Caches have cache lines that are on the order of 32 to 128 bytes. Pages go from 1024 bytes to megabytes in size. This is all done to make our programs perform more efficiently. We just need to know how to deal with it when it bites us. Data Alignment Exceptions and Fix-Ups The obvious way to deal with alignment issues is to avoid them; however, in the real world, that is not always possible. To help generate correct programs, Microsoft Visual C++ and Microsoft Windows have some mechanisms to help the programmer. These do not come without some performance impact, but they do assist in rapid development and/or porting of applications. The first question that comes to mind might be, "What if I violate the alignment restrictions?" That is, what happens if I generate an alignment fault? Well, a few things can happen, and none of them are good. In Windows, an application program that generates an alignment fault will raise an exception, EXCEPTION_DATATYPE_MISALIGNMENT. On the Itanium, by default, the operating system (OS) will make this exception visible to the application, and a termination handler might be useful in these cases. If you do not set up a handler, then your program will hang or crash. In Listing 3, we provide an example that shows how to catch the EXCEPTION_DATATYPE_MISALIGNMENT exception. Listing 3. Code to catch alignment exception on Itanium #include <windows.h> #include <stdio.h> int mswindows_handle_hardware_exceptions (DWORD code) { printf("Handling exception\n"); if (code == STATUS_DATATYPE_MISALIGNMENT) { printf("misalignment fault!\n"); return EXCEPTION_EXECUTE_HANDLER; } else return EXCEPTION_CONTINUE_SEARCH; } int main() { __try { char temp[10]; memset(temp, 0, 10); double *val; val = (double *)(&temp[3]); printf("%lf\n", *val); } __except(mswindows_handle_hardware_exceptions (GetExceptionCode ())) {} } The application can change the behavior of the alignment fault from the default, to one where the alignment fault is fixed up. This is done with the Win API call SetErrorMode, with the argument field SEM_NOALIGNMENTFAULTEXCEPT set. This allows the OS to handle the alignment fault, but at considerable performance cost. There are two things to note: 1) this is on a per-process basis, so each process should set this before the first alignment fault, and 2) SEM_NOALIGNMENTFAULTEXCEPT is sticky—that is, if this bit is ever set in an application through SetErrorMode, then it can never be reset for the duration of the application (inadvertently or otherwise). On the x86 architecture, the operating system does not make the alignment fault visible to the application. On these two platforms, you will also suffer performance degradation on the alignment fault, but it will be significantly less severe than on the Itanium, because the hardware will make the multiple accesses of memory to retrieve the unaligned data. On the x64 architecture, the alignment exceptions are disabled by default, and the fix-ups are done by the hardware. The application can enable alignment exceptions by setting a couple of register bits, in which case the exceptions will be raised unless the user has the operating system mask the exceptions with SEM_NOALIGNMENTFAULTEXCEPT. (For details, see the AMD Architecture Programmer's Manual Volume 2: System Programming.) With that said, there are situations on the x86 and x64 platform where unaligned access will generate a general-protection exception. (Note that these are general-protection exceptions, not alignment-check exceptions.) This is when the misalignment occurs on a 128-bit type—specifically, SSE/SSE2-based types. In some experimental runs, with the code in Listing 4 (we used 9,000,000 iterations, with 0 and 3 offset representing aligned and unaligned, respectively), we saw that on a slower Pentium III (731MHz, running Microsoft Windows XP Professional), the program with the unaligned access runs about 3.25 times slower than the program with the aligned access. On a faster Pentium IV (2.53GHz, running Windows XP Professional), the program with an unaligned access runs about 2 times slower than the program with the aligned access. This is definitely not the type of performance hit you want to take. Unfortunately, it gets even worse on the Itanium Processor Family. With the same test, running on an Itanium2 at 900MHz with Microsoft Windows Server 2003 (but only for 90,000 iterations, due to how long the test takes to run), the unaligned program runs 459 times slower! As you can see, unaligned access in an inner-loop can devastate the performance of your application. So, even with the OS fix-up, which prevents your application from crashing, you should avoid unaligned access. Listing 4. Example code to compare OS fix-up unaligned vs. aligned #include <stdio.h> #include <stdlib.h> #include <sys/timeb.h> #include <time.h> #include <windows.h> #ifdef _WIN64 #define UINT unsigned __int64 #define ENDPART QuadPart #else #define UINT unsigned int #define ENDPART LowPart #endif int main(int argc, char* argv[]) { SetErrorMode(GetErrorMode() | SEM_NOALIGNMENTFAULTEXCEPT); UINT iters, offset; if(argc < 2) iters = 9000000; else iters = atoi(argv[1]); if(argc < 3) offset = 0; else offset = atoi(argv[2]); printf("iters = %d, offset = %d\n", iters, offset); double *dest, *origsource; double *source; dest = new double[128]; origsource = new double[150]; source = (double *)((UINT)origsource + offset); printf("dest = %x source = %x\n", dest, source); LARGE_INTEGER startCount, endCount, freq; QueryPerformanceFrequency(&freq); QueryPerformanceCounter(&startCount); for (UINT x = 0; x < iters; x++) for(UINT i = 0; i < 128; ++i) dest[i] = source[i]; QueryPerformanceCounter(&endCount); printf("elapsed time = %lf\nTo keep stuff from being optimized %lf\n", (double)(endCount.ENDPART-startCount.ENDPART)/freq.ENDPART, dest[75]); delete[] origsource; delete[] dest; return 0; } Compiler Support for Alignment Sometimes, through explicit syntax, the compiler can help with these alignment issues. In this section, we give a few extensions that you can use in the source code to either minimize the cost of unaligned access, or to help ensure aligned access. __unaligned keyword As we stated earlier, by default, the compiler will align data on their natural boundaries. Most of the time, this is sufficient, and there will not be a problem; however, there can be situations where an alignment issue will exist, with no clear way to work around it (or it would take too much effort to do so). When you, the programmer, can determine statically which variables might be accessed on unaligned boundaries, you can specify these variables as being unaligned, by using the __unaligned keyword (the macro equivalent is UNALIGNED). This keyword is useful in that the compiler will insert the code to access the variable on an unaligned boundary, and it will not fault. It does this by inserting extra code that will finesse its way around the unaligned boundary—but this does not come without a trade-off. These extra instructions will slow your code down, plus increase the code size. Unfortunately, these extra instructions are generated even in places where it might be provable that the data is aligned! So use this keyword with care. We can modify the program of Listing 4 by using the __unaligned keyword in a variable declaration. In this example, we change the declaration of source to the following: This program will now run correctly on the Itaniums, even if you do not enable the operating system to fix up the alignment faults, although it will suffer some performance degradation. This is still better than having your program crash or suffer the severe performance penalty of the OS fix-up. (Keep in mind that, as noted earlier, the compiler inserts code to handle misaligned access, even where it is provable that the data is aligned. The OS goes into its fix-up code only when an exception occurs, and these occur only when the misaligned access actually happens.) In Figure 2, we have a chart that gives the running time on an Itanium 2 for the example program of Listing 4 when using various data access methods. The program executes fastest when the data is aligned, and the __unaligned keyword is not used. It runs next fastest when the data is aligned, but the __unaligned keyword is used. (Recall that if you use the __unaligned keyword, you pay a performance penalty, even if your data is aligned.) You run slightly slower if you use the __unaligned keyword on unaligned data. Lastly, you run much slower if you access unaligned data, but you have set SetErrorMode with SEM_NOALIGNMENTFAULTEXCEPT. Note In this chart, the y-axis is on a log10 scale. Figure 2. Comparative runtimes of test program to illustrate effect of different types of accesses __declspec(align(#)) So, we have dealt with the problem of a variable that you know is going to have unaligned access, but what about when you have a variable, and you would like it to be allocated on a boundary that is different from its natural boundary? For example, when using SSE2 instructions, you may want to align your operands on a 16-byte boundary, or you may want to align certain variables on cache-line boundaries. __declspec(align(#)) (where # is a power of two) is made for such purposes. In Listing 5, we give an example of its use. Listing 5. Code to demonstrate how __declspec(align(#)) works #include <stdio.h> class ClassA { public: char d1; __declspec(align(256)) char d2; double d3; }; int main() { __declspec(align(32)) double a; double b; __declspec(align(512)) char c; ClassA d; printf("sizeof(a) = %d, address(a) = %0x\n", sizeof(a), &a); printf("sizeof(b) = %d, address(b) = %0x\n", sizeof(b), &b); printf("sizeof(c) = %d, address(c) = %0x\n", sizeof(c), &c); printf("sizeof(d) = %d, address(d.d2) = %0x\n", sizeof(d), &d.d2); return 0; } The output might look something like the following (taken from my computer): Note the sizeof of the class. The sizeof value for any structure/class is the offset of the final member, plus that member's size, rounded up to the nearest multiple of the largest member alignment value, or the whole structure/class alignment value, whichever is greater. (This definition is taken from MSDN's entry on align.) The CRT and Intrinsics __declspec(align) is a useful tool, but it cannot align dynamic data off of the heap. For this, the C runtime library (CRT) gives a set of aligned memory allocation routines. These are listed below (and come with <malloc.h>): - void *_aligned_malloc(size_t size, size_t alignment) - void *_aligned_offset_malloc(size_t size, size_t alignment, size_t offset) - void _aligned_free(void *aligned_block) - void *_aligned_realloc(void *aligned_block, size_t size, size_t alignment) - void *_aligned_offset_realloc(void *aligned_block, size_t size, size_t alignment, size_t offset) See Data Alignment on MSDN for more information on these routines. One of the best ways to get performance is to use code that programmers have spent a lot of time tuning. The supplied CRT memory routines (strncpy, memcpy, memset, memmove, and so on) are a great example of this. The CRT routines are hand-code routines (often assembly) that are tuned to the particular architecture, which will align the source and destination so that, for large moves, the costs of the unaligned accesses are minimized. Alternatively, the user can use the /Oi flag or the #pragma intrinsic (functions ) pragma, which enables generation of intrinsics. (Note that the /Oi flag is implied by the /O2 flag.) Intrinsics are inlined routines emitted by the compiler, that are generally not as well tuned as the assembly language CRT routines. They do avoid the overhead of the function call, but at the additional cost of code bloat. It is also worth noting that using /Oi or #pragma intrinsic is a suggestion to the compiler, and the compiler is free to emit intrinsics or the CRT routines. Looking at the assembly code is a good way to determine which was generated. The IPF compiler will also use type information to assist in expanding the inline intrinsics. The compiler will examine the types of pointers to the source and destination addresses, and from this, it will infer the alignment of these addresses. If the pointer types are not correct, you might take an alignment exception, or the program will run slower (with the dreaded OS fix-ups). In Listing 6, we give code to show the effects of aligned versus unaligned accesses on code that uses the compiler intrinsics for memcpy or the CRT assembly language hand-tuned routines. To use the CRT assembly language hand-tuned routines, make sure to insert the #pragma function (function ) pragma. Listing 6. Code to demonstrate the effect of intrinsic and CRT routines on aligned vs. unaligned accesses #include <string.h> #include <stdio.h> #include <stdlib.h> #include <malloc.h> #include <windows.h> #ifdef _WIN64 #define UINT unsigned __int64 #define ENDPART QuadPart #else #define UINT unsigned int #define ENDPART LowPart #endif #pragma function(memcpy) // comment out this line for intrinsic generation. int main(int argc, char *argv[]) { int iters1 = atoi(argv[1]); int size1 = atoi(argv[2]); int offset = atoi(argv[3]); char *source, *origsource = (char *)_aligned_malloc(size1, 8); char *dest, *origdest = (char *)_aligned_malloc(size1, 8); source = (char *)((UINT)origsource + offset); dest = (char *)((UINT)origdest + offset); LARGE_INTEGER startCount, endCount, freq; QueryPerformanceFrequency(&freq); QueryPerformanceCounter(&startCount); for(int i = 0; i < iters1; ++i) memcpy(dest, source, size1-offset); QueryPerformanceCounter(&endCount); printf("&source = %0x \t &dest = %0x\n", source, dest); printf("elapsed time = %lf\nTo keep stuff from being optimized %lf\n", (double)(endCount.ENDPART-startCount.ENDPART)/freq.ENDPART, dest[1]); _aligned_free(source); _aligned_free(dest); } Figures 3 and 4 show the relative performance of each of the four configurations on memcpys of various size—on a Pentium III and Itanium2 computer, respectively. We generated this data with the code from Listing 6, using the following parameters: Where 8 ≤ size ≤ 4096 and 0 ≤ offset ≤ 1. Figure 3. The time to perform a memcpy using aligned vs. unaligned data and CRT vs. intrinsic routines on a Pentium III On the Pentium III, for aligned copies, it does not matter too much whether you use CRT or intrinsic. However, for large unaligned copies, using the CRT version is a big win. On the Itanium2, we compare only the CRT versions, because the compiler almost always uses the CRT versions, even when the programmer specifies /Oi or #pragma intrinsic. In Figure 4, we compare unaligned versus aligned CRT calls. You can clearly see that using aligned data results in better performance. The lesson here is not subtle at all. Figure 4. The time to perform a memcpy using aligned vs. unaligned data with CRT routines on an Itanium2 Some Quick Tips on How to Avoid Alignment Issues If you are short on time, and just want a quick section to refer to, you have found the right place. Here are some quick tips to help deal with data alignment related issues: - When casting from an aligned pointer P1 to a pointer P2, where the TYPE_ALIGNMENT(P1) < TYPE_ALIGNMENT(P2), you must ensure that all accesses are properly aligned. Using P2 to dereference addresses originally pointed to by P1 may result in an alignment fault. However, if TYPE_ALIGNMENT(P1) > TYPE_ALIGNMENT(P2), then P2 is fine to dereference all elements, element-wise, that it points to. - Do not pack structures unless you are sure that the space savings is a win—for example, if you are simply transporting the structure around, and never accessing individual members. - Understand what boundaries you need to align data on. Not having your alignment high enough can lead to alignment problems, but setting the alignment too high can lead to data bloat. What About Instruction Alignment? Well, you are almost at the end of this article, and some of you may be wondering, "You've talked about data alignment, but what about instruction alignment? Aren't instructions also stored in memory?" The answer is, instruction alignment is also an issue, but it is not covered in this article, because most programmers do not have to deal with it at all. Instruction alignment is mostly an issue for compiler writers. The one type of general-purpose programmer who might still care about instruction alignment would be the assembly-language programmer, especially if he or she is not using an assembler. Conclusion Hopefully, you will now feel confident that you know the ins and outs of data alignment when you sit down to do Windows development. This article has covered how to avoid many data-alignment faults, what to do when they are inevitable, and the various costs associated with them. This knowledge will be useful for all Windows development, but it will prove especially useful when porting code from x86 to Itanium, where data alignment plays a front-and-center role. In the end, the result will be faster, more reliable code. About the authorAbout the author Kang Su Gatlin is a Program Manager at Microsoft in the Visual C++ group. He received his PhD from UC San Diego. His focus is on high-performance computation and optimization.
https://msdn.microsoft.com/en-us/library/Aa290049
CC-MAIN-2016-30
refinedweb
4,788
60.65
Subject: [Boost-build] How to specify build order so I can use svnversion? From: Steve Soule (sts11dbxr_at_[hidden]) Date: 2010-04-23 20:10:39 I'm working on a project where the svn version number of my source code needs to be embedded in the executable (so that it can be viewed by the user). The "svnversion" command produces this svn version number. I need to put the output of svnversion in a source file that is compiled into the executable. I need to figure out how to make Boost Build do this correctly. The svn version number doesn't change very often--perhaps one in one hundred builds. So most of the time, the Jam code for including the svn version should not result in rebuilding anything. I've spent all day trying to figure this out. The best I've come up with so far is the following Jamroot.jam (greatly simplified): exe vprogram : [ glob src/*.cpp ] ; import notfile ; notfile write_svn_version : @write_svn_version_action ; actions write_svn_version_action { echo '"'`svnversion`'"' >svn_version_tmp.hpp if diff -N svn_version_tmp.hpp src/svn_version.hpp >/dev/null; then rm svn_version_tmp.hpp else mv svn_version_tmp.hpp src/svn_version.hpp fi } Effectively, this makes bjam check the output of svnversion; if the output has changed, it replaces the file src/svn_version.hpp with the new version. This works fine except for one problem: the write_svn_version target is built after the vprogram target, so the executable is built using the svn version from the last build rather than this build. All I have to do is remember to run bjam twice, and the result is correct, and practically no unnecessary rebuilding takes place. However, I might forget to execute bjam twice, so I would really like to know how to make bjam build the write_svn_version target before the vprogram target. I've spent all day working on this, and I've tried dozens of different things. Most of the things I've tried have resulted in creating a dependency between vprogram and write_svn_version. Because the write_svn_version target is always out-of-date, if any target depends on it, that target is always rebuilt. In many of my attempts, every source file in vprogram is rebuilt, even though nothing needs to be. I don't think it makes sense for vprogram to depend on write_svn_version. It seems like the solution should be simple. There should be an easy way to tell Boost Build to build write_svn_version before vprogram (without creating a dependency). But I haven't been able to find anything in the documentation. I'm stumped. What is the solution? Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk
http://lists.boost.org/boost-build/2010/04/23417.php
CC-MAIN-2015-40
refinedweb
459
67.04
On Sat, 14 Aug 1999, Vlad Harchev wrote: > On Sun, 15 Aug 1999, Leonid Pauzner wrote: > > > 12-Aug-99 06:01 Vlad Harchev wrote: > > Do you say several ASSUMED_..._CHOICE lines possible? Why not a list? > > Would this be resetted with reload_read_cfg() ? > > Yes, several ASSUMED_ ... _CHOICE are allowed. This approach simplifies > parsing (so now I rely on parsing by LYReadCFG.c) and allows choices to be > added in the INCLUDEd files. > This won't work with reload_.. (I mean all new changes to lynx.cfg will be > lost) - but this is easy to fix. Currently new changes will be ignored (the > info will be gathered, but final routine won't be called). > I will fix it in the end of August (Now I have only hyphenation on my TODO > list). >[...] Here is a patch that makes this lynx.cfg-reloading-safe, and fixes some things. Best regards, -Vlad diff -ru old/lynx.cfg fixed/lynx.cfg --- old/lynx.cfg Thu Aug 12 05:46:03 1999 +++ fixed/lynx.cfg Sat Aug 14 12:31:24 1999 @@ -345,7 +345,7 @@ # DISPLAY_CHSET_CHOICE and ASSUMED_DOC_CHSET_CHOICE settings correspondingly. # Each of these settings can be used several times to define the set of possible # choices for corresponding field. The syntax for the values is -# string | prefix* | <ALL> +# string | prefix* | * # Where # * 'string' is either the MIME name of charset or it's full name (listed # either in the left or in the right column of table of recognized charsets), @@ -360,14 +360,14 @@ # ASSUMED_DOC_CHSET_CHOICE:koi8-r # ASSUMED_DOC_CHSET_CHOICE:iso-8859-5 # or lines with full names of charsets. -# * litteral string '<ALL>' (without quotes) will enable all charset choices in +# * litteral string '*' (without quotes) will enable all charset choices in # corresponding field. This is useful for overriding site defaults in private # pieces of lynx.cfg included via INCLUDE directive. -# Default values for both settings are <ALL>, but any occurance of settings with +# Default values for both settings are *, but any occurance of settings with # values that denote any charsets will make only listed choices available for # corresponding field. -#ASSUMED_DOC_CHSET_CHOICE:<ALL> -#DISPLAY_CHSET_CHOICE:<ALL> +#ASSUMED_DOC_CHSET_CHOICE:* +#DISPLAY_CHSET_CHOICE:* # ASSUME_LOCAL_CHARSET is like ASSUME_CHARSET but only applies to local # files. If no setting is given here or by an -assume_local_charset diff -ru old/src/LYCharSets.c fixed/src/LYCharSets.c --- old/src/LYCharSets.c Thu Aug 12 04:54:15 1999 +++ fixed/src/LYCharSets.c Sat Aug 14 17:22:47 1999 @@ -951,6 +951,8 @@ chset_selectability_info[i].displayed_assumed_doc_chset_idx=n; }; }; + displayed_display_chset_names[cur_display_chset_choice]=NULL; + displayed_assumed_doc_chset_names[cur_assumed_chset_choice]=NULL; #endif }; #endif diff -ru old/src/LYMain.c fixed/src/LYMain.c --- old/src/LYMain.c Thu Aug 12 06:49:09 1999 +++ fixed/src/LYMain.c Sat Aug 14 12:34:42 1999 @@ -2105,6 +2105,10 @@ StrAllocCopy(LYCookieFile_flag, LYCookieFile); #endif +#ifndef ALL_CHSETS_IN_O_SCREEN + custom_assumed_doc_chset = custom_display_chset = FALSE; + memset((char*)chset_selectability_info,0,sizeof(chset_selectability_info_t)*MAXCHARSETS); +#endif free_lynx_cfg(); /* free downloaders, printers, not always environments */ /* * Process the configuration file. @@ -2116,6 +2120,9 @@ */ read_rc(); +#ifndef ALL_CHSETS_IN_O_SCREEN + init_selectable_chsets_lists(); +#endif /* We are not interested in startfile here */ /* but other things may be lost: */ diff -ru old/src/LYReadCFG.c fixed/src/LYReadCFG.c --- old/src/LYReadCFG.c Thu Aug 12 05:11:27 1999 +++ fixed/src/LYReadCFG.c Sat Aug 14 12:30:44 1999 @@ -974,7 +974,7 @@ CTRACE(tfp," - EMPTY STRING\n"); return 1; }; - if (!strcasecmp(p,"<ALL>")) { + if (*p=='*' && len==1) { if (display_chset) for (custom_display_chset=TRUE,i=0;i<LYNumCharsets;++i) chset_selectability_info[i].hide_in_display_chsets = FALSE;
http://lists.gnu.org/archive/html/lynx-dev/1999-08/msg00345.html
CC-MAIN-2016-36
refinedweb
566
50.02
Hi Bob, On 14/02/18 14:13, Bob Peterson wrote: Hi, AdvertisingComments below. ----- Original Message ----- | Currently the default behaviour when the journal size is not specified | is to use a default size of 128M, which means that mkfs.gfs2 can run out | of space while writing to a small device. The hard default also means | that some xfstests fail with gfs2 as they try to create small file | systems. | | This patch addresses these problems by setting sensible default journal | sizes depending on the size of the file system. Journal sizes specified | by the user are limited to half of the fs. As the minimum journal size | is 8MB that means we effectively get a hard minimum file system size of | 16MB (per journal). | | Signed-off-by: Andrew Price <anpr...@redhat.com> | --- | | v2: Andreas found that using 25% of the fs for journals was too large so this | version separates the default journal size calculation from the check | used | for user-provided journal sizes, which allows for more sensible defaults. | The default journal sizes for fs size ranges were taken from e2fsprogs. | | gfs2/libgfs2/libgfs2.h | 2 ++ | gfs2/man/mkfs.gfs2.8 | 5 +++-- | gfs2/mkfs/main_mkfs.c | 56 | ++++++++++++++++++++++++++++++++++++++++++++++++-- | tests/edit.at | 2 +- | tests/mkfs.at | 10 +++++++++ | tests/testsuite.at | 6 ++++++ | 6 files changed, 76 insertions(+), 5 deletions(-) (snip) | + if (num_blocks < 8192*1024) /* 32 GB */ | + return (32768); /* 128 MB */ | + if (num_blocks < 16384*1024) /* 64 GB */ | + return (65536); /* 256 MB */ | + if (num_blocks < 32768*1024) /* 128 GB */ | + return (131072); /* 512 MB */ | + return 262144; /* 1 GB */ Perhaps you can adjust the indentation on the comment so it's clear that the journal size is 1GB in this case, not the file system size? The journal size comments are already aligned but I guess I could nudge the "1 GB" over a little :)The journal size comments are already aligned but I guess I could nudge the "1 GB" over a little :) Here are some random thoughts on the matter: I'm not sure I like the default journal size going up so quickly at 32GB. In most cases, 128MB journals should be adequate. I'd like to see a much higher threshold that still uses 128MB journals. Unless there's a high level of metadata pressure, after a certain point, it's just wasted space. I'd rather see 128MB journals go up to file systems of 1TB, for example. I'm not sure it's ever worthwhile to use a 1GB journal, but I suppose with today's faster storage and faster machines, maybe it would be. Barry recently got some new super-fast storage; perhaps we should ask him to test some metadata-intense benchmark to see if we can ever push it to the point of waiting for journal writes. I'd use instrumentation to tell us whenever journal writes need to wait for journal space. Of course, a lot of that hinges on the bug I'm currently working on where we often artificially wait too long for journal space. (IOW, this is less of a concern when I get the bug fixed). Good points. It would be useful to see some performance numbers with different journal/device sizes. For now, based on your comments, perhaps we can do something likeGood points. It would be useful to see some performance numbers with different journal/device sizes. For now, based on your comments, perhaps we can do something like fs size jsize (at 4K blocks) < 512M 8M < 2G 16M < 8G 32M < 16G 64M < 1T 128M < 10T 512M >= 10T 1GSo we get the current default of 128M journals between 16G and 1T, and we keep the lower values the same to cater for Andreas' test cases. Over 1T a gigabyte is not much wasted space so we might as well increase it to the max. Also, don't forget that GFS2, unlike other file systems, requires a journal for each node, and that should also be factored into the calculations. Yes, the changes added in sbd_init() that do a '/ opts->journals' take the number of journals into account.Yes, the changes added in sbd_init() that do a '/ opts->journals' take the number of journals into account. Don't forget also that at a certain size, GFS2 journals will can cross resource group boundaries, For a while that's only been true for journals added with gfs2_jadd. mkfs.gfs2 always creates single-extent journals.For a while that's only been true for journals added with gfs2_jadd. mkfs.gfs2 always creates single-extent journals..and therefore have multiple segments to manage. It may not be a big deal to carve out a 1GB journal when the file system is shiny and new, but after two years of use, the file system may be severely fragmented, so gfs2_jadd may add journals that are severely fragmented, especially if they're big. Adding a 128MB journal is less likely to get into fragmentation concerns than a 1GB journal. Writing to a fragmented journal then becomes a slow-down because the journal extent map needed to reference it becomes complex, and it's used for every journal block written. Thanks, Andy
https://www.mail-archive.com/cluster-devel@redhat.com/msg11955.html
CC-MAIN-2018-22
refinedweb
854
69.21
If you’ve ever watched a live stream, downloaded through P2P file-sharing, connected to Tor, posted or responded to a discussion on a bulletin board, or got in a heated Reddit thread, then Usenet is for you. To those under 25, chances are you’ve never even heard of Usenet, but to the classic computer nerds of yore, Usenet’s the original social network. In the most basic sense, Usenet is a cross between a discussion forum and the ultimate file-sharing platform, but it’s still something else entirely. Because Usenet is shrouded in secrecy, there’s an unwritten community rule very similar to Fight Club. The first rule of Usenet is: you do not talk about Usenet. That’s because Usenet is not as defunct as users want you to believe. In this article, we are taking an at-a-glance look at Usenet to see just what goods the community is keeping tightly under wraps. - We picked out the best Usenet providers right here 1. Usenet newsgroups predate the web Before you accessed websites on the internet through a web browser, there was Usenet. It was an era when computing required the command line, and a computer weighed as much as a human being. The alt.hypertext Usenet newsgroup is where Sir Tim Berners-Lee – then a humble contractor for one of the largest nuclear research labs in the world – first detailed his idea for what we know today as the “www” in a URL (Uniform Resource Locator) string; for example <>. His initial internet project, appropriately called WorldWideWeb, aimed to help employees at the European Organization for Nuclear Research share data with one another instantly. On August 6, 1991, at 14:56 GMT, he wrote: “The WorldWideWeb (WWW) project aims to allow links to be made to any information anywhere. The address format includes an access method (=namespace), and for most name spaces a hostname and some sort of path…” 2. Usenet was originally made for academia The Usenet landscape is like your old hometown: it's familiar, but it looks nothing like it used to. While audio and video content has given new lifeblood to Usenet, it might be a surprise to learn that it was first built for university students, in text-only form. In 1979, two graduate students at Duke University built the Usenet platform as a means to exchange messages and files through a network with colleagues at UNC-Chapel Hill. Then, similarly to The Social Network, Usenet spread through college campuses. In 1993, AOL (remember AOL!?) began to offer Usenet access to its customers. The influx of AOL users became a majority, while academic users shrunk to a minority, and thus the culture was changed forever. 3. Usenet is home to many web culture references Many of the terms we use online and occasionally 'IRL' were first popularized in Usenet newsgroups. How many of these are you guilty of using? Spam: Before the 90s, Spam was just a canned meat and a Monty Python reference. But today, it's the colloquial word for junk email advertising (and potentially still, physical junk mail advertising). The idea of Spam was first introduced en masse on Usenet in 1994 by the law firm Canter & Siegel. The firm posted in all of the Usenet newsgroups (a much more realistic feat in 1994) for its legal services relating to the green card lottery. The message: "Green Card Lottery – Final one?" A new kind of advertising had been born. FAQ: A website and message board staple, the 'Frequently Asked Questions' acronym was introduced by NASA and adopted by Usenet newsgroups early on. The premise back then was similar to what it is now, only FAQs had to be reposted frequently to avoid getting buried in discussions. Not like Reddit or 4chan where FAQs can have static, ‘stickied’ posts. Over time, ‘.answers’ newsgroups like tv.answers, misc.answers, and sci.answers were added to collect the FAQs for cross-posting and easy access. Emoticon: Your ability to substitute a bum for a peach can be traced back to Usenet. No, really. Before we had emojis, we called them ‘smileys’ and ‘emoticons’. The basic combinations for happy and sad – :-) and :-( – were invented in 1982 by Scott Fahlman from Carnegie Mellon University. He and fellow computer scientists chatted a lot through Usenet newsgroups, and they needed a way to differentiate jokes and sarcasm. We'd say it worked, so the smiley can be considered a ‘discovery’ by computer scientists :-). ROFL: A cousin of LOL, ROFL (‘Rolling On the Floor Laughing’) and its many forms have early roots in Usenet. The expression ROFL (without the T for "the") was first used in a 1989 Usenet post to rec.ham-radio, and ROFLOL was used in a post to the group alt.rock-n-roll in 1992. Today, it often precedes LMAO. WTF: An incredibly popular acronym among teens and adults alike, WTF can be traced back to Usenet as well. Its first recorded instance was in the net.micro.mac titled ‘Ramblings’ on May 18, 1985. While the use of WTF rapidly grew, it’s always maintained a sense of ambiguity. Additional takes on WTF, in which the ‘w’ can stand for ‘what’, ‘why’, ‘where’, and ‘who’ have been in use since the mid-to-late 80s. 4. Usenet was text-only until the late 90s Technically Usenet is still plaintext-only (we’ll discuss that shortly) but it wasn’t until after 1997 that binary content was transferred through the platform. As any file attachment limit can attest to, image, video, and audio files take up space. Binary data files, often called ‘binaries’ in the Usenet community, comprise that same space-taking content. That is, binary data is anything that is non-text. So, how does one put non-text files on a text-only platform? With some translating. Encoders translate binary files to text-only code for easy sharing in, let’s say, the alt.binaries.boneless newsgroup. Then the person who wants to view the binary must convert the encoded text back to its natural form. The technology behind the encoding has improved over the years to make it more user-friendly, but the overall process is much the same. 5. Despite ‘vintage’ packaging, Usenet is here to stay While much of the framework is hidden beneath a metaphorical layer of dust, Usenet is still thriving. The platform is reliable, safe, and easily integrates with third-parties; that allows it to withstand the tests of time. That’s because of the way files are shared and stored. Unlike other P2P file-sharing methods, binary files on Usenet are broken into multiple components before they’re sent to a decentralized network. Most importantly, Usenet is actually a safer way to access video content than sketchy live stream sites, torrents, and the like. Unlike these other services, premium Usenet services will provide you with free SSL encryption which is essentially the same thing as OpenVPN, except you don’t have to download any software or connect to a client like you would with a traditional VPN service. Just because Usenet was originally made for command line folks doesn’t mean the easy click-and-drag search style is unwelcome. If the look and feel of Usenet is over your head, that’s okay, too. Nowadays, Usenet providers offer all-in-one software that allows you to search, preview, filter, and download content the way you naturally would on the web. If you’ve ever been the type to scroll through WinMX, Limewire, torrents, and the dark web, it may be time to give Usenet a shot. Sure, it’s a little clunky at first, and it’s not very beautiful to look at, but to some people, that’s just part of its charm.
https://www.techradar.com/news/what-is-usenet-5-things-you-didnt-know-about-it?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+techradar%2Finternet-news+%28TechRadar%3A+Internet+news%29
CC-MAIN-2018-43
refinedweb
1,304
70.33
51223/why-there-need-of-geckodriver-to-launch-firefox-in-selenium Why there is a need of GeckoDriver to launch Firefox in Selenium? Hello Sunaina, Gecko driver is required to launch firefox as post Firefox Version 47, Firefox doesn’t allow any 3rd party tool to interact directly with it. Hence in order to interact with it, we need a proxy called GeckoDriver. In Simple terms, Selenium will send the request to GeckDriver using W3C WebDriver Protocol and then GeckoDriver will read the commands and translate them into Marionette Protocol and forwards the request to Firefox Browser. Browser will read the commands in the form of Marionette protocol and execute them. You can setup the gecko driver this way: System.setProperty("webdriver.gecko.driver", "C:/Users/Anvi_R/geckodriver.exe"); Hi, Selenium IDE was initially a Firefox ...READ MORE ...READ MORE This is the usage: from selenium import webdriver from ...READ MORE @Nick, you can use following lines of ...READ MORE Recently Selenium launched v3 and if you ...READ MORE Yup it should work with the latest ...READ MORE I got to know that using Selenium ...READ MORE Okay so first of all, in the ...READ MORE use gettext() in java : string lableText = ...READ MORE Hey Abha, JAR files are fundamentally archive files, ...READ MORE OR At least 1 upper-case and 1 lower-case letter Minimum 8 characters and Maximum 50 characters Already have an account? Sign in.
https://www.edureka.co/community/51223/why-there-need-of-geckodriver-to-launch-firefox-in-selenium
CC-MAIN-2021-43
refinedweb
238
57.67
Could someone help me understand the word count part of the code? thanks Your example is very good thanks for help me with my homework. good web site 4 prgramming.... what is the input in the command line? I have found this SAMPLE CODES EXAMPLE AND EXPLANATION very help full and would request you guys to do something on seat reservation. Creating a reservation for a ship company and I would like to understand how object oriented programing work. THANK YOU GUYS... Post your Comment Ask java count Ask java count Good morning, I have a case where there are tables... the results: for example: | code book | name of book | sum | | b001 | Java 1 | 10 | | b002 | beginner java | 5 Hibernate Criteria Count Example Hibernate Criteria Count Example Example of Hibernate Criteria Count. Check the tutorial Hibernate Criteria Count. Check the Latest tutorials, articles and examples of Hibernate Framework. Thanks count the repeated character in one string count the repeated character in one string to find the how character occurrence in one String (for example the string is -java means there is 2...;counter<third.length;counter++){ char ch= third[counter]; int count=0 Java Count Vowels Java Count Vowels In this program you will learn how to count vowels in a String. Here you... a variable- count = 0. Now, we have applied a loop here which will go up file line count Java file line count In the section, you will learn how to count the number of lines from the given file. Description of code: Java has provide various... example, we have created an object of Scanner class and pass object of File Count Rows - JSP-Servlet Count Rows How to count rows in Java. Thanks Count Active Thread in JAVA Count Active Thread in JAVA In this tutorial, we are using activeCount() method of thread to count the current active threads. Thread activeCount... of active threads in the current thread group. Example : class ThreadCount MySQL Count MySQL Count This example illustrates how to use count() in MySQL database. Count(): The Count.... It returns a numeric value. If you use COUNT(*) that counts the number of rows.   Hibernate Criteria Count Distinct Example Count Distinct? Thanks Here is an example of Hibernate Criteria...Hibernate Criteria Count Distinct Example I am learning Hibernate and trying to find good example of Hibernate. I want example of Hibernate Count the character in java Count the character in java Write a java program to count.... Count characters by implementing thread import java.util.*; class CountCharacters { public static void count(final String str){ Runnable Hibernate count() Function . for example : count( [ distinct | all ] object | object.property) count(*); also...Hibernate count() Function In this tutorial you will learn how to use the HQL count() function count() function counts the maximum number of rows Character count by while loop Character count by while loop Write the program to count the number...]; int count=0; for ( int i=0; i<third.length; i++){ if (ch==third[i]) count++; } boolean flag=false; for(int j=counter-1;j>=0;j--){ if(ch==third[j Count Row - JSP-Servlet Count Row Hello all, Please I need your help on how to desplay... using java servlet and html form. Thanks for your good job! Hi friend... db = "register"; String driver = "com.mysql.jdbc.Driver"; int count= 0 count asterisk in a grid - Java Beginners count asterisk in a grid I need to write a program that uses a recursive method to count the number of asterisk in a square grid Count words in a string method? Count words in a string method? How do you Count words in a string? Example: package RoseIndia; import java.io.BufferedReader; import...=br.readLine(); int count=0; String arr[]=st.split To Count XML Element 0. Here is the video insturction "How to count XML elements in Java?"... To Count XML Element In this section, you will learn to count the elements present To Count The Elements in a XML File To Count The Elements in a XML File In this section, you will learn to count the element...; Here is the Java File: CountNodes.java Java Hibernate criteria count. Hibernate criteria count. How do we count rows using criteria in hibernate? Create hibernate configuration file (hibernate.cfg.xml... create Persistent class ?Hibernate uses the Plain Old Java Object (POJO) classes Count lines of a particular file _package>java NumberOfLine Getting line number of a paritcular file example...In this program you will learn how to read a file and count number of lines... and count no of lines in a file. Program first asks the user to enter NSArray Count Example NSArray Count Example In the example, we are going to count the number of elements in an array in objective c programming. In Objective C language, Count... in an array. Syntax of count method in objective c language - (NSUInteger)count Use of count() function in XPath Use of count() function in XPath In the previous section of XPath in Java tutorial we have studied about how to run XPath query in java and in this section we are going HelpShubham April 21, 2011 at 8:38 AM Could someone help me understand the word count part of the code? thanks GRACIAS (Thanks)Luis A. June 2, 2011 at 10:41 AM Your example is very good thanks for help me with my homework. programmingnoman nazir March 5, 2013 at 10:19 PM good web site 4 prgramming.... inputJune April 28, 2012 at 8:54 PM what is the input in the command line? File countTaban cosmos May 28, 2012 at 9:19 AM I have found this SAMPLE CODES EXAMPLE AND EXPLANATION very help full and would request you guys to do something on seat reservation. Creating a reservation for a ship company and I would like to understand how object oriented programing work. THANK YOU GUYS... Post your Comment
http://roseindia.net/discussion/19525-Java-Word-Count---Word-Count-Example-in-Java.html
CC-MAIN-2015-35
refinedweb
986
65.52
Download presentation Presentation is loading. Please wait. Published byAbigail Robertson Modified over 4 years ago 1 Kentucky Council on Economic Education 08/22/06 Investing 101 Kentucky Council on Economic Education 08/22/06 2 Penny a day…or $1million? Power of Compounding Interest on principal plus interest earned Rule of 72 Penny a day…or $1million? The power of compounding was said to be deemed the eighth wonder of the world - or so the story goes - by Albert Einstein. The Power of Compounding Learning about investing and the power of compounding is one of the most beneficial lifetime lesson your students can learn. Many people--especially as they near retirement--wish they had learned the lesson of compounding when they were young. We've all heard of Joe Somebody's grandfather who invested a few dollars in the stock market 40 or 50 years ago and now owns a fortune! The benefit of investing early is related to compound interest. What is compound interest? Compound interest is interest that is paid not only on the principal (initial loan balance), but also on the interest it earns. It's much like a snowball effect--as your capital rolls down the hill, it becomes bigger and bigger, earning interest on interest. The following activity can help explain compounding to your students. Tell your students they can earn money for a job that will last for one month. They have two options for being paid. Earn one cent on the first day, two cents on the second day, and double your salary every day thereafter for the thirty days; or Earn exactly $1,000,000. (That's one million dollars!) Most likely many of your students will want the million dollars. However, if they do the math, they could earn over $10 million dollars ($10,737, ) in 30 days, due to compounding. See the lesson at Discover the Power of Compounding Try the Compounding Calculator or Power of 72 Calculator at to learn how compounding works with investing. Print your own classroom posters to teach the power of saving and compound interest... RULE OF 72 The Rule of 72 is a formula used to quickly calculate approximately how much time it will take you to double your investment given any compound interest rate. The Rule of 72 for-mula is as follows: Years To Double Your Money = 72 / (Compound Interest Rate) To apply this to our example in the compounding section, here is how to calculate how much time it will take you to double your initial investment of $1,000 in a bank account earning 10% compound interest: 72 / 10 = 7.2 years Lessons and Activities in the Teacher Support Center in the “In The Classroom” tab – see the Publications link Access the Teacher Support Center with your teacher ID/password! In The News - Screens & Teens Learning from the Market - Getting Rich is Child's Play - The News About Compound Interest Learning from the Market - Why Study the Stock Market? Stock Market Game Guide - Understanding Stock Tables Stock Market Game Guide - Finding Stocks 3 Stocks A share in the ownership of a company. 100,000 shares outstanding in company You own 1,000 shares (100,000/1000) = 1% ownership. Types of Stock Common Stock Entitles the holder to one vote in the affairs of the company and one vote to elect the board members. Preferred Stock Usually doesn't come with the same voting rights as common stockholders. Receive a share of profits before common stockholders. In the event of company dissolution, preferred shareholders have a prior claim to assets ahead of common shareholders, but behind creditors. What is a Stock? A stock represent a share in the ownership of a company. If you own a company's stock, then you are an owner, or shareholder, of the company. The percent of a company that you own is calculated by dividing the number of shares owned by the number of shares of stock outstanding. For example: 100,000 shares outstanding in company You own 1,000 shares (100,000/1000) = 1% ownership. A stock certificate represents your ownership of the company. These days, when you buy stock of a company, you usually do not get the actual stock certificates. Instead, your ownership is tracked electronically, making it easier to buy and sell shares. Types of Stock Common Stock When people talk about stocks in general they are most likely referring to common stock. Common stock represents basic ownership of a corporation. Each share of common stock entitles the holder to one vote in the affairs of the company and one vote to elect the board members. represents some degree of ownership in a company but usually doesn't come with the same voting rights as common stockholders. Preferred stockholders receive a share of profits before common stockholders. In the event of company dissolution, preferred shareholders have a prior claim to assets ahead of common shareholders, but behind creditors. 4 Stock Classifications Blue-Chip Stocks biggest companies in the country Growth Stocks A growth company usually spends a lot of money on research and puts all its profits back into the company instead of paying dividends Income Stocks stable companies that pay higher-than-average dividend Cyclical Stocks move up or down in sync with the business cycle, i.e., automobile, housing, etc. Defensive Stocks unaffected by changes in the business cycle,i.e., food, utilities. Etc. Value Stocks considered undervalued by investors Penny Stocks - low-priced, speculative stocks Stock Classifications A wide variety of companies trade in the stock market. Investors use many classifications to group these companies in order to analyze and track them and to help in diversifying their portfolio. These are some popular stock classifications. Blue-Chip Stocks Blue-chip stocks are stocks of the biggest companies in the country. The term "blue chip" comes from poker, where the blue chips carry the highest value. Blue chip companies are large, established firms, with a long record of profit, growth, dividend payout, and a reputation for quality management, products, and services. These firms are generally leaders in their industries and often set the standards by which other companies in their fields are measured. Blue chip stocks are some of the safest stocks in invest in. Well known blue chips include IBM, Coca-Cola, General Electric and Microsoft. Growth Stocks Growth stocks are stocks of companies with profits that are increasing quickly. This increase in profits is reflected in the rise in the company's stock price. A growth company usually spends a lot of money on research and puts all its profits back into the company instead of paying dividends. Income Stocks Income stocks are those stocks of stable companies that pay higher-than-average dividends over a sustained period. These above average dividends tend to be paid by large, established companies with stable earnings. Utility company stocks are often classified as income stock. Cyclical Stocks Cyclical stocks are stocks that move up or down in sync with the business cycle. Company earnings and common stock prices increase or decrease with changes in business conditions or cycles. Examples of cyclical stocks include automobile, housing, steel, and industrial equipment companies. Defensive Stocks Defensive stocks are stocks whose prices are relatively unaffected by changes in the business cycle. They are generally stable and relatively safe in declining markets. Examples are industries that produce necessities. Food, drug, and utilities companies are defensive stocks. Value Stocks Value stocks are stocks that are currently selling at a low price and are considered undervalued by investors. Companies that have good earnings and growth potential but whose stock prices do not reflect this are considered value companies. Investors who buy value stocks believe that these stocks are only temporarily out of favor and will soon experience great growth. Penny Stocks Penny stocks are low-priced, speculative stocks that are very risky. They are issued by companies with a short or erratic history of revenues and earnings. These stocks are popular among small speculators. Penny stocks are typically valued under $5.00 and can not be purchased in the Stock Market Game, due to their volatility. 5 Industries and Sectors Industries - Companies are grouped by industry, based on the products or services they offer. Companies in the airline industry would be Delta, TWA, Southwest, etc. Sectors are broad groupings of similar industries. The airlines industry would be part of the transportation sector. Industries/sectors are used by investors to compare similar companies Companies are grouped by industry, based on the products or services they offer. Companies in the airline industry would be Delta, TWA, Southwest, etc. Sectors are broad groupings of similar industries. The airlines industry would be part of the transportation sector. One way to determine which companies are worth investing in is to identify a sector or industry that is performing above other sectors/industries; then, comparing companies within that sector or industry. Many investors diversify their portfolio by selecting stocks from several different industries and sectors. Below are examples of a Healthcare Sector and Transportation Sector and industries in each: For a complete listing of Sectors and Industries, see the lesson "Stocks in a Box" in the Beyond the Market curriculum in the Learning Resource Center. There are no hard-and-fast rules for categorizing companies and industries. Many investing websites group and analyze stocks by sector and industry. See Yahoo Finance for a sample of these groupings - (You can also compare stocks from different industries under websites like finance.yahoo.com) 6 Dividends Offered by well established companies Paid to investors Offered by well established companies Paid to investors As cash or stock (usually quarterly) Decided by the Board of Directors Record Date/Distribution Date Dividends When a corporation earns a profit, there are essentially two things that can be done with it. The corporation can put the profit back into its business (its retained earnings) to pay down debt or acquire more property. Another alternative is for the company to pay a portion of the profit to its owners (stockholders) in the form of a cash dividend. The Board of Directors of a company decides if it will declare a dividend, how much it will be, how often it will declare it, and the dates associated with the dividend. Dividends are usually paid out quarterly, and sometimes semi-annually or annually. Many companies don't pay dividends at all. Fast-growing smaller companies typically don't pay dividends, but rather re-invest their profits to grow their company. Companies in well-established, industries, on the other hand, are likely to pay big dividends since they have little need for the cash generated by their operations. Since the stocks of such companies provide the investor with a regular stream of fairly large dividends, they are often referred to as income stocks. If the Board declares a dividend, it will announce that the dividend will be paid to shareholders of record as of the record date and will be paid or distributed on the distribution date. and receive the dividend. A common measure of the return an investor earns from the receipt of dividends is dividend yield. Dividend yield is calculated by dividing dividends received per share by the current price of a stock. For example, if a stock was paying a dividend of $1 annually per share and the stock was currently selling for $10, its dividend yield would be 10% ($1/10). Actually, most companies pay dividends quarterly, so in the example just cited, the investor would receive 25 cents four times during the year. Stock Dividends Rather than paying cash, some companies declare stock dividends--issuing stockholders additional shares of stock. For example, if a company declared a 10 percent stock dividend, you would receive ten additional shares of stock if you owned 100 shares. Companies declare stock dividends to avoid paying out cash, as well as to reduce the selling price of their stocks, making the stock accessible to more investors. The Stock Market Game simulation reflects dividend payments to shareholders of record, just as in the "real world". The Transaction History report is where dividend payments will be reported. Lessons and Activities in the Learning Resource Center In The News Volume Declaring Dividends 7 Stock Splits 2 for 1, 3 for 1 Reverse splits, i.e., 1 for 2 Example: Johnny holds 100 shares of GTD, currently valued at $60/share, so he has a $6,000 investment. GTD announces a stock split of 2 for 1. After the stock split, Johnny will hold 200 shares of stock, and those 200 shares will be valued at $30/share shares X $30 share = $6,000. (Same value!) What is a stock split? Typically, stock splits occur when a publicly held company distributes more stock to holders of existing stock. A stock split, say 2-for-1, is when a company issues one additional share for every one outstanding. So for every share of stock you own, you receive one more share. (So it is called a "2-for-1 split.") Often times students think that if their stock splits, that their portfolio value will increase greatly. But, what they need to understand is that as the stock splits in two, so does its price. In a standard 2-for-1 split, the company simply makes each share worth half as much as it did before the transaction. The post-split value is exactly the same as the presplit value. You just have twice as many shares at half the price. Example: Johnny holds 100 shares of GTD, currently valued at $60/share, so they have a $6,000 investment. . GTD announces a stock split of 2 for 1. After the stock split, Johnny will hold 200 shares of stock, and those 200 shares will be valued at $30/share. 200 shares X $30 share = $6,000. (Same value!) A company will usually split a stock when the price of that stock is getting too high for the regular investor to purchase. Typical stock splits are 2 for 1, or 3 for 1, but there are also reverse splits, i.e., 1 for 2, etc. In the Stock Market Game simulation, stock splits are reflected in portfolios when they happen (although it is usually a 2 day process for the split to show up.). There are websites that track stock splits. Check out a few of these. Lessons and Activities in the Teacher Support Center in the “In The Classroom” tab – see the Publications link Access the Teacher Support Center with your teacher ID/password! Stock Talk Volume - Anna and the Banana 8 IPO – Initial Public Offerings First sale of stock by a company to the public. Distributed through investment bankers in the "primary market” Buyers (usually institutional investors) of these new shares of stock will sell to the public Initial Public Offerings (IPOs) An IPO (initial public offering) is the first sale of stock by a company to the public. Typically, an IPO involves the stock from a young and oftentimes little-known company. But occasionally, well-known and well-established privately-held companies do "go public." Krispy Kreme is an example of a well-known company that has recently gone public. When students use the Stock Market Game, they cannot buy IPOs when they are first issued, because IPOs are distributed through investment bankers in the "primary market". In the primary market, a company decides to "go public", meaning it will sell stocks to the public to raise money the first time. Buyers (usually institutional investors) of these new shares of stock will later sell them to the stock market known as the secondary market. Students can buy the stock when they become available to the public -- usually a few days after the initial IPO offering. IPOs can be a risky investment because it is tough to predict what the stock will do on its initial day of trading and there is no stock data history to rely on. Lessons and Activities in the Teacher Support Center in the “In The Classroom” tab – see the Publications link Access the Teacher Support Center with your teacher ID/password! Economics and the Stock Market - The Demand for Financial Capital SMG Teacher's Guide to the Internet - Why Go Public? Stock Market Game Guide - The Market for Stocks In the News - Sweet Stock Bloomberg Market Mentor - IPOs 9 Mutual Funds Mutual fund company Manager Pooled money of investors Mutual fund company Manager Pooled money of investors Investors buy shares of the mutual fund Good way to get started in investing In the Stock Market Game simulation, students can buy mutual funds in addition to stocks. A mutual fund is a company that makes investments on your behalf and on behalf of other investors. The mutual fund will have a fund manager who is responsible for investing the pooled money of investors into specific securities (usually stocks and/or bonds). When you invest in a mutual fund, you are buying shares (or portions) of the mutual fund and become a shareholder of the fund. A mutual fund, by its very nature, is diversified -- its assets are usually invested in many different securities. Minimum investment requirements on many funds are low enough that even the smallest investor can get started in mutual funds. Most typical investors invest in mutual funds (most retirement funds are offered as a selection of mutual funds.) In the Stock Market Game simulation, students can buy mutual funds in addition to stock. Lessons and Activities in the Learning Resource Center Bloomberg Market Mentor - Mutual Funds/Index Funds 10 Bonds IOU issued (debt securities) Issued by governments and corporations to raise money Investor is the lender Company/Govt repays principal plus interest (generally quarterly) Students cannot invest in bonds in the Stock Market Game. Corporate bonds are debt securities issued by private and public corporations. Companies issue corporate bonds to raise money for a variety of purposes, such as building a new plant, purchasing equipment, or growing the business. When a company issues bonds, it is borrowing money from investors. When an investor buys a corporate bond, the investor lends money to the "issuer," the company that issued the bond. In exchange, the company promises to return the money, also known as "principal," on a specified maturity date. Until that date, the corporation usually pays a stated rate of interest, generally quarterly or semiannually. Bondholders are not owners of the corporation. But if the company gets in financial trouble and needs to dissolve, bondholders must be paid off in full before stockholders get anything. Governments and municipalities also issues various types of bonds to raise money to build bridges, roads, etc. Students cannot invest in bonds in the Stock Market Game. For further information: The SIA Investor website: The Bond Market Association runs an information site. 11 Forms of Business Sole proprietorship Partnership Corporation There are basically three ways a business can organize--as a sole proprietorship, a partnership, or a corporation. Most all large businesses that you know (including household names like Microsoft, Sears, and Coca-Cola) are corporations. Small businesses (like your local hairdresser, law firms, or plumber) might be corporations, too, but often they are either sole proprietorships or partnerships. Sole proprietorship is a business that is owned by one person. There are advantages to organizing a business as a sole proprietorship. He/she gets to make all decisions regarding operations, such as what hours to operate, what to produce, how to produce, whom to hire, etc. The sole owner does not have to share the profits. There are also disadvantages to a sole proprietorship. If the business doesn't have enough money to pay off what it owes to other businesses or persons, the owners themselves must do so out of their personal savings or property. Partnership is a business that is owned by more than one person. There are two kinds of partnerships, general partnerships and limited partnerships. General partners share the responsibilities to manage the business as well and receive a full share of the profits. General partners, like sole proprietors, have unlimited liability. A limited partner has a liability that is limited to the amount he/she has invested in the firm. Limited partners usually do not participate in the management of the business and may receive a smaller share of the profits. A corporation is a legal entity, separate from its owners, with the rights to buy and sell property, enter into legal contracts, and to sue and be sued. The main advantage of a corporation is the ease of raising financial capital. Corporations can sell shares of stock to investors, who become shareholders--each owning a portion of the company. Shareholders in a corporation elect a board of directors, who in turn hire managers to run the business. Since a corporation is a legal entity, shareholders of the corporation are not legally responsible for the financial losses a corporation may experience. Lessons and Activities in the Teacher Support Center in the “In The Classroom” tab – see the Publications link Access the Teacher Support Center with your teacher ID/password! Learning from the Market - What is a Corporation? - Economics and the Stock Market Game - Businesses in the Marketplace Stock Market Game Guide - Business Organization 12 Public or Private Company? Private company does not issue stock to the public, only privately. Public company is a corporation that has "gone public“. As students begin the research of corporations, they will find many that they cannot invest in. Why is this? Actually, there could be several reasons. In many cases the reason may be that the corporation is a private company rather than a public company. What is the difference? You can broadly divide companies into two types: private and public. Private companies are (as the name implies) privately held. A private company is one that does not issue stock to the public, only privately. Most public companies were privately owned before "going public”. Being private means there are a smaller number of shareholders and very little information about the company has to be disclosed by the owners. Most all small corporations are privately held. Although, don't think of only small companies as private. There are also large companies that are private, such as Domino's Pizza, and Hallmark Cards. By contrast, a public company (more accurately called publicly-owned company) is a corporation that has "gone public", selling shares in their corporation to the public over a stock exchange, like the New York Stock Exchange (NYSE), American Stock Exchange (AMEX) or the NASDAQ market. Public companies have thousands of shareholders and are subject to strict rules and regulations. They must have a board of directors and report financial information every quarter. In the United States, public companies report information to the Securities and Exchange Commission (SEC), a governing body that oversees public companies. Lessons and Activities in the Learning Resource Center Beyond the Market - Symbol Search 13 How do businesses raise capital? Three major sources of financial capital for companies Retained earnings Debt (loans, corporate bonds, etc.) Equity (stock) How do businesses raise capital? Why do companies issue stock? When a corporation wants to expand, there are three major sources of financial capital: retained earnings, debt, and equity. The preferred choice for obtaining financial capital is retained earnings. Retained earnings represent the net profits of the corporation. Many corporations use their net earnings to grow their business. Debt is another source of financial capital. Corporations can make short-term loans from banks or issue corporate bonds to obtain long-term financing. Issuing bonds involves borrowing money from investors--with an agreement to pay back the money borrowed by a set date plus interest. The third source of financial capital is the sale of equity securities (stocks) representing ownership interest in the company. Corporations issue stock to raise money. They use this money to finance expansions, pay for equipment, and fund projects, etc. Corporations issue stock when they may need additional capital to operate successfully. The sale of stock brings in capital that does not need to be repaid, but, instead, investors own part of the company and can share in its profits. Lessons and Activities in the Teacher Support Center in the “In The Classroom” tab – see the Publications link Access the Teacher Support Center with your teacher ID/password! Learning from the Market - How do Businesses Obtain Financing? Economics and the Stock Market Game - Business Survival and Growth Economics and the Stock Market Game - The Demand for Financial Capital 14 Parent Companies, Brands, Subsidiaries, i.e., Taco Bell, Lands’ End, etc. When picking stocks, students are likely to think of popular brand names. Students who are big fans of Taco Bell or Land's End might want to buy stocks in these businesses. As they begin their research, they will find they can't find ticker symbols for Taco Bell or Land's End. This is because Taco Bell is a brand of YUM! Brands and Land's End is a subsidiary of Sears, Roebuck & Co. Students may need to conduct further research to find the parent companies for products or subsidiaries. For tips on researching companies and for tips on finding parent companies, see the Teacher Guide in the Teacher Resource Center - "#6 Where Do I Begin My Research?" Lessons and Activities in the Teacher Support Center in the “In The Classroom” tab – see the Publications link Access the Teacher Support Center with your teacher ID/password! Beyond the Market - Symbol Search Stock Talk - Volume 7-2: Rolling Stock 15 Mergers and Acquisitions A merger is a form of corporate acquisition in which one firm absorbs another and the assets and liabilities of the two firms are combined. An acquisition is when one business takes possession of another business. This is also called a takeover or buyout. Mergers are a way for a company. Mergers and Acquisitions As students begin researching stocks, they will run across companies that are merging, or may be part of a take-over by another company. In their research, if students pull up chart data and there is no data for the past 3-4 weeks, this company has probably either gone bankrupt, or merged. In the Stock Market Game simulation, If students have a stock in their portfolio for a company that merges with another, the simulation will automatically adjust their portfolio to reflect the correct shares of stock and change the stock symbol (if necessary). What is a merger? A merger is a form of corporate acquisition in which one firm absorbs another and the assets and liabilities of the two firms are combined. An acquisition is when one business takes possession of another business. This is also called a takeover or buyout. Mergers take place for a variety of reasons. A firm may see a merger as a way. Lessons and Activities in the Learning Resource Center In the News Volume - Time for AOL StockTalk - Sports Cap 16 Market Exchanges American Stock Exchange (AMEX) New York Stock Exchange NYSE Oldest stock market in US Auction market (with brokers on trading floor) American Stock Exchange (AMEX) NASDAQ (National Association of Securities Dealers Automated Quotation System), is an electronic market Over the Counter Bulletin Board (OTBB) for companies that don't qualify to list on the major market exchanges because they are too small or their stock prices too low. New York Stock Exchange The New York Stock Exchange, the oldest stock market in the U.S., is located in New York City. In this auction market, brokers make buys and sells for investors on the "trading floor". Companies must meet strict requirements to be listed on this market. Most of America's "blue-chip" companies list on the NYSE. There are nearly 3,000 companies on the NYSE. Visit the NYSE website, and select the link "trading floor" to learn more about trading on the New York Stock Exchange. American Stock Exchange (AMEX) Also located in New York City, the American Stock Exchange is the third largest stock market in the U.S. Also an auction market, there are around 700 companies listed on this exchange. Visit the AMEX website, to learn more. NASDAQ NASDAQ (National Association of Securities Dealers Automated Quotation System), is an electronic market, without a physical trading floor. Trades are made by brokers over a computerized network. The NASDAQ lists most U.S. technology companies, as well as smaller, newer companies, although a few "blue-chip" companies also list on the NASDAQ. Nearly 4,000 companies list on the NASDAQ. Visit the NASDAQ website, to learn more about this market, as well as how trades are made. Over the Counter Bulletin Board (OTBB) The OTC Bulletin Board is an electronic quotation system for companies that don't qualify to list on the major market exchanges because they are too small or their stock prices too low. There are no listing requirements for OTC companies, other than periodic financial reporting to the SEC. Lessons and Activities in the Teacher Support Center in the “In The Classroom” tab – see the Publications link Access the Teacher Support Center with your teacher ID/password! Beyond the Market - Awesome Auction Beyond the Market - Snazzy Nazzy Learning From the Market - What are markets? Learning From the Market - Showtime on Wall Street Economics and the Stock Market Game - The Securities Markets Stock Market Game Guide Activities- The Market for Stocks StockTalk - Mouse Wisdom Stock Talk - A Look at Delist (Over the Counter) StockTalk - Overtime? Bloomberg Market Mentor - Electronic vs. Floor Trading 17 History of Stock Market May 17, 1792 Buttonwood Tree Agreement NYSE – 1817 Curb trading – AMEX Securities Exchange Act of 1937 History of the Stock Market The United States stock market had meager beginnings. On May 17, 1792, 24 brokers signed an agreement forming the first organized stock market in New York under a Buttonwood tree at what is now 58 Wall Street. They agreed to sell shares or parts of companies among themselves and charge people a commission or fee to buy and sell shares for others. It wasn't until March 8, 1817, that a formal constitution was adopted and the first stock exchange was formed under the name "New York Stock & Exchange Board." From the late 1700s until about 1860, brokers made markets outdoors. The first stock ticker was introduced in Formal memberships in a stock exchange first became salable in In 1869, the New York Stock Exchange (NYSE) started to require the registration of securities by its listed companies to prevent over-issuance. The New York Stock Exchange was not the only way to buy stocks during the 1800s. Stocks that were not good enough for the NYSE were traded outside on the curbs. This so called "curb trading" became what is known today as the American Stock Exchange, which finally moved indoors in It wasn't until after the crash of 1929 that government regulation of the stock market was formalized with the Securities Act of 1933, to provide full disclosure to investors and prohibit fraud in connection with the sale of securities. The Securities Exchange Act of 1934 provided for the regulation of securities trading and established the Securities and Exchange Commission (SEC). In the 1940s and 1950s trading in commodities and monetary instruments became part of the stock exchanges, as well as automated trading functions. In 1971, the NYSE was incorporated and Merrill Lynch was the first member organization listed in July. 18 Stock Market Crash October 29, 1929 - Black Tuesday Set off the Great Depression NPR Audio A stock market crash is a sudden dramatic decline of stock prices across a significant cross-section of a market. Crashes are driven by panic as much as by underlying economic factors. They often follow speculative stock market bubbles such as the dot-com bubble. The most famous crash, the Stock Market Crash of 1929, started on October 24, 1929 (known as Black Thursday) when the Dow Jones Industrial Average dropped 50%. This event preceeded the Great Depression. The succeeding-years saw the Dow Jones drop-a-total of over 85%. Richard Armour, in his satirical American history book It All Started With Columbus, remarked that the 1929 crash occurred "near the corner of Dun and Bradstreet". There was also a crash or "adjustment" on Monday October 19, 1987, known in financial circles as Black Monday, when the Dow Jones lost 22% of its value in one day, bringing to an end a five-year bull run. The FTSE 100 Index lost 10.8% on that Monday and a further 12.2% the following day. The pattern was repeated across the world. The stock market downturn of 2002 was part-of-a-larger bear market and a Dot-com stock market bubble as well as Enron corruption that took the NASDAQ 75% from its highs and broader indices down 30%. 19 Indices A stock index is a measure of average stock prices in a group of individual stocks. Reflect how the market is doing as a group Examples:. There are thousands of publicly traded companies in the stock market, so to determine the condition of the market, investors refer to stock indices. A stock index is a measure of average stock prices in a group of individual stocks. The Dow Jones Industrial Average--a group of 30 blue chip stocks is an index. Stock indexes are useful because they reflect how the market is doing as a group. If you were read the financial pages of. Examples of commonly quoted stock indexes are:. The Stock Market Game has an "American Indices" link to current data of all the indices on the market. Lessons and Activities in the Teacher Support Center in the “In The Classroom” tab – see the Publications link Access the Teacher Support Center with your teacher ID/password! Beyond the Market - Market Meters 20 The DOW Dow Jones Industrial Average 30 blue chip stocks A stock market index Most-quoted market indicator The DOW When you hear people say "the market was up (or down) today", they are usually referring to the "DOW" (the Dow Jones Industrial Average.) Jones Industrial Average is the most-quoted market indicator in newspapers, on TV and on the Internet. For more information: Learn more about the original DOW, as well as the thirty stocks that make up the DOW today at the Dow Jones website. Stock Market Price History - Lessons and Activities in the Teacher Support Center in the “In The Classroom” tab – see the Publications link Access the Teacher Support Center with your teacher ID/password! Beyond the Market - Market Meters Stock Market Game Guide Activities - The Long Arm of the Dow In The News - The Dow's New Clothes In the News - The Nasdaq Newies 21 Bull and Bear Bear market describes a period of time when stock prices are falling. Bull market is a period when stock prices are generally rising. For those who don't spend a lot of time on Wall Street, bulls and bears refer to opposite trends in the stock market. According to Investor Words, a bull market is "a prolonged period in which investment prices rise faster than their historical average." Conversely, a bear market means "a prolonged period in which investment prices fall, accompanied by widespread pessimism." So, bulls good, bears bad. No one's quite sure how the two animals came to symbolize the market, but there are a few theories floating around. According to this article from. 22 Factors Affecting the Stock Market Health company industry economy Global Good News/Bad News Microeconomic variables - factors that can affect companies or industries Macroeconomic variables - factors that affect the economy Consumer confidence Investor perception Many factors affect the stock market and they all have to do with health. Health?? That's right, but not exactly physical health. We are talking about the health of the company, the health of the industry the company is part of (e.g., computer industry), the economic health of the country (e.g., depression, recession), and the global economic health. Good News/Bad News Economic factors that can affect companies or industries are called microeconomic variables. These factors can include the quality of management, competition, sales, profit, forecasts, etc. Students can pick up on these factors by researching companies (e.g., annual reports). Other factors that can affect companies or industries might include news about new products, improved technology, mergers, etc. Students can pick up on these factors by reading current news releases. Factors that affect the economy are called macroeconomic variables. Macroeconomic factors that can affect the stock market include changes in GDP, unemployment, fiscal policy, interest rates, unemployment, etc. Consumer confidence (or lack thereof), and global events both can affect the economy and the stock market. Investor Perception – if investors think the market will go down…it will! Many of the following lessons can help students understand how good news or bad news affects the economy and/or the stock market. Lessons and Activities in the Teacher Support Center in the “In The Classroom” tab – see the Publications link Access the Teacher Support Center with your teacher ID/password! Economics and the Stock Market Game - The Securities Markets: How Prices Are Determined Stock Market Game Guide Activities - Demand and Supply Stock Market Game Guide Activities- Why Stock Prices Change StockTalk - Volume Ashley and the Fed In The News - Share of the Vote In The News - Jee D. Pea In The News - Healing Wounds In The News - The Mystery of Mr. G. In The News - Recess In The News - Clothes Call In The News - A Knight at the Fed In The News - Payroll Call In The News - Health & Wealth 23 Diversification "Don't put all your eggs in one basket." Strategy of spreading your investment dollars across various types of securities, i.e., several industry sectors (e.g., transportation, technology, airlines, retail, etc.) large and small companies, growth and income stocks, cyclical and non-cyclical stocks, blue chip companies, and international companies. In the Stock Market Game, 5 stock minimum rule 30% maximum equity Asset Allocation and Diversification Asset allocation and diversification is about not putting all your eggs in one basket. Asset allocation is a risk-management strategy that involves distributing investments across a broad spectrum of asset classes. These classes might include stocks, bonds, mutual funds, real estate, and cash, or its equivalents, i.e., CDs, and Treasury bills which can be quickly liquidated. History has shown that not all classes of assets move up and down at the same time. One year, stocks of large companies may generate the best returns, while in another it will be government bonds or even a bank certificate of deposit. Using an asset allocation strategy can help minimize risk and possibly increase total return for an investor. Diversification is the strategy of spreading your investment dollars across various types of securities, i.e., several industry sectors (e.g., transportation, technology, airlines, retail, etc.) large and small companies, growth and income stocks, cyclical and non-cyclical stocks, blue chip companies, and international companies. Diversification isn't just buying randomly. If anything, it's the opposite, because it means developing an appropriate mix of investments for maximum growth and minimal risk. How does an investor know how much diversification is needed in their portfolio? It all depends on the investor's goals, risk tolerance, timeframe, and amount of money they are investing. Mutual funds are a type of investment that can be bought to diversify a portfolio. Employee retirement savings programs are usually composed of a diversified mix of mutual funds, based on the owner's risk tolerance. In the Stock Market Game, many states have diversification rules. Be sure that you check with your local coordinator. Lessons and Activities in the Teacher Support Center in the “In The Classroom” tab – see the Publications link Access the Teacher Support Center with your teacher ID/password! Beyond the Market - Stocks in a Box Bloomberg Market Mentor - Diversification In The News - Reel Smart For further information" Visit the SIA Investor website: 24 Supply and Demand Stock prices change because of supply and demand more buyers than sellers – price goes up! More sellers than buyers – price goes down! Stock prices change every day as a result of market forces.. To help students understand, give them examples like E-Bay, or an auction. 25 Reading an Annual Report Get from company website or call/write company Chairman of the Board Letter Sales and Marketing 10 Year Summary of Financial Figures Management Discussion and Analysis CPA Opinion Letter Financial Statements Subsidiaries, Brands and Addresses List of Directors and Officers Stock Price History from Annual Report Library ( Reading an Annual Report Students can write or call the corporate office and ask for an annual report, or search the company website -- where many companies post their annual report. There are also many websites online that provide annual reports for free. A company’s annual report contains valuable information for the investor. Not all annual reports will have the same sections or the same type or level of information. Listed below are nine identifiable sections that appear in most Annual Reports, with tips on what to look for or how to interpret each section. Chairman of the Board Letter - Should cover changing conditions, goals to achieve or achieved or missed, actions taken or not to be taken. Is it well written? Reading between the lines - what is being apologized for? Sales and Marketing - Should cover what the company sells, how, where and when. Is it clear where it make most of it's money presently? Is it understandable? Is it clear the scope of lines, divisions and operations? 10 Year Summary of Financial Figures - Is this included? What's the growth of profits and operating income? Management Discussion and Analysis - Is it a clear discussion of significant financial trends over past two years? How candid and accurate is it? CPA Opinion Letter - Written by the CPA firm as an opinion on the company's financials. The important thing to look for here is what the qualifications are. Financial Statements - Check sales, profits, R&D spending, inventory and debt levels over time. Read the footnotes to ferret out other information. Subsidiaries, Brands and Addresses - Where is the headquarters? Is it clear what lines, brand names the company has and what their overseas distribution network is? List of Directors and Officers - How many outside vs. inside directors? Are the directors well known and respected? Are there less than 5 or more than 12 directors? Stock Price History - General trend of price over time: up or down? Which exchange is company traded/listed? Stock symbol? Bonus/dividend history? from Annual Report Library ( Lessons and Activities in the Teacher Support Center in the “In The Classroom” tab – see the Publications link Access the Teacher Support Center with your teacher ID/password! Beyond the Market - Reading an Annual Report In The News - A Counting Story (balance sheet and income statement) In The News - Annual Report (earnings) Bloomberg Market Mentor - How to Read an Annual Report 26 Fundamental Analysis Thorough review of company Product Operating efficiency Management Financial performance Profit/Loss, EPS, P/E, etc. Position in Industry Different investment professionals analyze stocks in different ways. There are two basic approaches that investors use: fundamental analysis and technical analysis. Fundamental Analysis Fundamental analysis focuses on a thorough review of the basic facts about a company, including its product, operating efficiency, management and financial performance. Fundamentalists will evaluate many ratios and financial figures before deciding if a stock should be purchased or sold. Comparing these measures over time and to companies in similar industries gives an indication of the company's current value. Some of the more significant financial factors reviewed include book value, earnings per share (EPS), price/earnings ratio (P/E), etc.: Much of this information can be found in annual reports, Form 10-Ks filed with the Securities and Exchange Commission, articles and research reports. Fundamentalists may also look at the economy at large--such as unemployment and interest rates--to estimate a stock's potential. In the Stock Market Game, many students use fundamental analysis--usually at a very basic level: researching the company's products, efficiency, and financial performance and its position in the industry and the economy at large. 27 Technical Analysis Used to evaluate the worth of a stock by studying market statistics. Stock and stock market trends Charting Technical analysis is the practice of studying the stock market's past in an attempt to determine its future. People who utilize technical analysis often study charts and graphs of a particular stock, industry, and / or sector to try and find patterns.. 28 Crunching the Numbers Book value - This represents the different between the company's assets and liabilities. A low book value (from too much debt) could mean that the company's profits will be limited. However, a low value may also indicate that the assets are underestimated, and that the stock is a good value for potential investors. Earnings Per Share (EPS) - This represents the company's net profit divided by the number of shares outstanding. Analysts typically look for steadily increasing EPS, which shows a pattern of consistent growth. 29 Crunching the Numbers Price/Earnings (P/E) Ratio - company's stock price divided by its 12 month EPS. High P/E means high projected earning If a company has a PE of 10, that means that investors are willing to pay $10 for every $1 of last year's companies earnings. Compare the PE ratios of other companies in the same industry, or to the market in general, or against the company's own historical P/E ratio. Beta – quantifies how volatile a stock is compared to the overall market A stock that rises or falls in value at the same rate as the market has a beta of 1.0. Beta below 1 - less volatile -- and potentially less risky Beta above 1 - more volatile, meaning that investors might expect its price to rise or fall more quickly. 30 Margin Going on Margin" borrowing money to invest In SMG – pay 7% interest (per annum) for any money spent over initial $100,000 cash. Very Risky – not suitable for a long-term, buy-and-hold investor. Minimum Maintenance If the Total Equity in your portfolio falls below 30% of the value of your long and short positions, your team will receive a margin call. (Note: In a margin call, the computer will automatically sell shares of stock in the portfolio to recoup its losses.) As students have learned, in the Stock Market Game simulation, they can "go on margin". This means that they can basically "borrow" money to invest in the stock market. In effect, instead of having $100,000 to invest, they can have up to $200,000 to invests (depending on long position value). But, there's a catch! They will have to pay 7% interest (per annum) for any money they spend over their initial $100,000 cash. So, decision-making becomes even more involved when teams go on margin. Will this stock make enough profit to cover the 2% broker's fee and the cost of going on margin? In the Stock Market Game simulation, when a team spends over their $100,000, there is no "warning" that they are about to do so, they must keep track of their own cash holdings (in their Account Summary). If they go over $100,000, the simulation automatically begins charging them interest for any money over the original $100,000. This interest is posted weekly to their Transaction History report and is included in the Interest and Dividends field on their Account Summary. Buying on margin can be very risky and is not suitable for a long-term, buy-and-hold investor. For very young students, you can tell them to 1) not spend more money than is in their cash balance--in effect, not going on margin, or 2) let them go on margin, but have them watch their "Buying Power". Remember, "Total Equity" is the number their portfolio is ranked on. Below are explanations of some of the fields in the Account Summary that relate to buying on margin. Buying Power shows the total amount of money available for stock purchases and short sales when fully extended on margin. Buying Power is twice Available Equity. If a team puts up all their available they may borrow that same amount. This means that 50% of the money for the transactions is their own, which meets the 50% buy margin requirement.Formula: Buying Power = Available Equity x 2. Available Equity is the amount of equity available for supporting additional buy and short sell transactions. This is the most this team can provide for their part of the 50% initial margin requirement. If this figure is negative, all buy and short sell transactions will be rejected. Formula: Available Equity = Total Equity - (0.5)(Value of longs + Value of shorts) For this formula, use the absolute value (positive value) of the value of shorts). The Buy Margin Requirement is the amount of collateral that must be supplied to meet the 50% initial margin requirement when borrowing on margin. The Buy Margin Requirement is 50% of the value of the longs plus the value of the shorts. (Formula: Buy Margin Requirement = .50 x (value of longs + value of shorts). For this formula, use the absolute value (positive value) of the Value of shorts). The Minimum Maintenance (also know as Minimum Maintenance Margin Requirement is the minimum margin requirement (30%) that a team portfolio must maintain after borrowing on margin. If the Total Equity in your portfolio falls below 30% of the value of your long and short positions, your team will receive a margin call. This figure is only relevant for teams that have borrowed money. Formula: Minimum Maintenance = .30 x (Value of Longs + Value of Shorts). (Note: In a margin call, the computer will automatically sell shares of stock in the portfolio to recoup its losses.) Note: Students can find explanations and formulas for all fields in a portfolio by selecting the Help button when on a portfolio page. Lessons and Activities in the Teacher Support Center in the “In The Classroom” tab – see the Publications link Access the Teacher Support Center with your teacher ID/password! Learning from the Market - Getting Fancy: The Bulls, the Bears, and the Pigs In The News - Chargin at the Margin BloomBerg Market Mentor Newsletter - Risk/Buying on Margin 31 Short Selling Way to make money in the stock market--particularly during a Bear market when prices are dropping. It can also be effective if you know a company is headed in a downward spiral. Brokerage loans you stock from inventory You sell the stock you “borrowed” When stock value drops, you “short cover” – buy the stock on the market You give brokerage back their stock you borrowed, and You profit from the difference. You can lose more than you put in! Students can short sell in the Stock Market Game. Short Selling This is the topic that always seems to draw interest from a few students. What is short selling? It's not an easy concept to understand and seems to go against all that we teach about the stock market. But short selling is a way to make money in the stock market--particularly during a Bear market when prices are dropping. It can also be effective if you know a company is headed in a downward spiral. A short sale is generally the sale of a. When you sell short, your brokerage firm loans you the stock. The stock you borrow comes from either the firm’s own inventory, the margin account of another of the firm’s clients, or another brokerage firm. As with buying stock on margin, your brokerage firm will charge you interest on the loan, and you are subject to the margin rules. For Example: You borrow 100 shares of stock currently selling for $50 a share and sell it. When the stock value drops (which you hope it does), say to $30/share, you "short cover". In this short cover transaction you are actually buying 100 shares on the market at $30/share (current price). It costs you $3,000. You then pay back the broker the 100 shares you borrowed from him that was worth $50/share.. The major drawback to short selling is that you can lose more than you put up! In regular investing, you can only lose as much money as you put into the market. In short selling you can actually lose more than you put up (when you borrowed the stock) if the value of the stock goes up! Students can short sell in the Stock Market Game. On their 'Make a Trade' page, they can select to short sell and then short cover their stock. Lessons and Activities in the Teacher Support Center in the “In The Classroom” tab – see the Publications link Access the Teacher Support Center with your teacher ID/password! StockTalk -Short Story Bloomberg Market Mentor - Investing in a Down Market 32 Investing for the Long Term 1) start with a plan 2) understand your risk tolerance 3) diversify 4) keep track of your investments 5) invest for the long term As you introduce your students to investing, don't forget to give them valuable advice every investor needs to know: 1) start with a plan 2) understand your risk tolerance 3) diversify 4) keep track of your investments, and 3) invest for the long term. No matter what you decide to do with your savings and investments, your money will always face some risk. You could stash your dollars under your mattress and face the risk of having it stolen or you could keep your money in a savings account, and risk the possibility of losing buying power of your dollars, over time, due to inflation. Investing in stocks, bonds, or mutual funds carries risks too. When you invest in a stock, you are taking a risk that the it will decline in value--with the possibility of losing all the money you invested. The lesson to learn about risk is that it's impossible to realize a return (make money) on any investment without facing a certain degree of risk. The fundamental concept to understand when investing is the higher the risk, the higher the return you should expect to receive. The lower the risk, the lower the return you should expect. Risk tolerance is different for every investor. A good rule of thumb followed by many investors is that you shouldn't wake up in the middle of the night worrying about your portfolio. When you find your own comfort zone, you'll know your personal risk tolerance -- the amount of risk you are willing to tolerate in order to achieve your financial goals. Diversifying your portfolio is one way to balance your risk. By investing in a number of different stocks, bonds, and cash investments, you can decrease the risk. Set investing goals and invest for the long haul. Over time, shares have historically provided better returns and served as a better hedge against inflation than cash or bonds. The longer you have to invest, the more time you have to weather the market's inevitable ups and downs. Investors who adopt a "buy and hold" approach to investing tend to come out ahead of those who try to time the market. What is a long term investor? The following quote gives us an interesting insight into American investing... "Whether you mean to or not, putting your money into the market for the long term is making a statement about the world economy and America's role in that economy. In fact, you are making an economic bet that the U.S. will lead a growing world economy. If you don't believe that world growth led by U.S. corporations will continue, then you are betting your money contrary to your beliefs. The reason why I say this is because this is exactly what a long-term investment in the U.S. stock market has been over the past 100 years -- a bet that the U.S. will continue to lead the world economy. The global economy has grown tremendously over the last 100 years, and the U.S. has been leading the way most of the time." Moe Chernick - February 15, motleyfool.com Similar presentations © 2018 SlidePlayer.com Inc.
http://slideplayer.com/slide/714615/
CC-MAIN-2018-47
refinedweb
9,440
53.41
This post was flagged by the community and is temporarily hidden. Hi Chang, Can you compile with make debugmpiandsmp, and see if the problem occurs - if so, this will tell us where it went wrong. I see that you’re running with ASE, I don’t think this makes sense. The ASE calculator only supports ground state calculations but you wish to do BSE skipping the ground state. Can you try submitting the job directly? I also don’t think there’s a way to specify MPI processes with the ASE calculator (?) If not, the run time performance will be terrible. One you check these things, can you provide more information please? Which intel compiler and what make.inc did you use (provided or custom)? Can you supply INFO.OUT and corresponding BSE INFO file for the failing case, and the run time settings. I also note your rgkmax is extremely small, but I assume this is for testing purposes. Cheers, Alex This post was flagged by the community and is temporarily hidden. Hi Chang, This is the problem: forrtl: severe (408): fort: (8): Attempt to fetch from allocatable variable PMUO1 when it is not allocated Image PC Routine Line Source exciting_debug_mp 0000000003935ADF Unknown Unknown Unknown exciting_debug_mp 0000000002A844C6 exccoulint_ 484 exccoulint.f90 exciting_debug_mp 0000000000B1D746 exccoulintlaunche 118 exccoulintlauncher.f90 exciting_debug_mp 0000000000935FD9 xsmain_ 161 xsmain.F90 exciting_debug_mp 0000000001956B01 xstasklauncher_ 233 xstasklauncher.f90 exciting_debug_mp 00000000022D8EE0 tasklauncher_ 25 tasklauncher.f90 exciting_debug_mp 0000000001D7DD5B MAIN__ 51 main.f90 exciting_debug_mp 0000000000410D52 Unknown Unknown Unknown libc-2.26.so 00007F661379234A __libc_start_main Unknown Unknown exciting_debug_mp 0000000000410C6A Unknown Unknown Unknown I’ll ask the BSE developers if this has been patched. W.r.t. running exciting with mpi via ASE, I didn’t look at the code but you’ll also need to set the env variable for OMP_NUM_THREADS for maximum efficiency. excitingtools already enables you to generate input for ground state and BSE with python, it also has numerous file parsers. There is an open MR with ASE to completely overhaul the calculator, using excitingtools as a plug-in . Hopefully that goes through this year. Cheers, Alex Hi Alex, I am indeed setting OMP_NUM_THREADS to 1 for my parallelized computations yes, and many thanks for the tips about python scripts of BSE - I am still learning these very convenient tools now (I created a special Python 2.7.14 environment in Anaconda for exciting tools) and they are indeed very helpful. The news about open MR with ASE sounds great, too. Since I am trying to use exciting to compute X-ray absorption and emission spectra based on GW-BSE, I tried to go beyond TDA by setting coupling = "true", using the tutorial for BN (). But unfortunately the program crashes each time I attempt: mpprun info: Starting impi run on 1 node ( 8 rank X 1 th ) for job ID 21805777 Abort(101) on node 2 (rank 2 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 101) - process 2 Abort(101) on node 4 (rank 4 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 101) - process 4 Abort(101) on node 6 (rank 6 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 101) - process 6 mpprun info: Job terminated with error The same test will run smoothly if I turn off coupling. This exciting build was compiled by the staff at NSC in Linköping University, so it should not suffer from my own inexperience as in the previous case. I have uploaded the whole case in: Could you help me in this case, too? Thank you!!! Best wishes, Chang Liu Hi Chang, Python’s subprocess will start its own shell instance. I’m relatively sure that you would need to pass OMP_NUM_THREADS as an env dictionary to subprocess in order for anything other than 1 to be used. Something like this: def some_routine(my_env, ...): if my_env is None: my_env: dict = os.environ.copy() process = Popen(execution_str.split(), cwd=path, stdout=PIPE, stderr=PIPE, env=my_env) excitingtools is not the tutorial scripts, it’s the python3 package we’re developing to supersede the scripts: excitingtools · PyPI (also packaged with exciting). W.r.t. the failing calculation, I’ll pass this info on to Fabian, who currently does the most x-ray absorption simulations in the group. Cheers, Alex
https://matsci.org/t/bse-xas-calculation-crashes/44509
CC-MAIN-2022-40
refinedweb
705
63.29
Hi, evry1.. i need yur help.. i want to place an image as my background.. how am i supposed to do it..?? i have tried this setBackground("C:\\image\\background.jpg");i also tired this Icon m1 = new ImageIcon("C:\\New folder (5)\\background.jpg");lb1.setIcon(m1); But none of this is working.. what shuld i do??? - 5 Contributors - forum11 Replies - 89 Views - 4 Years Discussion Span - comment Latest Post by raj.mscking Edited by JamesCherrill JPanel is very standard stuff. Just add all your controls to the JPanel, then add the JPanel to your JFrame. Later on you will discover all kinds of reasons why you want to do it like that. I think you need to give us some examples. What do you mean by "background?" Are you creating a GUI swing app? If so, then the assumption to use JPanel (or JFrame) makes sense. But you can create a GUI app with JavaFX if you are being more modern and you could use the java.awt package if you took some book out of the library from 1998. jalpesh_007 -3 Where you want to set your background as image?? Hi! If you want to set image as your background on your Container (JFrame,Jpanel,etc..,), set an JLable 1st then place the image as an icon onthe JLable, fille the lable with your container.., Thats all.., Have A Happy Day.., Raj: How do you intend to keep the other components in front of the image JLabel? Which layout manager would you use to place components overlapping the image JLabel? Mr.James! i have changed the Layout import javax.swing.JOptionPane; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author Android_Raj */ public class BackGroundTest extends javax.swing.JFrame { /** * Creates new form BackGroundTest */ public BackGroundTest() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold private void initComponents() { jButton1 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jButton1.setText("On JLabl"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 490, 170, -1)); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/srts.png"))); // NOI18N jLabel1.setText("jLabel1"); getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 450, 520)); pack(); }// </editor-fold> private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: JOptionPane.showMessageDialog(rootPane, "Hi! I am on JLabel..,"); } /** * @param args the command line arguments */ public static void main(String args[]) { /*(BackGroundTest.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(BackGroundTest.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(BackGroundTest.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(BackGroundTest.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new BackGroundTest().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; // End of variables declaration } The out put will be is the solution right or wrong, Can you replay me.., if it is wrong i can correct myself.., You have used absolute coordinates to place your labels, which is OK if you will never run this on any device with a different screen resolution. In particular, run it on a "retina" Mac your controls will be too small by 50% to display the text. This is why you should always prefer a layout manager to pixel coordinates. You added two labels to the frame's content pane. These will both be in the same layer, so there are zero guarantees as to which will be painted on top of which. One day you will resieze the window, or un-minimise it or something and the background label will be in front of the button. If you want to use an image JLabel for a background you need to use a JLayeredPane to control the z-order, and a proper layout manager to handle screen differences. Then it works very well. The alternative is to subclass JPanel and override its paintComponent to draw the background. This also works very well. The choice is yours! Thank You Verymuch Mr.James..,
https://www.daniweb.com/programming/software-development/threads/483405/set-image-as-background
CC-MAIN-2019-04
refinedweb
786
52.97
Progressive Web Apps with React & Preact.js August 30, 2018 Progressive Web Apps (PWA) have come onto the scene in a big way and with more mobile browsers supporting them, they might very well be the future of web applications. A PWA is actually pretty simple, and virtually any website or application can be converted into a baseline Progressive Web App. Here is a checklist from Google on all the things a website needs in order to be considered a PWA. Basically if you have a website or web application that loads fast, is served over HTTPS, and is responsive for mobile and tablet devices, then you are already most of the way there. You'll just need a manifest.json file and a Service Worker JavaScript file. The manifest.json file tells a compatible browser that you have a Progressive Web App and, on certain mobile devices, it will trigger a prompt to add the app to the Home Screen. It also includes information about the icons that are displayed once added to the Home Screen and the name of the application. A service worker is a bit more complex, but it's also very powerful. It's essentially a JavaScript file that runs in the background and listens for events, even if the website or application is closed. It can do things like cache the website's files for offline access, enable push notifications, and even access the camera of a mobile device. This is what give your PWA superpowers and makes it feel like a native mobile application. Progressive Web Apps with React.js and Create React App If you use React.js and Create React App (CRA) to start your projects, the good news is that the resulting app will be a Progressive Web App by default. Create React App already has everything needed, including the manifest.json ( in the /public directory ) and a Service Worker file called service-worker.js ( handled by registerServiceWorker.js ). You'll have to run yarn build or npm run build and then serve the /build folder before seeing them in action. With the manifest.json, you'll need to generate and add the appropriate icons for the wide variety of devices. A great resource for generating a proper manifest.json file is app-manifest.firebaseapp.com. The Service Worker provided by CRA will provide support for offline mode. This means that it will cache all the files generated by CRA during the build process and store them in the browser's Cache Storage. If you turn off your internet connection. the application will still load! This is, however, the bare minimum required for a PWA. The default service-worker.js won't cache any external data or resources and it won't have neat features such as push notifications. You'll probably want to register a custom Service Worker if you wish to get the most out your PWA. PWAs with Preact.js, Custom Service Workers, and Workbox While CRA is a fantastic tool, it doesn't do much for you in terms of code optimization. A Progressive Web App needs to be as fast and performant as possible, and this means smaller JavaScript bundles and code splitting. Enter Preact.js, which is a slimmer alternative to React that also has built in support for PWAs. The Preact CLI functions much like Create React App and it's just as easy to use. The Service Worker that Preact CLI generates (called sw.js) will cache any generated files for offline use, but what if our web app uses an external API? If we fetch data or images from an external site, then those resources won't be cached by our default Service Worker. We'd need to register our own custom Service Worker to enable more robust PWA features. Here is a wonderful article by Dave Hudson on how to implement a custom Service Worker into Preact.js. If you'd rather skip his post, I've made a repo of his finished product here for download. Also included in the repo is the latest version of Workbox, which is a set of libraries by Google for PWAs. Workbox makes writing our custom Service Worker much easier and exposes many advanced features for a PWA. Building a News Feed PWA using Preact.js Starting with the Preact-Workbox repo, we'll be creating a super simple Progressive Web App that pulls in the news using this News API. We will then add a few simple lines of code into our Service Worker to enable Workbox's offline caching features. Preact.js News Feed PWA ( view source ) Let's kick things off by cloning the repo and running the dev environment. git clone preact-demo cd preact-demo npm install npm run dev # Navigate to in your browser Here you will see the default boilerplate for a Preact app created with the CLI. Let's add some code to make our very basic news feed app. Open up the main CSS file at src/style/index.css and replace with the following: html, body { height: 100%; width: 100%; padding: 0; margin: 0; background: #fafafa; font-family: "Helvetica Neue", arial, sans-serif; font-weight: 400; color: #444; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } * { box-sizing: border-box; } #app { height: 100%; } .site-header { padding: 2rem 0 1rem; } main { display: grid; grid-gap: 30px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); grid-auto-rows: max-content; grid-auto-flow: row dense; } .article a, .article a:visited { text-decoration: none; color: inherit; } .article img { width: 100%; } .error { display: flex; justify-content: center; align-items: center; height: 100%; } .alert { display: inline-block; padding: 15px; border-radius: 0.25rem; } .alert--error { background-color: #f8d7da; color: #721c24; } Under the home component. we'll add the functionality to fetch for the news using the newsapi.org API. If you haven't done so already, sign up for a free account to get your own API key. Open up the file at /src/routes/home/index.js and replace with the following. import { h, Component } from "preact"; import style from "./style"; const <div className="alert alert--error">Error: {error.message}</div> </div> ); } else if (!isLoaded) { return <div>Loading...</div>; } else { return ( <div className={style.home}> <div className="site-header"> <div className="select"> <select value={this.state.selectedSource} onChange={e => { this.updateNews(e.target.value); }}> {this.state.sources.map(source => { return ( <option value={source.id} key={source.id}> {source.name} </option> ); })} </select> </div> </div> <main> {articles.map((article, index) => ( <div className="article" key={index}> <h2> <a href={article.url}>{article.title}</a> </h2> <img src={article.urlToImage} <p>{article.description}</p> </div> ))} </main> </div> ); } } } Your app should now be getting some news articles, with the default dropdown source being techcrunch. If you change the dropdown to a different source, it will pull in a different set of articles. Let's open up our service-worker.js file and take a peek. workbox.precaching.precacheAndRoute(self.__precacheManifest || []); The Service Worker uses Workbox to precache any files that will be generated by Preact.js during the build process. This is much like the default behavior provided by CRA mentioned above. However, we also want to detect and cache the news articles fetched by the News API. We'll simply replace the contents with the following: // Default Precache for files generated by Preact.js workbox.precaching.precacheAndRoute(self.__precacheManifest || []); // Detect and register any fetch calls using 'https://' and use the Network First Strategy by Workbox workbox.routing.registerRoute(/(?:https:\/\/.*)/,workbox.strategies.networkFirst()); // Handle any images a week maxAgeSeconds: 7 * 24 * 60 * 60 }) ] }) ); Using Workbox, we can quickly and easily detect fetch requests and deal with them using Workbox Strategies. There are also a variety of Workbox Recipes to help with things like image caching and Google Fonts. With this added, our Progressive Web App is done! It's still very basic, but it will load offline and cache the news articles properly. We can do the final build and preview our app. # Build and serve the assets npm run serve When you serve with Preact, it will prompt you to accept some permissions so that it can load over https. If you navigate to, open up your Chrome inspector and head over to the Application tab. Make sure the service-worker.js is active and Workbox is working. You might need to reload the page a couple of times for the caching to kick in. If things don't look right, try clearing the Application's cache under Clear storage > Clear site data and reload the page. You can simulate going offline by checking the Offline box under Service Workers. The app should still load the Tech Crunch articles even if offline. If you browse to other sources before going offline, those should also be cached and served. Sources that you didn't visit will result in an error if you try selecting them while offline. To audit your PWA, use Google's Lighthouse in the Chrome Dev Tools. It will simulate a mobile device and throttle the internet to 3G speeds, eventually giving you some scores and advice for improvement. You can also host the app a variety of ways since it's essentially a static website after the build process. Visit your hosted app or the example app using an Android device with Chrome, and you'll see the prompt to add the app to your Home Screen. Apple iOS 11.3 and above will also support Progressive Web Apps, but I'm not sure Safari on mobile will pop up a prompt like Chrome does. Hopefully this was a good intro into Progressive Web Apps. You can take things further by experimenting with more of Google Workbox's recipes and features, making your PWA even better!
https://codebushi.com/pwa-with-react-and-preact/
CC-MAIN-2019-22
refinedweb
1,640
65.93
TagResourceInput import "github.com/aws/aws-sdk-go/service/athena" type TagResourceInput struct { ResourceARN *string `min:"1" type:"string" required:"true"` Tags []*Tag `type:"list" required:"true"` } - ResourceARN Type: *string Requests that one or more tags are added to the resource (such as a workgroup) for the specified ARN. ResourceARN is a required field A tag that you can add to a resource. A tag is a label that you assign to an AWS Athena resource (a workgroup). Each tag consists of a key and an optional value, both of which you define. Tags enable you to categorize workgroups in Athena, for example, by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter workgroups in your account. The maximum tag key length is 128 Unicode characters in UTF-8. The maximum tag value length is 256 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are case-sensitive. Tag keys must be unique per resource. Method GoString func (s TagResourceInput) GoString() string GoString returns the string representation SetResourceARN func (s *TagResourceInput) SetResourceARN(v string) *TagResourceInput SetResourceARN sets the ResourceARN field's value. SetTags func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput SetTags sets the Tags field's value. String func (s TagResourceInput) String() string String returns the string representation Validate func (s *TagResourceInput) Validate() error Validate inspects the fields of the type to determine if they are valid.
https://docs.aws.amazon.com/sdk-for-go/v1/api/service.athena.TagResourceInput.html
CC-MAIN-2019-13
refinedweb
252
55.74
table of contents - buster 4.16-2 - buster-backports 5.02-1~bpo10+1 - testing 5.03-1 - unstable 5.03-1 NAME¶hypot, hypotf, hypotl - Euclidean distance function SYNOPSIS¶ #include <math.h> double hypot(double x, double y); float hypotf(float x, float y); long double hypotl(long double x, long double y); Link with -lm. Feature Test Macro Requirements for glibc (see feature_test_macros(7)): hypot(): hypotf(), hypotl(): DESCRIPTION¶These functions return¶¶. ATTRIBUTES¶For an explanation of the terms used in this section, see attributes(7). CONFORMING TO¶C99, POSIX.1-2001, POSIX.1-2008. The variant returning double also conforms to SVr4, 4.3BSD.
https://manpages.debian.org/buster-backports/manpages-dev/hypotl.3.en.html
CC-MAIN-2019-47
refinedweb
106
54.9
4 Python Libraries to Take your Data Science Projects to the Next Level Introduction In this article, I’ll share 4 lesser-known Python libraries, that I feel don’t get the popularity they deserve and that’ll help you to take your Data Science projects to the next level. Let’s get started, in order these are: - argh – Create seamless CLIs - tqdm – Easy progress bars - msgpack – Binary JSON, fast and small - Redis Simple cache – For memoization And there’s a bonus library I’ve mentioned at the end of the article! Be sure to check it out. Now let’s get started! 1. argh argh is a wrapper around argparse which is dead simple to use. Given some function definition, argh will create a command-line interface for you automatically. First, we install argh. It can be easily installed using pip. > pip install argh Let us create a simple dummy function to help understand argh better: import argh def do_the_thing(required_arg, optional_arg=1, other_optional_arg=False): """ I am a docstring """ print((required_arg, type(required_arg))) print((optional_arg, type(optional_arg))) print((other_optional_arg, type(other_optional_arg))) First, we import argh, next we start creating our function. Note that we can write up custom documentation using docstring for our function, which we can access later in our command line also. As we can see our function takes 3 variables as arguments. The first one doesn’t have a default value so it’ll be interpreted as a required argument, the second one does have a default value, which happens to be an integer, and argh will recognize that and same with the third one, but this is a bool and argh will handle this differently. Now we want to make this function available for somebody to call from the command line. To do that, in the place where our script is supposed to run, we do this: if __name__ == '__main__': argh.dispatch_command(do_the_thing) And that’s it! This is all you have to do to create a CLI for your function. you can gain more control over your function. argh also provides a decorator called @args.arg using which you can specify options for a specific argument. You can specify a shorthand for these arguments as well as some help. @argh.arg('--bool-arg-for-flag', '-b', help="Flip this flag for things") @argh.arg('arg_with_choices', choices=['one', 'two', 'three']) def do_the_other_thing(arg_with_choices, bool_arg_for_flag=False): print(arg_with_choices) print(bool_arg_for_flag) if __name__ == '__main__': argh.dispatch_command(do_the_other_thing) Also sometimes it is very nice for command-line interfaces to give you the list of options that they accept rather than just take in any input. This is done in the above code using the ‘choices’ argument and giving it a list of values. Here is a summary of the argh module from its creator, explaining it in a nutshell: You can check out the official documentation and many in-depth tutorials here. 2. tqdm This is my goto progress bar generator. It is very very easy to use, you can nest loops and can easily customize your progress bar as well. From the module tqdm, the 2 most useful functions you’ll be requiring most are “tqdm” and “trange“. Now, let us start exploring this awesome package. Installing tqdm: > pip install ipywidgets > jupyter nbextension enable --py widgetsnbextension > jupyter labextension install @jupyter-widgets/jupyterlab-manager By doing this you can activate the ipywidgets plugin for JupyterLabs. After that add this cell to activate tqdm in a notebook: %%capture from tqdm import tqdm_notebook as tqdm tqdm().pandas() Fun fact : tqdm derives from the Arabic word taqaddum (تقدّم) which can mean “progress,” and is an abbreviation for “I love you so much” in Spanish (te quiero demasiado). The tqdm() function takes in an iterable and produces a progress bar as Python starts iterating through it. Here is a simple example: from tqdm import tqdm import time L = list(range(10000)) for ele in tqdm(L): time.sleep(0.2) Now a nice alternative to tqdm(range(x)) is trange(). Also, you can create multiple progress bars for nested loops: for i in trange(10): for j in trange(10, desc="inner_loop"): time.sleep(0.01) A few of the useful arguments along with their syntaxes: a) desc – Used to specify the description of the progress bar created. tqdm (self, iterable, desc= “Your description”) b) total – used to specify the expected number of iterations if not already specified or needs modification. tqdm (self, iterable, total= 500) c) ncols – Used to specify the width of the progress bar generated. Remains dynamic to the window if left unspecified. tqdm (self, iterable, ncols= 50) d) miniinterval – Used to change the minimum progress display update. The default value is 1/10th of a second. tqdm (self, iterable, mininterval=3) e) ascii – ASCII characters can be used to fill up the progress bar. tqdm ( self, iterable, ascii= “123456789$”, desc=”Your description” ) 3. msgpack This is just a Python client to a serialization protocol called MessagePack. msgpack is essentially what a binary version of JSON would be. It makes it really easy for you to serialize and deserialize the data and save it into either a byte array or a file. Almost every other language has an implementation of MessagePack so it has pretty much the same kind of portability that you would expect from a JSON file. However, because msgpack saves data in a binary format you can get a lot of space savings especially when this data needs to be transferred over a network. Here is the official description of the MessagePack module: You can install the package using: pip install msgpack Now let’s get on with examples: import msgpack import json import random def msgpack_example(): example_dict = {i: random.random() for i in range(10000)} with open('json_file.json', 'w') as f: json.dump(example_dict, f) with open('json_file.json') as f: back_from_json = json.load(f) # Saving and loading with open('msgpack_file.msgpack', 'wb') as f: f.write(msgpack.packb(example_dict)) with open('msgpack_file.msgpack', 'rb') as f: back_from_msgpack = msgpack.unpackb(f.read()) What we’ve essentially done here is create a dictionary of floating-point values, and then dumping it into a JSON and reloading it and also dumping it into a MessagePack file and reloading it. Since the MessagePack is in binary format, when it’s opened you have to use the binary format “b”. So you can see, using msgpack is really easy. Another thing I’d like to point out is about the data integrity of the files: # Data integrity print(type(next(iter(back_from_json.keys())))) print(type(next(iter(back_from_msgpack.keys())))) So the outputs are <class ‘str’> for JSON and <class ‘int’> for MessagePack. We know that JSON requires you to have string keys, even though our original data has integer keys in the dictionary, the JSON is going to forcibly turn them into strings. Whereas MessagePack maintains the integrity of the data and keeps it integer type. I’ve personally run into subtle problems multiple times while using JSON, while this is not even an issue. Secondly, if we look at the files that we’ve saved, the JSON file is 275kb and the Messagepack is 117kb. This might not seem a lot right now, but when you are working with more and more huge datasets, and you involve network, these savings become really important. 4. Redis Simple Cache Installation: pip3 install git+ For those that aren’t familiar with Redis, it is an in-memory key-value store that has very low latencies for data access. As the name suggests, redis_cache does cache using Redis. To use redis_cache, there are two decorators – @cache_it and @cache_it_json. The only difference between these is cache_it uses pickle to serialize your data and cache_it_json does not use pickle, instead uses JSON. import time from redis_cache import cache_it, cache_it_json @cache_it(limit=1000, expire=5) def function_that_takes_a_long_time(i): print(f"function was called with input {i}") return i**2 if __name__ == '__main__': for i in range(10): print(i, function_that_takes_a_long_time(2)) This is a dummy function to help visualize a function that takes a long time to execute, and then run a loop to call it 10 times. Using the @cache_it decorator, with arguments limit which implies in this scenario that only a 1000 unique input values will be cached, and then if the function is called with more different input values, the old ones will start getting pushed off and the new ones will start getting added. And the expire argument, in this case, signifies that anything cached for more than 5 seconds will automatically be deleted. This module is most useful when you are working with Databases, and pull a lot of data. This helps to keep the data from getting stale. End Notes I hope this article comes in handy to my fellow Data Science beginners. All these libraries can help you a lot if you can implement them in your day-to-day programming and development. Another library which you might find very useful and interesting is Numba. This library is mainly used to optimize your python code to make it run almost 1000 times faster! Yes exactly! a 1000 times fast. You can read all about numba in my article: Numba for Data Science, make your Py code run 1000x faster Thank you for reading this article. Cheers! Leave a Reply Your email address will not be published. Required fields are marked *
https://www.analyticsvidhya.com/blog/2021/05/4-python-libraries-to-take-your-data-science-projects-to-the-next-level/
CC-MAIN-2022-40
refinedweb
1,574
62.58
. Thanks to all for the feedback and support received in the last week since the launch of SchemaWeb. New features since launch include 'Schema of the Week' starting off with the mighty RSS 1.0. Also SchemaWeb is now hosting Dr Ont's Semantic Spout, a blog which will carry SchemaWeb news and RDF matters in general. Vic. For the first time since 1997 and the first Microsoft XML toolkit / parser, I have had to hack into XML files using regular expressions (arrrrrg!) in order to get a valid XML document to load into Microsoft XML tools. An example of this type of XML is: <?xml version="1.0"?><!DOCTYPE root [<!ENTITY ns "">]><root xmlns="&ns;"><foo>Some foo</foo><bar>Some bar</bar></root> The author of this type of XML is using a general entity to represent the default namespace uri. Both XmlDocument and XmlValidatingReader barf on this file with an error of: System.ArgumentException: Prefixes beginning with "xml" (regardless of whether the characters are uppercase, lowercase, or some combination thereof) are reserved for use by XML. So is this a valid XML document? Although using general entities in this way seems to be pushing the envelope a bit (Are namespaces part of the XML data or do they sit in a layer above the data?), I have seen quite a few examples in this style on the W3C site so I assume it is valid. So in order to deal with this type of XML, I have had to write code using tedious regular expressions to manually find and replace the offending entities prior to loading into .Net XML classes. Which brings me to my point and request. How do I report this bug to the MS XML team? I have looked on Technet and MSDN but cannot find a way to do this. Wow,. Sam Ruby has a moan about RDF / XML. Some people just don't understand. Also Edd Dumbill has a little gripe with RDFDrive, the only compliant RDF parser available for the .Net platform so I suppose beggars can't be choosers. 'Why all the interfaces', says Edd? Well, interfaces are cool. It means I can develop a parser that will query an in memory RDF graph and a parser that will query a database triples store against the same IRdfParser interface. I can then pass either parser to a application specific component, say a FOAF processor regardless of the internal implementations. His other gripe is with the node based query model which I agree is clunky. Mine main gripe with RDFDrive is the fact that it uses a DOM instead of an .Net XmlReader to deserialise the XML into triples. This is a real performance killer and resource eater when working with RDF files over the internet. That's why I'm presently extending and upgrading Jason Diamond's excellent RdfReader to the latest Working Draft spec and then going to use it as the basis for a proper parser. You know, the one with that nice graph.GetStatements(subject, predicate, object) interface like RAP. Is there a better query interface? Please please let me know before I start! One new feature of the Working Draft that I won't be tackling in a hurry is rdf:parseType = "Collection". Have you seen the triples that this is supposed to produce? And while we are talking syntax, why oh why is RDF / XML syntax so complicated? Any reasons or excuses for this would be appreciated because quite frankly, I just don't understand. So hang on there all .Net RDF heads (all 2 of you), I will be releasing VicSoft.Rdf.RdfParser + source code in September.
http://weblogs.asp.net/VLindesay/
crawl-001
refinedweb
613
73.88
Pages: 1 Okay, I'm mentally retarded when it comes to python. Nah not really, but I'm pretty new. I wanna parse the pacman.log for some info to use, sounds easy but it's not. I used to do a bit of PHP and I know I could do it super easy with that so this is driving me crazy that it doens't just work. I'm obviously doing something wrong somewhere I just can't figure out where. I'm using code something like this, I want to get a list of what was installed and when. import re r = open('/var/log/pacman.log') log = r.read() r.close() exp = re.compile('[(.+)] installed (.+)', re.MULTILINE) prnt exp.match(log) Every time it prints 'None" which isn't what I'm after. Basic debugging says log contains the data I'm chasing. Any tips would be greatly appreciated. Thanks Offline what are you trying to do? If you just want a python list (for gods sake, why can't they just call it an array), with each element being one of the strings found... import re r=open('/var/log/pacman.log','r') log = r.read() r.close() rexp = re.findall('^.*installed.*$',log,re.M) ##rexp is now a list of install lines. print rexp ps. I am new to python too. "Be conservative in what you send; be liberal in what you accept." -- Postel's Law "tacos" -- Cactus' Law "t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍ Offline Thanks, works well enough that I can go from here I'll split the string up to get the name and date, that's easy enough. There'll be a thread in the user contributions forum soon with the result of this Offline ps. I am new to python too. as am I - it's funny to see how long python has been around... Offline cactus wrote: ps. I am new to python too. as am I - it's funny to see how long python has been around... me three and cactus, they call it a list because a list can have multiple types in it, whereas an array implies a single type. list sounds cooler too Offline Pages: 1
https://bbs.archlinux.org/viewtopic.php?id=11688
CC-MAIN-2017-04
refinedweb
385
86.4
0 Hi folks, just a queary about checking chars. I have a char[] variable. I ask the user a question and the user types a response and presses enter. I need to check the variable to see if it said particular things and more importantly if it said nothing. #include <iostream> #include <fstream> using namespace std; char _cFileName[100]; int main() { cout<<"Enter the name of the file to open or press enter for HELP: "; cin>>_cFileName; if(_cFileName == 'HELP') { cout<<"DISPLAY HELP FILE"<<endl; system("PAUSE"); return 0; } if(_cFileName == '') { cout<<"DISPLAY HELP FILE"<<endl; system("PAUSE"); return 0; } ifstream infile("data.txt"); cout<<"Your file is "<<sizeof(infile)<<" bytes."<<endl; system("PAUSE"); return 0; } Apparently using either "HELP" or 'HELP' or HELP when using the if statement does not work. So I am just wondering where I am going wrong. Perhaps chars are not the way to go when doing this? Also as an aside. I have not had a chance to test this yet, but does sizeof() work on streams? Any help is much appriciated.
https://www.daniweb.com/programming/software-development/threads/427826/a-quick-question-about-checking-chars
CC-MAIN-2017-34
refinedweb
178
74.79
Bjorn Pettersen wrote: >>From: M.-A. Lemburg [mailto:mal at lemburg.com] >> >>Sure, but __int64 is only available in VC C++ AFAIK. Many >>compilers have a "long long" type which could be used, but >>then again, how do you know whether the ODBC driver was >>compiled with the same C type and layout as the application >>using it ? > > I haven't found a compiler without a long long type, but then I haven't > checked e.g. the Palm or Cray's, so I'm assuming they're out there :-) > This isn't a concern for the win32all odbc module of course, but all > cross platform projects I've seen so far has a #define LONGLONG to > either long long or __int64 somewhere (with an appropriate comment > <wink>). Sure, but the ODBC standard docs only refer to __int64 and as a result ODBC drivers and managers on other platforms have to use some other notion of "give me an integer with at least 64 bits". Here's an example of what unixODBC does: #if (ODBCVER >= 0x0300) #if (SIZEOF_LONG == 8) # define ODBCINT64 long # define UODBCINT64 unsigned long #else # ifdef HAVE_LONG_LONG # define ODBCINT64 long long # define UODBCINT64 unsigned long long # else /* * may fail in some cases, but what else can we do ? */ struct __bigint_struct { int hiword; unsigned int loword; }; struct __bigint_struct_u { unsigned int hiword; unsigned int loword; }; # define ODBCINT64 struct __bigint_struct # define UODBCINT64 struct __bigint_struct_u # endif #endif #ifdef ODBCINT64 typedef ODBCINT64 SQLBIGINT; #endif #ifdef UODBCINT64 typedef UODBCINT64 SQLUBIGINT; #endif #endif This is what the SAP DB ODBC driver uses: /* the ODBC C types for SQL_C_SBIGINT and SQL_C_UBIGINT */ #if (ODBCVER >= 0x0300) #if (_MSC_VER >= 900) #define ODBCINT64 __int64 #endif #if defined(_WIN32) || defined(_WIN64) #else # if defined (BIT64) # define ODBCINT64 long /* integer (8 byte, signed) */ # else # define ODBCINT64 long long /* integer (8 byte, signed) */ # endif #endif /* UNIX(tm) tested on AIX,DEC,LINUX,HP,SNI and SUN ;-) from sapdb_types.h */ /* If using other compilers, define ODBCINT64 to the approriate 64 bit integer type */ #ifdef ODBCINT64 typedef ODBCINT64 SQLBIGINT; typedef unsigned ODBCINT64 SQLUBIGINT; #endif #endif /* ODBCVER >= 0x0300 */ The introduction of Unicode has similar problems. Unicode on Windows is actually UCS2 (two bytes) or UTF-16 (depending on the app's view). Now, on other platforms such as Linux wchar_t has 4 bytes. As a result, some ODBC drivers use 4 bytes per character on Linux while other use 2 bytes. > If you call > > SQLColAttribute(hstmt, n, SQL_DESC_TYPE, NULL, 0, NULL, > (SQLPOINTER)&sqlType); > > and sqlType == SQL_BIGINT, that would be a good indication for result > sets, and if Right. That's what mxODBC uses. > SQLBindParameter(hstmt, num, SQL_PARAM_INPUT, > SQL_C_SBIGINT, SQL_BIGINT, > sizeof(__int64), 0, > (void*)val, sizeof(__int64), &m_nullInd); > > returns either SQL_SUCCESS or SQL_SUCCESS_WITH_INFO that ought to be > good enough for parameters? Yes, but only if __int64 is available. I suppose that mxODBC could use __int64 on Windows without any problems... >>It's one of those MS things again... the half cooked, "works >>for me" kind of attitude. > > > And here I thought it was the "everyone else did it that way, so we'll > do it different just because we can" attitude <wink>. The "everyone else" part doesn't fit: MS defines what the ODBC standard is, not everybody else :-/ -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Apr 14 2003) >>> Python/Zope Products & Consulting ... >>> mxODBC, mxDateTime, mxTextTools ... ________________________________________________________________________ EuroPython 2003, Charleroi, Belgium: 71 days left
https://mail.python.org/pipermail/python-list/2003-April/228061.html
CC-MAIN-2016-44
refinedweb
563
58.52
You can subscribe to this list here. Showing 4 results of 4 Where can I find OHSM GUI? I see it mentioned in documentation; there are even sample screenshots in Greg_OHSM_OLS2009.pptx. However, I don't see it anywhere in the sources (ohsm_v1.2). Is it located elsewhere? -- Tomasz Chmielewski Hello, I've run across OHSM while looking for a way to do data tiering on Linux for a Samba server. I'm very impressed by what I see from the project, but it looks as if there are no commits to repositories for about 4 months. Is the project being actively developed? I've got some questions before I understand enough to start testing. Thanks, Robert LeBlanc Life Sciences & Undergraduate Education Computer Support Brigham Young University Hi, We have decided to redesign the GUI for OHSM, hence i request everyone to put forward suggestions for the new GUI. You can also suggest layout graphically using paint brush etc. Regards, Rohit Sharma. file system downtime and any changes to the existing namespace.. File Allocation: Not all data is created equal. Some types of data such as databases, financial data, and online records are transactional in nature - meaning they change or are updated frequently. A majority of data however, is not transactional, but is data that is written once and read infrequently (persistent data). These two classes of data require different storage approaches. Transactional data requires high performance, disk-based storage. For persistent data, previously, the only option was tape which, while relatively inexpensive, was a pain to manage and unreliable for backups and restores. File Relocation: Not all data is treated equal and that’s why we have placement classes in the storage used by the enterprise level market player. Did applications have different data usage pattern. Take the example of a search engine, where not every data is referenced frequently. So, in our OHSM we move such files or objects to a lower level storage tier or a placement class. A placement class is usually identified with a storage tier. Policy rules cause files to be created and extended within specified placement classes, and to be relocated to other placement classes when they meet certain naming, activity, access rate, and size-related qualifications. What OHSM offer: * A very user friendly GUI to generate XML based policy files. * Facility to write XML based policy files and assign directly to a namespace. * Easy-to-use service level based volume migration. * Non-disruptive, completely transparent data object movement. * Safely moves data when application requirements increase or decrease. * Users can respond to business initiatives with faster storage provisioning. * Easily fine-tunes volume provisioning via command line interface (CLI). * The GUI Removes complexity in managing storage tiers. * Flexibility to add or remove storage to any placement class or tier. For any feedback or suggestions do mail us at fscops@... -- Regards, Sandeep.
http://sourceforge.net/p/ohsm/mailman/ohsm-open/
CC-MAIN-2015-27
refinedweb
477
57.98
Walkthrough Writing An Orchard Module This topic is obsolete. If you are just getting started with Orchard module development you should read the Getting Started with Modules course first. It will introduce you to building modules with Orchard using Visual Studio Community, a free edition of Visual Studio. Orchard is designed with modular extensibility in mind. The current application contains a number of built-in modules by default, and our intent with writing these modules has been to validate the underlying CMS core as it is being developed - exploring such concepts as routable content items, their associated "parts" (eventually to be bolted on using metadata), UI composability of views from separate modules, and so on. While there are many CMS core concepts that remain unimplemented for now, there are still many things you can do with the current system. The module concept is rooted in ASP.NET MVC Areas (1,2) with the idea that module developers can opt-in to Orchard-specific functionality as needed. You can develop modules in-situ with the application as "Areas", using Visual Studio's MVC tools: Add Area, Add Controller, Add View, and so on (in VS2010). You can also develop modules as separate projects, to be packaged and shared with other users of Orchard CMS (the packaging story is still to be defined, along with marketplaces for sharing modules). This is how the Orchard source tree is currently organized. There is also a "release" build of Orchard that contains all the modules pre-built and ready to run (without source code), that you can extend using the VS tooling for MVC Areas - this can be downloaded from. Let's take a walk through building an Orchard module as an MVC Area in VS. We'll start simple (Hello World), and gradually build up some interesting functionality using Orchard. Installing Software Prerequisites First, install these MVC and Orchard releases to your machine, along with Visual Studio or Visual Web Developer for code editing: - Install VS2010 (Express or higher) - Download and Install ASP.NET MVC 3 - Download and extract the latest "release" build from - Double-click the csproj file in the release package to open it in VS Getting Started: A Simple Hello World Module ("Area" in VS) Our objective in this section is to build a very simple module that displays "Hello World" on the front-end using the applied Orchard theme. We'll also wire up the navigation menu to our module's routes. Objectives: - A simple custom area that renders "Hello World" on the app's front-end - Views in the custom area that take advantage of the currently applied Orchard theme - A menu item on the front-end for navigating to the custom area's view Follow These Steps: - Right-click the project node in VS Solution Explorer, and choose "Add > Area..." - Type "Commerce" for the area name and click OK. - Right-click the newly created "Commerce > Controllers" folder, and choose "Add > Controller..." - Name the Controller "HomeController" - Right-click on the "Index()" method name and choose "Add View..." - Selected the "Create a partial view" option and click Add - Add the following HTML to the View page: <p>Hello World</p> Add the following namespace imports to the HelloController.cs file: using Orchard.Themes; using Orchard.UI.Navigation; Add a [Themed]attribute to the HelloController class: namespace Orchard.Web.Areas.Commerce.Controllers { [Themed] public class HomeController : Controller Add another class to create a new Menu item: public class MainMenu : INavigationProvider { public String MenuName { get { return "main"; } } public void GetNavigation(NavigationBuilder builder) { builder.Add(menu => menu.Add("Shop", "4", item => item .Action("Index", "Home", new { area = "Commerce" }))); } }
http://docs.orchardproject.net/Documentation/Walkthrough-Writing-An-Orchard-Module
CC-MAIN-2016-18
refinedweb
605
50.97
10. 10.1.1.1. Working with Universes¶ 10.1.1.1.1. Quick segid selection¶ Deprecated since version 0.16.2: Instant selectors will be removed in the 1.0 release. See issue #1377 for more details. If the loaded topology provided segids, then these are made accessible as attributes of the Universe. If the segid starts with a number such as ‘4AKE’, the letter ‘s’ will be prepended to the segid. For example: import MDAnalysis as mda from MDAnalysisTests.datafiles import PSF, DCD u = mda.Universe(PSF, DCD) u.select_atoms('segid 4AKE') # selects all segments with segid 4AKE If only a single segment has that segid then a Segment object will be returned, otherwise a SegmentGroup will be returned. 10.1.1(). dimensions Current dimensions of the unitcell - classmethod empty(n_atoms, n_residues=None, n_segments=None, load_new(filename, format=None, in_memory=False, *. 10.1.1.3..
https://www.mdanalysis.org/mdanalysis/documentation_pages/core/universe.html
CC-MAIN-2018-47
refinedweb
147
60.31
Running Joomla OpenShift for Free The Cloud Zone is brought to you in partnership with Iron.io. Discover how Microservices have transformed the way developers are building and deploying applications in the era of modern cloud infrastructure. My first post was running WordPress on OpenShift, so for all Joomla users I decided to show how easily you can get running Joomla on OpenShift for free also. I assume that you have OpenShift account and you read my first two posts if you are new with all of this. For Joomla there is no predefined cartridge so you will need to install it manually. So go to create application and add PHP cartridge, give application name and create it. After that you will get git repo for your application, so you will have to install git client if you already don’t have one. Look at Git on Windows post if you want to use it on Windows machine. In this post I will use git on Linux. When your application is created you will get name of your git repo and how to clone it locally. For Joomla installation you will need MySQL cartridge also, so go to your applications and add new cartridge along with PHP. Adding MySQL you will get all database information, like root user credentials. Write this info somewhere secure because you will need it for Joomla installation. When both are added you need to add Joomla to you git repo. So go to Joomla web site and get Joomla. I prefer “.tar.gz” package, so I will use this. Commands used on Linux machine: wget tar zxvf Joomla_2.5.8-Stable-Full_Package.tar.gz -C joomla git clone ssh://user@appName-namespace.rhcloud.com/~/git/appName.git/ cd appName/ cp -r ../joomla/* php/. git add . git commit -m "Joomla added" git push After all is done go to your application URL and install Joomla. As I already said in first two posts any change on application outside git repo will not be there if in meantime you do git push. The procedure for WordPress manual installation is basically the same. For features like adding custom domain read my first two posts. The Cloud Zone is brought to you in partnership with Iron.io. Learn how to build and test their Go programs inside Docker containers. {{ parent.title || parent.header.title}} {{ parent.tldr }} {{ parent.linkDescription }}{{ parent.urlSource.name }}
https://dzone.com/articles/running-joomla-openshift-free
CC-MAIN-2015-48
refinedweb
402
64.61
The current readHistory and writeHistory bindings are defined as: -- |Read in a history file. Returns 'False' on failure -- (for example, if the file does not exist). readHistory :: FilePath -- ^ The file to read (if null, read ~\/.history) -> IO Bool readHistory fp = do ok <- withCString fp read_history return (ok==0) foreign import ccall unsafe read_history :: Ptr CChar -> IO CInt -- |Write out a history file. Returns 'False' if there was a problem writing the file. writeHistory :: FilePath -- ^ The file to write (if null, write ~\/.history) -> IO Bool writeHistory fp = do ok <- withCString fp write_history return (ok==0) foreign import ccall unsafe write_history :: Ptr CChar -> IO CInt Note the comments "(if null, write ~/.history)"! This is supported in the original C API but in Haskell the filepath cannot be null. In the best case it can be empty string. Either the type signatures have to be changed to accept (Maybe FilePath) or the comments have to be changed because the Haskell binding currently doesn't support this functionality. Comments? I hope that this will not start another endless discussion. Regards, Krasimir
http://www.haskell.org/pipermail/libraries/2008-June/009834.html
CC-MAIN-2013-48
refinedweb
177
63.9
I began this trek along the 12 steps of Navier stokes with the extremely simple 1-D linear convection equation shown below:$$ \frac{\partial u}{\partial t} + c \frac{\partial u}{\partial x} = 0 $$ Next, we up the ante and present a new more complex model known as the 1D convection equation (notice the lack of the word linear) :$$ \frac{\partial u}{\partial t} + u \frac{\partial u}{\partial x} = 0 $$ Now, instead of a constant factor c multiplying we have the solution u doing that instead. Thus this makes our convection equation behave nonlinearly. We shall follow the exact discretization steps outline in Step 1 with the following result: Solving for the same unknown value $u_i^{n+1}$:$$ u_i^{n+1} = u^n_i - u^n_i \frac{\Delta t}{\Delta x}(u_i^n - u^n_{i-1}) $$ The following step is a condensed version of what we did to set up initial conditions, variables and libraries and is taken directly from the previous notebook. # Adding inline command to make plots appear under comments import numpy as np import matplotlib.pyplot as plt import time, sys %matplotlib inline #Same initial conditions as in step 1 grid_length = 10 grid_points = 41 dx = grid_length / (grid_points - 1) nt = 400 dt = 0.025 Non-Linear Convection t=0'); un = np.ones(grid_points) for n in range(nt): #Runs however many timesteps you set earlier un = u.copy() #copy the u array to not overwrite values for i in range(1,grid_points): u[i] = un[i] - un[i] * dt/dx * (un[i]-un[i-1]) plt.plot(np.linspace(0,grid_length,grid_points), u); plt.ylim(1,2); plt.xlabel('x') plt.ylabel('u') plt.title('1D Non-Linear Convection t=10'); #Imports for animation and display within a jupyter notebook from matplotlib import animation, rc from IPython.display import HTML #Generating the figure that will contain the animation fig, ax = plt.subplots() ax.set_xlim(( 0, grid_length)) ax.set_ylim((1, 2)) line, = ax.plot([], [], lw=2) plt.xlabel('x') plt.ylabel('u') plt.title('1D Non] - un[i] * dt/dx * (un[i]-un[i-1]) line.set_data(x, u) return (line,) anim = animation.FuncAnimation(fig, animate, init_func=init, frames=nt, interval=20) HTML(anim.to_jshtml())
https://nbviewer.org/github/Angelo1211/CFDPython/blob/master/Lessons/S02_Non-linear_convection.ipynb
CC-MAIN-2021-43
refinedweb
367
54.63
Consume a .NET Standard library in Visual Studio 2017 Once you've created a .NET Standard class library by following the steps in Building a C# class library with .NET Core in Visual Studio 2017 or Building a Visual Basic class library with .NET Core in Visual Studio 2017, tested it in Testing a class library with .NET Core in Visual Studio 2017, and built a Release version of the library, the next step is to make it available to callers. You can do this in two ways: If the library will be used by a single solution (for example, if it's a component in a single large application), you can include it as a project in your solution. If the library will be generally accessible, you can distribute it as a NuGet package. Including a library as a project in a solution Just as you included unit tests in the same solution as your class library, you can include your application as part of that solution. For example, you can use your class library in a console application that prompts the user to enter a string and reports whether its first character is uppercase: Open the ClassLibraryProjectssolution you created in the Building a C# Class Library with .NET Core in Visual Studio 2017 topic. In Solution Explorer, right-click the ClassLibraryProjects solution and select Add > New Project from the context menu. In the Add New Project dialog, expand the Visual C# node and select the .NET Core node followed by the Console App (.NET Core) project template. In the Name text box, type "ShowCase", and select the OK button. In Solution Explorer, right-click the ShowCase project and select Set as StartUp Project in the context menu. Initially, your project doesn't have access to your class library. To allow it to call methods in your class library, you create a reference to the class library. In Solution Explorer, right-click the ShowCaseproject's Dependencies node and select Add Reference. In the Reference Manager dialog, select StringLibrary, your class library project, and select the OK button. In the code window for the Program.cs file, replace all of the code with the following code: using System; using UtilityLibraries; class Program { static void Main(string[] args) { int row = 0; do { if (row == 0 || row >= 25) ResetConsole(); string input = Console.ReadLine(); if (String.IsNullOrEmpty(input)) break; Console.WriteLine($"Input: {input} {"Begins with uppercase? ",30}: " + $"{(input.StartsWithUpper() ? "Yes" : "No")}\n"); row += 3; } while (true); return; // Declare a ResetConsole local method void ResetConsole() { if (row > 0) { Console.WriteLine("Press any key to continue..."); Console.ReadKey(); } Console.Clear(); Console.WriteLine("\nPress <Enter> only to exit; otherwise, enter a string and press <Enter>:\n"); row = 3; } } } The code uses the rowvariable to maintain a count of the number of rows of data written to the console window. Whenever it is greater than or equal to 25, the code clears the console window and displays a message to the user. The program prompts the user to enter a string. It indicates whether the string starts with an uppercase character. If the user presses the Enter key without entering a string, the application terminates, and the console window closes. If necessary, change the toolbar to compile the Debug release of the ShowCaseproject. Compile and run the program by selecting the green arrow on the ShowCase button. You can debug and publish the application that uses this library by following the steps in Debugging your Hello World application with Visual Studio 2017 and Publishing your Hello World Application with Visual Studio 2017. Distributing the library in a NuGet package You can make your class library widely available by publishing it as a NuGet package. Visual Studio does not support the creation of NuGet packages. To create one, you use the dotnet command line utility: Open a console window. For example in the Ask me anything text box in the Windows taskbar, enter Command Prompt(or cmdfor short), and open a console window by either selecting the Command Prompt desktop app or pressing Enter if it's selected in the search results. Navigate to your library's project directory. Unless you've reconfigured the typical file location, it's in the Documents\Visual Studio 2017\Projects\ClassLibraryProjects\StringLibrary directory. The directory contains your source code and a project file, StringLibrary.csproj. Issue the command dotnet pack --no-build. The dotnetutility generates a package with a .nupkg extension. Tip If the directory that contains dotnet.exe is not in your PATH, you can find its location by entering where dotnet.exein the console window. For more information on creating NuGet packages, see How to Create a NuGet Package with Cross Platform Tools. Feedback Send feedback about:
https://docs.microsoft.com/en-us/dotnet/core/tutorials/consuming-library-with-visual-studio
CC-MAIN-2019-22
refinedweb
787
55.95
Section 4.13 Structs The second aggregate data type in C that we consider is the struct. Structs are also commonly referred to as record. A struct has \(n\) fields of possibly distinct types \(T_1,\dots, T_n\text{.}\) A container for a struct is the combination of containers for the \(n\) fields. For an example, consider a struct that represents aspects of a person. We want to consider for each person a date of birth, a first name, and a last name. A date consists of a day, a month, and a year: struct date { unsigned day, month, year; }; We can use composition (“is part of”) or aggregation (“refers to”) to define our struct: struct person { struct date date_of_birth; char name[16]; char surname[16]; }; struct person { struct date date_of_birth; char const *name; char const *surname; }; In both declarations, the date_of_birth field is added through composition. We could also implement the field via aggregation with a pointer to a date struct. However, the struct date is a small struct, therefore referencing it with a pointer saves little space in the person struct. Reusing struct date objects provides therefore little benefit for this case. We can access the individual fields of a struct container with the . operator: struct person p; /* ... */ printf("%s %s\n", p.name, p.surname); In contrast to arrays, structs can be passed to functions by value in C. With small structs, this can be sensible. In practice however, we usually pass structs via pointer as in the following example: void init_date(struct date *d, unsigned day, unsigned month, unsigned year) { d->day = day; d->month = month; d->year = year; } The expression A->B is an abbreviation for (*A).B. Remark 4.13.3. In C, suffix operators have higher precedence than prefix operators. Therefore, *A.B is not the same as (*A).B: The former accesses a struct field and loads from the address contained there, the latter loads the field of a struct whose address is given. In practice, it is best to use parentheses to make non-obvious precedences explicit. Subsection 4.13.1 typedef Types in C can easily become long, like struct person, or complex, like int *(*)[10]. C provides the means to define shorter, more meaningful names for such types: typedef struct { /* see above */ } person_t; /* ptr_table_t ist a pointer to an array of 10 pointers to ints */ typedef int *(*ptr_table_t)[10]; Example 4.13.4. Initialization. It is a common pattern to define for each struct a function that properly initializes it. The following function initializes the version of struct person where name and surname are aggregated: person_t *person_init(person_t *p, date_t const *d, char const *name, char const *surname) { p->date = *d; p->name = name; p->surname = surname; return p; } Such initialization functions, which are also called constructors, usually expect a pointer to an uninitialized struct container. This makes the constructor independent of how the struct is allocated: as a local variable, a global one, or dynamically: person_t global_p; void person_test() { person_t local_p; person_t *heap_p; heap_p = malloc(sizeof(*heap_p)); person_init(&global_p, /* ... */); person_init(&local_p, /* ... */); person_init(heap_p, /* ... */); free(heap_p); } If we incorporate the name and surname fields by composition instead of aggregation, we need to copy the character sequences into the struct: person_t *person_init(person_t *p, date_t const *d, char const *name, char const *surname) { p->date = *d; snprintf(p->name, sizeof(p->name), "%s", name); snprintf(p->surname, sizeof(p->surname), "%s", surname); return p; } It is important to not copy more characters than fit into the field. We realize this here with the snprintf function with the size sizeof(p->name). If we copied the string without ensuring that the field size is respected, we would encounter undefined behavior (see Section 4.15) when the function is called with too large strings. We can use sizeof here because the type of p->name here is char[16] and not char *. The value of sizeof(p->name) is therefore \(16\text{,}\) rather than the size of a pointer. Example 4.13.5. Polynomials. The following struct represents a polynomial of degree n: typedef struct { unsigned degree; int *coeffs; } poly_t; The coefficients are implemented through aggregation. This is necessary, since we do not want to assume a statically known fixed length for the polynomials. Therefore, an array for the coefficients need to be allocated separately (see Exercise 4.13.3.1). Subsection 4.13.2 Incomplete Structs We use a technique called encapsulation to separate large software systems into modules. By encapsulation, we hide the implementation details of a module from code that uses it. The benefit of this technique is that we can then change the module's implementation without affecting the code parts that use the module. C supports encapsulation through incomplete structs. They allow to hide the specific structure of a struct from other code. We will discuss encapsulation in more detail in the Java part of this book. Consider Example 4.13.5. Let us assume that we want to hide how polynomials are represented from using code parts. We achieve this with an incomplete struct that we declare in a header file (see poly.h in Figure 4.13.6). The values of the data type are then only accessible through a set of functions, a so-called Application Programming Interface (API). The API of such a data type only uses pointers to the incomplete type as the encapsulation ensures that its contents, and therefore the necessary container size, are not known to the outside. #ifndef POLY_H #define POLY_H /* incomplete struct */ typedef struct poly_t poly_t; poly_t *poly_alloc(unsigned degree); void poly_free(poly_t *p); void poly_set_coeff(poly_t *p, unsigned deg, int coeff); int poly_eval(poly_t const *p, int x); unsigned poly_degree(poly_t const *p); #endif /* POLY_H */ poly.h #include "poly.h" struct poly_t { unsigned degree; int *coeffs; }; poly.c. Continuation: Exercise 4.13.3.1 #include <stdlib.h> #include <stdio.h> #include "poly.h" int main(int argc, char *argv[]) { if (argc < 3) { fprintf(stderr, "syntax: %s x coeffs...", argv[0]); return 1; } poly_t *p = poly_alloc(argc - 3); for (int i = 2; i < argc; i++) { int coeff = atoi(argv[i]); poly_set_coeff(p, i - 2, coeff); } int x = atoi(argv[1]); int y = poly_eval(p, x); poly_free(p); printf("%d\n", y); return 0; } main.c poly_tis only visible in the translation unit poly.c. Exercises 4.13.3 Exercises 1. Polynomial. We consider the API for polynomials defined in Figure 4.13.6. Complete the file poly.c: Implement the functions declared in the header file poly.h in. Implement a function poly_allocallocating the space for a polynomial on the heap. Implement the function poly_free, that frees a polynomial that was constructed on the heap. Implement the function poly_set_coeffthat sets the coefficients of an polynomial. Implement the evaluation of a polynomial using the Horner schema. Implement the function poly_degreethat returns the degree of a polynomial. #include <stdlib.h> #include <assert.h> #include "poly.h" struct poly_t { unsigned degree; int *coeffs; }; poly_t *poly_alloc(unsigned degree) { poly_t *p = malloc(sizeof(*p)); p->degree = degree; p->coeffs = malloc((degree + 1) * sizeof(p->coeffs[0])); return p; } void poly_free(poly_t *p) { free(p->coeffs); free(p); } void poly_set_coeff(poly_t *p, unsigned i, int val) { assert(i <= p->degree); p->coeffs[i] = val; } int poly_eval(poly_t const *p, int x) { int res = p->coeffs[0]; for (unsigned i = 1; i <= p->degree; i++) res = res * x + p->coeffs[i]; return res; }
https://prog2.de/book/sec-c-structs.html
CC-MAIN-2022-33
refinedweb
1,237
54.93
Read my story at Great for fast visual validation that things are looking, and working as intended. Under the hood, these preview environments are powered by Helm. specifically, without the use of the server side component Tiller. Jenkins X is nice enough to wire this up, and create Helm charts for you. Chances are, you've also wanted to set up HTTPS. No problem, there's a command for that. jx upgrade ingress --cluster After a rather long series of saying yes over and over, you have certificates! "Success!" you shout, as you make a winning motion with your fist. And so you go on with life, but only for a short while. As you're happily awaiting your magical preview link something happens! Which something that is depends on your configuration and version, but it's not a working SSL cert, that's for sure! Either you get a build error that the preview status could not be determined and something about a certificate, or you get a successful build, only to open up chrome to an invalid cert. error: error checking if preview application https://*.com is available Or maybe the dreaded "Privacy Error": What happened!? I thought we upgraded the certs! And so, you begin to dig. You find closed PRs that say it's fixed, and references to a oror tls-acme oror tlsacme or maybe evenor maybe even tlsAcme setting and try several variations of that set to true and none of those work, and what about turning this http setting off? Nothing works.setting and try several variations of that set to true and none of those work, and what about turning this http setting off? Nothing works. TLSAcme Eventually you look more closely at the logs and see it never used any of your values anyway. So then you go read the source code and you see andand tls-acme andand tlsacme so you're just more confused now cause where do go modules even come from anyway?so you're just more confused now cause where do go modules even come from anyway? TLSAcme So then you go learn Go and how it's module system works, at least, enough to read it, and figure out that make preview is calling this and has a flag called that you can set to true from the command line, so you try that!that you can set to true from the command line, so you try that! tls-acme You modify your pipeline to append to it.to it. --tls-acme=\"true\" A few minutes pass as you anxiously await the results of your pipeline. 9th times a charm, right? Annnnd! DEPRECATED! WOMP WOMP! You saw it in the code, but hoped it would work anyway. It does leave a clue, however. Flag --tls-acme has been deprecated, please use `jx upgrade ingress` after install instead Feeling defeated you head over to your Jenkinsfile, and add the line: sh "jx upgrade ingress" Alas, it needs user input, as you already knew. To solve this, we need the flag.flag. --batch-mode And with that, we will find one more issue, a missing helm repository: .. jenkins-x That can be fixed easy enough by adding: sh "helm repo add jenkins-x" Using batch mode, turns out, it does get some config from a ConfigMap that's been created in the development namespace, which is by default, and a team name if you are using that feature. But not everything.by default, and a team name if you are using that feature. But not everything. jx apiVersion: v1 data: clusterissuer: "false" domain: yourdomain.com email: [email protected] exposer: Ingress issuer: letsencrypt-prod tls: "true" urltemplate: "" kind: ConfigMap For the rest, we can pass in some flags. Here's the full final Jenkinsfile stage. stage('CI Build and push snapshot') { when { branch 'PR-*' } environment { TEAM = "jx" PREVIEW_VERSION = "0.0.0-SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER" PREVIEW_NAMESPACE = "$APP_NAME-$BRANCH_NAME".toLowerCase() HELM_RELEASE = "$PREVIEW_NAMESPACE".toLowerCase() FULL_PREVIEW_NAMESPACE = "$TEAM-$ORG-$APP_NAME-$BRANCH_NAME".toLowerCase() } steps { container('nodejs') { sh "export VERSION=$PREVIEW_VERSION && skaffold build -f skaffold.yaml" sh "jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:$PREVIEW_VERSION" dir('./charts/preview') { sh "make preview" sh "jx preview --app $APP_NAME --dir ../.." sh "helm repo add jenkins-x" sh "jx upgrade ingress --batch-mode --namespaces=$FULL_PREVIEW_NAMESPACE --services=$APP_NAME --wait-for-certs=false --skip-resources-update=true --skip-certmanager=true" } } } } And with that, the preview pull request now creates a cert after the preview environment is successfully created! It may take around 60 seconds or so for the cert to be created after the completion of the build. There are a few caveats to this, such as when you are using a custom urlTemplate for the preview environment. In that case you'd need to adjust the environment variable I've added . Another one is if you are using the. Another one is if you are using the FULL_PREVIEW_NAMESPACE feature, you'll need to make sure you update that environment variable as well.feature, you'll need to make sure you update that environment variable as well. teams Happy Hacking! Make sure to follow me on here if that's still a thing, and on twitter @pat_scott! ~ Patrick Lee Scott If you're looking to learn for yourself, the best place to start is reading about my own journey, which I'm imagining is quite similar to yours! At the end you'll find a FREE 21 day email course called "Getting Dangerous with DevOps!" Create your free account to unlock your custom reading experience.
https://hackernoon.com/automatic-tlsssl-for-jenkins-x-previews-4dhdi3d7n
CC-MAIN-2021-43
refinedweb
925
64.71
Set user data for the dictionary returned with the last event. #include <mm/renderer/events.h> int mmr_event_data_set( mmr_context_t *ctxt, void *usrdata ) A context handle. A pointer to the user data to associate with the dictionary. Set a pointer to the user data to associate with the dictionary returned with the last event. The dictionary is stored in the mmr_event_t structure's data field and contains all the mm-renderer properties reported by the event. Some event types, including STATE, ERROR, and WARNING, share a single dictionary and therefore have a common user data pointer. So, if you set the user data after receiving, say, a STATE event, the same user data pointer is returned with any subsequent STATE, ERROR, or WARNING event. Other event types, including METADATA, OUTPUT, and TRKPAR, each have multiple dictionaries, distinguished by an index stored in the mmr_event_t details field. So, if you set the user data after receiving say, a METADATA event with an index of 2, the same user data is returned only for other METADATA events whose index is also 2. Zero on success, or -1 if the event was MMR_EVENT_NONE or a deletion. QNX Neutrino
http://www.qnx.com/developers/docs/6.6.0.update/com.qnx.doc.mm_renderer/topic/mmr_api/mmr_event_data_set.html
CC-MAIN-2018-26
refinedweb
194
52.29
#include <EventLogger.h> List of all members. Users' behaviors can call logMessage(), logImage(), and logWebcam() to insert the corresponding data into logSocket via an XML 'event' node. The protocol used with logSocket is: list spider listen ignore clear Each of those commands should be terminated with a newline - i.e. one command per line After a list command, the first line will be the number of StateNodes, followed by that number of lines, one StateNode name per line. After a spider command, an XML description of the model will be sent. If no matching StateNode is found, an warning will be displayed on serr, and an empty model ("<model></model>") returned over the network connection. spider All other commands give no direct response - listen can be executed before the specified StateNode is yet running, and ignore doesn't care whether or not the specified StateNode was actually being listened for. The format of the model is: <!DOCTYPE model [ <!ELEMENT model (state*, transition*)> <!ELEMENT state (state*, transition*)> <!ELEMENT transition (source+, dest+)> <!ELEMENT source (#PCDATA)> <!ELEMENT dest (#PCDATA)> <!ATTLIST state id CDATA #REQUIRED> <!ATTLIST state class CDATA #REQUIRED> <!ATTLIST transition id CDATA #REQUIRED> <!ATTLIST transition class CDATA #REQUIRED> ]> The format of status updates following a listen command is: <!DOCTYPE event [ <!ELEMENT event (fire*, statestart*, statestop*)> <!ELEMENT fire (EMPTY)> <!ELEMENT statestart (EMPTY)> <!ELEMENT statestop (EMPTY)> <!ATTLIST fire id CDATA #REQUIRED> <!ATTLIST fire time CDATA #REQUIRED> <!ATTLIST statestart id CDATA #REQUIRED> <!ATTLIST statestart time CDATA #REQUIRED> <!ATTLIST statestop id CDATA #REQUIRED> <!ATTLIST statestop time CDATA #REQUIRED> ]> The 'event' node is also used for the results of logImage(), logMessage(), and logWebcam(). Definition at line 77 of file EventLogger.h. [protected] the type of the behavior registry (BehaviorBase::registry) Definition at line 179 of file EventLogger.h. the type of listen Definition at line 181 of file EventLogger.h. the type of queuedEvents Definition at line 184 of file EventLogger.h. the type of transStack Definition at line 187 of file EventLogger.h. constructor Definition at line 27 of file EventLogger.cc. [virtual] destructor Definition at line 49 of file EventLogger.cc. opens a custom (embedded) menu to toggle individual EGIDs Reimplemented from ControlBase. Definition at line 62 of file EventLogger.cc. called when the child has deactivated and this control should refresh its display, or some other event (such as the user pressing the refresh button) has happened to cause a refresh to be needed Definition at line 97 of file EventLogger.cc. Referenced by doSelect(). sends all events received to stdout and/or logfile Implements EventListener. Definition at line 103 of file EventLogger.cc. [inline, static] returns logSocket Definition at line 93 of file EventLogger.h. returns port Definition at line 96 of file EventLogger.h. sets port Definition at line 99 of file EventLogger.h. NULL [static] send the current camera image over the log socket Definition at line 133 of file EventLogger.cc. 0 send a string over the log socket Definition at line 165 of file EventLogger.cc. request that the desktop side take a picture with the webcam (if available) Definition at line 187 of file EventLogger.cc. called by wireless when there's new data Definition at line 361 of file EventLogger.cc. Referenced by EventLogger(). [protected, virtual] deletes each slot item and clears the slots Definition at line 205 of file EventLogger.cc. Referenced by ~EventLogger(). sets the status char of slot i to c Definition at line 210 of file EventLogger.cc. Referenced by checkLogFile(), and doSelect(). checks to see if logfilePath differs from the StringInputControl's value and switches it if it is Definition at line 216 of file EventLogger.cc. Referenced by processEvent(), and refresh(). dumps all of the transitions and subnodes of a given statenode if parent is NULL, will dump the results over logSocket, otherwise adds the xml tree as a child of parent Definition at line 238 of file EventLogger.cc. Referenced by runCommand(). returns true iff n or one of its parents is found in listen Definition at line 287 of file EventLogger.cc. Referenced by processStateMachineEvent(). parses commands sent from callback() Definition at line 312 of file EventLogger.cc. Referenced by callback(). just to prettify the data sent out - probably should make this a null-op to save bandwidth after debugging is done Definition at line 296 of file EventLogger.cc. searches currently instantiated StateNodes to find the one named name Definition at line 301 of file EventLogger.cc. if there is a remote monitor listening for state machine transitions, this will send them over this is called by the StateMachineListener, which is subscribed to only those machines which have been requested by the remote monitor Definition at line 375 of file EventLogger.cc. Referenced by EventLogger::StateMachineListener::processEvent(). [static, protected] dumps elements of queuedEvents over logSocket, popping and freeing as it goes Definition at line 438 of file EventLogger.cc. Referenced by logImage(), logMessage(), logWebcam(), and processStateMachineEvent(). writes an xmlNode out over logSocket, freeing node when complete uses doc if provided, otherwise makes a new temporary one which is then deleted again before the function returns Definition at line 447 of file EventLogger.cc. Referenced by dumpQueuedEvents(), and spider(). the instance which will handle network communication Definition at line 113 of file EventLogger.h. Referenced by EventLogger(), EventLogger::StateMachineListener::processEvent(), and ~EventLogger(). handles state machine transitions if the Storyboard GUI (or other remote monitor) is listening for state machine events Definition at line 123 of file EventLogger.h. address of the logfile, if any (empty string is no logfile) Definition at line 162 of file EventLogger.h. Referenced by checkLogFile(). if a filename is given, events are logged to here Definition at line 165 of file EventLogger.h. Referenced by checkLogFile(), doSelect(), and processEvent(). events which are logged will be sent over this port in an xml format. See eventlog.dtd in the docs directory Definition at line 168 of file EventLogger.h. Referenced by dumpNode(), EventLogger(), getLogSocket(), indent(), logImage(), logMessage(), logWebcam(), processEvent(), processStateMachineEvent(), runCommand(), and ~EventLogger(). port number logSocket will listen on Definition at line 171 of file EventLogger.h. Referenced by EventLogger(), getLogSocketPort(), and setLogSocketPort(). reference count for logSocket -- when this hits 0, close the socket Definition at line 174 of file EventLogger.h. Referenced by EventLogger(), and ~EventLogger(). controls the level of verbosity - currently 0 through 2 Definition at line 177 of file EventLogger.h. Referenced by EventLogger(), and processEvent(). a set of state machine names which should have their subnodes monitored Definition at line 182 of file EventLogger.h. Referenced by isListening(), processStateMachineEvent(), and runCommand(). if logImage/logMessage/etc. are called during a transition, need to queue them until the transition event is complete Definition at line 185 of file EventLogger.h. Referenced by dumpQueuedEvents(), logImage(), logMessage(), logWebcam(), processStateMachineEvent(), and ~EventLogger(). if another transition occurs during the processing of another, have to recurse on processing the new transition first Definition at line 188 of file EventLogger.h.
http://www.tekkotsu.org/dox/classEventLogger.html
crawl-001
refinedweb
1,152
50.53
28 September 2009 09:26 [Source: ICIS news] LONDON (ICIS news)--Solvay has sold its pharmaceutical business to ?xml:namespace> The enterprise value includes €4.5bn in cash, additional potential payments of up to €300m if certain milestones are reached and liabilities of €400m, the company added in a statement. “This transaction is expected to be closed in the first quarter of 2010, pending the approval by relevant competition authorities,” the company added. Solvay said that once the deal is closed the company planned to reinvest in “value-added activities and strategic projects in chemicals and plastics”. Solvay’s CEO, Christian Jourquin, said: “We are building a new refocused group with the financial means to further accelerate sustainable growth on today’s strong foundations.” The planned Solvay Investor Day, which was scheduled for 29 September, had been cancelled. At 10:10 hours local time on the Euronext exchange in ($1 = €0
http://www.icis.com/Articles/2009/09/28/9250565/belgiums-solvay-sells-pharmaceutical-business-for-5.2bn.html
CC-MAIN-2013-48
refinedweb
151
53.31
Programming Tools: Java Scripting Languages Groovy's documentation provides an example that illustrates the benefits of using closures in place of anonymous classes. Using an anonymous class, we can write: Button b = new Button ("Push Me"); b.onClick (new Action() { public void execute (Object target) { buttonClicked(); } }); Using a closure, this becomes: Button b = new Button ("Push Me"); b.onClick { buttonClicked() } Another nice feature of Groovy is its "each" operator, which is used to iterate over a collection: SomeCollection stuff = new SomeCollection(); stuff.each() someClosure // for example: def myList = [1,2,4,5,6] myList.each { println it } // where 'it' is current collection item // outputs: 1 2 3 4 5 6 Groovy also has built-in structured "builders" for languages such as XML, HTML and more. Again, a simple example illustrates how natural it is to build structured text: xml = new groovy.xml.MarkupBuilder() def myList = ['acct1':['id':123111, 'type':'savings', 'balance':1234.56], 'acct2':['id':221212, 'type':'checking', 'balance':2010.02]] doc = xml.accounts() { for (entry in myList) acct(id:entry.key) { for (thing in entry.value) item(name:thing.key, type=thing.value) } } This small code fragment outputs: <accounts> <acct id='acct2'> <item name='type'>checking</item> <item name='id'>221212</item> <item name='balance'>2010.02</item> </acct> <acct id='acct1'> <item name='type'>savings</item> <item name='id'>123111</item> <item name='balance'>1234.56</item> </acct> Bindings In the following example, the use of variable c is caught at compile time in a statically defined language. Only when a is greater than b is the use of the undefined variable, c, detected in an interpreted language. a = 1 b = 2 if a > b: print c print a,b Another major difference between a compiled language and an interpreted one is when things are bound to their references. In Groovy, the following code prints "Bound to local variable": def varA = "Bound to global variable" def closure = { varA } public class C { def varA = "Bound to local variable" def closure = { varA } // bound to local varA at definition time public def f = closure // f bound to local closure }; def c = new C(); // create instance of C using new println c.f() // invoke f in C in Jython, the equivalent-looking code prints "Bound to global variable": varA = "Bound to global variable" closure = lambda: varA class C: varA = "Bound to local variable" closure = lambda self: varA f = closure c = C() print c.f() For those wanting more flexibility, the Jython/Python bindings are handier. For those wanting more stability, the Groovy implementation may be more desirable. Currying Currying function arguments is another difference. Groovy has a special "curry" mechanism to bind arguments to a function. In the following example, "foo bar" is printed: def c = { arg1, arg2-> println "${arg1} ${arg2}" } def d = c.curry("foo") d("bar") Jython inherits Python's natural ability to curry arguments using a number of techniques. One is: def c(arg1, arg2): print arg1,arg2 def d(arg2): c("foo",arg2) d("bar") Maturity Jython has been around a long time and is based on a mature language, Python. However, its development has stalled in recent years. Groovy is a relatively new language and thus still is developing. For example, its error diagnostics leave a lot to be desired. Also, at the moment, Groovy's following is much smaller than Jython's or Python's. However, both languages are picking up development activity, so you have a chance to influence both languages if you want sign of dynamic typing is a sign of dynamic typing is the following (groovy code): def foo(String s) {"String"} def foo(Object o) {"Object"} def obj = "obj" assert foo(obj) == "String" Object obj2 = "obj" assert foo(obj2) == "String" both, obj and obj2 have the static type java.lang.Object when viewed from Java, but for the function call the type String is used, as this is the runtime/dynamic type. So Groovy does have dynamic typing. A compile step is not a sign of the typing mechanism. What about BeanShell? Sometimes I wonder whether I am the only person in the world who uses BeanShell, It's a java interpreter written in java and uses java syntax (have I written "java" too many times? ;) .) I think there are two nice advantages when using BeanShell: 1) The programmer does not have to learn new syntax. 2) If desired, a more script-like syntax can be used. Also BeanShell scripts can have acess to every object within the host application, can acess all of the available java classes and runs at the VM speed (it just means I like it a lot :) .) I am not trying to make a case for BeanShell, I'm just curious to know why BeanShell has not gotten more coverage in "Java Scripting Languages" articles and learn more about the comparative advantages of using a diferent approach to java scripting. JavaScript By the way, JavaScript has nothing to do with the Java language, so it is not considered here. Historically, this statement is correct, but that is about to change. Mazilla has a javascript implementation in Java called Rhino that is slated to be included in the next major release of the JVM. And we had just convinced everyone that Java and JavaScript are not the same.... NetRexx Nice Article! I couldn't help but think about NetRexx which is Rexx built for a JVM. Rexx is an old classic scripting language from mainframes, OS/2, Amiga, Unix (sic!). It would be nice to also hear about Rexx's uses in this context, i.e. JVM scripting languages! Ciao! Good article. About your ver Good article. About your very last sentence, if someone wants to actually influence development and design decisions, go with groovy. Jython isn't going to be influenced by anyone, because it is meant to be an exact clone of CPython, nothing more, nothing less (same way with IronPython for .NET). For those comfortable with statically typed languages, scala () and nice () have some really fascinating features. Good article; a few typos I enjoyed the article. I had heard of Groovy, but not seen any examples. While the examples shown here are small, they do at least provide a little bit of flavor as to what the language is like. There are some typos, however. In the section on Closures, there is obviously some markup intermixed in the first code example. Then in the immediately following paragraph, the word "each" should have double quotes around it, but only the first one is there.
http://www.linuxjournal.com/article/8437?page=0,1
CC-MAIN-2015-11
refinedweb
1,088
62.68
Debug Guide For Web Analytics And Tag Management One. In the guide, we’ll use Google Analytics 4 and Google Tag Manager as examples. However, the guide’s topics be extended to any web analytics tools and tag management solutions out there, because the use cases are universal.X The Simmer Newsletter Subscribe to the Simmer newsletter to get the latest news and content from Simo Ahava into your email inbox! Browser developer tools Your best friend in debugging issues with your web analytics and tag management systems in the web browser are the browsers’ own developer tools. Developer tools are a suite of utilities that you can use to investigate various different aspects of the dynamic web page the user is inspecting. The image above lists the keyboard shortcuts for opening the developer tools in various browsers and operating systems. Note that on Safari, you’ll want to open Safari -> Preferences -> Advanced and check the button next to Show Develop menu in menu bar. All of the browsers above utilize a similar set of developer tools with just small differences in the UI and the chosen semantics. The most useful tools we’ll focus on are: The element inspector, which lets you look at the dynamic representation of the web page (Document Object Model). This is particularly useful for inspecting injected tracking scripts and custom HTML elements added by tag management solutions. The network debugger, which lets you inspect and analyze outgoing HTTP requests sent from the page (or embedded frames). This is one of the most important tools for you, as it will tell you the truth about what is actually sent from the user’s browser. The JavaScript console, which lets you run JavaScript code in the context of the current page (or embedded frame). Vital for recognizing issues with the JavaScript implementations of your analytics scripts. The sources browser, which lets you browse through the JavaScript resources loaded on the current page (or embedded frames). Great for identifying mismatches between what you expected the JavaScript file to contain vs. what’s actually contained within. The application storage, which lets you investigate the browser storage (cookies, localStorage, etc.) utilized on the current page (or embedded frames). Instrumental for understanding why some trackers might not be able to persist data consistently. In this section, we’ll walk through these different tools with more detail, so that you’ll have a better understanding of how to use them to unravel some of the more complicated debugging cases you run into. Note! This section uses mainly Chrome’s developer tools in examples. It’s possible the actual actions are (slightly) different in other browsers. Element inspector The element inspector lets you analyze the DOM (Document Object Model) of the page. When the browser loads the HTML source it retrieves from the site’s web server, it renders it into a dynamic tree model, accessible via JavaScript. This dynamic representation is the DOM. Whenever an analytics snippet or a tag manager interacts with the page, such as by loading a third-party JavaScript library or adding a click listener somewhere, they modify the DOM. Thus, if you have problems with your implementation, it’s useful to search through the element inspector to find what the issue could be. The element inspector is also extremely useful when you’re building triggers or variables in your tag management system with the purpose of scraping some information from the page or adding listeners to and injecting elements into the document. Here are a couple of cool tricks you can try in the element inspector. Hit CMD + F / CTRL + F to open a search bar. You can then search for a string (e.g. text content) or a CSS selector to have the inspector locate a specific element. For example, to search for all elements with the class name simmer, you can type .simmer into the search bar and the inspector will return all the matches. If you’re unsure whether Google Tag Manager actually added the Google Analytics 4 script on the page, for exampled, you could search for gtag/js to find all elements that have that particular string somewhere in them. Since GA4 is loaded from the /gtag/js?id=G-... URL, the inspector should find the GA4 script element, unless it’s actually missing. Select a specific element on the page itself You can also do the reverse. If you click the little element selector icon (this differs from browser to browser) in the developer tools panel, you can actually select an element on the page to reveal it in the element inspector. In addition to pinpointing it in the element inspector, the tool also displays some useful information about the element in question. Interact with the element context menu When you select an element in the inspector with the right mouse button, you’ll see a context menu. You can do a lot of cool stuff with this, such as: Add / edit the element’s attributes. I use this a lot to change link URLs to something else, when I want to test a specific outgoing link, for example. Edit / delete the element itself. Sometimes it’s useful to just delete an element entirely (e.g. an overlay that hides the page underneath). And sometimes you’ll want to edit the entire HTML structure of an element when you want to add new contents to it for testing a click listener, for example. Copy selector, as this lets you copy a CSS selector path to the element itself. Extremely useful when configuring triggers in Google Tag Manager, for example. Just note that the CSS selector path is usually needlessly complex, and you can trim it down to be more generic in order to avoid subtle changes in the DOM from breaking your triggers. Break on… lets you pause the page whenever the element or its subtree (nested elements) changes. This is pretty useful when you want to inspect what happens when an element becomes visible or when an element’s content is dynamically changed (think form validation error messages, for example). Change element styles When you’ve selected the element, you can change the associated styles with the developer tools. This might have marginal use for analytics debugging, but occasionally you might use it to make an element visible or move it around when you can’t find it in the actual page. Network debugger Often you’ll find that your tag management system and/or your analytics debugger extension claims that your hit has fired, but no data is collected into the vendor endpoint. At this point, you need to open the Network tab in the developer tools, as this lists all the HTTP requests sent from the browser. The network debugger is the ultimate truth. If a request doesn’t appear here, then the browser has not sent it. So if your tag management system says that a GA4 hit has fired but you see no evidence of a collect?v=2 request in the network debugger, then the hit has not been sent. It might be useful to check the Preserve log option, as this doesn’t clear the log of requests between page loads. This is very useful when you want to debug what happened on a previous page. For a more detailed walkthrough of the network debugger, check out this excellent resource. Here are some of the things you can do with the network debugger. Filter for specific requests By typing something into the filter field, you can show only the HTTP requests that match the filter. The filter searches through the request URL and the request body. When you select a request in the debugger, a small overlay opens with various tabs. Headers includes all the HTTP headers of the request and the response. This is useful for debugging things like cookies, referrer values, and where the request was actually sent. Payload contains the query parameters and the request body. Extremely important when analyzing what was actually sent to the analytics platform. Response shows what the web server actually responded with. This is often empty or nonsensical with pixel requests, but it’s useful when analyzing API responses or JavaScript files. Cookies lists all the cookies that were sent with the request and set in the response. Block a request from future loads You can right-click any request in the list and choose Block request URL or Block request domain to prevent the page from being able to send the request until the block is removed. When the resource URL (or domain) is blocked, then any requests that match the URL (or domain) will be blocked in future requests. This is extremely useful when you want to figure out which JavaScript resource is causing conflicts on the page. By blocking each one-by-one and then reloading the page, you’ll be able to pinpoint the file that causes issues. To unblock a resource, press the ESC key to toggle the Drawer, select the Network request blocking tab and uncheck the box next to the request (or delete it from the respective buttons). If you don’t see the tab, you can select it by clicking the Drawer menu (the three vertical dots) in the top-left corner of the Drawer. You can also right-click the blocked resource in the network debugger and choose Unblock…. Manually throttle the page speed If you want to test how the page loads like on a slower connection (might be useful every now and then), you can choose a throttling speed from the network tools. Remember to switch back to No throttling when done, though, or you’ll have to continue suffering with slowly loading pages. Pinpoint the initiator of the request In the Initiator column, you can see the resource or process that caused the redirect to fire. By clicking the resource in the column, it will jump to the relevant part of the developer tools to show what process initiated the request. If the initiator is (index), it means the request originated from a resource injected into the DOM, which means clicking it will open the element inspector with the element selected. If the initiator is a JavaScript file or a CSS file, for example, then developer tools will open the Sources tab with the relevant part of the source file code selected. This might not be very useful in itself, but you can use the Sources panel to add a breakpoint to the injection moment in order to replay through the stack after a page reload (more on this below in the Sources section). JavaScript console The JavaScript console lets you execute any JavaScript commands in the context of the current page. The context of the page is the DOM, and you can use DOM methods to interact with page elements. Here are some use cases for the JavaScript console. Inspect logs Many tools output debug messages to the JavaScript console, so the first course of action whenever you run into trouble is to open the JavaScript console to see if there are any relevant errors shown. It’s a good idea to add some console.log(msg) calls in whatever code you add yourself via a tag management system, for example. That way you can debug the log output in the JavaScript console – often this is the easiest way to debug code execution. Check the value of global variables In browser JavaScript, global variables are stored in the window object. If you want to check whether a global dataLayer array exists, you can simply type window.dataLayer and press enter. If the console shows undefined, it means that dataLayer does not exist in global scope. You can also set new global variables simply by initializing them in the window object: window.myGlobalVariable = "Hello, I am a global variable."; Add an event listener with a breakpoint This is a cool trick. Whenever any JavaScript that runs on the page uses the debugger; keyword, the page will pause and you will be diverted to the Sources tab where you can then walk through the stack (more on this below). If you want to try this out, you can add a click listener on the page with debugger; in the callback. Then, when you click anywhere on the page, the execution will pause and you’ll be taken to the Sources tab. window.addEventListener('click', () => { debugger; }) Change the context to an iframe The JavaScript console is initially bound to the context of the top frame (the URL the user is currently navigating). If the page embeds other content in iframes, you can use the frame selector in the console to change context to the iframe. This is, of course, particularly useful when debugging embedded content such as third-party shopping carts or widgets. Note that the frame selector is confusingly in different parts of the developer tools across different browsers. The screenshot above is from Chrome (and it’s the same on Edge). With Firefox the context picker is in the top-right corner of the developer tools, and with Safari it’s in the bottom-right corner of the developer console. Sources The sources panel can be game-changing but it can also be very overwhelming to use. The panel lists all of the subresources (images, scripts, frames, etc.) loaded on the current page. The list is sorted by URL, starting with the origin and then drilling own to paths and files. The sources panel would deserve a separate article in itself due to the many, many different things you can do with it. However, here I’ve listed some of the most useful things you can tamper with. Open a file, pretty-print it, and search through it When you open a minified JavaScript file (as they tend to be in order to save space and bandwidth), the panel prompts you if you want to pretty-print the file. Always do this. By pretty-printing the file, the code is displayed in a more readable format, even if the code itself is still minified. You can then hit CMD + F (or CTRL + F) to open the search bar. The search will look through the formatted file for all references to the searched string. Add a breakpoint to the file A breakpoint is an instruction for the brower to halt page execution and allow the user to see the exact state of the page at the time of the breakpoint. To add a breakpoint, open a file in the Sources panel, right-click the row number you want to halt execution on and choose Add breakpoint. When you then reload the page (or cause the code to be evaluated some other way), the browser will stop at the breakpoint and give you bunch of options how to proceed. Some useful tools here include: Look through the Scope list. Here are listed all the variables in Local (current function context) scope, Closure (scope of the function that initiated the closure code), and Global scope. Walk back through the Call Stack menu, as this will let you inspect the full execution thread all the way to where it was initialized. This is a great way to find just where the JavaScript started breaking down. Use the step methods (see screenshot below) to continue progressing through the code, pausing after every line. To remove the breakpoint (good idea once you’re done debugging), expand the Breakpoints list and uncheck the breakpoints you want to deactivate. Search through the sources Sometimes it can be useful to simply do a string search through the sources. For example, if you find GTM’s dataLayer is overwritten, you could even search for something as simple as dataLayer= in order to find if it’s been overwritten by custom code in some other file. You can find the search tool by opening the Drawer (press ESC) and selecting the Search tab. Here, you can do a string search and developer tools will search through all the source files for a match. If you do find a match, you can click it to jump to the relevant part of the source file. Add local overrides This can be extremely helpful in testing your page. You can actually edit / add / remove things in the page HTML or the linked JavaScript resources by adding local overrides. When you give the browser permission to write local overrides, you can then freely edit any of the files in the Sources panel, save them, and when you reload the page the saved and modified file will be used instead of the one loaded over the network. In Chrome, you’ll see a little purple button next to the file if it has a local override. To stop using overrides, just open the Overrides tab in the Sources panel and uncheck “Enable Local Overrides”. Application storage The application storage tab shows all the browser storage used on the current page (and in embedded frames). This includes things like cookies, localStorage, and sessionStorage. You can use this tab to create, edit, and delete items in browser storage. It’s a great resource to identify problems with persistence in your analytics tools, for example. Here are some of the things you can do with application storage. Inspect first-party and third-party storage It’s a bit confusing, but you can see multiple domains in both the navigation column as well as in the actual storage list. First, all the domains listed in the navigation column ( simoahava.com and gtmtools.com in the screenshot above), represent URL origins loaded in frames. For example, in this case simoahava.com was the URL of the top frame, and the page I was on loaded an iframe from gtmtools.com. In the Application tab I can choose gtmtools.com to inspect the cookies of that particular context. In the list of cookies, on the other hand, if you see multiple different domains listed it’s because the page is sending requests to these domains. If the browser supports third-party cookies, you’ll see all the cookies set on the domains the browser is communicating with. If the browser blocks third-party cookies, you’ll only see cookies set on the site of the top frame (the URL the user is browsing). Create, edit, and delete storage By clicking any storage entry and pressing backspace / delete, you can remove that particular item from the browser storage. You can edit any storage values by double-clicking the value you want to edit in the relevant column. You can create a new cookie (or other storage entry) by double-clicking the empty row at the bottom of the storage list. You can then input any values you want into the columns. Debug web analytics implementations Once you have a feel for the developer tools, you can start debugging actual issues with your implementations. Please note that since the scope of things you can do with JavaScript is so immensely vast, it’s impossible to exhaustively list all the things that you should do when debugging your setup. In this chapter, I’ve listed some of the more common ways to approach implementation issues. If you have other, common use cases you think should be listed here, please let me know in the comments! Check browser cookies Many analytics tools utilize browser storage to persist things like user and client identifiers. Google Analytics 4 uses the _ga and _ga_<measurementId> cookies to store information about the user and the session, respectively. If you see too many (or too few) users in your GA4 data compared to the count of sessions, for example, it might be that there’s something wrong with the browser cookies. So open the Application tab and look for _ga. If you don’t find any cookies with that name or prefix, it’s possible that there’s something wrong with your implementation and the cookie is either not being set or it’s being set incorrectly. A typical mistake is overwriting the cookie_domain field with something incorrect. The tracker tries to set the cookie on an invalid domain and the cookie write fails. It might be useful to have the GA Debugger extension enabled, as the JavaScript console will inform you if the cookie write failed for some reason. Another very common reason for cookies failing is because the page is actually running in a cross-site embedded iframe, and due to third-party cookie restrictions the page is unable to set the cookies correctly. Filter network requests You’ll also want to look through the network requests to see if your endpoint is actually receiving the data. Google Analytics requests are sent to the /collect path, with the domain or analytics.google.com (latter if Google Signals is enabled). If you see a request to /collect with a status code of 200, it means that your request was most likely collected by the endpoint successfully. If you see an aborted request (or some other error), it’s typically because the request happened just as the user was navigating away from the page (although this is less common with Google Analytics 4). If you don’t see the request at all, it means that something is preventing the request from being dispatched. Again, using the GA Debugger extension is a good idea, because the extension logs information into the console that might be of use. Identify conflicts in global methods Sometimes, rarely, the global methods used by your web analytics tool have been overwritten by some other tool. This is a constant danger when using global methods, and Google Analytics using the ga namespace for Universal Analytics is an example of a global name that can easily be taken by some other, unrelated tool. Sometimes it’s difficult to find issues with the global namespace, because using tools like Google Tag Manager might make global methods irrelevant. But if you’re having trouble with your requests working, you can always check if the global methods that your tool uses (e.g. ga, gtag, dataLayer) are either undefined or set to something that doesn’t resemble your analytics platform code at all. Note about iframes If you embed content in a cross-site (or third-party) iframe, remember that anything that happens in the iframe happens in third-party context. This means that if you’re running Google Analytics in the iframe, it will not work because by default the GA cookies are not treated in a way that would make them work in third-party context. You’ll see the Cookie write failed error message in the console when using the GA debugger, if this is the case. Furthermore, even if you update the cookies to use the required samesite=none and secure flags, browsers like Safari and Brave outright block third-party storage. Debug tag management solutions Since tag management solutions are more like a framework for deploying analytics and advertising pixels, if they fail then everything that’s loaded through them fails too. In this chapter, we’ll take a look at some of the ways you can debug a TMS implementation gone awry. Check Data Layer queue for conflicts First, if you’re seeing issues with your setup, check if the global dataLayer queue has been overwritten or is otherwise compromised. With Google Tag Manager, type dataLayer.push into the console and check what it returns. If it outputs something like [native code], it means that dataLayer has been reset to its initial state, and Google Tag Manager’s listeners no longer work with it. Alternatively, if you see something other than a variation of the below, it means that dataLayer has possible been overwritten in a way that doesn’t correctly work with GTM. This is a difficult scenario to debug, and requires that you add a breakpoint to the dataLayer processing in order to see if some other tool is cannibalizing the array and not passing the arguments to GTM. You can mock this with something like: window.dataLayer.push(function() { debugger; }); Then step through the stack and see if the gtm.js library is ever visited when stepping through the methods. If GTM is never referenced, it means that some other tool has taken control of dataLayer and you need to resolve this conflict elsewhere. This is a notoriously difficult scenario to debug, so you just need to patiently look through the Sources to find the culprit. Search for references to dataLayer, for example. Block JavaScript files one by one in the network debugger to find the one that is causing the conflict. Search through the element inspector Sometimes it might be useful to search through the element inspector to find the Custom HTML tags and script elements injected by Google Tag Manager. You can simply search for a string that you know to be within the injected code, but just remember that Google Tag Manager minifies all injected code automatically, so searching for a specific variable name might not be very useful. Search for content within strings or script URLs instead. If you don’t see any references to the elements you’d expect GTM to inject, it means that GTM did not add those elements to the page. Typically this is because the tag never fired or the tag was misconfigured. Sometimes it can be because of a CSP conflict that you need to resolve. Look for requests in network tools With GTM, too, it’s always useful to look for requests in the network tools. This is always the ultimate truth when it comes to debugging the end-to-end flow of pixel requests. If Tag Assistant says that the tag fired but you can’t see anything in your analytics platform, then you need to open the network debugger and see if the request was ever sent. Remember to check Preserve log to make sure that the requests aren’t gobbled up by page navigation. If you don’t see the requests anywhere, it means that the tags never managed to dispatch them. Note that this is only the first step of potentially a very complex debugging flow, because there can be a million different reasons for a failed request. Sometimes you do see the request but you still don’t see data in your analytics tool. In this case, meticulously sift through the headers and the payload of the request to see if it has all the information you expect it to contain. Search through sources Finally, searching through sources can be very useful in identifying issues with your tag management system. With GTM, it’s often the case that the version wasn’t actually published to the live environment but rather to a staging context. It might be useful to take a tag that you expect the most recent version to have, and then search for something in that tag’s code (an ID, a parameter, a key-value pair) within the gtm.js library. Sometimes searching through the sources is an exercise in futility, especially because the code is so minified that you can’t make any heads or tails of it. Trying to narrow down with more specific search terms often helps. Useful browser extensions I’ve already mentioned GA Debugger above, but there are other useful extensions you might consider installing in your browser (Chrome, most often) which make debugging your analytics setup a breeze. Many of these extensions take the existing capabilities of browser developer tools and hone them to suit a specific set of use cases in the analytics world. I still recommend to always use developer tools as your main tool of choice, but do take a look at these extensions and see if they could help alleviate some of the pain of debugging your analytics or tag manager implementation. GTM/GA Debugger David Vallejo’s Chrome extension, GTM/GA Debugger, is certainly the most ambitious and the most impressive browser extension for debugging Google Analytics and Google Tag Manager implementations. The feature set is so incredibly rich that it doesn’t make sense to go through all the functionality here, but here’s just a short overview of things you can do with the extension: - Block GA3/GA4 hits - Inspect server-side tagging hits - Export as a table, copy objects - Enhanced ecommerce reports - Analyze dataLayer and the outgoing requests - Show POST data in a meaningful way - View all dataLayermessages (not just the ones sent on the current page) Everything is just displayed so nicely and so intuitively. You don’t have to sift through complicated headers and messy payloads – it’s all visually displayed in rich tables and with purposeful structure. GA Debugger GA Debugger is the official Universal Analytics, Google Analytics 4, and Google Tag Manager debugger. It outputs information about the aforementioned platforms into the console. I love this tool because once the information is in the console, searching through it is easy with the JavaScript console’s own search tools. The GA Debugger helpfully informs you why something went wrong rather than just showing a non-descript error message. Naturally, in some cases you still need to continue investigating, but the console output can be very helpful in collecting the initial set of leads for your research. Note! This extension doesn’t work if you load your files from or collect hits to a server-side endpoint. Live HTTP Headers Live HTTP Headers is my favorite extension for debugging HTTP traffic. It’s an easy way to inspect the headers of all the HTTP requests dispatched by the browser. Although today you can get pretty much all the same information in the network debugger of the developer tools, I still prefer the visual output of this extension and use it diligently whenever I want to quickly look through redirects or HTTP headers. Summary Even though this article is long and full of words and pictures, it covers only a fraction of the approaches you can take when debugging your analytics and tag management implementations. The idea wasn’t to list everything that can go wrong and give you the solution how to fix it. Instead, the purpose of this guide is to give you the tools and the confidence to start collecting leads for your own investigations. Debugging the complexity of what happens within a web browser is a daunting task. But the debugging steps themselves are often very predictable and can be repeated from one scenario to the next. My workflow is pretty simple: - Always start with inspecting the network requests. Try to find the requests that you’re debugging. If you find them, look through the headers and the payload to see if they contain the data you expect them to have. - Search through the sources to find inconsistencies in the libraries you use (particularly Google Tag Manager). If you can’t find references to a specific tag you expect to be in GTM, it means that you might be previewing the wrong version or that you never actually published a version. - Look through cookies to see if the values used by your analytics tool persist from one page load to the next. If the values change, then it means that the cookies are being reset or overwritten for some reason (typically a consent management platform is to blame). - Utilize the element inspector especially when you are certain that the page should include some element or tag deployed through Google Tag Manager. If you have additional ideas for the debugging flow that you think should be included in this guide, please let me know in the comments. What are your favorite ways of debugging analytics and tag management solution issues?
https://www.simoahava.com/analytics/debug-guide-web-analytics-tag-management/
CC-MAIN-2022-05
refinedweb
5,311
59.53
I don't want to interfere with all the things that already have been stated correctly, but I think I should clarify (at least superficially) some things about the relation between native C++ and managed C++ (IOW C++/CLI) before even more confusion arises... Originally Posted by 2kaud If Friedman is the name of the "solution/project" then this is not a namespace and hence using namespace Friedman; is incorrect and should not be included. That's not exactly true for Windows Forms application projects. When the VC++ IDE sets up such a project, it creates a namespace with the same name as the as the project. I usually call that the "application namespace", but I think that's by no means an official term. The main form class (Form1) is defined in that namespace, but for any other classes (except for forms created by the IDE), the developers need to take care of that themselves. Originally Posted by Paul McKenzie How are you going to learn the advanced topics if you don't know the basics, such as namespaces? You can't cherry-pick certain topics in C++ and expect to get anything useful done. You have to know the basics before going on to do anything else in C++. [...] So true, so true... While not even native C++ really is a language meant for beginners, C++/CLI is even less. One might say that C++ is a language for those who know what they're doing, and C++/CLI is one for those who know even better. (By which I don't mean to say that C++/CLI is in any way superior to native C++. But it definitely is more demanding in some aspects.) One word directly to the OP, Protocol: MFC is sort of the canonical way of writing native C++ Windows GUI apps, but the Express Edition doesn't provide that. So the only way to write Windows GUI applications with the Express, except for Petzold-Style raw Win32 programming (rather tideous) or 3rd-party libraries, is Windows Forms. But if you pick that, stick with it. Mixing managed and native code in C++/CLI is possible, and in fact the probably primary advantage of C++/CLI, but it's strongly discouraged unless you have a really good reason to do that, especially for beginners. Such combinations result in "interop scenarios" which can be really, really advanced and cause unexpected and complicated difficulties. If you make your decision for Windows Forms and C++/CLI, feel free to post in the dedicated forum section. But, as already mentioned, I strongly recommend against mixing that with native C++ without a good reason. Last edited by Eri523; January 27th, 2013 at 11:41 PM. Reason: Small but important semantic
http://forums.codeguru.com/showthread.php?533753-Trying-to-create-a-vector-using-a-structure-definition-as-the-basis-in-VC&p=2102775&mode=threaded
CC-MAIN-2017-09
refinedweb
461
60.55
Rechercher une page de manuel ungetc.3posix Langue: en Version: 2003 (ubuntu - 16/08/07) Section: 3 (Bibliothèques de fonctions) Sommaire NAMEungetc - push byte back into input stream SYNOPSIS #include <stdio.h> int ungetc(int c, FILE *stream); DESCRIPTION. RETURN VALUE Upon successful completion, ungetc() shall return the byte pushed back after conversion. Otherwise, it shall return EOF. ERRORS No errors are defined. The following sections are informative. EXAMPLES None. APPLICATION USAGE None. RATIONALE None. FUTURE DIRECTIONS None. SEE ALSO fseek() , getc() , fsetpos() , read() , rewind() , . compte 10000 lignes de C -- Jayce - Le pascal, c'est plus fort que toi -- Contenus ©2006-2009 Benjamin Poulain Design ©2006-2009 Maxime Vantorre
http://www.linuxcertif.com/man/3/ungetc.3posix/
crawl-002
refinedweb
109
62.14
People reading the OpenGL ARB minutes are cautioned that statements made by attendees do not represent official company positions unless explicitly identified as such. Discussion and final feature set selection for the next revision. ISVs are using this and seem happy with it. Only negative feedback was from someone using thousands of tiny VBOs and unhappy with performance implications on some platforms. VOTE for inclusion in the core: 10 Yes / 0 Abstain / 0 No, PASSES unanimously. Some objection to including this in the core, in part because requested precison of shadow maps may not be satisfied, making it hard for "equal" operations to succeed. VOTE for inclusion in the core: 4 Yes / 4 Abstain / 2 No, PASSES by supermajority of non-abstainers. We are considering the HLSL + 3 extensions as a package. Discussion: participants already reviewed Working Group output and commented, WG responded. NVIDIA has a number of issues: Similar to issues in the superbuffers WG. That spec allows control of clamping behavior at various points in the pipe, decoupling clamping from range of the destination buffer. Suggests removing clamping in programs and introducing a separate GL extension which only controls clamping behavior. Will alter so compiling doesn't block and can query results later. Likewise will alter linking to block if necessary for previously compiler code. Will alter the functions passing strings between server and client so they pass buffers of specified maximum size instead of strings. This allows fast path implementations, but other implementations can still do error checking. First proposal is simply to require error checking; this could be relaxed later. Later, more complex proposal is to agree that per-primitive attributes are inherently inefficient (due to requiring Begin/End instead of vertex arrays), so it makes more sense to make vertex attributes fast path and make uniforms more in line with traditional GL error checking and type conversion behavior. 0 This should be eased by proposed changes in string handling. Provisional straw poll: assuming we like the updated spec JohnK and Bill will come back with tomorrow, will we vote the HLSL+extensions in as ARB extensions? VOTE for provisional approval as ARB extensions: 8 Yes / 1 Abstain / 1 No, PASSES by supermajority of non-abstainers. Nick suggests folding both these and the HLSL extensions into a new "programmable shading" appendix to the core spec, but doesn't feel it's appropriate to place either group into the core. VOTE for inclusion in the core: 1 Yes / 0 Abstain / 9 No, FAILS. Need to decide how to handle this short of the core; possibilities include making them an optional feature set (like ARB_imaging), or Nick's proposal. Spec wasn't updated to address clipping of point sprites. Nick would be OK with specifying ATI's desired behavior (sprite clipped with its provoking vertex). Several other minor open issues; assuming they are resolved, will people vote for this functionality in the core? Straw Poll for inclusion in the core: 9 Yes / 1 Abstain / 0 No, PASSES by supermajority of non-abstainers. Nick will form a small WG and try to come back with an updated spec tomorrow, or at worst within a week. Updated extension spec proposal posted recently. Changes from NV spec this was based on: size of counter (24/32 bits); whether implementation counts pixels, or samples; asynchronous behavior (does not flush); sharing amongst contexts (not shared, like histograms). Intel objects to including this in the core (their scene-based hardware won't support it). VOTE for approval as an ARB extension: 9 Yes / 1 Abstain / 0 No, PASSES unanimously (excluding abstainers). How to try and get this into the core? Seems too small to do as an optional subset. Called a straw poll contingent on someone coming up with a "caps-bit like" interface that would let Intel claim to support it. Rob then suggested that we could change the spec to allow supporting counters with zero bits and calling out in the spec that query functionality should not be used in this case. Under these conditions, the core vote is: VOTE for inclusion in the core: 7 Yes / 1 Abstain / 2 No, PASSES by supermajority of non-abstainers. The ARB extension will be likewise modified. Rob Mace reviewed the version 0.22 spec and he and Kurt discussed some remaining issues - see Rob's notes for details. Meeting in closed session, the permanent members renewed Matrox and Apple as Auxiliary members for another one-year term. No Auxiliary members were promoted to Permanent status at this time. Jeremy Sandmel reviewed their specs, including not just texture rectangle, but "non power-of-2" 1, 2, and 3D textures including mipmaps and cubemaps. VOTE to approve ARB_texture_non_power_of_two: 11 Yes / 0 Abstain / 0 No, PASSES unanimously. VOTE to approve ARB_texture_non_power_of_two_2D: 2 Yes / 6 Abstain / 3 No, FAILS. ATI and Intel will continue discussions on making this into an EXT extension. VOTE to promote EXT_texture_rectangle to ARB: 4 Yes / 1 Abstain / 6 No, FAILS. Neil Trevett (Khronos secretary) and David Blythe (OpenGL spec editor) reviewed status of the OpenGL ES spec. They are near completion and expect approval by SIGGRAPH. Khronos requested the ARB approve additions to the core OpenGL namespace to support Khronos, adding a GLfixed type to represent fixed-point integers and using the x 'x' type designator for variants of existing core GL calls taking GLfixed parameters. VOTE to approve Khronos use of specified core namespace additions: 11 Yes / 0 Abstain / 0 No, PASSES unanimously. Updates to NV_point_sprite: Mark has made changes per yesterday's discussion. Will email out and call email vote ASAP. Updates to ARB_occlusion_query: Nick updated spec per yesterday's discussion and emailed it out. Will further update lack-of-meaning of results when there are zero bits of occlusion counter. Updates to HLSL extensions: JohnK and Bill updated per yesterday's discussion and circulated printouts. Decision on core/extension status of the OpenGL Shading Language: VOTE for approval of the OpenGL Shading Language and extensions as ARB extensions: 8 Yes / 2 Abstain / 1 No, PASSES by supermajority of non-abstainers. VOTE for immediate promotion of the OpenGL Shading Language and extensions to the core: 6 Yes / 1 Abstain / 4 No. The result was a simple majority of non-abstaining YES votes, but not a supermajority. Interpretation of this vote required some care since final spec approval requires a supermajority vote, while consideration of features for the final spec requires only a simple majority. Because the NO votes were strongly held, we expect that trying to approval a core revision including the shading language would carry extremely high risk of failing to approve the spec. We will therefore not include the shading language into the core at this time, but instead drive a new core version as soon as there's more experience with the extensions, perhaps as soon as this fall. As previously agreed in the marketing working group, we will call the new core revision OpenGL 1.5, reserving OpenGL 2.0 for a future core revision including the shading language. Dave Zenz and the WG members worked through some of the remaining open issue list - see Dave's notes for details. Rob Mace noted that effects of changes to shared objects are usually poorly defined. GLX spec talks about explicitly undefined behavior WRT shared textures, but that's not very satisfactory. Extensions have similarly been punting on this issue. This came up during Rob's work in the superbuffers WG, but is more general. If we create a WG addressing this, we may want to define a window system-independent definition of sharing behavior, rather than write it into the AGL / GLX / (nonexistent WGL) specs. Will call for a WG leader on the participants' list, since Rob is overburdened already. Examples are much more useful if they don't remove the 'gl' affix in source code (unlike the convention for spec language). We should just leave them in. Kurt volunteered to update the extension-writing template. We agreed to fold both the low-level and HLSL extensions into the extensions appendix of the OpenGL 1.5 spec. Some discussion about versioning - does the shading language have an extension string? Not today; it's implicit in the presence of the HLSL extensions. In the future, if we revise the language, we'll add a new extension defining some enum. We agreed to define an extension name string which would indicate the presence of version 1.00 of the OpenGL Shading Language. Tentatively this will be "GL_ARB_shading_language_100". Dell will host the September 9-10 ARB meeting in Austion; further details TBD. Sun will host the December 9-10 ARB meeting in Silicon Valley. Thanks to Apple for hosting this meeting!
http://www.opengl.org/about/arb/meeting_notes/notes/meeting_note_2003-06-10.html
crawl-001
refinedweb
1,450
54.93
A Tag cloud is a visual representation of text data. In this tags are words, where the importance is highlighted using colour or font size. This is very popular now to analyse contents of websites. This helps in quickly perceiving the most important words. The importance is calculated by counting the number of occurance. Thus based on occurance, weightage is given to each word(tag). After analysing the whole text, it is displayed based on it weightage. Thus tag cloud will be generated. open cloud is a java library for generating tag clouds. Here I used Open cloud library for the generation of Tag cloud. Normally we need a webserver for getting a good UI of the TagCloud, here we are displaying the cloud using Swing. This is a sample program for the generation of a simple tag Cloud. For this download the Open Cloud Library. package tagcloud; import java.util.Random; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingUtilities; import org.mcavallo.opencloud.Cloud; import org.mcavallo.opencloud.Tag; public class TestOpenCloud { private static final String[] WORDS = { "amal", "india", "hello", "amal", "birthday", "amal", "hello", "california", "america", "software", "cat", "bike", "car", "christmas", "city", "zoo", "amal", "asia", "family", "festival", "flower", "flowers", "food", "little", "friends", "fun", "amal", "outing", "india", "weekend", "india", "software", "me", "music", "music", "music", "new", "love", "night", "nikon", "morning", "love", "park", "software", "people", "portrait", "flower", "sky", "travelling", "spain", "summer", "sunset", "india", "city", "india", "amal", "uk", "usa", "", "water", "wedding","cool","happy","friends","best","trust","good", "enjoy","cry","laugh"}; protected void initUI() { JFrame frame = new JFrame(TestOpenCloud.class.getSimpleName()); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel panel = new JPanel(); Cloud cloud = new Cloud(); Random random = new Random(); for (String s : WORDS) { for (int i = random.nextInt(50); i > 0; i--) { cloud.addTag(s); } } for (Tag tag : cloud.tags()) { final JLabel label = new JLabel(tag.getName()); label.setOpaque(false); label.setFont(label.getFont().deriveFont((float) tag.getWeight() * 10)); panel.add(label); } frame.add(panel); frame.setSize(800, 600); frame.setVisible(true); } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { new TestOpenCloud().initUI(); } }); } } I Amal I liked example for generating TagCloud, I need a little help I want to do the same from an REST URL which is given for lets say a social networking site and which returns a JSON object. I am new to Java and dont know much about it. It would be really helpful if you could help me with anything in this regard. Hi, If your requirement is to get the data from a JSON and visualize in tag cloud, it is very simple. Just write a program to read the url and get the JSON, parse the JSON, get the contents, pass the contents to the tag cloud program. If your requirement is to get the interactions using JSON, ie input as well as output. Write a Service on top of this method. Writing a service is very simple using python. You can use tornado library in python Thanks Amal, I will definitely try the approach suggested indeed the steps explained by you seems to be helpful.
https://amalgjose.com/2013/04/27/simple-tag-cloud-generation-using-java-program/
CC-MAIN-2020-50
refinedweb
521
59.09
Source for .NET API Hello, can you publish the source code for this shiny software? I would really like to use the API for my private webinterface / .NET API. If you can't publish, can you point me into the right direction how to create my own API? I already tried slice2cs and got my murmur.cs file but I don't know how I can access / use the classes. If would be enough if you provide an example how I can get the Servers running in the default ICE connection. Would really appreciate your feedback. I thought about that. It's needed some tuning and documentation but now I busy on other projects. I can't promise but I hope I'll publish sources on GitHub when I'll return to the project. We have great plans to make it base for a new web project. The main problem for .NET Ice implementation is you must use Murmur.icethe same version as a Murmur server you connect to. I've made MurmurAdapter.dllfor that and MurmurXXX.dllfor each Murmur version, and MurmurPlugin.dllas a wrapper on Ice connection and classes. It's easier use than direct Ice methods. If you need not need dynamic version switcher then you can add only MurmurPlugin.dlland MurmurXXX.dllinto your project references. Don't forget place Ice.dllnear your program executable. Usage example (replace address, port, secret): Thanks for you fast response. Can't you release an unfinished project? I'd really like to contribute to this project. I know that it must use the same Murmur.ice as my server version. I used the following command on linux to generate the Murmur.cs for my 1.2.8 instance: I copied the file into my c# project but I can't find the Instance Method within the Murmur Namespace / File. Did I miss some command when I created the .cs file? What command parameters did you use?. See this gist for my Murmur.cs: I'm talking about DLLs that are distributed with Yulli. For now I can't release unfinished project. If you use my code above you should not use Murmur.cs that is generated using slice2cs. For instance, If you reference Murmur128.dllthen you should replace Murmurnamespace to Murmur128in my code example.
https://bitbucket.org/HarpyWar/yulli/issues/10/source-for-net-api
CC-MAIN-2017-47
refinedweb
383
79.36
DOM (document object model) is a cross-language API from W3C i.e. World Wide Web Consortium for accessing and modifying XML documents. Python enables you to parse XML files with the help of xml.dom.minidom, which is the minimal implementation of the DOM interface. It is simpler than the full DOM API and should be considered as smaller. Steps for Parsing XML are – - Import the module import xml.dom.minidom Let say, your XML files will have the following things, - Use the parse function to load and parse the XML file. In the below case docs stores the result of the parse function docs = xml.dom.minidom.parse("test.xml") - Let’s print the child tagname and nodename of the XML file. Python3 Output: #document info - Now to get the information from the tag-name, you need to call dom standard function getElementsByTagName and getAttribute for fetching the required attributes. Python3 Output: #document info 4 skills Machine learning Deep learning Python Bootstrap Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics. To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. Recommended Posts: - How to Parse and Modify XML in Python? - Read, Write and Parse JSON using Python - NLP | Using dateutil to parse dates. - Create XML Documents using Python - Python | Parse a website with regex and urllib - Python | How to Parse Command-Line Options - Python | Execute and parse Linux commands - How to Parse Data From JSON into Python? - XML parsing in Python - Python - JSON to XML - Python - XML to JSON - Serialize Python dictionary to XML -.
https://www.geeksforgeeks.org/parse-xml-using-minidom-in-python/?ref=lbp
CC-MAIN-2020-50
refinedweb
269
64.71
Journal tools | Personal search form | My account | Bookmark | Search: ...number 2 domain place stay.co.za dvd to mpeg freeware nokia x.tk ericsson mp3 player sony buffalo ny area apartments for rent area content reading syllabus vacca vacca council tax uk students mac os x freeware backup active gif creator crack cobra kissing snake simple interest loan... ... projector pt 1998 firebird specs reading festival 2007 burn in mode old... 01 02 2006 ar2006020100348.html article content dyn washingtonpost.com wp ... saint martin of tours brentwood area central home lakefront sale longford ... dinahs garden hotel palo alto article costing job 1992 525i bmw ... fruit stands boiled peanuts orlando area office 2004 mac reviews 2006 ... ... medical waste hearing impaired shelter tusa platina evolution ...mind body spirit care assignments mst reading week eye.info laser lasik lasik...line manholes precast steam bad decision article pluto truck accident attorney news information... timezone abuse information substance surface area triangular pyramid adidas shoe among ... ... gang of four mp3s yosemite area regional transportation system nitrosamines structure ... deep blue something mp3 adult content shop web waubay lake fishing...tropical storms how to find area code the truth music...jobs being blood effect pressure reading sick bend cooker slow versatility...oak theater thousand baltimore metropolitan area bring the boy back home... ... adventure computer download free game intervention program reading that work composing nokia ringtones holidays to ... telephone code finder uk success in business alpinestar leather suit article content directory sell a used prs guitar... wallet crowley food math definition for surface area most corrosive substance bbc smile homepage my ... ...touch tab razorlight tiny dancer video us bankruptcy court indiana business education content area test center columbus skill how does the moon affect tides cleaner free...mortar spider web quilt pattern td summer reading program credit card secure hosting monitor to... company uk job tamu wildlife bay area california rentals glue make stick eye soap... ...glint in his eyes. Now, if you’ve been reading my chronicles all along, you know you can’t... regions, getting quite a good feel of the area. "You shaved here, as well?" "Everything from toes... one hand, he ripped open his last remaining article of clothing, releasing his beautiful manhood at last. ... moose sounds like, of course, whether enraged or content. But he sounded as I imagine one would when... ...home resume start powder ridge ski area in ct quarter panel repair brand...dogs in texas new jersey core content curriculum standards discount ink cartridges for...philadelphia international airport home insurance pennsylvania reading portland or rental property alaskan canned...rich ohio weimaraner breeders mxlogic germany content filtering texas state council swimming ... ... welding rod lawsuit attorneys 19th engine gasket hole jeep mud toe buy guided lesson reading wedding cake with gold leafing oregon river maps attract women tips best buy engagement...madison cable corporation judge of the dead elemental composition human body pajarito mountain ski area black cat crossing soukyuu no fafner anime phantom of the opera film lyrics ... ... adobe photo shop 70 plugins christian sermon online reading strategies elementary education seismic design criteria smoking mistresses toy... in las vegas il frantoio della pieve elementary reading school strategy teacher import car yards in brisbane ... party song adtsecurity bed and breakfast and boston area white fillings vs silver fillings the small things ... Cgi Bin Dasp Content Tou Area Article Content In Reading Content Article On Reading In The Content Area Content Filtering Area Content Reading Vacca Content Management Area Business Content Education In Reading Content Management Software Area Content Reading Content Management System Area Content Reading Strategy Content Provider Area Content Reading Writing Content Rating Area Best Content Practice Reading Html Head Meta Http Equiv Refresh Content 0 Url Http Area Content Reading Teaching Questionable Content Software By Content Result Page: 1 2 3 4 5 6 7 8 9 for Area Article Content Reading
http://www.ljseek.com/Area-Article-Content-Reading_s4Zp1.html
crawl-002
refinedweb
640
57.06
27 May 2011 09:41 [Source: ICIS news] FUKUOKA, Japan (ICIS)--Japan’s Mitsubishi Chemical Holdings Corporation (MCHC) plans to restart its 120,000 tonne/year bisphenol A (BPA) plant at Kurosaki at the end of June, a company source said on Friday. The company had originally scheduled a turnaround of the plant for one month in early June. However, the company shut down the plant in the middle of May instead because of a shortage of feedstock phenol, said the source. The source was speaking at the sidelines of the Asia Petrochemical Industry Conference (APIC), which is being held at ?xml:namespace> The company will restart the plant at the end of June, the source said. MCHC operates a 100,000 tonne/year BPA plant at Kashima. The BPA unit and an upstream phenol/acetone plant at the same site were taken off line after the earthquake and tsunami which hit northeastern The phenol/acetone plant can produce 250,000 tonnes/year of phenol and 150,000 tonnes/year of acetone. The company plans to restart the Kashima-based BPA and phenol/acetone plants at the end of June, the source said. For more on bisphenol A
http://www.icis.com/Articles/2011/05/27/9463892/apic-11-japans-mitsubishi-chemical-to-restart-bpa-plant.html
CC-MAIN-2015-18
refinedweb
198
67.89
0 Members and 1 Guest are viewing this topic. ...it's much more efficient to generate perfect numbers from Mersenne primes than by factorising each positive integer. Is that an offer? :p Yours can still be improved though as your primeality test is fairly simplistic - perhaps by dividing by primes less than the square root of the number of interest, rather than potentially by all integers >= 3. Or even just dividing by odd numbers.Chet T16 - the code I posted was intentionally a bit simplistic but if you are a beginner in C programming it is probably worth making sure you understand it, then make sure you understand _Sin's. Then see if you can spot the (obviously deliberate ) errors of coding style in both - there are things in _Sin's that I would reject at code review. There again there are things in mine that I would also question now that I re-read it. No-one's perfect!! #include <stdio.h>void main() { int i = 2; int numfound = 0; int factorsum; int j; int hold[1000000]; // Probably doesn't need to be this big but whatever... int cv; while (numfound < 6) { factorsum = 1; for (j = 2; j < i; j++){ if (i % j == 0) { if (hold[j] == 0) { factorsum +=j; hold[j] = 1; } if (hold[i/j] == 0){ factorsum += i/j; hold[i/j] = 1; } } } if (factorsum == i) { printf("%10d\n", i); numfound++; } for (cv = 0; cv < 100000; cv++) { hold[cv] = 0; } i += 2; // Assuming all answers will be even }} find the best possible way of factorising large numbers
https://www.eevblog.com/forum/chat/c-coding-competition-win-an-arduino/25/
CC-MAIN-2019-51
refinedweb
260
64.14
I am working on a home made shell (very simple shell). I have decided to take the route of using execvp as my path is not a changeable element for my shell. I am running into an issue with coming up with the logic on how to fork and exec multiple processes at once. My program should work with a command as such: ls ; echo hello ; cat shell.c A. Intake full command line into char array with a grab line function B. Split the char array received from the last function by delimiters and place into an array of char arrays (pointer to pointer). C. If one of the elements in our array of char arrays is ";" we can assume that multi commands are necessary. This is where I have trouble. int launch(char **args){ pid_t pid; int status; int i = 0; if(strcmp(args[0], "quit") == 0){ exit(EXIT_SUCCESS); } if(strcmp(args[0], ";") != 0){ printf("Essential Command Found : %s\n", args[0]); numFork++; } if(multiCommand == 1){ //Handle Multicommands here printf("Multi Commands Handling Here\n"); for(; i < elements - 1; i++){ if(strcmp(args[i], ";") == 0){ if((i + 1) < elements){ printf("Essential Command Found : %s\n", args[i + 1]); numFork++; } } } //This is where I need to figure out what to do printf("Fork: %d times\n", numFork); }else if (multiCommand == 0){ pid = fork(); if(pid == 0){ execvp(args[0], args); }else{ wait(&status); } } multiCommand = 0; elements = 0; return 1; } The general idea would be to have a for loop over the different commands and fork each of them. E.g. for(int i = 0; i < commandCount; i++) { int pid = fork(); if(pid == 0) { //this is the child (don't forget to check for errors and what-not) execCommand(all, of, the, info, needed); } } You can easily get the different commands using strtok(). Here's an example: #include <string.h> #include <stdio.h> int main() { char input[] = "abc;def;ghi"; char *token = strtok(input, ";"); while(token != NULL) { printf("%s\n", token); token = strtok(NULL, ";"); } return 0; } Output: abc def ghi The final function will look something like this: char *token = strtok(input, ";"); while(token != NULL) { int pid = fork(); if(pid == 0) { //token is one command //parse the different parts here execCommand(args, to, exec); } token = strtok(NULL, ";"); }
https://codedump.io/share/wA5ipgWU7fTt/1/fork-and-exec-multiple-processes-simultaneously
CC-MAIN-2016-50
refinedweb
377
59.13
Enumeration or Enum in C is a special kind of data type defined by the user. It consists of constant integrals or integers that are given names by a user. The use of enum in C to name the integer values makes the entire program easy to learn, understand, and maintain by the same or even different programmer. Syntax to Define Enum in C An enum is defined by using the ‘enum’ keyword in C, and the use of a comma separates the constants within. The basic syntax of defining an enum is: enum enum_name{int_const1, int_const2, int_const3, …. int_constN}; In the above syntax, the default value of int_const1 is 0, int_const2 is 1, int_const3 is 2, and so on. However, you can also change these default values while declaring the enum. Below is an example of an enum named cars and how you can change the default values. enum cars{BMW, Ferrari, Jeep, Mercedes-Benz}; Here, the default values for the constants are: BMW=0, Ferrari=1, Jeep=2, and Mercedes-Benz=3. However, to change the default values, you can define the enum as follows: enum cars{ BMW=3, Ferrari=5, Jeep=0, Mercedes-Benz=1 }; Enumerated Type Declaration to Create a Variable Similar to pre-defined data types like int and char, you can also declare a variable for enum and other user-defined data types. Here’s how to create a variable for enum. enum condition (true, false); //declaring the enum enum condition e; //creating a variable of type condition Suppose we have declared an enum type named condition; we can create a variable for that data type as mentioned above. We can also converge both the statements and write them as: enum condition (true, false) e; For the above statement, the default value for true will be 1, and that for false will be 0. How to Create and Implement Enum in C Program Now that we know how to define an enum and create variables for it, let’s look at some examples to understand how to implement enum in C programs. Example 1: Printing the Values of Weekdays #include <stdio.h> enum days{Sunday=1, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday}; int main(){ // printing the values of weekdays for(int i=Sunday;i<=Saturday;i++){ printf("%d, ",i); } return 0; } Output: In the above code, we declared an enum named days consisting of the name of the weekdays starting from Sunday. We then initialized the value of Sunday to be 1. This will assign the value for the other days as the previous value plus 1. To iterate through the enum and print the values of each day, we have created a for loop and initialized the value for i as Sunday. Example 2: Assigning and Fetching Custom Values of Enum Elements #include<stdio.h> enum containers{ cont1 = 5, cont2 = 7, cont3 = 3, cont4 = 8 }; int main(){ // Initializing a variable to hold enums enum containers cur_cont = cont2; printf("Value of cont2 is = %d \n", cur_cont); cur_cont = cont3; printf("Value of cont3 is = %d \n", cur_cont); cur_cont = cont1; printf("Value of hearts is = %d \n", cur_cont); return 0; } Output: We have declared an enum named containers with four different containers as the elements in the above code. We have then given custom values to the elements and initialized the variable for the enum multiple times to print the relevant output. Why Do We Use Enums in C? We use enums for constants, i.e., when we want a variable to have only a specific set of values. For instance, for weekdays enum, there can be only seven values as there are only seven days in a week. However, a variable can store only one value at a time. We can use enums in C for multiple purposes; some of the uses of enums are: - To store constant values (e.g., weekdays, months, directions, colors in a rainbow) - For using flags in C - While using switch-case statements in C Example of Using Enum in Switch Case Statement In this example, we will create an enum with all the 4 directions, North, East, West, and South as the constants. We will then use the switch case statements to switch between the direction elements and print the output based on the value of the variable for the enum directions. #include <stdio.h> enum directions{North=1, East, West, South}; int main(){ enum directions d; d=West; switch(d){ case North: printf("We are headed towards North."); break; case East: printf("We are headed towards East."); break; case West: printf("We are headed towards West."); break; case South: printf("We are headed towards South"); break; } return 0; } Output: Example of Using Enum in C for Flags We can use enum in C for flags by keeping the values of integral constants a power of 2. This will allow us to choose and combine two or more flags without overlapping with the help of the Bitwise OR (|) operator. Let’s consider the example below where we set three flags: Crop, Rotate, and Save to work with an image. Example: #include <stdio.h> enum designFlags{ CROP = 1, ROTATE = 2, SAVE = 4 }; int main() { int myExample = ROTATE | SAVE; printf("%d", myExample); return 0; } Output: If we do the calculations for the above code, it is: 00000010 (ROTATE = 2) | 00000100 (SAVE = 4) ___________ 00000110 (Output = 6) As you can see, our calculation and the output given by the program are the same. This concludes that we can use enum in C for flags. Also, we can add our custom flags. Interesting Points About Initialization of Enum in C There are a few facts about the enum worth noting, such as: 1. Multiple enum names or elements can have the same value. Here’s an example of two enum elements having a similar value. Example: #include <stdio.h> enum Cars{Jeep = 1, BMW = 0, Mercedes_Benz = 0}; int main(){ printf("%d, %d, %d", Jeep, BMW, Mercedes_Benz); return 0; } Output: 2. If we do not assign custom values to enum elements, the compiler will assign them default values starting from 0. For instance, the compiler will assign values to the months in the example below, with January being 0. Example: #include <stdio.h> enum Months{January, February, March, April, May, June, July, August, September, October, November, December}; int main(){ enum Months m = May; printf("The Value of May in Months is %d", m); return 0; } Output: 3. We can provide values to any elements of enum in any order. All the unassigned elements will get the value as previous + 1. The following program demonstrates the same. Example: #include <stdio.h> enum weekdays {Sunday, Monday = 2, Tuesday, Wednesday = 6, Thursday, Friday = 9, Saturday = 12}; int main() { printf("%d %d %d %d %d %d %d", Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday); return 0; } Output: 4. All the values assigned to the elements of enum must be an integral constant. For instance, they should be within the range of minimum and maximum possible integers. 5. All the enum elements or constants should have a unique scope. It means that an element cannot be a part of two different enums in the same program as it will fail during compilation. Here’s an example: Example: #include <stdio.h> enum Cars{Mahindra, Jeep, BMW}; enum Luxury_Cars{BMW, Ferrari, Mercedes_Benz}; int main(){ return 0; } Output: Enum in C vs. Macro Similar to enum, you can also use the macro in C to define named constants. However, the use of enum in C is preferred as it has many advantages over the macro. Two of the key benefits are: - Enums follows the ‘scope’ rules as discussed earlier (in the last point of the previous section). - The compiler can automatically assign values to enum elements. Hence, the declaration becomes easier. Advance your career as a MEAN stack developer with the Full Stack Web Developer - MEAN Stack Master's Program. Enroll now! Conclusion In this article, you have learned everything about enum in C and how to use it differently. If you want to know more about C programming fundamentals, you can sign up on our SkillUp platform. The platform offers free courses on multiple programming languages, including C and C++. You can take the opportunity to brush up on your C programming skills and put them to practice. In today’s competitive world, full-stack developers are in higher demand than professionals with mastery in a particular language. Hence, it is of utmost importance to learn and master multiple programming languages. That’s exactly what our Full-Stack Web Development Certification Course is made for. The course provides tutorials and applied learning to get acquainted with 30+ programming skills and tools. Opt for the course to become the best and land a high-paying job in the software development field.
https://www.simplilearn.com/tutorials/c-tutorial/enum-in-c
CC-MAIN-2022-21
refinedweb
1,468
60.95
Here's a code sample that uses signals and slots to start and stop a recording by responding to the button control's clicked() signal. When the user clicks the btnRecord button, its onClicked slot is called to begin recording. When the user clicks the btnStop button, its onClicked slot is called and the recording is stopped. The code sample shows you how to set the path (and file name) for the outputUrl attribute of the AudioRecorder. The outputUrl attribute determines where the recording will be saved. In this case, the recording is saved in a file called recording.m4a within the misc folder of the shared area on the device. import bb.multimedia 1.4 // ... attachedObjects: [ AudioRecorder { id: recorder outputUrl: "" } ] // ... Button { id: btnRecord text: "Record" onClicked: { recorder.record(); } } Button { id: btnStop text: "Stop" onClicked: { recorder.reset(); } } Got questions about leaving a comment? Get answers from our Disqus FAQ.comments powered by Disqus
https://developer.blackberry.com/native/documentation/graphics_multimedia/audio_video/recording_audio.html
CC-MAIN-2018-43
refinedweb
153
77.03
So I wrote a little Ruby script using pipes roughly like this – BEGIN SCRIPT ---- #!/usr/bin/ruby -n def process(line) f = IO.popen(‘some_executable’, ‘w’) f.puts <<END_INPUT some executable commands #{line} some executable commands END_INPUT f.close puts puts line end process $_ unless $_ =~ /#/ – END SCRIPT ----- Now this works nicely, I invoke it with ./script input_file > result the “some_executable” prints to STDOUT results as I expect (given the lines from input_file) and I can read the results in the “result” file However, the output of the puts / puts line at the end of the process method does not occur at the places I expect. The output of “some_executable” for several “lines” shows up on STDOUT, then the output of the puts / puts line for several “lines” shows up on STDOUT, whereas they should simply alternate (depending on the “line” value). Am I missing something about pipes, and how the input/output streams are hooked up? I am guessing that a calling STDOUT.flush before and after the puts/puts line statements will repair this, but I’m wondering why this would be necessary. This is with ruby 1.8.4 (2005-12-24) [i386-linux] Thanks Stephan
https://www.ruby-forum.com/t/pipes-and-flush/105100
CC-MAIN-2022-40
refinedweb
200
72.87
Tooling overload in JS Before I start let me clarify what I mean by tooling in the context of programming language: all ecosystem of tools/libraries/frameworks that are needed to use with a given programming language. When I’m thinking about tooling and how cumbersome it can be the first thing that comes to my mind is JavaScript. You probably heard of the black hole of node modules or days since the last JavaScript framework website. It means that either ecosystem is a black mess with a huge dependency list and new dependencies come every day. Why is that? I read somewhere that JavaScript as an ecosystem is a baby. It means that we have many responsibilities and so little knowledge about how to handle such a range of responsibilities. Where can we learn? Maybe we can look into other languages - how & what they are doing? I think you expect me to write about how beautifully other languages are doing the things that JavaScript cannot or not yet done. Sorry to disappoint you - but I don’t. I think I don’t know enough yet to do this. But I can give an example of my journey with one piece of the tooling ecosystem - bundlers. Example from my work I wanted to develop React & Typescript application. In a typical situation,you expect me to use something like create-react-app. I personally like to set up my own tooling and choose parts of the toolchain instead of being surprised when I eject. I choose a parcel as a main piece of the toolchain. Why? It is the easiest to start and I don’t need to write any config. I added ant design too. Two weeks of development passed and I need to render the Table. I import it via import {Table} from 'antd' and tried to run the project in development mode. I got an error telling me that parcel can’t create a JavaScript bundle. I started searching around the web for this problem. After a while, I found a corresponding issue inside ant design GitHub repository. The main conclusion was that table won’t work with parcel. I checked issue tracker inside parcel repository to see that issue was stale. I had two options there - either fix the issue or change the bundler to one that works with antd. I choose webpack as it is a recommend bundler to use with antd. I have to migrate the application from parcel to webpack. I started by adding TypeScript and Babel plugins & configs. After that, I need to add emotion.js babel plugins in proper versions in order for css prop to work. I the meantime I forgot about less loader for antd - I had to add it as well. It took about 3 hours of running webpack server, fixing building errors, fixing TypeScript errors but in the end I made it!. No errors from tsc, no errors from eslint (which setup requires additional 5 packages in order it to work with TS), no errors from npm run dev. I’m done here 🎉. Until the next update of webpack or babel or any part of the toolchain. Summary This was a mind dump about the tooling ecosystem in JavaScript world. I wrote about my problems with ant design in conjunction with parcel. Takeaway? It is hard but we are moving in a good direction.
https://krzysztofzuraw.com/blog/2020/tooling-overload-js/
CC-MAIN-2022-21
refinedweb
566
74.39
As in C++, a namespace is a "boundary" within which keys must be unique. As illustrated in my section on instance naming, starting on page 66, the namespace actually forms part of the full name of an instance. Generally, namespace names look like a UNIX directory tree (e.g., root/CIMV2 and root/CIMV2/test) but this is misleadingthere is actually neither structure nor hierarchy in these names. The slashes in the names are simply characters and each namespace is independent of all others. When classes are created and loaded into the WBEM server, their superclasses must exist in the same namespace, which may mean that the CIM schema need to be loaded into several namespaces. An association, however, may relate classes or instances in different namespaces as the namespace can be included in the reference fields.
https://flylib.com/books/en/1.229.1.76/1/
CC-MAIN-2022-05
refinedweb
137
52.19
The transactions made by various clients are queued in the system; the miners pick up the transactions from this queue and add it to the block. They will then mine the block and the winning miner would have the privilege of adding the block to the blockchain and thereby earn some money for himself. We will describe this mining process later when we discuss the creation of the blockchain. Before we write the code for multiple transactions, let us add a small utility function to print the contents of a given transaction. The display_transaction function accepts a single parameter of transaction type. The dictionary object within the received transaction is copied to a temporary variable called dict and using the dictionary keys, the various values are printed on the console. def display_transaction(transaction): #for transaction in transactions: dict = transaction.to_dict() print ("sender: " + dict['sender']) print ('-----') print ("recipient: " + dict['recipient']) print ('-----') print ("value: " + str(dict['value'])) print ('-----') print ("time: " + str(dict['time'])) print ('-----') Next, we define a transaction queue for storing our transaction objects. To create a queue, we declare a global list variable called transactions as follows − transactions = [] We will simply append each newly created transaction to this queue. Please note that for brevity, we will not implement the queue management logic in this tutorial. Now, we will start creating transactions. First, we will create four clients who will send money to each other for obtaining various services or goods from others. Dinesh = Client() Ramesh = Client() Seema = Client() Vijay = Client() At this point, we have four clients called Dinesh, Ramesh, Seema, and Vijay. We currently assume that each of these clients hold some TPCoins in their wallets for transacting. The identity of each of these clients would be specified by using the identity property of these objects. Now, we initiate our first transaction as follows − t1 = Transaction( Dinesh, Ramesh.identity, 15.0 ) In this transaction Dinesh sends 5 TPCoins to Ramesh. For transaction to be successful, we will have to ensure that Dinesh has sufficient money in his wallet for this payment. Note that, we will need a genesis transaction to start TPCoin circulation in the system. You will write the transaction code for this genesis transaction very shortly as you read along. We will sign this transaction using Dinesh’s private key and add it to the transaction queue as follows − t1.sign_transaction() transactions.append(t1) After the first transaction made by Dinesh, we will create several more transactions between different clients that we created above. We will now create several more transactions, each transaction given out a few TPCoins to another party. When somebody spends money, it is not necessary that he has to check for sufficient balances in this wallet. The miner in anyway would be validating each transaction for the balance that the sender has while initiating the transaction. In case of insufficient balance, the miner will mark this transaction as invalid and would not add it to this block. The following code creates and adds nine more transactions to our queue. t2 = Transaction( Dinesh, Seema.identity, 6.0 ) t2.sign_transaction() transactions.append(t2) t3 = Transaction( Ramesh, Vijay.identity, 2.0 ) t3.sign_transaction() transactions.append(t3) t4 = Transaction( Seema, Ramesh.identity, 4.0 ) t4.sign_transaction() transactions.append(t4) t5 = Transaction( Vijay, Seema.identity, 7.0 ) t5.sign_transaction() transactions.append(t5) t6 = Transaction( Ramesh, Seema.identity, 3.0 ) t6.sign_transaction() transactions.append(t6) t7 = Transaction( Seema, Dinesh.identity, 8.0 ) t7.sign_transaction() transactions.append(t7) t8 = Transaction( Seema, Ramesh.identity, 1.0 ) t8.sign_transaction() transactions.append(t8) t9 = Transaction( Vijay, Dinesh.identity, 5.0 ) t9.sign_transaction() transactions.append(t9) t10 = Transaction( Vijay, Ramesh.identity, 3.0 ) t10.sign_transaction() transactions.append(t10) When you run the above code, you will have ten transactions in the queue for the miners to create their blocks. As a blockchain manager, you may periodically like to review the contents of transaction queue. For this purpose, you can use the display_transaction function that we developed earlier. To dump all transactions in the queue, just iterate the transactions list and for each referenced transaction, call the display_transaction function as shown here − for transaction in transactions: display_transaction (transaction) print ('--------------') The transactions are separated by a dashed line for distinction. If you run the above code, you would see the transaction list as shown below − ----- value: 15.0 ----- time: 2019-01-14 16:18:01.859915 ----- --------------a070c82b34ae14 3cbe59b3a2afde7186e9d5bc274955d8112d87a00256a35369acc4d0edfe65e8f9dc93fb d9ee74b9e7ea12334da38c8c9900e6ced1c4ce93f86e06611e656521a1eab561892b7db0 961b4f212d1fd5b5e49ae09cf8c603a068f9b723aa8a651032ff6f24e5de00387e4d0623 75799742a359b8f22c5362e5650203010001 ----- value: 6.0 ----- time: 2019-01-14 16:18:01.860966 ----- -------------- sender: ----- recipient: 30819f300d06092a864886f70d010101050003818d0030818902818100cba097c0854876 f41338c62598c658f545182cfa4acebce147aedf328181f9c4930f14498fd03c0af6b0cc e25be99452a81df4fa30a53eddbb7bb7b203adf8764a0ccd9db6913a576d68d642d8fd47 452590137869c25d9ff83d68ebe6d616056a8425b85b52e69715b8b85ae807b84638d8f0 0e321b65e4c33acaf6469e18e30203010001 ----- value: 2.0 ----- time: 2019-01-14 16:18:01.861958 ----- -------------- For brevity, I have printed only first few transactions in the list. In the above code, we print all transactions beginning with the very first transaction except for the genesis transaction which was never added to this list. As the transactions are added to the blocks periodically, you will generally be interested in viewing only the list of transactions which are yet to be mined. In that case, you will need to create an appropriate for loop to iterate through the transactions which are not yet mined. So far, you have learned how to create clients, allow them to among themselves and maintain a queue of the pending transactions which are to be mined. Now, comes the most important part of this tutorial and that is creating a blockchain itself. You will learn this in the next lesson. 187 Lectures 17.5 hours 55 Lectures 8 hours 136 Lectures 11 hours 75 Lectures 13 hours Eduonix Learning Solutions 70 Lectures 8.5 hours 63 Lectures 6 hours
https://www.tutorialspoint.com/python_blockchain/python_blockchain_creating_multiple_transactions.htm
CC-MAIN-2022-05
refinedweb
931
56.05
The ASP.NET MVC framework includes a useful utility class named the TagBuilder class that you can use when building HTML helpers. The TagBuilder class, as the name of the class suggests, enables you to easily build HTML tags. In this brief tutorial, you are provided with an overview of the TagBuilder class and you learn how to use this class when building a simple HTML helper that renders HTML <img> tags. Overview of the TagBuilder Class. These methods and properties give you all of the basic methods and properties that you need to build up an HTML tag. You don’t really need to use the TagBuilder class. You could use a StringBuilder class instead. However, the TagBuilder class makes your life a little easier. Creating an Image HTML Helper When you create an instance of the TagBuilder class, you pass the name of the tag that you want to build to the TagBuilder constructor. Next, you can call methods like the AddCssClass and MergeAttribute() methods to modify the attributes of the tag. Finally, you call the ToString() method to render the tag. For example, Listing 1 contains an Image HTML helper. The Image helper is implemented internally with a TagBuilder that represents an HTML <img> tag. Listing 1 – Helpers\ImageHelper.vb Public Module ImageHelper <System.Runtime.CompilerServices.Extension> _ Function Image(ByVal helper As HtmlHelper, ByVal id As String, ByVal url As String, ByVal alternateText As String) As String Return Image(helper, id, url, alternateText, Nothing) End Function <System.Runtime.CompilerServices.Extension> _ Function Image(ByVal helper As HtmlHelper, ByVal id As String, ByVal url As String, ByVal alternateText As String, ByVal htmlAttributes As Object) As String ' Create tag builder Dim builder = New TagBuilder("img") ' Create valid id builder.GenerateId(id) ' Add attributes builder.MergeAttribute("src", url) builder.MergeAttribute("alt", alternateText) builder.MergeAttributes(New RouteValueDictionary(htmlAttributes)) ' Render tag Return builder.ToString(TagRenderMode.SelfClosing) End Function End Module The module in Listing 1 contains two overloaded methods named Image(). When you call the Image() method, you can pass an object which represents a set of HTML attributes or not. Notice how the TagBuilder.MergeAttribute() method is used to add individual attributes such as the src attribute to the TagBuilder. Notice, furthermore, how the TagBuilder.MergeAttributes() method is used to add a collection of attributes to the TagBuilder. The MergeAttributes() method accepts a Dictionary<string,object> parameter. The The RouteValueDictionary class is used to convert the Object representing the collection of attributes into a Dictionary<string,object>. After you create the Image helper, you can use the helper in your ASP.NET MVC views just like any of the other standard HTML helpers. The view in Listing 2 uses the Image helper to display the same image of an Xbox twice (see Figure 1). The Image() helper is called both with and without an HTML attribute collection. Listing 2 – Home\Index.aspx <%@ Page <!-- Calling helper without HTML attributes --> <%= Html.Image("img1", ResolveUrl("~/Content/XBox.jpg"), "XBox Console") %> <!-- Calling helper with HTML attributes --> <%= Html.Image("img1", ResolveUrl("~/Content/XBox.jpg"), "XBox Console", New With {.border="4px"})%> </asp:Content> Figure 01: Using the Image helper(Click to view full-size image) Notice that you must import the namespace associated with the Image helper at the top of the Index.aspx view. The helper is imported with the following directive: <%@ Import Namespace="MvcApplication1" %> In a Visual Basic application, the default namespace is the same as the name of the application. This article was originally created on March 2, 2009
http://www.asp.net/mvc/overview/older-versions-1/views/using-the-tagbuilder-class-to-build-html-helpers-vb
CC-MAIN-2015-27
refinedweb
586
58.28
Resolution would be that the failing test would pass and concurrent writes to pessimistically locked rows would be correctly handled and the expected count. First for Grails: 1) The HSQLDB database shipped with Grails doesn't support "SELECT .. FOR UPDATE" and hence pessimistic locking is not possible (see). I have updated the documentation to reflect this. 2) Even on a database where SELECT .. FOR UPDATE is possible like MySQL you may still get a problem with data loss as you're doing an initial get and then a later lock: def foo = Foo.get(id) foo.lock() In between the time it takes to do the get and call the lock() method another thread could have obtained and locked the db done its changes and you end up with data loss. To avoid this situation I've added a static lock method so you can do: def foo = Foo.lock(id) However, even with this change you test will not pass. Why? because the test shares the same Hibernate session even across all the threads, so essentially its locking on the same object. In Grails different requests will have different sessions bound to each thread which where each willl have a different object to lock on. Because of the presence if so many concurrent sessions, the only way to atomically update something like a counter where there may be many contending threads attempting to increment, was to relinquish control to the database. We solved by def update = sessionFactory.currentSession.createSQLQuery("update foo set counter = counter + 1 where id = 123") update.executeUpdate() {code) I'm using postgres and driving my application via HTTP Unit from multiple threads and locking still doesn't work as advertised. From In Grails pessimistic locking is performed via the lock method: def airport = Airport.get(10) airport.lock() // lock for update airport.name = "Heathrow" airport.save() When I follow this pattern the result is multiple OptimisticLockingFailureExceptions Your suggestion of doing airport.lock(10) airport.name = "Heathrow" airport.save() results in No signature of method: Person.lock() is applicable for argument types: (java.lang.String) values: {"ff80818119bdf60d0119bdf7d5c80005"} (The id is a String since we're using uuid) def session = sessionFactory.currentSession session.evict(airport) // Force the following load to actually go to the DB instead of doing a version check airport = session.load(Airport.class, airport.id, LockMode.UPGRADE) This seems to work OK
http://jira.codehaus.org/browse/GRAILS-2790
crawl-001
refinedweb
397
56.76
Installing Simple2D and Compiling your first application Simple2D is my graphics library for students and beginners looking to experiment with drawing 2D graphics in C++ in the simplest possible way. It is based on the Direct2D API but removes almost all of the complexity. This article contains instructions on installing the software and all of the extras it requires, and shows how to compile your first program using Simple2D. System Requirements Simple2D is based on Microsoft Direct2D therefore you require one of the operating systems listed below. Windows XP is not supported! Make sure your operating system meets these requirements before continuing. Simple2D 1.06 and later: - Windows 7 Service Pack 1 with Platform Update for Windows 7 - Windows Server 2008 R2 Service Pack 1 with Platform Update for Windows 7 - Windows 8 - Windows Vista is NOT supported Simple2D 1.05 and earlier (no longer supported): - Windows Vista Service Pack 2 with Platform Update - Windows 7 - Windows Server 2008 R2 - Windows 8 Installation Visual Studio Visual Studio is required to compile Simple2D applications. The library is tested against the following versions: - Visual Studio 2010 (compile with warnings) - Visual Studio 2012 (no warnings) - Visual Studio 2013 (no warnings) If you don’t already have Visual Studio installed, download your preferred version for free: - Visual Studio 2013 Express for Windows Desktop - Visual Studio 2012 Express for Windows Desktop - Visual C++ 2010 Express It is strongly recommended that you use Visual Studio 2012 or 2013 where possible as the configuration is much simpler. Windows 8 SDK (does not require Windows 8 to install or use) Visual Studio 2010 users: Download and install the Windows 8 SDK so that Direct2D libraries are available in Visual Studio. See the section “Setting up Visual Studio 2010” in my Direct2D 1.1 Migration Guide for configuring the SDK paths correctly in your Visual Studio projects. Visual Studio 2012 / 2013 users: When you perform the installation, ensure that you have chosen to install the Windows 8 SDK so that Direct2D libraries are available in Visual Studio. No changes to include or library paths on a per-project basis are needed. Boost Simple2D makes use of a common set of libraries called Boost to simplify many tasks. Simple2D has been tested against: - Boost 1.47 - Boost 1.53 - Boost 1.55 First download the Boost sources and headers and unpack them into a folder such as C:\Program Files (x86)\boost. Then download the pre-compiled binaries for Windows. Use the 32-bit versions even if you are running a 64-bit system, as Simple2D is designed for a 32-bit build. The EXE will create a folder of libraries. Move them to C:\Program Files (x86)\boost\boost_x_yy_z\lib32 where boost_x_yy_z is the version-named Boost folder you copied in the previous step. The DirectX SDK is not required The DirectX SDK is not required to use Simple2D, so you don’t need to download this. Simple2D Finally, download Simple2D itself from this web site and run the installer. This will install the libraries and header files you need to get working with Simple2D. If your system requires Platform Update for Windows 7, the installer will download and install it for you automatically. Hello, I’ve followed all of the directions specified and now when I run the program I get a syntax error stemming from simple2dlib.h referring to objToClone. The exact piece of code is ObjectManager(ObjectManager const &o) { for (auto &objToClone : o.objects) { auto cloned = objToClone.clone(); cloned->SetDeleteBehaviour(SODB_Destroy); objects.push_back(cloned); } } It says that objToClone reference has not been initialized. How do I go about initializing this? Hi Kaden and sorry for the slow reply. That sounds like a bug in the library. Which version are you using, and can you post the entire source code so I can take a look? The example code from the article is a simplified version of the ‘MSDN-Direct2D’ example in the examples folder of the installation. All of the examples are re-compiled and tested before each new version is released so it should work, so let’s have a look at your code. Thanks! I am using the Simple2D 1.10 and I am running the code from your 2D Platform Games Collision detection. Even when I try the test code from the above article, I get the same syntax error. I haven’t made any alterations to the simple2dlib.h code. The error is on Line 2231 of simple2dlib.h . I am using Windows 7, and VS 2010. My source code is as follows for main #include “C:\Program Files (x86)\DJKaty.com\Simple2D\src\Simple2D.h” using namespace S2D; class MyProgram : public Simple2D { // API entry points bool SetupResources(); void ReleaseResources(); void DrawScene(); void UpdateObjects(); // The bitmap brush to use to draw the platforms ImageBrush tile; // The sprite to use for the player Image player; // The number of objects in the game world int worldObjectCount; // The geometry of all the landscape objects (platforms and walls) Geometry *worldObjects;() { typedef enum { Rectangle, Ellipse } ShapeType; // This structure allows us to quickly define the layout of each landscape object typedef struct { int width; int height; ShapeType shape; float scaleX; float scaleY; GeometryTransformPoint scalePoint; float skewAngleX; float skewAngleY; GeometryTransformPoint skewPoint; float rotAngle; GeometryTransformPoint rotPoint; int topLeftX; int topLeftY; } ObjectDefinition; worldObjectCount = 12; // Create the landscape definition ObjectDefinition objdef[] = { // Gently sloping straight surface { 80*6, 80*1, Rectangle, .5f, .5f, PointBottomLeft, 0.f, -10.f, PointBottomLeft, 0.f, PointBottomLeft, 80, ResolutionY – 200 }, // Block to help climb up steep sloping wall { 80*1, 80*1, Rectangle, .5f, .5f, PointTopLeft, 0.f, 0.f, PointBottomLeft, 0.f, PointBottomLeft, 250, ResolutionY – 60 }, // Steep sloping wall { 80*8, 80*1, Rectangle, .6f, .6f, PointBottomLeft, 0.f, 0.f, PointBottomLeft, 75.f, PointTopLeft, 240, ResolutionY – 250 }, // Edge walls { }, // Square blocks (‘stairs’) { 80*1, 80*1, Rectangle, .75f, .75f, PointTopLeft, 0.f, 0.f, PointBottomLeft, 0.f, PointTopLeft, 20, ResolutionY – 80 }, { 80*1, 80*1, Rectangle, .4f, .4f, PointTopLeft, 0.f, 0.f, PointBottomLeft, 0.f, PointTopLeft, 20, ResolutionY – 110 }, // Two sloping platforms on left-hand side to give access to a long fall through a thin platform { 80*5, 80*1, Rectangle, .25f, .25f, PointTopLeft, 0.f, 10.f, PointBottomLeft, 0.f, PointTopLeft, 20, 200 }, { 80*20, 80*1, Rectangle, .25f, .25f, PointTopLeft, 0.f, -15.f, PointBottomLeft, 0.f, PointTopLeft, 100, 150 }, // Very thin platform (to test fall-through) { 80*20, 80*1, Rectangle, .1f, .05f, PointTopLeft, 0.f, 0.f, PointBottomLeft, 0.f, PointTopLeft, 420, 250 } }; //); } return true; } // Free up game world resources void MyProgram::ReleaseResources() { delete [] worldObjects; } //(); } Ok, I copy pasted your code into a new project and linked it against Simple2D 1.10 and it worked correctly. I suspect the problem is you are using Visual Studio 2010 and the problem line in question uses a C++11 syntax which isn’t supported by Microsoft until Visual Studio 2012. This was my fault – that code should be in the Simple2D.cpp file instead of the header so that you don’t need Visual Studio 2012 to compile applications with Simple2D. I will fix it in the next version. In the meantime, you should be able to make it compile correctly by changing these two lines: for (auto &objToClone : o.objects) { auto cloned = objToClone.clone(); to: for (auto it = o.objects.begin(); it != o.objects.end(); it++) { auto cloned = it->clone(); in Simple2DLib.h. Let me know if that helps and thanks for the report! That helped get rid of that syntax error. Thank you. Now I get an error that I’ve never come across before. fatal error C1900: Il mismatch between ‘P1’ version ‘20100826’ and ‘P2’ version ‘20081201’. I checked online and haven’t found many solutions except to reinstall my service pack. I did just that but it hasn’t fixed the problem. If you have any suggestions, I would really appreciate it. I feel like I’m so close to getting this to work. I’ve never heard of that problem before, but there are some pages eg. where it is suggested that a static library compiled with /GL (whole program optimization enabled) requires the compiler tools which consume it to be of the same version as those which created it. I wasn’t aware of this… in Simple2D, the debug version (Simple2Dd.lib) is compiled without /GL but the release version (Simple2D.lib) is compiled with /GL. I will turn this off for future releases – in the meantime, can you try linking against Simple2Dd.lib and building with ‘Debug’ as the selected configuration and see if the problem goes away? You get the same for example with VS2008 code vs VS2008SP1. The /GL will generate code at link time. Which means it has to compile, and if the code doesn’t match the exact compiler version, you’ll get these problems. Better avoid /GL for libraries in general. Yep, I just posted a new version of the library yesterday and I have removed /GL altogether. I’ll accept my own inexperience with publishing C++ libraries to blame there… Hey Katy, great work! I followed your steps but it seems it doesn’t work for me. I’m using VS C++ 2010 Express and tried to run one of the collision demos but I get like 30 linker errors (LNK2019 unresolved external symbol). Do you happen to know what would be the problem? Can you post the linker output so I can take a look for you? 🙂 Ah right if you’re using 1.13 I need to update the installation instructions. You no longer need to add Simple2Dd.lib and Simple2D.lib as debug and release linker inputs – you can instead go to the global settings (properties manager) and add c:\program files (x86)\djkaty.com\simple2d\lib\vc11\$(Configuration) and it will automatically link to the correct library for both debug and release. Note though that the vc11 folder is compiled against Visual Studio 2012 (and vc12 for Visual Studio 2013) so you may get a version mismatch error (1600 vs 1700 or some such) – if so you need to recompile Simple2D itself and I’m not sure if you can under VS2010 anymore because it uses some C++11 stuff, but you can try. I recommend you upgrade to Visual C++ 2012 Express or Visual Studio for Windows Desktop Express 2013 if you are able to. If you need to recompile Simple2D for VS2010 and you get errors, post them and I’ll come up with some compatibility fixes. I got VS Express 2012 but I still didn’t make it work. Downloaded boost 1.53 and simple2D 1.13. Unfortunately, I still get the 30 linker errors. If it’s the same errors it is because it can’t find Simple2D.lib; did you change the linker input in property manager as I suggested above? Sorry, I meant adding the above mentioned folder to Library Directories in VC++ Directories in Property Manager. Yes, I added C:\Program Files (x86)\DJKaty.com\Simple2D\lib\vc11\$(Configuration) to Library Directories in VC++ Directories but I still get the errors. They are the same errors. Maybe I’m forgetting something, but I can’t find what. I have just updated the article with new installation instructions for Simple2D 1.13 on various versions of Visual Studio. Can you please try again and let me know how it goes? Sorry for taking so long to reply, been sick. Hi, I tried to install this today, but i don’t know how to include the library on the Visual Studio 2013, and was wondering if you could help me out? I downloaded your Tetris source code and tried to run it, and it appeared that I couldn’t open the #include . Thanks!
https://katyscode.wordpress.com/2012/05/21/simple2d-installing-simple2d-and-compiling-your-first-application/
CC-MAIN-2018-17
refinedweb
1,963
65.83
This constraint moves clones into clone groups of type II by comparing them. More... #include "clang/Analysis/CloneDetection.h" This constraint moves clones into clone groups of type II by comparing them. Clones that aren't type II clones are moved into separate clone groups. In contrast to the RecursiveCloneTypeIIHashConstraint, all clones in a clone group are guaranteed to be be type II clones of each other, but it is too slow to efficiently handle large amounts of clones. Definition at line 274 of file CloneDetection.h. Definition at line 416 of file CloneDetection.cpp. References areSequencesClones(), and clang::CloneConstraint::splitCloneGroups().
http://clang.llvm.org/doxygen/classclang_1_1RecursiveCloneTypeIIVerifyConstraint.html
CC-MAIN-2018-26
refinedweb
101
57.98
Introduction : In this post, I will show you how we can print one string without semicolon in C++. In C++, we need to end one statement with a semicolon to complete it. But there are ways to execute one statement without a semicolon. The idea is to put the statement inside a condition checker, i.e. if we put it inside an if, while, or switch, it will execute that statement and that statement will print the result. Method 1: Using while loop : while loop takes one condition and executes its body if the condition is true. We can pass one print statement as the condition in a while loop like below : #include <iostream> using namespace std; int main() { while (!(cout << "Hello World\n")) { } return 0; } Here, we are checking the ! of the value that cout expression returns. This is because the loop will execute for infinite times if we don’t use the not operator. If you execute this program, it will print the “Hello World” line. We are keeping the body of the while loop empty because without a body we can’t execute one while loop. Method 2: Using a for loop : It is similar to the while loop solution we did above. for loop takes three conditions. We can keep the first and the last one empty and add the print cout statement as the second one. #include <iostream> using namespace std; int main() { for (; !(cout << "Hello World\n");) { } return 0; } We are using one not here. Otherwise, it will run for an infinite time. Method 3: Using a ‘if’ block : if checks for a condition before executing its body. We can place cout as its condition : #include <iostream> using namespace std; int main() { if(cout << "Hello World\n") { } return 0; } Method 4: Using macros : Macros are used to define a constant at the top level of a program. We can also create one macro as a cout expression and we can use that in other places like in a if condition. Example program : #include <iostream> #define HELLO cout<<"Hello World\n" using namespace std; int main() { if(HELLO) { } return 0; } The if block will execute the cout expression and print that Hello World string. Method 5: Using a switch block : We can even use one switch block in a similar way. We can leave the body part empty. For example, the below example will print the Hello World string : #include <iostream> using namespace std; int main() { switch (printf("Hello World\n")) { } return 0; } We can’t use cout here because switch requires integral values and printf returns one integer, cout not. Similar tutorials : - C++ program to change the case of all characters in a string - C++ program to find out the total vowels in a string - C++ program to count the total number of digits in a string - C++ program to check if all characters of a string are alphanumeric or not - How to read a string in C++ using getline - C++ different ways to find the length of a string
https://www.codevscolor.com/c-plus-plus-print-without-semicolon
CC-MAIN-2020-50
refinedweb
506
69.11
[GIT PULL] namespace changes for 4.17-rc1 From: Eric W. Biederman Date: Tue Apr 03 2018 - 15:17:19 EST Next message: Heinrich Schuchardt: "[PATCH 1/1] checkpatch: allow space between colon and bracket" Previous message: Jacek Anaszewski: "Re: [GIT PULL] LED updates for 4.17-rc1" Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Linus, Please pull the userns-linus branch from the git tree: git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git userns-linus HEAD: 2236d4d39035b9839944603ec4b65ce71180a9ea ipc/shm: Fix pid freeing. There was a lot of work this cycle fixing bugs that were discovered after the merge window and getting everything ready where we can reasonably support fully unprivileged fuse. The bug fixes you already have and much of the unprivileged fuse work is coming in via other trees. Still left for fully unprivileged fuse is figuring out how to cleanly handle .set_acl and .get_acl in the legacy case, and properly handling of evm xattrs on unprivileged mounts. Included in the tree is a cleanup from Alexely that replaced a linked list with a statically allocated fix sized array for the pid caches, which simplifies and speeds things up. Then there is are some cleanups and fixes for the ipc namespace. The motivation was that in reviewing other code it was discovered that access ipc objects from different pid namespaces recorded pids in such a way that when asked the wrong pids were returned. In the worst case there has been a mearsured 30% performance impact for sysvipc semaphores. Other test cases showed no measurable performance impact. Manfred Spraul and Davidlohr Bueso who tend to work on sysvipc performance both gave the nod that this is good enough. Casey Schaufler and James Morris have given their approval to the LSM side of the changes. I simplified the types and the code dealing with sysvipc to pass just kern_ipc_perm for all three types of ipc. Which reduced the header dependencies throughout the kernel and simplified the lsm code. Which let me work on the pid fixes without having to worry about trivial changes causing complete kernel recompiles. When merging you may see a trivial conflict with the syscalls tree where adjacent lines in the sysvipc code were touched. Alexey Dobriyan (1): pidns: simpler allocation of pid_* caches Eric W. Biederman (14): sem/security: Pass kern_ipc_perm not sem_array into the sem security hooks shm/security: Pass kern_ipc_perm not shmid_kernel into the shm security hooks msg/security: Pass kern_ipc_perm not msg_queue into the msg_queue security hooks sem: Move struct sem and struct sem_array into ipc/sem.c shm: Move struct shmid_kernel into ipc/shm.c msg: Move struct msg_queue into ipc/msg.c ipc: Move IPCMNI from include/ipc.h into ipc/util.h ipc/util: Helpers for making the sysvipc operations pid namespace aware ipc/shm: Fix shmctl(..., IPC_STAT, ...) between pid namespaces. ipc/msg: Fix msgctl(..., IPC_STAT, ...) between pid namespaces ipc/sem: Fix semctl(..., GETPID, ...) between pid namespaces ipc: Directly call the security hook in ipc_ops.associate ipc/smack: Tidy up from the change in type of the ipc security hooks ipc/shm: Fix pid freeing. Stephen Rothwell (1): ipc/shm: fix up for struct file no longer being available in shm.h include/linux/ipc.h | 2 - include/linux/lsm_hooks.h | 32 ++++---- include/linux/msg.h | 18 ----- include/linux/security.h | 67 ++++++++------- include/linux/sem.h | 40 +-------- include/linux/shm.h | 22 +---- ipc/msg.c | 62 ++++++++------ ipc/sem.c | 81 ++++++++++++------- ipc/shm.c | 68 ++++++++++------ ipc/util.c | 9 +++ ipc/util.h | 12 +++ kernel/pid_namespace.c | 67 ++++++--------- security/security.c | 32 ++++---- security/selinux/hooks.c | 92 ++++++++++----------- security/smack/smack_lsm.c | 197 +++++++++++++-------------------------------- 15 files changed, 346 insertions(+), 455 deletions(-) Next message: Heinrich Schuchardt: "[PATCH 1/1] checkpatch: allow space between colon and bracket" Previous message: Jacek Anaszewski: "Re: [GIT PULL] LED updates for 4.17-rc1" Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
http://lkml.iu.edu/hypermail/linux/kernel/1804.0/01463.html
CC-MAIN-2019-18
refinedweb
647
59.8
Contains MAY Nurturing Faith Lessons Q&A with Tony Campolo 6 APRIL 2012 baptiststoday.org Heis Risen indeed ™ BIBLE STUDIES for adults and youth MAY lessons inside 17 Pastoral Perspectives with George Mason | 34 Wendell Griffen Minister-Judge | 38 Raleigh’s two First Baptist churches take center stage 42 April 2012 Vol. 30, No. 4 baptiststoday.org John D. Pierce Executive Editor editor@baptiststoday.org Julie Steele Chief Operations Officer Walker Knight, Publisher Emeritus Jack U. Harwell, Editor Emeritus. 2 | Feature IN THE NEWS A case for ministry 36 42 ‘Two Buildings, One Heart’ ™. Information | 3 —Pastor Jerry Henry of First Baptist Church of Fairhope admitting that the Southern Baptist Convention name can be an obstacle in other parts of the country (RNS) pocketbooks and faithfulness “If we could convert political hyperbole to cash, this debate would have eliminated the national debt.” faith itself and its profounder to an institution’s particular heritage with a still deeper faithfulness to the Christian) Editorial By John Pierce Overturning tables — and misconceptions My parents, other relatives, neighbors, teachers and church leaders taught me to value good manners. I still do (except when driving). M anners can take on various forms and have evolved since Emily Post’s definitive statement on the subject in 1922. However, basic respect and kindness, more than formal etiquette, marked the behavioral standards that were conveyed to me since table settings were simple and hot tea’s only use was to dissolve sugar before being poured over ice. Those home and community efforts to teach basic social behavior did not totally fail. So, as a result, I try to speak kindly to others, to be gracious in social settings and to be mindful enough to hold the door for the next person. Manners just matter to me. And I don’t like being in social settings where ill-mannered people talk loudly on their cell phones or smoke in non-smoking areas or act like their convenience is more important than the rules everyone else follows. Such elitism, in my book, conveys poor manners as well. Those who consider it very important to feel important tend to be disrespectful toward those they consider to be less than important. Therefore, being mannerly is not a matter of socio-economic status. One can be both socially refined and ugly toward others. So the manners of my upbringing were rooted in the idea of kindness that is expressed by treating all people in considerate ways. Therefore, it is not surprising that I grew up with an image of a well-mannered, very polite Jesus. Our Jesus was sweet. “Sweetest name I know.” “’Tis so sweet to trust in Jesus.” Jesus’ hard rhetoric toward the religiously pious — though quite obvious in the Bible we read and loved — didn’t get a lot of our attention. That would hit too close to home. But there was one exception: The story of Jesus overturning the tables of the temple merchants was very popular. It was interpreted as Jesus giving us permission for an occasional angry outburst if directed toward selected “sins.” It’s that moment in the Gospel story when Jesus shifts characters from Mr. Rogers to John Wayne — before returning to his sweater and sneakers. Today, some church leaders play up the cowboy image of Jesus in an effort to get men roped into church. Such macho Christianity may involve weight-lifting exhibitions, testimonies by athletes who credit Jesus with their on-field successes, and wild game dinners. On the other end, Jesus can get portrayed as meek, mild, and accepting of any and all beliefs and behavior. He becomes the quiet philosophical Jesus. However, it became obvious to me long ago that a soft-spoken philosopher who wanders the countryside while telling heart-warming stories doesn’t end up on a cross. Since such various images of Jesus abound, it is no wonder that he was compelled to ask even those closest to him: “But who do you say that I am?” Apparently, the confusion has been going on for a long time. For us, this is a good season to reflect on the full person of Jesus in the Gospels — passed down through the ages by those who witnessed and recorded his life and teachings. With careful attention to not imposing our predetermined concepts of Jesus on our reading, we might discover something new and fresh about the most remarkable person to walk the face of the Earth. We just might find: an often kind but sometimes less-than-polite Jesus; a revolutionary whose love and mercy threatens those of us who claim to be loving and merciful; and a savior who not only rescues sinners by our definition, but also reminds those of us who think we are safely on the right shore that we could use a little more rescuing too. But, then, it’s never a bad time to get better acquainted with Jesus — the sweetest name I know. BT Wishing you a blessed Holy Week, and the joy and hope of Easter. The Directors and Staff of Baptists Today Perspective | 5 “When you start dealing with what Christ really expects from us, you become socially dangerous.” “What young people like more than anything else is a radical call to obedience to Christ.” ‘A sense of urgency’ A conversation with Tony Campolo story and photos by john pierce A TLANTA — An ongoing irritant to casual Christianity (which he would consider an oxymoron), well-traveled Tony Campolo flew in from a speaking engagement in Rome, Italy, to address an urban ministry workshop here during the Martin Luther King Jr. National Holiday weekend. The 77-year-old author, sociologist and Baptist minister has not slowed down — nor toned down his call for selfless, counter-cultural expressions of the Christian faith. “You get a sponge and dip it in water,” he said to workshop participants gathered at Atlanta’s First Presbyterian Church. “But if you don’t wring it out, what happens?” His rhetorical question created the desired image of something that is saturated and even souring. Then he compared the dripping sponge to church members who go to Bible study to “grow” — but never put their increased faith into active ministry on behalf of those Jesus loved and served. The only way to get people to grow in the Spirit, said Campolo, is to get them involved in the neighborhood. Then he offered some tactical advice. Lay off guilt trips aimed at middle and upper-class Christians, he said. “Tell them you want to help them grow.” Afterward, Baptists Today editor John Pierce posed questions to Campolo about issues and opportunities facing Christians today. The conversation below is adapted from that interview. BT: Tony, you’ve been doing this a long time. What keeps you going? Campolo: The thing that keeps me going is the sense that I haven’t done what needs to be done in my life. It’s a sense of incompleteness. It’s a sense that there is a long-way more to go. I think of that poem by Robert Frost: “I have promises to keep and miles to go before I sleep.” There is a sense of urgency, and I think it comes, largely, out of the way in which I conduct my prayer life. 6 | Feature Each morning I take time to just center down on Jesus, and don’t ask God for anything. But in quiet and solitude, I wait to feel some kind of infilling of his presence. And that tends to regenerate the sense of urgency that was there from the beginning. I’d say that I have more of a sense of urgency today than when I first started out. BT: Back in the 1980s you were invited to speak at conferences and in moreconservative, evangelical churches that you may not get invited to today. What has changed? Have the churches changed? Have you changed? Or are we just in a more divisive time? Campolo: I think that your analysis is a correct one. I speak just as much, but in terms of being in mainline churches: American Baptist, Cooperative Baptist Fellowship churches, some Southern Baptist churches — but Presbyterian, Methodist, United Church of Christ. What changed was due to a couple of things. First of all, it became known that I was serving as a pastoral counselor to President Clinton. It was on the front page of about every newspaper in the country that the president called upon me and another friend to really spend time with the president each week. And we did; it was each week. [We were] weeping and trying to get him back on track — and trying to revitalize his sense of commitment to the causes of justice and helping the poor and oppressed and living out the work of the presidency in a way that those who Jesus called the least of these would benefit from. He had a fall in his life, and he needed to recover. When I stepped forward to do that, I knew then that I was going to be in trouble. So many of my evangelical friends are so Republican that they sometimes forget the Kingdom of God transcends political affairs — but that we are called upon to pray for the leaders, and with the leaders, whoever they may be... But there was a sense that to be aligned with this man in a spiritual capacity was in fact to become persona non grata in certain circles of the evangelical faith. I think that was one of the things that did it. I think the other thing that did it was this: I tend to have a somewhat conservative view on homosexual relationships. I hold that samegender erotic behavior does not fit in with my understanding of scripture. But I am totally committed to justice for my gay and lesbian brothers and sisters. I don’t think you can tell these brothers and sisters that you love them and not stand up for justice on their behalf. Justice is nothing more than love turned into social policy. That’s a strong statement with me. So I’ve been an advocate for those brothers and sisters. There is seldom a message that I give that I don’t work in something calling for justice. There are like 110 rights that heterosexuals enjoy that homosexuals do not. I don’t think we are really serving Christ well when we don’t stand up for justice even on behalf of those we don’t necessarily agree with. This is a very important factor. I would say those two things have really kind of created a negative attitude in many evangelical circles — but by no means in all evangelical circles. As a matter of fact, I think evangelicalism is itself going through a rapid evolution. [Evangelicals] are now as concerned about the poor as mainline churches have been — maybe even more so. The place where they differ from mainline churches is that they are willing to respond to the poor with charity, but they are not about to raise serious questions about political and economic structures in America that are creating poverty. That Latin American bishop [Dom Helder Camara] said: “When I fed the poor, they called me a saint; when I began to ask what made them poor, they called me a communist.” I’m a totally committed American, but I get people calling me a socialist and all kind of things simply because I say it’s not enough just to feed the poor; we’ve got to, in fact, change the political and economic structures that are creating poverty. That has caused me a great deal of difficulty. BT: You’re an old guy who connects with young people well. How do you do that, and why is it important to you? Campolo: Well, I never treated young people any differently than I treated old people. So it wasn’t that I had to change my style when I moved from one group to another. I think that young people don’t want to be talked down to. They don’t want to be treated as though they are a different species. They are progressive in their thinking and, more important than that, they are looking TONY CAMPOLO is professor emeritus of sociology at Eastern University and a former faculty member at the University of Pennsylvania. An American Baptist minister, he is the founder and president of the Evangelical Association for the Promotion of Education. He has written more than 35 books, including It’s Friday, but Sunday’s Comin’, Letters to a Young Evangelical: The Art of Mentoring, and 20 Hot Potatoes Christians Are Afraid to Touch. He and his wife Peggy live near Philadelphia. For more on his books, speaking schedule and other information, visit tonycampolo.org. A video portion of this interview is available online at baptiststoday.org. for something they are not finding in many churches. We have this movement called the Red Letter Christian Fellowship — calling people to be Red Letter Christians referring to [Jesus’ sayings] in the Bible. But what we are really saying is: Has the time come for us not simply to be sound in Pauline theology? And that’s very important. If you read Paul, you’ll learn about justification by faith — which is at the core of our Christianity. If you read the Gospels, you’ll get the lifestyle of the Kingdom of God. We need both of those things. We need some Pauline theology on one hand. We need directives from Christ on how to live. When you start dealing with what Christ really expects from us, you become socially dangerous. You begin to raise questions about such things as capital punishment — because Jesus said, “Blessed are the merciful, for they shall obtain mercy.” You begin to raise questions about militarism because Jesus said, “Love your enemies.” When he said that, he probably meant you shouldn’t kill them. He said when you have two coats you ought to give one of them away. I mean, when you go through the statements of Jesus, he is radical. And what young people like more than anything else is a radical call to obedience to Christ. Feature | 7 BT: What would you say to churches that are really serious about reaching young people but don’t know how to do it? Campolo: I think more than anything else we need to listen to what some observers outside the church are saying in answer to that question. Ernest Becker, in a Pulitzer Prize-winning book [The Denial of Death] on neo-Freudian sociology and psychology, says this: “When will the church learn that youth was made for heroism and not for pleasure?” That’s a profound statement. Too often we think we are going to attract young people if we can entertain them … but what the kids who we want to bring into the church are really looking for is an opportunity to do something significant for others in the name of Jesus. Kids who will never come to a Bible study will join a group to do Habitat for Humanity. When you say: “Would you like to go to Haiti and work with some poor people in a village?” — they’ll line up. They want to do something heroic. We always get the idea that if we can get them into the Bible then we can get them into action. That’s true, but it is equally true that if we can get them to do things that are biblical — doing heroic things for Christ and the kingdom — that will make them into people who want to read the scripture and who will have much to pray about. There is an interactive process at work here. Namely, what we read about and pray about affects what we do. But let us not forget: what we do affects how much we pray and how much we read the scripture. I think we’ve got to get our young people into heroic actions for Christ and the kingdom. BT: What is the ethical or social issue that’s really in your craw right now? Campolo: Oh, that’s a heavy one. I think that the social issue more than any other that has got me going is the poor and oppressed, of course. But I would think that militarism has got me upset. I don’t care whether you’re on the left or the right — both parties are saying that our nation is in trouble. The national debt has soared. We don’t have enough money to take care of elderly people. We’re talking about cutting back on Social Security. We’re talking about ending a whole 8 | Feature host of entitlement programs that are very, very necessary. The answer is quite simple: we are spending 40 percent of our income on the federal level for a military establishment. The war in Iraq cost $250,000 a minute. What’s more, almost 5,000 young men and women died over there. And we’re asking what was it all about. When we let our young men and women become cannon fodder and we spend the resources of the richest nation in the world in order to carry out wars that don’t seem to have any end to them, which have very little meaning to us, and which we probably shouldn’t be in at all — militarism scares me. I ask the very simple question: Can there be peace in the world unless the Israelis and Palestinians get together? And, yet, we’ve not listened to the concerns of our Palestinian Christian brothers and sisters. We act as if the Arabs are all Muslims. They’re not. Huge numbers of Christians are Arabs — and they feel themselves oppressed militaristically. And they look at the United States and say: “You are equipping those who are, in fact, oppressing us and destroying our dignity … You’re our Christian brothers and sisters and you don’t seem to care what’s happening to us.” So, militarism has all kinds of effects. I think it has an eroding impact on our young people. I think it has a frightening effect on our economy. BT: As a sociologist and as a minister, you have helped churches over the years to read sociological shifts. What is happening sociologically that church leaders should be aware of now? Campolo: What I think we are moving into is an era of the church taking on new forms. I’m amazed at how many church groups of young people are meeting in ways I never imagined. One of the guys in the Red Letter Christian Fellowship has a church in Manhattan that meets Sunday mornings in a large bar. He said: “Why build a building? I went to the bartender and asked, ‘Do you have much of a crowd here on Sunday morning?’ He said, ‘No.’ ‘What if I brought a church in here and I gave you a hundred bucks?’ ‘Great!’” So they are there. People come in the bar … and listen in. There are about 150 squeezing in this bar on Sunday morning. I never imagined that kind of thing would happen. My son Bart runs a program he doesn’t even call a church. But he’s in a very, very highrisk neighborhood. If you ever saw an area that was dangerous and slummy-looking, it’s his section of Walnut Hills, Cincinnati. He has a group of about 70 people who come together on Monday night and they have a dinner. They’ll play some games, and then he’ll share the message. I always thought the church was to be, you know, a call to worship and hymns. But we play some games, eat a meal and talk about the Lord. I could give you 15 different forms of the ways in which the church is spreading out and growing and experimenting with models. And I think I’m seeing that as a viable option to the traditional ways in which we have conducted church. But let me also say that I’m very optimistic about the church. A lot of Southern Baptist churches, which I love dearly, have gone into great difficulty, for instance, over the issue of women pastors. And then I see churches that heroically stand up against the broad mainstream of their denomination and say: “I’m sorry, when I read the scripture I see women in key roles of leadership — like Junia in the book of Acts. I see women preaching — like the four daughters of Philip who were preachers and prophets of God. I see too much of this; I affirm women in ministry.” And they get shot down and hurt. But in the end, when the final judgments are made about the church, there will be great respect for those who stood up for the hard issues. Let me just say this [during MLK weekend]: Right now, Martin Luther King is a hero of white people. But I’m old enough to remember when the churches were calling him a communist. And you’re old enough. BT: … and a troublemaker Campolo: Yes. A troublemaker, an agitator. All of the sudden it’s in retrospect that we begin to see him in his heroism. In the end, I’m not so concerned as to how many members we have in our church as I am concerned about how heroic the church has been in times when the great questions of our age were raised. And I see so much heroism and so much courage among ministers who … say with Martin Luther: “Unless I am persuaded by conscience or by scripture, I cannot and I will not recant.” I’ve got to be optimistic about a church that stands on biblical grounds for justice. BT OTHER VOICES — that call for taking Jesus seriously The next generation speaks By Tony Campolo T his new column in Baptists Today will be written by and for young people, but those of us who are not young will want to read it, too, because it will be about what young people are thinking as they view the Christian faith and how they believe the church has to change. These authors are more able than I am to express the concerns of today’s youth — and they have a better handle on what the church might do to respond to them. These authors likely will offer expressions of their faith that look different from what we older Christians are used to, and will state their convictions in ways that may disturb and even challenge how we think about what we believe. Probably, they will replace many of the “hot button” issues that dominate our present-day discussions with new ones, and the language they use may be confusing and perhaps even offensive to us. But as one of our old hymns tells us, “New occasions teach new duties, time makes ancient good uncouth, they must upward still and onward, who would keep abreast of truth.” Many of these young authors may no longer want to call themselves “evangelicals” or, for that matter, even “Christians.” For the vanguard of a coming generation of young people, these labels carry “image baggage” they want to unload. For instance, “evangelical” often conjures up in their minds an image of churchgoers who hold an array of values and attitudes they sometimes find offensive and contrary to the ways they read the red letters in the Bible (those words of Jesus highlighted in red). Even the time-honored title of “Christian” may pose problems for some of them. This is because “Christian” has become, in the secular media, an adjective describing militia groups in Africa, Zionist movements bent on taking land away from Palestinians, and those who too easily martyr Christianity to specific political parties — usually right-wing parties that sanctify nationalism. They also have suspicions about left-leaning Christians who would make Jesus into an advocate of the platform of the Democratic Party. When asked about party affiliation, they are prone to answer: “Name the issue.” They shy away from making any political party into the “God Party.” High on the list of the concerns of these writers will be the promotion of an activism that addresses the needs of the poor and oppressed directly, rather than through a political process they view with cynicism. They will propose building houses for poor people with Habitat for Humanity and traveling to Third World countries to learn from indigenous people what they can do to make “the world that is” into the world that ought to be. They will advocate going to people living on the streets to give them the food and blankets they need, rather than talking about homelessness at conferences and forums. For them, formulating what they believe is something to be done in the context of reflection in action. I am not suggesting that these authors will represent the vast majority of young people in today’s churches, but I do propose that more and more of our young people will be drawn to what these authors say and will find in their words something with which they can resonate. What you read in this column sometimes may cause cheering and sometimes shuttering. You probably realize, however, that the time has come when lecturing young people is over and a time for dialoguing with them is at hand. This column will give some of them a chance to say their peace to us, after which we will have to figure out how to answer them. This may be just what we need. BT “COME, follow me” EDITOR’S NOTE: Often we limit our hearing to voices similar to ours. This new column will allow for some other, usually more-youthful voices to speak about faith and the living out of Christianity in contemporary times. Writers will come from various denominational backgrounds and church experiences. This series is provided in partnership with the Red Letter Christians Fellowship (redletterchristians.org). Tony Campolo, who suggested the idea, sets the stage. Perspective | 9 Quality& Value brought together in one trusted resource Churches with group subscriptions to Baptists Today are well informed — and have consistently excellent Bible studies for Sunday school classes right in hand.. Calvary Baptist Church, Washington,. Emerywood Baptist Church, High Point, N.C., Forest City, N.C. First Baptist Church, Frankfort, Ky. First Baptist Church, Ft. Myers, Fla. First Baptist Church, Gainesville, Fla. First Baptist Church, Gainesville, Ga. First Baptist Church, Gastonia,annapolis, N.C. First Baptist Church, Knoxville, Tenn. First Baptist Church, London, Ky. First Baptist Church, Madison, N.C. First Baptist Church, Marietta, Ga. First Baptist Church, Marion, N.C. First Baptist Church, Middlesboro, Ky., Orangeburg, S.C. First Baptist Church, Pensacola, Fla. First Baptist Church, Rome, Ga. First Baptist Church, Sanford, N.C. First Baptist Church, Savannah, Ga. First Baptist Church, Spruce Pine, N.C. First Baptist Church, Sylva, N.C. First Baptist Church, Tifton, Ga. First Baptist Church, Tryon, N.C. First Baptist Church, Wilmington, N.C. First Baptist Church, Wilson, N.C. First Baptist Church, Winston-Salem, N.C. Forest Hills Baptist Church, Raleigh, N.C. Godwin Heights Baptist Church, Lumberton, N.C. Grace Fellowship Baptist Church, Meridian, Miss. Haddock Baptist Church, Haddock, Ga. Hendricks Avenue Baptist Church, Jacksonville, Fla. Highland Hills Baptist Church, Macon, Ga. Highland Park Baptist Church, Austin, Texas HomeStar Fellowship, Apex, N.C.. Lystra Baptist Church, Chapel Hill, N.C. Maranatha Baptist Church, Plains, Ga. Masonboro Baptist Church, Wilmington, N.C.. Rock Falls Baptist Church, Excelsior Springs, Mo. Rolesville Baptist Church, Rolesville, N.C. Rolling Hills Baptist Church, Fayetteville, Ark. Second Baptist Church, Liberty, Mo. Second Baptist Church, Little Rock, Ark. Second Baptist Church, Memphis, Tenn. Second Baptist Church, Richmond, Va. Second-Ponce de Leon Baptist, Atlanta, Ga. Shades Crest Baptist Church, Birmingham, Ala. Smoke Rise Baptist Church, Stone Mountain, Ga. Snyder Memorial Baptist Church, Fayetteville, N.C. St. Andrews Baptist Church, Columbia, S.C. St. John’s Baptist Church, Charlotte, N.C. St. Matthews Baptist Church, Louisville, Ky. Sugar Land Baptist Church, Sugar Land, Texas Tabernacle Baptist Church, Carrollton, Ga. Temple Baptist Church, Ruston, La. Trinity Baptist Church, Cordova, Tenn. Trinity Baptist Church, Seneca, S.C. Vineville Baptist Church, Macon, Ga. Viewmont Baptist Church, Hickory, N.C. Watts Street Baptist Church, Durham, N.C. Weatherly Heights Baptist Church, Huntsville, Ala. Wingate Baptist Church, Wingate, N.C. Winter Park Baptist Church, Wilmington, N.C. Woodhaven Baptist Church, Apex,. Classifieds In the Know Senior Pastor: The Memorial Baptist Church () of Greenville, N.C., seeks a full-time senior pastor. The new senior pastor will lead TMBC in fulfilling its mission to worship God, share Christ and serve others. He or she will proclaim the gospel, teach biblical truth, provide pastoral care, equip members to live out their Christian faith, and oversee the administration of the church. The successful candidate will be an ordained Baptist minister with a seminary degree and no less than five years of ministerial experience. To apply, send a letter of interest and a résumé with references by April 15 to Steve Beaman at beamans1@suddenlink.net or Pastor Search Team, 1510 Greenville Blvd. SE, Greenville, NC 27858. Music Ministry Resources: Choir robes (new and used), handbells, choirchimes, custom choral folders, music storage boxes, choral risers and choir chairs for sale. Contact Curtis Murdock, Baptist music minister for 35 years, at MurdockMusic@yahoo.com or (800) 868-0101 or MurdockMusic.com. Advertise today Details, discounts, reservations: advertising@baptiststoday.org 478-471-9274 Associate Minister for Administration and Senior Adults: Morningside Baptist Church in Spartanburg, S.C., a congregation of 1500+ members and a team of six ministers, is seeking an associate minister for administration and senior adults. Appropriate college and seminary degrees are required. Candidates must have the ability to coordinate the administrative responsibilities of the church and the senior adult program, and also have good communication skills. Morningside affirms women in ministry and worships in a traditional form. Send résumés to areggiehill@bellsouth.net or to Associate Minister for Administration and Senior Adults, c/o Reggie Hill, Morningside Baptist Church, 897 S. Pine St., Spartanburg, SC 29302. in your own words “We found the online ad to be very helpful in reaching out regarding our opening … [W]e ended up selecting one of the candidates who sent us her cover letter and résumé based on the ad.” st. andrews baptist church columbia, S.C. THE WALTER B. AND KAY W. SHURDEN LECTURES ON RELIGIOUS LIBERTY AND SEPARATION OF CHURCH AND STATE Mercer University, Macon, Ga. Steve Dominy is pastor of University Baptist Church in Shawnee, Okla., coming from the pastorate of First Baptist Church in Gatesville, Texas. Ida Mae Hays will retire as registrar and financial aid director of the Baptist Theological Seminary at Richmond in June. She served as a Southern Baptist missionary for 31 years in Brazil. She is pastor of Crossroads Baptist Fellowship in Weldon, N.C. Gary Gunderson is vice president of faith and health ministries at Wake Forest Baptist Medical Center in WinstonSalem, N.C. He will oversee spiritual care services to patients, families, staff and management as well as marketing and public relations services to Baptist churches. His areas include chaplaincy and the Center for Congregational Health. Ida Mae Hays will retire as registrar and financial aid director of the Baptist Theological Seminary at Richmond in June. She served as a missionary with the Foreign (now International) Mission Board for 31 years in Brazil, and is a former pastor of Weldon (N.C.) Baptist Church. While at BTSR she started a CBF church, Crossroads Baptist Fellowship in Weldon, N.C. Fred Loper, M.D., will end his service May 31 as executive director of the Baptist Medical Dental Fellowship. A former Southern Baptist home missionary, he will work with a charitable Christian medical clinic in Oklahoma City. Tuesday, April 17 Medical School Auditorium 10:50 a.m. “America Conceived as a Christian Nation? – The Separation of Good and Bad History” 5 p.m. “A Secular/Sacred Alliance in the Fight for Religious Liberty Wednesday, April 18 Newton Chapel 10 a.m. “Constituting the Separation of Church and State” Laura A. Barclay received the Bill J. Leonard Distinguished Service Award from Wake Forest University Feb. 16. The 2008 divinity school graduate is social ministries coordinator for the Cooperative Baptist Fellowship of North Carolina. Her work involves addressing poverty, justice, compassion and reconciliation issues. Speaker: Franklin T. Lambert, Professor of History, Purdue University Free and open to the public. Information: BJConline.org/lectures • (202) 544-4226 • jhuett@BJConline.org Rodger Murchison will retire in July from First Baptist Church of Augusta, Ga., where he has served as associate pastor for 25 years. It has been his only full-time ministry position. David Sapp will retire April 14 as pastor of Second-Ponce de Leon Baptist Church in Atlanta where he has served for 13 years. BT Sponsored by THE BAPTIST JOINT COMMITTEE FOR RELIGIOUS LIBERTY, Washington, D.C. Information | 11 BUBBA, others rejected Southern Baptists to stick (mostly) with same name By Adelle M. Banks Religion News Service A task force unanimously recommended that the Southern Baptist Convention maintain its official name but give members of the nation’s largest Protestant denomination the option of calling themselves “Great Commission Baptists.” The recommendation, approved overwhelmingly by the SBC Executive Committee Feb. 20, determined that changing the convention’s name was fraught with legal and logistical problems. Southwestern Baptist Seminary President Paige Patterson, a former SBC president and a member of the task force, had long favored a name change but said it is likely too difficult to pull off — citing the “enormous legal fees” involved in changing congregational and state convention names as well as trusts and other documents. He hopes the proposal, which will come before the SBC’s annual meeting in June in New Orleans, will satisfy those who wanted a name change: “I think that, if anything, it’s a case of our having our cake and getting to eat it, too.” Pastor Micah Fries of St. Joseph, Mo., another member of the task force, agreed: “This is probably the best-case scenario.” As the task force weighed a possible name change, denominational leaders were bombarded with hundreds of suggestions, most avoiding the word “Southern.” But one hinted at the denomination’s regional flavor: Baptist Ultimate Bible Believing Alliance, or BUBBA. Other intriguing, but rejected, names included: Association of Thriving Baptist Churches, Baptist Southern Convention, Christian Synergy Convention, Ends of the Earth Baptists, Eternal Baptist Convention, Friendly Family Church of America, Global Association of Immersing Christians, Jesus Christ is Lord Baptist Convention and League of Baptist Messengers. BT 12 | Information Seven million pennies Coin gathering grows, benefits children in poverty V ALLEY FORGE, Penn. — The Penny Project was started by the children of First Baptist Church of New London, N.H., as a regional project in 2007. Two years later, it gained national appeal through the American Baptist Home Mission Societies. Today, American Baptists have collected more than 7 million pennies to support programs aimed at improving the lives of children living in poverty. That milestone marks the halfway point to the ultimate goal of 14 million pennies. Why that goal? According to the National Center for Children in Poverty and the U.S. Census Bureau, there were 14 million children living in poverty in the United States and Puerto Rico (where American Baptists form a regional body) in 2008. More than 225 organizations — many of them American Baptist-related youth groups — have joined the effort to collect pennies and other coins to help children in poverty. Recently the children of New Creation Baptist Church in Wheaton, Md., were honored with a proclamation by Maryland’s Montgomery County Council for donating more than 300,000 pennies to two charities in their area. Earlier their penny collection had been stolen when it reached 40,000, but they began collecting again and surpassed the original amount. To view a video from the proclamation ceremony, visit youtube.com and search “The Penny Project.” Other Penny Project stories can be found at abhms.org, by clicking on “The Penny Project.” Groups interested in helping The Penny Project reach its goal — still 7 million pennies away — can join the effort at the American Baptist Home Missions web site as well. —Adapted from an American Baptist News Service release. CBF task force reveals work, seeks input By John Pierce Baptists Today DECATUR, Ga. — A 14-member task force charged with recommending changes to the structure of the 20-year-old Cooperative Baptist Fellowship shared its work Feb. 23 with the CBF Coordinating Council and other leaders. A key component of the extensive, initial report calls for carving down the governing council from its current size of 64 to 16. Two additional councils, without governing duties, would work with CBF staff in the areas of mission and ministries. Describing the Fellowship as his “heritage and hope,” task force leader David Hull said the 20-month experience of listening to and discussing various suggestions and drafting and refining the recommendations “was holy stuff for us.” However, the pastor of First Baptist Church of Huntsville, Ala., was not defensive about the report — encouraging feedback that would clarify and strengthen the document. The task force has gone back to work with the many and various responses to their presentation and will make a followup report to the council in June, prior to the CBF General Assembly. If approved, the report will be recommended to the larger assembly gathered in Fort Worth. The current report including explanatory videos may be viewed at thefellowship. info/2012taskforce. BT an analysis by david gibson, Religion News Service Name change? Re-branding religion hard to do, and not always successful NEW YORK — Did leaders of the Southern Baptist Convention hurt their missionary cause by opting not to change the denomination’s name to something a bit more, well, marketable? M aybe, but as the advertising executives of Madison Avenue could attest, as tempting as it is to try to solve a missionary slump with a marketing campaign, religious groups — like commercial businesses — should think twice before undergoing a brand overhaul. An SBC task force recommended against an official name change, an idea that has been bandied about for more than a century. Advocates argued that the name,” President Albert Mohler of Southern Baptist Theological Seminary wrote as the debate heated up. “If these issues can be resolved, even to any significant degree, by a name change, a Gospel-minded people would never hesitate to consider such a proposal.” There were also strong currents running against a change, however. “We believe that the equity that we have in the name Southern Baptist Convention is valuable,” said Jimmy Draper, head of the task force. “It is a strong name that identifies who we are in theology, morality and ethics, compassion, ministry and mission in the world. It is a name that is recognized globally in these areas.”. Campus Crusade for Christ, the worldwide ministry started in 1951 by the late Bill Bright and his wife, is this year introducing a new moniker, “Cru,” that some worry could become the “New Coke” of evangelical Christianity. Elsewhere, evangelical leader Tony Campolo has taken to calling himself a “Red Letter Christian” because he worries that the evangelical brand has become too politicized. (See related story on page 6.) The rock-ribbed Christians at Bob Jones University in South Carolina have been looking — so far in vain — for an alternative to the “fundamentalist” label that they once wore so proudly. Mormon leaders are also making a push to have the church called only by its formal name, The Church of Jesus Christ of Latter-day Saints, because they feel the “Mormon” label can be derogatory or raise undesirable associations with polygamist splinter groups.,” he said. “That applies to the religious world as much as it does to the business world.”. In the end, all the Southern Baptist task force could do was offer an unofficial alternative, “Great Commission Baptists,” for congregations that want at least something a little different. It seems unlikely the “GCB” moniker will win out, but an evolutionary approach to re-branding can work; International Business Machines effectively reinvented itself as IBM, and General Electric did the same by switching to GE..” BT “Brands exist to change behavior. That applies to the religious world as much as it does to the business world.” —Josh Feldmeth, head of the New York office of Interbrand Information | 13 Mormons warned against baptizing Holocaust victims, celebrities By Peggy Fletcher Stack Salt Lake Tribune SALT LAKE CITY (RNS) — Anne Frank, Simon Wiesenthal’s parents, Gandhi, Daniel Pearl, Elvis. Mormon leaders are fed up. O n March 2, the LDS church’s governing First Presidency,” LDS President Thomas S. Monson and his counselors wrote in a letter to all Mormon bishops, dated Feb.-eminent.” The letter from the church’s First Presidency is an emphatic step, said Philip Barlow, an expert on Mormon history and culture at Utah State University. “It says ‘we. In a statement, Abraham Foxman, national director of the New York-based AntiDefamation. “As two minority religions who share histories as the target of intolerance and discrimination, we will continue to work with each other to bring greater understanding and respect to both of our faith communities.” BT Richard Dawkins says he’s not entirely sure God doesn’t exist By Al Webb Religion News on Feb. 23, Richard Dawkins surprised his online and theater audiences by conceding a personal chink of doubt about his conviction that there is no such thing as a creator. 14 | Information.”.” BT Guest Commentary By Elizabeth Evans Hagan Baptists at the White House Delegation discusses partnerships beyond politics When a group of Baptist pastors and denominational leaders from across the country are invited to the White House for dialogue during an election year, one might assume a political conversation awaits. Or, that there is some hidden agenda on the part of organizers. O r, perhaps, that the room filled with Southern Baptists, American Baptists, Cooperative Baptists, Progressive Baptists and Alliance Baptists might soon erupt like kids in a schoolyard fight. Or that party loyalties would determine the quality of the experience of the day. But, think again. When a delegation of more than 60 “goodwill Baptists” gathered for conversation with senior and associate White House staff on March 7, partisan politics took a back seat to a unique opportunity for partnership building. Even as we knew that others in the room would have different opinions on just about everything — we are Baptists after all — our personal narratives connected us. “I want to hear your story and I want to share mine” was the motto of the day. Here are some of the stories shared by the gathered Baptists and government leaders: I want to tell you about a 10-year-old Latino boy from my community in the Midwest. Suffering from sleep apnea and a swollen tonsil so large that he was having trouble breathing, his options for medical care are sparse. With parents having neither documentation nor insurance, the life-saving operation that would allow him to go back to school to continue his education is out of his reach. What might this administration say to him? I want to tell you about one of our staffers who is currently facing a severe allergic reaction and can’t attend our debriefing this morning. Could one of you offer a prayer for him? I know he’d appreciate it. I want to tell you about the men I know in my predominantly African-American neighborhood. So many of our families are suffering because a son, an uncle, a father is in jail, going to jail or on probation. How might this administration seek to speak to the pipeline-to-prison phenomenon that prevails where I live? Ministry leaders and administrators mutually shared stories in the absence of cameras or the press, and a funny thing happened: doors opened for relationship. I was pleased to join several of my D.C.-area Baptist colleagues among others as we listened in. On countless occasions throughout the three-hour briefing session, White House presenters offered personal, direct and enthusiastic suggestions to topics such as immigration reform, the housing market crisis, credit fraud, human trafficking and disaster relief. Often agency names, phone numbers and websites were offered to specific problems with the shared response of Baptists: “I’ve never heard of that before. I’m glad to know that policy or program exists.” Together in an “I’m not trying to win your vote” and “I’m not going to be hateful to you even if I don’t like our President” posture, we could peacefully talk about issues that touch all of our families in one way or another. The longer we sat with White House staffers, the more apparent it became that this meeting was important. The entire experience felt like a rare opportunity for person-toperson dialogue among my Baptist family and those within earshot of the president to bring about tangible change. Even with all of the security procedures and bag checks required to get through doors and gates, even with the time away from pressing work responsibilities, and even with all of the personal stress I felt in answering the question of “What am I going to wear?” on the morning of the visit, our time together forged relationships. Certainly such a view couldn’t come from watching Fox News or CNN or reading the newspaper or even writing a concerned letter to my congressman hoping to get a reply. If we are going to move forward as a nation without constantly playing the blame game no matter who is in the Oval Office, then open lines of communication, mutual respect and commitments to person-to-person meetings have to continue. I hope this delegation of “good will” Baptists is only the start of a dialogue that we as a particular faith community can have with those we elect to lead us. Together, as we keep talking on- and offline about our hungry kids, broken schools and flooded townships, I trust we’ll begin to see the human face in every complex social problem at our nation’s doorstep. Most of all, my trip to the White House reminded me again that we can never have too many friends — among each other and in some high places, too. BT —Elizabeth Evans Hagan is pastor of Washington Plaza Baptist Church in Reston, Va. Perspective | 15 Church’s future tied to interactive communication By Natalie Aho T wo billion people (or 30 percent of the world’s population) are connected to the Internet. It is imperative that the church finds ways to be present online as well. When the Internet was introduced to the general public in the early 1990s, we were at the height of living in an isolated society. Clive Thompson called it “the modern American disconnectedness that Robert Putnam explored in his book Bowling Alone.” The Internet was released to the public as a way to share information — how we could move a document from point A to point B like a mail service. But now it is how people connect, collaborate and share life. It is inter-active. It is community. “If you look at human history, the idea that you would drift through life, going from new relation to new relation, that’s very new. It’s just the 20th century,” said Thompson. “Psychologists and sociologists spent years wondering how humanity would adjust to the anonymity of life in the city, the wrenching upheavals of mobile immigrant labor — a world of lonely people ripped from their social ties. We 16 | Perspective now have precisely the opposite problem.” The Internet provided a way for us to connect out of our isolation, from the convenience of our own homes. The church must accept that interactive communication, especially through social media, is a foundational shift in the way we communicate and even form relationships. We now have the opportunity and resources to communicate with the world and interact with people in a unique and instant way. We should not and cannot avoid online platforms such as websites, social media, blogs, podcasts and videos. The world needs us to have an online presence. We can worship, minister and live there. Of course, we have some concerns about this digital world: privacy, security, being misrepresented or misunderstood, a loss of reality or connection to the physical world, bullying (from both children and adults), predators, the need for discernment, moderation and accountability. We are all still working out this medium together, and there will be challenges, mistakes and pitfalls along the way. However, they do not outweigh the requirement for us to be there. Churches need to learn how to have an effective, engaging and welcoming website — a front door to the online world. Churches need social media community. Sites such as Facebook, Twitter, Google+, and Pinterest are about engagement, collaboration, activity and connection. Congregational leaders should know about blogs, YouTube and podcasts — and determine which is most helpful for connecting with their communities. The world is still crying out for the truth. That has not changed through all the various “ages” of society, nor is it any different now. People still hurt and need love. Through the Internet and social networks, we can make these connections faster, wider and deeper than ever before. Online connections allow for Christians to be among the people. BT —Natalie Aho of Mobile, Ala., is a communications specialist for the Center for Congregational Health and a communications specialist for Associated Baptist Press and Alabama Cooperative Baptist Fellowship. May lessons in this issue One for All What Hinders Me? — Acts 8:26-40 Could It Be? — Acts 10:44-48 Life Is Different Now — Acts 1:1-11 Well, Blow Me Down! — Acts 2:1-21 ™ Bible study curriculum for adults and youth Teaching resources at nurturingfaith.net HOW TO USE THESE BIBLE STUDIES 1. Order a copy of Baptists Today news journal for EACH MEMBER of the class. The weekly lessons are found only here. 2. Teachers can go to nurturingfaith.net to access all of the free resources needed for presentation. Teaching the Lessons After reading Tony Cartledge’s weekly Bible study lessons starting on page 18, Sunday school teachers and other Bible leaders can access helpful teaching resources (at no charge) at nurturingfaith.net. These include: * T ony’s video overviews *A dult teaching plans by Rick Jordan * Y outh teaching plans by Jeremy Colliver * T ony’s “Digging Deeper” notes and ”The Hardest Question” * L inks to commentaries, multimedia resources and more How to Order Bible Studies in Baptists Today are copyrighted and not to be photocopied. *O rders may be placed at baptiststoday.org or 1-877-752-5658. * T he price is just $18 each for groups of 25 or more — for a full year — with no additional costs. * All online teaching resources are available at no charge and may be printed and used by teachers of the Nurturing Faith Bible Studies. P opular Bible teacher and writer Tony W. Cartledge writes each of the weekly Bible studies in Baptists Today (beginning on page 18). Themes are based on selected texts from the Revised Common Lectionary. These lessons — found exclusively in this Nurturing Faith section of Baptists Today — form the foundation for the teaching resources for all age groups. Each class participant should have a copy of Baptists Today with these lessons in hand. Christian educator Rick Jordan of the Cooperative Baptist Fellowship of North Carolina provides a teaching plan for each lesson, available at nurturingfaith.net. His FIT FAITH approach to teaching allows for class engagement with the biblical texts as well as with one another. The Youth Lessons — found on pages 22-23 — build off of Tony’s Bible studies and direct these biblical truths to the daily lives of students. Curriculum developer David Cassady writes the youth lessons in the news journal, and student minister Jeremy Colliver provides the online teaching guides for each lesson found at nurturingfaith.net (or linked from baptiststoday.org). Acts 8:26-40 with Tony W. Cartledge May 6, 2012 What Hinders Me? W hat do we do with the resurrection story? It’s one thing to get all inspired on Easter, but another thing altogether to carry that Easter excitement onward. This was not, apparently, an issue for the earliest believers. This month we will explore their growing engagement with the resurrected Christ and a world in need of resurrection as we continue taking our texts from the book of Acts. These memorable stories emphasize the truth that God’s love, Christ’s work and the Spirit’s blessing are for all people. The aftermath of Christ’s postresurrection appearances turned the disciples’ lives upside down. No longer plagued by doubt but confident in their call, they proclaimed the gospel not only in Jerusalem, but also on into Judea and Samaria. Encounters such as the one we study today propelled the gospel even into faraway lands. The message of salvation through Christ is a borderless gospel offered to all who need the Savior’s grace, and no one exhibited that belief more clearly than Philip, an early believer and a powerful witness for Christ. Hearing God’s call (vv. 26-29) Luke, who wrote the Book of Acts, reports that Philip was called of God to go into the countryside and meet an Ethiopian eunuch who was returning to his home after a pilgrimage to Jerusalem (v. 26). The story is told so matter-of-factly that the appearance Additional background information online where you see the “Digging Deeper” icon of an angel garners little attention: the heavenly messenger’s function is simply to convey God’s direction to Philip. Philip, possibly one of the “seven” chosen in Acts 6:1-6 rather than the apostle, was called to meet an official in service to the queen of Ethiopia. Luke says that the unnamed administrator was in charge of the royal treasury, which would make him a person of considerable authority (v. 27). Surprisingly, the official had not come to Jerusalem on diplomatic business, but to worship. This indicates that he was a “God-fearer,” a term used to describe Gentiles who worshiped Yahweh, the God of the Jews. Having completed his mission, the man was returning home in a stately chariot large enough to include a bench on which he could sit and read (v. 28) while a driver handled the horses. Ironically, while the Ethiopian worshiped the God of the Jews, he could never become a Jew. Firstcentury Hebrews had rituals designed to incorporate proselytes from among the Gentiles, but they also remembered Deut. 23:1, which insists that no man could enter the house of Israel if his testicles were not intact. Although an angel had sent Philip to meet the Ethiopian, Luke says “the Spirit” prompted him to run along side the chariot (v. 29). Explaining God’s message (vv. 30-40) Philip found the eunuch reading something that clearly puzzled him. He knew he was reading from Isaiah 53:7-8. He knew it spoke of a suffering servant of God, but he did not understand the significance of what he was reading. Try to imagine how the Ethiopian felt. Let’s say that you are a plumber by trade, and someone has handed you a textbook on quantum mechanics — or that you are a computer engineer who thinks in digital code, and someone encouraged you to read a book on Eastern philosophy. Or, for that matter, imagine that you grew up in a home that practiced no religion at all, and someone asked you to interpret the book of Revelation. Any of those tasks would be quite a challenge. You need a certain amount 18 | © Nurturing Faith Bible Studies are copyrighted by Baptists Today. DO NOT PHOTOCOPY. Order at: baptiststoday.org of background and context before you can begin to grasp what is going on. Otherwise, what you’re reading might as well be written in Hebrew or Greek. The eunuch was probably reading from a Greek translation of Isaiah, because Greek was the language of commerce and politics. A Greek translation of Hebrew scriptures, now called the “Septuagint,” was widely known. He probably had little difficulty in reading the words of his scroll, but was finding it troublesome to interpret them. Isaiah 53:7-8 speaks of one who “was led like a sheep to the slaughter, and as a lamb before the shearer is silent, so he did not open his mouth.” The suffering one was humiliated and deprived of justice, the prophet said, and “his life was taken from the earth” (see also vv. 32-33). The eunuch had learned much of the law, and apparently he loved the law, despite the fact that it pointedly excluded him from full acceptance within Judaism. But this text from the prophets was beyond him. Seeing his confusion, Philip asked if he understood what he was reading, and the eunuch admitted he had no hope of comprehending without someone to guide him (vv. 30-31). Isaiah 53:1-8 is one of four texts that are often called “Servant Songs.” They are found in the part of Isaiah that is sometimes called “Second Isaiah,” because it seems to have been written during the exile, long after the original Isaiah was dead. The song speaks of a servant of the Lord who would willingly suffer and die in behalf of others. That whole concept was so far removed from the law with which the eunuch was familiar that he was rightly puzzled. Just a few years earlier Philip would not have understood it, either. But Philip had met Jesus. And, like other early Christians, Philip soon interpreted the puzzling texts as prophesies pointing to Christ, and because of that he could do what we read about in v. 35: “then Philip began with that very passage of Scripture and told him the good news about Jesus.” LESSON FOR MAY 6, 2012 Resources to teach adult and youth classes are available at nurturingfaith.net And, because the official understood the good news that Philip declared — the incredible good news that he could be fully accepted into Christ’s family despite his ethnic background and his wounded gender — the eunuch believed. He believed, and he wanted to act on his new belief. So, when they came upon a small body of water, he asked Philip if there was anything to prevent him from being baptized. Philip, seeing no reason not to proceed, baptized him (vv. 36-38). Living as God’s example (vv. 39-40) Once the evangelist had accomplished his purpose, as Luke tells the story, “the Spirit of the Lord snatched Philip away,” leaving the eunuch to continue homeward, rejoicing in his newfound faith (v. 39). The word for “snatch” is quite emphatic, suggesting the speed with which Philip was removed and set down in a place called Azotus, where he went on throughout the region and “proclaimed the good news to all the towns until he came to Caesarea” (v. 40). Azotus is the New Testament name for the old city known in the Old Testament as Ashdod, one of the five major strongholds of the Philistines. It was located in the coastal plain of southern Palestine. To get from there to Caesarea, on the northern coast of Palestine, Philip’s preaching tour would have followed the main coastal highway and brought him into potential contact with several large population centers. Reflecting on this story, which clearly portrays Philip as a model for evangelistic emulation, suggests several patterns of behavior that are worthy of a second look. First, Philip was a faithful follower of Jesus. Again, we note that he was not the apostle Philip, since 8:1 says all the apostles stayed in Jerusalem, while this man was in Samaria when the story began. He may be the Philip named as one of the seven men who were appointed in Acts 6 to lead the social ministries of the church in Jerusalem. If so, he would have been a man of compassion who shared the characteristic of being “filled with the Holy Spirit and with wisdom” (6:3). Secondly, Philip listened for God, and paid attention when God spoke. Perhaps it was because he was filled with the Spirit that Philip was so spiritually perceptive. We don’t know how he recognized the angel of God in v. 26, or how he sensed the message of God’s Spirit in v. 29. But, because Philip was apparently open and listening for divine guidance, he recognized when God was speaking to him. Third, Philip obeyed God, even when it was not convenient. God’s call sent Philip well out of his way. He had been in Samaria, in the northern part of Israel, but God’s call put him on a road that led southwest from Jerusalem and through the desert to Gaza, where it met the main north/south caravan route. It required some effort for Philip to get to the place of his appointment, and even more effort to keep it. He was told to “go to that chariot and stay near it.” The chariot, of course, would have been moving. Philip would have had to jog (at least) to keep up. Fourth, Philip reached out without prejudice. God called Philip to relate one-on-one to a total stranger, a totally different kind of person. The Ethiopian had darker skin and wore a different style of clothing. He came from a foreign land and had been raised with different customs. Greek would have been a second or third language to him, and his altered gender would have been offensive to observant Jews. But none of that hindered Philip from reaching out to him or baptizing him. Do we allow cultural, ethnic or gender-based differences to become obstacles to obedience as we hear Christ’s call? What hinders us? BT | 19 Acts 10:44-48 with Tony W. Cartledge May 13, 2012 Could It Be? F ollowing lectionary texts can sometimes be confusing because the church calendar overrides the thematic calendar. So, while all four lessons from Acts this month concern the growth of an unhindered gospel that welcomes all nations, they don’t follow chronological order. Last week’s lesson concerned Philip’s baptism of an Ethiopian official, followed by a preaching tour up the coast to Caesarea (ch. 8). Today’s lesson takes Peter to the coastal port of Joppa and then northward, also to Caesarea, where he experienced what is often called the “Gentile Pentecost” (ch. 10). Next week, however, we will drop back to the first chapter of Acts, followed a week later by the Acts 2 account of the first Pentecost. While this sequence seems out of order, it will serve the purpose of having us study Acts 2 on May 27, which is celebrated as Pentecost Sunday. Today’s passage is a short text from within a larger story. To fully appreciate it, we need a taste of what comes before and after, too. An act with seven scenes (9:32-11:18) Acts 10:44-48 could be seen as one scene within a two-act play in which the main character is the temperamental Peter, a faithful Jew who had become a leader among Christ’s disciples — the same Peter of whom Jesus said “upon this rock I will build my church” (Matt. 16:18). Additional background information online where you see the “Digging Deeper” icon It was one thing for Philip to proclaim the gospel and baptize uncircumcised Gentiles. It was another thing — a much bigger thing — for the more influential Peter to endorse the full inclusion of Gentiles in the nascent church. Thus, Luke provides a lengthy account of how Peter came to embrace Gentile believers as full participants within the church. Act One of Peter’s story (9:32-43) includes two scenes in which Peter works among Jewish believers, effecting miracles and drawing many to faith in Christ. Act Two (10:1-11:18) moves into the Gentile world and plays out in seven scenes. Scene one (10:1-8) leaves Peter in Joppa, staying for a few days in the home of a man identified as Simon the Tanner. The reader, meanwhile, is taken north to Caesarea, where a Roman centurion was granted a vision from God. Cornelius is described as a Godfearer, a Gentile who worshiped the God of the Jews but had not fully converted through circumcision. The text emphasizes Cornelius’s piety as a man who prayed constantly and gave generous alms for the poor. One afternoon about 3:00 p.m., as he knelt for Judaism’s regular mid-afternoon prayer time, an angel instructed him to send messengers to find Peter and bring him to Caesarea. We shift back to Joppa for scene two (10:9-16), which Luke says took place about noon on the following day. As we look in on Peter, he is praying alone on the flat roof of his host’s home. Peter also sees a vision, one that he finds troubling. Noon was neither a scheduled time of prayer nor a normal mealtime for first-century Jews, but the text observes that Peter was both prayerful and hungry when he saw a large sheet filled with four-footed animals, birds and reptiles descend to the roof. A voice told him to “kill and eat,” but Peter immediately objected, insisting that he had never eaten any profane thing. This suggests that all of the creatures before him were considered “unclean” or non-kosher, and thus off-limits to Jews (see Leviticus 11). 20 | © Nurturing Faith Bible Studies are copyrighted by Baptists Today. DO NOT PHOTOCOPY. Order at: baptiststoday.org The heavenly voice, however, insisted that “what God has made clean, you must not call profane” (10:15). The vision was repeated three times, apparently to make sure the stubborn Peter got the point. The Old Testament law clearly associated eating unclean food and having fellowship with unclean people (Lev. 20:24-26), and Peter was about to be challenged to do precisely that. Three messengers from Cornelius show up in scene three (10:17-23a), and the Spirit instructs Peter to accompany them without hesitation. Employing a lesson learned from the vision, Peter invited the men to come in and rest overnight, something that strictly observant Jews would not have done. Scene four (10:23b-33) relates Peter’s arrival and opening conversation with Cornelius and others who were gathered with him. Recognizing the odd nature of his visit in a Gentile’s home, and accompanied by other Jewish Christians, Peter sought to explain himself: “You yourselves know that it is unlawful for a Jew to associate with or to visit a Gentile; but God has shown me that I should not call anyone profane or unclean” (10:28). Cornelius then described his own vision and asked Peter to proclaim “all that the Lord has commanded you to say” (10:33). Peter’s sermon (10:34-43) comprises scene five. In it, he proclaimed the basics of the gospel message, the death and resurrection of Christ, and the command to proclaim the good news to all, calling for repentance and promising the forgiveness of sins. The running theme of this section finds emphasis in Peter’s opening words, in which he relates what he has learned: “I truly understand that God shows no partiality, but in every nation anyone who fears him and does what is right is acceptable to him” (10:34-35). Peter’s sermon was quickly interrupted, however, for scene six (10:44-48) relates how the Spirit of God was poured out on all who were gathered. The Gentile believers spoke in tongues and praised God, demonstrating LESSON FOR MAY 13, 2012 Resources to teach adult and youth classes are available at nurturingfaith.net the same evidence of the Spirit’s blessing that Jewish believers had experienced in Acts 2. Some of them had apparently accompanied Peter, and “were astounded that the gift of the Holy Spirit had been poured out even on the Gentiles,” the text says (10:45). Still, no one objected when Peter called for the Gentile believers to be baptized just as they had been. The last scene in the lengthy story (11:1-18) provides Peter’s recounting of his experience when he got back to Jerusalem and spoke with other church leaders. Some criticized him for having lodged and presumably eaten with the Gentiles, but Peter’s forthright defense silenced the critics: “If then God gave them the same gift that he gave us when we believed in the Lord Jesus Christ, who was I that I could hinder God?” (11:17). Unfortunately, the silence did not last, and the issue would have to be revisited (Acts 15). Scene six redux (10:44-48) With the larger context in place, let’s take a closer look at our text for the day. “While Peter was still speaking,” Luke says, “the Holy Spirit fell upon all who heard the word” (v. 44). There were no magic formulas involved, no official words of invocation to prompt the Spirit’s presence. Luke’s language suggests that the manifestation of the Spirit was at God’s initiative, not caused by anything Peter, Cornelius or the others had done. Believers may be blessed by the Spirit, but cannot invoke the Spirit’s gifting at will. Some have wondered whether the gift of tongues in Caesarea — where everyone present probably spoke Greek — mirrored the miracle of Pentecost, where people from many lands were gathered and the gift of tongues appears to refer to known languages, thus facilitating the spread of the gospel. Whether the tongues of Acts 10 refer to spoken languages or the “tongues of angels” of which Paul later spoke (1 Cor. 13:1) is unclear, but also beside the point. Whatever their flavor, the gift of tongues was interpreted as clear evidence of the Spirit’s acceptance of and blessings upon the Gentile believers. Peter ordered the new believers to be baptized “in the name of Jesus Christ,” just as Jewish believers had been baptized, and with no indication that they were required to be circumcised or to restrict themselves to kosher food before fully entering the family of faith. As we contemplate this passage, we rejoice in Peter’s newfound knowledge and the courageous obedience he showed in listening to the Spirit and extending acceptance to the Gentiles. Yet, we know that Peter later came under pressure to retreat from this bold position, leading to a public conflict with Paul, who charged that Peter had segregated himself from Gentile believers (Gal. 2:1-14). Where do we stand when it comes to showing acceptance to others? Are there people who would not be welcome to join our church due to their ethnicity, their background, or some other aspect of their identity? Even within the membership of our churches, are there some who are considered “insiders” and “outsiders”? Think personally: are there people you’d never volunteer to sit with at homecoming or a family night supper, preferring to stick with people who are more like you? Some of us might be able to relate stories of specific encounters that helped us overcome prejudice and become more inclusive, while for others it may have been a growing thing — or not. Peter’s experience reminds us of how hard it can be to accept Christ’s command to show inclusive love to all people. It takes intentional work to overcome our cultural, institutional and even supposedly biblical prejudices — but it is work worth doing, work God’s Spirit will help us to accomplish. BT | 21 Youth May 6 — May 27, 2012 Youth lessons are made possible through the generous support of the Eula Mae and John Baugh Foundation. Are You Serious? T here aren’t a lot of people in our lives for whom we will drop whatever we are doing and do what they wish. The rare exception might be a coach, our best friend, maybe even a boyfriend or girlfriend. In our passage for today, Philip drops everything when an angel of the Lord speaks to him. As if starting his day off with an angel speaking to him isn’t enough, Philip runs into a court official of the queen of the Ethiopians who is reading from the prophet Isaiah. Philip doesn’t have to ponder what to do for long because the angel instructs him to go and join the chariot. Philip’s day gets stranger when he sits down in the chariot with the official. The official who usually deals with money is reading one of the Servant Songs from Isaiah. This would be like you reading Shakespeare when your favorite subject is calculus; you know MAY 6 what the words say, but you don’t know what they mean. Philip wouldn’t have understood the Servant Song either if he had not had an encounter with Christ. The passage comes alive to Philip, and he shares its meaning with the Ethiopian man. This man had been to Jerusalem to worship. He was a God-fearer (a name for those who were not Jewish but still worshipped Yahweh) and knew of the laws that would not allow him to be a Jew (check out Deuteronomy 23:1). None of this stopped the man from asking Philip to baptize him right there in the river, however. His encounter with Christ led him to throw all that he knew out the window and to believe! Philip also knew that the man could not become a Jew, but that didn’t stop him either. They went down to the water together, and Philip baptized him. Think About It: Philip went! He didn’t just go and serve the Ethiopian man, but he continued to serve afterward in Azotus. How willing are you to go and serve where God calls you? Make a Choice: We take for granted that Philip chose to follow what the angel of the Lord called on him to do. Sometimes we even say no by ignoring what we hear. Make the choice to act on what God has called you to do. Pray: Pray that your ears will be open to hear and that your hands and feet will be willing to act when God calls. They’re With Us W ho’s your biggest rival? What team do you cheer against whether or not your home team is playing them? What team do you circle at the beginning of the year and say “we have to beat them”? Now imagine that you are attending the game against your rivals and your coach stands up, points at the opponents and says, “From now on we are all on the same team!” The roaring crowd would probably come to a complete stand-still, the cheering would be cut off to silence, and murmurs might start among the fans asking if the coach had lost his or her mind. The “they’re with us?” mindset of the crowd is the mindset that the early Jews would have had as they heard this story of Peter recounted to them. Peter was Jewish. He was also an active defender of the faith — to the point that he cut off a soldier’s ear when they came to 22 | Youth MAY 13 take Jesus away. Peter was also the one Jesus called “the rock” that the church would be built upon. Peter would be like the coach who gets up and gives the impassioned speech. As Peter was giving his speech, the Holy Spirit was poured out — even onto the Gentiles. The Jews who were with Peter were shocked and were probably rubbing their eyes in disbelief. To silence the speculation of what was being seen, Peter cleared the air by acknowledging the presence of the Holy Spirit within the Gentiles. He didn’t just give the event lip-service, but called them to action: to be baptized in the name of Jesus Christ; to be one people in the name of Jesus Christ. Sometimes we look for magic words that will bring about the Holy Spirit, but there were no magic words for Peter. It’s not our responsibility to decide who will not hear; it is our responsibility to speak. Think About It: It would have been a lot easier for Peter to stay and preach among people he knew and who accepted him. How is God calling you out of your comfort zone? Make a Choice: The gospel of Jesus Christ is for all people. Peter reminds us that sometimes we need to not choose who we share the love of Christ with, but share it with everyone around us. Pray: Ask God that you might have eyes to see how God sees others instead of how you choose to see others. Pray for courage to share when it is uncomfortable. David Cassady and Jeremy Colliver Act Two W hen you watch a sequel on TV, it always starts by referring back to what happened at the end of the previous episode. TV shows make this blatantly obvious when someone says, “Last time on ...” Movies also may do this in trailers for upcoming sequels. The writer of Acts does the same thing in the first five verses of Acts as he connects back to what he was telling in the Gospel of Luke: Jesus taught, was taken to heaven, and presented himself alive to many people for 40 days. Imagine what the disciples were thinking when Jesus presented himself to them again. Some doubted, others were relieved that their leader was among them again, and probably some were ready to take back the Kingdom. So, Jesus had to convince them again. But in all of this Jesus told them to wait. MAY 20 How hard would it have been to wait? Many of the disciples had been hiding for the past three days fearing that their fate may be the same as that of their Christ. What were they waiting for? Jesus was back among them. How long would they have to wait? We know what happens because we have the rest of the book of Acts, but the disciples were living it. Think about what it is like to wait for Christmas or your birthday … the anticipation you have — and you know when and what is to come. The followers of Jesus didn’t know when it was coming or what it would look like. At least Jesus had told them what was coming: the Holy Spirit. This Holy Spirit would bring them power so they might go and be his witnesses to the ends of the earth. Think About It: We don’t know the rest of our story, just as the disciples didn’t know what would happen after Jesus ascended to heaven. How will you choose to share Christ even when you don’t know where you will end up? Make a Choice: The fear of the unknown can bring some people to a standstill. How will you choose to overcome the fear of the unknown to follow where Christ leads? Pray: Pray that you will not follow blindly but that you will follow the will of God with the eyes of Christ. Bring It On! H opefully you’ve never been in the path of a tornado, but those who have said it sounds like a train is rushing toward them. Even if you haven’t been in the path of a tornado, you have been outside when the wind is blowing so hard that you can actually hear it. The whistle of the wind can sometimes even turn into a roar. When you begin to read the passage for today, imagine being gathered for a celebration. This celebration would have been Pentecost, which would have been a week of feasts. As you are gathered with your friends and family, a wind blows so violently that the sound surrounds you and tongues of fire rest on each of you. Through the wind and the fire you are filled with the Holy Spirit. On the day of Pentecost, the group was MAY 27 not small. Jews from every nation were present in Jerusalem. Many of them spoke their native tongues, but after being filled with the Holy Spirit they understood each other — regardless of the language being spoken. The situation was so extraordinary, the only explanation that those who hadn’t been filled with the Holy Spirit could come up with were that these people were drunk. Those who had received the Holy Spirit knew they were not drunk, so Peter stood up to defend them. His defense was practical: how could someone be drunk at 9 o’clock in the morning? His defense was also theological: the prophet Joel spoke of this day. The Holy Spirit is with us, too, and may still lead us to live in ways that seem hard to explain to others. Think About It: What Christian words or phrases do you use that your friends might not understand? With the help of the Holy Spirit, how can you help others understand what you say and do? Make a Choice: The Holy Spirit resides in each of us, but we have to choose to let the Holy Spirit in so that our lives may catch on fire as well. Will you choose to let the Holy Spirit move you? Pray: Offer a prayer of thankfulness for the Holy Spirit that still resides with you and in you today. Youth | 23 Acts 1:1-11 with Tony W. Cartledge May 20, 2012 Life Is Different Now S ome years ago, I was privileged to serve a mission church as pastor. We began with a handful of members and a heart full of desire to grow a church that would bring glory to God, bring new persons to Jesus, and bring to our community a quality center for worship, education, and fellowship. It was an intimidating task, but God was faithful, our members worked with passion, and the church became (and remains) healthy and vibrant. Beginning something new can be frightening, even when we have other models to emulate. Imagine how the apostles felt as they heard Jesus describe the awesome task that lay before them: nothing less than the preaching the gospel throughout the entire world. Life would be different now. Who’s in charge? (vv. 1-3) Though today’s lesson is our sixth in a series of studies from the Book of Acts, it drops back to the beginning of the book in celebration of Ascension Sunday (May 20) and in preparation for next week’s celebration of Pentecost. The opening verses remind us that the Book of Acts is the second part of a two-volume work that Luke composed and dedicated to his friend (or patron) Theophilus. Luke’s purpose is to explain the life and work of Jesus, both before and after his ascension. In volume one (the gospel), Luke said he had written “about all that Jesus did and taught from the Additional background information online where you see the “Digging Deeper” icon beginning until the day when he was taken up to heaven, after giving instructions through the Holy Spirit to the apostles whom he had chosen” (vv. 1-2, NRSV). Now, Luke begins the Book of Acts by overlapping with the end of the gospel and describing Jesus’ postresurrection appearances in more detail. His purpose was to make it clear that Christ remained the guiding force of the church, even after his resurrection and ascension. Thomas was not the only follower who needed convincing that Jesus was still alive, and in charge. Perhaps this was why he “presented himself alive to them by many convincing proofs, appearing to them during 40 days and speaking about the kingdom of God” (v. 3). How many “convincing proofs” would it take for us to truly believe Christ had risen from the dead and now fully expected us to go out on mission? During this time, Luke tells us, Jesus’ teaching focused on the kingdom of God, the eternal reign of God over all things, a kingdom in which we are called to be willing subjects. Jesus’ followers, however, like many modern dispensational premillennialists, still expected the kingdom of God to be expressed through the Jewish nation. The promise of power (vv. 4-8a) Jesus knew his followers would need more than knowledge to carry out his purpose: they would need spiritual power. So, “he ordered them not to leave Jerusalem, but to wait there for the promise of the Father” (v. 4). The “promise of the Father” would be fulfilled by the power of the Spirit, for Jesus declared that his followers would “be baptized with the Holy Spirit not many days from now” (v. 5). In his gospel, Luke had recorded the words of John the baptizer: “I baptize you with water; but he who is mightier than I is coming, the thong of whose sandals I am not worthy to untie; he will baptize you with the Holy Spirit and with fire” (Luke 3:16-17). The scriptures are painfully honest 24 | © Nurturing Faith Bible Studies are copyrighted by Baptists Today. DO NOT PHOTOCOPY. Order at: baptiststoday.org in showing how hard it was for the disciples to grasp the true meaning of the master’s teaching. Despite their newly strengthened faith in the risen Christ, this is no exception. When Jesus spoke of an outpouring of the Spirit, his followers immediately assumed that Christ was about to fulfill Old Testament hopes of the last days, when a messiah would lead Israel to receive divine forgiveness and renewed national power. “Lord,” they asked, “is this the time when you will restore the kingdom to Israel?” (v. 6). Again, Jesus had to correct their misconceptions. The kingdom of God was not about an eschatological future (v. 7) but about the challenging present, not about a restored nation but a global mission. In the gospels, Jesus had said even he did not know the “times and seasons” of the last days (Mark 13:32). Now he reminds the disciples that their business is not to worry about the “then,” but the now. The disciples’ kingdom task was an immediate assignment, but they would need God’s help to perform it. And so Jesus promised: “you will receive power when the Holy Spirit has come upon you …” (v. 8a). We understand this to be a prediction of what would be fulfilled in Acts 2:4, our text for next week, when the Spirit came like a mighty rushing wind and filled the gathered followers with a new and incredible sense of God’s presence and power. Through his periodic post-resurrection appearances, Jesus was teaching his disciples that he was still with them, even when they could not see him. Through the post-ascension outpouring of the Holy Spirit, Jesus would demonstrate clearly that he was still present. The Holy Spirit is the spirit of Christ, living on in the hearts and lives of believers. A worldwide witness (v. 8b) The Spirit would not only comfort Christ’s followers, but also energize their work and witness in the world. “But you will receive power,” Jesus LESSON FOR MAY 20, 2012 Resources to teach adult and youth classes are available at nurturingfaith.net said, “and you will be my witnesses in Jerusalem, in all Judea and Samaria, and to the ends of the earth” (v. 8). This statement is so familiar to us that it’s easy to overlook how radical it is. Remember that Jesus was speaking to a rag-tag band of disciples who were still hiding behind locked doors for weeks after Jesus’ crucifixion. Now Jesus expected the same fearful followers to go out into the streets of Jerusalem and publicly proclaim their relationship with him, though it would be dangerous business — so perilous that the Greek word for “witness” furnishes the root for our English word “martyr.” Jesus expected his followers to not only witness in Jerusalem, but also throughout Judea, the homeland of Jewish power and influence. There would be opposition, antagonism and danger every step of the way. Yet, Christ expected them to be faithful in their testimony. Jesus’ challenge extended even further, as he instructed his followers to witness in Samaria. That region was geographically close, but culturally distant and ethnically inimical. Jesus’ early followers were predominantly Jewish, and they had grown up with an intense hatred for Samaritans, former Jews who had become excluded during the postexilic period. Nothing less than the clear mandate of Christ and the power of the Spirit would impel the Jewish believers to carry the gospel into such a place. Jesus concluded his missions mandate with a phrase that has rung in the ears of Baptists throughout our history: “… and to the ends of the earth.” God loved the world so much that he gave his only Son that whosoever believes in him will not perish. Christ died for all people. This good news has global significance, but the peoples of the world cannot know this unless the followers of Jesus spread the word. The disciples faced many barriers as they contemplated the mission Jesus set before them. They would face the external barriers of open conflict and physical danger as they challenged the Jewish people to accept Jesus. They would have to deal with the internal barriers of their own prejudice and small-mindedness as they travelled on to Samaria and to the ends of the earth. Nothing less than the power of God would lead these followers out of their hiding places and into the light. Nothing less than the present Spirit of Christ would set them free from their narrow provincialism and send them forth to proclaim grace to people they had been trained to despise. Ascendant, yet present (vv. 9-11) This is why it was so important that Jesus impress upon his followers the indelible truth that, though he was leaving them physically, he would always be present through the Spirit. The disciples had seen Jesus crucified, had seen him buried, and had seen him resurrected. Now, they saw him ascend into heaven (v. 9). They could no longer see Jesus in the flesh, but had no doubt that he was alive and active. Soon they would taste his power. There is both humor and instruction in the angel’s question: “Why are you looking up toward heaven?” (vv. 10-11). Where else would they be looking? But what the angel’s question implies is this: “If you want to see Jesus now, go to Jerusalem and Judea and Samaria and to the uttermost parts of the earth. To stay in touch with Jesus, don’t look up to the heavens; look inward to the Spirit and outward to the mission field he has given you.” It is only through the power of Christ’s Spirit that we can overcome the timidity, apathy and prejudice that stifle our witness. Jesus’ challenge is just as real today as it was before the first church building ever took shape. As long as there are people in the world who don’t know Christ, his followers will never be out of a job. BT | 25 Acts 2:1-21 with Tony W. Cartledge May 27, 2012 Well, Blow Me Down! T oday we celebrate Pentecost Sunday. Liturgical churches that display symbolic colors for the church year may drape the pulpit or communion table with red. The pastor may wear a red stole or necktie. Women ministers may wear red shoes (most men can’t pull that off). The red color reminds worshipers of the tongues of fire that marked the Holy Spirit’s indwelling presence in the lives of those who experienced the first Christian Pentecost. Worship planners often seek to recall the excitement of that day through stirring hymns or dramatic readings, and fiery (if not “brimstony”) sermons. It is a day for celebrating the amazing gift of God’s Spirit. A mighty wind (vv. 1-4) The familiar story is worth a closer look. Jerusalem was a cosmopolitan city with residents from all over the world. The streets may also have been packed with Jewish pilgrims who had flocked to Jerusalem to celebrate the Feast of Weeks. The NRSV begins with “When the day of Pentecost had come,” but the word translated as “had come” might be rendered better as “was fulfilled,” an expression that suggests more than a date on the calendar arriving. Jesus began his ministry by saying “the time is fulfilled” (Mark 1:15, using a related word), and he had spoken earlier of prophecies concerning the coming of the Spirit being fulfilled (Acts 1:4-5, 8). Additional background information online where you see the “Digging Deeper” icon Who were the people “gathered in one place” (v. 1), and where were they? In the previous chapter, 120 persons had been gathered in the upper room of a large house as they contemplated the meaning of Christ’s ascension, heard Peter speak, and chose Matthias to replace Judas as the 12th apostle (1:12-26). Perhaps we are to imagine a similar number of followers, possibly in the same place. As they gathered that morning, Luke says that suddenly, “from heaven there came a sound like the rush of a violent wind, and it filled the entire house where they were sitting” (v. 2). Luke’s account implies that the sound originated with God, for it came “from heaven.” The “violent wind” was apparently more sound than fury. The NRSV’s “rush of” (NET “blowing”) actually translates a verb that normally means “bringing” or “carrying.” The whistling sound did not indicate the movement of air, but the arrival of something remarkable. That something, we will learn in v. 4, is the Holy Spirit. In another sign of the Spirit’s presence, tongues of flame appeared and hovered over the heads of all who were gathered there (v. 3). Ordinarily, one would think that a sudden wind would blow out small flames; this wind blew them in. Both wind and flame were common symbols of a theophany, the presence of God. Luke understands the presence of God to be in the form of the Holy Spirit (v. 4), sent in fulfillment of Jesus’ promise (1:8). In a further sign of the Spirit’s presence, the gathered believers began to speak, but not in their normal fashion. In Greek, the same word (glossa) is used for the tongues of flame and the other tongues with which they spoke, clearly suggesting there is a spiritual component to the speech. Although the familiar King James Version uses the word “tongues” in v. 4, “languages” would be a better translation, since the following verses indicate that people from other lands heard them speak in their own languages. 26 | © Nurturing Faith Bible Studies are copyrighted by Baptists Today. DO NOT PHOTOCOPY. Order at: baptiststoday.org Bewildering speech (vv. 5-13) With v. 5, Luke shifts the scene from events inside the room to a great crowd that had gathered outside. As modern folk hearing a crash or explosion might rush to see what had happened, people walking or living nearby apparently heard the same “sound like the rush of a violent wind” that had filled the house, and they came to see what the excitement was all about. If they could see the flames reportedly hovering over those inside, they might have been even more amazed that the building was still standing. Luke does not locate the building, but the size of the crowd gathered outside (from whom 3,000 were baptized, according to 2:41), suggests it might have been on the edge of a large public square or some other open space, possibly near the outer courts of the temple. Luke also says nothing about how the diverse multitude was able to hear the newly “spiritized” persons as they spoke in languages that every person present could understand. Did the empowered believers rush from the building to mingle with the crowd and testify to Christ’s mighty works? Did some of the group stand on steps or a raised platform? Peter reportedly addressed the entire crowd while standing with the other 11 disciples, apparently in view of those gathered (2:14). The people expressed bewilderment, not so much at what the disciples said, but that they could understand what they said, since all of the speakers were from Galilee (vv. 6-7). Jesus had called his first disciples in Galilee, where most of his active ministry took place, and had many followers other than the 12. Galileans were known for their distinctive regional accent (see Luke 22:59), yet on the Day of Pentecost, people throughout the international audience heard them speaking in their own native languages. Scholars and others have long LESSON FOR MAY 27, 2012 Resources to teach adult and youth classes are available at nurturingfaith.net debated whether the miracle that day was one of speaking or of hearing. Were the disciples given the ability to speak (and presumably understand) a known language, or were they uttering some sort of heavenly language their audience could miraculously understand? The text could lend itself to either interpretation, but the plainer sense suggests they were speaking a known language. Modern missionaries working in a non-English-speaking country typically spend the first two years of their assignment in language school, learning to communicate with the people they hope to reach. Because of Pentecost, the first wave of missionaries required no such preparation. Note how Luke combines the observations of many people into what appears to be a single speech as he lists the nations represented that day. Though from different parts of the world, members of the crowd were uniformly Jewish — but not uniform in their response. Though “all were amazed and perplexed” by the events, wondering what it was all about (v. 12), “others sneered and said, ‘They are full of new wine’” (v. 13). Some interpreters see evidence in v. 13 that the disciples were speaking in glossolalia, or unknown tongues, and that some could understand it, while to others it sounded like gibberish. It’s also possible that people could have been overhearing other foreign languages they did not understand, which could also have sounded like nonsense. Cynically, they accused the speakers of being drunk on new wine. An insightful sermon (vv. 14-21) Peter was generally the most outspoken of the disciples, so it’s not surprising that he offered a quick response, forcefully addressing the crowd as “you men of Judea and all who live in Jerusalem” and insisting they should “listen to what I say” (v. 14). Charges of drunkenness could easily be dismissed, as Peter said it was only 9 a.m. (v. 15). Wine often accompanied an evening meal, but was not commonly consumed in the morning. Those who were speaking in new languages were not inebriated by spirits, but inspired by the Spirit. Peter spoke as if his listeners should not be surprised at what they saw. Quoting a familiar scripture, he described the miraculous movement of the Spirit as nothing more than the fulfillment of Joel’s ancient prophecy that a time would come when God would pour out his Spirit on all people, so that people of every race and gender and age would experience God’s Spirit and express their faith through prophecy (vv. 17-18). Peter reminded his hearers of how Joel had indicated that the day would be marked by signs in the heavens and on earth — signs much like those that had accompanied Christ’s death on the cross (vv. 19-20). Likewise, he pointed to Joel’s prediction that such an event would throw open the gates of heaven, so that “everyone who calls on the name of the Lord will be saved” (v. 21). Our text ends at v. 21, but Peter’s sermon continues through v. 36 as he quoted psalms attributed to David. Peter argued that David had predicted the coming of a messiah and called him Lord, which would connect back to the closing line of the quote from Joel, that “everyone who calls on the name of the Lord shall be saved.” As modern disciples celebrate Pentecost, we need not expect to see it repeated, for the Spirit of Christ has not left the earth and does not need to be “prayed down” again. Those who know the power of the Spirit are not those who happen to be in the right place at the right time, or have hands laid on them in a ceremonial fashion, but those who are humble enough to surrender themselves to the present Lord, whose power is greater than our own. BT | 27 Adventures with Luler the Hound I Kelly Belcher The Bow-Wow Luler says to get to know the n May, a young hound dog’s fancy turns to running fast parts of your sanctuary by toward the smell of something new. The weather is name and by heart like she warmer, and Luler wants out of the house to roam free knows her backyard. and follow the path of her snout’s desire. But first she runs around checking out all the regular spots in the yard where she has found something that smelled good before. She’ll go each time in exactly the same order: first the flowerpot, then up the steps to the snake’s hidey-hole, then to the fence and garbage can (she loves that), then to the tree where squirrels live – 1,2,3,4,5. The yard is her sanctuary. What if we did the same thing and found all the important places in our own sanctuaries? Close your eyes and let your memory lead you the way Luler’s snout leads her. In your imagination, walk down the aisle of your church’s sanctuary, past the pews, to the altar or communion table, then to the pulpit, then over to the organ or piano, then to the baptistery, then to your usual worship seat. What important things have happened to you in these spots? ? ? ? The Idea Box Draw a map of your church sanctuary. Do you know the names of the furniture and worship items? What parts are you curious about? More Online: Jump online at nurturingfaith.net to discover weekly ideas for children’s leaders. 28 | Children Media Michael Parker and James Houston A Vision for the Aging Church: Renewing Ministry for and by Seniors A review by Jackie B. Riley, Managing Editor Aging church offers challenges, opportunities “Youth are the church of tomorrow.” For years we have heard this statement in church circles. Based on current population trends of society in general and the church in particular, however, authors Parker and Houston would say that “elders are the church of tomorrow.” S eniors are not the problem, they contend, but rather the solution. The aging church offers opportunities as well as challenges. Therefore, Parker and Houston call on the church to … • Address the moral issues related to caring for seniors. • Provide successful care-giving programs. • Restore broken connections across the generations. • Promote the care and employment of seniors, healthy caregiving practices, caregiving support, late-life planning, aging-in-place initiatives, and strategies for successful aging. • Uphold the inherent value of dependent, disabled people. • Reconceive the place and part of the elderly in local congregations. • Create a vision for change in which the church is a clear stakeholder. • Work with community-based and ecumenical partnerships. The authors develop their case well throughout five parts titled “An Ageist Zeitgeist,” “Biblical and Historical Themes of Aging,” “Solutions for an Aging Church,” “Late Life Significant Living,” and “Finishing Well.” The stage is set with the authors telling the Old Testament story of Nehemiah and the people of Jerusalem joining together to rebuild their city walls, and then relating it to the need for churches to involve elders with persons of other ages in rebuilding modern communities — rather than simply being recipients of caregiving. This intergenerational approach is confirmed in several ways, including an expanded meaning of caregiving that includes the spiritual and relational dimensions, a theological-scientific approach that explains the benefits of an aging church, and examples of successful intergenerational programs. The discussion of depression and aging is enlightening — and should garner close attention. The chapter on Alzheimers disease and dementia explains the latter as not only deterioration of the brain but also of a diminishing social environment — and thereby establishes the need for greater involvement of the church with aging persons. The epilogue relates back to the prologue about Nehemiah and rebuilding: “What a responsibility it is … to be a Christian elder … sometimes giving and sometimes receiving, but always united in Christ and by the scars affixed from a lifetime of service!” A Vision for the Aging Church needed to be written. Few seminaries offer courses on aging and ministry, so ministers are not well equipped to lead their congregations in dealing with issues regarding the elderly. This volume offers substantive instruction for congregations of varying sizes and faiths and also for secular leaders. And, who better to write it than two people who portray the role of intergenerational connections they advocate? James Houston is an Oxford-educated theologian in his 80s and the author of 40 books. Michael Parker felt a strong spiritual calling in midlife to redirect his career toward specializing in gerontology, and now teaches at the University of Alabama medical school. These two formed a friendship and professional partnership over issues regarding aging populations in churches. Endorsed by physicians and sociologists along with ministerial professionals, A Vision for the Aging Church ably combines research and scriptural application. The blend of academic and ministry aspects flows naturally and in a positive tone that makes sense and also confirms the need for the church’s role in caregiving and seeing elders as positives to the church. The book is not a quick read, but is nevertheless quite approachable and understandable because of the short chapters and thoughtfully organized text. BT Perspective | 29 by bruce gourley, Online Editor In their own words AND THE AMERICAN As the month of April dawns, the Confederacy is reeling from Union advances in the state of Tennessee. Andrew Johnson now serves as the military governor of Tennessee, appointed by U.S. President Abraham Lincoln. Meanwhile, U.S. General Ulysses S. Grant advances into the southwestern portion of the state. D isillusioned but not entirely defeated, the Confederates regroup in western Tennessee. Stopping Grant’s advance is imperative. On April 6, two Confederate armies launch a surprise attack on Grant’s army, which is leisurely encamped near Shiloh Baptist Church, a small log church inland from Pittsburg Landing on the Tennessee River. Confederate forces, some 55,000 strong under generals Albert S. Johnston and P.G.T. Beauregard, push Grant’s army back toward Pittsburg Landing. Thousands of Union soldiers are captured in the bloodiest day of the Civil War to date. As night falls, the Confederates are certain they have bested Grant. Yet Union reinforcements arrive in the evening, and the next morning Grant launches a counterattack, driving the Confederates back to the Shiloh Baptist Church, where they make a last stand before retreating in defeat. The Union thus wins a great victory, while the Confederacy suffers a shocking defeat. In response, President Lincoln decrees a national day of Thanksgiving, while the Confederate Congress passes the South’s first Conscription Act. Beyond the momentary emotions, the carnage of the Battle of Shiloh is staggering: 10,000 Confederate casualties and 13,000 Union casualties. One year into the war, any hope of the conflict ending with one great battle is lost. North and South now realize the immensity of the challenges ahead. In the wake of Shiloh, Rev. S. Dryden 30 | Feature Phelps of the First Baptist Church of New Haven, Conn., preaches a sermon titled “National Symptons,” in which he declares: A year of civil war in our country we never expected to witness. But it is now a matter of experience and history…. we believe a New and brighter Day will spring from this National night of ours. Its symptoms already appear. Its strokes of dawn gild the horizon. The first anniversary of the war comes with events as startling as those that marked its beginning, and far more propitious…. God signals the coming Morn by His manifest Interpositions in our behalf…. The morning cometh evidently, from the present aspects of the everperplexing Slavery question. There is now increasing hope of our ultimately becoming a free nation…. This war, waged by its instigators in the interest of human bondage, has done more to break down that system, and thus freed more slaves in one year, than all other agencies seemed likely to accomplish in a lifetime. Indeed, slavery can never regain its former power, but must in time pass away, as utterly at variance with the fundamental principles of our Republic and the moral sense of the civilized world, and no doubt abhorrent to God, who seems to be over-ruling the wrath of man for its overthrow…. O blessed Day of death 150 years ago q April 1862 to Treason and Slavery, come! O glorious Day of a brighter Liberty, and a freer Land, over all which the starry folds of our dear Banner shall wave in triumph and peace, come! Come, O longed-for Day of Righteousness, and thou conquering Prince of Salvation, come! Union triumphs this month do not stop at Shiloh. Fort Pulaski on the coast of Georgia is captured by Union forces, sealing off coastal access to Savannah. Union naval forces sail up the Mississippi River and force the surrender of New Orleans. President Lincoln frees the remaining 3,500 slaves in Washington, D.C. Yet, as the month draws to a close, white Southern Baptists are undaunted. The Georgia Baptist Convention meets and passes the following resolutions: Resolved, That while profoundly feeling our cause is just, we nevertheless have great reason to humble ourselves before Almighty God, and to acknowledge his chastening hand in our late reverses. Resolved, That we find in the present circumstances of the country no cause for discouragement; that God, our heavenly Father, often chastens most promptly those whom he most loves; and that, trusting in Him with the whole heart, we are more and more determined, by His blessing, to oppose the invader of our soil by ever means placed in our power and to the last extremity. The stage is thus set for three more years of an increasingly-bloody war. BT —For a daily journal along with references to source material, visit civilwarbaptists.org. The Lighter Side By Brett Younger Runaway Bunnies The graduates sang a rousing rendition of “We’re on Our Way to Kindergarten.” Mrs. Ayres gave out the “Certificates of Completion.” (They went in alphabetical order. Youngers learn to be patient.) We had cupcakes and cookies and then stepped out into the bright light of the post pre-kindergarten world. I enjoyed graduation, but the real rite of passage took place earlier that morning in my office at 8:05. Almost three years earlier, Caleb began attending the Children’s Center at our church two mornings a week. On his first day Caleb was apprehensive, so we took three books from home (Spot Counts from 1 to 10, But Not the Hippopotamus, and The Runaway Bunny) to read before going downstairs. The next day we read the same three books. We kept them on my shelf, but soon decided to pick a book from the church library each day. We quickly had a full-blown ritual. We would drop Graham off at school, park in front, unlock the door, turn on the lights, go to the library, pick out a book, and read it in my office. As a 4-year-old, Caleb came to the Children’s Center three mornings a week. The next year, it was five mornings. So, we read in my office more than 300 mornings. We learned about nature (Our Yard Is Full of Birds). We read books with noises (The Very Quiet Cricket) and blinking lights (The Very Lonely Firefly). We made friends with Corduroy, Babar, Chrysanthemum, and Wilfrid Gordon McDonald Partridge. We introduced discussions on the family with Daddy Makes the Best Spaghetti — my favorite — and dealt with social issues such as prejudice (Frog and Toad Together) and war and peace (The Butter Battle Book). We tackled theology with God Made It All, Carol Beth Learns about Following Jesus and When I Talk to God. Brett and Caleb Younger enjoying great literature As we opened the front door on our last day of pre-kindergarten, I said: “Caleb, this is the last morning we’ll read a book before going downstairs, so pick a good one.” He thought about it for a long time. I thought he would choose a recent favorite — The Little Baby SnoogleFleejer, The Cowboy and the Black-eyed Pea, or The Giant Jam Sandwich. Instead my suddenly very grown-up soon-to-be-kindergartner said, “Let’s read the old ones.” It may have been the last time that I heard Spot Counts from 1 to 10. We counted one cow chewing, two horses trotting and three ducks swimming. We squealed with four piglets squealing, clucked at five chickens clucking, and when 10 bees buzzed we shut the book fast before any could escape. We read But Not the Hippopotamus in unison. We reminisced with the hog and the frog cavorting in the bog, the cat and two rats trying on hats, the moose and the goose who together have juice, and the bear and the hare who went to the fair. When the animal pack came running on back saying “Hey come join the lot of us” and “She just didn’t know. Should she stay? Should she go?” … we shouted joyfully “But yes the hippopotamus!” and feigned tears on “But not the armadillo.” The Runaway Bunny, not normally a tearjerker, got to me. The little bunny (just like, I imagine, every pre-kindergarten graduate) feels a need to put some distance between him and his parents. His mother keeps saying, “If you run away, I will run after you. You are my little bunny.” If he becomes a fish, she will be a fisherman. If he becomes a rock on the mountain, she will be a mountain climber. If he becomes a bird, she will be a tree to which he comes home. By the time we read that if he became a little boy, she would be his mother and catch him in her arms and hug him, I was telling Caleb that my allergies were acting up. My little bunny is now waiting on college admission letters. Caleb will graduate from high school next month.This graduation may feel even more momentous than pre-kindergarten. In our mushiest moments we know that the love we know overwhelms all the sorrow we feel. BT —Brett Younger is associate professor of preaching at Mercer University’s McAfee School of Theology. Perspective | 31 Atheists likely to outnumber Christians in England in 20 years By Al Webb Religion News Service.”.BT Israeli postmen refuse to deliver Hebrew-language Bibles By Michele Chabin Religion News Service JERUSALEM — Israeli postal workers outside Tel Aviv are refusing to deliver thousands of copies of the New Testament and other Hebrew-language Christian materials. Israel media reported that dozens of religious and secular Jewish mail deliverers jointly informed their supervisors that disseminating the materials goes against their religious beliefs. 32 | Information The workers, who deliver mail in Ramat Gan, assert that delivering the items would be tantamount to proselytizing and therefore a violation of Jewish law..” BT by tony w. cartledge, Contributing Editor GLOBAL BAPTIST NEWS Experienced relief worker to head BWAid Baptists Today joins North American Baptist Fellowship FALLS CHURCH, Va. — Rothangliani Rema Chhangte has been tapped as the new director of Baptist World Aid (BWAid), which provides global disaster relief and economic development services. She succeeds Paul Montecute who retires in July. Chhangte (pronounced “shan-tay”) is a native of India, where her father worked as an administrator of a hospital and was actively involved in Baptist life, including the Baptist World Alliance. She was educated at Bethel University, Eastern University, and Palmer Theological Seminary, earning degrees in economic development and theology. Chhangte currently serves as pastor of Woodland Baptist Church in Philadelphia and has held leadership positions with the American Baptist Churches USA, Church World Service and the World Council of Churches. She has helped coordinate disaster relief efforts through the ABCUSA and BWAid, and was founder and director of the Asian American Youth Association. She previously served on the BWA General Council, has wide experience working with refugee populations, and currently serves as liaison to Burmese refugees for the American Baptist Home Mission Societies. Search committee chair Jerry Carlisle said Chhangte is skilled at budgeting, fundraising and working cross-culturally — and that “BWA has been in her DNA from birth.” He described her as having superior diplomatic skills and wide experience with non-governmental organizations. Chhangte, he said, has a vision for BWAid “to be the premier relief and development agency for Baptist churches worldwide.” The executive committee voted unanimously to approve her appointment. The BWA’s general council will be asked to affirm the appointment at the annual gathering in Santiago, Chile, July 2-7. BT Pastor and human rights advocate Palacios honored FALLS CHURCH, Va. — Edgar Palacios, associate pastor of Christian education at Calvary Baptist Church in Washington, D.C., is the winner of the 2012 Baptist World Alliance’s Denton and Janice Lotz Human Rights Award. Palacios was featured in the January issue of Baptists Today. Palacios worked as a Baptist pastor and advocate of social justice prior to and during the civil war that wracked his native El Salvador from 1980-1992. He helped to organize the Permanent Committee for the National Debate for Peace, a group of religious and social organizations seeking change, and was chosen to be its leader. He sought dialogue between the U.S.-supported government and the FMLN, an armed rebel group seeking social reform. Palacios was targeted for assassination by government agents. In November 1989, after six Jesuit priests were murdered by a government-sponsored “death squad” and FMLN forces advanced on San Salvador, Palacios made his way to Washington, D.C., where he and his wife, Amparo, lobbied the FALLS CHURCH, Va. — The independent news journal Baptists Today was accepted for membership in the North American Baptist Fellowship (NABF), a regional body of the Baptist World Alliance (BWA). During a March 9 meeting, the membership application was approved and Tony Cartledge was elected as one of 12 at-large members of the NABF executive committee. He is the contributing editor for Baptists Today, whose assignments include coverage of global Baptists. He also serves as chair of the BWA Communications Committee. “Baptists Today enjoys mutually-beneficial partnerships where there are both shared values and respect for one another’s autonomy,” said Executive Editor John Pierce. “We are glad to build bridges across the global Baptist family.” BT U.S. Congress to end military aid to the El Salvadoran government. Palacios later returned to El Salvador, where he urged the United Nations and the Organization of American States to press for a just and peaceful solution, and assisted in the negotiations. In recognition of his important role, Palacios was invited to be present when peace accords were signed in 1992. Palacios continues to advocate for social justice for the poor and for immigrants in Washington, D.C., and also travels often to El Salvador where he is a trusted consultant to church and governmental officials. BT Information | 33 “American individualism, consumerism, affluence, and activities that involve kids’ sports and adult hobbies are church competitors like never before.” Pastoral perspectives D ALLAS — Pastor George Mason and Wilshire Baptist Church are known for training successful young pastors through a groundbreaking two-year pastoral residency program that receives support from the Lilly Endowment. Mason grew up on Staten Island, N.Y. He attended the University of Miami where he played quarterback for the Hurricanes. He earned M.Div. and Ph.D. degrees from Southwestern Baptist Seminary. He has served Wilshire since 1989, coming from the pastorate of Hillcrest Baptist Church in Mobile, Ala. He currently chairs the committee charged with recommending a new executive coordinator for the Cooperative Baptist Fellowship. BT: How would you briefly describe your leadership style as a pastor? Mason: One image that I keep coming back to is the leader of a band. In a jazz combo, the bandleader passes the spotlight around while others support that one by playing along. Everyone gets a chance to solo, but it’s never really a solo because everyone else is cooperating and encouraging the one who is leading in that moment. At times it’s the bandleader in that lead role, but otherwise it’s the work of the leader to make sure the music goes on, the song is being well played, etc. As a pastor, I know there are times when I am front and center. Other staff and laypersons also have their turns to lead, in which case I will play a supportive role and not get in their way. But I still have to keep my eye on how we are doing in achieving our mission, which sometimes requires me to step in or to ask others to step up. For the most part, I try to lead with a light hand but with clear vision and a confident presence. From George Mason Wilshire Baptist Church, Dallas, Texas BT: Can you identify a couple of the biggest challenges in pastoral ministry today and share how you and your congregation are facing them? Mason: Participation and stewardship are two significant challenges. The self-definition of an active member has shifted from attending about three times per month to about once per month. It’s difficult to have continuity, to preach sermon series, to staff Sunday school, and to count on common knowledge when people are AWOL so often. The subtle shift from a sense of being part of a covenant community to being an attender when convenient is a huge challenge. American individualism, consumerism, affluence, and activities that involve kids’ sports and adult hobbies are church competitors like never before. One additional challenge is finding a way to lead a church by the guiding principle of what Kavin Rowe has called “traditioned innovation.” Failure is found both in being shackled to tradition or unshackled in innovation. Somehow we need a faithful tethering to tradition, along with a spirit that allows us to adapt to the challenges of our time. One such example is the recovery of the notion of the believer’s church that believer’s baptism by immersion is a symbol of but not necessarily the definition of. Our commitment to a believer’s church should allow us to respect the conscience of believers who have been baptized as infants (thus getting the order wrong, by our reckoning, but nonetheless believing and being baptized) or of believers who have been baptized by sprinkling or pouring. To exclude them from membership today, after the battle of church-state separation has been won and soul liberty is otherwise practiced, is to judge all other churches as false and every other baptism invalid. Most of our members no longer believe this, but our baptismal practice has not caught up with our belief. BT: What do you know now that you wish you had known earlier as a pastor? Mason: I wish I had figured out earlier that I didn’t have to be the key figure all the time. I have learned that I don’t have to write the pastor’s column every week, or teach every Wednesday Bible study, or attend every staff or committee meeting. Sharing ministry leadership strengthens the whole body, keeps me fresher, and prevents the church from being too identified with the pastor’s style and personality. BT: Is denominational identity and engagement important to you — and to your congregation? How do you engage with other churches, and what value does that bring? Mason: Church autonomy can too easily lead to independence and away from cooperation. Denominational identity and engagement keep the church moored to a tradition and prevent it from becoming isolated or deluded into thinking it is self-sufficient. The bigness of the body of Christ requires our intentional interaction and partnership with other Baptist and Christian churches. We can do that through traditional means of associations, conventions and fellowships, and also through direct and select partnerships with other churches. EDITOR’S NOTE: In this new series, experienced pastors are asked the same seven questions about the important and sometimes misunderstood work they provide in congregational leadership and care. The monthly feature is designed to help pastors learn from one another and to give others greater insight into the multi-faceted work of pastors in changing times. 34 | Feature BT: How do you keep a balanced life that allows for personal time and study while being accessible to your congregation? This is more or less important to churches depending upon how important it is to the pastor. Although there are exceptions to this, it seems to me that churches tend to take on the vision of the pastor about denominational identity and engagement. My former pastor and mentor, Charles Wade, once said that it’s a fallacy that back in the heyday of the Southern Baptist Convention everyone was on board with growing their gifts to the Cooperative Program. Even then, the pastor had to keep advocating for missions and cooperation. The same is true today. There is little blind loyalty today. We are all more loyal critics now, knowing more about our mission partners than ever before and wanting more from them as well. This can sometimes lead to unfair carping, but it can also reflexively demand more from those of us who call on our mission partners to be good stewards of church dollars. We in the churches have to do our part too to make the [Cooperative Baptist] Fellowship or any other partner the best it can be. Mason: It’s not easy to keep a balanced life in ministry, but I try to remind myself that that challenge is not unique to ministry. Everyone has that challenge. We tend to address it too much these days on the side of balance, I think. And that means we start setting up ministry against our life away from the church as if we are divided selves. There’s a lot of attention given in seminaries and divinity schools to setting boundaries and making sure that you work when you work and are home when you are home. But I think this has gone a bit too far. We are better off focusing on the life of being a minister more than the balance part of it. There needs to be a healthy flow between my being a distinct person and my being an ordained minister. It should be difficult to separate those two, even if we distinguish them. I am called, and I am called. When I try to set my boundaries too strictly, I tend to get resentful of the demands of the work and forget the enormous privileges of the life of being a pastor. I believe I am a better human being because I am a pastor, and I hope I am also a better pastor because I am a healthy human being. BT: Every church member knows exactly the right time for scheduling worship and the proper format of the service. The problem, of course, is that these are as different as the people. How do you, as a pastoral leader, plan worship with such varied expectations? Mason: We do not try to be all things to all people. There are many other churches that worship differently from us. God is at work in all of them. We have a distinct culture of worship that reflects the need for reverence and transcendence as well as immediate experience. Our worship is Baptist in its call for response and conversion, but it is also ecumenical in its liturgical format. We have a flavor of Baptist experientialism, but our unity with the body of Christ is also expressed in our commitment to the church year and common texts. Another way we keep that fresh is by using many lay worship leaders in each service, so that over time the congregation is educated about how and why we worship as we do. Worship should never be the performance of the clergy for the laity; it is always the people’s work (liturgy). And this is especially true for Baptists, who believe that clergy are a subset of the laity and not a separate category of Christians. BT: What keeps you coming back for more? Mason: These days I am inspired and encouraged by young ministers and their formation more than by my own work. I still love being a pastor, with all its attendant duties of preaching and teaching and leading and being a healing presence of Christ at the most crucial moments of people’s lives. But I truly love helping and seeing young people discern their call and find their way in ministry. I like very much being for them “a guide on the side” more than “a sage on the stage.” Our church has worked to become a teaching congregation, and it takes that role quite seriously. This is one of the more important ways we believe we can contribute to the wider church. BT Feature | 35 by terri byrd, Contributing Writer Ministers Bart McNiel, standing, and Chris George. A case for ministry Attorney’s new calling affirmed in Mobile MOBILE, Ala. — When attorney Bart McNiel shared his calling to ministry with the deacons and congregation of First Baptist Church of Mobile, the universal response was, “It’s about time!” A ccording to pastor Chris George: “When Bart expressed his desire to respond to God’s calling, I externally maintained my composure and provided a ministerial affirmation, but internally experienced a celebration.” McNiel’s move toward his call to ministry seemed to be a long time in coming to fruition. At the age of 14, he walked to the front center stage of a youth conference with scores of other emotional teenagers responding to an evangelist’s plea to come forward if they could sense God calling them to full-time Christian service. Over the next few years — and multiple youth conferences and zealous evangelists later — McNiel continued to follow that sense of call throughout his teen years, and then completed undergraduate and graduate studies in religion at Florida State University. However, McNiel came to resent ministers who he felt specialized in manipulating children and teens at their most vulnerable stages of physical and emotional maturity. He wondered if he was headed toward ministry simply because, as the son of Baptist missionaries, it was what he knew best. So, he changed vocational direction. Three years later, he graduated with a law degree and spent the next 12 years building a career as a civil defense litigator. But as a student and a young lawyer, McNiel remained active in church life. In the congregations he joined, however, he found that his missionary background, love of Bible stories, and studies in religion often landed 36 | Feature him behind a pulpit. “Over many years,” said McNiel, “more than one fellow church member remarked that I had missed my calling.” Giving up a successful career as a defense attorney was hard to imagine, however. Yet he would accept opportunities to teach and preach in his church — even though he often worked 60 to 70-hour weeks. “What was apparent to so many around me started to become clear to me,” said McNiel. “Christian ministry had become my passion.” But he felt that his daily grind had become essential if for no other reason than to pay for a large custom home and the promise of the ever-elusive American dream. “What I was teaching and sometimes preaching on Sunday was an indictment of everything I had become — Christ asked me not to worry about tomorrow, but I could not stop chasing tomorrow long enough to see today.” Before the church was aware of this decision, Bart and his wife, Stacey, put their home up for sale as a visible sign of their commitment. When the calling was finally shared with the Mobile congregation, there was much rejoicing. “It has been evident to many people for many years that God has been working through Bart to minister in our church community,” said George. “In both the deacon council and the church in conference, Bart received unanimous support.” First Baptist Mobile wasn’t the only partnership that his pastor wanted for McNiel. George worked with Ronnie Brewer, coordinator of Alabama Cooperative Baptist Fellowship, to bring together several ministers throughout the state to share advice and wisdom from their ministry experiences. As a result, those involved are putting together a program that can be shared with other congregations who affirm and ordain one of their own members. The plan is also designed to strengthen bonds among the ministers in the region who have much collective experience and wisdom to share with prospective pastors. Since McNiel was not a typical candidate for ordination, the church sought a way for him to serve at First Baptist Church of Mobile and to learn more about the practice of ministry, worship planning and pastoral care. So a pastoral resident internship was born. On a quarterly basis, the internship incorporates various aspects of ministry — as well as a reading list ranging from pastoral care and counseling to fictional writings that are relevant to contemporary challenges of the church. The church provides a setting for spiritual growth and practical experience for McNiel while he enhances the church’s pastoral ministry. “Thus far, the internship has exceeded expectations and been a wonderful blessing to both Bart and our congregation,” said George. He described the experience in terms of two callings: “God’s calling for Bart to commit to Christian service, embarking upon a difficult journey toward full-time Christian ministry — and God’s calling for First Baptist Church Mobile to provide a place for Bart to learn, live, love and experience God’s work in our church community.” BT Guest Commentary By Tommy McDearis Remembering Melissa A tribute to a well-lived life I t was one of the hardest emails I have ever written to my church: Today we mourn the loss of our good friend and fellow minister, Melissa Cheliras. Only 33 years old, her life seems so unfinished. However, few ministers I have known touched more lives as positively as did hers. She was a dear friend who joined our church as a freshman in college. I had known her for almost 15 years. Cancer claimed her days on earth. God claimed her life, soul and spirit — and what a spirit it was! Few people have made such an impact for Christ in so few years. This young woman embodied the spiritual gifts of humility and commitment as well as anyone I have known. The qualities found in Gal. 5:22-23 — “love, joy, peace, patience, kindness, generosity, faithfulness, gentleness and self-control” — formed the key to her life as a minister. When Melissa moved to Boston as a Baptist home missionary, she lamented “the sad fact” that so few people her age attended church. After pondering how to reach a largely unreached population, and after reading several books on evangelism that she found interesting but less helpful than she had hoped, Melissa made a risky decision. Recognizing the signs of spiritual hunger, Melissa launched into a relational outreach that was radical, yet very Christ-like. If the people would not come to church, she would go to the people. Realizing those her age congregated in bars instead of churches, Melissa went there to create relationships. After spending months of meeting people and gaining trust, she started a discussion group called “Theology on Tap.” Melissa then began inviting these young people to come to the new church with which she was working. To the surprise of no one who knew Melissa, many of those “Theology on Tappers” began attending the church. Her college ministry in Boston took a similar approach. Melissa went to the students and formed friendships. Then she began some small discussion groups that became Bible studies. She then invited these curious students to her church — and they came! Then she led those students to team with other Christian students on campus to do what she had done — start their own groups. The result was new disciples who professed faith because Melissa had the courage to think outside the comfort zones of most ministers and churches. One of her signature questions was, “OK, where is Jesus in that?” Melissa always sought the goal of doing something great for Christ. When Melissa returned to Blacksburg, she asked about the vision of our church. When she realized our vision remained that of mission outreach, she joined and became involved. She worked with college students and taught a youth Bible study. She became a volunteer staff member to help form new outreach endeavors. She served on ministry teams and in mission projects. Most of all, she became an encourager to those around her, including her ministers. Early in my ministry in Blacksburg I lamented that we were not reaching many students. It was then-20-year-old Melissa who suggested that I go to students. She accompanied me to those places and introduced me to students she had already met. Sure enough, those students began talking to me — and some came to church. Some were baptized, and they in turn invited others. Those years were our most successful at reaching students. It was Melissa who led the way. My daughter, Kathryn, met me at Melissa’s funeral. She told me that only a month earlier Melissa had called her at James Madison University — just to see how college was going and to assure Kathryn of her prayers. “I’m fine,” Kathryn told Melissa, who was quite ill. “There’s nothing wrong in my life that study and work doesn’t solve.” Kathryn added: “You don’t need to pray for me; let’s pray for you.” To which Melissa’s replied: “We can do both.” She ministered to the end. On Monday, Feb. 12, a day appropriately filled with sunshine, we celebrated the life of Melissa Cheliras at her home church in Chesapeake, Va. The sanctuary designed for 480 was packed with nearly 550 people from several states. Others joined the service by video feed in the chapel. For 90 minutes we sang, told stories, read Melissa’s favorite scriptures, and shared memories of one of the best Christians I have ever known. I wish I understood why this exceptional witness for the Lord was lost at such an early age. It seems she had so much more to offer. Yet, while I do not have an answer, I do know one thing for certain: Melissa’s 33 years were well invested; her life counted on earth as it did in heaven. Goodbye, dear Missy. We do so love and miss you! Well done, good and faithful servant. Today you dance in your healing place where no pain will ever harm you. Thank God! BT —Tommy McDearis is pastor of Blacksburg Baptist Church in Blacksburg, Va. Perspective | 37 story and photos by john pierce Pastor-Judge Little Rock’s Wendell Griffen proclaims justice in two roles L ITTLE ROCK, Ark. — Pastor Wendell Griffen fills the pulpit of New Millennium Church with his physical presence and the power of his words. He is strong, but not boisterous; he is insightful, not but aloof. The sermon for this Sunday morning is a call to be prophetic people — modeled after Jesus. “Jesus is no less savior for his prophetic work and no less prophet for his saving work,” said Pastor Griffen. He contrasted the life and teachings of Jesus to some religious leaders of his day who overemphasized following religious law at the expense of dispensing love and grace. He called Jesus the “un-scribe.” “Jesus didn’t call us to be scribes but to be prophetic agents of change in his world,” he added. Getting practical, Griffen spoke to his yearold congregation that meets in the Lakeshore Drive Baptist Church sanctuary about ways of being prophetic today — including ministry to returning military veterans and persons who have been incarcerated. “You only do baby food so long, then you get chores,” he said, calling the congregation to an active faith. He told of a retired pastor who mentioned having never gone behind prison walls. Griffen — who is also an appeals court judge — shook his head in disbelief. “We don’t need more scribes,” he continued his sermon. “You and I are called to follow Jesus, the un-scribe. Let us not do less.” The music at New Millennium is traditional yet upbeat. LaVante Pettigrew added soft saxophone sounds to the organ and piano accompaniment while the congregation sang “Oh, How I Love Jesus” and “Just a Closer Walk With Thee.” Then the young man, who was scheduled for baptism the following Sunday, sang a soulful rendition of “Fix Me, Jesus” for the offertory reflection. There is a sense of welcome at New 38 | Feature “You only do baby food so long, then you get chores.” Millennium where quick smiles and warm embraces are commonplace before and after worship. During the formal welcome, Griffen acknowledged guests, shared prayer concerns and promoted upcoming activities. He told congregants that his wife Patricia, a clinical psychologist, was recovering well from eye surgery. He relayed her request for continued prayers and her report that “her husband is doing a decent job” in providing care. He announced upcoming occasions in which women will fill the pulpit. But he quickly added that their doing so was not a special emphasis: “We believe women preach year ‘round.” But on this day it was Pastor-Judge Wendell Griffen who gave the charge. “Somebody said, ‘Be ye doers of the Word,’” he reminded his listeners. “That’s what prophets do!” BT Q&A with Wendell Griffen Pastor Wendell Griffen greets church member Bettye Brown before worship. LITTLE ROCK — An appeals court judge and Baptist minister, Wendell Griffen brings many gifts to both callings. He is an Arkansas native, Army veteran and graduate of the University of Arkansas School of Law. Griffen was the first African American to join a major law firm in Little Rock. He took to the bench in 1996 after then-Gov. Jim Guy Tucker appointed him to the Court of Appeals. Baptists Today editor John Pierce posed questions to Griffen, who currently serves on a search committee to find the next executive coordinator of the Cooperative Baptist Fellowship. BT: How would you describe your dual calling as a judge and minister? In what ways does one role inform the other? Griffen: I consider my work as judge and as minister to be part of who God has created me to be. Both functions are based on commitment to social justice. Justice is always a moral issue first, and becomes social because of our relationship actions and misconduct. So ministry and judging go hand in hand. BT: How did you get connected to the Cooperative Baptist Fellowship? How does that relationship enable your ministry? Griffen: I was engaged in seminary extension studies when the fundamentalist faction gained control of the Southern Baptist Convention. Although I belonged to a National Baptist congregation, I knew white Baptists who were followers of an inclusive, intellectually humble, and socially engaging gospel and I wanted to be in fellowship with them. Tom Logue, Robert Ferguson and other “goodwill Baptists” in Central Arkansas encouraged my early ministry in the late 1980s. [Current CBF of Arkansas Coordinator] Ray Higgins reached out to our new church start in a very genuine way in 2009. Tom Logue, with his typical gentleness and kindness, asked that I use what had been his former CBF of Arkansas office as my church study. [Pastor] Matt Cook and Chris Ellis of Second Baptist Church in Little Rock reached out to partner with New Millennium almost from the time we became a congregation. The CBF relationship New Millennium enjoys is based on that kind of support. BT: You are a strong advocate for reforming the justice system that you know so well. From your insider perspective, what are the major areas that need attention? Griffen: We must rethink what justice means in a systemic way. Justice involves more than the outcomes of legal controversies. The causes for social conflict must also be understood and addressed. We are seeing support for public education for every child attacked. Social service agencies (governmental and non-governmental) are under attack. Meanwhile, our society steadily invests more in private prisons and tactical weapons for police agencies. We must also turn away from the mass incarceration mindset developed over the past 40 years. A society is more just when people who are poor, vulnerable, immigrant, and socially marginalized are protected and free, not when they are targeted for incarceration. That mindset and social ethic isn’t politically popular, but justice is rarely popular (politically or otherwise). That’s why prophets are the key proponents of social justice in the Bible rather than princes and priests. BT: The Bible speaks a great deal about justice. What are some ways churches can be more engaged in justice issues today? Griffen: Start with your understanding of the gospel of Jesus and why you are a congregation. You need a justice sense about the gospel of Jesus that guides your sense of ministry. The whole Bible should be preached, taught and understood as dealing with love, truth and justice, not about privilege and maintaining the status quo. I wish every pastor and church leadership team would study Howard Thurman’s Jesus and the Disinherited, along with Dr. King’s “A Time to Break Silence” sermon (preached April 4, 1967 at Riverside Church in New York). Churches will never become more involved with social justice if pastors and other leaders (lay and ordained) cling to the un-biblical notion that following Jesus is simply a matter of private piety and social privilege. So I would focus on changing how people think about the gospel of Jesus. Ministry efforts are based on what we believe we’re called to be and do for God as followers of Jesus. BT: What are your hopes for New Millennium Baptist Church? Griffen: My hopes are reflected in the “Affirmation of Oneness and Purpose” we share during each Sunday worship service when we say: “We praise and worship God together. We petition God together. We proclaim God together. We welcome all persons in God’s love together. We live for God in every breath and heartbeat by the power of the Holy Spirit as followers of Jesus Christ, together.” That is what I pray we will do “in every breath and heartbeat” to the glory of God. BT Feature | 39 To tithe or not to tithe? By Tony W. Cartledge T he reported historic low in tithing among Americans should come as no surprise to anyone who plays a role in trying to balance church budgets. Often programs are being cut, mission offerings sliced, and staff positions pared away because the money just isn’t there anymore. The recession plays a role, but not the only one. The practice of tithing is fading away, and sometimes with the encouragement of church leaders who fear an emphasis on giving will chase away current or prospective members. A survey of “evangelical leaders” by the National Association of Evangelicals found that 58 percent of the respondents don’t believe the Bible requires tithing, though 95 percent of them claimed to do so, and virtually all of them believe that God calls Christians to be generous. It is often reported that Mormons tithe at a much higher rate than either conservative or mainline Christian groups. given in support of the temple and the poor. The Hebrew word translated as “tithe” literally means “tenth,” which gave rise to the idea that believers should contribute one-tenth of their income to God’s work. I don’t believe tithing is essential for salvation, nor that Christians should tithe as a down payment on greater blessings in return (as some teach, based on Malachi 3:10). But tithing plays a very important role in the living out of Reblog Selections from recent blogs at baptiststoday.org our faith. Tithing shouldn’t be thought of as a legalistic requirement for church participation; otherwise, we might as well be selling indulgences or charging — which makes 10 percent seem a bit chintzy.. BT Taking ourselves too seriously is serious mistake By John Pierce O ver the years I’ve not always lived up to my philosophy that the right balance in life is to take the Gospel seriously while not taking oneself too seriously. But I sure try. That perspective resurfaced after reading a New York Times column by Eric Weiner about “the sad state of our national conversation about God.” He wished there were another way. So do I. “For a nation of talkers and selfconfessors, we are terrible when it comes to talking about God,” said Weiner. Honest seekers and humble followers get drowned out by the more boisterous and certain “true believers” and “angry atheists,” as he calls them. Indeed, that is no way to 40 | Perspective have a conversation. Humility is often evidenced by humor. No, not the derisive attempts at ridiculing another faith tradition or getting a laugh at someone else’s expense, but those places where genuine smiles abound and self-depreciating laughter is celebrated as a confession that we are all faulty in our thinking and feeble in our attempts to grasp the fullness of God. Weiner quotes G.K. Chesterton who said: “It is the test of a good religion whether you can joke about it.” He noted that perhaps Americans are enamored of the Dalai Lama because “he laughs, often and well.” Many would rightly argue that religious faith is a serious matter. But the trouble comes when we take our own take on religion way too seriously — and overestimate our abilities, not God’s. Then we end up with many people, like Weiner, who say they can only find an angry God — or perhaps an absent God — being argued about in the national conversation. And I like his metaphor of God as not an exclamation point — but rather a semicolon that connects people to experiences of grace. It is in those unpredictable, unexplainable experiences of grace that we most often find God. And since such experiences are not of our own making, we have no reason to brag or get defensive. But we have very good reasons to be grateful, to smile and to perhaps even laugh a bit — and to join the conversation with faith, humility and joy. BT.! Baptists Today Inc. is a 501(c)(3) charitable organization under the careful stewardship of a trusted, self-perpetuating Board of Directors. Published on Mar 30, 2012 April 2012 Natl Edition | Baptists Today
https://issuu.com/baptiststoday/docs/btapril12_nl_031312
CC-MAIN-2018-17
refinedweb
25,434
61.87
pyversions.py generates wrong output with version_only option Bug Description Binary package hint: python-central On Ubuntu 6.10 running pyversions -vd should return '2.4' but it returns 'in/python2.4' this also affects post-install configurations with pycentral. the pyversions.py script is installed in two locations and two versions (!?): /usr/share/ /usr/share/ Both can be fixed this way: * search location of this text: def default_ global _default_version if not _default_version: if version_only: return _default_ else: return _default_version * replace the line: return _default_ * with this line: return _default_ Is this the right place to post this bugreport/fix? This was my first one. this patch works on my system (Ubuntu 6.10) and it is better than my prior posted patch, because it sets the global variable _default_version to the correct value. You never should modify files by yourself in /usr (except /usr/local); doing so will make your system unreliable (and as seen here break it in some cases). Using alternatives is not possible: you'll break all those modules and extensions that are available for one python version only. If you do want to set another default for your own use, use /usr/local/bin, or ~/bin. closing the report. This occurs if /usr/bin/python is a symbolic link whose target is an absolute path, not just "python2.x". It's not on my system, but apparently it can be. Another, related, issue is that update-alternatives may make /usr/bin/python a link to /etc/alternativ es/python, which, in turn, is a link to /usr/bin/python2.x. The original function does not cater for such circumstances. I believe the attached patch fixes both issues, but I haven't tested it (beyond verifying that the results are as correct as before on my own box).
https://bugs.launchpad.net/ubuntu/+source/python-central/+bug/92287/+index
CC-MAIN-2019-09
refinedweb
303
56.05
csRenderBuffer::Props Struct ReferenceTo scrape off a few bytes use bitfields; assumes values are in sane limits. More... #include <csgfx/renderbuffer.h> Detailed DescriptionTo scrape off a few bytes use bitfields; assumes values are in sane limits. Definition at line 251 of file renderbuffer.h. Member Data Documentation hint about main usage Definition at line 254 of file renderbuffer.h. number of components per element Definition at line 259 of file renderbuffer.h. datatype for each component Definition at line 256 of file renderbuffer.h. should we copy data, or just use supplied buffer Definition at line 266 of file renderbuffer.h. if buffer should be deleted on deallocation Definition at line 268 of file renderbuffer.h. if this is index-buffer Definition at line 272 of file renderbuffer.h. currently locked? (to prevent recursive locking) Definition at line 270 of file renderbuffer.h. last type of lock used Definition at line 275 of file renderbuffer.h. offset from buffer start to data Definition at line 263 of file renderbuffer.h. buffer stride Definition at line 261 of file renderbuffer.h. The documentation for this struct was generated from the following file: - csgfx/renderbuffer.h Generated for Crystal Space 1.0.2 by doxygen 1.4.7
http://www.crystalspace3d.org/docs/online/api-1.0/structcsRenderBuffer_1_1Props.html
CC-MAIN-2014-10
refinedweb
207
51.24
Now we need to run that insert_item function from the web app. Let’s build an ‘add’ widget into the Data Grid. Add a column to your Data Grid. Clear its Title and Key. Set its width to 80. This will hold our ‘add’ button later. Add a Data Row Panel to the bottom of your Data Grid. Drop a TextBox into each of the Name and Quantity columns. Rename them text_box_name and text_box_quantity. Set the Quantity TextBox’s type to number. Drop a Button into the end column. Rename it button_add. Clear the Button’s text and set its icon to fa:plus. Create a click handler by clicking the blue arrows to the right of ‘click’ in the Events section: def button_add_click(self, **event_args): anvil.server.call( 'insert_item', self.text_box_name.text, self.text_box_quantity.text ) # Refresh the open Form to load the new item into the UI get_open_form().raise_event('x-refresh') # Clear the input boxes self.text_box_name.text = '' self.text_box_quantity.text = '' Now you can add items to your database from your web app!
https://anvil.works/learn/tutorials/external-database/chapter-3/30-build-add-ui.html
CC-MAIN-2020-10
refinedweb
174
71.1
Consistently, one of the more popular stocks people enter into their stock options watchlist at Stock Options Channel is Travelers Companies Inc (Symbol: TRV). So this week we highlight one interesting put contract, and one interesting call contract, from the February 2016 expiration for TRV. The put contract our YieldBoost algorithm identified as particularly interesting, is at the $105 strike, which has a bid at the time of this writing of $1.55. Collecting that bid as the premium represents a 1.5% return against the $105 commitment, or a 9% annualized rate of return (at Stock Options Channel we call this the YieldBoost ). Selling a put does not give an investor access to TRV's upside potential the way owning shares would, because the put seller only ends up owning shares in the scenario where the contract is exercised. So unless Travelers Companies Inc sees its shares decline 4.8% and the contract is exercised (resulting in a cost basis of $103.45 per share before broker commissions, subtracting the $1.55 from $105), the only upside to the put seller is from collecting that premium for the 9% annualized rate of return. Worth considering, is that the annualized 9% figure actually exceeds the 2.2% annualized dividend paid by Travelers Companies Inc by 6.8%, based on the current share price of $110.35. And yet, if an investor was to buy the stock at the going market price in order to collect the dividend, there is greater downside because the stock would have to lose 4.79% to reach the $105 strike price. Always important when discussing dividends is the fact that, in general, dividend amounts are not always predictable and tend to follow the ups and downs of profitability at each company. In the case of Travelers Companies Inc , looking at the dividend history chart for TRV below can help in judging whether the most recent dividend is likely to continue, and in turn whether it is a reasonable expectation to expect a 2.2% annualized dividend yield. Turning to the other side of the option chain, we highlight one call contract of particular interest for the February 2016 expiration, for shareholders of Travelers Companies Inc (Symbol: TRV) looking to boost their income beyond the stock's 2.2% annualized dividend yield. Selling the covered call at the $115 strike and collecting the premium based on the $1.35 bid, annualizes to an additional 7.5% rate of return against the current stock price (this is what we at Stock Options Channel refer to as the YieldBoost ), for a total of 9.7% annualized rate in the scenario where the stock is not called away. Any upside above $115 would be lost if the stock rises there and is called away, but TRV shares would have to advance 4.3% from current levels for that to occur, meaning that in the scenario where the stock is called, the shareholder has earned a 5.5% return from this trading level, in addition to any dividends collected before the stock was called. The chart below shows the trailing twelve month trading history for Travelers Companies Inc , highlighting in green where the $105 strike is located relative to that history, and highlighting the $115 strike in red: The chart above, and the stock's historical volatility, can be a helpful guide in combination with fundamental analysis to judge whether selling the February 2016 put or call options highlighted in this article deliver a rate of return that represents good reward for the risks. We calculate the trailing twelve month volatility for Travelers Companies Inc (considering the last 251 trading day TRV historical stock prices using closing values, as well as today's price of $110.35) to be 18%. In mid-afternoon trading on Monday, the put volume among S&P 500 components was 709,966 contracts, with call volume at 1.23 TR.
https://www.nasdaq.com/articles/interesting-february-2016-stock-options-trv-2015-12-21
CC-MAIN-2020-45
refinedweb
655
59.33
Many developers when writing their first ember addon confuse it with an ember app. Yes, both ember addon and ember app follows similar code structure and conventions. However, both are fundamentally different when it comes to managing dependencies and using them. Before we move on, first let’s get some things out of the way. Npm or Bower? Bower. Given the current scenario in Ember land, you should be using bower to install manage you external-frontend dependencies. Later, we’ll see how convenient bower is for our purpose and hooks ember provides to manage packages installed via bower. However, it’s all possible for npm modules as well. When you create a new ember addon , you’ll notice a bower.json file inside root directory. One might think that adding our dependencies to this bower.json will do the trick. I did too. However it is not so, as again ember addons and NOT ember apps. That bower.json installs the dependencies for this time, but doesn’t tell our host application(which will install this addon) about the dependencies. So how does ember install work anyways? *When you do ember install <addon>, all ember-cli does is add <addon> to package.json and run npm install && bower install and then run the blueprint(s) specified in the addon. The key thing to note here is blueprint. A blueprint runs additional code after the addon is installed. It has to be named the same as the addon. This makes blueprint perfect place to add our dependencies. Define dependencies So now to the interesting part, we now actually define our dependencies. First we create the blueprint file for our addon. In your root directory create blueprints/<addon-name>/index.js like so: module.exports = { normalizeEntityName: function() {}, // no-op since we're just adding dependencies afterInstall: function() { return this.addBowerPackagesToProject([ { name : 'moment' , target : '^2.10.0'}, { name : 'material-datetime-picker'}, { name : 'rome'} ]); } } Ember provides various hooks to load npm and bower packages. They are as follows: addAddon(s)ToProject: Adds an addon to the project’s package.json and runs its defaultBlueprint if it provides one. addBowerPackage(s)ToProject: Adds a package to the project’s bower.json. addPackage(s)ToProject: Adds a package to the project’s package.json. And all of these return Promises so all its all then-able so you can load dependencies one after another and any order you prefer. Also it all goes into the afterInstall hook, which is called after ember-cli is finished installing other dependencies. Now, we’ve done it. All our dependencies will be correctly installed within our host application alongside our addon. But, not so fast! , Your addon cannot yet use these dependencies as they are not imported yet. I think now you know why just an app.import in ember-cli-build.js will not work. So let’s see the solution Index.js to the rescue index.js as the name suggests, is the first file that is picked up when your addon boots up (after all the installation spaghetti). So well use this opportunity to import our dependencies as well!. Modify your index.js , located in the root directory of your addon like so module.exports = { name: 'ember-datetime-picker', included(app) { // include this addon for `dummy` application for testing this._super.included(app); // import he library into global namespace app.import(app.bowerDirectory + '/moment/moment.js'); app.import(app.bowerDirectory + '/rome/dist/rome.min.js'); app.import(app.bowerDirectory + '/material-datetime-picker/dist/material-datetime-picker.js'); app.import(app.bowerDirectory + '/material-datetime-picker/dist/material-datetime-picker.css'); //app.import(app.bowerDirectory + '<path to dependency>.js'); }, contentFor(type,config){ // type can anything like 'head' 'body' etc.. look for { { content-for '<typename>' } } in index.html if(type=='head') { // bonus!, you can add CDN requests here to load files from CDN, // all the this is include in the <head> section of the page // where your addon is used const headFile = `<link href="" rel="stylesheet"> <link href='' rel='stylesheet' type='text/css'> `; return headFile; } } }; The code above is pretty much self explanatory. Now before you jump at me for pulling all libraries into global scope — YES, it is not the best practice to do so. The workaround is to create a shim for the library (if one not exists already). I’ll leave that topic for later. Basically a shim is some boilerplate code which allows AMD or CommonJS modules to be imported like ES6 modules. So you’ll be able to do this: import moment from 'moment' ; So, finally you are all set for writing your dependable ember addon. Good Luck.
http://blog.codingblocks.com/2017/manage-use-dependencies-ember-addon
CC-MAIN-2018-43
refinedweb
774
51.65
The Files class is the other primary entrypoint of the java.nio.file package. This class offers a rich set of static methods for reading, writing, and manipulating files and directories. The Files methods work on instances of Path objects. Before proceeding to the remaining sections, you should familiarize yourself with the following common concepts: Many of the resources that are used in this API, such as streams or channels, implement or extend the java.io.Closeable interface. A requirement of a Closeable resource is that the close method must be invoked to release the resource when no longer required. Neglecting to close a resource can have a negative implication on an application's performance. The try-with-resources statement, described in the next section, handles this step for you. With file I/O, unexpected conditions are a fact of life: a file exists (or doesn't exist) when expected, the program doesn't have access to the file system, the default file system implementation does not support a particular function, and so on. Numerous errors can be encountered. All methods that access the file system can throw an IOException. It is best practice to catch these exceptions by embedding these methods into a try-with-resources statement, introduced in the Java SE 7 release. The try-with-resources statement has the advantage that the compiler automatically generates the code to close the resource(s) when no longer required. The following code shows how this might look: Charset charset = Charset.forName("US-ASCII"); String s = ...; try (BufferedWriter writer = Files.newBufferedWriter(file, charset)) { writer.write(s, 0, s.length()); } catch (IOException x) { System.err.format("IOException: %s%n", x); } For more information, see The try-with-resources Statement. Alternatively, you can embed the file I/O methods in a try block and then catch any exceptions in a catch block. If your code has opened any streams or channels, you should close them in a finally block. The previous example would look something like the following using the try-catch-finally approach: Charset charset = Charset.forName("US-ASCII"); String s = ...; BufferedWriter writer = null; try { writer = Files.newBufferedWriter(file, charset); writer.write(s, 0, s.length()); } catch (IOException x) { System.err.format("IOException: %s%n", x); } finally { if (writer != null) writer.close(); } For more information, see Catching and Handling Exceptions. In addition to IOException, many specific exceptions extend FileSystemException. This class has some useful methods that return the file involved ( getFile), the detailed message string ( getMessage), the reason why the file system operation failed ( getReason), and the "other" file involved, if any ( getOtherFile). The following code snippet shows how the getFile method might be used: try (...) { ... } catch (NoSuchFileException x) { System.err.format("%s does not exist\n", x.getFile()); } For purposes of clarity, the file I/O examples in this lesson may not show exception handling, but your code should always include it. Several Files methods accept an arbitrary number of arguments when flags are specified. For example, in the following method signature, the ellipses notation after the CopyOption argument indicates that the method accepts a variable number of arguments, or varargs, as they are typically called: Path Files.move(Path, Path, CopyOption...) When a method accepts a varargs argument, you can pass it a comma-separated list of values or an array ( CopyOption[]) of values. In the move example, the method can be invoked as follows: import static java.nio.file.StandardCopyOption.*; Path source = ...; Path target = ...; Files.move(source, target, REPLACE_EXISTING, ATOMIC_MOVE); For more information about varargs syntax, see Arbitrary Number of Arguments. Several Files methods, such as move, can perform certain operations atomically in some file systems. An atomic file operation is an operation that cannot be interrupted or "partially" performed. Either the entire operation is performed or the operation fails. This is important when you have multiple processes operating on the same area of the file system, and you need to guarantee that each process accesses a complete file. Many of the file I/O methods support the concept of method chaining. You first invoke a method that returns an object. You then immediately invoke a method on that object, which returns yet another object, and so on. Many of the I/O examples use the following technique: String value = Charset.defaultCharset().decode(buf).toString(); UserPrincipal group = file.getFileSystem().getUserPrincipalLookupService(). lookupPrincipalByName("me"); This technique produces compact code and enables you to avoid declaring temporary variables that you don't need. Two methods in the Files class accept a glob argument, but what is a glob? You can use glob syntax to specify pattern-matching behavior. A glob pattern is specified as a string and is matched against other strings, such as directory or file names. Glob syntax follows several simple rules: *,. *, ?, or the other special characters, you can escape them by using the backslash character, \. For example: \\matches a single backslash, and \?matches the question mark. Here are some examples of glob syntax: *.html– Matches all strings that end in .html ???– Matches all strings with exactly three letters or digits *[0-9]*– Matches all strings containing a numeric value *.{htm,html,pdf}– Matches any string ending with .htm, .html or .pdf a?*.java– Matches any string beginning with a, followed by at least one letter or digit, and ending with .java {foo*,*[0-9]*}– Matches any string beginning with foo or any string containing a numeric value "*"), use the backslash ( \*), or use whatever escape mechanism is supported at the command line. The glob syntax is powerful and easy to use. However, if it is not sufficient for your needs, you can also use a regular expression. For more information, see the Regular Expressions lesson. For more information about the glob sytnax, see the API specification for the getPathMatcher method in the FileSystem class. The Files class is "link aware." Every Files method either detects what to do when a symbolic link is encountered, or it provides an option enabling you to configure the behavior when a symbolic link is encountered.
http://docs.oracle.com/javase/tutorial/essential/io/fileOps.html
CC-MAIN-2014-23
refinedweb
1,001
58.08
Tim Peters wrote: > [Damien Morton] > >>In the BINARY_ADD opcode, and in most arithmetic opcodes, > > > Aren't add and subtract the whole story here? > > >>there is a line that checks for overflow that looks like this: >> >>if ((i^a) < 0 && (i^b) < 0) goto slow_add; >> >>I got a small speedup by replacing this with a macro defined thusly: >> >>#if defined(_MSC_VER) and defined(_M_IX86) > > > "and" isn't C, so I assume you were very lucky <wink>. > > >>#define IF_OVERFLOW_GOTO(X) __asm { jo X }; >>#else >>#define IF_OVERFLOW_GOTO(X) if ((i^a) < 0 && (i^b) < 0) goto X; >>#endif >> >>Would this case be an acceptable use of snippets of inline assembler? > > > If you had said "a huge speedup, on all programs", on the weak end of maybe. > "Small speedup" isn't worth the obscurity. Note that Python contains no > assembler now. Just to add my 0.02 EUR. You know that I'm not reluctant to use assembly for platform specific speedups. But first, I'm with Tim, not going this path for such a small win. Second, I'd like to point out that going to assembly for such a huge function like eval_frame is rather dangerous: All compilers have different ways of handling the appearance of assembly. This is a dangerous path, believe me: MS C's behavior is one of the worst, which is the reason why I was very careful to put this in a clean-room for Stackless, for instance: For the appearance of ASM code in some function, the calling sequence and the optimization strategy are changed drastically. Register allocation is changed, the optimization level is reduced, and the calling convention is *never* without stack frames. This might not have changed eval_frame's behavior too much, just because it is too big to benefit from certain optimizations now, but I remember that I changed it once to use about two registers less, and I might re-apply these changes to give the eval loop a boost of about 10 percent. The existance of a single one asm statement would voiden this effect! Hint: Write a small, understandable function twice, once using assembly and once without. Compile the stuff, and set the listing option to everything. Then look at the .cod file, and wonder how different the two versions are. This will make you very reluctant to use any asm statement at all, unless you want to re-write the whole function in assembly, including the "naked" option. Doing the latter for eval_frame would be worthwhile, but then I'd suggest to do this as an external .asm file. If you do this right, taking cache lines and probabilities into account, you can for sure create an overall gain of up to 20 percent. But even this remarkable gain wouldn't be enough, even for me, to go this hard path for a single platform. sincerely --?
https://mail.python.org/pipermail/python-dev/2003-March/033880.html
CC-MAIN-2019-18
refinedweb
477
67.38
Feature #7580 Range translation Description =begin I would like to propose the (({#+})) and (({#-})) methods on (({Range})). These would be useful for translating ranges - for example, given a range where the endpoints are 1-indexed, the range could be translated by 1 in the negative direction to use in (({Array#[]})). Instead of doing a syntactically-bulky manual translation like so: ary[(range.begin - 1)..(range.end - 1)] (({Range#-})) could be used instead: ary[range - 1] The translation methods would not handle certain endpoint types specially, they would just pass the call on. Here's an example implementation in Ruby: class Range def +(other) Range.new(self.begin + other, self.end + other, exclude_end?) end def -(other) Range.new(self.begin - other, self.end - other, exclude_end?) end end =end History #1 Updated by Yui NARUSE almost 3 years ago I think such arithmetic is not addition/subtraction, but shift. #2 Updated by Charlie Somerville almost 3 years ago =begin Do you propose that (({Range#<<})) would use (({#-})) and (({Range#>>})) would use (({#+})), or would it be a different method call internally? I am happy with both alternatives, I just want nice convenience methods for this operation. =end #3 Updated by Ricky Ng almost 3 years ago I would normally agree that 'shift' would be the proper term except that it's used in Array already which could cause a bit of confusion. #4 Updated by Yui NARUSE almost 3 years ago - Status changed from Open to Assigned - Assignee set to Yukihiro Matsumoto charliesome (Charlie Somerville) wrote: Do you propose that (({Range#<<})) would use (({#-})) and (({Range#>>})) would use (({#+})), or would it be a different method call internally? Don't use +/- and use <</>> or Range#shift(). I am happy with both alternatives, I just want nice convenience methods for this operation. In my experience, such alternative name considered harmful because if you want to add another method as Arange#+ in the future, those aliases prevent it. #5 Updated by Charlie Somerville over 2 years ago - Target version set to next minor Also available in: Atom PDF
https://bugs.ruby-lang.org/issues/7580
CC-MAIN-2015-40
refinedweb
339
62.88
Hello all, I am a new programmer and I am trying to look at how two classes can interact if one class is called by another. What I am trying to do is have a control class. This control class will then make a decision in the constructor about what "sub" classes to call (they are not inherited classes so not strictly a sub class). Since I don't know ahead of time which sub classes will be called I use a pointer in my class header file. In the constructor I then make a decision about the sub classes to call, instantiate the sub classes, and set the pointer to that sub class. Now here is the my problem; once the constructor finishes, the new sub class I made is destroyed. Later in the control class I have a function that uses the sub class pointer. The pointer works fine and all of the data is passed through the pointer and the function. My worry is that I am working off an artifact in the memory. Since the destructor is called on the sub class the pointer should be randomly pointing into space. Am I missing something about constructors/destructors and pointers? I am sure I am missing something, but I want to learn good technique and make sure I have easily modifiable code. Any help or insight is appreciated. Below is my test code: main file my control class header and cpp filesmy control class header and cpp filesCode:#include "stdafx.h" using namespace std; int main() { int kb = 0; // just a value to halt the program from closing the window { // defining a new scope to test destruction and construction int val_test = 5; // initialize the value val_test; Class1 input(0); // call class one and initialize class one's variable for (int ii = 0; ii < 10; ii++){ // loop to test this setup cout << "my value: " << ii << endl; input.set(ii); // resetting the values in class 1 } } cin >> kb; // just a halt command return 0; } ,,Code:#pragma once class Class2; class Class1 { public: Class1(int a); // constructor ~Class1(void); // destructor void set(int a); // set function int & get(); // get function friend class Class2; // make class two a friend private: int b; // integer variable testing value passing Class2 *Ptr; // pointer to second class that is called from this class }; my sub class header and cpp filesmy sub class header and cpp filesCode:#include "StdAfx.h" #include "Class1.h" using namespace std; Class1::Class1(int a) { b = a; // initial assignment Class2 sub_class; // creating a class2 object Ptr = &sub_class; // setting a pointer to class2 object cout << "constructor value of class1: " << b << endl; // output statement to see the value was initialized } void Class1::set(int a) { b = a; // set the integer value cout << "Class1 stored value is: " << b << endl; // out put the set interger value cout << "Calling second sub_class" << endl; // calling the pointer to class2 Ptr->get(this); // pointer to second class passes the pointer of this object } int &Class1::get() { return b; // return a reference to this value } Class1::~Class1(void) { cout << "my control class destructor is called" << endl; // tell me when the destructor is called } ,,Code:#pragma once class Class1; class Class2 { public: Class2(void); // constructor ~Class2(void); // destructor friend class Class1; // friending class 1 to see private data private: int val; // value i want passed in from class1 object int *valPtr; // pointer Class1 *Ptr; // pointer to class one object void get(Class1 *cPtr); // get function to get value from class1 object }; thanks again and I hope this is readablethanks again and I hope this is readableCode:#include "StdAfx.h" #include "Class2.h" using namespace std; Class2::Class2(void) { val = 0;// initialize the value } void Class2::get(Class1 *cPtr) { Ptr = cPtr; // set the pointer to class1 object val = Ptr->get(); // calling the class1 function get to pass the data to class 2 cout << " Sub_class value is: " << val << endl; // output what the data is } Class2::~Class2(void) { cout << "my sub_class destructor is called" << endl; // telling me when this destructor is called } Specter
http://cboard.cprogramming.com/cplusplus-programming/125372-question-about-constructors-destructors-pointers.html
CC-MAIN-2013-20
refinedweb
669
56.32
django-fabric 2.0.1 a generic fabric utility class for django projects django-fabric is written to make writing fabfiles for django projects easier and faster. It contains the basic stuff one would expect from a django setup with git and virtualenv. The code expects the project to have a certain structure as seen below. It is possible to customize the activation of the virtualenvironment. .. code-block: project-dir/ venv/ # virtualenv project-package/ manage.py fabfile.py Installation Run pip install django-fabric Usage There is two options to get get a basic setup, both will make you able to run fab deploy:prod and fab test. Init script There is a init script that will guide you through the generation of a basic fabfile that utilises django-fabric. Run it with the command .. code-block: django-fabric-init Basic manual setup Create a fabfile.py in your project directory. You can see example of a fabfile below. If you run into problems with settings where fabric cannot locate settings add sys.path.append(os.path.dirname(__file__)) to your fabfile. Here is an example of an fabfile .. code-block: from fabric.decorators import task from fabric.state import env from django_fabric import App env.user = 'web' env.hosts = ['server1.example.com'] site = App( project_paths={ 'prod': '/var/www/example_site', }, urls={ 'prod': '' }, restart_command={ 'prod': 'restart prod' }, project_package='example', test_settings='example.settings.test', ) deploy = task(site.deploy) test = task(site.test) - Downloads (All Versions): - 87 downloads in the last day - 486 downloads in the last week - 1935 downloads in the last month - Author: Rolf Erik Lekang - Categories - Package Index Owner: frecar, oleronning, relekang - Package Index Maintainer: frecar - DOAP record: django-fabric-2.0.1.xml
https://pypi.python.org/pypi/django-fabric/2.0.1
CC-MAIN-2015-48
refinedweb
284
51.95
Develop, edit & deploy websites entirely in the cloud with the CodeSandbox, Contentful and Netlify trio Setting up a development machine can be a tedious process. I once worked at a company that considered it an achievement to set up the development environment for their custom shop system in under two days (to be fair though, this was before Vagrant and Docker became a thing). And why’s that? Building software products relies heavily on things like your favorite editor or IDE to be productive, and it depends on installed dependencies like databases, shell programs or servers to actually run and update your software. Is this still a necessity or could we ditch all of that and rely completely on cloud services? I recently gave a talk about the Frontend stack 2018 and had a look at how far you can get without placing a single file on your computer. As it turned out, you really can create websites, make them editable and later deploy them (I’m a big fan of the recent static site generators) from any computer using powerful online services. CodeSandbox – the new online editor in town A while back, I noticed CodeSandbox being used more and more for React prototyping when people started sharing sandboxes on Twitter with specific React patterns or best practices. "Do we need another online editor?" was my immediate response. Earlier this year, I wrote an article on how to use render props in React and decided to give CodeSandbox a try. It doesn’t feel like my local editor (I’m using VSCode) – but it’s pretty close. In CodeSandbox, you can start by forking one of the 500,000 (!) available user sandboxes, or choose to start from scratch using starter templates for React, Vue, Angular, and other frameworks. Looking at all the user-created sandboxes, you’ll see that the editor is used primarily for quick prototyping in the React ecosystem. However, this doesn’t mean that you can’t use it to build something more complex inside or outside the React ecosystem. Getting started with JavaScript development entirely in the cloud Getting started with a new JavaScript-based project using a modern framework was very tedious, and far and away from being beginner friendly in the past. The folks working on React discovered that this had to change and came up with create-react-app. This project helps you to bootstrap and start a new React project in a few minutes by taking all the configuration away and providing all the needed defaults (#zeroconfig all the things 🎉). create-react-app is the base for CodeSandbox to create new React projects. For Preact, Vue and other frameworks similar CLI tools are available, and there’s even a "vanilla" starter template without heavy framework dependencies that uses Parcel (a new zero-config bundler – it’s fantastic, trust me!) under the hood to give you all the freedom you need. When you decide to go the React route and initialize a new project, you’ll get a codebase that is ready to dive into React development. Crucial editor features that let you forget that you’re "just" in an online editor cmd/ctrl+p to quickly access files and commands There are a few things that I can't live without while doing web development – first, CMD+p and CMD+Shift+p. These two shortcuts let you jump to any file or execute any command available with a quick and easy-to-use fuzzy search. Programming is very often about productivity, and these two shortcuts help you to achieve anything without leaving the keyboard. Dependency handling and automatic installation But now you’re in a cloud environment, right? How does it work to install dependencies then? CodeSandbox provides a dialog which lets you choose dependencies from npm easily. When you install packages with this dialog, the package.json will be automatically updated. Sweet! Prettier included by default When developing in CodeSandbox, Prettier is enabled by default, is configurable, and also runs very smoothly! Hot reloading in a separate window Looking at the screenshot above, the editor provides you with an in-browser preview. The cool thing is, you can open the preview in a separate window, which is perfect for two monitor setups like mine. This way, the code is on one monitor and I can see the changes in near-realtime on the other one. Autocompletion for projects shipping with TypeScript type definitions When I discovered that VSCode picks up type definition included in npm packages, I finally decided to go for TypeScript. As a JavaScript developer, I’m very used to working without great autocompletion, but seeing my editor picking up TypeScript definitions is excellent. To see that CodeSandbox does the same is nice! GitHub integration makes CodeSandbox a real tool to work with The last feature that got me was GitHub integration, which lets you create a project in CodeSandbox, push it to GitHub, and then make commits from CodeSandbox directly to GitHub. Very cool stuff! The only feature missing Split-view mode for viewing multiple files at once is the only thing missing to make it my everyday application for development. Let’s hope that it’ll come soon! 🤞🏻 Contentful – the content infrastructure for any project With CodeSandbox you can quickly create your next JavaScript project and push it to GitHub. Very often when you do website development, the projects are built for people that are not that comfortable with writing code, though. Take a quick, one-pager portfolio site for a friend as an example. How would you go about this this project, saving them the effort of updating content with a pull request, but also without setting up a complete content management system yourself? You can use Contentful’s content infrastructure for that. With Contentful, you can define your needed data models in minutes and get the data back using JSON APIs. For the above example, you need an entity with individual fields for an image, a headline, and a paragraph respectively. This flexibility is where Contentful shines – create a content type portfolio and define the three needed fields without any need to set up a server or something similar. Your non-techy friend can now make content changes to the JavaScript app you’re building without editing JSON files or React code. Later, you can use the provided JavaScript SDK to get the Contentful data edited by your friend. import React from "react"; import ReactDOM from "react-dom"; import { createClient } from "contentful"; import "./styles.css"; // create the SDK client with the needed credentials // which you can get in the web app const client = createClient({ space: "...", accessToken: "..." }); function Portfolio() { /* … */ } class App extends React.Component { constructor() { super(); this.state = { isLoading: true, portfolio: null }; // fetch the entry of your portfolio entry type client .getEntries({ content_type: "portfolio" }) .then(({ items }) => { this.setState({ isLoading: false, portfolio: items[0] }); }); } render() { return this.state.isLoading ? ( <div>Loading</div> ) : ( <div className="App"> <Portfolio {...this.state.portfolio.fields} /> </div> ); } } When you look at the code above, one of my favorite things is that you can connect content entries with your frontend component quite easily ( <Portfolio {...this.state.portfolio.fields} />). This connection makes Contentful a perfect fit for component-driven applications and sites. Netlify – the few-clicks static deployment tool Now you have the code editable and connected to Github in CodeSandbox, and you can edit the content that powers the application via Contentful. The last step is to deploy this application somewhere. Netlify is a relatively new service out there that specializes in static deployments. The cool thing about Netlify is that they also allow you to define build scripts - they’re your CI service and host, so to say. To deploy a site to Netlify you can start by importing a specific GitHub repository: Your next steps are to define a build command and public directory in which the static files will be present. In the case of create-react-app, the build command is npm run build and the published directory will be build. After submitting these two configurations, your first deploy will get up and running, and you’ll get a unique subdomain on netlify.com. One less obvious thing after importing a GitHub repository in Netlify is that this process also defines webhooks on GitHub. Now every time you push new code to GitHub, Netlify will automatically redeploy your site. Magic? Magic! Usage of webhooks to connect all the pieces For this portfolio demo site, there is no additional webhook configuration needed because the React application fetches that data right from the browser. But client-side only applications have the significant downside that they show a loading spinner initially until they've fetched all the needed API data. A more performant way to do it is to statically pre-render React on the server and then do something that is called hydration when the client-side React code kicks in. The static pre-render approach means that you would have to re-render the generated HTML files and deploy them whenever your friend updates their portfolio data in Contentful, too. An additional webhook notifying Netlify has to be configured in Contentful in that case. With a little bit more webhook configuration, you can then set up a complete deployment pipeline without any local installation and configuration shipping static sites without loading spinners. Use the power of web services to not reinvent the wheel In conclusion, I’m amazed how much the web development field has changed. Serverless technologies change the way we work and we no longer have to worry about all the tiny pieces that might be needed in a project. For running Node.js projects we can use Zeit, for authentication Auth0, and for a performant search experience Algolia. Webhooks and serverless functions give me the possibility to connect all these services and write quick connectors in the cloud in an easy and speedy manner. That’s very exciting because I can now focus on building things rather than setting things up and... I can even create and deploy websites on my friend's computer while we’re sitting on their balcony. Have a project in mind and want to try out Contentful? Sign up free.
https://www.contentful.com/blog/2018/08/07/developing-website-cloud-codesandbox-contentful-netlify/
CC-MAIN-2021-21
refinedweb
1,707
52.39
RoboFab vs. FontParts APIs ↩ - API differences - Importing font objects - Pens - Object selection API - The RFont.compileGlyphmethod was deprecated in FontParts because it was considered too limited. Glyph Construction is recommended as a more powerful approach to building glyphs. The glyphConstructionmodule is now embedded in RoboFont 3. See Building accented glyphs with a script for more information and examples. RGlyph RAnchor Importing font objects In RoboFab, the main font objects for the current environment were imported from the robofab.world module: from robofab.world import RFont, RGlyph # etc In FontParts, the corresponding objects are found in the fontParts.world module: from fontParts.world import RFont, RGlyph # etc FontParts objects are needed only when working outside of RoboFont. When coding in RoboFont, you can use the native objects from mojo.roboFontinstead. Pens RoboFab pens were reorganized and moved to other packages. FontParts does not include pens. Converter pens were moved into the ufoLib, to isolate the implementation of the PointPen infrastructure and protocol. Other pens were moved to the new fontPens package, and other to fontTools. The ufoLibis now part of FontTools. From RoboFont 3.2 onwards, all pens from the ufoLib.pointPenmodule can also be found in fontTools.pens.pointPen. The ufoLibmodule will be deprecated. The following table provides a list of all RoboFab pens and their new locations. Object selection API FontParts introduces a new object selection API, which offers fine-grained control over selections in different types of objects. Object Selection Flag The selected attribute (a boolean) is supported by these objects: Sub-Object Selected Objects Objects with sub-objects can now also return a list of selected sub-objects:. The ufoLibis now part of FontTools. From RoboFont 3.2 onwards, all tools from the ufoLib.glifLibmodule can also be found in fontTools.ufoLib.glifLib. The ufoLibmodule will be deprecated.
https://doc.robofont.com/documentation/building-tools/toolkit/robofab-fontparts/
CC-MAIN-2020-29
refinedweb
301
52.76
Scaling code that we’re ready to share. To recap the talk: at any given point over the last four years, we have had what I’d call a minimum viable caching system. The stages were: - Stand up a Master-slave Memcached pair. - Add sharded Redis, each shard a master-slave pair, with loosely Pinstagram-style persistence, consistent hashing based on fully distributed ketama clients, and Zookeeper to notify clients of configuration changes. - Replace (1) with Wayfair-ketamafied Memcached, with no master-slaves, just ketama failover, also managed by Zookeeper. - Put Twemproxy in front of the Memcached, with Wayfair-ketamafied Twemproxy hacked into it. The ketama code moves from clients, such as PHP scripts and Python services, to the proxy component. The two systems, one with configuration fully distributed, one proxy-based, maintain interoperability, and a few fully distributed clients remain alive to this day. - Add Redis configuration improvements, especially 2 simultaneous hash rings for transitional states during cluster expansion. - Switch all Redis keys to ‘Database 0’ - Put Wayfairized Twemproxy in front of Redis. - Stand up a second Redis cluster in every data center, with essentially the same configuration as Memcached, where there’s no slave for each shard, and every key can be lazily populated from an interactive (non-batch) source. The code we had to write was - Some patches to Richard Jones’s ketama, described in full detail in the previous blog post:. - Some patches to Twitter’s Twemproxy :, a minor change, making it interoperable with the previous item. - Revisions to php-pecl-memcached, removing a ‘version’ check - A Zookeeper script to nanny misbehaving cluster nodes. Here’s a gist to give the idea. Twemproxy/Nutcracker has had Redis support from early on, but apparently Twitter does not run Twemproxy in front of Redis in production, as Yao Yue of Twitter’s cache team discusses here: . So we are not necessarily surprised that it didn’t ‘just work’ for us without a slight modification, and the addition of the Zookeeper component. Along the way, we considered two other solutions for all or part of this problem space: mcRouter and Redis cluster. There’s not much to the mcRouter decision. Facebook released McRouter last summer. Our core use cases were already covered by our evolving composite system, and it seemed like a lot of work to hack Redis support into it, so we didn’t do it. McRouter is an awesome piece of software, and in the abstract it is more full-featured than what we have. But since we’re already down the road of using Redis as a Twitter-style ‘data structures’ server, instead of something more special-purpose like Facebook’s Tao, which is the other thing that mcRouter supports, it felt imprudent to go out on a limb of Redis/mcRouter hacking. The other decision, the one where we decided not to use Redis cluster, was more of a gut-feel thing at the time: we did not want to centralize responsibility for serious matters like shard location with the database. Those databases have a lot to think about already! We’ll certainly continue to keep an eye on that product as it matures. There’s a sort of footnote to the alternative technologies analysis that’s worth mentioning. We followed the ‘Database 0’ discussion among @antirez and his acolytes with interest. Long story short: numbered databases will continue to exist in Redis, but they are not supported in either Redis cluster or Twemproxy. That looks to us like the consensus of the relevant community. Like many people, we had started using the numbered databases as a quick and dirty set of namespaces quite some time ago, so we thought about hacking *that* into Twemproxy, but decided against it. And then of course we had to move all our data into Database 0, and get our namespace act together, which we did. Mad props to the loosely confederated cast of characters that I call our distributed systems team. You won’t find them in the org chart at Wayfair, because having a centralized distributed systems team just feels wrong. They lurk in a seemingly random set of software and systems group throughout Wayfair engineering. Special honors to Clayton and Andrii for relentlessly cutting wasteful pieces of code out of components where they didn’t belong, and replacing them with leaner structures in the right subsystem. Even madder props to the same pair of engineers, for seamless handling of the operational aspects of transitions, as we hit various milestones along this road. Here are some graphs, from milestone game days. In the first one, we start using Twemproxy for data that was already in Database 0. We cut connections to Redis in half: Then we take another big step down. Add the two steps, and we’re going from 8K connections, to 219. Sorry for the past, network people, and thanks for your patience! We promise to be good citizens from now on. [Update: I gave a talk about this at Facebook’s Data@Scale Boston 2014 conference ] Responses April 9th, 2015 Great work, thanks for the update Ben! May 24th, 2019 Great move. I belong to retail industry and i am personally evaluating different caching solution to remove bottlenecks and improve performance. i found NCache as alternative to Redis and now i am confused. Can you please share with me the Redis performance and issues? It will help me in taking a better decision. Reference:
https://tech.wayfair.com/2015/03/scaling-redis-and-memcached-at-wayfair/
CC-MAIN-2020-29
refinedweb
910
61.87
OK, where to start? I’m gonna link to bits of information for further explanation. That makes my job easier =) (1) If you’re going to use a base class like this, you should have a virtual destructor too. (2) In an abstract base class, you usually want to declare you virtual functions pure virtual, by adding the “= 0”. (3) You usually want classes in an inheritance hierarchy to be non-copyable and to use a cloning mechanism instead, to avoid the chance on slicing. Slicing is what happens if you have a reference to a Shape that is actually a Rectangle and you make a copy. Then the copy will only contain the Shape part and not the Rectangle. The link will explain it better, the only reason I mention it here is because it’s important in (4) (4) When dealing with arrays of objects from a inheritance hierarchy, you don’t want to store an array of the base class, but an array of POINTERS TO the base class. Otherwise, when you push a Rectangle in the collection, you will SLICE the object to a shape and you will loose the Rectangle information. Actually, once you have a pure virtual function, you will find it impossible to have an array of Shapes. The only thing you’ll have to take care of, is to delete the objects explicitly on destruction of the ShapeGroup. (4 bis): it’s best to use the heap to allocate objects in an inheritance hierarchy (5) an extra: it’s easier to use a std::vector instead of plain arrays. (6) another extra: for abstract base classes, it’s good practice to declare the constructor as protected. #include <stdio.h> #include <vector> // (6) class Shape { public: virtual ~Shape() {} // (1) virtual void draw() = 0; // (2) protected: Shape() {} // (6) }; // Rectangle and Circle are OK class ShapeGroup { public: ShapeGroup() { // nothing to be done thanks to (5) } ~ShapeGroup() { // vectors can be accessed like arrays, // and they know their own size (5) for (int i = 0; i < shapes.size(); i++) { delete shapes[i]; // delete shapes explicitly (4) } } void AddShape(Shape* sh) { // pointer to shape, due to (4) shapes.push_back(sh); // vector syntax, (5) } void DrawAllShapes() { for (int i = 0; i < shapes.size(); i++) { // we're storing pointers (4), so -> instead of . shapes[i]->draw(); } } private: std::vector<Shape*> shapes; // use vector (5) of pointers (4) }; int main() { ShapeGroup *group = new ShapeGroup(); Circle* c = new Circle; // (4 bis); Rectangle* r = new Rectangle; // (4 bis); group->AddShape(c); group->AddShape(r); group->DrawAllShapes(); while (true) {} // so we can see output window... delete group; return 0; } There are still some issues left, like using auto_ptr in main() to protect against possible memory leaks, but that’s for later. Also, in this example it is not necessary to allocate ShapeGroup on the heap. And of course I assume that the while (true) {} loop is just a oversimplification of the real situation. hi everybody again… i want to baild an abstract class called: Shape with virtual function “draw”… a ShapeGroup class will store shapes and draw them ! in ShapeGroup class “DrawAllShapesfunction” we dont know witch shape we are drawing so i use the base class Shape ! but i got a linker error : i dont want to set Draw function for base class “Shape”, i want to call its deriven classes; witch we dont know their number, name or …
http://devmaster.net/posts/13118/c-oo-problem-virtual-function-abstract-class
CC-MAIN-2014-10
refinedweb
565
65.66
#include <CGAL/Direction_2.h> An object d of the class Direction_2 is a vector in the two-dimensional vector space \( \mathbb{R}^2\) where we forget about its length. They can be viewed as unit vectors, although there is no normalization internally, since this is error prone. Directions are used whenever the length of a vector does not matter. They also characterize a set of parallel oriented lines that have the same orientations. For example, you can ask for the direction orthogonal to an oriented plane, or the direction of an oriented line. Further, they can be used to indicate angles. The slope of a direction is dy()/ dx(). Kernel::Direction_2 returns true, iff d is not equal to d1, and while rotating counterclockwise starting at d1, d is reached strictly before d2 is reached. Note that true is returned if d1 == d2, unless also d == d1. returns values, such that d == Direction_2<Kernel>(delta(0),delta(1)).
https://doc.cgal.org/4.12.1/Kernel_23/classCGAL_1_1Direction__2.html
CC-MAIN-2022-05
refinedweb
158
65.01
I was running this program on the page: I have just started with Cuda. #include <iostream> #include <math.h> // Kernel function to add the elements of two arrays __global__ void add(int n, float *x, float *y) { for (int i = 0; i < n; i++), 1>>>; } I got the following warnings: ==4312==Warning:. More details can be found at: (I can’t understand anything much on this page, need directions in layman terms) ==4312== Warning: Found 42 invalid records in the result. ==4312== Warning: This can happen if device ran out of memory or if a device kernel was stopped due to an assertion. Even after using 940MX 2GB my profile time is slower than the author’s GT 740M which is rated lower for Cuda.
https://forums.developer.nvidia.com/t/cuda-might-not-be-working-properly-and-other-warnings/62774
CC-MAIN-2020-40
refinedweb
125
68.1
Wing Tips: Extending Wing with Python (Part 3 of 4) In this issue of Wing Tips we continue to look at how to extend Wing's functionality, by taking a look at extension scripts that collect arguments from the user. This article assumes you already know how to add and try out extension scripts in Wing. If you haven't read the previous installments of this series, you may want to take a look at Part 1 where we introduced Wing's scripting framework and set up auto-completion for the scripting API, and Part 2 where we used Wing to debug itself for easier extension script development. Script Arguments Extension scripts may be defined with arguments, which Wing will try to collect from the user if not specified. For example: import wingapi def test_argument(text): wingapi.gApplication.ShowMessageDialog("Result", "You typed: {}".format(text)) After the script is loaded, you can use Command by Name from the Edit menu to execute it by typing test-argument as the command name. Because the type of argument text is undefined, Wing collects it as a string in an entry area shown at the bottom of the IDE window: In key bindings and added toolbar items, it is often useful to provide the value of an argument as part of the invocation like this: test-argument(text="hello") This displays the message dialog without first prompting for the value of text: Script arguments must always be passed using the keyword arg=value form. If a script has multiple arguments and only some are specified in its invocation, Wing collects only the unspecifed arguments from the user. Default values may be specified in the script definition, in order to avoid collecting the argument from the user if it is not given in the invocation: import wingapi def test_argument(text="default"): wingapi.gApplication.ShowMessageDialog("Result", "You typed: {}".format(text)) This simplest form, without specifying argument type or interface, is sufficient for many scripting tasks that require argument collection. Argument Type and Interface Extension scripts may also specify the type and interface to use for arguments by by setting the arginfo function attribute on the script. This is a map from argument name to a specification that includes documentation, data type, argument collection interface, and a label. This example collects two arguments, a filename and a choice from a popup menu: import wingapi from wingutils import datatype from guiutils import formbuilder def test_arg_entry(filename, word): wingapi.gApplication.ShowMessageDialog('Choice {}'.format(word), "You chose: {}".format(filename)) _choices = [ ("Default", None), None, ("One", 1), ("Two", 2), ("Three", 3) ] test_arg_entry.arginfo = { 'filename': wingapi.CArgInfo( "The filename to enter", # The tooltip shown to use over this field datatype.CType(''), # The data type is string formbuilder.CFileSelectorGui(), # Use a file selection field to collect the value "Filename:" # The field label ), 'word': wingapi.CArgInfo( "The word to enter", datatype.CType(''), formbuilder.CPopupChoiceGui(_choices), # Use a popup menu to collect this value "Word:" ) } # This causes the script to be listed in a new menu Scripts in the menu bar test_arg_entry.contexts = [wingapi.kContextNewMenu('Scripts')] Notice that this imports some additional modules not used in our previous examples in this series: datatype is used to specify the type of an argument, and formbuilder is used to specify how the value is collected from the user. These are documented in Argument Collection in the users manual. Once you load the script, you can try it with Test arg entry in the Scripts menu that should appear in the menu bar. The value collection area will look like this: Pressing Tab moves between the fields and Enter executes the command, which displays this dialog: Using a Dialog for Argument Entry Arguments may also be collected in a dialog, rather than at the bottom of the IDE window. For the above example, this would be done by appending the following code: test_arg_entry.flags = {'force_dialog_argentry': True} After this change is saved, executing Test arg entry from the Scripts menu displays the argument entry fields in a dialog instead: Providing History and Completion Argument entry can also implement history (accessible by pressing the up and down arrows) and completion of matching choices with Tab or Enter. The following example does both for its argument text: import wingapi from wingutils import datatype from guiutils import formbuilder # The command does nothing other than adding the argument to history # (first=most recent) _history = [] def test_arg_entry(text): if text in _history: _history.remove(text) _history.insert(0, text) # For completions, we just use the matching words in this file def _completions(fragment): fn = __file__ if fn.endswith(('.pyc', '.pyo')): fn = fn[:-1] with open(fn) as f: txt = f.read() return sorted([t for t in txt.split() if t.startswith(fragment)]) test_arg_entry.arginfo = { 'text': wingapi.CArgInfo( "Test with completion and history", datatype.CType(''), formbuilder.CSmallTextGui(history=_history, choices=_completions) ), } test_arg_entry.contexts = [wingapi.kContextNewMenu('Scripts')] test_arg_entry.flags = {'force_dialog_argentry': True} After replacing the script created earlier with the above code you should see an auto-completer as you type: After executing the command one or more times, the up and down arrows traverse the stored history: Note that in this implementation the history is lost each time the script is reloaded. One way to save history or any other value across script reload or sessions is to store it using SetAttribute() on the current project obtained from wingapi.gApplication.GetProject(). The above covers most argument collection needed by extension scripts for Wing. A few other data entry methods are also supported, as documented in Argument Collection in the users manual. That's it for now! In the next Wing Tip we'll take a look at the API in more detail, in order to write a more complex scripting example. Share this article:
http://wingware.com/hints/scripting-3
CC-MAIN-2020-16
refinedweb
958
50.97
Re: delete command weirdness - From: Nathaniel Calloway <ntc6@xxxxxxxxxxx> - Date: Tue, 13 May 2008 01:18:20 -0400 CL-USER> (defvar testing) TESTING CL-USER> (setq testing '(a b c d)) (A B C D) CL-USER> (delete 'a testing) (B C D) The (B C D) you see above is the value returned by delete. Obvious, perhaps, but I am just warming up. Uh huh....I know how lisp works. CL-USER> testing (A B C D) If you are familiar at all with programming (I do not know how experienced you are) you will realize delete does not see the /variable/ testing, the caller pulls a value out of that variable and passes it to delete. ie, delete sees (a b c d), not "testing". This is wrong. When you don't try to change the car, it goes to where testing points to the memory and changes the various cons'es, IE it "sees" where testing is pointing. Don't confuse this with the differences in the eval loop between macros and functions. All delete can do is dutifully return a list without A, and whaddaya know, it can do just by returning the CDR of the list received (since A appears only in the car of the first cons). Well, sure, but that's not the issue. The issue is why it doesn't change the assignment of testing. CL-USER> (delete 'b testing) (A C D) Now delete is forced to do some work, and makes the cdr of the first cons the cdr of the second cons, effectively discarding the second cons from the structure received. You skipped the last line showing that delete is in fact destructive...but only when you aren't changing the car. Another way for you to understand this is to try to write a destructive version of my-delete that does behave they way you expected. Methinks the light will go on before you write a line of code. My problem isn't writing code, it's understanding why exactly this behavior was chosen. This is indicative of something deeper in lisp than anything you have touched on. I'm assuming it has to do with how variables are assigned. What I fail to understand is why exactly lisp doesn't have a problem changing where a particular cdr points, but does have a problem with changing where a variable points. My feeling is that because variables are handled differently in some way, whomever coded delete sacrificed consistent behavior for consistent code. (For the record, if this is the case, I think it is silly: either smash everything into the same namespace like scheme and treat it all the same, and have your theoretical consistency, or just make it work intuitively). And that brings me to another question: Why even include delete at all? Remove works just fine in a non-destructive way, and we can always just (setq testing (remove 'a testing)). Is there any purpose to having a function that will destructively delete anything but the car? Perhaps, but I sure can't think of one. -Nat . - Follow-Ups: - Re: delete command weirdness - From: Robert Maas, - Re: delete command weirdness - From: Barry Margolin - Re: delete command weirdness - From: Barry Margolin - References: - delete command weirdness - From: Nathaniel Calloway - Re: delete command weirdness - From: Ken Tilton - Prev by Date: Re: delete command weirdness - Next by Date: Re: delete command weirdness - Previous by thread: Re: delete command weirdness - Next by thread: Re: delete command weirdness - Index(es):
http://coding.derkeiler.com/Archive/Lisp/comp.lang.lisp/2008-05/msg00503.html
CC-MAIN-2016-18
refinedweb
588
67.18
Polymorphism in java is the ability of an entity to take several forms or performing single action at different times. As it was named Poly means many and morph means one or more forms, so that we can know polymorphism means many forms. Which means an object showing different behaviors at different times. For example, a person can be a son, student, employee, husband, and father, he is playing different roles in the different situation he is changing the behavior according to the point of the time. Polymorphism is often classified into two types - Static Polymorphism (Compile time polymorphism) - Dynamic Polymorphism (Runtime polymorphism) Static Polymorphism The static polymorphism will be resolved during the compiler time so that it was also called the Compile time Polymorphism. The Method Overloading is an example of Static Polymorphism. Method Overloading It is possible to create a method that has the same name but different in the parameter list and the number of arguments passed is called Method Overloading. Method Overloading is used when objects are required to perform a similar task but use in different input parameters when we call a method in an object java matches up the method name first and then the number and types of the parameters to decide which one of the definitions to execute. For Example: import java.io.*; class Overload1 { void test() { System.out.println(“Method Overloading”); } void test(int a) { System.out.println(“Single Value =” +a); } int test(int a,int b) { return(a*b); } double test(double a) { return(a*a); } } class Overload { public static void main(String args[])throws IOException { Overload1 t=new Overload1(); t.test(); t.test(10); System.out.println(“Value of a*b =”+t.test(10,20)); System.out.println(“Value of a*a =”+t.test(10.5)); } } Output: Method Overloading Sing Value = 10 Value of a*b = 200 Value of a*a = 110.25 Dynamic Polymorphism The dynamic polymorphism in java will be resolved during the runtime so that it was also called the Runtime Polymorphism. The Method Overriding is an example of Dynamic Polymorphism. Method Overriding A method defined in the superclass is inherited by its subclasses and used by the object created by the subclass. It is possible to define a method in a subclass that has the same name, the same number of arguments and, the same return type as a method in the superclass. For Example: import java.io.*; class Parent { void display() { System.out.println(“This is Parent Class”); } } class Child extends Parent { void display() { super display(); System.out.println(“This is Child Class”); } } Class Override { public static void main(String args[])throws IOException { Child c= new Child(); c.display(); } } Output: This is Child Class Related Article:
https://codingsmania.in/polymorphism-in-java/
CC-MAIN-2021-25
refinedweb
452
54.42
First try Before getting into any detailed knowledge, it's a good idea to try your first project. You'll have a first impression of what your board can do. Let's blink an LED. Set up software At first, you will set up the software for your board. Open the Visual Studio Code. I believe most of you guys have installed it. We have created an extension for it. It is really handy and easy to use. Install the extension MadMachine as shown below: - click the Extensions button on the left bar. - enter the extension name MadMachine in the search box. - click the Install button. Download the latest mm sdk. It is used to build your project. Choose the version marked with the label Latest. The versions marked with Pre-release are still for internal testing. Open the Settings by clicking Code / Preferences / Settings to set the extension. - Click Extensions to expand it and find MadMachine. Indicate the mm sdk location in the box that matches your operating system. If you change the location of sdk later, you will need to update it again. OK, the software gets prepared👏. Create a project Now, you will start your first project. - Click the Explorer button on the left bar. Then click the extension MadMachine on the bottom to show three functionalities. Click New Project. - Choose the project as an executable. Your project will run on the board after it is downloaded, so you need an executable. And the projects later in the following sections are all executables. - Choose the board for this project - SwiftIOFeather. - Name the project. You could choose any descriptive name you like for the project. Then press the Enter key. - Choose a location to store the project and press Open. Well, the project is created and will open in a new window. Write code Then you will need to edit the code for the project. Click on the Blink / Sources / Blink / main.swift to open the file. This file stores the main code for your project. So you will always edit this file for all your projects. Copy the code below into the file. In the next section, you will learn more about the code. import SwiftIO import MadBoard let led = DigitalOut(Id.BLUE) while true { led.write(true) sleep(ms: 1000) led.write(false) sleep(ms: 1000) } Download code to the board Now you come to the last steps - download your project to the board. - Connect your SwiftIO Feather board to your computer. In the illustration below, the SwiftIO Feather board is pluged into the SwiftIO Circuit Playgrounds board. You can also disconnect them. - Press the download button. - Wait until the onboard LED turns to steady green. - Click the Download button. It will take a few seconds. After it's done, the onboard blue LED starts to blink💡.
https://docs.madmachine.io/tutorials/swiftio-circuit-playgrounds/preparation/first-try
CC-MAIN-2022-21
refinedweb
471
87.92
how to make vanilla.Window not disappear - RafaŁ Buchner last edited by gferreira hi (hehe, me again) how to make simple vanilla.Window not disappear programmatically when the RoboFont app is becoming inactive? Eg: from vanilla import * class simpleWin: def __init__(self): self.w = FloatingWindow((200,200)) self.w.open() simpleWin() If I will run the code above in the RF, and change the active app to any another (let's say Finder), I see only default RF windows like script window, font window or glyph window. I would like my simpleWin also be visible in that case. Is it possible? I realized that Erik's design space extension does it. I was trying to find it in its code. Somehow I could not. Any help would be appreciated - colinmford last edited by colinmford FloatingWindows are meant to act like NSPanel, which hide when the app is unfocused. If you want a standard window that stays open when you leave the app (like erik's), use the vanilla class Windowinstead. from vanilla import * class WindowDemo(object): def __init__(self): self.w = Window((200, 70), "Window Demo") self.w.myButton = Button((10, 10, -10, 20), "My Button") self.w.myTextBox = TextBox((10, 40, -10, 17), "My Text Box") self.w.open() WindowDemo() hi @RafaŁ-Buchner, if you want a window to stay visible when the app focus changes, it is recommended to use Windowinstead of FloatingWindow: from vanilla import Window, FloatingWindow class SimpleWindow: def __init__(self): self.w = Window((200,200), 'Window') self.w.open() class SimpleFloatingWindow: def __init__(self): self.w = FloatingWindow((200,200), 'FloatingWindow') self.w.open() SimpleWindow() # this one stays visible when RF is inactive SimpleFloatingWindow() # this one does not if you really need a FloatingWindowwhich stays visible (like the Output Window, for example), it can be done by tweaking the native window object: from vanilla import FloatingWindow class SpecialFloatingWindow: def __init__(self): self.w = FloatingWindow((200,200), 'SpecialFloatingWindow') self.w.getNSWindow().setHidesOnDeactivate_(False) self.w.open() SpecialFloatingWindow() edit: written before reading @colinmford’s reply… - RafaŁ Buchner last edited by @gferreira said in how to make vanilla.Window not disappear: self.w.getNSWindow().setHidesOnDeactivate_(False) Thanks Gustavo!!! That is exacly what I needed
https://forum.robofont.com/topic/620/how-to-make-vanilla-window-not-disappear
CC-MAIN-2020-16
refinedweb
365
51.24
This is just a PSA posting. If you are making the jump from Windows 8 or Windows Phone 8 XAML development and are used to use the EventToCommand helper which comes along w/ the MVVM Light framework, things have changed and it is ok. In fact Laurent has a nice post on how to use the new built-in EventTriggerBehior rather than the EventToCommand helper. However, there is two key pieces of information missing from his examples. 1) In order to get the Interaction.Behaviors namespace included you reference the Behaviors SDK inside your Windows 8.1 project 2) You will need to add reference to the correct namespaces in your xaml (see below) xmlns:interactivity="using:Microsoft.Xaml.Interactivity" xmlns:core="using:Microsoft.Xaml.Interactions.Core" Once you have done these 2 things you should be good to go. Till next time,
http://codebetter.com/derikwhittaker/2014/06/10/using-invokecommandaction-in-winodws-8-1-universal-applications/
CC-MAIN-2015-48
refinedweb
143
56.96
On 04/04/2013 07:40 AM, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" <berrange redhat com> > > Introduce a method virFileDeleteTree for recursively deleting > an entire directory tree > > Signed-off-by: Daniel P. Berrange <berrange redhat com> > --- > src/libvirt_private.syms | 1 + > src/util/virfile.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++ > src/util/virfile.h | 2 ++ > 3 files changed, 81 insertions(+) Don't we already have something like this? /me goes and looks... yep, very similar to virCgroupRemoveRecursively - hopefully a later patch drops that function to use this instead. I like the idea of a generalized interface. > + * virFileDeleteTree: > + * > + * Recursively deletes all files / directories > + * starting from the directory @dir. Does not > + * follow symlinks > + */ > +int virFileDeleteTree(const char *dir) > +{ > + DIR *dh = opendir(dir); > + struct dirent *de; > + char *filepath = NULL; > + int ret = -1; > + > + if (!dh) { > + virReportSystemError(errno, _("Cannot open dir '%s'"), > + dir); > + return -1; > + } > + > + errno = 0; > + while ((de = readdir(dh)) != NULL) { > + struct stat sb; > + > + if (STREQ(de->d_name, ".") || > + STREQ(de->d_name, "..")) > + continue; > + > + if (virAsprintf(&filepath, "%s/%s", > + dir, de->d_name) < 0) { > + virReportOOMError(); > + goto cleanup; > + } We should use gnulib's LGPL unlinkat. On capable kernels, it avoids O(n^2) behavior that is inherent in computing filenames in a deep hierarchy. On less capable kernels, it still makes this code simpler to write (no virAsprintf needed here). > + > + if (lstat(filepath, &sb) < 0) { > + virReportSystemError(errno, _("Cannot access '%s'"), > + filepath); > + goto cleanup; > + } Potentially wasteful on systems like Linux that have d_type. If d_type exists, and is not DT_UNKNOWN, then the difference between DT_DIR and other types can save some system call efforts. Potential TOCTTOU race. POSIX allows unlink("dir") to succeed (although most platforms reject it, either always [Linux], or based on capabilities [Solaris, which also has code to give up that capability, and where gnulib also exposes that]). If we ever manage to unlink() a directory, because we lost the TOCTTOU race, then we have done bad things to the file system. But you are guaranteed that rmdir() on a non-directory will gracefully fail; so you can minimize the race window by attempting to treat _every_ name as a directory first, then gracefully fall back to unlink() if the opendir() fails with ENOTDIR, without ever having to waste time lstat()ing things. Hmm, except that you don't want to follow symlinks, but opendir() follows them by default; so you would have to use open(O_DIRECTORY)/fdopendir() instead of raw opendir(). > + > + if (S_ISDIR(sb.st_mode)) { > + if (virFileDeleteTree(filepath) < 0) > + goto cleanup; > + } else { > + if (unlink(filepath) < 0 && errno != ENOENT) { > + virReportSystemError(errno, > + _("Cannot delete file '%s'"), > + filepath); > + goto cleanup; What happens on files that have restrictive permissions? Do we need to worry about chmod()ing files (or containing directories) to give ourselves enough access so that we can then turn around and unlink() files regardless of restrictive permissions? > + } > + } > + > + VIR_FREE(filepath); > + errno = 0; > + } > + > + if (errno) { > + virReportSystemError(errno, _("Cannot read dir '%s'"), > + dir); > + goto cleanup; > + } > + > + if (rmdir(dir) < 0 && errno != ENOENT) { > + virReportSystemError(errno, > + _("Cannot delete directory '%s'"), > + dir); > + goto cleanup; > + } What you have works, even if it is inherently quadratic compared to using unlinkat(). What sort of trees do we envision deleting? Do we need to start worrying about performance, using lessons learned from GNU coreutils? Or are the trees small enough, with properties of never being too-restrictive in file mode, and where the trees we are deleting are unlikely to be hit by a malicious user exploiting a TOCTTOU race, that we can just stick with this implementation as-is? > + > + ret = 0; > + > +cleanup: > + VIR_FREE(filepath); > + closedir(dh); > + return ret; > +} > diff --git a/src/util/virfile.h b/src/util/virfile.h > index c885b73..5f0dd2b 100644 > --- a/src/util/virfile.h > +++ b/src/util/virfile.h > @@ -108,4 +108,6 @@ int virFileUpdatePerm(const char *path, > int virFileLoopDeviceAssociate(const char *file, > char **dev); > > +int virFileDeleteTree(const char *dir); > + > #endif /* __VIR_FILES_H */ Very weak ACK, depending on what you answer to my commentary. -- 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/2013-April/msg00407.html
CC-MAIN-2014-10
refinedweb
663
55.95
In OpenCV, CV stands for Computer Vision that helps to understand and extract meaningful information from the images and videos. There exist various applications like facial recognition, detecting fingerprints, autonomous vehicles, obstacles avoidance, tumor detection, OCR, MRI, defect detection, etc. and in these and other computer vision applications, you will need OpenCV. What it does do? It detects features or specific objects from images or videos like faces, eyes, etc. It captures and analyzes the videos like estimating motion, tracking objects, etc, and saves the videos. It performs I/O operations from images or videos. Let's see what it is and how you can install it on your system. Introduction to OpenCV Open Source Computer Vision Library is the state of the art and one of the most popular computer vision libraries. It supports many languages like C, C++, Python, and Java. OpenCV is well known for its real-time operations and interactive windows capabilities. OpenCV-Python is a Python API for OpenCV but Python is a bit slower. You can easily extend Python with C/C++, you can create Python wrappers that can be used as Python modules and write code in C/C++ which will make your program computationally intensive. This is a cumbersome task and OpenCV does it for you automatically, it has a few Python scripts. You can learn more about them from here. OpenCV-Python uses NumPy which is an optimization library for numerical operations and can be converted to and from Numpy arrays. It can easily be integrated with other libraries that use Numpy like SciPy and Matplotlib. Installation If you don't have OpenCV on your system, let's see how you can install it. Setting up on Windows You need to have Python to the command line (type cmd in the Run dialog) and pip on your system before installing OpenCV. You can use the command line (type cmd in the Run dialog) for installation in windows. To check if Python exists, run the following command: $ python --version This command will tell you the Python version if it exists. To check for pip, run the following command: $ pip -V Pip is a system that installs or manages software packages/libraries written in Python. This command will tell you the location of the pip installed in your system and the version. To install OpenCV, it can directly be installed using pip by command line. Execute the following command: $ pip install opencv-python This command will install all the necessary data or information required. To check the version, run the following command: import cv2 print(cv2.__version__) Setting up on Ubuntu Python comes pre-installed on Ubuntu, so we directly install OpenCV now. Open the terminal (as root user) and run the following command: $ sudo apt-get install python3-opencv To check if it installed properly, execute the following command: import cv2 print(cv2.__version__) Setting up with Anaconda Environment Anaconda is open-source software that is used for large data processing and heavy computing, it contains jupyter notebooks, spyder, etc. For Anaconda installation, you need to have a minimum of 3 GB disk space on your system but for miniconda, 400 MB disk space will work. You should have a 32-bit or 64-bit system. For installation, go to their main website and install it with the default setting. After you are done with the installation, open the Anaconda Prompt (Start Menu / Anaconda3 / Anaconda Prompt). First create a new environment named opencv and activate it: $ conda create -n opencv $ conda activate opencv Then execute the following command: $ pip install opencv-python Note: conda install can also be used. More information can be found here: $ conda install -c conda-forge opencv To learn more about Anaconda, you can read this article on our website. End Notes OpenCV has been tremendously used in various applications and helps to make our tasks easier in computer vision, image processing, and machine learning. This tutorial gives you an overview of OpenCV and helps you to set up the library on your system.
https://www.python-engineer.com/posts/opencv-python-intro/
CC-MAIN-2022-21
refinedweb
676
62.07