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
“What can the French avant-garde teach us about search?”. I spent the winter of 2015 through 2016 investigating this very question. From England to Virginia, in the halls of academia a small group of researchers have been diligently working away. Applying ideas from the French Playwright Alfred Jarry’s (Wikipedia,Jarry, 2017) canon of literature, they hope to find new, interesting ways of transforming the world of search. Thus what could the results of a search engine such as possibly mean for how we think about finding information on the web? Why would searching for the word bicycle via this engine return images of a water bottle, key or tortilla chip jammed into somebody’s arm (give it a try and see what images come back)? Since the early days of Google and Yahoo, our ability to search for data to answer questions or hone in on a topic in the wilds of the web has become ever more refined. But some, such as Professor Andrew Hugill (Wikipedia, Hugill, 2017), argue this has taken away from the explorative nature of early search engines. How then have search engines like pata.physics.wtf challenged this world? Enter ‘pataphysics. ‘Pataphysics: a science of imaginary solutions The French playwright Alfred Jarry became infamous amongst the theatre goers of Belle Époque Paris at the end of the 19th century. His plays were raucous affairs with the 1896 opening of the controversial Ubu Roi descending into riot as the final curtain went down. Over the years, Jarry’s works, such as Dr Faustroll Pataphysician, would go onto explore a pseudo-philosophy he called ‘pataphysics. ‘Pataphysics (yes the ‘ belongs there) is often defined as: “… the science of that which is super induced.” (Jarry 1996) In essence, ‘pataphysics is a philosophy that looks at the exception, rather than the rule. Jarry and other followers of this ‘imaginary science’ constructed a number of categories of phenomena that help us to explain these exceptions. These can be summed up as: Clinamen The essence of a clinamen is a slight swerve from the norm. Canadian experimental poet Christian Bök defined the clinamen as: “the smallest possible aberration that can make the greatest possible difference”. (Bök 2002). For those familiar with Jarry’s work, his most notorious clinamen they are likely to have read is “merdre” a mutation of the French word merde (we leave it to you the reader to Google that term). The addition of the ‘r’ has changed the original word to something that makes the original vulgar term sound even harsher in its native French. In the world of computing the clinamen has been realized in code form through the application the Damerau-Levenshtein distance, where changing 1 letter in a word reveals a different word with often considerable difference in meaning. Syzygy The syzygy has its root in the realm of astronomy. The term refers to the alignment of three celestial bodies such as the Sun and Earth being in conjunction with the Moon. Outside of the field of astronomy the concept has been adopted by both poets and philosophers. It is therefore not surprising that it has found its way from philosophy into ‘pataphysics where it is used in the context of a pun resulting in something unexpected. An example of such a pun in the world of search is looking for the term “weed” and being presented with the word “band”. The user may have intended the initial search to mean an uncultivated plant growing in a flower patch. However by returning the word “band” the initial search term is thrown it into a different context. Now we have the initial word taking on the meaning drugs, and the result being either a reference to a rock band and associated drug use or a secondary meaning – the prohibition of drugs. Antinomy Most readers will be familiar with the term antinomy as it is used to define the mutually exclusive. The term thus sums up symmetry and incompatibility. Examples include good and evil and plus and minus. Synonym Synonyms are of course two words that in essence mean the same thing. We might use the words ‘ground’ and ‘land’ in a synonymous fashion for example. The beauty of synonyms is in their wordplay however. Two words can reference the same concept, but in fact have a difference in meaning. In our example ground and land can whilst being synonyms also be unrelated, where ground can mean to grind something up. Anomaly Jarry said ‘pataphysics is “the law that governs exceptions” and an anomaly is the disrupter of order, the exception that proves the rule. If ‘pataphysics sees the world (a rule in itself) as a stream of unique events then surely an anomaly is an oxymoron? However it is here we find that the anomaly exists through contradicting itself. A anomaly therefore is a pataphysical exception within the rule that renders the rule no longer a rule. It was from these categories that Hughill constructed the idea of patadata. This would be a ontological/taxonomic format for representing the association between a search term and a search result, with the results being one of the categories above. Thus, rather than take an input term and find more relevant results, using a patadata structure we hope to return more explorative terms. Based upon Hugill’s paper ‘pataphysics and computing we can see an example of what such a result may look like: Query = “Good” Patadata = [Fine(synonym), Evil(antinomy), Carrot(anomaly), Moral(syzygy), Hood(clinamen)] This set can then be further used by a search engine to return links to a user based upon the five pataphysical categories. The result is a search experience quite different to that of a traditional search engine such as Google. Early work has been done in implementing the ideas expressed by Andrew Hugill, Fania Raczinski, James Hendler and Johanna Drucker. Zhang, Zou, Jing and Yang of Bath Spa University at the 2016 IEEE Symposium on Service-Oriented System Engineering presented an approach to incorporating pataphysical concepts with the semantic web. Their paper discussed the application of a pataphysical ontology in OWL format, with an MVC architecture as part of a General Framework of Creative Computing. (Zhang et al. 2016) This proposed structure would be built upon a Java and Apache Jena based stack, with a JSP, JavaScript, HTML and CSS front end. For those interested in experimenting with these ideas at home however a simpler Python approach is available. Patalib – a Python library for exploring ‘pataphysics The Patalib Python package was a byproduct of the winter of research I conducted. It functions around the idea of using an English word list such as that found in Linux and the Python Natural Language Toolkit. Each search class generates a JSON object in a format similar to Hugill’s patadata structure. The libraries home page can be found hosted on GitHub at the following URL: A packaged version of the library can also be installed via pip from pypi: To install the library via pip run: pip install patalib Alternatively the source code can be cloned from GitHub: And also installed via pip. Remember to use the -e flag to install a local repository from source. Once you have PataLib installed, it’s time to experiment with generating some results from an input term. First however you will need the wordnet corpus. This can be downloaded using the following command: python -m nltk.downloader wordnet Once it has finished downloading you can start writing your first program. Create a new empty file called pata.py and copy and paste in the following application: from patalib import PataLib from patalib import Antonym, Synonym, Syzygy, Anomaly, Clinamen test = Synonym().generate_synonym("cheese") print test test = Antonym().generate_antonym("good") print test test = Syzygy().generate_syzygy("cheese") print test test = Anomaly().generate_anomaly("cheese", ["parrot","rabbit"], 1) print test test = Clinamen().generate_clinamen("gum", ["hum","gym"], 1) print test The first three of these classes rely upon values stored in the wordnet corpora for returning their values. The last two however require further input from the user. In this instance we have included a small list of two items, however this could of course be a dictionary of English words, such as the one mentioned that exists in Linux. The generate_anomaly method takes an additional parameter of an integer value. This tells us how many anomalies we would like to search for. Our list only has two values, so we only have the choice of 1 or 2 here realistically. Like generate_anomaly the generate_clinamen method also takes a numerical value as its last parameter. This is used to set the Damerau Levenshtein distance, that being the amount of “swerve” we want the algorithm to use. Each of these methods returns a dictionary object of the following format: {'input' : input word, 'results' : results, 'category' : category type} Here the input will be the input word, the results a list of matches and the category the category type for example anomaly, clinamen etc. Run the script via python pata.py and you will see the results displayed on the screen. And that’s really all there is to it. With a simple script you have generated some search results via the Python NLTK that implements pataphysical ideas. Conclusion At first glance the idea of applying a pseudo-philosophy from 100 years ago to computing might seem absurd, but you may already be unconsciously making use of manu of the ideas described here. When you explore WIkipedia, perhaps starting with the word cat and find yourself 20 minutes later reading an article on the Habsburg Empire. Through a series of what seem to be unrelated links one topic flows into another. Hopefully this article has opened your mind to some interesting ideas for improving search in ways that can replicate the fun that can be had by exploring Wikipedia. References Wikipedia.org (2017) Alfred Jarry. Available from: [24 January 2017] Wikipedia.org (2017) Andrew Hugill. Available from: [24 January 2017] Andrewhugill.com (2015) ’Pataphysics and Computing. Available from: [1 March 2016]. Bök, C. 2002. ‘Pataphysics: The Poetics of an Imaginary Science. Evanston IL, USA. Northwestern University Press. Jarry, A 1996, Exploits & Opinions of Dr. Faustroll Pataphysician. Boston USA, Exact Change. pp 26. Zhang L et al (2016) “An Approach to Constructing A General Framework for Creative Computing: Incorporating Semantic Web” 2016 IEEE Symposium on Service-Oriented System Engineering. pp. 297 – 306 Andy Dennis Related Posts - Modus Create Welcomes Larry Roe As SVP, Business Development Modus is excited to welcome Larry Roe as our SVP, Business Development. We also made… - Agile Development Teams: Size Matters Can I make my project move faster if I simply add more team members? This…
https://moduscreate.com/blog/what-can-the-french-avant-garde-teach-us-about-search/
CC-MAIN-2021-04
refinedweb
1,786
61.87
Jan 19, 2010 08:59 AM|HomerJ666|LINK Hello fellows! I am currently localizing my MVC website, using the Html.Encode method. I've got a global resouce named "Localization" and using it by e.g. <%= Html.Encode(Resources.Localization.FirstName) %> When compiled and viewing in the browser it works perfectly, but in VS 2008 Developement Edition it marks it red and displays Cannot resolve symbol 'Resources' when hovering it. Any way to get that to work? Cheerio, Thomas All-Star 157856 Points Moderator MVP Jan 19, 2010 01:16 PM|ignatandrei|LINK Stupid question, but maybe... : Are you using ReSharper? All-Star 15531 Points Microsoft Moderator Jan 19, 2010 07:39 PM|ricka6|LINK >>when hovering it. Don't hover :-) I've seen this problem before - sometimes rebuild all fixes it. Does your code work on a real IIS server? That's what you really should care about. Jan 20, 2010 06:51 AM|HomerJ666|LINK Yes i'm using resharper, and yes it works both on developement server and a real IIS. I found out the following: The resources generator was the evil thing. It produced a wrong namespace.. i dont know why it worked then though.. i changed it to 'PublicResXFileCodeGenerator' and changed the namespace to application.App_GlobalResources, and now i use just "Localization.ResourceKey" and everything is fine! thank you! thomas 3 replies Last post Jan 20, 2010 06:51 AM by HomerJ666
http://forums.asp.net/t/1515796.aspx
CC-MAIN-2014-42
refinedweb
237
60.31
Last Updated on February 10, 2021 Stochastic Gradient Descent is an important and widely used algorithm in machine learning. In this post you will discover how to use Stochastic Gradient Descent to learn the coefficients for a simple linear regression model by minimizing the error on a training dataset. After reading this post you will know: - The form of the Simple Linear Regression model. - The difference between gradient descent and stochastic gradient descent - How to use stochastic gradient descent to learn a simple linear regression model. Kick-start your project with my new book Master Machine Learning Algorithms, including step-by-step tutorials and the Excel Spreadsheet files for all examples. Let’s get started. - Updated Feb/2021: Fixed typo in predicted values. Linear Regression Tutorial Using Gradient Descent for Machine Learning Photo by Stig Nygaard, some rights reserved. Tutorial Data Set The data set we are using is completely made up. Here. Plot of the Dataset for Simple Linear Regression We can see the relationship between x and y looks kind-of linear. As in, we could probably draw a line somewhere diagonally from the bottom left of the plot to the top right to generally describe the relationship between the data. This is a good indication that using linear regression might be appropriate for this little dataset. Get your FREE Algorithms Mind Map Sample of the handy machine learning algorithms mind map. I've created a handy mind map of 60+ algorithms organized by type. Download it, print it and use it. Also get exclusive access to the machine learning algorithms email mini-course. Simple Linear Regression When we have a single in put attribute (x) and we want to use linear regression, this is called simple linear regression. With simple linear regression we want to model our data as follows: y = B0 + B1 * x This is a line where y is the output variable we want to predict, x is the input variable we know and B0 and B1 are coefficients we need to estimate. B0 is called the intercept because it determines where the line intercepts the y axis. In machine learning we can call this the bias, because it is added to offset all predictions that we make. The B1 term is called the slope because it defines the slope of the line or how x translates into a y value before we add our bias. The model is called Simple Linear Regression because there is only one input variable (x). If there were more input variables (e.g. x1, x2, etc.) then this would be called multiple regression. similar technique called stochastic gradient descent to minimize the error of a model on our training data. The way this, called weights (w) in machine learning language are updated using the equation: w = w – alpha * delta Where w is the coefficient or weight being optimized, alpha is a learning rate that you must configure (e.g. 0.1) and gradient is the error for the model on the training data attributed to the weight. Simple Linear Regression with Stochastic Gradient Descent The coefficients used in simple linear regression can be found using stochastic gradient descent. Linear regression is a linear system and the coefficients can be calculated analytically using linear algebra. Stochastic gradient descent is not used to calculate the coefficients for linear regression in practice (in most cases). Linear regression does provide a useful exercise for learning stochastic gradient descent which is an important algorithm used for minimizing cost functions by machine learning algorithms. As stated above, our linear regression model is defined as follows: y = B0 + B1 * x Gradient Descent Iteration #1 Let’s start with values of 0.0 for both coefficients. B0 = 0.0 B1 = 0.0 y = 0.0 + 0.0 * x We can calculate the error for a prediction as follows: error = p(i) – y(i) Where p(i) is the prediction for the i’th instance in our dataset and y(i) is the i’th output variable for the instance in the dataset. We can now calculate he predicted value for y using our starting point coefficients for the first training instance: x=1, y=1 p(i) = 0.0 + 0.0 * 1 p(i) = 0 Using the predicted output, we can calculate our error: error = 0 – 1 error = -1 We can now use this error in our equation for gradient descent to update the weights. We will start with updating the intercept first, because it is easier. We can say that B0 is accountable for all of the error. This is to say that updating the weight will use just the error as the gradient. We can calculate the update for the B0 coefficient as follows: B0(t+1) = B0(t) – alpha * error Where B0(t+1) is the updated version of the coefficient we will use on the next training instance, B0(t) is the current value for B0 alpha is our learning rate and error is the error we calculate for the training instance. Let’s use a small learning rate of 0.01 and plug the values into the equation to work out what the new and slightly optimized value of B0 will be: B0(t+1) = 0.0 – 0.01 * -1.0 B0(t+1) = 0.01 Now, let’s look at updating the value for B1. We use the same equation with one small change. The error is filtered by the input that caused it. We can update B1 using the equation: B1(t+1) = B1(t) – alpha * error * x Where B1(t+1) is the update coefficient, B1(t) is the current version of the coefficient, alpha is the same learning rate described above, error is the same error calculated above and x is the input value. We can plug in our numbers into the equation and calculate the updated value for B1: B1(t+1) = 0.0 – 0.01 * -1 * 1 B1(t+1) = 0.01 We have just finished the first iteration of gradient descent and we have updated our weights to be B0=0.01 and B1=0.01. This process must be repeated for the remaining 4 instances from our dataset. One pass through the training dataset is called an epoch. Gradient Descent Iteration #20 Let’s jump ahead. You can repeat this process another 19 times. This is 4 complete epochs of the training data being exposed to the model and updating the coefficients. Here is a list of all of the values for the coefficients over the 20 iterations that you should see: I think that 20 iterations or 4 epochs is a nice round number and a good place to stop. You could keep going if you wanted. Your values should match closely, but may have minor differences due to different spreadsheet programs and different precisions. You can plug each pair of coefficients back into the simple linear regression equation. This is useful because we can calculate a prediction for each training instance and in turn calculate the error. Below is a plot of the error for each set of coefficients as the learning process unfolded. This is a useful graph as it shows us that error was decreasing with each iteration and starting to bounce around a bit towards the end. Linear Regression Gradient Descent Error versus Iteration You can see that our final coefficients have the values B0=0.230897491 and B1=0.7904386102 Let’s plug them into our simple linear Regression model and make a prediction for each point in our training dataset. We can plot our dataset again with these predictions overlaid (x vs y and x vs prediction). Drawing a line through the 5 predictions gives us an idea of how well the model fits the training data. Simple Linear Regression Model Summary In this post you discovered the simple linear regression model and how to train it using stochastic gradient descent. You work through the application of the update rule for gradient descent. You also learned how to make predictions with a learned linear regression model. Do you have any questions about this post or about simple linear regression with stochastic gradient descent? Leave a comment and ask your question and I will do my best to answer it. God Bless you and your family . Your duties was every bright so keep it up. My loard jesus bless your mind and your duties. I don’t have more words. Thanks Tadele. u explain it very well. thank you so much. Thanks for your kind words effa. I’m glad you found the post useful. I am getting somewhat confused between epoch and iteration.Is epoch or iteration depends on number of observations in training dataset? I am having dataset as (year,cost)= [(2005,40.15), (2006,49.8), (2007,60), (2008,75), (2009,83), (2010,90), (2011,111), (2012,128). (2013,128), (2014,138), (2015,160),(2016,175) and I want to apply linear regression with stochastic gradient descent.what epoch or iteration should i set? One epoch is one run through the entire training dataset. An iteration may be an epoch or it may be an update for one training observation (one row in the training data), depending on the context (training iteration vs update iteration). Hi Jason, i am investgating stochastic gradient descent for logistic regression with more than 1 response variable and am struggling. I have tried this using the same formula but with a different calculation for the error term [error=Y-(1/1+exp(-BX))] I have plugged this into the equations you have provided but the coefficients to not seem to be converging. Is there anything that i am missing? A See this tutorial Alex: Hi Jason, where is the parameter m (number of training examples) in update procedure? In other tutorials it is like this: B0(t+1) = B0(t) – alpha / m * error B1(t+1) = B1(t) – alpha / m * error * x I’m not sure what you mean Serb. There is no “m” in the above equations. Yes, i see that there is no m, but it should be there. Since the cost function is defined as follows: J(B0, B1) = 1/(2*m) * (p(i) – y(i))^2 in order to determine the parameters B0 and B1 it is necessary to minimize this function using a gradient descent and find partial derivatives of the cost function with respect to B0 and B1. At the end you get equations for B0 and B1 where there is “m”. Jason, You mention these weight updating equations: B0(t+1) = B0(t) – alpha / m * error B1(t+1) = B1(t) – alpha / m * error * x B0 representing the slope of our to-be regression line and B1 the intercept. In other tutorials I see people () multiplying x into the slope weight update calculation and not the intercept like so: B0(t+1) = B0(t) – alpha / m * error * x B1(t+1) = B1(t) – alpha / m * error Can you explain if this is incorrect or what I’ve mistaken? Hi Daniel, The update equations used in this post are based on those presented in the textbook “Artificial Intelligence A Modern Approach”, section 18.6.1 Univariate linear regression on Page 718. See this reference for the derivation. I cannot speak for the equations in the youtube video. Hi Daniel, I believe you might be mixing up stochastic and batch gradient descend. In batch gradient descend you calculate the total error for all the examples and divide it by the number of examples for a ‘mean error’. On the other hand, in stochastic gradient descend, as in this article, you tackle one example at a time, so no need to calculate a mean by diving with the number of examples. I hope this helps. Also this post might help clear thing up: Actually the m isn’t necessary. It all depends upon the learning rate chosen the whole thing (alpha / m) may be regarded as a single constant. The point is, the learning rate is all the matters, the m is just another constant. Can you make a similar post on logistic regression where we could get to actually see some interations of the gradient descent? Ty. Hi Akash, Here is a tutorial for Logistic Regression with SGD: while i am trying to calculate the second example, i am getting the values as .03 and 0.06 but not as shown in the picture… please help me Remember to use the updated values from the last iteration as the starting values on the current iteration. I provide complete spreadsheet examples in my book: your .03 is the value of y(x) when b0 = .01 and b1= .01 to get second iteration you need to put inputs in this formula: b0= b0 – alpha* error and b1 = b1 – alpha * error*x where x is 3 Great tip. i mean in the second iteration, i am getting the values as 0.03 and 0.06 instead of 0.0397 0.0694. Please help me ASAP Hi, what is the convergence point? How we understand that is the minimum point of the function? You stopped calculation with B0=0.230897491 and B1=0.7904386102. And then calculated predicted values. Can you please explain why it stopped on this B0 B1 values? It should be error=0? How we see it? Thank you! Great question. You can evaluate the coefficients after each update to get an idea of the model error. You can then use the model error to determine when to stop updating the model, such as when the error levels out and stops decreasing. thanks for the post/tutorial Jason! In relation to Jenny’s question on when does the model converge – in the plot you showed, error seems generally to be getting closer to zero per iteration (I guess we could say it is being minimized). I just wanted to confirm 2 points: 1 – the error you plotted is the model error (computed by evaluating the coefficients and comparing to the correct values) right? 2 – we often see graphs plotting error vs iteration with the error decreasing over time (); is error in your graph just plotted on a different scale? or why do most training graphs have error decreasing from a positive number to zero? Would really appreciate some clarification, and thanks again for the tutorial! Belal The error is calculated on the data and how many mistakes the model made when making predictions. Thanks a lot for such a nice post, I have doubt in calculation of y coordinate using B0 and B1 value. Acc. to me we are using y=B0+B1*x (to calculate y predicted), but considering B0=0.230897491 and B1=0.7904386102, answer of first instance(x=1,y=1) should be y(predicted)=1.0213361012 as (y=(0.230897491)+(0.7904386102)*1), but in your post it is 0.9551001992., so am I doing something wrong or intercepted it wrongly? Guide me if I am missing somewhere? I am stuck at same question. The values of B0=0.230897491 and B1=0.7904386102 are actually for the 21th iteration therefore its wrong.If you look at the graph of the values you would notice the 20th iteration values of B0 and B1 are 0.219858174 0.7352420252 respectively.Substitute the values gives the correct predictions(.95…). Small human error I guess 🙂 If anyone wants to learn more about Simple linear regression, visit below link Thanks for sharing. Thanks a lot! Finally understood this . I’m glad to hear it! How can I find the value of theta 0 and theta 1 with the given training set(x,y)..so that linear regression will be able to fit the data perfectly..? Rarely do models fit the data perfectly unless the data was contrived. Using a linalg approach will give a more robust estimate if the data can fit into memory. A model is a tradeoff. Is SGD the same as backpropagation? When classifying images into two categories (e.g. Cats and Dogs) is the model computing linear regression. If not, what would this be classified as? No, gradient descent is a search algorithm, backpropagation is a way of estimating error in a neural net. Hi Dr. Brownlee: Definitely a great tutorial! I was able to reproduce the same results. Can this algorithm be modified for multiple parameters? I am trying to understand linear regression for more than one parameter and the tutorials I have found use excel or some other tool the black boxes the actual algorithm. Yes, linear regression can have multiple inputs. Did I miss the derivative here? I do not cover the derivation. I have read the post, but I am not very clear about the difference between Gradient Descent and Stochastic Gradient Descent in this particular example. You have shown that in Stochastic Gradient Descent, we take one example at a time and update the coefficients. But what happens in case of Gradient Descent? Perhaps this post will make it clearer: hi sir, im maruthi please let tell me step by step procedure.As a fresher i understand 50% only. Why do you choose not to square the sum of distances in the loss function? In my class we did everything similar to what you outlined except that part in order to make the function differentiable. For the value of b0=0.01 b1=0.01 the corresponding values of x and y are 1. When we put those in the linear equation we get y_predict=0.01+0.01*1 I am not getting 0.95 as the first value. Am i doing something wrong? Please tell me The prediction was made after many after the model was learned with the coefficients B0=0.230897491 and B1=0.7904386102 hi Jason , how can should i decide the learning rate for my model , any suggestion. Trial and error, test a range of values on a log scale, e.g. [0.1, 0.01, 0.001, …] when i am applying the B0 and B1 value to the linear regression, i am getting a different predicted value. can u just rectify my doubt? Perhaps your coefficients differ from the tutorial? Jason, Thanks for the post. It is very pedagogical. I wonder about implementing the Gradient Descent with Mini Batches for your example. When updating the B1, what would be the value of x to be iput in your equation B1(t+1) = B1(t) – alpha * error * x ? Still on the mini batch example, will the error to be input in both B0 and B1 equations equal to the square root of the sum of the squared error ? Thanks a lot. When using a batch, the values are averaged over all examples in the batch/mini-batch. what is cost function? It is the function by which we estimate the error of the model, and seek to minimize over training. Hi Jason, While we use gradient descent in Linear Regression, then why can’t we use alpha learning rate as parameter in sklearn module. Is it not required or is there some another theory behind it? Because sklearn does not use gradient descent, it use linear algebra, like this post: from where that prediction values come ? can you break down this step “plug the values simple linear Regression model and make a prediction for each point in our training dataset.” Thank you An input is multiplied by the coefficients and summed to give a prediction. Great Great article. Jason, you’re articles are so detailed. Thank you very much. Thanks, I’m glad it helped. Thank you Jason, your tutorials are very helpful I would like to ask you the following question: I tried to use gradient descent for logistic regression and I had used this code to calculate accuracy : def accuracy(self, x, actual_classes, probab_threshold=0.5): predicted_classes = (self.predict(x) >= probab_threshold).astype(int) predicted_classes = predicted_classes.flatten() accuracy = np.mean(predicted_classes == actual_classes) return accuracy * 100 I would Like to get confusion metrics that it is used for getting this result because the sklearn confusion matrix return a different accuracy value Yes, sklearn does not use gradient descent, it uses a different optimization algorithm and therefore will give a different result. thanks for your quick reply so in this case, if we need to calculate precision and recall how we can do. Is there also a different way? because I need to compare the algorithm results with other machine learning classifiers results. You must calculate error, such as MAE or MSE or RMSE. ok, thank you very much No problem. What are the disadvantages of using gradient descent for linear regression? It is slow and inefficient compared to a least squares solution. Hello, I wonder what if we have beside b0 and b1 other coefficients like b2, b3 and so on, how can we find their values using gradient descent also? would it be: B2(t+1) = B2(t) – alpha * error * x2 B3(t+1) = B3(t) – alpha * error * x3 and so on ? Thank you I give an example here: Hi Jason, If we use Linear regression algo having 9 to 10 inputs, then does it uses the linear algebra to compute the values of parameters or it uses Gradient Descent for parameters computation ? Thanks. Use linear algebra unless the data violates the expectations of the linear algebra method or does not fit into memory. Hi Jason, Do you any any comprehensive tutorial that calculates the standard error and all the statistical parameters associated with Multiple Regression. If not please suggest a good resource. I don’t think so, sorry. Hello Jason. How do we calculate the coefficients for the 20 iterations. That is from the 2nd iterations, I do not understand how you came up with the values for BO and B1. Repeat the process for one iteration 20 times. Or see this example: Thank you. Hi sir, Thank you for the clear article. I have one doubt please. why do we use the formula b0(1) = b0(0) * alpha * error also why do we use b1(1) = b1(0) * alpha * error * x why do we multiply with x i.e input for b1 ? This implementation is based on the description in “artificial intelligence a modern approach” I believe. Why do you want to use that formula? How to calculate m What is m? good, it was really helpful Thanks. For implementing the gradient descent on simple linear regression which of the following is not required for initial setup : 1). Defining cost function 2). Update rules of slop and intercept 3). Optimal learning rate for slope and intercept 4). Initial guess for slope and intercept…….. Looks like an interview question to me! I’d go with 3. Is it true that a large learning rate leads to faster convergence????? Or A small learning rate is always best for gradient descent ???? There is no best learning rate in general, we have to see what works best for a given objective function/dataset. Awesome sharing with full of information I was searching for. Your complete guidance gave me a wonderful end up. Great going. Thanks. How can I implement into multiple linear regression? Perhaps this will help: Hi, I followed you to apply the method, for practice I built a code to test the method. I have noticed that for points with small X values the method works great, however when there is a large variety of points with large X values the method fails to converge, and in fact we get an explosion of the gradient. Is there a way to deal with this problem. Thanks Linear regression should be the easiest to perform due to its linearity. But in fact, the scenario you see is not unexpected. One way to do is preprocess the data before feed into the model. In your case, probably you want to normalize the X to avoid extremely large range.
https://machinelearningmastery.com/linear-regression-tutorial-using-gradient-descent-for-machine-learning/
CC-MAIN-2022-27
refinedweb
3,996
65.52
When you write an application, you depend on the API that's provided by the OS. But how and where does your application find the code that corresponds to a particular function call? There are two vehicles for collecting "common" code that different applications can use: a) shared libraries and b) add-ons. This article looks at the features of and differences between shared libraries and add-ons. Shared libraries are binaries that contain code and data that can be used by any application. For example, in /boot/beos/system/lib, you'll find the "system libraries," i.e., the libraries provided by Be and used by most applications. They contain the code for the standard kits, such as the Interface Kit, the Storage Kit, the Application Kit, and so on. Developers can also create their own shared libraries. This can prove particularly useful if you're developing a line of applications that share some amount of code. The common code is put into a shared library that the "client" applications can link against. Some developers may even find a market in developing shared libraries that they can sell to other developers as API extensions. Structurally, add-ons are identical to shared libraries. The difference between libraries and add-ons is how they're used: Applications identify the libraries they need at compile time, and link against the libraries at load time. When you launch an application, the application's code and that of all the libraries that it needs are loaded. Add-ons, on the other hand, are identified and loaded by the application at run time. The dependency is completely dynamic, as the application can decide on the fly which add-on to load. There are functions to load an add-on, to unload it, to look for a specific symbol (function or data item), or browse through all the symbols of the add-on. This allows any application to dynamically load and unload code that's defined by the add-on. Looking for and using add-ons is very useful if you want to allow "extensions" to your program. Many BeOS applications rely on add-ons: The Tracker, for example, allows its add-ons to operate on the set of selected files through a defined API. The add-on only needs to have a function process_refs(), which is invoked on the selection passed as a BMessage. This architecture makes the Tracker customizable. Rraster uses the same technology to identify and parse different picture formats—the format recognition isn't in Rraster itself, but in the add-ons that it loads. Adding support for another picture format simply consists of writing an add-on that can decipher that format and complies with Rraster. Another use of add-ons is in the kernel with loadable drivers and file-systems. Launch the IDE and create a project squarer.proj that contains squarer.c as its only source file. Change the project settings the following way: set the project type to "Shared Library" set the file name to "squarer" (under "PPC project") remove __start as the "Main" entry point (under "Linker") set "use #pragma" (under "PEF") You can then make the shared library. squarer.c: (the shared library) extern "C" int squarer(int); #pragma export on int squarer(int x) { return x* x; } #pragma export off The #pragma primitive tells the linker which symbols to export from the shared library. Without it, the function squarer() would be invisible from the executable. Also, squarer() is declared as extern C to avoid C++ name mangling. Now create another project for the application that's going to call squarer(). This one takes the default project settings. Add main.c and the shared library squarer to the project, and make your application. main.c: (the executable that links against the shared library) #include <stdio.h> extern "C" int squarer(int); int main(int argc, char ** argv) { int n; n= squarer(5); printf("> squarer(5) = %d\n", n); } In the <app_dir> (i.e., the directory that the application lives in), create a directory named lib and copy "squarer" into it. The kernel loader automatically looks in <app_dir>/lib for shared libraries (in addition to looking in the system-defined library directories). Launch the application from the shell, and you'll see the expected result $ squarer > squarer(5) = 25 "Very good," you think, "but je suis francais—I want to use her as an add-on!" Shared libraries and add-ons are built exactly the same way (remember, they're structurally identical). So we don't have to do anything different to build "squarer". "squarer" does not change, but the way the function squarer() is invoked does. Here's the new version of main.c: #include <stdio.h> #include <image.h> int main(int argc, char ** argv) { int n; int (* squarer)(int); image_id aoid; aoid= load_add_on("squarer"); if ( aoid< 0) { printf("problems loading the add-on\n"); return 1; } if ( get_image_symbol( aoid, "squarer", B_SYMBOL_TYPE_TEXT, & squarer)) { printf("problems finding symbol 'squarer'\n"); return 1; } n= (* squarer)(5); printf("squarer(5) = %d\n", n); unload_add_on( aoid); } The code is pretty much self-explanatory. get_image_symbol() takes B_SYMBOL_TYPE_TEXT as a parameter to indicate the symbol is a function. Copy squarer into a directory add-ons that you create in the app's directory—that's where load_add_on() will look for the add-on. Run the application, and you'll get the same result. But the important difference is that you can now load any add-on, and, as long as it respects our convention (i.e., if it defines a function int squarer(int)), you can use its services. Where should you put your shared libraries and add-ons? When asked to load a shared library or an add-on, the system uses an environment variables in its search: LIBRARY_PATH (for libraries) and ADDON_PATH (for add-ons). Each is a list of paths using a colon (":") as a separator. LIBRARY_PATH is set by default to: %A/lib:/boot/home/config/lib:/boot/beos/system/lib Where %A is means the app directory. You see now why we have put the shared library "squarer" in a directory named lib/. As for which branch of the search path to put your library in, the convention is the following: If the library is application specific, put it in %A/lib. If it can be of some use to applications from other third parties, put it in /boot/home/config/lib. DON'T put it in /boot/beos/system/lib. This directory is reserved for system libraries. Note an interesting use of the %A/lib directory. If you ship some application on a CD that relies on a certain version of the system libraries (libroot.so and libbe.so for example), you can very well include those on the CD in that %A/lib directory. They will automatically override the libraries in /boot/beos/system/lib for your application, but not for other applications. This way, you can be sure that your application will run, no matter what version of the system software is currently installed on the user's machine, and it won't mess up the rest of the system. No more installation nightmares. In a similar manner, ADDON_PATH is set by default to: %A/add-ons:/boot/home/config/add-ons:/boot/beos/system/add-ons The "branch" rules are the same as with libraries: An application-specific add-on should be put in %A/add-ons. An add-on that's intended to be shared by different applications would end up in /boot/home/config/add-ons. /boot/beos/system/add-ons is reserved for system add-ons. Also note that you can use symbolic links in combination with the %A/lib or %A/add-ons directories. %A refers to the directory of the real (resolved) application, not of the link. For example: /boot/home/fred is a symbolic link to /boot/apps/myapps/fred; when /boot/home/fred is launched, %A refers to /boot/apps/myapps. This makes it possible to hide the lib/ and add-ons/ directories from the user. By now I'm sure you've heard of UTF-8, the character encoding method of choice for the BeOS. (Take a look at the article "Unicode UTF-8" by Don Larkin, found in Issue 75 of the Be Newsletter if you are unfamiliar with UTF-8.) Given that text is something every developer deals with in their work in one form or another, I thought I would share some of my UTF-8-ish experiences with you, mostly in the form of tips, clarifications on common misconceptions, and some deep confessions of my own. This is probably the first question that crosses a developer's mind, even if you're developing in FORTRAN: how does strlen() work with UTF-8 text? Well, it's simple, strlen() counts the number of bytes in a string until it encounters a null-terminator (a byte with a value of 0). Since UTF-8 is backwards compatible with plain old ASCII, a null-character is still a null-character is still a null-character. So, that's that: strlen() will still work as expected with UTF-8. That is, it will return the number of bytes, not the number of characters (or glyphs) in your string. In a multibyte encoding method such as UTF-8, a byte-count is different from a count of characters (which, incidentally, is why the function BTextView::SetMaxChars() was renamed to BTextView::SetMaxBytes()). This might seem strange (or even bad) at first, but it's actually a good thing. After all, malloc() could care less how many instances of Japanese characters there are in a string when you're trying to allocate some memory into which to copy it. What if you want to know how many bytes a character is, so that the number of characters in a string can be calculated? First of all, you should consider carefully whether it is indeed necessary for you to know this information. Again, functions such as strchr(), strcpy(), strlen(), and strstr() work as-is with UTF-8. (This is true not only for the BeOS, but for UTF-8 text processing in general.) Byte-lengths of characters are an issue only if there is potential for something to clobber portions of a multibyte character. For example, a text engine needs to be aware of a character's length so that it knows how many bytes to traverse when the user moves the insertion point. OK, you're convinced that you need to know how to measure a character's length. One approach is to simply iterate through the bytes, counting from one initial byte to another. Another more exciting approach, however, is to use Pierre's Uber-inline: inline uint32 utf8_char_len(uchar byte) { return (((0xE5000000 >> (( byte>> 3) & 0x1E)) & 3) + 1); } When given an initial UTF-8 byte, the above inline will tell you the number of bytes (from 1 to 4) in the character that the initial byte represents. It's a hairy inline, and, to be honest (here's the confession part), I'm not so sure I could explain how it works...it just does. Keep in mind that the inline looks only at the initial byte of the character, and therefore does not verify that the following bytes actually make any sense when construed as a UTF-8 character. So, with the help of Pierre's inline, you could count the number of characters in a string as follows: uint32 numChars= 0; for (uint32 i= 0; string[ i] != '\0'; numChars++) i+= utf8_char_len( string[ i]); A similar but more subtle issue arises with functions such as tolower(). Many (if not all) of the toXXX()/ isXXX() functions in ctype.h are not UTF-8 aware. They will fail or even munge your UTF-8 data, so beware. The proper implementations of those functions require the use of carefully crafted mapping tables. A less accurate, but often sufficient, implementation is to use those functions only on 7-bit ASCII data. Something like: inline uchar utf8_safe_tolower(uchar byte) { return (( byte< 0x80) ? tolower( byte) : byte); } Take a look at the Support Kit when you receive your copy of the Preview Release. There are two UTF-8 conversion routines in a new header file called (surprise!) UTF8.h. convert_to_utf8() and convert_from_utf8() are already documented in The Be Book, look there for more details. Also, if you simply want to convert some non-UTF-8 files, try out a little tool called xtou in /bin. Its usage is pretty straight-forward; do the following in a shell if you want to convert your ISO 8859-1 document to UTF-8: $ xtou -f iso1 my_iso1_file You can optionally specify the -n option to convert carriage-returns to newlines (useful for Mac files). There is an inherent slowness to synchronous server calls because of the associated messaging (client to server, then back to client) overhead. Since BFont::StringWidth() (and the BView equivalent) relies on the App_Server for font metrics information, repeated calls to StringWidth() can be costly. The solution is to cache this information wherever sensible. For example, if you have an object that draws a line under some text, it might make sense for you to cache the string's width so as to avoid the gratuitous calling of StringWidth(). Ming tells me that the price of a float at Fry's is ridiculously cheap these days, so don't be too shy about equipping your classes with another member variable or two. If you're writing, say, a text engine or a web browser (read: something string-width intensive), simply caching a single string's width might not be what you want. You probably want to be able to find out any string's width without incurring the messaging overhead each time. Sounds like you want your own StringWidth() function. I happened to have such a "width buffer" object, and did some profiling with it. BStopWatch revealed the potential performance boost of a local string-width mechanism to be significant. On average, it took a version of NetPositive that did no caching roughly 530 microseconds to calculate the various strings (one at a time) in its default page. With caching enabled, the number went down to 54 microseconds. I'll save the implementation details of my width buffer class for another article, but here are some things to remember if you decide to write your own. Escapements rule. As long as you don't rely on B_STRING_SPACING mode, you can store the escapements of the individual characters on a per font style (and potentially size) basis, and then use those values to calculate the pixel width of any string. As usual, The Be Book has much information on this topic, as does Pierre's recent two-part article, "The New Font Engine, PART 1 and 2" (issues 76 and 77 of the Be Newsletter). Don't assume 256. Remember, we use UTF-8. Creating a statically sized table of 256 items is not sufficient. Neither is pre-allocating a table for the entire Unicode code space. I implemented my class using a simple linear probing hash table. Keep App_Server calls to a minimum. The whole point of caching things locally is to avoid the number of actual App_Server calls. For example, BFont::GetEscapements() allows for multiple characters to be measured per call. Every call counts. That's it! Hope you get to know and love UTF-8 as much as Ron and I do. Isn't it funny how humans are prone to analogy. For some reason it helps to say "It tastes like chicken" in order to relate the flavor of new foods to that of known foods. It's kind of like using a club to simulate the use of a hammer. So what analogy can be used to describe a new OS, its attendant release, and its expected acceptance in a new community? It's kind of like giving water to someone who's thirsty in the middle of the desert. It's like a dragster on steroids that only weighs 20 pounds. It's kind of like the day I went to junior high and discovered the opposite sex. We've completed the Preview Release, and it has begun its irrevocable trip into history. Disks are pressed, packaged, sealed, and soon to be delivered, but wait, there's a typo... You wouldn't believe what a relief it is to get something like this out the door. It's kind of like passing a stone, or doing yoga. It hurts while you're doing it, but you're so much better off when you stop. When you finally get the Preview Release in your hands, a few things in your life will change. You will no longer need to gunzip .tgz files, because we will pack all of our things using zip. You will be able to send embedded forms based mail to us using a nifty third-party mail program. Your applications will stand a strong chance of being binary compatible with future releases. Your applications will have an audience to play to numbering in the few hundreds of thousands. Your will come into a lot of money and live a long prosperous life. But wait, before you go, I quietly released a new version of the PCIList application It fixes one particular bug whereby if you had multiple PCI cards of the same variety, only the first one was reported in the list, and the size of the registers was reported as kilobytes, but the number was actually HEX kilobytes. What good is that app again? It's kind of the peephole at the construction site. You can kind of see what's in your system, but you can't touch anything. When you're trying to write PCI device drivers, it becomes useful. What a weekend! I was torturing my BeBox trying to do wicked things with television input and just generally tempting fate with my disk drive when I came across this thought, "what's a good analogy for how different it is to program other OSes compared to the BeOS." Then, conveniently, I went kayaking. When you're kayaking, there is a subtlety of style that makes the paddling a lot easier. Your sitting flat on your bottom, and you simply twist your torso left to right, dipping you paddle in on either side and giving a stroke before lifting it out again. If you force it and try to do a Hawaii 5-0 type of brute force stroking, you might go faster for a short amount of time, but in the end, you'll just get tired and not really have a good time, you'll end up sore, and you won't go back in the water for a long time. The BeOS is subtle and elegant. Whereas others have come up with designs such as OpenDoc, we have Replicants. Where others have come up with chants at bull fights, we have the BMessage object and SendMessage. Our strokes are supple, smooth and light. I don't know about you, but I prefer the long game. Geoff Woodcock had an incident at a local restaurant recently that's just too funny to pass by, but I'll save it for next time. But to give you a hint, it's kind of like the ultimate in embarrassing moments. Go forth and code! The Preview Release approacheth and the time has come to stand and deliver. I'm doing it, your friends are doing it, and soon the whole world be doing it!! Charles De Gaulle, while not known as a jester, had a cruel wit. A connoisseur of Germany, he obliquely paid his respects to the great country by saying he loved her so much he wanted two Germanys. That was cold war humor. The heads of state in Cupertino may be feeling more heat than cold, but, as you will see, we have a vested interest in a more successful cure to Apple's problems. Let's focus on the problem du jour: Finding a new CEO for Apple. The latest coup is business as usual in the Hall of Mirrors. Think back 14 years: Steve Jobs hires Sculley to help him run the company, John pops Steve. To help him at the helm, Sculley airlifts Spindler from Europe and makes him COO and President. Spindler replaces Sculley. Spindler restructures Apple's Board of Directors and brings in Amelio from National Semiconductor. Amelio bounces Spindler. A few months later, Amelio buys NeXT and hires Steve as a "Strategic Advisor." Jobs ousts Amelio. Da capo? Another spin around the dance floor, Nellie? Unhappily, not quite. The patterns emerge and the names are the same, but the orchestra is packing up and the chairs are on the tables. When Jobs hired Sculley, the company was on the way up. Today, it's losing customers, developers, money, and market share. (And Bill '95 isn't just a greenhorn angling for a license to the Mac look-and-feel.) Who wants to run Apple under these conditions—where's the Lee Iacocca of the personal computer industry? Simply wanting the job (so the joke goes) disqualifies you. The Jim Barksdales are too happy, too rich and, some say, too smart to consider it. Apple doesn't need a CEO, they need a messiah (or a crash test dummy). And any problem that requires walking on water as a solution is, you'll grant me, a problem ill-stated. Still, there may be a way to make the search for a new CEO easier. That's where General De Gaulle comes in... Split Apple into two companies, one for hardware, the other for system software and applications: Apple, the hardware company, makes Macintosh computers and (why not?) PC clones. Apple, the software company, makes system software (Mac OS on PPC, and Rhapsody on PPC and Intel) licensed to all comers and cloners, and applications on PPC and Intel as Claris already does. I realize this involves convincing shareholders, perhaps with terms involving a temporary reduction of their stake in order to attract new investors or new lenders. But taking this new course will generate more excitement (if less blood lust) than backing up the car and running it into the wall again with a new driver. Instead of requiring superhuman skills of its new CEOs, the restructured Apple merely requires skill, courage, and hard work. And we have examples of these already in the industry. Does the hardware company sounds like Power Computing? Then merge it with Power or hire Steve Khang. On the software side, Guerrino De Luca was happily and successfully running Claris before valiantly signing up for the only job more dangerous than the CEO position at Apple: VP of Marketing. Make Guerrino CEO of "AppleSoft" and watch more cloners come back into the Mac space, thus reversing the market share slide. Our interest in this is fairly obvious. We've always hoped for a level playing field for all Mac hardware manufacturers. Disentangling Apple's hardware from its system software would make everyone's life—ours included—much easier. In theory, CHRP offers an industry standard platform, the PC/AT for the PowerPC. But in practice, Apple appears to want to keep an "enhanced" version of CHRP for itself, in order to "de-clone" some combination of hardware and software features. Apple has tried to have its cloners and eat their lunch, too. It's not working; nobody's happy. This does not sound like a level playing field. What other choices does Apple have? Many observers think an acquisition is likely; they even diagnose the recent upswing in AAPL as the result of traders betting on a sale. One Silicon Valley wag even speculates that Apple's Board of Directors gave Steve Jobs an expanded role in anticipation of the deed. After all, who better than Steve to charm a prospect into buying Apple at an interesting price? Fair or not, such witticisms serve to emphasize the sentiment that Apple's current business formula must be revised, or else. We all hope -- for sentimental as well as business reasons—that Apple(s) will emerge from the current crisis and regain the health and the vibrancy that made it such a unique icon of Silicon Valley technology and creativity.:. It was suggested, last week, that peak collisions (when mixing sound sources) are rare. This week, James McCartney pointed out that this isn't necessarily so (or not necessarily not so)... “On the contrary, if you have two signals of different frequency then their peaks are guaranteed to coincide at regular intervals.” Other suggestions: The Media Kit should provide a graph of subscribers, rather than a simple chain. Also, it would be nice if the "native" sound stream format were floating-point. Mixing floating-point samples and then converting to 16-bit integers at the end of the stream is not only "saner" (in that it's much easier to handle overflow—including deferred handling), the floating-point multiply/add is also faster than the integer multiply/add. Simple filtering and other manipulations (AM, for example) is, therefore, faster in floating-point. Of course, you pay the price in increased data. THE BE LINE: At the DAC stream level, the subscribers need to speak in a format that's understood by the hardware, so don't look for mixing or floating-point-friendly features at that level. But a friendlier, higher-level graph is being considered as an improvement to the Media Kit. Should an OS be expected to detect and report double-clicks? If so, how would an app express the criteria for judging two clicks as part of a double, as opposed to being two separate events? Obviously, some cases defy OS-ification: A view that displays multiple clickable items has to parse clicks on its own, for example. It was generally agreed that a simple formula such as "two clicks within a certain (small) amount of time, regardless of mouse's location => a double-click" is wrong. The formula is better if you throw in some location constraint ("...within a certain amount of time, and within the same 'item'..."), but it's still not going to cover every case. It was somewhat agreed that certain Be objects (list view items, for example) can/should implement their own double-click testing. This thread, which branched off of the "dumb sound" thread, discussed sound recording and processing in general (i.e., without special regard for the BeOS): Are delay buffers necessary? Are they expensive? In a multi-source recording or playback what entity assigns/synchronizes timestamps? Is 44.1 kHz floating-point a reasonable trade-off between fidelity and data width? What happened to a-law and mu-law? And so on. What's the real story on spawn_thread() and fork()? Are they incompatible (as the Be Book claims), or can you mix the two? THE BE LINE: As Dominic Giampaolo explained, while it *is* possible to fork() and then call spawn_thread(), it's not a good idea. The Be Book is perhaps a bit extreme in its estimation of the consequences of such an act, but it's correct in its proscription. What's the best way to track the mouse while the user is moving it around inside a view? Although you certainly don't want to lock down the entire window, you probably want to be able to generate some sort of feedback. This thread discussed a couple of ways to safely watch the mouse and still be able to draw.
http://www.haiku-os.org/legacy-docs/benewsletter/Issue2-28.html
crawl-001
refinedweb
4,624
62.98
Zulip Chat Archive Stream: Lean for teaching Topic: Intro to Proofs in US with Lean Matthew Ballard (Mar 11 2021 at 19:23): Last fall, I decided to incorporate Lean into our existing Introduction to Mathematical Reasoning course here at UofSC. The goal of the course was definitely not Lean for Lean's sake. Rather, I wanted to see if Lean could be useful for students whose ultimate outcome is to compose convincing written or oral natural language proofs of basic mathematical statements. In my experience, teaching students to write good proofs requires many detailed feedback cycles per assignment. Better than me, Lean provides immediate feedback as to problems. My main concern was whether including the additional language of Lean would constitute too much inertia for students to realize any pedagogical of Lean. The majority of students were first-year in our honors program. So the student background was essentially good US high school education which includes seeing calculus/taking calculus concurrently. In particular, students were not expected to have any experience with mathematics at the UG level nor any programming experience. It turned out the majority of students were CS majors that were also thinking about incorporating math into their degree in some way (dual major, minor, or just mathed-up). For a textbook, I initially leaned on Logic and Proof to structure the flow of material. By midway through, I had incorporated Infinite Descent and authored a good portion of the Lean components of the assignment. We covered logic, sets, functions, and then delved into basics of group theory by focusing on four main classes, cyclic, symmetric, dihedral, and free groups. The first 2.5 months of the course were structured closer to traditional lecture. I tried to break up me just talking to students with some small group work periodically. After this, we had covered logic, sets, functions, and relations. During this time, students worked on homework in rotating groups. The assignments were about 2/3-3/4 written problems and 1/4-1/3 lean problems. Tactic-based proofs were essentially buried for the majority of course. Forcing students to confront a term-based assume, have, show proof in Lean forced them to rectify their thoughts. As an added benefit, it made identifying whether a problem with a written proof came from poor communication or poor understanding easier. If a student could compose a proof that compiled but I didn't understand their written work, then I knew where to focus the attention. Each week for the final 4 weeks, I handed out worksheets on the 4 classes of groups above. Students were required to fill in the proofs and present some of their proofs. There was no Lean here. The structure was strongly influenced by this course at JHU. Finally, in place of a final exam, there was final project chosen from a selection. By far, the most popular option was beating the NNG. I take this as the strongest indication of students' appreciation for Lean overall. Anecdotal conversations lead me to believe that the individual appreciation was highly variable. Some students loved it and thought it was the best part of the course. Others viewed it as a distraction to the core material though I think they understand why I believed it brought value. I don't think anyone actively detested it partly because you could still earn a good grade without much proficiency in Lean. I think, overall, it went gang-busters. Ultimately, I'd like to build these into undergraduate major and graduate qualifying courses. Kevin Buzzard (Mar 12 2021 at 06:53): Many thanks for your report. Are any of your teaching resources eg Lean files available online? Matthew Ballard (Mar 12 2021 at 13:28): Unfortunately, right now, everything is embedded in Microsoft Teams and often in strange ways to ease workflow. For example, all my lean files have .txt extensions because the file viewer in Teams balked at rendering .lean files in the pop-up window. To get a sense of what a homework assignment looked like, here is the lean component on the week we did relations: import data.set section parameters {U : Type} {R : U → U → Prop} #print irreflexive -- definition of irreflexive #print transitive -- definition of transitive #print anti_symmetric -- definition of anti-symmetric parameter (irreflR : irreflexive R) -- a proof that R is irreflexive parameter (transR : transitive R) -- a proof that R is transitive /- Question 1: Prove that an irreflexive and transitive relation is anti-symmetric -/ example: anti_symmetric R := sorry end /- Question 2 -/ section parameters {U : Type} {R : U → U → Prop} parameter (equivR : equivalence R) #print equivalence -- take a look at the definition of equivalence in Lean #print reflexive #print symmetric #print transitive def Rop (x y : U) : Prop := R y x -- the "opposite" relation to R example : equivalence Rop := sorry end /- Question 3 -/ section open set variable {U : Type} def equiv_class (X : set U) (S : U → U → Prop) (x : U) : set U := { y ∈ X | S y x } variable R : U → U → Prop variable X : set U variable a : U #reduce equiv_class X R a -- see what Lean thinks this is #check ext_iff example (x y : U) (h1 : x ∈ X) (h2 : y ∈ X) (equivR : equivalence R) : equiv_class X R x = equiv_class X R y ↔ R x y := sorry end Matthew Ballard (Mar 12 2021 at 13:33): Additionally, I discovered that having to translate a statement often required some understanding of the statement. For example, if all our calculus homework were turned in Lean, then the instances of search-copy-paste solutions to assignments would approach 0. Currently, we are at nice spot in the development of Lean where it is documented sufficiently so students (and instructors) shouldn't struggle with the basics of the language but, at the same time, you can't toss your question into a google search and pull up a solution. Matthew Ballard (Mar 12 2021 at 13:34): That being said, I definitely benefited from @Jeremy Avigad sharing his course materials from CMU. So I would be happy to share what I have via email. People should not hesitate to reach out. Matthew Ballard (Mar 12 2021 at 13:36): For me, the main lesson (I think) was the stark difference between the fears I felt when I began contemplating adding in an ITP to such a course and the actual outcomes. Last updated: May 06 2021 at 01:57 UTC
https://leanprover-community.github.io/archive/stream/187764-Lean-for-teaching/topic/Intro.20to.20Proofs.20in.20US.20with.20Lean.html
CC-MAIN-2021-21
refinedweb
1,069
59.33
Get rid of includes If there is one thing I really get annoyed over in C/C++ it's the includes. Why on earth would we have to handle all that crap manually? My solution to this problem when doing embedded programming with AVR-GCC was to put all includes I ever needed in a file "includes.h" and then add "includes.h" to all source files. As it's legal to declare something infinite times it should be okey, I guess? However, this doesn't work in Qt as it seems. If the includes for a GUI arent "directly" included in mainwidow.cpp a lot of weird stuff happens. For instance it was impossible to connect slots from the buttons in the GUI. So, is there a way to get rid of the includes? Basically, I just want to include it all, all libraries and all my other header files automatically. If would never give my own function a name from the library anyway, as that is just bound to create confusion. Is this done alot, or why is the tedious include process ever present? I think it's completely ridicolous having to go 1971 and add a new header manually to all source files. - dbzhang800 You project will take more time to build if you include all the headers to each source file. Through precompiled headers can speed this up. For Qt, you can do this too. But you should make sure that all your-own-headers that contains Q_OBJECT have been preprocessed by moc. - Jeroentjehome Hi, CodaxX your still thinking like someone in 1971. Just that the syntax hasn't changed much, that doesn't mean the programming style did not! For embedded systems it might work to put all header files in one include file and have fun, but then again you let everybody know all about all the other modules. When thinking more object orientated you e.g. introduce module header and only include those. Then only when the module is needed, you include that header, not everything in the entire project! Protect yourself from unwanted calls and links! And yes, Qt is very well capable in doing a global header include. If you include them all every where you might even get include loops and added dependencies! If you known and think about who includes who and you change a single header file you only need to test/debug the files the DEPEND on it, not ENTIRE program. The entire program might get mixed up when a single header file is changed!! If you don't trust me, simply forget a } in a header file, add a ; extra or a #ifdef .. without #endif. Do that in your first included header and a HOLE lot of shit happens!! Do you really want that kind of dependencies?? - Asperamanca Some of my colleagues use a similar structure, with a header file combining many include. Also Qt includes. Can you post your "includes.h"? Maybe there's just a problem in there. Do you use proper include guards? Jeroentje: Well, for bigger project that might be better, actually I don't know. But I haven't ever been close to having to create different modules in a single program so similar that they could coincide. Therefore, I would just want a checkbox like "Compiler, I trust you to do includes and declarations for me". If I ever wanted something else I could just uncheck it. 1+1=2: Okej, but as you say it should be easy for a compiler to get rid of that speed problem. Asperamanca: It seems like the problems started when I put #include "ui_mainwindow.h" in a separate includes.h. I did compile I think, but the method for graphically adding slots to pushbuttons in the main UI stopped working. Well, I join the other: centralizing the header file inclusion into one unique file is a very bad idea. You'll have to recompile the whole project at each change and it will increase the size of your program. C++ is quite a low level programming language, so you have to deal with the low level stuff. - Asperamanca What you could do is put all Qt includes you'll ever need in your project into one header file. Then include that one header prior to any other includes you might have. If you do something like this for your own header files, you sooner or later run into circular dependencies. If "x.h" depends on "y.h", but "y.h" also depends on "x.h", this just will not work. And with all your headers in a single header file, it also means that each header file would basically include itself, which drives the compiler nuts. - Jeroentjehome Hi, CodaxX, also with small and easy to maintain projects it is already a good idea to generate modules and expand from there. If you want to minimize includes for Qt there are "extended" includes like @ #include <QtWidgets> #include <QtGui> @ Those take a lot more time to compile because all GUI elements are included in your project, so I would recommend against it. Also, like Asperamanca wrote, you will get circular dependencies if you try to include them all in a single header file. So please don't, it will come back and bite you in the a**. This is the way that C and C++ work. There are plenty of other languages that don't use headers if you don't like it. Some editors can help you include the right headers, and there are tools like 'include-what-you-use' that can help with getting just the right includes. Paul So the compiler cant sort out circular dependencies? According to my experience compilers at least can solve headers including themselves. paulf: Yes but is there another language that is available in a package like Qt? I'm thinking about trying Visual Studio with C# but that is not cross platform though. - Chris Kawa Moderators Circular dependencies are not the only problem. There are many many subtleties when talking about headers, especially considering macros and templates. A simple #ifdef can make a header look completely different in two include spots depending on what symbols are defined in that scope, and that is one of the simplest examples. Templates are usually defined (not just declared) in the headers, and the compiler needs surrounding scope to trigger the right instantiation. The argument about other languages dealing with it is shallow. C++ is a lot more complex language than say Java or C#, mainly because of macros and templates. It is advised to put minimal set of includes in headers. Only(but all) those that are needed. Also use forward declarations! These make tremendous difference in compile times in larger projects. Use precompiled headers for library includes and stuff that doesn't change often, like utility classes etc. Don't create uberheader files. These are evaluated(copy/pasted almost) at each and every include site and will make your project compile times abysmal. Also even a semicolon added in any of the includes will cause the whole project to recompile. This is a bad bad idea if you value your time. The C++ standardization committee has recognized the problems with headers and is working on a new paper called modules. This won't get into the language until c++17 or later though. The idea is something similar to C# using but, as I said, c++ is a lot more complex language and there are many more subtleties to iron out. "Clang": has some experimental implementation of it if you're interested, but it's a very early preview and things will certainly change. You can also see this "great talk": about it on youtube. Well, it's the preprocessor that handles #includes, not the compiler. And the preprocessor is very dumb, it just does text replacement. The preprocessor/compiler cannot figure out circular dependencies alone, i.e., you will get an error like a.h:1:15: error: #include nested too deeply or "b.h", line 1: Error: Too many open files: "a.h". Aborting .... The usual technique to avoid this is include guards or something like #pragma once. (Here I'm assuming a conventional compiler - I have used one compiler [IBM VisualAge C++ 4 I think it was] that had a 'database' model, and you just had to add the source files and headers to the project and the compiler would sort it all out - great idea, nightmare for porting any existing makefile based project). As for other languages, the main one that springs to mind is Java. Paul
https://forum.qt.io/topic/35144/get-rid-of-includes
CC-MAIN-2018-09
refinedweb
1,443
73.88
While exploring LINQ keywords, I encountered the Let keyword and thought to write something for .Net geeks. I've taken an idea from my previous article on about DefaultIfEmpty() and utilized similar code. You can look at this article here:. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace LINQ_LetKeyword { class Employee { public string Name { get; set; } public string EmpID { get; set; } public int Salary { get; set; } } class Program static void Main(string[] args) { //Object Initialization for Employee class List<Employee> objEmployee = new List<Employee>{ new Employee{ Name="Sachin",EmpID="I001",Salary=800}, new Employee{ Name="Vijay",EmpID="I002",Salary=400}, new Employee{ Name="Ashish",EmpID="I003",Salary=250}, new Employee{ Name="Syed",EmpID="I004",Salary=300}, new Employee{ Name="Ravish",EmpID="I005",Salary=700}, }; var objresult = from emp in objEmployee let totalSalary = objEmployee.Sum(sal => sal.Salary) let avgSalary = totalSalary / 5 where avgSalary > emp.Salary select emp; foreach (var emp in objresult) { Console.WriteLine("Student: {0} {1}", emp.Name, emp.EmpID); } Console.ReadLine(); } }LINQ Query var objresult = from emp in objEmployee let totalSalary = objEmployee.Sum(sal => sal.Salary) //output :I've tried to use the very simplest way to describe the "Let" keyword. Yet I look forward to your advise on this, whether I could present it in a more convenient way and if so then how.Cheers. ©2014 C# Corner. All contents are copyright of their authors.
http://www.c-sharpcorner.com/UploadFile/97fc7a/linq-let-keyword-using-C-Sharp/
CC-MAIN-2014-42
refinedweb
233
50.43
Bart De Smet's on-line blog (0x2B | ~0x2B, that's the question) A few days ago I blogged about extension methods in C# 3.0 as a piece of glue to support LINQ (although it's not strictly required to enable LINQ, it's the most natural way to "extend" existing collections etc with query operators and allow a pretty straightforward translation between query operator syntax and chained extension method calls as an intermediate compilation step). Somewhat later I got the following question from a reader of mine, John Rusk: Bart, What do you think about the possible versioing problems with extension methods? I blogged about it here, . Everyone is is talking about segregating extension methods into their own namespaces, but I'm not sure that completely solves the problem. Bart, What do you think about the possible versioing problems with extension methods? I blogged about it here, . Everyone is is talking about segregating extension methods into their own namespaces, but I'm not sure that completely solves the problem. In this post I'd like to discuss the problem mentioned on the following pages which John is referring to: Warning: The ideas below are just some personal random thoughts that haven't been revised thoroughly; no guarantuees are made and none of the ideas below are a reflection of the C# team's ideas. The only official source for C# 3.0 language specification is the one you can find on the Microsoft website. All syntax propositions are imaginary and won't compile at all. I'm also sure to have overlooked various issues with the proposals being made, so don't start throwing rotten tomatoes at me :-). Suggestions and feedback are welcome (as usual) but it might be more advisable to direct your concerns to the C# team directly. Basically there are different problems to be considered: To summarize, the "minimality" of the current extension method implementation might be its major drawback too. It's basically built around an extended meaning for the using statement and an additional use case for the this keyword. Einstein's words might be applicable: "Everything should be made as simple as possible, but not simpler." As the matter in fact, method resolution precedence is a double-edged sword in this problem. If instance methods take precedence on extension methods, problem 1 can occur. If the reverse were true, i.e. extension methods that take precedence on instance methods, adding a new using statement to the code can change behavior because some extension is brought in scope. A few remarks: Another question one might ask is whether or not the use of using as the "extension methods importing operator" is the good choice. By doing so, using has a three-way semantic, i.e. importing namespaces, importing extensions through namespaces and working with IDisposable objects. This can introduce the side effect that importing a namespace (for convenience use of certain types, i.e. "abbreviating long names") also imports extension methods. A few remarks: What about multiple extension sources available for the same type? For example: namespace Bar contains an extension method called Reverse for System.String, whileas namespace Foo does the same. Namespace segregation might help but not eliminate all possible problems. Again, more fine-grained control might be desirable. An example would be this: using System;namespace Bar{ public static class StringExtensions extends String // or public extension class StringExtensions : String { public static string Reverse() { char[] c = this.ToCharArray(); Array.Reverse(c); return new string(c); } }} namespace Foo{ extend String with Bar.StringExtensions; class Program { public static void Main() { string s = "Hello world"; Console.WriteLine(s.Reverse()); } } } Pros: Cons: The solution of John using contractual explicitness seems pretty nice too, but syntax looks quite awkward at first glance with the "method casting style": s.(IContainable)Contains(t); Nevertheless, it provides a good solution to the precedence and versioning-related problems aforementioned by allowing explicitness for target method call choise. However, on the definition side things look a little weird for the moment: public static class Extender : IFooable{ public static void Foo(this Thing t) { //... }}public interface IFooable{ void Foo();} For example, interfaces are used for instance members and the static class "implements" IFooable. Also, looking at the interface in isolation, you can't see the correlation with the extension of the "Thing" class. To summarize, I do understand the concerns of people like John with the current implementation of extension methods and I also do agree things need to be changed a bit to make its use safer and to eliminate possible versioning issues. In this post, I've put a light on those issues and proposed ideas for possible solutions, which might be a little 'dramatic' because of the 'makeover character' of these propositions. Less disruptive solutions might work out pretty well too, such as a more fine-grained control over which extension types (and/or methods) have to be imported. In the end, I'd like to say that extension methods should be used with care, like most language features, concerning the risky versioning business we're faced with when writing reusable libraries. Hi Bart, Good point about "my solution" looking a bit wierd. I do like the way it means that neither instance nor extension methods have precedence by default, but rather that if there is a conflict the user will be called on to resolve it. Also, if there is intentional implementation of an instance method to take precendence over an extension method (e.g. a LINQ method is implemented as an instance method for some type which needs special handling) then the instance method will be automatically, and _safely_ chosen by the compiler. I think this is important, in any solution to these issues. (See for the pattern which I think the LINQ team wants to support for LINQ methods) I'll re-read the rest of your post again in a couple of days, when I have more time... Regards, John Hi John, You're absolutely right about the possibility to have an intentional instance method precedence for LINQ stuff. For the moment a happy marriage between the mentioned problems and all the problem constraints seems a bit unlikely; changing it one way or another causes other "parties" to be unhappy. Whenever I have some free time left, I'll think further about possible implications. -Bart Yesterday I published a blog post about the WinSAT API in Windows Vista . It's always great to see others Dans la lignée de mon message "Pourquoi ne faut il plus utiliser l'héritage de classe" , voici la suite.
http://community.bartdesmet.net/blogs/bart/archive/2006/12/10/C_2300_-3.0-Extension-Method-Versioning-Troubles-_2D00_-Some-thoughts-and-random-ideas.aspx
crawl-002
refinedweb
1,099
60.24
?!). Let’s get started! Dev Environment Personally, I don’t like mixing projects or installing PHP directly on my dev system. It’s just too costly in terms of the time wasted getting and keeping everything set up properly in the dev environment. Brew on an Apple makes it the easiest to do that, so feel free… but I’m going to show you how I actually do this in real life: Docker. While I used Vagrant a lot in the past because of its ability to run any VM I want, I have found that Docker setup is a lot easier. With Docker Compose I am able to make a simple file (similar to Vagrantfile) for generating my Docker environment. The biggest plus is that Docker runs the operating system inside of my own host instead of requiring a dedicated VM environment. In short, that means I can be running 100 docker servers on my machine and jump around in them (assuming it’s just me accessing them), whereas with Vagrant, I would have to turn them on and off because of the memory requirements alone. If you don’t have docker, it’s pretty easy to get. After a simple installation it is ready to go. Head over to store.docker.com and click on Docker CE (Community Edition) to download it for your platform. You will need to create an account to download it, but they haven’t spammed me as of yet, and I don’t expect them to start in the future. Follow their instructions to install for your platform. I’m going to name my project InspireMe, so I’ll create a directory in my dev folder called inspire-me (the name really doesn’t matter). Inside that folder we should create a docker-compose.yml file to keep the docker setup in. This file will make it a breeze to start or stop our server environment using the Docker Compose tool. A WordPress site needs two different servers to work – a MySQL server and a Web server, so we will need two docker containers (both defined inside this yaml file): version: '3' services: inspire-me-db: image: mysql:5.7 container_name: inspire-me-db restart: always ports: - 33061:3306 environment: MYSQL_ROOT_PASSWORD: root inspire-me-wp: image: wordpress container_name: inspire-me-wp volumes: - ./:/var/www/html ports: - 8081:80 links: - inspire-me-db:mysql environment: WORDPRESS_DB_PASSWORD: root In this file we are defining two services (or containers). The first one comes from the official mysql release tagged for version 5.7. So that everything looks nice we give it a container name, then make a port mapping so we can access it directly. Outside the docker container, in my mac environment port 33061 will map to the port 3306 (mysql port) inside the container. Lastly, we tell MySQL what the root password should be (you can make it anything you want – this is just a dev environment). The second service is being made from the official WordPress release in the latest version. This container we want to map to our local filesystem, so we use the volumes configuration to map ./ in our filesystem (the directory the yaml file is in) to /var/www/html inside the container. When mapping, it is important to know how the container image is set up, but most linux installations default to /var/www/html for service web pages with apache (like in this container). I’ve mapped the internal port 80 to my local port 8081, so I will be able to access this WordPress installation at. Any local posts can be used – whatever is most convenient for you. At this point, the docker-compose.yml file is the only one in the directory. However, once we load the system setup it will put all the files from /var/www/html in the WordPress environment into this directory. The first run will take a little while as your system downloads all the files, but once it’s been loaded the first time, subsequent loads will be super fast (since all the files and settings are already local). Now it’s as simple as running docker-compose up -d in the console from the directory. The -d flag tells docker compose to detach and run the containers in the background, giving you back your terminal. Unloading this system is as simple as typing docker-compose down. This is another thing I love about docker. Vagrant always bugged me with their inconsistent use of terminology with loading and unloading… I love that it’s up and down in docker. One other thing that can be super helpful and not always easy to find is how to get your logs. Again, docker compose to the rescue. See your logs as they currently stand (for all services in the yaml file) by running docker-compose logs. If you add the -f flag, the the logs will stream to your terminal window as you go (you can exit by pressing control-c). This can be extremely helpful when developing an app, and again, much easier than my ex-love, Vagrant! Now that we have a docker environment, we just need to go through the basic installation steps at. It’s as simple as telling WordPress your language and admin login credentials. Now we are ready to code! WordPress Plugins If you are anything like me, as you code you will inadvertently leave off a semicolon or make some other small errors in your script from time to time as you go. To get WordPress to let us see debugging info we need to put it in Debug mode. This is done using a constant called WP_DEBUG. It can be changed in the root directory’s wp-config.php file. For my local setup after installation, it is found on line 80, near the bottom. Just change the false to true and you are good to go. Under this line, you will also want to go ahead and tell WordPress to save all the DB queries made so you can easily sort through them. This is done by adding define('SAVEQUERIES', true); to the script. WordPress has a very specific folder structure. Plugins are created in the wp-content/plugins folder. They can go their own folder and have some specific files that help WordPress know what they are (like defining the name of the plugin, etc.). There is also a convention in WordPress to help end users with their security setup. That is, there is always a simple three-line index.php file in every folder: <?php // Silence is golden. I agree – it doesn’t really do much for security, but I suppose the intent is to help users with misconfigured servers not offer a list of files to users that go snooping around, which is certainly better than not doing it. Now, in this directory (mine is called inspire-me-to-write) there is a php file bearing the same name (so in my case ./wp-content/plugins/inspire-me-to-write/inspire-me-to-write.php). This file needs to have some very specific metadata at the top, which is how WordPress knows how to display this plugin to its users. Mine would look like this: <?php /** * @package InspireMeToWrite */ /* Plugin Name: Inspire Me to Write Plugin URI: Description: <strong>Inspire Me to Write</strong> is a tool for web authors to allow their readers to easily ask and vote for future articles. Version: 1.0.0 Author: John Fansler Author URI: License: GPLv2 or later Text Domain: inspire-me-to-write */ I think the fields here make pretty decent sense. One thing to note is that you can choose any license you want, but if you wish to host it publicly on wordpress.org then you will need a GPL license – preferably “GPLv2 or later” according to wordpress.org. Text Domain is a setting used if you plan to include translations with your plugin to make it available in other languages. You can do anything with this file that you would otherwise do in PHP. Other scripts can be included, subdirectories made, etc. However, there are some specific WordPress functions that need to be called in order to do certain things like include links in menus, display widgets, allow the user to change settings, or get WP-specific data about the user, etc. Going OOP Object Oriented Programming is often missing in many plugins I have seen for WordPress. However, I feel like it is of utmost importance especially in a system such as WordPress, which can have tons of plugins installed, to avoid namespace conflicts. While WordPress does have some standards that help avoid conflicts (such as prefixing every function with your plugin name), entering into a Class with its own namespace makes doing anything substantial in PHP easier in the long run, takes less typing for calling individual functions, and is more maintainable. Please, spend some time setting up at the beginning and create a system that is utilizing OOP for most stuff. WordPress itself recommends a couple different boilerplates that can be forked from github. If I had to choose one I’d go with though. Starting there may well be a better way to begin a project if you are going to create many, but setting it up manually is good practice to really get a good understanding of how plugins work in the WordPress architecture. To get into the habit of OOP, let’s start by making three folders in our plugin folder. Most plugins will usually have something for the admin pages and something that is public. Additionally you will usually have some other generic things that need to be accessed by both the admin and public sections. (You can almost think of the admin and public sections as controllers, and the third section as models or helpers.) Let’s call them admin, public, and includes for consistency with the boilerplate above. Again, any time you create a folder, add in the index.php file that does nothing (silence is golden, above). Now we have a couple immediate things that need to be done first. We need to be able to set up and tear down the data for the plugin (activate and deactivate it). WordPress offers two hooks that define functions specifically for this: register_activation_hook and register_deactivation_hook. These functions, like all the other WordPress API functions, are in the global scope and can be called from anywhere. Depending on how invasive the plugin will be, you might be able to skip them altogether, but chances are there is something that will need to be set up. If there is a lot to do, I would recommend making a Class in the includes folder for it, but if it is super tiny, a simple function at the top level will do. Activation and deactivation are special hooks, but in reality there are many, many hooks in WordPress. Hooks are divided into two categories: Actions and Filters. Actions are used to run functions at specific points in the WordPress execution, whereas Filters are used to modify an input and return it (like if you wanted to do something like highlight a sentence in an article). At first glance into the code for add_action or add_filter you will notice that the same exact code is used – add_action actually just points the unchanged parameters to add_filter. I believe this is probably because the same “hook” system is what is being used, but the WordPress developers wanted to help Plugin developers remember that these hooks call the function in very different ways. There are many different hooks that functions can be attached to. As a plugin is being designed, it’s best to really study the list of hooks published and determine the best place to have your function execute. There are two lists of hooks: one list for Actions and another for Filters. Maybe you are going to include some CSS used by your program, which is best tied to wp_head or admin_head. A simple add action call will do the trick: add_action('admin_head', 'my_function');. If the function is inside of a Class, just swap ‘my_function’ for an array where the first item is the Class name, and the second is the static function: add_action('admin_head', ['MyClass', 'my_function']);. There are a couple more parameters for add_action that can be helpful in specific situations: the priority (defaults to 10 – lower numbers execute earlier than higher numbers), and lastly the number of arguments the function accepts, which defaults to 1. Now that we know how to get our code to run in various places of WordPress execution, we probably need to have some access to the database. WordPress provides a global $wpdb that is a Class based on ezSQL by Justin Vincent. This object already has an active connection to the database being used by WordPress, so no additional overhead is incurred if it is used directly. The ins and outs of this Class could easily be a full article (and you can find many around the web), but here are the basics. If you are familiar with writing queries directly and find comfort in that, then the get_results method will be your best friend. Simply call $resultArray = $wpdb->get_results("SELECT ID, post_title, comment_count FROM $wpdb->posts ORDER BY comment_count"); to get an Array of Post objects that have the properties ID, post_title, and comment_count. $wpdb->posts in the middle of the query references the name of the post table (usually wp_posts), but allows the query to work in environments with custom table prefixes. You can also create tables and access your own data in the same way. There is also a query method, but it returns the number of rows/affected rows and not the result. It could be useful for creating a table or inserting static data. In order to keep your code secure, it is recommended that all queries that contain any user-based data use prepared statements. This can be done with the prepare method and follows a very familiar format: $resultArray = $wpdb->get_results($wpdb->prepare("SELECT post_title FROM $wpdb->posts WHERE ID = %d",5));. Using the prepare method %d denotes an integer, %f a float, and %s a string. A literal percent sign (%) should be entered as a double percent (%%), for example when formatting dates. There is also a special formatter for using LIKE wildcards in a query. The $wpdb->esc_like method can be used to pass in the full string including single % for wildcards as such: $resultArray = $wpdb->get_results($wpdb->prepare("SELECT ID, post_title FROM $wpdb->posts WHERE post_title LIKE %s",$wpdb->esc_like("%".$searchTerm."%")));. There are also some helper methods in $wpdb that are there to make simple queries easier, such as the update, insert, and delete methods. More info on these can be found in the WordPress wpdb class documentation. At this point you have an excellent starting point for writing a Plugin. Now I’m going to go write mine and hopefully you will see it on this site soon! Leave your comments and questions below – I love getting feedback!
https://engagedphp.com/2018/09/wordpress-plugin-development-using-docker/
CC-MAIN-2018-47
refinedweb
2,528
60.75
What is modular arithmetic? I was looking into RSA, an asymmetric cryptosystem. The RSA algorithm relies on “modular exponentiation”. But what is modular exponentiation, and what are the properties of modular exponentiation that make it useful for cryptography? Let’s start with exponentiation. You likely saw exponentiation in school. 37, or “3 to the power 7”, is 3 multiplied by itself 7 times, 3×3×3×3×3×3×3, or 2187. Modular exponentiation is the same operation, modulo some natural number. You might have seen modular arithmetic in school. You’ve certainly worked with modular addition when telling the time. Modular arithmetic is arithmetic where the numbers “wrap around”. In normal addition, 3+11 is 14, but on a 12-hour clock-face, 3+11 is 2. (3am + 11 hours = 2pm.) Computers often use modular arithmetic, with a power-two modulus. Addition over unsigned char values does arithmetic modulo 256. For example, what is 156+240 in unsigned chars? 140. 156+240 = 396. 396 hours around a 256-hour clock reaches 140. There are modular versions of all the normal operations, such as addition, subtraction, multiplication, and exponentiation. What is 3×5 on the clock-face? 3. Compute 3×5 = 15, then count 15 hours around the clock-face from noon. In traditional notation, we write 3×7 ≡ 3 (mod 12). This relation a ≡ b (mod n) can be defined in terms of normal equality: a = b+kn. For example, 38 = 17 + 3×7, so we can say 38 ≡ 17 (mod 7), taking k = 3. Notice we can also say 38 ≡ 17 (mod 3), taking k = 7. What k shows that 15:00 is 3pm, i.e. that 15 ≡ 3 (mod 12)? k=1. 15 hours around the clock goes once around, then three hours more. Addition is iterated stepping, multiplication is iterated addition, and exponentiation is iterated multiplication. All this is true in normal arithmetic and in modular arithmetic. We can define these naïvely in C: #include <stdio.h> #include <stdint.h> typedef unsigned int uint; uint mod_incr(uint x, uint n) { return (x+1 == n) ? 0 : x+1; } uint mod_add(uint a, uint b, uint n) { uint x = a; while (b--) x = mod_incr(x,n); return x; } uint mod_mul(uint a, uint b, uint n) { uint x = 0; while (b--) x = mod_add(x,a,n); return x; } uint mod_exp(uint b, uint e, uint n) { uint x = 1; while (e--) x = mod_mul(x,b,n); return x; } int main(void) { printf("3 + 11 = %u (mod 12)\n", mod_add(3, 11, 12)); printf("3 * 7 = %u (mod 12)\n", mod_mul(3, 7, 12)); printf("11 ^ 8 = %u (mod 12)\n", mod_exp(11, 8, 12)); return 0; } $ clang main.c $ ./a.out 3 + 11 = 2 (mod 12) 3 * 7 = 9 (mod 12) 11 ^ 8 = 1 (mod 12) Every time the number is operated on (incremented), the above algorithm checks whether the number has wrapped around, and if so, resets it to zero. But there’s another way to compute a modular expression: compute it in ordinary arithmetic, then apply the “modulo” at the end. In C, we can redefine our functions using the % (remainder) operator. (This is equivalent as long as the numbers are non-negative.) uint mod_incr(uint x, uint n) { return (x+1) % n; } uint mod_add(uint a, uint b, uint n) { return (a+b) % n; } uint mod_mul(uint a, uint b, uint n) { return (a*b) % n; } uint mod_exp(uint b, uint e, uint n) { uint x = 1; while (e--) x *= b; return x % n; } In normal arithmetic over the integers, each of these operations has an inverse. Subtraction is the inverse of addition, because (a + b ) - b = a. The inverse of multiplication is division, because (a×b) / b = a (unless b is zero!). And exponentiation has as its inverse the “nth root”: b√(a b) = a. There are inverses in modular arithmetic, too, but they don’t work how you might expect! Say you’re at noon, then go forward 3 hours. How do you undo this operation? How do you undo “going 3 hours around the clock-face”? One answer is “by going back 3 hours”. But another answer is “by going forward until you loop back to the original time”. So in clock arithmetic, the inverse of +3 is +9 (adding 3 then adding 9 leaves you in the same place). In general, for modulus n, the inverse of +b is +(n-b). How about the inverse of multiplication and exponentiation? This gets closer to the territory of the RSA algorithm, and.
https://jameshfisher.com/2017/12/08/what-is-modular-arithmetic/
CC-MAIN-2019-22
refinedweb
759
66.23
. 13 comments: Thanks for the writeup! As an FYI, the API has changed a bit with the inclusion of the package in 2.6, and a handful of bugs have been addressed. Hopefully, I'll get a chance at pycon to do some sessions on the new package! No problem Jesse! One thing I should point out that I forgot, is the fact that Both Parallel-Python and Ipython1 support multiprocessing in clusters of computers which is something Processing don't yet support. I wonder if that is an appropriate feature for a standard library module, however. I've been using the multiprocessing lib in 2.6RC2, and IMO I don't think it's all that. I'm working on a checkers game with a Tkinter GUI, and I wanted an easy way to do calculations in the background and keep the GUI active. I also thought you could terminate a process easier than a thread. Here's some sample problems I found: 1) While the multiprocessing module follows threading closely, it's definitely not an exact match. One example: since parameters to a process must be "pickleable", I had to go through a lot of code changes to avoid passing Tkinter objects since these aren't pickleable. This doesn't occur with the threading module. 2) process.terminate() doesn't really work after the first attempt. The second or third attempt simply hangs the interpreter, probably because data structures are corrupted (mentioned in the API, but this is little consolation). Those are just a few off the top of my head. In my opinion, threading is easier to use and understand ... and I'd never thought I'd say that! But it's true in my case. I have had many of the same problems you mention while trying to work with parallel-python. The Pickleability requirement is really a pain in the "neck", However passing data between processes, is not an easy to solve problem. I try to minimize it by designing my solution around the need to share data among processes. In your example, if all you need is to run computations in the background, I don't see why pass tkinter objects around... @usagi -- I'm using an MVC architecture for my Checkers program, so my Model notifies the View of updates. When I pass a Model reference to the process, the process tries to pickle the View reference too and blows up with a run time exception. So it just means the multiprocessing lib introduces a dependency on the pickle module, and it's not just a drop-in replacement for threading. I had to carefully decouple my model & view in order to use the processing library in my application, and it's a pretty big "gotcha" for what I'm doing. @usagi - there is a clustering example in the 2.6 docs, and I'll be expanding on it using some work I am doing @brandon - I'm not a GUI person, nor am I largely interested in GUI programming, therefore I can't offer any suggestions: but I am willing to take them to improve the multiprocessing package. The package is not a panacea, and won't help 100% of users - for *many* use cases: it is a drop in replacement (which is why I ran with it). Of course threading doesn't require pickling: It's all within the same memory space, which is not true for the mp package. In your case, the threading module is more appropriate for the simple fact you don't have a problem for which the mp module meshes well. I'm open to suggestions and improvements though. One day though - I hope people realize that the wide spread sharing of data between threads (and processes) that doesn't happen on a messaging or queue level is why they have so many problems. Again, I'm open to improvements - but no, the mp package isn't going to fix 100% of problems. Some problems just aren't a fit. @usagi - Additionally, the mp package offers network-based managers for object sharing and message passing @jesse - My suggestion is to improve the documentation, putting the gotchas up front in the summary rather than embedded within the text. Right now it required a several reads top to bottom (several times in my case, along with code changes) to understand if I could use the lib effectively for my app. That is not typically how I read (or want to read) docs. I also think you should have some recommendation in the docs on how to use process.terminate() correctly so that it doesn't hang ... e.g. recreate your pipes/queues if that actually works. I think terminate() should be removed if it isn't reliable. Thanks for being open to improvements. Thanks for the hint about support for clustering, Jesse. hi, here's another simple option that may work for you... For some stuff that releases the GIL, like pygame, and numpy using threads can be better... since you don't have to pickle massive amounts of memory. Using the experimental threads module in pygame makes it just like using the python map function. import pygame.threads pygame.threads.init(2) tmap = pygame.threads.tmap result = tmap(func, [data,data]) @brandon - for the initial inclusion, I didn't want to grossly refactor the docs - but I'll file an enhancement for myself for 2.6.1/2.7 and 3.1 to do this. somethign of note is that the processing module works flawlessly with the stackless project. One of my little side software dabbling projects is to see how hard/easy it is to utilize a multi-core system in python, as it comes up on the python list all the time it seems. Originally I had done manual forking and all that rot, which was painful. Once I found out that processing module (still running under 2.5) works with stackless, my code became a LOT simpler. My testing code was a psudeo mud, where mobs would interact and trade with each other. very simplistic and unpolished. :) I ended up with a master process that handled message routing from subprocesses. this used a python thread per subprocess to handle incoming messages on the queue object, and a dedicated thread that sent out ticks on a broadcast channel. The worker processes then handled a world 'town', and all the tasklets and objects associated with it. as mobs moved from town to town, they would be pickled, sent via the master process to their new worker process, unpickled and their channels reinitialized. I was VERY surprised at the ease of getting this up and running using the processing module. Once you find a good demarkcation point for your data exchange in your program, it becomes very easy to scale up to X cores. much thanks goes out to all the teams behind python, stackless, and the processing module.?...
http://pyinsci.blogspot.in/2008/09/python-processing.html
CC-MAIN-2018-09
refinedweb
1,162
72.05
SUCCESSFUL TIPS TO MANAGING TAX DEBT - Myles McGee - 2 years ago - Views: Transcription 1 SUCCESSFUL TIPS TO MANAGING TAX DEBT 2 A Complete Guide to THE IRS COLLECTION PROCESS Everything You Need to Know About How the IRS Tax Debt Collection Process Works and What You Can Do to Stop It Learn: What Triggers the IRS Collection Process What Methods the IRS Uses to Collect The Penalties for Failing to Pay Taxes Owed Actionable Steps for Resolving IRS Tax Problems 3 FOREWORD IRS tax problems require immediate action. To collect tax debt, the IRS has almost unlimited powers that it can use to destroy your financial and personal life. They can and will use everything in their power to collect the taxes owed. These can be federal tax liens, wage garnishments, levies, and intimidating notices and telephone calls. This ebook serves as a comprehensive guide to the IRS Collection Process. By reading this guide you will gain a stronger understanding of all aspects of the IRS collection process; identifying IRS tactics including levies, wage garnishment, liens and penalties. This guide will help you take actionable steps to deal with the IRS. We encourage you to apply this knowledge to your unique situation. 4 CONTENTS I. What Triggers the IRS Collection Process 1 II. IRS Collection Process 2 III. Tax Penalties 4 IV. Resolving Tax Problems 7 V. How We Can Help 11 VI. Three Things You Should Never Say to the IRS 12 - 5 Each year Americans pay over $2 trillion in taxes to the Internal Revenue Service. Though that is a huge number there is still a significant amount of taxes that do not get paid-about $345 billion per year, according to the most recent estimates. The IRS refers to these unpaid taxes as the "Tax Gap" since they represent the gap between what should be paid in taxes and what the government actually receives. That "Tax Gap" sum legally belongs to the IRS and they are not going to let $345 billion go without a fight. With the growth of the federal government's annual budget deficit in recent years the IRS has been under increasing pressure to collect all of the taxes owed. Because of this the agency has stepped up its efforts to collect delinquent taxes and close the "Tax Gap." When someone does fail to pay their tax bill in full and on time the IRS irritates its collection process and takes whatever steps are necessary to collect the money. WHAT TRIGGERS THE IRS COLLECTION PROCESS? There are many reasons why individuals or businesses find themselves owing taxes and become entangled in the IRS collection process. Here are just a few examples: A tax return is not filed on time. The taxpayer cannot afford to pay the entire tax bill. The IRS has added penalties or interest to the tax bill and those additional costs have not been paid. An audit determines additional taxes are owed. Tax bills can be increased if the IRS determines some income was not reported, some deductions are not allowable or that there are no receipts for the deductions that were claimed. A person is saddled with someone else's tax debt. For example, the IRS might try to collect a spouse's tax debt even if that spouse has left the marriage. Or if an individual has worked for a business that has failed and the business owed taxes the IRS can seek to collect those unpaid business taxes from the individual. Payment is made but there is an error in processing or recording the payment. The IRS miscalculates how much money is owed. therefore ignore it. Even if it truly is an error by the IRS the taxpayer must respond in order to get the error corrected. An IRS notice is sent but never received. This is often due to a change of address but there are many reasons why a taxpayer might not be aware of the problem before it is too late 6 IRS COLLECTION PROCESS After sending a final demand for payment, both through the mail and by telephone, the IRS will start enforcing their legal right to take from you what is owed. The Internal Revenue Service has a huge amount of power and authority and has a wide range of tools available for getting money from delinquent taxpayers. Though they function in different ways the collection methods are similar in that they allow the IRS to take the money owed with or without your approval. The methods used by the IRS during the collection process include: Tax liens Tax levies Asset seizure Bank levies Wage garnishment TAX LIENS A tax lien is typically the first collection tool used by the IRS. As soon as the deadline for payment passes and the case goes into collection status a statutory tax lien comes into effect. So, what is a statutory tax lien? A lien is a legal claim against your property, with "property" being defined as anything and everything that you own-your home, car, business, bank account, retirement account, etc. The legal claim of a tax lien stops short of giving the IRS ownership and control of your assets; they. Because there is no paperwork and no notifications are involved in the creation of a statutory tax lien it can often go unenforced. When the IRS is serious about enforcing the tax lien it will usually choose to officially file it with the court system. To do so the agency simply provides written notice to your local county court with a document known as a Notice of Federal Tax Lien (NFTL). This is known as "perfecting" the lien because it provides notice that the tax lien is in effect. It ensures that the government's legal claim to your money is enforced should you try to sell any assets. The fact that the tax lien is now public record can cause several difficulties for the taxpayer: Credit bureaus can learn about the tax lien through court records and lower your credit score as a result. It can make it very difficult to get financing because lenders know that the IRS has first right to any property that you would use as collateral. For both of the reasons above any credit you do receive will likely carry a higher interest rate. It makes it much more difficult to sell the property because the title must first be cleared of the tax lien 7 Despite these problems tax liens are still relatively minor compared to the next step the IRS can take: tax levies. TAX LEVIES With a tax lien the IRS does not actually take ownership or possession of your property. A tax levy, on the other hand, is when the IRS does take ownership of your property. It can legally take almost anything you own, and sell your belongings to pay off the tax debt.." That is the entire list; any other personal property can be seized by the IRS. However, there are situations in which it is not worthwhile for the agency to seize physical items. The IRS will not seize a piece of property if: The owner has less than 20 percent equity in the item. The expenses involved in taking and selling the item would exceed the amount the IRS would make from selling it. For a primary place of residence the IRS will not seize the house unless the tax debt is more than $5, 8 BANK LEVIES Because of the potential difficulties in seizing physical assets the IRS prefers to seize financial assets. Besides being easier and safer to take they provide instant cash without the hassle of finding a buyer. The seizure of a financial asset is often referred to as a "bank levy." In no way should that imply that the IRS is limited only to accounts that reside in a bank though. what it considers to be basic living expenses, but calculates that amount based on charts and tables. In the most extreme cases, those tables allow the IRS to leave the taxpayer with little more than $180 per week. The agency does not take into account what your living expenses actually amount to and may therefore. Of course, increasing the amount 9 owed makes it more difficult to pay the tax bill, increasing the odds that the IRS will have to seize assets or garnish wages. There are also instances where the tax penalties go beyond simple interest and fines and can result in criminal prosecution and Below are explanations for the different types of penalties and the amount that is charged for each: FAILURE TO FILE PENALTY If you do not file a tax return by the April 15 due date (or by the extended due date, if you file for an extension) the IRS will charge you a "failure to file" penalty. The dollar amount of the penalty depends on the amount of tax owed, the number of months that have passed since the deadline and the reason for the tax return not being filed. In cases that do not involve negligence or fraud the "failure to file" penalty is calculated as follows: For each month that has passed since the deadline 5% is added to the total tax amount owed. The maximum penalty is 25%. This essentially means that the 5% penalty only apples for the first 5 months past the deadline. However, if at least 60 days have passed since the deadline to file the minimum penalty is $135 or 100% of the amount due, whichever is smaller. FAILURE TO PAY PENALTY If you do not pay your taxes on time or pay only part of the amount owed you will be subject to a "failure to pay" or "underpayment" penalty. Payment of taxes is due on April 15 each year; at the same time tax returns are filed. Though you can get an extension on filing your taxes there is no extension on paying your taxes. So a filing extension can lead to a "failure to pay" penalty even if you file and pay within the allowed extension period. If you cannot pay the full amount on time and the IRS agrees to let you set up an installment plan you will still have to pay at least a portion of this penalty. The amount of the penalty depends on the circumstances: The standard penalty is 0.5% of the unpaid amount per month. Over time the penalty can add up but is capped at 25% of the original amount owed. If you are paying with an installment plan the fee is lowered to 0.25% per month. If a levy is involved the penalty may be increased to 1% per month. If you both fail to file and fail to pay the combined penalty will be 5% per month--the same as the "failure to file" penalty by itself. The cap on the total combined penalty is 47.5% of the original amount owed. In addition to the penalty, the IRS will also charge interest on any amount that is not paid on time. The interest rate charged is equal to the federal short-term rate plus 3% 10 ACCURACY- RELATED PENALTY Even if you file and pay your taxes on time you can still be charged a penalty if an audit finds your tax return to contain inaccurate information. Errors on a tax return can lead to a person paying either too much or too little in taxes; the IRS is primarily concerned with those who pay too little. There are two main inaccuracies that can cause a tax return to show a lower tax amount than what is actually owed: Listing less income than was actually earned. Taking more in deductions than what should actually apply. When inaccuracies on your tax return lead to you paying less in taxes than you should have the IRS will charge you for the extra taxes you owe plus a penalty for filing an inaccurate return. Generally, the accuracy-related penalty will be 20% of the amount by which the taxes were understated. NEGLIGENCE PENALTY The penalty amounts listed so far are for cases in which the taxpayer is not accused of negligence or fraud. If you are found to be negligent or guilty of fraud the penalties can increase dramatically. What constitutes "negligence" can be a bit hard to define because it depends on what would be considered a "reasonable" effort to comply with tax rules and regulations. If someone does not make at least a "reasonable" attempt to understand and follow IRS rules they can be found negligent and face stiffer tax penalties. Some examples of actions that could constitute negligence: Not keeping receipts or records of items claimed as deductions. Not reporting income you were notified about on a tax information return (such as a W-2 or a 1099 form). Not checking the accuracy of a number or calculation that seems unusually high or lower than expected. Making the same mistake multiple times even though you have been notified and told how to do it correctly. So, what happens if you are found to be negligent? If you fail to file your tax return due to negligence the "failure to file" penalty is tripled. Instead of being charged a 5% penalty for each month you are late the monthly penalty will be 15%. Instead of the maximum penalty being capped at 25% you can be penalized up to 75% of the tax amount owed. If inaccuracies on your tax return are caused by negligence the accuracy-related penalty is doubled. Instead of a 20% penalty you will be charged 40%. TAX FRAUD PENALTIES If you intentionally do not file or pay taxes or intentionally report inaccurate numbers in an effort to lower your tax bill, it is tax fraud. Any intentional effort to avoid paying what you owe in taxes constitutes tax fraud. Tax fraud is illegal and carries the most severe penalties that the IRS can dish out. The most basic tax fraud penalties mirror those charged for negligence and are considered "civil" tax fraud penalties. The IRS can also charge taxpayers with criminal" tax fraud in which case the criminal justice 11 system determines the punishment. Criminal tax fraud penalties can involve hefty fines and significant jail time. Criminal tax fraud can be classified as a misdemeanor or a felony depending on the charges. Failure to file a tax return is a misdemeanor and can carry penalties of up to $25,000 in fines and 1 year in prison for each year. Failure to pay estimated taxes is also a misdemeanor with a maximum fine of $25,000 and a maximum prison sentence of 1 year. Filing a fraudulent tax return is a felony and can be punished with up to $100,000 in fines and 3 years in prison. Tax evasion or using illegal activities to circumvent tax laws and avoid paying taxes is the most serious tax-related charge you can face. It is a felony punishable by up to $100,000 in fines and 5 years in prison. Criminal prosecution is usually reserved for the most serious tax fraud cases; minor charges are generally handled with the "civil" penalties used for cases of negligence. That being said, more than 2,000 people were convicted of criminal tax fraud last year and the vast majority of those convictions included a prison sentence. The consequences of not fully paying your taxes can be severe. So how can you avoid these tax problems or at least minimize the damage? RESOLVING TAX PROBLEMS If you find yourself facing the IRS collections process and the related penalties and consequences there are ways you can fix the problem and get back on good standing. Removing tax penalties Removing tax liens Removing tax levies Stopping wage garnishments Innocent spouse relief Installment plans Offer in compromise "Currently not collectible" status Criminal tax defense Help with tax preparation and planning Dealing with the IRS REMOVING TAX PENALTIES If you are facing penalties for not filing or paying your taxes on time you may be able to get those penalties removed (or even get past penalties and interest refunded) if you can show that there was a "reasonable cause" for why you were late. "Reasonable cause" can include: Mailing the tax return or payment on time but writing the wrong address on the envelope or using the wrong amount of postage. A death or illness in the family. An error caused by an IRS employee. The destruction of records by a fire, flood or other catastrophe 12 About one-third of tax penalties; are eventually removed by the IRS. To request that a tax penalty be removed or refunded you need to fill out IRS Form 843, "Claim for Refund and Request for Abatement." REMOVING TAX LIENS Tax liens are usually only removed when the underlying debt to the IRS is paid in full. However, because tax liens negatively impact your credit situation, make it more difficult to do business and limit your ability to sell assets it can sometimes be in the best interest of both you and the IRS for the liens to be removed before the debt is paid. If you can convince the IRS that removing a lien will allow you to pay them back sooner, the IRS will likely be happy to have the lien removed. You can also get the IRS to remove a lien that has been filed in court if you appeal and can show that the IRS was in error or did not have the right to file a lien. A lien can be removed on appeal if: The tax debt has already been paid in full. The IRS did not follow proper procedures. You were in bankruptcy when the lien was filed. The statute of limitations on collecting the tax debt has already passed. REMOVING TAX LEVIES When the IRS issues a notice that it intends to levy and seize your assets you have 30 days to challenge the levy or pay the amount due. If you cannot pay the tax debt in full before the IRS is scheduled to seize your assets you may be able to remove the tax levy anyway by setting up an installment plan with the IRS or making other arrangements. If you need more time you can file for a "Stay of Collections" which allows you an additional 90 days before the IRS would be able to seize any assets. STOPPING WAGE GARNISHMENTS Wage garnishments are likewise a form of tax levy, though the seizure of assets from your paycheck is an ongoing process. If the levy on your wages is removed, the wage garnishments will be stopped. Since wage garnishments function as a sort of forced, involuntary installment plan they can sometimes be removed by setting up a regular installment plan. Besides removing the burden from your employer and giving you the power to handle the payments yourself an installment plan can often be set up with payments that are considerably less than the wage garnishment amounts. INNOCENT SPOUSE RELIEF The IRS can sometimes saddle you with a tax debt that is actually the responsibility of your spouse or exspouse. If the actions of your spouse caused the tax problem and you were unaware of or had no part in those actions you can use the IRS Form 8857 to request "innocent spouse relief" and have the tax debt and penalties removed 13 INSTALLMENT PLANS If you cannot pay your tax debt all at once the IRS may agree to let you pay it off gradually in monthly installments. The IRS may be a tough and impersonal entity but it is also highly logical and practical. The agency does understand that it cannot take money that does not exist and allowing taxpayers to pay down a debt over time can often be the easiest and best way for the agency to collect all of the money owed. And since the IRS does collect interest on past due amounts it does not actually hurt the agency financially to allow someone to pay slowly. Installment plans are often viable options that work well for both the IRS and the taxpayer. Though you will usually still have to pay penalties and interest setting up a payment plan can get you on a track towards being free of your tax debt and put an end to the stresses and pitfalls of the IRS collection process. OFFER IN COMPROMISE In some cases, your financial situation may make it nearly impossible for you to pay off all of your tax debt even over the long term of an installment plan. In such situations the IRS may be willing to accept an "Offer in Compromise" and significantly lower your tax bill. Here is how an Offer in Compromise works: Both you and the IRS acknowledge that there is no feasible way to pay off all of your tax debt. This means that you do not have enough income to pay it all and do not have enough valuable assets that the IRS could seize. You offer to pay the IRS the maximum amount that you can afford even though that amount may fall far short of the actual tax debt. If the IRS accepts that the amount you offered is the most that it could reasonably expect to collect from you it will agree to compromise and essentially lower your tax debt to match the amount you can pay. Once you have finished paying that amount the tax debt is considered "paid in full." This is true even if the agreed-upon Offer in Compromise is only a small percentage of what you originally owed. The Offer in Compromise can be a life-saving tool for those who truly need it. On average people who settle their debt using an Offer in Compromise end up paying less than 20% of the actual amount they owed to the IRS. CURRENTLY NOT COLLECTIBLE" STATUS If there is absolutely no way for you to pay your tax debt, and no way for the IRS to collect the money owed you can file for "currently not collectible" status. "Currently not collectible" means exactly what it sounds like. The IRS will not be able to collect any owed taxes or penalty charges if: Your wages cover no more than your necessary living expenses so 14 The fact that you have nothing worth taking is not exactly an enviable position but it can help in dealing with the IRS. If your account is deemed to be uncollectible the IRS will stop the collection process until your financial situation improves.. CRIMINAL TAX DEFENSE If the IRS Criminal Investigation Division starts investigating your case due to suspicions of tax fraud you need to hire a criminal tax defense professional to represent you. The stakes are simply too high to risk facing a criminal investigation by yourself. Whether a case constitutes tax fraud depends just as much on your intentions as on your actions. A specialist in criminal tax defense can guide you through the investigation process and give you the best possible chance to avoid any criminal charges. HELP WITH TAX PREPARATION AND PLANNING Of course prevention is the best medicine. The easiest way to deal with tax problems is to prevent them from happening in the first place. This is one reason why it often pays to have a tax professional prepare your tax returns. Besides eliminating errors or misstatements that may simply be due to a lack of experience or a misunderstanding of the tax process having professionals do your taxes places much of the responsibility for any problems on their shoulders. Seeking out a professional for customized tax planning can also help you avoid getting into a tax debt situation. Proper tax planning can keep you from getting personally saddled with tax debt from your business. Estate tax planning can also help out after you are gone; ensuring that your family is not left with a heavy tax burden due to your passing. DEALING WITH THE IRS When you do have tax problems and are dealing with the IRS and its employees your odds of success will be heavily influenced by how well you communicate. There are a number of things you can do to help things go smoothly when dealing with IRS agents: Remain friendly. Being confrontational will make the IRS agent less likely to work with you or try process and complaining will not help your case. 15 Ask for the name and ID number of any IRS employee who calls you. To be safe it is best to check and make sure that you are actually actually do have something to hide. Of course, considering the stakes involved, this is much easier said than done. No matter what you do you will always be at a disadvantage when dealing with the IRS. Most taxpayers have little or no experience in handling tax problems details and nuances of the tax code the IRS knows every rule and every tool they can use against you. The IRS literally knows every trick in the book because it is their book, they wrote it. HOW WE CAN HELP If you are facing the possibility of IRS collections Optima Tax Relief stands ready to help. We can provide the expert advice, guidance and representation needed to get you through the IRS collection process as quickly, cheaply and painlessly as possible. Our team of tax specialists and attorneys has a proven track record of helping people in situations just like your own. There are several reasons for our success in dealing with the IRS: We specialize in resolving IRS tax problems. It's all we do. Just as IRS agents are experts at getting what they want from taxpayers we are experts at dealing with the IRS. We understand the IRS better than anyone because we have worked with the IRS everyday. That insider knowledge enables us to know exactly what the IRS will try to do and how to best handle every situation. Our licensed professionals have over 27 years of experience working in the tax industry. As a result of our licensed professionals experience, we have developed our own system of methods and procedures that allow us to work quickly and efficiently; that means we are able to give your case the personal attention needed while resolving your problems in the shortest amount of time possible. By representing you before the IRS we are able to save you stress and time. We know what to say and what not to say and can help you face the IRS without fear. At Optima Tax Relief we offer services including: Removing tax liens Removing tax levies Preventing the seizure of assets Stopping wage garnishments Setting up installment plans Negotiating Offers in Compromise Help with tax preparation Filing overdue tax returns Customized tax planning Protection against criminal action Representation before IRS auditors and revenue collectors If you have any questions about the IRS collection process or would like more information about how we can help with your IRS tax problems, contact us at Optima Tax Relief today 16 Three Things You Should Never Say to the IRS : 1., Well you have a point, I guess we could agree with that. 2.. 3. CLIENT SERVICES: Tax Problem Resolution Services CLIENT SERVICES: Tax Problem Resolution Services Dear Client: Are you having problems with the IRS? We re here to help you resolve your tax problems and put an end to the misery that the IRS can put Sure and Secure IRS Resolution Services Sure and Secure IRS Resolution Services Enrolled Agent - Representation What is an Enrolled Agent? An Enrolled Agent (EA) is a federally-authorized tax practitioner who has technical expertise in the field Free Report: How To Repair Your Credit Free Report: How To Repair Your Credit The following techniques will help correct your credit and should be done with all Credit Bureaus. In this section you will learn the ways of removing negative items Notice to Delinquent Taxpayers Notice to Delinquent Taxpayers Department of the Treasury Alcohol and Tobacco Tax and Trade Bureau TTB P 5610.1 (1/04) Previous Editions are Obsolete NOTICE TO DELINQUENT TAXPAYERS INTRODUCTION When BETTER YOUR CREDIT PROFILE BETTER YOUR CREDIT PROFILE Introduction What there is to your ITC that makes it so important to you and to everyone that needs to give you money. Your credit record shows the way you have been paying your Your Rights As A Taxpayer Your Rights As A Taxpayer Most people understand they have a duty to pay all taxes imposed by the State of Maine when taxes are due. Many people, however, do not know that the law gives them some important Chapter 13 Bankruptcy Filing Process Chapter 13 Bankruptcy Filing Process Let us now turn our discussion to the process of bankruptcy. Although over 1.6 million people file bankruptcy every year, enough to fill every major stadium in the Bankruptcy/Debt Collection Bankruptcy/Debt Collection [ADVOCATE: Give caller advice per script. Check case acceptance list and refer to appropriate offfice for more services.] I. Explain Judgment Proof Judgment proof means you have AGOSTINO & ASSOCIATES, P.C. IRS Collections. Presented by : Frank Agostino AGOSTINO & ASSOCIATES, P.C. IRS Collections Presented by : Frank Agostino DISCLAIMER: The following materials and accompanying Access MCLE, LLC audio program are for instructional purposes only. Nothing Understanding Bankruptcy Understanding Bankruptcy What is Bankruptcy? Bankruptcy is a legal process where an individual or organizational debtor is able to seek some financial relief. A fundamental goal of the federal bankruptcy The IRS Collection Process Keep this publication for future reference Publication 594 IRS Mission: Provide America s taxpayers top quality service by helping them understand and meet their tax responsibilities and by applying the tax law with integrity and fairness to all. What You Should, Using Credit to Your Advantage Hands on Banking Using Credit to Your Advantage Credit Reports, Credit Scores and Dealing with Debt The Hands on Banking program is a free public service provided by Wells Fargo. You may also access the Spouses, ex-spouses and children are a major example of what causes credit report errors, identity theft and confusion of reporting data. Repair Credit? Repair Credit Scores? Is it Worth all the Extra Effort? 850 750 300 You should check your credit reports and official credit scores at least once a year, or more often, when you are preparing SMALL CLAIMS COURT IN ARKANSAS SMALL CLAIMS COURT IN ARKANSAS Note: The information contained in this publication is designed as a useful guide to remind you of your rights as a citizen of this state. You should not rely totally on The Examination Process. The IRS Mission The IRS Mission Provide America s taxpayers top quality service by helping them understand and meet their tax responsibilities and by applying the tax law with integrity and fairness to all. The Examination 4 Ways to Cut the Penalties and Interest on Your Tax Debt 4 Ways to Cut the Penalties and Interest on Your Tax Debt 1 Table of Contents Content Page Number Overview 3-4 The Voluntary Disclosure Program 5-10 Notice of Objection 11-14 The Taxpayer Relief Provision Living the Dream -Live E-Seminar / Conference Call September 15, 2010 Living the Dream -Live E-Seminar / Conference Call Fighting Battles: Partners, Potential Foreclosure and The IRS Host: Mat Sorensen, Attorney at Law Special Guests: Mark Kohler, CPA, GUIDE TO SMALL CLAIMS COURT The Rural Law Center of New York, Inc. This material is provided to answer general questions about the law in New York State. The information and forms were created to assist readers with general issues and not specific situations, and, as Offer in Compromise (Doubt as to Liability) Form 656-L Offer in Compromise (Doubt as to Liability) CONTENTS What you need to know...2 Important information...2 Form 656-L...5 IRS contact information If you have questions about qualifying for an COMMON QUESTIONS ABOUT BANKRUPTCY SCUDDER G. STEVENS, P.A. ATTORNEYS AT LAW A PROFESSIONAL ASSOCIATION 120 North Union Street P.O. Box 1156 Kennett Square, PA 19348 (610) 444-9840 (800) 294-4242 FAX (610) 444-9841 COMMON QUESTIONS FREE REPORT: Don t Be Embarrassed It Is NOT Your Fault! FREE REPORT: The Top 5 Tax Secrets The IRS Doesn t Want You To Know And How To Use Them To Reduce Your Stress And Save You Money ESPECIALLY During Tough Economic Times Guaranteed! Dear Taxpayer, Believing DEALING WITH THE IRS DEALING WITH THE IRS 2 3 DEALING WITH THE IRS More individuals deal with the IRS than any other federal government agency. The IRS processes more than 100 million individual income tax returns every year. Using Credit to Your Advantage. Using Credit to Your Advantage. Topic Overview. The Using Credit To Your Advantage topic will provide participants with all the basic information they need to understand credit what it is and how to make Don't go it alone* The IRS collection process. pwc. *connectedthinking. Introduction. IRS emphasis on increasing tax collection. IRS Service Team Don't go it alone* The IRS collection process Introduction Taxpayers periodically request assistance with IRS collection matters. IRS collection contacts can appear intimidating, and taxpayers Life After Bankruptcy. By Jason Amerine Life After Bankruptcy By Jason Amerine Bankruptcy: A Fresh Start for You Every day I have clients ask me about what life might be like after bankruptcy, and perhaps you re feeling that way, too. Sure, Improving a Credit Profile Improving a Credit Profile Steps to improving a credit profile STEP 1. Order your credit Report STEP 2. Evaluate & develop a plan STEP 3. Is the personal information accurate? STEP 4. Are the tradelines ( - 2 - Your appeal will follow these steps: QUESTIONS AND ANSWERS ABOUT YOUR APPEAL AND YOUR LAWYER A Guide Prepared by the Office of the Appellate Defender 1. WHO IS MY LAWYER? Your lawyer s name is on the notice that came with this guide. The TEN LOOPHOLES THAT CAN STOP FORCLOSURE FAST TEN LOOPHOLES THAT CAN STOP FORCLOSURE FAST Copyright Notice All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means electronic or mechanical.... TABLE OF CONTENTS. Introduction...3 What is Debt Consolidation?...5. Debt Consolidation Program Processes...19 TABLE OF CONTENTS Introduction...3 What is Debt Consolidation?...5 A) CHAPTER 13 B) WHAT DEBTS ARE ADDRESSED? Debt Consolidation Program Processes...19 A) DEBT MANAGEMENT PROGRAM B) DEBT SETTLEMENT, Restitution Basics for Victims of Crimes by Adults Restitution Basics for Victims of Crimes by Adults If you are the victim of a crime, you have a right to be repaid for losses that resulted from the crime. This booklet will help you understand: How to Understanding IRS Collection Procedures I. Collection Begins with Assessment Understanding IRS Collection Procedures Unit One- Assessment Learning Objectives After completing this Unit you should have an understanding of: A. Overview What an MABS Guide to the Personal Insolvency Act, 2012 MABS Guide to the Personal Insolvency Act, 2012 DISCLAIMER: This Guide is for general information purposes only and does not constitute legal, financial or other professional advice. Specific advice should SOCIAL SECURITY OVERPAYMENTS: SOCIAL SECURITY OVERPAYMENTS: RESPONDING TO A NOTICE THAT SAYS YOU HAVE BEEN OVERPAID This document contains general information for educational purposes and should not be construed as legal advice. It? The IRS Resolution Guide for Owner-Operators The IRS Resolution Guide for Owner-Operators Learn ways to avoid penalties, how the IRS deals with unpaid taxes, the resolution options available, and how to take action to resolve your debt. PRESENTED Credit Repair Made Easy Credit Repair Made Easy A simple self help guide to credit repair By Don Troiano Introduction My name is Don Troiano and I spent over 15 years in the mortgage industry. Knowing how to guide customers in TABLE OF CONTENTS. Introduction: Levy on Bank Accounts... 7610. Notice of Bank Levy... 7620. Levy Questionnaire... 7630. Exemption Notice... TABLE OF CONTENTS SECTION HEADING SECTION NUMBER Introduction: Levy on Bank Accounts... 7610 Notice of Bank Levy... 7620 Levy Questionnaire... 7630 Exemption Notice... 7640 Bank's Responses to Levy... The IRS Collection Process Keep this publication for future reference Publication 594 IRS Mission: Provide America s taxpayers top quality service by helping them understand and meet their tax responsibilities and by applying the tax law with integrity and fairness to all. What You Should DEPARTMENT OF DEFENSE DEFENSE OFFICE OF HEARINGS AND APPEALS DEPARTMENT OF DEFENSE DEFENSE OFFICE OF HEARINGS AND APPEALS In the matter of: ) ) ------------------------ ) ISCR Case No. 07-02458 SSN: ----------- ) ) Applicant for Security Clearance ) Appearances YOUR LEGAL RIGHTS DURING YOUR LEGAL RIGHTS DURING AND AFTER BANKRUPTCY: MAKING THE MOST OF YOUR BANKRUPTCY DISCHARGE Copyright April 2011, Legal Aid Society of Hawai`i All rights reserved. These materials may not be reproduced Worcester Business Journal Worcester Business Journal IRS audits on the rise Written by Joy Child, C.P.A., PFS Monday, 11 December 2006 Agency gets aggressive about closing the "Tax Gap" Many people would rather have a root canal What You Should Know About Bankruptcy What Is Bankruptcy? FACTS FOR National Consumer Law Center What You Should Know About Bankruptcy What Is Bankruptcy? Bankruptcy is a process under federal law designed to help people and businesses get protection from their Creditor Lawsuits Handbook Creditor Lawsuits Handbook In Magisterial District Court A Handbook for people dealing with creditor lawsuits, including information on such suits and common defenses. Revised July 2009 Introduction This An Introduction to Identity Theft. Letbighelptoday.com. Your Free Copy An Introduction to Identity Theft Your Free Copy DO I NEED IDENTITY THEFT INSURANCE? Necessary Coverage or False Sense of Security? Identity theft has become a national concern, with 10 million victims things to know Helping you understand your debt things to know Helping you understand your debt Your questions answered Some common questions Here are the answers to some frequently asked questions that may arise when dealing with your debt. Creditors MANDATORY BANKRUPTCY DISCLOSURE 2418 Main St. Vancouver, WA 98660 Telephone: (360) 334-6277 Facsimile: (360) 356-1920 MANDATORY BANKRUPTCY DISCLOSURE IMPORTANT INFORMATION ABOUT BANKRUPTCY ASSISTANCE SERVICES FROM Early Delinquency Intervention: Saving Your Home From Foreclosure Early Delinquency Intervention: Saving Your Home From Foreclosure There are many circumstances in a homeowner s life that could result in missed mortgage payments: unexpected expenses, loss of overtime, Help! I Got a Letter from the IRS Help! I Got a Letter from the IRS Common IRS Tax Collection Notices Simplified and Explained 1.866.866.1555 In this guide, you will learn: Why, When and How the IRS Sends Collection IRS Penalties: Running Afoul of the Tax Code IRS Penalties: Running Afoul of the Tax Code The income tax system of the United States is essentially based on the notion of voluntary compliance. You are expected to report and remit the income you ve Your Guide to Past-Due Support Your Guide to Past-Due Support WI BUREAU OF CHILD SUPPORT Increased withholdings Interest charges Tax refund intercept Court actions Child support liens Federal actions Interstate cases What the paying FREE YOUR MIND. Stop House Repossession FREE YOUR MIND Stop House Repossession The purpose of this report is to open the curtains on the mortgage industry and give regular people in depth insights on foreclosure Information for Worker s Compensation Clients Information for Worker s Compensation Clients Overview of the Worker s Compensation Act Indiana Worker s Compensation cases are governed by a State law known as the Worker s Compensation Act. The legislature Don t Panic: Your Complete Guide IRS Audit Letters Don t Panic: Your Complete Guide to Understanding IRS Audit Letters 1.866.866.1555 This guide is a resource for anyone who worries about an IRS audit. In the following CHAPTER 7 BANKRUPTCY BOOKLET CHAPTER 7 BANKRUPTCY BOOKLET By Gerardo M. DelGado, Esq. AMABLE LAW PLLC gdelgado@amablelaw.com INTRODUCTION This information is intended as general information ONLY. It is NOT legal advice. You should Credit Repair: Self-Help May Be Best FTC Facts For Consumers Federal Trade Commission For The Consumer December 2005 1-877-ftc-help Credit Repair: Self-Help May Be Best You see the advertisements in newspapers, on TV, and on the Bankruptcy: Is It the Right Choice for You? Bankruptcy: Is It the Right Choice for You? Find more easy-to-read legal information at Introduction This is to help you to understand some basics about the bankruptcy laws and rules. This CLIENT RESPONSIBILITY RETAINER AGREEMENT FOR Filing a Chapter 7 Bankruptcy BETWEEN FIRM NAME: Paul E. Kauffmann, Attorney at Law ADDRESS: 233 12 th Street, Suite 725 CITY/STATE Columbus, GA 31901 TEL. NO.: 706 566 3434 AND Bankruptcy Guide for Beginners Bankruptcy Guide for Beginners Answers to 20 common bankruptcy questions We hope you find this guide useful and informative. We look forward to helping you eliminate debt and get a fresh financial. What to Know When You Owe (edited transcript) What to Know When You Owe (edited transcript) Sarah Vainer: Hello, and welcome to SB/SE Collection s Nationwide Tax Forum Presentation for this year. I m Sarah Vainer. I m the Collection group manager DEBTOR EDUCATION CERTIFICATES: These must be filed with the Bankruptcy Court. Do NOT send a copy to me. DINA L. ANDERSON, CHAPTER 7 TRUSTEE MAILING ADDRESS: 21001 N. Tatum Blvd., #1630-608, Phoenix, AZ 85050 EMAIL: general@dlatrustee.com* PHONE: 480-304-8312* Case No. I have been appointed as the Trustee The IRS Collection Process Publication 594 The IRS Collection Process Publication 594 Page 1 The IRS Collection Process Publication 594 This publication provides a general description of the IRS collection process. The collection process is a series DELINQUENT PERSONAL PROPERTY TAXES TABLE OF CONTENTS. Introduction: Tax Lien... 7305. General Tax Lien Information... 7310 TABLE OF CONTENTS SECTION HEADING SECTION NUMBER Introduction: Tax Lien... 7305 General Tax Lien Information... 7310 Guidelines for Filing a Tax Lien... 7315 Notice of Tax Lien... 7320 Renewal of Tax Lien... WHAT YOU SHOULD KNOW ABOUT YOUR CHAPTER 13 CASE PUT YOUR CASE NUMBER ON ALL PAYMENTS AND CORRESPONDENCE SENT TO THE CHAPTER 13 TRUSTEE OR THE COURT. YOUR CASE NUMBER: WHAT YOU SHOULD KNOW ABOUT YOUR CHAPTER 13 CASE Brief answers to most questions that come up while under a Chapter 13 Plan. Read this pamphlet completely to understand your obligations TAX OFFENCES AND ENFORCEMENT MEASURES IN RUSSIA Authors: Jon Hellevig, Anton Kabakov, and Artem Usov. Jon Hellevig, Managing partner of Awara Group LinkedIn: Facebook: E-mail: Self Help Credit Repair Guide Self Help Credit Repair Guide This report will inform you of your rights under the Fair Credit Reporting Act (FCRA) and what you can do about it! In 1971 Congress passed legislation to protect consumer All the Things the IRS Can Take Even Retirement Accounts! All the Things the IRS Can Take Even Retirement Accounts! The power of the IRS to take is limited by the issuance of a Final Notice of Intent to Levy. But what are the limits on the power of what can be General District Courts General District Courts To Understand Your Visit to Court You Should Know: It is the courts wish that you know your rights and duties. We want every person who comes here to receive fair treatment in accordance Law Related to Fraud. Bankruptcy (Insolvency) Fraud. 2015 Association of Certified Fraud Examiners, Inc. Law Related to Fraud Bankruptcy (Insolvency) Fraud Bankruptcy Court Filed in a local district of the U.S. Bankruptcy Court Bankruptcy judges hear all cases involving: Debtors and creditors rights Approval
http://docplayer.net/1345084-Successful-tips-to-managing-tax-debt.html
CC-MAIN-2017-34
refinedweb
7,295
58.01
String length You are encouraged to solve this task according to the task description, using any language you may know. In this task, the goal is to find the character and byte length of a string. This means encodings like UTF-8 need to be handled properly, as there is not necessarily a one-to-one relationship between bytes and characters. By character, we mean an individual Unicode code point, not a user-visible grapheme containing combining characters. For example, the character length of "møøse" is 5 but the byte length is 7 in UTF-8 and 10 in UTF-16. Non-BMP code points (those between 0x10000 and 0x10FFFF) must also be handled correctly: answers should produce actual character counts in code points, not in code unit counts. Therefore a string like "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" (consisting of the 7 Unicode characters U+1D518 U+1D52B U+1D526 U+1D520 U+1D52C U+1D521 U+1D522) is 7 characters long, not 14 UTF-16 code units; and it is 28 bytes long whether encoded in UTF-8 or in UTF-16. Please mark your examples with ===Character Length=== or ===Byte Length===. If your language is capable of providing the string length in graphemes, mark those examples with ===Grapheme Length===. For example, the string "J̲o̲s̲é̲" ("J\x{332}o\x{332}s\x{332}e\x{301}\x{332}") has 4 user-visible graphemes, 9 characters (code points), and 14 bytes when encoded in UTF-8. [edit] 4D [edit] Byte Length $length:=Length("Hello, world!") [edit] ActionScript [edit] Byte length This uses UTF-8 encoding. For other encodings, the ByteArray's writeMultiByte() method can be used. package { import flash.display.Sprite; import flash.events.Event; import flash.utils.ByteArray; public class StringByteLength extends Sprite { public function StringByteLength() { if ( stage ) _init(); else addEventListener(Event.ADDED_TO_STAGE, _init); } private function _init(e:Event = null):void { var s1:String = "The quick brown fox jumps over the lazy dog"; var s2:String = "𝔘𝔫𝔦𝔠𝔬𝔡𝔢"; var s3:String = "José"; var b:ByteArray = new ByteArray(); b.writeUTFBytes(s1); trace(b.length); // 43 b.clear(); b.writeUTFBytes(s2); trace(b.length); // 28 b.clear(); b.writeUTFBytes(s3); trace(b.length); // 5 } } } [edit] Character Length var s1:String = "The quick brown fox jumps over the lazy dog"; var s2:String = "𝔘𝔫𝔦𝔠𝔬𝔡𝔢"; var s3:String = "José"; trace(s1.length, s2.length, s3.length); // 43, 14, 4 [edit] Ada [edit] Byte Length Str : String := "Hello World"; Length : constant Natural := Str'Size / 8; The 'Size attribute returns the size of an object in bits. Provided that under "byte" one understands an octet of bits, the length in "bytes" will be 'Size divided to 8. Note that this is not necessarily the machine storage unit. In order to make the program portable, System.Storage_Unit should be used instead of "magic number" 8. System.Storage_Unit yields the number of bits in a storage unit on the current machine. Further, the length of a string object is not the length of what the string contains in whatever measurement units. String as an object may have a "dope" to keep the array bounds. In fact the object length can even be 0, if the compiler optimized the object away. So in most cases "byte length" makes no sense in Ada. [edit] Character Length Latin_1_Str : String := "Hello World"; UCS_16_Str : Wide_String := "Hello World"; Unicode_Str : Wide_Wide_String := "Hello World"; Latin_1_Length : constant Natural := Latin_1_Str'Length; UCS_16_Length : constant Natural := UCS_16_Str'Length; Unicode_Length : constant Natural := Unicode_Str'Length; The attribute 'Length yields the number of elements of an array. Since strings in Ada are arrays of characters, 'Length is the string length. Ada supports strings of Latin-1, UCS-16 and full Unicode characters. In the example above character length of all three strings is 11. The length of the objects in bits will differ. [edit] Aime [edit] Byte Length length("Hello, World!") [edit] ALGOL 68 [edit] Bits and Bytes Length BITS bits := bits pack((TRUE, TRUE, FALSE, FALSE)); # packed array of BOOL # BYTES bytes := bytes pack("Hello, world"); # packed array of CHAR # print(( "BITS and BYTES are fixed width:", new line, "bits width:", bits width, ", max bits: ", max bits, ", bits:", bits, new line, "bytes width: ",bytes width, ", UPB:",UPB STRING(bytes), ", string:", STRING(bytes),"!", new line )) Output: BITS and BYTES are fixed width: bits width: +32, max bits: TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT, bits:TTFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF bytes width: +32, UPB: +32, string:Hello, world! [edit] Character Length STRING str := "hello, world"; INT length := UPB str; printf(($"Length of """g""" is "g(3)l$,str,length)); printf(($l"STRINGS can start at -1, in which case LWB must be used:"l$)); STRING s := "abcd"[@-1]; print(("s:",s, ", LWB:", LWB s, ", UPB:",UPB s, ", LEN:",UPB s - LWB s + 1)) Output: Length of "hello, world" is +12 STRINGS can start at -1, in which case LWB must be used: s:abcd, LWB: -1, UPB: +2, LEN: +4 [edit] AppleScript [edit] Byte Length count of "Hello World" Mac OS X 10.5 (Leopard) includes AppleScript 2.0 which uses only Unicode (UTF-16) character strings. This example has been tested on OSX 10.8.5. Added a combining char for testing. set inString to "Hello é̦世界" set byteCount to 0 repeat with c in inString set t to id of c if ((count of t) > 0) then repeat with i in t set byteCount to byteCount + doit(i) end repeat else set byteCount to byteCount + doit(t) end if end repeat byteCount on doit(cid) set n to (cid as integer) if n > 67108863 then -- 0x3FFFFFF return 6 else if n > 2097151 then -- 0x1FFFFF return 5 else if n > 65535 then -- 0xFFFF return 4 else if n > 2047 then -- 0x07FF return 3 else if n > 127 then -- 0x7F return 2 else return 1 end if end doit [edit] Character Length count of "Hello World" Or: count "Hello World" [edit] Applesoft BASIC ? LEN("HELLO, WORLD!") [edit] AutoHotkey [edit] Character Length Msgbox % StrLen("Hello World") Or: String := "Hello World" StringLen, Length, String Msgbox % Length [edit] AWK [edit] Byte Length From within any code block: w=length("Hello, world!") # static string example x=length("Hello," s " world!") # dynamic string example y=length($1) # input field example z=length(s) # variable name example Ad hoc program from command line: echo "Hello, wørld!" | awk '{print length($0)}' # 14 From executable script: (prints for every line arriving on stdin) #!/usr/bin/awk -f {print"The length of this line is "length($0)} [edit] Axe Axe supports two string encodings: a rough equivalent to ASCII, and a token-based format. These examples are for ASCII. [edit] Byte Length "HELLO, WORLD"→Str1 Disp length(Str1)▶Dec,i [edit] Batch File [edit] Byte Length @echo off setlocal enabledelayedexpansion call :length %1 res echo length of %1 is %res% goto :eof :length set str=%~1 set cnt=0 :loop if "%str%" equ "" ( set %2=%cnt% goto :eof ) set str=!str:~1! set /a cnt = cnt + 1 goto loop [edit] BASIC [edit] Character Length BASIC only supports single-byte characters. The character "ø" is converted to "°" for printing to the console and length functions, but will still output to a file as "ø". INPUT a$ PRINT LEN(a$) [edit] ZX Spectrum Basic The ZX Spectrum needs line numbers: 10 INPUT a$ 20 PRINT LEN(a$) [edit] BBC BASIC [edit] Character Length INPUT text$ PRINT LEN(text$) [edit] Byte Length CP_ACP = 0 CP_UTF8 = &FDE9 textA$ = "møøse" textW$ = " " textU$ = " " SYS "MultiByteToWideChar", CP_ACP, 0, textA$, -1, !^textW$, LEN(textW$)/2 TO nW% SYS "WideCharToMultiByte", CP_UTF8, 0, textW$, -1, !^textU$, LEN(textU$), 0, 0 PRINT "Length in bytes (ANSI encoding) = " ; LEN(textA$) PRINT "Length in bytes (UTF-16 encoding) = " ; 2*(nW%-1) PRINT "Length in bytes (UTF-8 encoding) = " ; LEN($$!^textU$) Output: Length in bytes (ANSI encoding) = 5 Length in bytes (UTF-16 encoding) = 10 Length in bytes (UTF-8 encoding) = 7 [edit] Bracmat The solutions work with UTF-8 encoded strings. [edit] Byte Length (ByteLength= length . @(!arg:? [?length) & !length ); out$ByteLength$𝔘𝔫𝔦𝔠𝔬𝔡𝔢 Answer: 28 [edit] Character Length (CharacterLength= length c . 0:?length & @( !arg : ? ( %?c & utf$!c:?k & 1+!length:?length & ~ ) ? ) | !length ); out$CharacterLength$𝔘𝔫𝔦𝔠𝔬𝔡𝔢 Answer: 7 An improved version scans the input string character wise, not byte wise. Thus many string positions that are deemed not to be possible starting positions of UTF-8 are not even tried. The patterns [!p and [?p implement a ratchet mechanism. [!p indicates the start of a character and [?p remembers the end of the character, which becomes the start position of the next byte. (CharacterLength= length c p . 0:?length:?p & @( !arg : ? ( [!p %?c & utf$!c:?k & 1+!length:?length ) ([?p&~) ? ) | !length ); [edit] C [edit] Byte Length #include <string.h> int main(void) { const char *string = "Hello, world!"; size_t length = strlen(string); return 0; } or by hand: int main(void) { const char *string = "Hello, world!"; size_t length = 0; const char *p = string; while (*p++ != '\0') length++; return 0; } or (for arrays of char only) #include <stdlib.h> int main(void) { char s[] = "Hello, world!"; size_t length = sizeof s - 1; return 0; } [edit] Character Length For wide character strings (usually Unicode uniform-width encodings such as UCS-2 or UCS-4): #include <stdio.h> #include <wchar.h> int main(void) { wchar_t *s = L"\x304A\x306F\x3088\x3046"; /* Japanese hiragana ohayou */ size_t length; length = wcslen(s); printf("Length in characters = %d\n", length); printf("Length in bytes = %d\n", sizeof(s) * sizeof(wchar_t)); return 0; } [edit] Dealing with raw multibyte string Following code is written in UTF-8, and environment locale is assumed to be UTF-8 too. Note that "møøse" is here directly written in the source code for clarity, which is not a good idea in general. mbstowcs(), when passed NULL as the first argument, effectively counts the number of chars in given string under current locale. #include <stdio.h>output #include <stdlib.h> #include <locale.h> int main() { setlocale(LC_CTYPE, ""); char moose[] = "møøse"; printf("bytes: %d\n", sizeof(moose) - 1); printf("chars: %d\n", (int)mbstowcs(0, moose, 0)); return 0; } bytes: 7 chars: 5 [edit] C++ [edit] Byte Length #include <string> // (not <string.h>!) using std::string; int main() { string s = "Hello, world!"; string::size_type length = s.length(); // option 1: In Characters/Bytes string::size_type size = s.size(); // option 2: In Characters/Bytes // In bytes same as above since sizeof(char) == 1 string::size_type bytes = s.length() * sizeof(string::value_type); } For wide character strings: #include <string> using std::wstring; int main() { wstring s = L"\u304A\u306F\u3088\u3046"; wstring::size_type length = s.length() * sizeof(wstring::value_type); // in bytes } [edit] Character Length For wide character strings: #include <string> using std::wstring; int main() { wstring s = L"\u304A\u306F\u3088\u3046"; wstring::size_type length = s.length(); } For narrow character strings: #include <iostream> #include <codecvt> int main() { std::string utf8 = "\x7a\xc3\x9f\xe6\xb0\xb4\xf0\x9d\x84\x8b"; // U+007a, U+00df, U+6c34, U+1d10b std::cout << "Byte length: " << utf8.size() << '\n'; std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> conv; std::cout << "Character length: " << conv.from_bytes(utf8).size() << '\n'; } #include <cwchar> // for mbstate_t #include <locale> // give the character length for a given named locale std::size_t char_length(std::string const& text, char const* locale_name) { // locales work on pointers; get length and data from string and // then don't touch the original string any more, to avoid // invalidating the data pointer std::size_t len = text.length(); char const* input = text.data(); // get the named locale std::locale loc(locale_name); // get the conversion facet of the locale typedef std::codecvt<wchar_t, char, std::mbstate_t> cvt_type; cvt_type const& cvt = std::use_facet<cvt_type>(loc); // allocate buffer for conversion destination std::size_t bufsize = cvt.max_length()*len; wchar_t* destbuf = new wchar_t[bufsize]; wchar_t* dest_end; // do the conversion mbstate_t state = mbstate_t(); cvt.in(state, input, input+len, input, destbuf, destbuf+bufsize, dest_end); // determine the length of the converted sequence std::size_t length = dest_end - destbuf; // get rid of the buffer delete[] destbuf; // return the result return length; } Example usage (note that the locale names are OS specific): #include <iostream> int main() { // Tür (German for door) in UTF8 std::cout << char_length("\x54\xc3\xbc\x72", "de_DE.utf8") << "\n"; // outputs 3 // Tür in ISO-8859-1 std::cout << char_length("\x54\xfc\x72", "de_DE") << "\n"; // outputs 3 } Note that the strings are given as explicit hex sequences, so that the encoding used for the source code won't matter. [edit] C# [edit] Character Length string s = "Hello, world!"; int characterLength = s.Length; [edit] Byte Length Strings in .NET are stored in Unicode. using System.Text; string s = "Hello, world!"; int byteLength = Encoding.Unicode.GetByteCount(s); To get the number of bytes that the string would require in a different encoding, e.g., UTF8: int utf8ByteLength = Encoding.UTF8.GetByteCount(s); [edit] Clean [edit] Byte Length Clean Strings are unboxed arrays of characters. Characters are always a single byte. The function size returns the number of elements in an array. import StdEnv strlen :: String -> Int strlen string = size string Start = strlen "Hello, world!" [edit] Clojure [edit] Byte Length (def utf-8-octet-length #(-> % (.getBytes "UTF-8") count)) (map utf-8-octet-length ["møøse" "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" "J\u0332o\u0332s\u0332e\u0301\u0332"]) ; (7 28 14) (def utf-16-octet-length (comp (partial * 2) count)) (map utf-16-octet-length ["møøse" "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" "J\u0332o\u0332s\u0332e\u0301\u0332"]) ; (10 28 18) (def code-unit-length count) (map code-unit-length ["møøse" "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" "J\u0332o\u0332s\u0332e\u0301\u0332"]) ; (5 14 9) [edit] Character length (def character-length #(.codePointCount % 0 (count %))) (map character-length ["møøse" "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" "J\u0332o\u0332s\u0332e\u0301\u0332"]) ; (5 7 9) [edit] Grapheme Length (def grapheme-length #(->> (doto (java.text.BreakIterator/getCharacterInstance) (.setText %)) (partial (memfn next)) repeatedly (take-while (partial not= java.text.BreakIterator/DONE)) count)) (map grapheme-length ["møøse" "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" "J\u0332o\u0332s\u0332e\u0301\u0332"]) ; (5 7 4) [edit] COBOL [edit] Byte Length FUNCTION BYTE-LENGTH(str) Alternative, non-standard extensions: LENGTH OF str FUNCTION LENGTH-AN(str) [edit] Character Length FUNCTION LENGTH(str) [edit] ColdFusion [edit] Byte Length <cfoutput> <cfset str = "Hello World"> <cfset j = createObject("java","java.lang.String").init(str)> <cfset t = j.getBytes()> <p>#arrayLen(t)#</p> </cfoutput> [edit] Character Length #len("Hello World")# [edit] Common Lisp [edit] Byte Length In Common Lisp, there is no standard way to examine byte representations of characters, except perhaps to write a string to a file, then reopen the file as binary. However, specific implementations will have ways to do so. For example: (length (sb-ext:string-to-octets "Hello Wørld")) returns 12. [edit] Character Length Common Lisp represents strings as sequences of characters, not bytes, so there is no ambiguity about the encoding. The length function always returns the number of characters in a string. (length "Hello World") returns 11, and (length "Hello Wørld") returns 11 too. [edit] Component Pascal Component Pascal encodes strings in UTF-16, which represents each character with 16-bit value. [edit] Character Length MODULE TestLen; IMPORT Out; PROCEDURE DoCharLength*; VAR s: ARRAY 16 OF CHAR; len: INTEGER; BEGIN s := "møøse"; len := LEN(s$); Out.String("s: "); Out.String(s); Out.Ln; Out.String("Length of characters: "); Out.Int(len, 0); Out.Ln END DoCharLength; END TestLen. A symbol $ in LEN(s$) in Component Pascal allows to copy sequence of characters up to null-terminated character. So, LEN(s$) returns a real length of characters instead of allocated by variable. Running command TestLen.DoCharLength gives following output: s: møøse Length of characters: 5 [edit] Byte Length MODULE TestLen; IMPORT Out; PROCEDURE DoByteLength*; VAR s: ARRAY 16 OF CHAR; len, v: INTEGER; BEGIN s := "møøse"; len := LEN(s$); v := SIZE(CHAR) * len; Out.String("s: "); Out.String(s); Out.Ln; Out.String("Length of characters in bytes: "); Out.Int(v, 0); Out.Ln END DoByteLength; END TestLen. Running command TestLen.DoByteLength gives following output: s: møøse Length of characters in bytes: 10 [edit] D [edit] Byte Length import std.stdio; void showByteLen(T)(T[] str) { writefln("Byte length: %2d - %(%02x%)", str.length * T.sizeof, cast(ubyte[])str); } void main() { string s1a = "møøse"; // UTF-8 showByteLen(s1a); wstring s1b = "møøse"; // UTF-16 showByteLen(s1b); dstring s1c = "møøse"; // UTF-32 showByteLen(s1c); writeln(); string s2a = "𝔘𝔫𝔦𝔠𝔬𝔡𝔢"; showByteLen(s2a); wstring s2b = "𝔘𝔫𝔦𝔠𝔬𝔡𝔢"; showByteLen(s2b); dstring s2c = "𝔘𝔫𝔦𝔠𝔬𝔡𝔢"; showByteLen(s2c); writeln(); string s3a = "J̲o̲s̲é̲"; showByteLen(s3a); wstring s3b = "J̲o̲s̲é̲"; showByteLen(s3b); dstring s3c = "J̲o̲s̲é̲"; showByteLen(s3c); } - Output: Byte length: 7 - 6dc3b8c3b87365 Byte length: 10 - 6d00f800f80073006500 Byte length: 20 - 6d000000f8000000f80000007300000065000000 Byte length: 28 - f09d9498f09d94abf09d94a6f09d94a0f09d94acf09d94a1f09d94a2 Byte length: 28 - 35d818dd35d82bdd35d826dd35d820dd35d82cdd35d821dd35d822dd Byte length: 28 - 18d501002bd5010026d5010020d501002cd5010021d5010022d50100 Byte length: 14 - 4accb26fccb273ccb265cc81ccb2 Byte length: 18 - 4a0032036f00320373003203650001033203 Byte length: 36 - 4a000000320300006f000000320300007300000032030000650000000103000032030000 [edit] Character Length import std.stdio, std.range, std.conv; void showCodePointsLen(T)(T[] str) { writefln("Character length: %2d - %(%x %)", str.walkLength(), cast(uint[])to!(dchar[])(str)); } void main() { string s1a = "møøse"; // UTF-8 showCodePointsLen(s1a); wstring s1b = "møøse"; // UTF-16 showCodePointsLen(s1b); dstring s1c = "møøse"; // UTF-32 showCodePointsLen(s1c); writeln(); string s2a = "𝔘𝔫𝔦𝔠𝔬𝔡𝔢"; showCodePointsLen(s2a); wstring s2b = "𝔘𝔫𝔦𝔠𝔬𝔡𝔢"; showCodePointsLen(s2b); dstring s2c = "𝔘𝔫𝔦𝔠𝔬𝔡𝔢"; showCodePointsLen(s2c); writeln(); string s3a = "J̲o̲s̲é̲"; showCodePointsLen(s3a); wstring s3b = "J̲o̲s̲é̲"; showCodePointsLen(s3b); dstring s3c = "J̲o̲s̲é̲"; showCodePointsLen(s3c); } - Output: Character length: 5 - 6d f8 f8 73 65 Character length: 5 - 6d f8 f8 73 65 Character length: 5 - 6d f8 f8 73 65: 9 - 4a 332 6f 332 73 332 65 301 332 Character length: 9 - 4a 332 6f 332 73 332 65 301 332 Character length: 9 - 4a 332 6f 332 73 332 65 301 332 [edit] Dc [edit] Character Length The following code output 5, which is the length of the string "abcde" [abcde]Zp [edit] Déjà Vu [edit] Byte Length Byte length depends on the encoding, which internally is UTF-8, but users of the language can only get at the raw bytes after encoding a string into a blob. !. len !encode!utf-8 "møøse" !. len !encode!utf-8 "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" - Output: 7 28 [edit] Character Length !. len "møøse" !. len "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" - Output: 5 7 [edit] E [edit] Character Length "Hello World".size() [edit] Elixir [edit] Byte Length name = "J\x{332}o\x{332}s\x{332}e\x{301}\x{332}" byte_size(name) # => 14 [edit] Character Length name = "J\x{332}o\x{332}s\x{332}e\x{301}\x{332}" Enum.count(String.codepoints(name)) # => 9 [edit] Grapheme Length name = "J\x{332}o\x{332}s\x{332}e\x{301}\x{332}" String.length(name) # => 4 [edit] Emacs Lisp [edit] Character Length (length "hello") => 5 [edit] Byte Length (string-bytes "\u1D518\u1D52B\u1D526") => 12 string-bytes is the length of Emacs' internal representation. In Emacs 23 up this is utf-8. In earlier versions it was "emacs-mule". [edit] Display Length string-width is the displayed width of a string in the current frame and window. This is not the same as grapheme length since various Asian characters may display in 2 columns, depending on the type of tty or GUI. (let ((str (apply 'string (mapcar (lambda (c) (decode-char 'ucs c)) '(#x1112 #x1161 #x11ab #x1100 #x1173 #x11af))))) (list (length str) (string-bytes str) (string-width str))) => (6 18 4) ;; in emacs 23 up [edit] Erlang [edit] Character Length Strings are lists of integers in Erlang. So "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" is the list [120088,120107,120102,120096,120108,120097,120098]. 9> U = "𝔘𝔫𝔦𝔠𝔬𝔡𝔢". [120088,120107,120102,120096,120108,120097,120098] 10> erlang:length(U). 7 [edit] Euphoria [edit] Character Length print(1,length("Hello World")) [edit] F# This is delegated to the standard .Net framework string and encoding functions. [edit] Byte Length open System.Text let byte_length str = Encoding.UTF8.GetByteCount(str) [edit] Character Length "Hello, World".Length [edit] Factor [edit] Byte Length Here are two words to compute the byte length of strings. The first one doesn't allocate new memory, the second one can easily be adapted to measure the byte length of encodings other than UTF8. : string-byte-length ( string -- n ) [ code-point-length ] map-sum ; : string-byte-length-2 ( string -- n ) utf8 encode length ; [edit] Character Length length works on any sequece, of which strings are one. Strings are UTF8 encoded. length [edit] Fantom [edit] Byte length A string can be converted into an instance of Buf to treat the string as a sequence of bytes according to a given charset: the default is UTF8, but 16-bit representations can also be used. fansh> c := "møøse" møøse fansh> c.toBuf.size // find the byte length of the string in default (UTF8) encoding 7 fansh> c.toBuf.toHex // display UTF8 representation 6dc3b8c3b87365 fansh> c.toBuf(Charset.utf16LE).size // byte length in UTF16 little-endian 10 fansh> c.toBuf(Charset.utf16LE).toHex // display as UTF16 little-endian 6d00f800f80073006500 fansh> c.toBuf(Charset.utf16BE).size // byte length in UTF16 big-endian 10 fansh> c.toBuf(Charset.utf16BE).toHex // display as UTF16 big-endian 006d00f800f800730065 [edit] Character length fansh> c := "møøse" møøse fansh> c.size 5 [edit] Forth [edit] Byte Length Strings in Forth come in two forms, neither of which are the null-terminated form commonly used in the C standard library. Counted string A counted string is a single pointer to a short string in memory. The string's first byte is the count of the number of characters in the string. This is how symbols are stored in a Forth dictionary. CREATE s ," Hello world" \ create string "s" s C@ ( -- length=11 ) s COUNT ( addr len ) \ convert to a stack string, described below Stack string A string on the stack is represented by a pair of cells: the address of the string data and the length of the string data (in characters). The word COUNT converts a counted string into a stack string. The STRING utility wordset of ANS Forth works on these addr-len pairs. This representation has the advantages of not requiring null-termination, easy representation of substrings, and not being limited to 255 characters. S" string" ( addr len) DUP . \ 6 [edit] Character Length The 1994 ANS standard does not have any notion of a particular character encoding, although it distinguishes between character and machine-word addresses. (There is some ongoing work on standardizing an "XCHAR" wordset for dealing with strings in particular encodings such as UTF-8.) The following code will count the number of UTF-8 characters in a null-terminated string. It relies on the fact that all bytes of a UTF-8 character except the first have the the binary bit pattern "10xxxxxx". 2 base ! : utf8+ ( str -- str ) begin char+ dup c@ 11000000 and 10000000 <> until ; decimal : count-utf8 ( zstr -- n ) 0 begin swap dup c@ while utf8+ swap 1+ repeat drop ; [edit] GAP Length("abc"); # or same result with Size("abc"); [edit] Gnuplot [edit] Byte Length print strlen("hello") => 5 [edit] Go [edit] Byte Length package main import "fmt" func main() { m := "møøse" u := "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" j := "J̲o̲s̲é̲" fmt.Printf("%d %s % x\n", len(m), m, m) fmt.Printf("%d %s %x\n", len(u), u, u) fmt.Printf("%d %s % x\n", len(j), j, j) } Output: 7 møøse 6d c3 b8 c3 b8 73 65 28 𝔘𝔫𝔦𝔠𝔬𝔡𝔢 f09d9498f09d94abf09d94a6f09d94a0f09d94acf09d94a1f09d94a2 14 J̲o̲s̲é̲ 4a cc b2 6f cc b2 73 cc b2 65 cc 81 cc b2 [edit] Character Length package main import ( "fmt" "unicode/utf8" ) func main() { m := "møøse" u := "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" j := "J̲o̲s̲é̲" fmt.Printf("%d %s %x\n", utf8.RuneCountInString(m), m, []rune(m)) fmt.Printf("%d %s %x\n", utf8.RuneCountInString(u), u, []rune(u)) fmt.Printf("%d %s %x\n", utf8.RuneCountInString(j), j, []rune(j)) }] 9 J̲o̲s̲é̲ [4a 332 6f 332 73 332 65 301 332] [edit] Grapheme Length Go does not have language or library features to recognize graphemes directly. For example, it does not provide functions implementing Unicode Standard Annex #29, Unicode Text Segmentation. It does however have convenient functions for recognizing Unicode character categories, and so an expected subset of grapheme possibilites is easy to recognize. Here is a solution recognizing the category "Mn", which includes the combining characters used in the task example. package main import ( "fmt" "unicode" "unicode/utf8" ) func main() { m := "møøse" u := "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" j := "J̲o̲s̲é̲" fmt.Printf("%d %s %x\n", grLen(m), m, []rune(m)) fmt.Printf("%d %s %x\n", grLen(u), u, []rune(u)) fmt.Printf("%d %s %x\n", grLen(j), j, []rune(j)) } func grLen(s string) int { if len(s) == 0 { return 0 } gr := 1 _, s1 := utf8.DecodeRuneInString(s) for _, r := range s[s1:] { if !unicode.Is(unicode.Mn, r) { gr++ } } return gr }] 4 J̲o̲s̲é̲ [4a 332 6f 332 73 332 65 301 332] [edit] Groovy Calculating "Byte-length" (by which one typically means "in-memory storage size in bytes") is not possible through the facilities of the Groovy language alone. Calculating "Character length" is built into the Groovy extensions to java.lang.String. [edit] Character Length println "Hello World!".size() Output: 12 Note: The Java "String.length()" method also works in Groovy, but "size()" is consistent with usage in other sequential or composite types. [edit] GW-BASIC GW-BASIC only supports single-byte characters. 10 INPUT A$ 20 PRINT LEN(A$) [edit] Haskell [edit] Byte Length It is not possible to determine the "byte length" of an ordinary string, because in Haskell, a string is a boxed list of unicode characters. So each character in a string is represented as whatever the compiler considers as the most efficient representation of a cons-cell and a unicode character, and not as a byte. For efficient storage of sequences of bytes, there's Data.ByteString, which uses Word8 as a base type. Byte strings have an additional Data.ByteString.Char8 interface, which will truncate each Unicode Char to 8 bits as soon as it is converted to a byte string. However, this is not adequate for the task, because truncation simple will garble characters other than Latin-1, instead of encoding them into UTF-8, say. There are several (non-standard, so far) Unicode encoding libraries available on Hackage. As an example, we'll use encoding-0.2, as Data.Encoding: import Data.Encoding import Data.ByteString as B strUTF8 :: ByteString strUTF8 = encode UTF8 "Hello World!" strUTF32 :: ByteString strUTF32 = encode UTF32 "Hello World!" strlenUTF8 = B.length strUTF8 strlenUTF32 = B.length strUTF32 [edit] Character Length The base type Char defined by the standard is already intended for (plain) Unicode characters. strlen = length "Hello, world!" [edit] HicEst LEN("1 character == 1 byte") ! 21 [edit] Icon and Unicon [edit] Character Length length := *s Note: Neither Icon nor Unicon currently supports double-byte character sets. [edit] IDL [edit] Byte Length Compiler: any IDL compiler should do length = strlen("Hello, world!") [edit] Character Length length = strlen("Hello, world!") [edit] Io [edit] Byte Length "møøse" sizeInBytes [edit] Character Length "møøse" size [edit] J [edit] Byte Length # 'møøse' 7 Here we use the default encoding for character literals (8 bit wide literals). [edit] Character Length #7 u: 'møøse' 5 Here we have used 16 bit wide character literals. See also the dictionary page for u:. [edit] Java [edit] Byte Length Java encodes strings in UTF-16, which represents each character with one or two 16-bit values. Another way to know the byte length of a string -who cares- is to explicitly specify the charset we desire. String s = "Hello, world!"; int byteCountUTF16 = s.getBytes("UTF-16").length; // Incorrect: it yields 28 (that is with the BOM) int byteCountUTF16LE = s.getBytes("UTF-16LE").length; // Correct: it yields 26 int byteCountUTF8 = s.getBytes("UTF-8").length; // yields 13 [edit] Character Length Java encodes strings in UTF-16, which represents each character (code point) with one or two 16-bit code units. This is a variable-length encoding scheme. The most commonly used characters are represented by one 16-bit code unit, while rarer ones like some mathematical symbols are represented by two. The length method of String objects is not the length of that String in characters. Instead, it only gives the number of 16-bit code units used to encode a string. This is not (always) the number of Unicode characters (code points) in the string. String s = "Hello, world!"; int not_really_the_length = s.length(); // XXX: does not (always) count Unicode characters (code points)! Since Java 1.5, the actual number of characters (code points) can be determined by calling the codePointCount method. String str = "\uD834\uDD2A"; //U+1D12A int not_really__the_length = str.length(); // value is 2, which is not the length in characters int actual_length = str.codePointCount(0, str.length()); // value is 1, which is the length in characters [edit] Grapheme Length import java.text.BreakIterator; public class Grapheme { public static void main(String[] args) { printLength("møøse"); printLength("𝔘𝔫𝔦𝔠𝔬𝔡𝔢"); printLength("J̲o̲s̲é̲"); } public static void printLength(String s) { BreakIterator it = BreakIterator.getCharacterInstance(); it.setText(s); int count = 0; while (it.next() != BreakIterator.DONE) { count++; } System.out.println("Grapheme length: " + count+ " " + s); } } Output: Grapheme length: 5 møøse Grapheme length: 7 𝔘𝔫𝔦𝔠𝔬𝔡𝔢 Grapheme length: 4 J̲o̲s̲é̲ [edit] JavaScript [edit] Byte Length JavaScript encodes strings in UTF-16, which represents each character with one or two 16-bit values. The length property of string objects gives the number of 16-bit values used to encode a string, so the number of bytes can be determined by doubling that number. var s = "Hello, world!"; var byteCount = s.length * 2; //26 [edit] Character Length JavaScript encodes strings in UTF-16, which represents each character with one or two 16-bit values. The most commonly used characters are represented by one 16-bit value, while rarer ones like some mathematical symbols are represented by two. JavaScript has no built-in way to determine how many characters are in a string. However, if the string only contains commonly used characters, the number of characters will be equal to the number of 16-bit values used to represent the characters. var str1 = "Hello, world!"; var len1 = str1.length; //13 var str2 = "\uD834\uDD2A"; //U+1D12A represented by a UTF-16 surrogate pair var len2 = str2.length; //2 [edit] jq jq strings are JSON strings and are therefore encoded as UTF-8. When given a JSON string, the length filter emits the number of Unicode codepoints that it contains: $ cat String_length.jq def describe: "length of \(.) is \(length)"; ("J̲o̲s̲é̲", "𝔘𝔫𝔦𝔠𝔬𝔡𝔢") | describe $ jq -n -f String_length.jq "length of J̲o̲s̲é̲ is 8" "length of 𝔘𝔫𝔦𝔠𝔬𝔡𝔢 is 7" [edit] Julia Julia encodes strings as UTF-8, so the byte length (via sizeof) will be different from the string length (via length) only if the string contains non-ASCII characters. [edit] Byte Length sizeof("Hello, world!") # gives 13 sizeof("Hellö, wørld!") # gives 15 [edit] Character Length length("Hello, world!") # gives 13 length("Hellö, wørld!") # gives 13 [edit] JudoScript [edit] Byte Length //Store length of hello world in length and print it . length = "Hello World".length(); [edit] Character Length //Store length of hello world in length and print it . length = "Hello World".length() [edit] LabVIEW [edit] Byte Length LabVIEW is using a special variant of UTF-8, so byte length == character length. [edit] Character Length [edit] Lasso [edit] Character Length 'Hello, world!'->size // 13 'møøse'->size // 5 '𝔘𝔫𝔦𝔠𝔬𝔡𝔢'->size // 7 [edit] Byte Length 'Hello, world!'->asBytes->size // 13 'møøse'->asBytes->size // 7 '𝔘𝔫𝔦𝔠𝔬𝔡𝔢'->asBytes->size // 28 [edit] LFE [edit] Character Length (length "ASCII text") 10 (length "𝔘𝔫𝔦𝔠𝔬𝔡𝔢 𝔗𝔢𝒙𝔱") 12 > ...) > (length (unicode:characters_to_list encoded 'utf8)) 12 [edit] Byte Length > ...) > (byte_size encoded) 45 > (set bytes (binary ("𝔘𝔫𝔦𝔠𝔬𝔡𝔢 𝔗𝔢𝒙𝔱"))) #B(24 43 38 32 44 33 34 32 23 34 153 49) > (byte_size bytes) 12 > (set encoded (binary ("ASCII text" utf8))) #B(65 83 67 73 73 32 116 101 120 116) > (byte_size encoded) 10 [edit] Liberty BASIC See BASIC [edit] Logo Logo is so old that only ASCII encoding is supported. Modern versions of Logo may have enhanced character set support. print count "|Hello World| ; 11 print count "møøse ; 5 print char 248 ; ø - implies ISO-Latin character set [edit] LSE64 [edit] Byte Length LSE stores strings as arrays of characters in 64-bit cells plus a count. " Hello world" @ 1 + 8 * , # 96 = (11+1)*(size of a cell) = 12*8 [edit] Character Length LSE uses counted strings: arrays of characters, where the first cell contains the number of characters in the string. " Hello world" @ , # 11 [edit] Lua In Lua, a character is always the size of one byte so there is no difference between byte length and character length. [edit] Byte Length str = "Hello world" length = #str or str = "Hello world" length = string.len(str) [edit] Character Length str = "Hello world" length = #str or str = "Hello world" length = string.len(str) [edit] Maple [edit] Character length length("Hello world"); [edit] Byte count nops(convert("Hello world",bytes)); [edit] Mathematica [edit] Character length StringLength["Hello world"] [edit] Byte length StringByteCount["Hello world"] [edit] MATLAB [edit] Character Length >> length('møøse') ans = 5 [edit] Byte Length MATLAB apparently encodes strings using UTF-16. >> numel(dec2hex('møøse')) ans = 10 [edit] Maxima s: "the quick brown fox jumps over the lazy dog"; slength(s); /* 43 */ [edit] MAXScript [edit] Character Length "Hello world".count [edit] Mercury Mercury's C and Erlang backends use UTF-8 encoded strings; the Java and C# backends using the underlying UTF-16 encoding of those languages. The function string.length/1 returns the number of code units in a string in target language encoding. The function string.count_utf8_code_units/1 returns the number of UTF-8 code units in a string regardless of the target language. [edit] Byte Length :- module string_byteBytes = count_utf8_code_units(String), io.format("%s: %d bytes\n", [s(String), i(NumBytes)], !IO). Output: møøse: 7 bytes 𝔘𝔫𝔦𝔠𝔬𝔡𝔢: 28 bytes J̲o̲s̲é̲: 14 bytes [edit] Character Length The function string.count_codepoints/1 returns the number of code points in a string. :- module string_characterChars = count_codepoints(String), io.format("%s: %d characters\n", [s(String), i(NumChars)], !IO). Output: møøse: 5 characters 𝔘𝔫𝔦𝔠𝔬𝔡𝔢: 7 characters J̲o̲s̲é̲: 9 characters [edit] Metafont Metafont has no way of handling properly encodings different from ASCII. So it is able to count only the number of bytes in a string. string s; s := "Hello Moose"; show length(s); % 11 (ok) s := "Hello Møøse"; show length(s); % 13 (number of bytes when the string is UTF-8 encoded, % since ø takes two bytes) Note: in the lang tag, Møøse is Latin1-reencoded, showing up two bytes (as Latin1) instead of one [edit] mIRC Scripting Language [edit] Byte Length alias stringlength { echo -a Your Name is: $len($$?="Whats your name") letters long! } [edit] Character Length $utfdecode() converts an UTF-8 string to the locale encoding, with unrepresentable characters as question marks. Since mIRC is not yet fully Unicode aware, entering Unicode text trough a dialog box will automatically convert it to ASCII. alias utf8len { return $len($utfdecode($1)) } alias stringlength2 { var %name = Børje echo -a %name is: $utf8len(%name) characters long! } [edit] Modula-3 [edit] Byte Length MODULE ByteLength EXPORTS Main; IMPORT IO, Fmt, Text; VAR s: TEXT := "Foo bar baz"; BEGIN IO.Put("Byte length of s: " & Fmt.Int((Text.Length(s) * BYTESIZE(s))) & "\n"); END ByteLength. [edit] Character Length MODULE StringLength EXPORTS Main; IMPORT IO, Fmt, Text; VAR s: TEXT := "Foo bar baz"; BEGIN IO.Put("String length of s: " & Fmt.Int(Text.Length(s)) & "\n"); END StringLength. [edit] NewLISP [edit] Character Length (set 'Str "møøse") (println Str " is " (length Str) " characters long") [edit] Nemerle Both examples rely on .Net faculties, so they're almost identical to C# [edit] Character Length def message = "How long am I anyways?"; def charlength = message.Length; [edit] Byte Length using System.Text; def message = "How long am I anyways?"; def bytelength = Encoding.Unicode.GetByteCount(message); [edit] Nim [edit] Byte Length var s: string = "Hello, world! ☺" echo '"',s, '"'," has byte length: ", len(s) # -> "Hello, world! ☺" has unicode char length: 17 [edit] Character Length import unicode var s: string = "Hello, world! ☺" echo '"',s, '"'," has unicode char length: ", runeLen(s) # -> "Hello, world! ☺" has unicode char length: 15 [edit] Oberon-2 [edit] Byte Length MODULE Size; IMPORT Out; VAR s: LONGINT; string: ARRAY 5 OF CHAR; BEGIN string := "Foo"; s := LEN(string); Out.String("Size: "); Out.LongInt(s,0); Out.Ln; END Size. Output: Size: 5 [edit] Character Length MODULE Length; IMPORT Out, Strings; VAR l: INTEGER; string: ARRAY 5 OF CHAR; BEGIN string := "Foo"; l := Strings.Length(string); Out.String("Length: "); Out.Int(l,0); Out.Ln; END Length. Output: Length: 3 [edit] Objective-C In order to be not ambiguous about the encoding used in the string, we explicitly provide it in UTF-8 encoding. The string is "møøse" (ø UTF-8 encoded is in hexadecimal C3 B8). [edit] Character Length Objective-C encodes strings in UTF-16, which represents each character (code point) with one or two 16-bit code units. This is a variable-length encoding scheme. The most commonly used characters are represented by one 16-bit code unit, while "supplementary characters" are represented by two (called a "surrogate pair"). The length method of NSString objects is not the length of that string in characters. Instead, it only gives the number of 16-bit code units used to encode a string. This is not (always) the number of Unicode characters (code points) in the string. // Return the length in characters // XXX: does not (always) count Unicode characters (code points)! unsigned int numberOfCharacters = [@"møøse" length]; // 5 Since Mac OS X 10.6, CFString has methods for converting between supplementary characters and surrogate pair. However, the easiest way to get the number of characters is probably to encode it in UTF-32 (which is a fixed-length encoding) and divide by 4: int realCharacterCount = [s lengthOfBytesUsingEncoding: NSUTF32StringEncoding] / 4; [edit] Byte Length Objective-C encodes strings in UTF-16, which represents each character with one or two 16-bit values. The length method of NSString objects returns the number of 16-bit values used to encode a string, so the number of bytes can be determined by doubling that number. int byteCount = [@"møøse" length] * 2; // 10 Another way to know the byte length of a string is to explicitly specify the charset we desire. // Return the number of bytes depending on the encoding, // here explicitly UTF-8 unsigned numberOfBytes = [@"møøse" lengthOfBytesUsingEncoding: NSUTF8StringEncoding]; // 7 [edit] Objeck All character string elements are 1-byte in size therefore a string's byte size and length are the same. [edit] Character Length "Foo"->Size()->PrintLine(); [edit] Byte Length "Foo"->Size()->PrintLine(); [edit] OCaml In OCaml currently, characters inside the standard type string are bytes, and a single character taken alone has the same binary representation as the OCaml int (which is equivalent to a C long) which is a machine word. For internationalization there is Camomile, a comprehensive Unicode library for OCaml. Camomile provides Unicode character type, UTF-8, UTF-16, and more... [edit] Byte Length Standard OCaml strings are classic ASCII ISO 8859-1, so the function String.length returns the byte length which is the character length in this encoding: String.length "Hello world" ;; [edit] Character Length While using the UTF8 module of Camomile the byte length of an utf8 encoded string will be get with String.length and the character length will be returned by UTF8.length: String.length "møøse" UTF8.length "møøse" [edit] Octave s = "string"; stringlen = length(s) This gives the number of bytes, not of characters. e.g. length("è") is 2 when "è" is encoded e.g. as UTF-8. [edit] Oforth Oforth strings are UTF8 encoded. size method returns number of UTF8 characters into a string basicSize method returns number of bytes into a string [edit] OpenEdge/Progress The codepage can be set independently for input / output and internal operations. The following examples are started from an iso8859-1 session and therefore need to use fix-codepage to adjust the string to utf-8. [edit] Character Length DEF VAR lcc AS LONGCHAR. FIX-CODEPAGE( lcc ) = "UTF-8". lcc = "møøse". MESSAGE LENGTH( lcc ) VIEW-AS ALERT-BOX. [edit] Byte Length DEF VAR lcc AS LONGCHAR. FIX-CODEPAGE( lcc ) = "UTF-8". lcc = "møøse". MESSAGE LENGTH( lcc, "RAW" ) VIEW-AS ALERT-BOX. [edit] Oz [edit] Byte Length {Show {Length "Hello World"}} Oz uses a single-byte encoding by default. So for normal strings, this will also show the correct character length. [edit] PARI/GP [edit] Character Length Characters = bytes in Pari; the underlying strings are C strings interpreted as US-ASCII. len(s)=#s; \\ Alternately, len(s)=length(s); or even len=length; [edit] Byte Length This works on objects of any sort, not just strings, and includes overhead. len(s)=sizebyte(s); [edit] Pascal [edit] Byte Length const s = 'abcdef'; begin writeln (length(s)) end. Output: 6 [edit] Perl [edit] Byte Length Strings in Perl consist of characters. Measuring the byte length therefore requires conversion to some binary representation (called encoding, both noun and verb). use utf8; # so we can use literal characters like ☺ in source use Encode qw(encode); print length encode 'UTF-8', "Hello, world! ☺"; # 17. The last character takes 3 bytes, the others 1 byte each. print length encode 'UTF-16', "Hello, world! ☺"; # 32. 2 bytes for the BOM, then 15 byte pairs for each character. [edit] Character Length my $length = length "Hello, world!"; [edit] Grapheme Length Since Perl 5.12, /\X/ matches an extended grapheme cluster. See "Unicode overhaul" in perl5120delta and also UAX #29. Perl understands that "\x{1112}\x{1161}\x{11ab}\x{1100}\x{1173}\x{11af}" (한글) contains 2 graphemes, just like "\x{d55c}\x{ae00}" (한글). The longer string uses Korean combining jamo characters. use v5.12; my $string = "\x{1112}\x{1161}\x{11ab}\x{1100}\x{1173}\x{11af}"; # 한글 my $len; $len++ while ($string =~ /\X/g); printf "Grapheme length: %d\n", $len; - Output: Grapheme length: 2 [edit] Perl 6 [edit] Byte Length say 'møøse'.encode('UTF-8').bytes; [edit] Character Length say 'møøse'.codes; [edit] Grapheme Length say 'møøse'.chars; [edit] Phix As yet there is no offical support for character-wise processing of unicode strings, but there is some incomplete code knocking about somewhere (I think the file is unicode.e). [edit] Byte Length constant s = "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" ?length(s) - Output: 28 [edit] PHP Program in a UTF8 linux: <?php foreach (array('møøse', '𝔘𝔫𝔦𝔠𝔬𝔡𝔢', 'J̲o̲s̲é̲') as $s1) { printf('String "%s" measured with strlen: %d mb_strlen: %s grapheme_strlen %s%s', $s1, strlen($s1),mb_strlen($s1), grapheme_strlen($s1), PHP_EOL); } yields the result: String "møøse" measured with strlen: 7 mb_strlen: 7 grapheme_strlen 5 String "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" measured with strlen: 28 mb_strlen: 28 grapheme_strlen 7 String "J̲o̲s̲é̲" measured with strlen: 13 mb_strlen: 13 grapheme_strlen 4 [edit] PicoLisp (let Str "møøse" (prinl "Character Length of \"" Str "\" is " (length Str)) (prinl "Byte Length of \"" Str "\" is " (size Str)) ) Output: Character Length of "møøse" is 5 Byte Length of "møøse" is 7 -> 7 [edit] PL/I declare WS widechar (13) initial ('Hello world.'); put ('Character length=', length (WS)); put skip list ('Byte length=', size(WS)); declare SM graphic (13) initial ('Hello world'); put ('Character length=', length(SM)); put skip list ('Byte length=', size(trim(SM))); [edit] PL/SQL LENGTH calculates length using characters as defined by the input character set. LENGTHB uses bytes instead of characters. LENGTHC uses Unicode complete characters. LENGTH2 uses UCS2 code points. LENGTH4 uses UCS4 code points. [edit] Byte Length DECLARE string VARCHAR2(50) := 'Hello, world!'; stringlength NUMBER; BEGIN stringlength := LENGTHB(string); END; [edit] Character Length DECLARE string VARCHAR2(50) := 'Hello, world!'; stringlength NUMBER; unicodelength NUMBER; ucs2length NUMBER; ucs4length NUMBER; BEGIN stringlength := LENGTH(string); unicodelength := LENGTHC(string); ucs2length := LENGTH2(string); ucs4length := LENGTH4(string); END; [edit] Pop11 [edit] Byte Length Currently Pop11 supports only strings consisting of 1-byte units. Strings can carry arbitrary binary data, so user can for example use UTF-8 (however builtin procedures will treat each byte as a single character). The length function for strings returns length in bytes: lvars str = 'Hello, world!'; lvars len = length(str); [edit] PostScript [edit] Character Length (Hello World) length = 11 [edit] PowerShell [edit] Character Length $s = "Hëlló Wørłð" $s.Length [edit] Byte Length For UTF-16, which is the default in .NET and therefore PowerShell: $s = "Hëlló Wørłð" [System.Text.Encoding]::Unicode.GetByteCount($s) For UTF-8: [System.Text.Encoding]::UTF8.GetByteCount($s) [edit] PureBasic [edit] Character Length a = Len("Hello World") ;a will be 11 [edit] Byte Length Returns the number of bytes required to store the string in memory in the given format in bytes. 'Format' can be #PB_Ascii, #PB_UTF8 or #PB_Unicode. PureBasic code can be compiled using either Unicode (2-byte) or Ascii (1-byte) encodings for strings. If 'Format' is not specified, the mode of the executable (unicode or ascii) is used. Note: The number of bytes returned does not include the terminating Null-Character of the string. The size of the Null-Character is 1 byte for Ascii and UTF8 mode and 2 bytes for Unicode mode. a = StringByteLength("ä", #PB_UTF8) ;a will be 2 b = StringByteLength("ä", #PB_Ascii) ;b will be 1 c = StringByteLength("ä", #PB_Unicode) ;c will be 2 [edit] Python [edit] 2.x In Python 2.x, there are two types of strings: regular (8-bit) strings, and Unicode strings. Unicode string literals are prefixed with "u". [edit] Byte Length For 8-bit strings, the byte length is the same as the character length: print len('ascii') # 5 For Unicode strings, length depends on the internal encoding. Since version 2.2 Python shipped with two build options: it either uses 2 or 4 bytes per character. The internal representation is not interesting for the user. # The letter Alef print len(u'\u05d0'.encode('utf-8')) # 2 print len(u'\u05d0'.encode('iso-8859-8')) # 1 Example from the problem statement: #!/bin/env python # -*- coding: UTF-8 -*- s =). [edit] Character Length len() returns the number of code units (not code points!) in a Unicode string or plain ASCII string. On a wide build, this is the same as the number of code points, but on a narrow one it is not. Most linux distributions install the wide build by default, you can check the build at runtime with: import sys sys.maxunicode # 1114111 on a wide build, 65535 on a narrow build To get the length of encoded string, you have to decode it first: print len('ascii') # 5 print len(u'\u05d0') # the letter Alef as unicode literal # 1 print len('\xd7\x90'.decode('utf-8')) # Same encoded as utf-8 string #] 3.x In Python 3.x, strings are Unicode strings and a bytes type if available for storing an immutable sequence of bytes (there's also available a bytearray type, which is mutable) [edit] Byte Length You can use len() to get the length of a byte sequence. print(len(b'Hello, World!')) # 13 To get a byte sequence from a string, you have to encode it with the desired encoding: # The letter Alef print(len('\u05d0'.encode())) # the default encoding is utf-8 in Python3 # 2 print(len('\u05d0'.encode('iso-8859-8'))) # 1 Example from the problem statement: #!/bin/env python # -*- coding: UTF-8 -*-). u="𝔘𝔫𝔦𝔠𝔬𝔡𝔢" assert len(u.encode()) == 28 assert len(u.encode('UTF-16-BE')) == 28 [edit] Character Length Since Python3.3 the internal storage of unicode strings has been optimized: strings that don't contain characters outside the latin-1 set, are stored with 8 bits for each character, strings that don't contain codepoints outside the BMP (lone surrogates aren't allowed) are stored as UCS-2, while all the others use UCS-4. Thus Python is able to avoid memory overhead when dealing with only ASCII strings, while handling correctly all codepoints in Unicode. len() returns the number of characters/codepoints: print(len("𝔘𝔫𝔦𝔠𝔬𝔡𝔢")) # 7 Until Python 3.2 instead, length depended on the internal encoding, since it shipped with two build options: it either used 2 or 4 bytes per character. len() returned the number of code units in a string, which could be different from the number of characters. In a narrow build, this is not a reliable way to get the number of characters. You can only easily count code points in a wide build. Most linux distributions install the wide build by default, you can check the build at runtime with: import sys sys.maxunicode # 1114111 on a wide build, 65535 on a narrow build print(len('ascii')) # 5 print(len('\u05d0')) # the letter Alef as unicode literal # 1 To get the length of an encoded byte sequence, you have to decode it first: print(len(b'\xd7\x90'.decode('utf-8'))) # Alef encoded as utf-8 byte sequence #] R [edit] Byte length a <- "m\u00f8\u00f8se" print(nchar(a, type="bytes")) # print 7 [edit] Character length print(nchar(a, type="chars")) # print 5 [edit] Racket Using this definition: (define str "J\u0332o\u0332s\u0332e\u0301\u0332") on the REPL, we get the following: [edit] Character length -> (printf "str has ~a characters" (string-length str)) str has 9 characters [edit] Byte length -> (printf "str has ~a bytes in utf-8" (bytes-length (string->bytes/utf-8 str))) str has 14 bytes in utf-8 [edit] REBOL [edit] Byte Length REBOL 2.x does not natively support UCS (Unicode), so character and byte length are the same. See utf-8.r for an external UTF-8 library. text: "møøse" print rejoin ["Byte length for '" text "': " length? text] Output: Byte length for 'møøse': 5 [edit] Retro [edit] Byte Length "møøse" getLength putn [edit] Character Length Retro does not have built-in support for Unicode, but counting of characters can be done with a small amount of effort. chain: UTF8' {{ : utf+ ( $-$ ) [ 1+ dup @ %11000000 and %10000000 = ] while ; : count ( $-$ ) 0 !here repeat dup @ 0; drop utf+ here ++ again ; ---reveal--- : getLength ( $-n ) count drop @here ; }} ;chain "møøse" ^UTF8'getLength putn [edit] REXX Classic REXX don't support Unicodes, so character and byte length are the same. All characters (in strings) are stored as 8-bit bytes. Indeed, everything in REXX is stored as strings. [edit] Byte Length /*REXX program to show lengths (in bytes/characters) for various strings*/ /* 1 */ /*a handy over/under scale.*/ /* 123456789012345 */ hello = 'Hello, world!' ; say 'length of HELLO is ' length(hello) happy = 'Hello, world! ☺' ; say 'length of HAPPY is ' length(happy) jose = 'José' ; say 'length of JOSE is ' length(jose) nill = '' ; say 'length of NILL is ' length(nill) null = ; say 'length of NULL is ' length(null) sum = 5+1 ; say 'length of SUM is ' length(sum) /*stick a fork in it, we're done.*/ output length of HELLO is 13 length of HAPPY is 15 length of JOSE is 4 length of NILL is 0 length of NULL is 0 length of SUM is 1 [edit] Ruby [edit] Byte Length Since Ruby 1.8.7, String#bytesize is the byte length. # -*- coding: utf-8 -*- puts "あいうえお".bytesize # => 15 [edit] Character Length Since Ruby 1.9, String#length (alias String#size) is the character length. The magic comment, "coding: utf-8", sets the encoding of all string literals in this file. # -*- coding: utf-8 -*- puts "あいうえお".length # => 5 puts "あいうえお".size # alias for length # => 5 [edit] Code Set Independence The next examples show the byte length and character length of "møøse" in different encodings. To run these programs, you must convert them to different encodings. [edit] Ruby 1.8 The next example works with both Ruby 1.8 and Ruby 1.9. In Ruby 1.8, the strings have no encodings, and String#length is the byte length. In Ruby 1.8, the regular expressions knows three Japanese encodings. /./nuses no multibyte encoding. /./euses EUC-JP. /./suses Shift-JIS or Windows-31J. /./uuses UTF-8. Then either string.scan(/./u).size or string.gsub(/./u, ' ').size counts the UTF-8 characters in string. # -*- coding: utf-8 -*- class String # Define String#bytesize for Ruby 1.8.6. unless method_defined?(:bytesize) alias bytesize length end end s = "文字化け" puts "Byte length: %d" % s.bytesize puts "Character length: %d" % s.gsub(/./u, ' ').size [edit] Run BASIC input a$ print len(a$) [edit] SAS data _null_; a="Hello, World!"; b=length(c); put _all_; run; [edit] Scheme [edit] Byte Length string-size function is only Gauche function. (string-size "Hello world") (bytes-length #"Hello world") [edit] Character Length string-length function is in R5RS, R6RS. (string-length "Hello world") [edit] Seed7 [edit] Character Length length("Hello, world!") [edit] SETL [edit] Character Length print(# "Hello, world!"); -- '#' is the cardinality operator. Works on strings, tuples, and sets. [edit] Sidef var str = "J\x{332}o\x{332}s\x{332}e\x{301}\x{332}"; [edit] Byte Length UTF-8 byte length (default): say str.bytes.len; #=> 14 UTF-16 byte length: say str.encode('UTF-16').bytes.len; #=> 20 [edit] Character Length say str.chars.len; #=> 9 [edit] Grapheme Length say str.graphs.len; #=> 4 [edit] Scala object StringLength extends App { val s1 = "møøse" val s3 = List("\uD835\uDD18", "\uD835\uDD2B", "\uD835\uDD26", "\uD835\uDD20", "\uD835\uDD2C", "\uD835\uDD21", "\uD835\uDD22").mkString val s4 = "J\u0332o\u0332s\u0332e\u0301\u0332" List(s1, s3, s4).foreach(s => println( s"The string: $s, characterlength= ${s.length} UTF8bytes= ${ s.getBytes("UTF-8").size } UTF16bytes= ${s.getBytes("UTF-16LE").size}")) } - Output: The string: møøse, characterlength= 5 UTF8bytes= 7 UTF16bytes= 10 The string: 𝔘𝔫𝔦𝔠𝔬𝔡𝔢, characterlength= 14 UTF8bytes= 28 UTF16bytes= 28 The string: J̲o̲s̲é̲, characterlength= 9 UTF8bytes= 14 UTF16bytes= 18 [edit] Slate 'Hello, world!' length. [edit] Smalltalk [edit] Byte Length string := 'Hello, world!'. string size. [edit] Character Length In GNU Smalltalk: string := 'Hello, world!'. string numberOfCharacters. requires loading the Iconv package: PackageLoader fileInPackage: 'Iconv' [edit] SNOBOL4 [edit] Byte Length output = "Byte length: " size(trim(input)) end [edit] Character Length The example works AFAIK only with CSnobol4 by Phil Budne -include "utf.sno" output = "Char length: " utfsize(trim(input)) end [edit] Sparkling [edit] Byte length spn:1> sizeof "Hello, wørld!" = 14 [edit] SQL [edit] Byte length SELECT LENGTH(CAST('møøse' AS BLOB)); [edit] Character length SELECT LENGTH('møøse'); [edit] Standard ML [edit] Byte Length val strlen = size "Hello, world!"; [edit] Character Length val strlen = UTF8.size "Hello, world!"; [edit] Swift [edit] Grapheme Length Swift has a concept of "character" that goes beyond Unicode code points. A Character is a "Unicode grapheme cluster", which can consist of one or more Unicode code points. To count "characters" (Unicode grapheme clusters): let numberOfCharacters = "møøse".characters.count // 5 let numberOfCharacters = count("møøse") // 5 let numberOfCharacters = countElements("møøse") // 5 [edit] Character Length To count Unicode code points: let numberOfCodePoints = "møøse".unicodeScalars.count // 5 let numberOfCodePoints = count("møøse".unicodeScalars) // 5 let numberOfCodePoints = countElements("møøse".unicodeScalars) // 5 [edit] Byte Length This depends on which encoding you want to use. For length in UTF-8, count the number of UTF-8 code units: let numberOfBytesUTF8 = "møøse".utf8.count // 7 let numberOfBytesUTF8 = count("møøse".utf8) // 7 let numberOfBytesUTF8 = countElements("møøse".utf8) // 7 For length in UTF-16, count the number of UTF-16 code units, and multiply by 2: let numberOfBytesUTF16 = "møøse".utf16.count * 2 // 10 let numberOfBytesUTF16 = count("møøse".utf16) * 2 // 10 let numberOfBytesUTF16 = countElements("møøse".utf16) * 2 // 10 [edit] Tcl [edit] Byte Length Formally, Tcl does not guarantee to use any particular representation for its strings internally (the underlying implementation objects can hold strings in at least three different formats, mutating between them as necessary) so the way to calculate the "byte length" of a string can only be done with respect to some user-selected encoding. This is done this way (for UTF-8): string length [encoding convertto utf-8 $theString] Thus, we have these examples: set s1 "hello, world" set s2 "\u304A\u306F\u3088\u3046" set enc utf-8 puts [format "length of \"%s\" in bytes is %d" \ $s1 [string length [encoding convertto $enc $s1]]] puts [format "length of \"%s\" in bytes is %d" \ $s2 [string length [encoding convertto $enc $s2]]] [edit] Character Length Basic version: string length "Hello, world!" or more elaborately, needs Interpreter any 8.X. Tested on 8.4.12. fconfigure stdout -encoding utf-8; #So that Unicode string will print correctly set s1 "hello, world" set s2 "\u304A\u306F\u3088\u3046" puts [format "length of \"%s\" in characters is %d" $s1 [string length $s1]] puts [format "length of \"%s\" in characters is %d" $s2 [string length $s2]] [edit] TI-89 BASIC The TI-89 uses an fixed 8-bit encoding so there is no difference between character length and byte length. ■ dim("møøse") 5 [edit] Toka [edit] Byte Length " hello, world!" string.getLength [edit] Trith [edit] Character Length "møøse" length [edit] Byte Length "møøse" size [edit] TUSCRIPT [edit] Character Length $$ MODE TUSCRIPT string="hello, world" l=LENGTH (string) PRINT "character length of string '",string,"': ",l Output: Character length of string 'hello, world': 12 [edit] UNIX Shell [edit] Byte Length [edit] With external utility: string='Hello, world!' length=`expr "x$string" : '.*' - 1` echo $length # if you want it printed to the terminal [edit] With SUSv3 parameter expansion modifier: string='Hello, world!' length="${#string}" echo $length # if you want it printed to the terminal [edit] Vala [edit] Character Length string s = "Hello, world!"; int characterLength = s.length; [edit] VBA Cf. VBScript (below). [edit] VBScript [edit] Byte Length LenB(string|varname) Returns the number of bytes required to store a string in memory. Returns null if string|varname is null. [edit] Character Length Len(string|varname) Returns the length of the string|varname . Returns null if string|varname is null. [edit] x86 Assembly [edit] Byte Length The following code uses AT&T syntax and was tested using AS (the portable GNU assembler) under Linux. .data string: .asciz "Test" .text .globl main main: pushl %ebp movl %esp, %ebp pushl %edi xorb %al, %al movl $-1, %ecx movl $string, %edi cld repne scasb not %ecx dec %ecx popl %edi ;; string length is stored in %ecx register leave ret [edit] XPL0 include c:\cxpl\stdlib; IntOut(0, StrLen("Character length = Byte length = String length = ")) Output: 49 [edit] XSLT [edit] Character Length <?xml version="1.0" encoding="UTF-8"?> ... <xsl:value-of <!-- 5 --> [edit] xTalk [edit] Byte Length put the length of "Hello World" or put the number of characters in "Hello World" [edit] Character Length put the length of "Hello World" or put the number of characters in "Hello World" [edit] Yorick [edit] Character Length strlen("Hello, world!") [edit] zkl Although zkl handles 8 bit ASCII natively, it also knows UTF-8 up to 6 bytes. In a string, "\uabcd" (hex) and "\U???;" encode 2 and n byte UTF-8 Unicode characters. It does not handle UTF-16 or 4 byte Unicode. It also knows about the bad spots in UTF-8 (such as overlongs). If your terminal/editor deals with UTF-8 (mine doesn't), you don't need to use the escapes, just put the unicode characters in quotes (ie the editor inserts UTF bytes, which are non zero). [edit] Character Length "abc".len() //-->3 "\ufeff\u00A2 \u20ac".len() //-->9 "BOM¢ €" [edit] Byte Length "abc".len() //-->3 "\ufeff\u00A2 \u20ac".len() //-->9 Data(0,Int,"\ufeff\u00A2 \u20ac") //-->Data(9) (bytes) "J\u0332o\u0332s\u0332e\u0301\u0332".len() //-->14 "\U1D518;\U1D52B;\U1D526;\U1D520;\U1D52C;\U1D521;\U1D522;".len() //-->28 [edit] Character Length UTF-8 characters are counted, modifiers (such as underscore) are counted as separate characters. "abc".len(8) //-->3 "\ufeff\u00A2 \u20ac".len(8) //-->4 "BOM¢ €" "\U1000;".len(8) //-->Exception thrown: ValueError(Invalid UTF-8 string) "\uD800" //-->SyntaxError : Line 2: Bad Unicode constant (\uD800-\uDFFF) "J\u0332o\u0332s\u0332e\u0301\u0332".len(8) //-->9 "J̲o̲s̲é̲" "\U1D518;\U1D52B;\U1D526;\U1D520;\U1D52C;\U1D521;\U1D522;".len(8) //-->7 "𝔘𝔫𝔦𝔠𝔬𝔡𝔢" - Programming Tasks - Basic language learning - String manipulation - GUISS/Omit - Openscad/Omit - 4D - ActionScript - Ada - Aime - ALGOL 68 - AppleScript - Applesoft BASIC - AutoHotkey - AWK - Axe - Batch File - BASIC - ZX Spectrum Basic - BBC BASIC - Bracmat - C - C++ - C sharp - Clean - Clojure - COBOL - ColdFusion - Common Lisp - Component Pascal - D - Dc - Déjà Vu - E - Elixir - Emacs Lisp - Erlang - Euphoria - F Sharp - Factor - Fantom - Forth - GAP - Gnuplot - Go - Groovy - GW-BASIC - Haskell - HicEst - Icon - Unicon - IDL - IDL examples needing attention - Examples needing attention - Io - J - Java - JavaScript - Jq - Julia - JudoScript - JudoScript examples needing attention - LabVIEW - Lasso - LFE - Liberty BASIC - Logo - LSE64 - Lua - Maple - Mathematica - MATLAB - Maxima - MAXScript - Mercury - Metafont - MIRC Scripting Language - MIRC Scripting Language examples needing attention - Modula-3 - NewLISP - Nemerle - Nim - Oberon-2 - Objective-C - Objeck - OCaml - Octave - Oforth - OpenEdge/Progress - Oz - PARI/GP - Pascal - Perl - Perl 6 - Phix - PHP - PicoLisp - PL/I - PL/SQL - Pop11 - PostScript - PowerShell - PureBasic - Python - R - Racket - REBOL - Retro - REXX - Ruby - Run BASIC - SAS - Scheme - Seed7 - SETL - Sidef - Scala - Slate - Smalltalk - SNOBOL4 - Sparkling - SQL - Standard ML - Swift - Tcl - TI-89 BASIC - Toka - Trith - TUSCRIPT - UNIX Shell - Vala - VBA - VBScript - X86 Assembly - XPL0 - XSLT - XTalk - XTalk examples needing attention - Yorick - Zkl
http://rosettacode.org/wiki/String_length
CC-MAIN-2015-48
refinedweb
10,082
64
Polar Humenn wrote: > > Hi Andrea, > > Could you please elaborate the changes that you made to http-conf.xsd? > I'm working on that as well. > > Did you commit changes already? Hi Polar, URL: Log: [JIRA CXF-674] for conduit and destination in namespace: bean types extends beans:identifiedType. As JAXB mappings of these classes were never used prevented code from being generated by splitting http-conf.xsd into two files (both with same target namespace) - only one to be processed by xjc. Check cxf-commits for the exact diffs in that revision. I have not changed the namespace for the schema, just the URI(s). Andrea. > > Cheers, > =Polar > > Andrea Smyth wrote: > >> Dan Diephouse wrote: >> >>> On 6/4/07, Andrea Smyth <andrea.smyth@iona.com> wrote: >>> >>>> >>>> Dan Diephouse wrote: >>>> >>>> > Hi Andrea, >>>> > >>>> > Just had one minor piece of feedback on your commit to change the >>>> > Schema locations. Would you be OK with changing the schema locations >>>> > to something like: >>>> > >>>> > >>>> > >>>> > instead of >>>> > >>>> > >>>> > >>>> > While I like the symmetry between the classpath and the schema >>>> > location, I see a couple issues: >>>> >>>> > 1. /wsdl/ shouldn't really be in the URI for a spring schema >>>> > 2. -conf is kind of redundant >>>> >>>> I agree with you on the naming - it's quite awful, and there are >>>> way too >>>> many namespaces (but that's another issue). >>>> For now, I would like to use URIs that can a) be derived very simply >>>> from other information that we have (i.e. their actual location in the >>>> trunk) and b) where the underlying schema can potentially be made >>>> available on the web. See wiki page >>>> I started >>>> on that, and on which I want to complete the table. >>>> If someone wants to change the URI for one schema, name and >>>> location of >>>> the schema should be changed at the same time to avoid confusion - >>>> after >>>> all the latter is the least work. The real pain is in updating >>>> references in schemaLocation attributes, not just on cfg files but in >>>> other schemas and catalog files as well. >>> >>> >>> >>> >>> Yeah, I like how the locations are symettric with the classpath >>> locations. I >>> think I'd just like to move our schemas from the schemas/wsdl >>> directories to >>> the schemas/ directory. I can go ahead and do that if its ok with you. >> >> >> Sure, go ahead. >> But remember that (because neither JMS not HTTP beans inherit from >> JAXB generated code), I have split the http-conf.xsd and jms.xsd into >> two schema files - one located in schemas/wsdl as before and the >> split off part in schemas/configuration. No code is generated from >> the latter, and both parts have same target namespace. For valid >> spring cfg files you only need to specify the schemaLocation the >> latter in the cfg files schemaLocation attribute (Spring pulls in the >> included schemas if necessary). >> >> Andrea. >> >>> >>>> 3. I think it might be good to have the version # as we previously >>>> > discussed in the location. Lets say we change the namespace in our >>>> > schema for 2.1, then we effectively need to host two schemas at the >>>> > same location with the current location URI. >>>> >>>> What about redirecton as I suggested in an earlier mail? >>>> "For reasons outlined below I tend towards not using a version >>>> number in >>>> the URI, but instead adopt the convention that >>>> contains the schemas for version x.y >>>> and that directs to the current >>>> version. " >>>> >>>> Unless we maintain versions of schemas, bean definition parsers >>>> etc. in >>>> one product version, and IMO this is a real pain, many cfg files >>>> become >>>> unnecessarily invalid.\ >>> >>> >>> >>> >>> >>> OK, I see now what you were proposing - I misunderstood before. Once >>> we move >>> to 2.1 we can copy 2.0 schemas to schemas/2.0/ and if people want to >>> strictly stay with that schema they can change their location >>> accordingly. >>> Sounds good to me! >>> >>> Thanks! >>> - Dan >>> >>> >>> >> >> ---------------------------- >>
http://mail-archives.apache.org/mod_mbox/cxf-dev/200706.mbox/%3C4665D3C6.4030805@iona.com%3E
CC-MAIN-2018-26
refinedweb
635
73.47
Drop-down lists Posted on March 1st, 2001 Like a group of radio buttons, a drop-down list is a way to force the user to select only one element from a group of possibilities. However, it’s a much more compact way to accomplish this, and it’s easier to change the elements of the list without surprising the user. (You can change radio buttons dynamically, but that tends to be visibly jarring). Java’s Choice box is not like the combo box in Windows, which lets you select from a list or type in your own selection. With a Choice box you choose one and only one element from the list. In the following example, the Choice box starts with a certain number of entries and then new entries are added to the box when a button is pressed. This allows you to see some interesting behaviors in Choice boxes: //: Choice1.java // Using drop-down lists import java.awt.*; import java.applet.*; public class Choice1 extends Applet { String[] description = { "Ebullient", "Obtuse", "Recalcitrant", "Brilliant", "Somnescent", "Timorous", "Florid", "Putrescent" }; TextField t = new TextField(30); Choice c = new Choice(); Button b = new Button("Add items"); int count = 0; public void init() { t.setEditable(false); for(int i = 0; i < 4; i++) c.addItem(description[count++]); add(t); add(c); add(b); } public boolean action (Event evt, Object arg) { if(evt.target.equals(c)) t.setText("index: " + c.getSelectedIndex() + " " + (String)arg); else if(evt.target.equals(b)) { if(count < description.length) c.addItem(description[count++]); } else return super.action(evt, arg); return true; } } ///:~ The TextField displays the “selected index,” which is the sequence number of the currently selected element, as well as the String representation of the second argument of action( ), which is in this case the string that was selected. When you run this applet, pay attention to the determination of the size of the Choice box: in Windows, the size is fixed from the first time you drop down the list. This means that if you drop down the list, then add more elements to the list, the elements will be there but the drop-down list won’t get any longer [57] (you can scroll through the elements). However, if you add all the elements before the first time the list is dropped down, then it will be sized correctly. Of course, the user will expect to see the whole list when it’s dropped down, so this behavior puts some significant limitations on adding elements to Choice boxes. There are no comments yet. Be the first to comment!
http://www.codeguru.com/java/tij/tij0142.shtml
CC-MAIN-2014-35
refinedweb
430
61.16
Package cloudsql Overview ▹ Overview ▾ Package cloudsql exposes access to Google Cloud SQL databases. This package does not work in App Engine "flexible environment". This package is intended for MySQL drivers to make App Engine-specific connections. Applications should use this package through database/sql: Select a pure Go MySQL driver that supports this package, and use sql.Open with protocol "cloudsql" and an address of the Cloud SQL instance. A Go MySQL driver that has been tested to work well with Cloud SQL is the go-sql-driver: import "database/sql" import _ "github.com/go-sql-driver/mysql" db, err := sql.Open("mysql", "user@cloudsql(project-id:instance-name)/dbname") Another driver that works well with Cloud SQL is the mymysql driver: import "database/sql" import _ "github.com/ziutek/mymysql/godrv" db, err := sql.Open("mymysql", "cloudsql:instance-name*dbname/user/password") Using either of these drivers, you can perform a standard SQL query. This example assumes there is a table named 'users' with columns 'first_name' and 'last_name': rows, err := db.Query("SELECT first_name, last_name FROM users") if err != nil { log.Errorf(ctx, "db.Query: %v", err) } defer rows.Close() for rows.Next() { var firstName string var lastName string if err := rows.Scan(&firstName, &lastName); err != nil { log.Errorf(ctx, "rows.Scan: %v", err) continue } log.Infof(ctx, "First: %v - Last: %v", firstName, lastName) } if err := rows.Err(); err != nil { log.Errorf(ctx, "Row error: %v", err) } Index ▹ Index ▾ Package files cloudsql.go cloudsql_vm ¶ func Dial(instance string) (net.Conn, error) Dial connects to the named Cloud SQL instance.
http://docs.activestate.com/activego/1.8/pkg/google.golang.org/appengine/cloudsql/
CC-MAIN-2018-17
refinedweb
261
52.87
Marlon Churchill wrote:This question is about how Java creates objects and when. I think I'm missing some basic concept. the code and question are from the Sierra and Bates SCJP 6 book, Chapter 3, question 11. Given; // do stuff } } When line 16 is reached, how many objects are available for garbage collection? The correct answer is 1, but I seem to count 3. b1, b2, and a1. Backing up a bit, how many objects were created? I'm not really sure. Is it seven? a1, a1.b1, a1.b2, b1, b1, a2, and a2.b2 ? Since Alpha.b1 is static, I think there is no separate a2.b1 object, the static Beta b1 belongs to the class Alpha. or is it four? a1, b1, b2 and a2. The variables in the Alpha class are reference variables, not objects. still, setting b1 and b2 both equal to null, seems to make them eligible for GC. Does setting a2.b2 = b2 mean the code can still reach b2, so b2 (although null) is not eligible for GC? Marlon Churchill wrote:Hi, Sorry for the late reply. Thanks to both of you for your assistance. @Joe - The questions on the SJCP are deliberately obfuscatory and use poor programming practices to enhance difficulty. Or so the Sierra and Bates SJCP books states. @Ron - diagramming it out helped a lot. Unfortunately, I have another question about question 10 of the same chapter. Here is the code class Dozens ( int[] dz= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; } public class Eggs { public static void main(String[] args) { Dozens [] da = new Dozens[3]; da[0] = new Dozens(); Dozens d = new Dozens(); da[1] = d; d = null; da[1] = null; // do stuff } } The question asks which are true about ojbects created within main and eligible for garbage collection at line 14 (the comment line) The correct answers are 5 objects created and two eligible for GC at line 14. I can figure out the GC part. So we have a dozens array da. At first I thought it created a Dozens object in each element of the array when da is created, but I don't think it does. only at line da[0]= new Dozens(); is the Dozens object in da[0] created. A int array da[0].dz (also an object) is also created. Is this correct? then Dozens d= new Dozens (); creates another two objects. I think I get it. Sorry for the questions. I worked my way through many of the sample problems in the Murach Java 6 book and thought I had a good handle on Java, but these questions are very detailed.
http://www.coderanch.com/t/539316/java/java/object-creation
CC-MAIN-2015-06
refinedweb
447
84.78
i want to connect my LDR with the arduino without using any resistor or other things as shown in the figure, i just want to use hook-up wires and breadboard. can any one help me doing this? i also want a code with it library to test my ldr . i want to connect my LDR with the arduino without using any resistor or other things as shown in the figure, i just want to use hook-up wires and breadboard. No. Well that diagram does not show an LDR, so I am not sure how it helps. However, connecting the LDR is simple - just connect it between an analog input pin - any from A0 to A3 - and ground. Use it in code like this: #define LDR1 A0 int ldrval; void setup() { // Your other setup code pinMode(LDR1, INPUT_PULLUP); } void loop() { // previous loop code ldrval = analogRead(LDR1); // following loop code } The resistor on the right is for the LED backlight, if you do not need a backlight (illuminated display) then you can omit that. The LCD contrast pin is trickier to eliminate as a bias voltage is needed between 0V and 5V to set the contrast and this is normally set by a potentiometer (pot) or one/two resistors. Some success has been achieved using a PWM pin. It might also be possible to use the Arduino UNO AREF pin as bias source since the voltage on this pin can be set by changing the reference, eg: analogReference(INTERNAL1V1); But the that pin is not really designed to sink even a small current, the contrast might not be ideal and it will mess up the analogue measurements! Some LCDs are readable with the contrast pin connected to 0V, others like a bias level of about 0.5V. Caveat: I have not tried any of this myself. Pots (or a single "select on test" bias resistor to 0V) are cheap and is the correct solution so why not use one! Ah! There's another slant on the question - a LCD, not a LDR! Well, that's easy. Check that Resistor R8 on the LCD is labelled "101". That means that you can connect pin 15 directly to +5 V, the resistor shown is superfluous. Connect pin 3 to ground. The LCD should be legible, but may not be fully clear. Try resistors 100 to 330 Ohms between pin 3 and ground if and when you have them to find the best legibility; the potentiometer is not really necessary. ayshaalrayes: i also want a code with it library to test my ldr . It's on the page you found that terrible diagram! Hi everyone i am using an LCD that is connected to an arduino, and i am using this diagram as a reference when i run LiquidCrystal Library - Hello World nothing is shown on the LCD can u please help me Did you not like the previous answers? What does “nothing is shown on the LCD” actually mean? i used another diagram to connect the LCD with the arduino that does not include resistor, but it also des not work. nothing is showing on the LCD means that the code i have apload it on my arduino does not show a hello world on my LCD screen. ayshaalrayes: I used another diagram to connect the LCD with the Arduino that does not include resistor, but it also does not work. Let me explain how using this forum works. You are given an explanation of what to do to correct the problem that you describe. You follow the instructions given; (there may be alternate things suggested by different people, in which case you should perhaps try one suggestion, then try another but) in each case you must describe what happens when you follow those instructions. If you do not do this, then it is impossible to assist you. Unfortunately, sometimes apparently well-meaning suggestions given here will be wrong and actually make the problem more diffcult. :roll_eyes: In the case of the instructions I gave, did you determine what is written on the resistor "R8" on the back of the LCD module? Did you then make the connection I instructed? Did you connect pin 3 of the LCD to ground? What showed on the display? ayshaalrayes: Nothing is showing on the LCD means that the code I have upload it on my Arduino does not show a hello world on my LCD screen. Perhaps not, but in order to determine what is the problem, you must tell what it does show. This means, does the backlight light up? Does it show any form of dark "blocks" on the screen? Does it show one line of blocks, or two? Are there any visible characters in those blocks? If the alterations to the first circuit that I described do not work, then the second circuit will definitely not function as it completely relies on the code (which you have not given to us) working correctly. PWM contrast seems to work very well, so if you have the resistor that Paul mentioned fitted on the PCB then you can completely avoid other discrete components. I used a Mega and just wired Arduino pin 7 direct to V0 (LCD pin 3) and then by experiment found a PWM value of 150 works well. I tried pin 13 too as that runs at a higher PWM frequency but then I got display flicker, no doubt due to the aliasing between the segment drive waveform and the PWM frequency. Pin 7 showed no discernible flicker though. This is the code based on the “Display” example: //("PWM contrast"); // Arduino pin 7 is wired direct to V0 (pin 3 of LCD) analogWrite(7, 150); // Set the contrast (150 looks good) } void loop() { // Turn on the display: lcd.display(); while(1); } So the answer is “yes” you can avoid all discrete components. Sorry for not understanding how does the forum works. i am only a beginner on arduino and this is my first time using it. yes i have tried what you said by grounding pin3. on the LCD i got a one row of blocks with no characters. so what are your suggestion ? thank you ayshaalrayes: I have tried what you said by grounding pin3. on the LCD I got a one row of blocks with no characters. So, we are actually getting somewhere now! I now presume you have in fact checked resistor R8, found it to indeed be “101” and connected pin 15 directly to Vcc, so you have the backlight working (otherwise it is very difficult to see the display). The “row of blocks” tells us that the contrast (pin 3) is set more-or-less correctly and should be ready to display characters. The fact that it is there and on the first line only indicates that you are failing to communicate with the controller on the LCD module. This means that either the connections are incorrect, or the code is incorrect or simply does not match the connections. I now want you to do two things. I want you to tell me to which UNO pins each of the LCD pins 4, 6, 11, 12, 13 and 14 connect and confirm that pin 5 is connected to ground. Then I want you to post the actual code you are trying to use by copying it from the IDE to inside a pair of code tags (using the “ </>” icon above the reply window) in your reply. OK? i have connected the pins as following : LCD pin 4 to digital pin 12 LCD pin 6 to digital pin 11 LCD pin 11 to digital pin 5 LCD pin 12 to digital pin 4 LCD pin 13 to digital pin 3 LCD pin 14 to digital pin 2 and i used this code " Hello World " #include <LiquidCrystal.h> #include <SPI); } Well, the code does seem to match the wiring though I am not sure how the “#include <SPI.h>” came to be in there as it is not relevant to this device. There is a minor problem with that code, but it need not concern us now. There must be a problem with the connections, which leads me to two comments. One is that you should try a different set of jumper wires for connections to pins 4 to 14 of the LCD in case one of them is faulty. The other however and perhaps more to the point, is to ask how you have the LCD module connected to the breadboard. To connect a module to the breadboard, it must have a set of pins soldered into the holes on the module. Can you confirm that your pins are actually soldered to the LCD board as it will quite certainly not work if they are not? A perfectly focussed photograph of your whole assembly, photographed in good outdoor daylight (but not direct sun) might be useful to confirm the soldering of the pins. First step code for testing: () { /* // First test without loop code // Do not update the display too frequently delay(300); // set the cursor to column 0, line 1 // (note: line 1 is the second row, since counting begins with 0): lcd.setCursor(0, 1); // print the number of seconds since reset: lcd.print(millis() / 1000); */ } This will print just the first line if connections are correct. thankyou very much, it seems that the wire connection was not connected well. i tried it again and it worked perfectly I think we figured that. You may now modify the title on your first post to add the word "(Solved!)". :grinning:
https://forum.arduino.cc/t/how-to-connect-ldr-with-arduino/383218
CC-MAIN-2021-43
refinedweb
1,603
76.76
Opened 5 years ago Closed 5 years ago Last modified 4 years ago #27039 closed Bug (fixed) ModelFields with 'default' value set and 'required'=False in form does not use default value Description I have Model M with corresponding ModelForm class M(models.Model): f = models.CharField(max_length=255, default=u'default_value') class MF(forms.ModelForm): class Meta: model = M fields = ['f'] f = forms.CharField(required=False) I save form with empty data, expecting receive default value in field mf = MF({}) if mf.is_valid(): m = mf.save(commit=False) m.f >>> u'' expected behavior m.f >>> u'default_value' Commits, that broke previous behavior: Offered patch: --- django/forms/models.py (revision 35225e2ade08ea32e36a994cd4ff90842c599e20) +++ django/forms/models.py (revision ) @@ -385,7 +385,7 @@ exclude.append(name) try: - self.instance = construct_instance(self, self.instance, opts.fields, opts.exclude) + self.instance = construct_instance(self, self.instance, opts.fields, exclude) except ValidationError as e: self._update_errors(e) Attachments (1) Change History (21) comment:1 Changed 5 years ago by comment:2 Changed 5 years ago by I'd like to hear more about the use case. It might be argued that defaults should only apply to the population of initial forms and that if a user removes that value and submits a blank form, Django shouldn't transform it back to the default. Of course if we decide on that resolution, we'll have to document the change. If we decide to keep the old behavior, I'm attaching a regression test. Changed 5 years ago by comment:3 Changed 5 years ago by If a user removes the value in a form, the form should receive {'f': ''}, not an empty dict. I still think we should fix the regression. comment:4 Changed 5 years ago by Makes sense to me, however, on older Django versions, {'f': ''} as the data also results in an instance with the model field default rather than an empty string. Do you feel the behavior should be restored for that case as well? comment:5 Changed 5 years ago by No, IMHO {'f': ''} should really end up with the field being assigned the empty string, if possible. Quoting (and agreeing with) you: if a user removes that value and submits a blank form, Django shouldn't transform it back to the default. comment:6 Changed 5 years ago by I drafted a pull request, however, it demonstrates a small problem with the idea that values not present in POST data should fallback to their default. For HTML widgets like checkboxes, if the element isn't checked, it won't appear in POST data. In such a case, it's inappropriate to fallback to the model field's default if it's True. The current patch special cases this with isinstance(form[f.name].field.widget, CheckboxInput) to fix some test failures but that hardly seems ideal. comment:7 Changed 5 years ago by I see. So maybe another approach could be documenting that default values are used to populate initial blank forms, but not to fill missing data from the form input. comment:8 Changed 5 years ago by I asked on django-developers to try to get a consensus on how to proceed. comment:9 Changed 5 years ago by The patch might be ready now. comment:10 Changed 5 years ago by comment:11 Changed 5 years ago by comment:12 Changed 5 years ago by Reopening as Alex Hill reported that this isn't working with prefixed forms. comment:13 Changed 5 years ago by The issue was that when a field on a prefixed form had a default, its (unprefixed) name wasn't found in form.data, so the instance would always be populated with the default value. Fixed with form.add_prefix(). PR at comment:14 Changed 5 years ago by comment:15 Changed 5 years ago by comment:16 Changed 5 years ago by comment:17 Changed 4 years ago by I am noticing an odd behavior upgrading a Django app and I have traced it to this ticket. I have upgraded the app from 1.8 to 1.10 and all tests are passing, however if I upgrade from 1.10 to 1.10.1 one of my tests fail. I have determined the reason why to be its a ModelForm and the model has a field defined with a default value: field_x = models.CharField(max_length=100, db_index=True, blank=True, default='') The model form also has a clean method that if a value isn't supplied for field_x that it will generate one: def clean_field_x(self): token = self.cleaned_data.get('field_x') if not token: token = utils.generate_token() return token It would appear that in 1.10.1 it changed from using the generated token in the clean method, to then preferring the model field's default value. I think this behavior is incorrect, shouldn't it prefer the form's cleaned data over the model defaults? comment:18 Changed 4 years ago by The behavior you describe isn't what's implemented. Hopefully it's not documented anywhere. It should be possible to adapt your code. For example, this might work: if not token: token = utils.generate_token() self.data['field_x'] = token by inserting a value in self.data, the model fallback logic won't be triggered, I think. If you think we could improve the behavior and have a patch to propose, feel free to open a new ticket. comment:19 Changed 4 years ago by I've run into what I would call a bug (or at least unexpected - to me - behaviour) which is related to this, running Django 1.11.1. I'm happy to break this out into another ticket if you'd prefer. While the argument can be made for a user submitted blank/empty string overriding the field default, does this make sense in the case of an IntegerField (or any number field really)? If I have e.g. models.IntegerField(blank=True, default=0) in a model then currently a user can submit a blank value to a ModelForm for this model by deleting the field initial value, and the field value will travel through form/model cleaning as None. If I then have couple of IntegerFields like the above and model.clean() does a check on their sum, it will fail when attempting to add NoneType. I would say it is reasonable to expect a number based field to contain a number by the time it hits model.clean() via a form, either a valid user submitted value or default if the submitted field is empty. Obviously I can guard the arithmetic statement with a test or try: clause, but in my mind I set a default value so I expect to see something valid. Maybe others expect otherwise :) comment:20 Changed 4 years ago by I'm doubtful that further complexity in this area is a good idea but this isn't a good place to discuss it. Design decisions are discussed on the DevelopersMailingList. Providing a patch to show your idea is feasible and wouldn't break backwards compatibility would help the discussion greatly. Thanks, but a test is still missing in the patch.
https://code.djangoproject.com/ticket/27039
CC-MAIN-2021-21
refinedweb
1,198
64.41
Download presentation Presentation is loading. Please wait. Published byLynne Jones Modified over 4 years ago 2 Many algorithms appear over and over again, in program after program. These are called standard algorithms You are required to know about 5 of these algorithms: Input Validation (Int 2) Linear search Counting occurences Finding the maximum value Finding the minimum value 3 Standard Algorithms Input validation checks user input to see if it’s within a valid number range. If it’s outside the valid range the algorithm asks for the number again until it falls within the acceptable range. What is Input Validation 4 Standard Algorithms Input Validation Pseudocode 1Get and store value 2Loop WHILE data is out with range 3 Display error message 4 Prompt user to re-enter value 5End loop 5 Standard Algorithms Input Validation VB6.0 code Number = InputBox (“Enter number between 1 and 10”) Do While number max MsgBox (“Must be num between “ & min & ” and “ & max) Number = InputBox (“Enter number between “ & min & ” and “ & max) Loop 6 Standard Algorithms What is Linear Search? Linear search is the simplest search method to implement and understand. Starting with an array holding 8 numbers with a pointer indicating the first item, the user inputs a search key. Scanning then takes place from left to right until the search key is found, if it exists in the list. 7 Standard Algorithms Linear Search (The search item is 76) Each item is checked to see if it 76, until 76 is found or the last item is checked. 8 1. Set found to false 2. Get search value 3. Start at first element on the list 4. Do while (not end of list) AND (found is false) 5.If current element = search value Then 6.Set found = true 7.Display found message 8.Else 9.Move to next element in the list 10.End If 11. Loop 12. If found = false Then 13.Display not found message 14. End If Standard Algorithms Linear Search Pseudocode 9 IsFound = false SearchValue = InputBox(“Please enter the value your are looking for”) Position = 0 Do While (Position <> UBound(List())) AND (found = false) If List(Position) = SearchValue Then IsFound = true MsgBox(“The item is at position ” & Position & “in the list”) Else Position = Position + 1 End If Loop If found = false Then MsgBox(“The item is not in the list”) End If Standard Algorithms Linear Search VB6.0 Code 10 Standard Algorithms What is Counting Occurrences Programs often have to count occurrences. Examples include counting the number of: students who achieved particular marks in an exam rainfall measurements greater than a particular level words equal to a given search value in a text file. The basic mechanism is simple: 1.a counter is set to 0 2. a list is searched for the occurrence of the search value 3. every time the search value occurs, the counter is incremented 11 Standard Algorithms Counting Occurrences Algorithm 1.Set counter = 0 2.Get search value 3.Set pointer to start of the list 4.Do 5.If search item = list(position) Then 6.Add 1 to counter 7.End If 8.Move to next position 9.Until end of list 10.Display number of occurrences 12 Standard Algorithms Counting Occurrences VB6.0 Code Count = 0 Occurrence = Inputbox(“Please enter value to count”) Position = 0 Do If List(Position) = Occurrence Then Counter = Counter + 1 End If Position = Position + 1 Loop Until Position = UBound(List()) 13 Standard Algorithms Maximum And Minimum Algorithms Computers are often used to find maximum and minimum values in a list. For example, a spreadsheet containing running times for videos might make use of a maximum algorithm to identify the video with the longest running time, or a minimum algorithm to identify the shortest running time. To find a maximum, we set up a variable which will hold the value of the largest item that has been found so far, usually the first element. If an element in the array exceeds this working maximum, we give the working maximum that value. 14 Standard Algorithms Maximum Pseudocode 1.Set maximum value to first item in this list 2.Set current position to 1 3.Do 4.If list(position) > maximum Then 5.set maximum equal to list(position) 6.End If 7.Move to next position 8.Until end of list 9.Display maximum value 15 Standard Algorithms Finding the Maximum VB6.0 Code Maximum = List(0) Position = 1 Do If List(Position) > Maximum Then Maximum = List(Position) End If Position = Position + 1 Loop Until Position = UBound(List()) Msgbox(“The maximum value is ” & Maximum) 16 Standard Algorithms Minimum Pseudocode 1.Set minimum value to first item in ths list 2.Set current position to 1 3.Do 4.If list(position) < minimum Then 5.set minimum equal to list(position) 6.End If 7.Move to next position 8.Until end of list 9.Display minimum value 17 Standard Algorithms Finding the Minimum VB6.0 Code Minimum = List(0) Position = 1 Do If List(Position) < Minimum Then Minimum = List(Position) End If Position = Position + 1 Loop Until Position = UBound(List()) Msgbox(“The minimum value is ” & Minimum) 18 Standard Algorithm Exam Questions An international athletics competition between eight countries has a number of events. The winning times are stored in a list in order of lane number like the one on the right. The stadium needs a program to help process the results. Q1.The program must find the fastest time for a race. Use pseudocode to design an algorithm to find the fastest time (4 marks) Q2. It is suggested that algorithm should find the lane number of the fastest time instead of the fastest time. Explain how this could be achieved. (1 mark) Lane Time (secs) 140.23 241.05 342.88 439.89 540.55 640.01 739.87 19 Exam Marking Scheme Set fastest to first time in list For rest of array items If array(current)<fastest then Set fastest to array(current) End if End loop In summary, 1 mark for each of the following: Setting initial value Loop (with end) for traversal of array Comparison of current element with maximum value (with end if) Assignment of new maximum value 20 Standard Algorithm Exam Questions NoTow is a company that runs a city centre car park. The company requires a piece of software that will calculate the number of cars on a particular day that spent more than three hours in the car park. The number of whole minutes each car is parked is stored in a list as shown on the right. Q3. Use pseudocode to design an algorithm to carry out this calculation (4 marks). 124 210 105 193 157 21 Exam Marking Scheme Set over3 = 0 For each car that day If duration >180 then Add one to over3 End if End loop 1 mark for initialising 1 mark loop with termination 1 mark for if..endif with correct condition 1 mark for keeping running total Note: End of if/loop may be implicit in clearly indented algorithm The value is in minutes so the condition is > 180 Similar presentations © 2020 SlidePlayer.com Inc.
https://slideplayer.com/slide/4776144/
CC-MAIN-2020-10
refinedweb
1,192
64.51
Thanks for your detail answer. What I gave to you is an exported output of BaseX database version 7.3.1 (old database) via Java application with BaseX version 8.6.7. I tried to export with BaseX version 7.3.1 with same db:export() XQuery, but it returns error db:export("userdb", "/home/mascalan/", map { 'method': 'xml' }) Error when querying BaseX database 'Failed at querying the database, detail: Stopped at line 1, column 45: [XPST0003] Invalid key, simple expression expected. Check collection name and version are valid first.'. I think if I could export to you the XML of old database by BaseX version 7.3.1, you could see the in the XML file which BaseX version 8.6.7 couldn't find to export (?) On 02/02/2018 11:02 AM, Kirsten, Dirk wrote: > > Hi, > > > > well, the XQuery might be the same, but because you certainly use > different BaseX instances they might use different properties (i.e. > point to a different BaseX storage). At least for the examples you > provide here it simply doesn’t add up. To make it clear: You say the > result on the right is with the old BaseX version. One of the results > is the string. > However, the string does simply not appear in your input XML. So, > where does the difference come from? > > > > Maybe it would be easier to simply forget about the old version and > instead you could describe what results you are missing from the 8.6.7 > vcersion? (you said data is missing)? I can hardly imagine that > something is really missing in this case. > > > > However, what certainly has improved (and thus: changed) with BaseX 8 > (I think) is the serialization. It uses the adaptive serialization by > default, which uses newlines as separators when serialiazing. However, > you can switch to any other serialization method quite easily and use > the old default xml by issueing “declare option output:method “xml”; > in the query prolog. > > > > Cheers > > Dirk > > > > *Von:*Bang Pham Huu [mailto:b.pham...@jacobs-university.de] > *Gesendet:* Freitag, 2. Februar 2018 10:08 > *An:* Kirsten, Dirk <dirk.kirs...@senacor.com>; > basex-talk@mailman.uni-konstanz.de > *Betreff:* Re: AW: [basex-talk] Big Surprise from outputs in version > 7.3.1 and 8.6.7 ? > > > > Yes, I'm sure I tested with old database from version 7.3.1 for both > versions (7.3.1 and 8.6.7). Please see the exported XML from this > database here: > > with this XQuery: |db:export("userdb", "./userdb", map||{ 'method': > 'xml'||})| > > At least I can see that query in version 7.3.1 doesn't return "new > line character \n" as in 8.6.7 but an empty space " ". > > Thanks, > > > > On 02/02/2018 09:46 AM, Kirsten, Dirk wrote: > > Hallo, > > are you sure you are querying the same collection? I am quite > confused by your different outputs, because they seem to have not > much in common (the results on the left almost exclusively return > URIs pointing to opengis.net and the one on the right to > localhost:8080? > > If you are sure it would most certainly be helpful if you provide > the input XML. > > Also, looking at your query I don't really get why you write it > that way, e.g. "for $i in $x return $i" is identical as simply "$x"... > > Cheers > Dirk > > > > Senacor Technologies Aktiengesellschaft - Sitz: Eschborn - > Amtsgericht Frankfurt am Main - Reg.-Nr.: HRB 105546 > Vorstand: Matthias Tomann, Marcus Purzer - > Aufsichtsratsvorsitzender: Daniel Grözinger > > -----Ursprüngliche Nachricht----- > Von: basex-talk-boun...@mailman.uni-konstanz.de > <mailto:basex-talk-boun...@mailman.uni-konstanz.de> > [mailto:basex-talk-boun...@mailman.uni-konstanz.de] Im Auftrag von > Bang Pham Huu > Gesendet: Freitag, 2. Februar 2018 08:45 > An: basex-talk@mailman.uni-konstanz.de > <mailto:basex-talk@mailman.uni-konstanz.de> > Betreff: [basex-talk] Big Surprise from outputs in version 7.3.1 > and 8.6.7 ? > > Hello, > > I've been using BaseX to query an XML file in version 7.3.1 and it > worked well. However, because of this problem > > > and I was suggested to use version 8.6.7 then I changed to use > this version in a Java Web application which queries the old BaseX > files from version 7.3.1. > > However, I didn't know that this version changes created a very > surprise result between version 7.3.1 and 8.6.7 (i.e: data is > missing in version > 8.6.7 from output result !!!). > > Could someone tell me why it happens and how to use BaseX version > 8.6.7 on BaseX database from version 7.3.1. > > Here is the difference between 2 outputs on same old BaseX > database version 7.3.1 (left: 8.6.7, right: 7.3.1) with same XQuery: > > > The XQuery is: > > declare namespace gml = ""; > declare function local:get-children() { > let $x := collection('userdb')//gml:identifier/text() > return > if (exists($x)) then > for $i in $x > return $i > else <empty/> > }; > > let $x := distinct-values(local:get-children()) > for $i in $x return $i > > Thanks, > > > > >
https://www.mail-archive.com/basex-talk@mailman.uni-konstanz.de/msg10306.html
CC-MAIN-2018-39
refinedweb
834
68.16
Ruby - Modules and Mixins Modules are a way of grouping together methods, classes, and constants. Modules give you two major benefits. Modules provide a namespace and prevent name clashes. Modules implement the mixin facility. Modules define a namespace, a sandbox in which your methods and constants can play without having to worry about being stepped on by other methods and constants. Syntax module Identifier statement1 statement2 ........... end Module constants are named just like class constants, with an initial uppercase letter. The method definitions look similar, too: Module methods are defined just like class methods. As with class methods, you call a module method by preceding its name with the module's name and a period, and you reference a constant using the module name and two colons. Example #!/usr/bin/ruby # Module defined in trig.rb file module Trig PI = 3.141592654 def Trig.sin(x) # .. end def Trig.cos(x) # .. end end We can define one more module with the same function name but different functionality − #!/usr/bin/ruby # Module defined in moral.rb file module Moral VERY_BAD = 0 BAD = 1 def Moral.sin(badness) # ... end end Like class methods, whenever you define a method in a module, you specify the module name followed by a dot and then the method name. Ruby require Statement The require statement is similar to the include statement of C and C++ and the import statement of Java. If a third program wants to use any defined module, it can simply load the module files using the Ruby require statement − Syntax require filename Here, it is not required to give .rb extension along with a file name. Example $LOAD_PATH << '.' require 'trig.rb' require 'moral' y = Trig.sin(Trig::PI/4) wrongdoing = Moral.sin(Moral::VERY_BAD) Here we are using $LOAD_PATH << '.' to make Ruby aware that included files must be searched in the current directory. If you do not want to use $LOAD_PATH then you can use require_relative to include files from a relative directory. IMPORTANT − Here, both the files contain the same function name. So, this will result in code ambiguity while including in calling program but modules avoid this code ambiguity and we are able to call appropriate function using module name. Ruby include Statement You can embed a module in a class. To embed a module in a class, you use the include statement in the class − Syntax include modulename If a module is defined in a separate file, then it is required to include that file using require statement before embedding module in a class. Example Consider the following module written in support.rb file. module Week FIRST_DAY = "Sunday" def Week.weeks_in_month puts "You have four weeks in a month" end def Week.weeks_in_year puts "You have 52 weeks in a year" end end Now, you can include this module in a class as follows − #!/usr/bin/ruby $LOAD_PATH << '.' require "support" class Decade include Week no_of_yrs = 10 def no_of_months puts Week::FIRST_DAY number = 10*12 puts number end end d1 = Decade.new puts Week::FIRST_DAY Week.weeks_in_month Week.weeks_in_year d1.no_of_months This will produce the following result − Sunday You have four weeks in a month You have 52 weeks in a year Sunday 120 Mixins in Ruby Before going through this section, we assume you have the knowledge of Object Oriented Concepts.. Mixins give you a wonderfully controlled way of adding functionality to classes. However, their true power comes out when the code in the mixin starts to interact with code in the class that uses it. Let us examine the following sample code to gain an understand of mixin − module A def a1 end def a2 end end module B def b1 end def b2 end end class Sample include A include B def s1 end end samp = Sample.new samp.a1 samp.a2 samp.b1 samp.b2 samp.s1 Module A consists of the methods a1 and a2. Module B consists of the methods b1 and b2. The class Sample includes both modules A and B. The class Sample can access all four methods, namely, a1, a2, b1, and b2. Therefore, you can see that the class Sample inherits from both the modules. Thus, you can say the class Sample shows multiple inheritance or a mixin.
http://www.tutorialspoint.com/ruby/ruby_modules.htm
CC-MAIN-2019-04
refinedweb
708
64.91
#include <wx/dynlib.h> wxDynamicLibrary is a class representing dynamically loadable library (Windows DLL, shared library under Unix etc). Just create an object of this class to load a library and don't worry about unloading it – it will be done in the objects destructor automatically. The following flags can be used with wxDynamicLibrary() or Load(): This class supports the following styles: Default constructor. Returns the platform-specific full name for the library called name. E.g. it adds a ".dll" extension under Windows and "lib" prefix and ".so", ".sl" or ".dylib" extension under Unix. This function does the same thing as CanonicalizeName() but for wxWidgets plugins. The only difference is that compiler and version information are added to the name to ensure that the plugin which is going to be loaded will be compatible with the main program. Returns the platform-specific dynamic library file extension, or depending on flags, the plugin file extension. The leading dot is included. For example, on Windows ".dll" is returned, and either ".dylib" or ".bundle" on macOS. Returns the load address of the module containing the specified address or NULL if not found. If the second argument path is not NULL, it is filled with the full path to the file the module was loaded from upon a successful return. This method is implemented under MSW and Unix platforms providing dladdr() call (which include Linux and various BSD systems) and always returns NULL elsewhere. Return a valid handle for the main program itself or NULL if symbols from the main program can't be loaded on this platform. Returns pointer to symbol name in the library or NULL if the library contains no such symbol. appended automatically depending on the current build. Otherwise, this method is identical to GetSymbol(). Returns true if the symbol with the given name is present in the dynamic library, false otherwise. Unlike GetSymbol(), this function doesn't log an error message if the symbol is not found. Returns true if the library was successfully loaded, false otherwise. This static method returns a wxArray containing the details of all modules loaded into the address space of the current project. The array elements are objects of the type: wxDynamicLibraryDetails. The array will be empty if an error occurred. This method is currently implemented only under Win32 and Linux and is useful mostly for diagnostics purposes. Loads DLL with the given name into memory. The flags argument can be a combination of the styles outlined in the class description. Returns true if the library was successfully loaded, false otherwise. Unloads the library from memory. wxDynamicLibrary object automatically calls this method from its destructor if it had been successfully loaded. Unloads the library from memory. wxDynamicLibrary object automatically calls this method from its destructor if it had been successfully loaded. This version of Un.
https://docs.wxwidgets.org/trunk/classwx_dynamic_library.html
CC-MAIN-2021-49
refinedweb
472
58.38
Yes they can. This is the fundamental feature of polymorphism and is called method overloading. Where you have multiple methods with the same name in a class. These methods differ from one another in the method signature alone. False. Two methods can have the same name in Java. It is called Method Overloading. false. Two methods can have the same name in Java Yes. It is called Method Overloading in Java. No. There can be multiple java classes in the same .java file, but the name of the file must match the name of the public class in the file. Method overloading is a technique in Java where you can have multiple methods in a class with the same name. These methods will have a different signature. Ex: public int add(int a, int b){} public float add(float a, float b){} The above two methods have the same name but a different signature. This is method overloading. In Java there is a concept called Scope of a Variable. Which defines the places in the code where a variable can be accessed. When you declare a variable inside a method, that variable is available only inside that method. Outside the method you cannot access it. So if you declare another variable of the same name in another method, it is as good as declaring a variable afresh because the instances of those variables are specific to that method. Those two variables are not at all related. That means you have two (or more) methods with the same name, but with different signatures - that is, the number or types of parameters are different. The compiler will automatically choose the correct method, according to the parameters provided. That means that you have two or more methods with the same name, but with a different parameter list - either the number of parameters varies, or the type of at least one of the parameters. Overloading is the means by which we can provide two or more different definitions of the same method in the same namespace. Overriding is the means by which a derived class may redefine the meaning of a base class method. Oddly enough, there is a Java class named Class. It provides an easy way to tell if two unknown Objects are of the same type (through use of the Object.class method). method header and method body There are two ways to call a method; the choice is based on whether the method returns a value or not. No. Interfaces in Java are a construct to get polymorphism ( subtype polymorphism ) working in Java, but they are not a "kind" of polymorphism. In polymorphism happens when two objects respond to the same message ( method call ) in different way ( hence poly -> many, morphism -> way or shape : polymorphism -> many ways). In Java to be able to send the same message to two different objects you have to either inherit the same parent, or implement the same interface. You use the .equals() method. Both True and False Two methods can have the same name provided they have a different signature (Parameters, return type) If they have the same signature then two methods cannot have the same name. Two methods can have the same name provided their signature is different.Ex:public int add(int a, int b){...}public int add(int a, int b, int c){...}This is allowed whereaspublic int add(int a, int b){...}public int add(int a, int b){...}This is not.The above only applies within a single Class or Interface definition.It is entirely possible for different classes to have a method of the exact same signature (i.e. return value, method name, argument list). If a subclass has a method with the same signature as a parent class, then that method is said to have overridden the parent class's method. There is no specific name for the case where two unrelated classes have the same method signature, though that case is perfectly legal. Different signatures with the same method name are also allowed (which is called overloading when a subclass does it).Interfaces follow the same rules and conventions as Classes in this matter.-------------------Two or more methods or constructor can have the same name provided they have different signature. In other words, when we can one of those methods, we should be able to tell which method was called even when they have the same name. You can read more about overloading constructors and methods on this page: The notify() method is used in Thread Communication between two threads along with the wait() method No. Each thread can have only one run method. You can overload the run method because it is just another java method but only the default run method with void return type will get called when you start the thread Java doesn't have a printf method. To provide the implementation of printf method of C in java, the java has two print methods. They are1. print()2. println()The first method prints the text in braces on the same line, while the second is used to print on the next line. In fact, ln in println() stands for next line. We need not use /n while working in java.Actually, the System.out.format() function is practically identical to printf in C. When translating code from C to Java, you can generally replace all calls to printf(args...) with calls to System.out.format(args...)....and to answer the original question, Java's System.out.format() method is based off of C's printf() function. Just create two methods with the same name, but with different types or numbers of parameters. Two methods can have the same name provided their method signatures are different. For ex: public int add(int a, int b, int c){ } public float add(float a, float b, float c){ } These two methods can co-exist in the same class in spite of having the same method names because their signatures are different. But public int add(int a, int b, int c){ } public int add(int a, int b, int c){ } You cannot have this. Because it is just a replica of the earlier method and it would cause duplication.. Core JAVA and Advanced JAVA are the two types of JAVA False. Methods in a class can have the same name as long as they have a different signature. You cannot duplicate method code inside a class but you can always have methods that have the same name but a different signature. Ex: Here I have created two methods in a class that have the same name "sum" but have a different argument types, and return types and hence perfectly allowable in a java class. Public class PolymorphismExample { public int sum(int a, int b){ return a + b; } public double sum (double a, double b){ return a + b; } } A Method in Java is a piece of code that is designed to perform a specific operation. It takes in input arguments processes them and then returns a value. Ex: public int sum(int a, int b) { return a + b; } The above method takes two integer arguments and returns the sum of the two numbers passed..
https://www.answers.com/Q/Can_Two_method_have_the_same_name_in_java
CC-MAIN-2021-04
refinedweb
1,209
72.16
Agenda See also: IRC log, previous 2008-12-09 PROPOSED to accept minutes of the last telecon: RESOLVED to accept minutes of the last telecon: ACTION: Ben review RDFa Use Cases and propose transition to Group Note [recorded in] [CONTINUES] ACTION: Ralph to review the revised Recipes draft [recorded in] [CONTINUES] ACTION: Ralph/Diego to work on Wordnet implementation [of Recipes implementations] [recorded in] [CONTINUES] Ben: nothing critical to report on RDFa ACTION: Ralph post his comments on the editor's draft of the metadata note [recorded in] [CONTINUES] ACTION: Guus to look at OWL documents for review [recorded in] [CONTINUES] ACTION: Ralph to report on use of RDFa metadata in Recommendations. [recorded in] [CONTINUES] ACTION: seanb to redraft response to peter on ISSUE-157, where skos doc props are annotation props, and rdf:value example is dropped from skos [DONE] [recorded in] -> ACTION: alistair send email with editors' draft proposed for CR before next telcon [recorded in] [DONE] -> <aliman> update on CR for SKOS Reference ACTION: Antoine to write something in Primer wrt. ISSUE 160[recorded in] [DONE] [recorded in] -> ACTION: Antoine propose 1 or 2 SPARQL examples showing named graph usage [recorded in] [DONE] -> Antoine: resulting from ccing skos list re 160 issue. Do you agree with what I'm trying to defend? Alistair: Quick summary? Antoine: Started after note re. SKOS Collection. People started to say that we should put all the ... BS5723 and ISO<whatever> into the model. But that's not the priority and will make things ... complicated Guus: proposal on the table for the decision to request CR status for SKOS Reference. ... today Alistair sent message -> <aliman> SKOS Reference Editors' Draft, proposed for candidate rec (rev 1.73) scribe: Reference updated. Alistair: all documents updated and ready to go. Guus: Anyone want discussion on this? ... would like to see the issue list. ... one issue left. 157. Informal response from Peter. No problems anticipated. ... Document describing disposition ... Message from Sean describing at risk features -> Sean: three features: namespace URI, relationship between mapping props ... and topConceptOf naming ... no change for 2 and 3 ... but the namespace has been reverted to the original namespace Guus: about the XL namespace? Sean: current position: the XL namespace remain in the 2005/08 namespace Guus: it should be part of our decision that we have two namespaces <aliman> XL namespace: Guus: proposal is clear to everybody <aliman> xl namespace has not changed since first published Guus: request CR status for SKOS reference ... based on documents outlined in ... I propose to accept the proposal Antoine: I second Guus: objections? ... RESOLVED ... I'd like to thank the editors. <aliman> scribe should probably do "RESOLVED:" in IRC ACTION: chairs to write the CR transition request [recorded in] Guus: from now on we can focus on implementation report <aliman> E.g. "RESOLVED: to request CR transition for SKOS reference based on documents outlined in" Guus: and the additional documents (primer, use cases) Sean: can we close ISSUE 157? Guus: yes ... how about the problem with doctype? Alistair: if we're happy with the output of W3C validator there's no problem Guus: did you ask any feedback from RDFa task force? Ben: no time to read details, but I want to look at it Guus: SKOS Primer ... it would be nice if we could republish Primer when the Reference is accepted <seanb> scribenick: seanb Antoine: the last paragraphs sent around are already in the ... editors draft. If these are ok, then it would be easy to republish. Almost the last things ... to be dealt with Guus; So you're ready. Is review requried? Antoine: At least one for editorial quality/santiy checks Guus: Who were reviewers? Tom? Tom: yes Guus: Willing to check them? Tom: yes <edsu> TomB: thanks! Guus: Antoine/Ed Happy to accept an action for new working draft? Antoine: As long as there's not much feedback on recent paras. Would prefer action Ed: attach to wiki or move into place? Guus: Can still be on the wiki if tom's ok Tom: ok Antoine: Would prefer to wait for feedback on the latest paras. Only my first try ... at this. Not checked by anyone yet. Guus: Tom should review dec 16th veruibs ACTION: Tom to review Dec 16th version of SKOS Primer [recorded in] Guus: Can handle feeback in parallel. <TomB> Tom: What's the deadline? Guus: By beginning Jan. Call somewhere in first ten days. BTW, Alistair and Sean likely ... to be invited on to that call. We'll schedule separately. ... Propose to schedule call around 6th Jan, so review by then. ... Use case and requirement we can postpone for now. ... Implementation report can be on agenda for next call. ... propose next call on 6th Jan. <TomB> +1 for 6 January RESOLUTION: next call 6th Jan. Guus: AOB? ... congrats to all on work well done. Looking forward to completion in 2009. ... Happy holidays [meeting adjourned]
http://www.w3.org/2008/12/16-swd-minutes.html
CC-MAIN-2016-30
refinedweb
816
66.74
Evidence-based management needs comprehensible information; metrics are distilled facts: not a bad fit. Here is a series of blogs giving a metric that can be useful in many areas of XML project management, from verifying the suitability of adopting a particular schema, to making sure that only work and capabilites arising from business requirements are being carried out, to estimating the price variation that a schema change may entail. Everyone using XML already uses a metric: well-formedness! Validity is also a metric. (I am simplifying away the difference between a metric and a measure in these blogs: pedants please lower your hackles!) But the metrics for XML on the Web are either concerned with communications and information theory, or are based on programming complexity measures, or are a little polluted by voodoo ideology about good structures and bad structures; I don’t buy into the latter, at least not at the current state of knowledge. But there is a need for a good set of metrics for XML project management, scoping and to inform XML schema governanc, so I thought people might be interested in some of the metrics I have been developing and using. They all address different, but to me vitally important, aspects of XML projects, and most are, I hope, common sense. Of course, you can make up your own metrics as well: but I think it is good to at least have a basic vocabulary of XML metrics to use or adapt or decry as appropriate. Element and Attribute Count This most basic and coarse metric asks the question “How many element and attribute names are there?” Take a schema or document set, count the unique element names and the unique attribute names, and sum them. It is a fine metric for schemas where elements or attributes only appear in a single context, with a single meaning. For example, a flat database dump of a single table with 50 fields has a metric of 51; a dump of a single table with 100 fields has a metric of 101; the idea that in some sense the second table is twice as big as the first (as the metric suggests) is obvious. For other kinds of documents, it becomes less attractive. Mixed content, multiple contexts, attributes used on multiple elements, all these things make a document or schema somehow more complicated, and the Element and Attribute Count metric doesn’t reflect that. Every time I produce the schema documentation for the release of a database, I provide management with a count of the tables and fields. Our cert gal asked how to interpret that. I told her, "roughly and don't get into reification fallacies". What she should really ask is about the number of keyed types. She asked about the growth rate. I told her it has settled at a number approximately at 200 per release. "Isn't that decreasing?" she asks. "It used to be about 400 per release but our coverage is very good now." I reply. She said she expected it to drop further. I told her it isn't likely to do that very fast because if she looks at the actual values, they are in the system tables where we are handling local variations, and in the seldom-sold features that we now implement for local agencies. IOW, the dynamism is in the exceptions now but they never quit coming. Any database that integrated around a set of common types (eg, names, vehicles, properties and locations) can grow quite large. If monolithic, it is a sales and cert nightmare. If modular, it is a pretty stable system. So I would want to know how many of the related tables are related simply by product bundling or by mixed namespaces that are created because the published artifact (document, report, etc.) actually require that. Yes Len, I agree they never quit coming. When developing the Document Complexity Metric, I sampled hundreds of documents using different DTDs. What I found, for any particular group of documents using the same DTD, was that every particular document only had about 70% of the elements (for medium sized DTDs). So sampling one or two documents was not enough to determine structure well, and in fact even sampling large numbers of documents was not enough to completely cover the number of elements. This has several impacts: the need to be suspicious of "fixed" schemas based on limited samples of documents, the need to have a change process instead, the need for tools to anyalyse document sets, the need for metrics for the tools to express useful things, the need for a rejection mechanism whereby rare elements (or elements only used because of tag abuse) can be dealt with. As is my point here, this is a particular problem when using the kitchen sink standard schemas, which are always too big. They were designed to be subsetted. Agreed. We learned about this in CALS wars. As you know, it depends on the approach taken to the results of the sampling. If one tries to cover every contingency, it becomes the DTD/Schema from Hell. If one attempts to subset too early, it becomes the DTD that spawns competitors (which ain't all bad). If one attempts to abstract away the differences, it becomes an abstract data dictionary and too many non-local types get pushed into it. Too much modeling leads to analysis paralysis. There is no single answer, but the rule of thumb that simpler is better seldom fails. If one acknowledges agreements are local, precisely defines the locale, and avoids the temptation to use recruitment as a means to pre-fix the market ("We MUST get buy-in first!) thus incurring ever expanding mission cressp, it usually goes a bit better. My best thought is to limit the use cases and the ambition. Evolution proceeds mostly by co-opting bits from near neighbors and adapting one's own uses to these. Reciprocity and a willingness to adapt mean living longer and getting more done. Better to pick one piece and do it well. GMX-V - new LISA OSCAR Draft Standard for Word and Character counts and the general exchange of metrics within an XML vocabulary: Hi Everyone,. GMX/V can be viewed at the following location: Localization tool providers have been consulted and have contributed to this standard. We would appreciate your views/comments on GMX/V. Regards, AZ Thanks for the heads-up on that, AZ. Lay readers may not be aware of the extent to which automated translation systems are used, in particular the success and penetration of translation memory systems. I am not at all surprised that a forward-thinking consortium like LISA, bringing together lean-and-hungry competitors whose cream largely comes from quality improvement, should be a leader here too. GMX/V has a name only a tech writer could love, but it seems completely serviceable for any industry needing a simple metrics reporting framework which supports phases (e.g., workflows, processes, etc.) Well done! Many thanks for you feedback Rick. I specially liked your description of GMX/V as a name only a tech writer could love. I will add this quote to my presentations on the subject!
http://www.oreillynet.com/xml/blog/2006/05/metrics_for_xml_projects_1_ele.html
crawl-002
refinedweb
1,209
60.55
Ben HedgepethPython Web Development Techdegree Student 6,741 Points Using Continue while iterating a list I'm not clear on what I'm doing wrong with my code. I'm testing whether the first character of each item in the list starts with 'a' but the challenge isn't passing. def loopy(items): for item in items: if item.index("a") == 0: continue else: print(item) 2 Answers Antonio De Rose20,840 Points def loopy(items): for item in items: if item.index("a") == 0: #this will actually return, the index, had there been an element with the value "a" #that too you cannot use "==", if at all to find the index of an element of "a" - item.index("a") #close, give it a try, hint - square bracket continue else: print(item) Jennifer NordellTreehouse Staff Hi there! Remember that if the substring is not found at all it will raise an exception and the function will terminate. So if we send in an item like "test", then this will fail. There is another way to check if the first letter is an "a". Strings can have the individual characters accessed through subscripting just like the items in a list. Here's an example: my_string = "Treehouse" print(my_string[4]) This would print the letter "h". I think you can get it with these hints, but let me know if you're still stuck!
https://teamtreehouse.com/community/using-continue-while-iterating-a-list
CC-MAIN-2019-35
refinedweb
232
78.89
Trusted Platform Module (TPM) present on many of today's systems can be used in various ways, from making completely locked-down systems that cannot be changed by users to protecting sensitive systems from various kinds of attacks. While the TPM-using integrity measurement architecture (IMA), which can measure and attest to the integrity of a running Linux system, has been part of the kernel for some time now, the related extended verification module (EVM) has not made it into the mainline. One of the concerns raised about EVM was that it obtained a cryptographic key from user space that is then used as a key for integrity verification—largely nullifying the integrity guarantees that EVM is supposed to provide. A set of patches that were recently posted for comments to the linux-security-module mailing list would add two new key types to the kernel that would allow user space to provide the key without being able to see the actual key data. We last looked in on EVM back in June when it seemed like it might make it into 2.6.36. That didn't happen, nor has EVM been incorporated into linux-next, so its path into the mainline is a bit unclear at this point. EVM calculates HMAC (hash-based message authentication code) values for on-disk files, uses the EVM key and TPM to sign the values, and stores them in extended attributes (xattrs) in the security namespace. If the EVM key is subverted, all bets are off in terms of the integrity of the system. While they are targeted for use by EVM, Mimi Zohar's patches to add trusted and encrypted key types could also be used for other purposes such as handling the keys for filesystem encryption. The basic idea is that these keys would be generated by the kernel, and would never be touched by user space in an unencrypted form. Encrypted "blobs" would be provided to user space by the kernel and would contain the key material. User space could store the keys, for example, but the blobs would be completely opaque to anything outside of the kernel. The patches come with two new flavors of these in-kernel keys: trusted and encrypted. Trusted keys are generated by the TPM and then encrypted using the TPM's storage root key (SRK), which is a 2048-bit RSA key (this is known as "sealing" the key in TPM terminology). Furthermore, trusted keys can also be sealed to a particular set of TPM platform configuration register (PCR) values so that the keys cannot be unsealed unless the PCR values match. The PCR contains an integrity measurement of the system BIOS, bootloader, and operating system, so tying keys to PCR values means that the trusted keys cannot be accessed except from those systems for which it was specifically authorized. Any change to the underlying code will result in undecryptable keys. Since the PCR values change based on the kernel and initramfs used, trusted keys can be updated to use different PCRs, once they have been added to a keyring (so that the existing PCR values have been verified). There can also be multiple versions of a single trusted key, each of which is sealed to different PCR values. This can be used to support booting multiple kernels that use the same key. While the underlying, unencrypted key data will not need to change for different kernels, the user-space blob will change because of the different PCR values, which will require some kind of key management in user space. Encrypted keys, on the other hand, do not rely on the TPM, and use the kernel's AES encryption instead which is faster than the TPM's public key encryption. Keys are generated as random numbers of the requested length from the kernel's random pool and, when they are exported as user-space blobs, they are encrypted using a master key. That master key can either be the new trusted key type or the user key type that already exists in the kernel. Obviously, if the master key is not a trusted key, it needs to be handled securely, as it provides security for any other encrypted keys. The user-space blobs contain an HMAC that the kernel can use to verify the integrity of a key. The keyctl utility (or keyctl() system call) can be used to generate keys, add them to a kernel keyring, as well as to extract a key blob from the kernel. The patch set introduction gives some examples of using keyctl to manipulate both trusted and encrypted keys. A recent proposal for a kernel crypto API was not particularly well-received, in part because it was not integrated with the existing kernel keyring API, but Zohar's proposal doesn't suffer from that problem. Both have the idea of wrapping keys into opaque blobs before handing them off to user space, but the crypto API went much further, adding lots of ways to actually use the keys from user space for encryption and decryption. While the trusted and encrypted key types would be useful to kernel services (like EVM or filesystem encryption), they aren't very useful to applications that want to do cryptography without exposing key data to user space. The keys could potentially be used by hardware cryptographic accelerators, or possibly be wired into the existing kernel crypto services, but they won't provide all of the different algorithms envisioned by the kernel crypto API. The existing IMA code only solves part of the integrity problem, leaving the detection of offline attacks against disk files (e.g. by mounting the disk under another OS) to EVM. If EVM is to eventually be added to the kernel to complete the integrity verification puzzle, then trusted keys or something similar will be needed. So far, the patches have attracted few comments or complaints, but they were posted to various Linux security mailing lists, and have not yet run the linux-kernel gauntlet. Linux is a registered trademark of Linus Torvalds
http://lwn.net/Articles/408439/
CC-MAIN-2013-20
refinedweb
1,014
52.94
Introducing SharePointR Recently there’s been a lot of great press on a async signallying libarary called SignalR. SignalR is the brainchild of Microsoft employee David Fowler and helps you build real-time, multi-user interactive web applications. The last year I’ve been working with a top team in Redmond on rewriting SharePoint into a complete JavaScript version that runs in the client which we’re now calling SharePointR. SharePointR is a client side version of SharePoint offers all of the base functionality that SharePoint 2010 has but boasts a 300% improvement in speed and productivity for the Information Worker. Along with key features that can only be offered in a client side product, SharePointR comes out of the box with social media integration so there’s no need to build any third party solution. Technology. Creator David Fowler sounds a little confusing about the product and had this to say. Not really sure what it means though: Here’s a production product yesterday and predictive rasterized integration legacy fully operating on leftover server data and yup. Creating a new instance of SharePointR is a breeze: 1. Create a SharePointR hub: [HubName("sharePointHub")] public class SharePointRHub : Hub { private readonly SharePointR _server; public SharePointRHub(SharePointR server) { _server = server; } } 2. Create a connection between the server and your client: var sharePointRHubClient = $.connection.sharePointRHub; // Start the connection $.connection.hub.start(function() { sharePointRHubClient.join('domain\user'); }; That’s it! You now have a fully functional SharePointR server running anywhere you want. How do you interact with it? Simple. It uses all the classes you’re familiar with in SharePoint land, just in SignalR style. Here’s how to get a listing of documents in a document library and display the list name and number of items in a HTML div tag (called output): var server = $.connection.sharePointR; server.lists["Shared Documents"].foreach(function(){ $("#output").append("" + name + " items = " + items.getCount()); }); Bonus BizTalk Integration In addition to just a SharePoint server at your fingertips, SharePointR also includes a fully baked BizTalk server (based on BizTalk 2010). It’s drop dead easy to integrate with it using SharePointR: var biztalk = $.connection.sharePointR.bizTalkR; biztalk.transport.sendPort = 25; var json = biztalk.send("SELECT * FROM Northwind.Customers").toJson(); $("#datagrid").load(json); With 4 lines of code I just contacted the BizTalk server, issued a command to submit a SQL query on a send port via SMTP and returned a JSON array that I fed into a jQuery datagrid. How easy is that? SharePointR is Open Source Just as the ASP.NET MVC team recently announced open sourcing the ASP.NET stack, the SharePointR team has open sourced the product in the same fashion. I’m very excited about this because not only does it mean SharePointR is licensed under an open source license (Apache 2.0) but the SharePointR team is now accepting contributions! Yes, now the SharePointR team will ship community code inside the core product. How do you get involved? Simple. - Find a bug? Send a unit test or fix it. -. Implementation To install SharePointR just use NuGet in your browser by going to then issuing the command: Install-Package SharePointR.Server This will bring down the server package and give you everything you need to run SharePointR. Additional packages can be installed via NuGet. These are: - SharePointR.Bdc – Business Data Catalog - SharePointR.Publishing – Content publishing subsystem - SharePointR.PowerPivot – Powerful reporting via Excel - SharePointR.Social – All the social media elements of SharePointR Integrated Services Some of the new features of SharePointR that we’re announcing is complete integration with Instagram, the fast, beautiful, and fun way to share your photos. With SharePointR you’ll be able to upload photos to a SharePointR picture library and in the background the pictures are automatically posted to the Instagram photo service. This is done behind the scenes so there’s nothing you need to do except setup your Instagram account and password in the system settings: PInterest meets SharePointR The Like system from SharePoint 2010 has been abandoned in favour of a deep link integration with PInterest. Now users can tag documents, photos, videos, and files in SharePointR and have them immediately posted to PInterest. The integration doesn’t just go one way, it’s two-way with SharePointR pulling in your pins and boards and allowing you to navigate them in the familiar SharePoint UI. Native QR Code Support The SharePointR team thought that QR codes are the greatest invention since the modem and felt they had to be natively included in the product. And they are! Now you can configure a Document Library or SharePointR list to produce a QR code automatically. We’ll be releasing QR code generation on a per-item level in a future Service Pack. Availability SharePointR is available now! Just install it via the NuGet package or you can grab the source code off GitHub. What are people saying about SharePointR? Take a look! I hope this sheds some light on what’s happening with the next version of SharePoint and that you see this as a benefit to your organization. While it does mean all your server side code has to be redone, the CoffeeScript tool will help with that so migration to SharePointR should be quick and seamless. Please don’t hesitate to contact me on Twitter (@bsimser) or via comments below on more questions about SharePointR!
http://weblogs.asp.net/bsimser/introducing-sharepointr
CC-MAIN-2015-18
refinedweb
897
55.95
On 16.02.2010, at 01:52, Rob Landley wrote: > On Monday 15 February 2010 07:08:33 Michael S. Tsirkin wrote: >> On Mon, Feb 15, 2010 at 06:58:33AM -0600, Rob Landley wrote: >>> On Monday 15 February 2010 05:19:24 Alexander Graf wrote: >>>> On 15.02.2010, at 12:10, Rob Landley wrote: >>>>> On Sunday 14 February 2010 08:41:00 Alexander Graf wrote: >>>>>> So the only case I can imagine that this breaks anything is that >>>>>> uClibc requires register state to be 0. >>>>> >>>>> Yes, r3 (which is the exit code from the "exec" syscall, and thus 0 >>>>> if it worked). In the BSD layout, it's argc (which can never be 0). >>>>> >>>>> >>>> >>>> So what you really want is something like >>>> >>>> #ifdef CONFIG_LINUX_USER >>>> /* exec return value is always 0 */ >>>> env->gpr[3] = 0; >>>> #endif >>>> >>>> just after the #endif in your patch. If you had inlined your patch I >>>> could've commented it there. >>> >>> Unfortunately kmail plays fast and loose with whitespace when I inline >>> stuff. (Not always, but I can't tell by inspection when it's decided it >>> was hungry for tabs or wanted to throw in that horrible UTF8 escaped >>> whitespace.) >> >> See Documentation/email-clients.txt under linux source tree. > > I did. That doesn't cover the different bugs in different versions, what > happens when you use kmail under xfce, and so on. (It also doesn't mention > that you have to disable wordwrap for the entire message and hit return by > hand at the end of each line to get kmail not to wrap inline includes. Or > that some versions of kmail embed NUL bytes into inline includes, for some > reason.) > > I could make it work, just didn't know this list had a tropism for inline. > (Varies per list and I wander through a bunch of 'em.) Over on the -hda sets > /dev/hdc topic I posted a patch inline which was ignored because the behavior > the Linux kernel has consistently had for the past decade or more isn't > considered especially important. Thus I didn't think you were likely > following lkml tropes. If swapping the parameter was the right solution I would've submitted a patch long ago :-). Unfortunately it's not as easy. But the inlining is really only about simple commenting. It's a lot nicer to have context when you say "this doesn't make sense" or so :-). Either way - it's good to see someone interested in the topic actually sending patches. Reviewing and commenting doesn't mean I don't like what you're doing. In this case it just means I'm pretty sure it doesn't solve the problem, but only the symptoms. Alex
https://lists.gnu.org/archive/html/qemu-devel/2010-02/msg01025.html
CC-MAIN-2022-27
refinedweb
450
71.04
Systems and methods for transforming query results into hierarchical informationDownload PDF Info - Publication number - US7213017B2US7213017B2 US10623369 US62336903A US7213017B2 US 7213017 B2 US7213017 B2 US 7213017B2 US 10623369 US10623369 US 10623369 US 62336903 A US62336903 A US 62336903A US 7213017 B2 US7213017 B2 US 7213017B2 - Authority - US - Grant status - Grant - Patent type - - Prior art keywords - lt - xml - data - name - is a continuation-in-part application of commonly assigned U.S. patent application Ser. No. 09/528,078, filed Mar. 17, 2000 now U.S. Pat. No. 6,708,164, entitled “Transforming Query Results into Hierarchical Information.” 2000–2003, Microsoft Corp. The present invention relates to data processing, and more particularly to the generation of hierarchical information in the context of transformational systems. Two trends in networked computing are (1) the increasing use of hierarchical information systems, such as the eXtensible Markup Language (XML), for information exchange among networked applications and (2) the continuing and increasing use of relational database systems for managing businesses. These trends are likely to continue and accelerate in the future. XML is widely used for exchanging hierarchical information in networked systems, such as local area networks, wide area networks, and the Internet. XML is one of the most important and most widely accepted standards to disseminate data and information between different applications over, i.e., XML can transfer information about complex data relationships in a single, easy to understand form. Relational database systems provide access to a significant percentage of all the information stored in modem business information processing systems. Relational database systems also allow users of the data to easily access and process the information stored in the systems from both local and remote locations. Unfortunately, a database query executed against a relational database returns information in the form of rowset(s) encoded either in binary or in nonstandard character format. A large amount of both the existing and new data that is and will be disseminated in such ways will be stored in database systems. It is therefore important that the database system provides the programmer with the means to deliver XML for any query running against the database in this context. There is also a need to provide the programmer with the means to formulate such a query in a simple, and easily understood manner. For these and other reasons there is a need for the present invention. In consideration of the above-mentioned shortcomings, disadvantages and problems, various embodiments of the invention are implemented in connection with a database, such as a relational database, which processes a query and returns rowset(s) to the process initiating the query. The present invention also relates to systems and methods for implementing a rowset to XML formatter or aggregator that receives as input one or more relational rowsets and potentially some corresponding lineage data and generates a hierarchical serialization, e.g., XML serialization, of the data represented by the rowset(s). The invention enables an application programmer to formulate one or more queries and return the result(s) in a hierarchical format, such as XML, enabling Web Servers and the application programmer to deliver Web-aware data in a standard format. In one aspect, the invention facilitates the composition of query expressions to generate nested hierarchical structures more easily than previous formulations and provides simpler semantics, without implicit hierarchy inference. The syntax of an improved formulation of the hierarchical information formatter, or formatting function, in accordance with the invention includes optional arguments including a name option, a root option, map option, namespace options and a null option. Other features and embodiments of the present invention are described below. The file of this patent includes at least one drawing executed in color. Copies of this patent with color drawings will be provided by the United States Patent and Trademark Office upon request and payment of the necessary fee. The systems and methods for transforming query results into hierarchical information in accordance with the present invention are further described with reference to the accompanying drawings in which: Hardware Operating Environment Referring to. Exemplary Embodiments of the Invention 64 In one embodiment, the generic identifiers (GI), tag numbers, attribute names, and directives are encoded in the column names as GI!TagNumber!AttributeName! Directive. A generic identifier provides the resulting element's generic identifier, which for example universal table 311 shown in. Hierarchical Information Formatting Function—Alternative Embodiments In further embodiments of the invention, a hierarchical information formatting or aggregating function, e.g., XML formatter or aggregator, is provided that is accepted everywhere a function that results in an XML datatype is accepted. For instance, for use in connection with SQL, the following non-limiting exemplary syntax may be utilized to replace, or supplement, the above-described embodiments relating to the functionality of the FOR XML function: XML(rowsetexpr [, Options]) where rowsetexpr is any valid relational database select statement (including order by clause, excluding group by clause). Since nesting of formatters is allowed inside select statements, these rowset expressions are basically subqueries that can correlate to their containing queries. Options indicates one or more of the following options: name=“QName” root=“QName” map=(element|attribute|path) namespace NCName=“anyURI”|default namespace=“anyURI” null=(absent|xsinil|empty) Multiple options are comma-separated. The option keywords are case-insensitive. QName is a valid XML QName according to the QName productions in, NCName is a valid XML NCName according to the NCName productions in and anyURI is any valid universal resource identifier (URI). Examples of the use of the XML formatting or aggregating function are as follows: XML(select * from Customers) XML(select * from Customers, name=“foo:Customer”, map=attribute, namespace foo=“http:Hexample.com”, null=xsinil) Semantically, the XML formatting or aggregating function transforms a rowset into an XML datatype instance by mapping each row into an element. In various non-limiting embodiments of the invention, if no options are specified, default behavior of the XML formatting or aggregating function is to map every row in the rowset to an XML element as follows: (1) If the rowset is empty, the XML datatype is NULL (and not empty), (2) Every row maps to an element in the order the rows are returned. The name of the element that represents the row is ‘row’. In this regard, the generated element name for the rows can be overwritten by the name option, (3) Every column maps to a subelement of the row element in the order the columns appear in the rowset as follows, which can be overwritten with the map options: (a) A NULL value in a column by default maps to the absence of the subelement, which can be overwritten with the null option. (b) Any column without a name is inlined. If the column type is XML, then it inserts the content of the XML datatype instance (document nodes are dropped); otherwise, it is inserted as a text node. (c) Any column with a name is mapped case-sensitive to a subelement whose name is the partially encoded column name according to the name encoding scheme (See, e.g., section 7.1 of ISO SQL/XML with amendment ICN-25) and (4) Values of cells are mapped by following the type-sensitive mapping of relational values to XML values (See, e.g., section 7.16 of ISO SQL/XML) and based on existing FOR XML/XQuery value serialization. Binary columns are exposed in base 64 encoding. Three examples follow: As mentioned, the syntax of the XML formatter or aggregator, or formatting or aggregating function, in accordance with presently described embodiments has optional arguments including: a name option, a root option, map option, namespace options and a null option. Semantically, they are used as follows: The name option enables overwriting the name of a row element. Its value is case-sensitive and follows the QName rules according to, or else is empty. If the value of the name option is not a valid QName or an empty string, an error is raised. If the lexical representation of the QName includes a namespace prefix, the namespace prefix is bound to a namespace URI using the namespace option, described in more detail below. If the QName is an empty string, then the row element tag and any potentially contained attributes are dropped. Four exemplary usages of the name option are as follows: The root option is utilized to wrap the row elements with a single element tag. Its value is. case-sensitive and follows the QName rules according to. If it is not a valid QName, an error is raised. If the lexical representation of the QName includes a namespace prefix, the namespace prefix is bound to a namespace URI using the namespace option, described in more detail below. Three exemplary usages of the root option include: The map option enables overwriting of the default element-centric (element) row mapping described above with an attribute-centric (attribute) mapping or a mapping interpreting the names as paths (path). In one embodiment, only one of these map options can be specified per the XML formatting or aggregating function. If more are specified, an error is raised. It is noted that the map option can be implemented in connection with the embodiments relating to the FOR XML described above. Moreover, the explicit, auto1 and auto2 modes described above can be implemented as map options in the presently described embodiments. The “map=element” option maps all rows to subelements regardless of the presence of ‘@’ or ‘/’. The names are partially encoded. The “map=element” option is the default behavior. The “map=attribute” option maps all rows to attributes regardless of the presence of ‘@’ or ‘/’. The names are partially encoded. A NULL value in a column by default maps to the absence of the attribute. This can be overwritten with the null option. If a column has no name, an error is raised. If more than one attribute receives the same name, an error is raised. Also, if the datatype of the row cannot be mapped to an attribute (e.g., because it contains an XML subtree), then an error is raised. If a column name starts with xmlns, an error is raised. The “map=path” option maps columns in the order they appear in the rowset to attributes or subelements by interpreting the column names as a path according to the following rules: Any column without a name is inlined. If the column type is XML, then the content of the XML datatype instance is inserted, while dropping document nodes; otherwise, it is inserted as a text node. Any column with a name is mapped case-sensitive in the following way: If the name does not start with a ‘@’ or does not contain a ‘/’, an XML element that is a subelement of the row element containing the column value is created. The subelement name is the partially encoded column name according to the name encoding scheme (See, e.g., section 7.1 of ISO SQL/XML with amendment ICN-25, hereby incorporated by reference). If the name starts with a ‘@’ and does not contain a ‘/’, an attribute of the row element containing the column value is created. The attribute name is the partially encoded column name without the leading ‘@’ according to the name encoding scheme. If more than one attribute receives the same name, an error is raised. Also, if the datatype of the row cannot be mapped to an attribute (e.g., because it contains an XML subtree), then an error is raised. In one embodiment, attributes come before elements on the same level. Otherwise, an error is raised. If an attribute name starts with the prefix xmlns, an error is raised to avoid dynamic setting of namespace declarations. If the name does not start with a ‘@’ and contains a ‘/’ then the name indicates a hierarchy. Assuming a name is broken into name1/name2/. . . /namen. Then each namei (1<=i<n) represents an element that is nested under the current row element (i=1) or under the element with the name namei-1. If namei (i<n) starts with ‘@’, then an error is raised namen is mapped to an attribute of namen-1 if it starts with a ‘@’ or a subelement otherwise. See, e.g., above rules and sub rules relating to case-sensitive mapping columns with a name. All names are partially encoded. If the name starts with a “/”, the “/” is disregarded. If several subsequent columns share the same path prefix, they are grouped together under the same elements. If a column with a different name is occurring in between, it breaks the grouping. A NULL value in a column per default maps to the absence of the leaf attribute or subelement, which can be overwritten with the null option. Any elements added by the rule pertaining to the scenario wherein the name does not start with a ‘@’ and contains a ‘/’ are always inserted. Five exemplary uses of the map option include: The namespace options provide a way to associate a namespace to a prefix or a default namespace. The syntax for a namespace option is as follows: - namespace NCName=“anyURI”|default namespace=“anyURI” - where NCName is a valid XML NCName according to the NCName productions in and anyURI is any valid namespace URI. If the same prefix is being associated more than once in the same XML formatting or aggregating function, an error is raised. The namespace declaration is added to the outermost XML element returned by the XML formatter or aggregator, or XML formatting or aggregating function. If there is more than one top-level XML element, it is added to all the top-level elements. It can be appreciated that an XML formatter or aggregator nested within another XML formatter or aggregator inherits all namespace associations and is allowed to overwrite them. See, e.g., below the descriptive material relating to XML formatter or aggregator nesting. If anyURI is an empty string in the case of a default namespace declaration, then the default namespace prefix is undefined. This can be used to overwrite an inherited default namespace. Two exemplary uses of the namespace options are as follows: In this first example, it is noted that the y element is associated with the default namespace. In this second example, it is noted that the y attribute is not associated with the default namespace. The null option overwrites the default mapping of NULL values described above. Only one of the options can be specified per XML formatter or aggregator. If more than one is specified, an error is raised. The null option provides three values: absent, xsinil, or empty. The “absent” value is the default behavior. A NULL value results in the absence of its containing attribute or subelement. The “xsinil” value adds the namespace declaration for the XML Schema instance namespace URI xmlns:xsi=“” and adds xsi:nil=“true” to every subelement that represents a cell containing NULL. If the cell/column is mapped to an attribute while xsinil is specified, the attribute is still absent. The “empty” value represents the NULL value with an empty string as the value of the attribute or subelement. The null option also impacts the NULL handling of the root element if one has been specified. Based on the two tables A and B in Table I above, six exemplary uses of the null option are presented below: XML formatters or aggregators can be nested to achieve nested XML trees. If they are nested inside selections, they have access to the externally bound variables for correlation purposes. Based upon tables A and B in Table I, exemplary use of nested XML formatters or aggregators to achieve nested XML trees is depicted in Since the formatter acts as a computed column, the first formatter call is not wrapped in an XML column element. Since it returns a NULL XML datatype instance if the input rowset is empty, the second formatter call will return an absent C element for the last C. This could be overwritten with the null option to either get an element C with empty content or with the xsi:nil attribute set. Namespaces (including default namespaces) are inherited in contained XML subtrees. An explicit “undeclare” is added if the outermost formatter declares a default namespace and the innermost data is be kept outside of the default namespace. For example, In various embodiments, the invention optionally includes a variety of features. For instance, a default XML view over relational data can be defined. Thus, XML(SELECT * FROM X, map=element, name=“X”, name_enc=full) can represent the default XML view over a relational database. With respect to adding inline schema, the invention can be augmented with an Addschema function as follows: Addschema(XML): XML which infers inline schema and prepends it to the XML, while recognizing and avoiding namespace collisions. With respect to adding functionality relating to “empty” and “absent” on a per column basis, the invention optionally extends xsinil, whereby empty and absent take names of columns to individually indicate NULL mapping. For instance, the following exemplary pseudocode is illustrative: - XML(select a, b, c, d as “@d” from T, null=xsinil(a), null=empty(b,@d), null=absent(c)) With respect to name encoding, the invention adds an option to set name encoding to full, which may be parameterized by column. With respect to implementing a droptag on a per column basis, the invention adds an option to drop a containing element tag (with contained attributes). For instance, the following exemplary pseudcode: - XML(select a, b from T, droptag(a)) results in the following hierarchical information: To indicate binhex instead of base 64 encoding, the invention adds an option to change base 64 to binhex encoding. For instance, the following exemplary pseudocode: - XML(select a, b from T, binary=binhex(a)) results in the following hierarchical information: Lastly, a hide option can be implemented to hide rows that are passed from SELECT. This may be useful, for instance, when operating over a SELECT GROUP BY to drop otherwise required columns. There are multiple ways of implementing the present invention, e.g., an appropriate API, tool kit, driver code, operating system, control, standalone or downloadable software object, etc. which enables applications and services to use the query and query result transformation techniques of the invention. The invention contemplates the use of the invention from the standpoint of an API (or other software object), as well as from a software or hardware object that communicates in connection with requesting any kind of data. retrieve data. Thus, the techniques reusable control, as a server object, as an application programming interface,. Moreover, it can be appreciated that many of the examples illustrated and described herein show an expression and/or its result, but not a full statement. data transformation techniques of the present invention, e.g., through the use of a data processing API, reusable control,. Further, as used herein, the term “module” shall mean any hardware, firmware or software component, or any combination thereof. In addition, the term “database server” includes not only relational database servers, but also other database servers, such as object oriented database servers..
https://patents.google.com/patent/US7213017?oq=5%2C815%2C794
CC-MAIN-2018-13
refinedweb
3,188
50.57
The QScriptContext class represents a Qt Script function invocation. More... #include <QScriptContext> This class was introduced in Qt 4.3.. Use thisObject() to get the `this' object associated with the function call, and setThisObject() to set the `this' object. Use isCalledAsConstructor() to determine if the function was called as a constructor (e.g. "new foo()" (as constructor) or just "foo()"). Use throwValue() or throwError() to throw an exception. Use callee() to obtain the QScriptValue that represents the function being called. Use parentContext() to get a pointer to the context that precedes this context in the activation stack. Use engine() to obtain a pointer to the QScriptEngine that this context resides in. Use backtrace() to get a human-readable backtrace associated with this context. This can be useful for debugging purposes when implementing native functions. See also QScriptEngine::newFunction() and QScriptable. This enum specifies types of error. This enum specifies the execution()). See also argument().(). Returns a human-readable backtrace of this QScriptContext. Each line is of the form <function-name>(<arguments>)@<file-name>:<line-number>. See also QScriptEngine::uncaughtExceptionBacktrace(). Returns the callee. The callee is the function object that this QScriptContext represents an invocation of. Returns the QScriptEngine that this QScriptContext belongs to. Returns true if the function was called as a constructor (e.g. "new foo()"); otherwise returns false. When a function is called as constructor, the thisObject() contains the newly constructed object to be initialized. Returns the parent context of this QScriptContext. Sets the activation object of this QScriptContext to be the given activation. See also activationObject(). Sets the `this' object associated with this QScriptContext to be thisObject. See also thisObject(). Returns the execution state of this QScriptContext. Returns the `this' object associated with this QScriptContext. See also setThisObject(). Throws an error with the given text. Returns the created error object. The text will be stored in the message property of the error object. See also throwValue() and state(). This is an overloaded member function, provided for convenience. Throws an error with the given text. Returns the created error object. See also throwValue() and state(). Throws an exception with the given value. Returns the value thrown (the same as the argument). See also throwError() and state().
http://doc.trolltech.com/4.3/qscriptcontext.html
crawl-002
refinedweb
368
54.59
# Set up imports and matplotlib options %pylab inline import numpy as np import matplotlib.pyplot as plt import quantities as pq from matplotlib import rc rc('font',**{'family':'sans-serif', 'sans-serif': 'Helvetica, Arial', 'weight': 'medium', 'size': 18}) rc('text', usetex=False) rc('lines', linewidth=3) Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline]. For more information, type 'help(pylab)'. Python is widely used for translating scientific ideas to code. Excellent packages are available to do the types of things that scientists do on a daily basis. In this set of examples, I'm going to try to convince you that Quantities should also be in the list of packages scientists use on a daily basis. The following question comes from Physics: Principles and Problems by Paul Zitzewitz. A hockey puck, mass 0.115 kg, moving at 35.0 m/s, strikes a rubber octopus thrown on the ice by a fan. The octopus has a mass of 0.265 kg. The puck and octopus slide off together. Find their velocity. The solution to this is based on the conservation of momentum: the momentum of moving puck and the stationary octopus before the collision is equal to their combined momentum after the collision.\begin{aligned} m_p v_p + m_o v_o &= (m_p + m_o) v_{po} \\\\ v_{po} &= \frac{m_p v_p + m_o v_o}{m_p + m_o} \\\\ v_{po} &= \frac{0.115 \times 35 + 0.265 \times 0.0}{0.115 + 0.265} \end{aligned} Let's use Python to do this computation. mp = 0.115 vp = 35.0 mo = 0.265 vo = 0.0 v = (mp * vp + mo * vo) / (mp + mo) print v 10.5921052632 To explore the situation being described in this question, we can try changing some of these values and redoing the computation. An obvious thing to change would be the puck speed. How does the velocity of the combined puck and octopus (pucktopus) change when the puck has a higher initial speed? vp = 40.0 v = (mp * vp + mo * vo) / (mp + mo) print v 12.1052631579 vp = np.arange(51.) v = (mp * vp + mo * vo) / (mp + mo) print v [ 0. 0.30263158 0.60526316 0.90789474 1.21052632 1.51315789 1.81578947 2.11842105 2.42105263 2.72368421 3.02631579 3.32894737 3.63157895 3.93421053 4.23684211 4.53947368 4.84210526 5.14473684 5.44736842 5.75 6.05263158 6.35526316 6.65789474 6.96052632 7.26315789 7.56578947 7.86842105 8.17105263 8.47368421 8.77631579 9.07894737 9.38157895 9.68421053 9.98684211 10.28947368 10.59210526 10.89473684 11.19736842 11.5 11.80263158 12.10526316 12.40789474 12.71052632 13.01315789 13.31578947 13.61842105 13.92105263 14.22368421 14.52631579 14.82894737 15.13157895] Note that we didn't have to change the update for v at all; NumPy just does the calculation with all of the vp values! Outputting the numbers is a bit too much to process visually, so let's instead plot this data on a graph. plt.plot(vp, v) [<matplotlib.lines.Line2D at 0x10aded1d0>] We can easily see that there is a linear relationship between the velocity of the puck before the collision and the velocity of the pucktopus after the collision. What if, instead, we varied the mass of the puck? vp = 35.0 mp = np.arange(0., 2.05, 0.05) v = (mp * vp + mo * vo) / (mp + mo) plt.plot(mp, v) [<matplotlib.lines.Line2D at 0x10372e210>] This looks logarithmic, which is much more interesting! As we increase the mass of the puck, the pucktopus velocity quickly increases, but starts to plateau as we reach 1.0 kg. However, if we handed in these scripts to our high school Physics teacher, he or she might be impressed by the Python scripts, but will ultimately mark us down for not including our units. Recall the original problem: A hockey puck, mass 0.115 kg, moving at 35.0 m/s, strikes a rubber octopus thrown on the ice by a fan. The octopus has a mass of 0.265 kg. The puck and octopus slide off together. Find their velocity. The real solution is$$v_{po} = \frac{0.115 \\,kg \times 35 \\,m/s + 0.265 \\,kg \times 0.0 \\,m/s}{0.115 \\,kg + 0.265 \\,kg}$$ Putting the units in allows us to do dimensional analysis, to be sure that we're doing the right computation.\begin{aligned} m/s &= \frac{kg \cdot m / s + kg \cdot m / s}{kg + kg} \\\\ m/s &= \frac{kg \cdot m / s}{kg} \\\\ m/s &= m/s \end{aligned} Adding in units isn't academic, it has real-world implications. An often cited example is the Mars Climate Orbiter, which crashed into the atmosphere of Mars because one of its subsystems represented force in Imperial pounds and another subsystem used Newtons. While a costly mistake for Nasa, it has served as a very nice example to remind scientists that we teach people to use units for a reason! The first time any scientist uses units, it's done in the following (bad) way. mass_p = 0.115 # kg velocity_p = 35.0 # m/s mass_o = 0.265 # kg velocity_o = 0.0 # m/s velocity = ((mass_p * velocity_p + mass_o * velocity_o) / (mass_p + mass_o)) # m/s Verbose variable names and comments may help some, but they are terribly inconvenient, as you constantly have to look up the decalaration of each variable, and you don't gain anything tangible from this. It's like putting post-it notes on every item in your junk drawer. Fortunately, there are plenty of Python packages available for adding units to your code. unum buckingham magnitude piquant units dimpy quantities Each has their own advantages and disadvantages. In my research, I use quantities because it integrates well with NumPy and Matplotlib, and the syntax makes sense to me. With Quantities imported as pq, our code becomes mp = 0.115 * pq.kg vp = 35.0 * (pq.m / pq.s) mo = 0.265 * pq.kg vo = 0.0 * (pq.m / pq.s) v = (mp * vp + mo * vo) / (mp + mo) print v 10.5921052632 m/s Our answer now includes the units! Already, our code is easier to use than before incorporating units. Dimensional analysis is happening in the background, as well. Observe what happens when the units are omitted from one of the numbers. vo = 0.0 # It's just zero, who cares... v = (mp * vp + mo * vo) / (mp + mo) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) /Users/Trevor/Programming/git/pyconca2012/<ipython-input-8-7255462974c5> in <module>() 1 vo = 0.0 # It's just zero, who cares... ----> 2 v = (mp * vp + mo * vo) / (mp + mo) /Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/quantities/quantity.pyc in g(self, other, *args) 61 other = other.view(type=Quantity) 62 if other._dimensionality != self._dimensionality: ---> 63 other = other.rescale(self.units) 64 return f(self, other, *args) 65 return g /Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/quantities/quantity.pyc in rescale(self, units) 194 raise ValueError( 195 'Unable to convert between units of "%s" and "%s"' --> 196 %(from_u._dimensionality, to_u._dimensionality) 197 ) 198 return Quantity(cf*self.magnitude, to_u) ValueError: Unable to convert between units of "kg" and "kg*m/s" This occurs because now we're trying to add a number in $kg$ to a number in $kg \cdot m/s$. quantities is built on top of NumPy (its Quantity class is a subclass of numpy.ndarray), which means we can do the same exploration as before with no change in the code aside from declaring our variables with units. mp = np.arange(0., 2.05, 0.05) * pq.kg vp = 35.0 * (pq.m / pq.s) mo = 0.265 * pq.kg vo = 0.0 * (pq.m / pq.s) v = (mp * vp + mo * vo) / (mp + mo) plt.plot(mp, v) [<matplotlib.lines.Line2D at 0x10adb8cd0>] It also provides some nice shortcuts to make nicer, less error-prone plots. plt.xlabel("Mass of puck in " + mp.dimensionality.string) plt.ylabel("Velocity of pucktopus in " + v.dimensionality.string) plt.plot(mp, v) [<matplotlib.lines.Line2D at 0x10b536850>] Sometimes we're dealing with a non-standard quantity, or we want to translate a real quantity to something we're using in our code (e.g., a mapping from real-world lengths to length in terms of pixels in a GUI application). Suppose we're part of the PyCon Canada organizing team. If every PyCon attendee drinks on average 200 mL of milk, how many bags of milk should we order? To make a new unit, we use the UnitQuantity class. bags = pq.UnitQuantity('milk bags', pq.L * (4. / 3.)) person = pq.UnitQuantity('person', pq.dimensionless * 1) This puts our new units (milk bags and persons) in terms of known units. A milk bag is 4/3 L, and a person is 1 thing that doesn't have a dimension. We can then express our need in terms of milks bags and persons. need = 200 * (pq.mL / person) If there are 250 PyCon attendees, then we would need to buy need *= 250 * person print need 50000.0 mL of milk. This is a big number; let's express it in litres instead. print need.rescale(pq.L) 50.0 L Since we have defined how milk bags translate to litres, we can put this quantity in terms of milk bags instead. print need.rescale(bags) 37.5 milk bags We can't purchase fractional bags. But since a Quantity is a subclass of ndarray, we can use NumPy's number manipulation capabilities to give us a clean answer. print np.ceil(need.rescale(bags)) 38.0 milk bags print need.item() print need.rescale(bags).item() 50000.0 37.5 These toy examples have hopefully convinced you that physical quantities are easy to use. But what about when you scale up to real scientific research code? I originally started using quantities because it is used by Python-Neo, a package I use for neuroscientific data analysis. In my experience, I have had very few occasions where I had problems because of quantities, but many occasions where using quantities has improved my code significantly. One of the types of data that neuroscientists collect is the times at which a neuron spikes. We can generate some sham data (that doesn't match the statistics of real spike trains, but is good enough for illustrative purposes) with the following function. def generate_spikes(filename, neurons=20, time=20 * pq.s, event=11 * pq.s): with open(filename, 'w') as f: # Choose random rates rates = np.random.randint(2, 10, size=neurons) * pq.Hz for rate in rates: # Randomly generate spikes spikes = np.random.uniform(0, time, size=time * rate) # Add spikes around the event spikes = np.append(spikes, np.random.normal(event, size=rate * 5)) # Sort and save to text file np.savetxt(f, (np.sort(spikes),), fmt="%f", delimiter=', ') # Uncomment to call this function # generate_spikes("spikes.csv") We can then load that comma-separated value file into a list of numpy arrays with the following function. Note that this cannot be loaded into a two-dimensional array because each individual spike train may be of different length. def load_spikes(filename): with open(filename, 'r') as f: lines = f.readlines() return [np.array(map(float, line.split(','))) for line in lines] spiketrains = [st * pq.s for st in load_spikes("spikes.csv")] We can plot these spike trains using a scatterplot. This is called a spike raster plot. def raster_plot(spiketrains, event=None, window=None): plt.clf() # Start a fresh plot if event is not None: event.units = spiketrains[0].units plt.axvline(event, lw=2, color='r') plt.text(event, len(spiketrains) + 0.01 * len(spiketrains), "Event", color='r', horizontalalignment='center', fontsize=12) if window is not None: window.units = spiketrains[0].units plt.axvspan(event + window[0], event + window[1], facecolor='#9696FF', zorder=0, ec='none') lastspike = 0.0 * pq.s firstspike = np.amin(spiketrains[0]) for j, st in enumerate(spiketrains): lastspike = max(lastspike, np.amax(st)) firstspike = min(firstspike, np.amin(st)) plt.scatter(st, j * np.ones(st.shape), marker='|', color='k') plt.ylim(-1, len(spiketrains)) plt.xlim(firstspike, lastspike) plt.xlabel("Time in " + spiketrains[0].dimensionality.string) plt.tight_layout() plt.show() raster_plot(spiketrains) Now that we have some spike trains, we want to do some data analysis. While these spike trains are over a 20 second period, experimentally recorded spike trains can be extremely long -- it could be hours' worth of data. We usually only want to do analysis around experimentally salient events. Let's suppose such an event happens 11 seconds into the recording time. event = 11 * pq.s raster_plot(spiketrains, event=event) Let's look at the spikes 0.5 s before the event, and 2 seconds after the event. window = (-0.5, 2) * pq.s raster_plot(spiketrains, event=event, window=window) def time_slice(spikes, tstart, tend): return spikes[np.logical_and(tstart <= spikes, spikes < tend)] perievent = [time_slice(spikes, event + window[0], event + window[1]) for spikes in spiketrains] raster_plot(perievent, event=event) We can do these same functions in terms of milliseconds without changing anything! event = 7000 * pq.ms window = (-2500, 1000) * pq.ms raster_plot(spiketrains, event=event, window=window) We can even mix units! event = 5.0 * pq.s window = (-1000, 1000) * pq.ms raster_plot(spiketrains, event=event, window=window) Sometimes in order to do calculations, we need to "bin" the spikes; that is, we discretize time into a finite set of bins, and sum up the number of spikes that occur within that time bin. Often this binning requires confusing calculations in order to determine the number of bins in a time window. With quantities, however, this is easy. def bin_spikes(spikes, tstart, tend, binsize): binsize.units = tstart.units bins = np.arange(tstart, tend + binsize, binsize) return np.histogram(spikes, bins=bins)[0] binsize = 20 * pq.ms binned = np.vstack([bin_spikes(st, 0 * pq.s, 20 * pq.s, binsize) for st in spiketrains]) To plot the result, we can use pcolormesh to make an image in which the color of a cell corresponds to the number of spikes in that time bin. def binned_plot(bins, window=None): plt.clf() plt.pcolormesh(bins, cmap="gray_r") if window is not None: plt.axvspan(window[0], window[1], facecolor='b', alpha=0.5, ec='none') plt.xlabel("Time bin") plt.xlim(0, bins.shape[1]) # Discrete color bars take a bit of code bounds = np.arange(0.5, np.amax(bins) + 1) norm = mpl.colors.BoundaryNorm(bounds, len(bounds) - 1) plt.tight_layout() plt.colorbar(format="%d", spacing='proportional', norm=norm, boundaries=bounds) binned_plot(binned, (525, 650)) It's easy with this code to bin only the perievent spikes. peribinned = np.vstack([bin_spikes(st, event + window[0], event + window[1], binsize) for st in spiketrains]) binned_plot(peribinned) Changing the bin size is easy, and we can use whichever units make the most sense. binsize = 50 * pq.ms binned = np.vstack([bin_spikes(st, 0 * pq.s, 20 * pq.s, binsize) for st in spiketrains]) binwindow = (event + window).rescale(binsize.units) / binsize binned_plot(binned, binwindow) binsize = 0.05 * pq.s binned = np.vstack([bin_spikes(st, 0 * pq.s, 20 * pq.s, binsize) for st in spiketrains]) binwindow = (event + window).rescale(binsize.units) / binsize binned_plot(binned, binwindow)
https://nbviewer.jupyter.org/github/tbekolay/pyconca2012/blob/master/QuantitiesTutorial.ipynb
CC-MAIN-2020-40
refinedweb
2,554
69.18
Agenda See also: IRC log >fjh: Scribe: Sean Mullan fjh: fjh: plenary planned for Oct 20-24, start planning for it ... need to register also fjh: F2F planning ... hal: Oracle can potentially host in Redwood City esimon2: +1 to Redwood! brich: the registration link is bal: also could host but Seattle in Feb may not be best time of year fjh: fjh: xades plugfest coming up fhirsch3: Minutes 16 July: Minutes 17 July: RESOLUTION: Minutes from 16/17 July approved fhirsch3: Minutes 29 July RESOLUTION: 29 July minutes approved fhirsch3: Pending action items fjh: process: open action items, annotate items, can link emails as annotations, email group when action is done, go over in meeting <smullan> ACTION-9 CLOSED <trackbot> ACTION-9 Fix Tracker closed <smullan> ACTION-3 CLOSED <trackbot> ACTION-3 RNG Schema: Check on status with customer. closed <smullan> ACTION-10 CLOSED <trackbot> ACTION-10 Update wg page to include issues link closed <smullan> ACTION-11 CLOSED <trackbot> ACTION-11 Ask for XPath 2.0 presentation to group closed fjh: keep action 12 open <smullan> ACTION-14 CLOSED <trackbot> ACTION-14 Ask about namespaces/undeclarations in xml coordination group closed <fhirsch3> draft message re XPath fjh: action 20, draft message has been sent to group <smullan> ... does it look ok? <smullan> +1 <smullan> RESOLUTION: workgroup agrees message is ok gerald: no objections <smullan> ACTION-20 CLOSED <trackbot> ACTION-20 Draft message about XPath 2 presentation to mailing list closed <fhirsch3> product list is at <smullan> ACTION-26 CLOSED <trackbot> ACTION-26 Define products in tracker and associate with actions/issues closed fhirsch3: see <fhirsch3> <smullan> ACTION-2 review <smullan> tlr: still working on it <smullan> ACTION-4 still open <smullan> ACTION-5 still open <smullan> ACTION-6 : sean not the right person, need someone else <smullan> ... should be assigned to someone else <scribe> ACTION: thomas to investigate ebXML liaison (see ACTION-6) [recorded in] <trackbot> Created ACTION-31 - Investigate ebXML liaison (see ACTION-6) [on Thomas Roessler - due 2008-08-19]. ACTION-6 closed <trackbot> ACTION-6 Investigate ebxml liasion closed tlr: close action 6 and make new one assigned to tlr brich: ACTION-7 still open <smullan> ACTION-13 still open bal: ACTION-15, draft proposal sent to list <smullan> ACTION-15 CLOSED <trackbot> ACTION-15 Provide proposal on xmlsec namespace approach to identify elements to be processed closed <fhirsch3> completed with <smullan> ACTION-16 still open <smullan> ACTION-19 still open <smullan> ACTION-21 part of proposal of ACTION-15 <smullan> ACTION-21 CLOSED <trackbot> ACTION-21 Propose ways to reduce dependencies on XML specs closed <fhirsch3> completed with <smullan> ACTION-22 still open <smullan> ACTION-23 still open <smullan> ACTION-24 still open <trackbot> ACTION-23 -- Frederick Hirsch to contact EXI re signature/verification use cases -- due 2008-08-05 -- OPEN <trackbot> <trackbot> ACTION-24 -- Scott Cantor to review schema for improvements -- due 2008-08-05 -- OPEN <trackbot> <smullan> ACTION-27 still open, rob not on call <smullan> ACTION-28 still open <smullan> ACTION-29 still open <smullan> ACTION-30 still open fjh: one doc or two? ... originally 2, one for c14n, one for sig bal: start with one document then two if needed <bal> back in about 60min fjh: do we have a template for reqmts? ... no real template, but thinks we should use xmlspec fjh: suggest we take existing document as starting point fjh: could use widgets one or something else ... if you know of a template, let list know <fjh> fjh: agreed at f2f we need principles doc ... look at doc above and see if it looks good fjh: helpful if someone could write more text for each principle fjh: ask next week for resolution to accept princ. fjh: Bring forward existing requirements to keep? ... any comments on directions for requirements? hal: some requirements may end up in conflict based on work we produce <esimon2> OK to post conflicting requirements, though one should have a note indicating that it is recognized they may conflict. hal: minimum profile proposal strikes me we need to be clear about assumptions fjh: goal is to get concrete requirments down, even though may not be firm fjh: example - is processing instruction ok? fjh: should we have diff requirements for signature generation and validation? hal: clearly a possibility for anything we may deprecate tlr: no process for deprecating algs that aware of fjh: <fjh> comments from Brad Hill bhill: reemphasize point that not all signatures will be trusted pdatta: if you trust signer, not a good assumption to trust transforms? ... cross site scripting? bhill: not sure if in scope for xml sig ... "Is signed?" - yes - "GET" <smullan> are remote refs equally problematic as any detached sigs? smullan, yes tlr: is important to call out, item that people can not realize issue <bhill> issue re: entity expansion in remote DTDs and changes between validation and subsequent retrieval <bhill> consider for new c14n requirements: SOAP subset only? <bhill> relevant to algorithms for reference caching: pre vs. post c14n safety fjh: comment on list on brad's comments will next week be good time to accept changes? <smullan> .. brad on vacation next week, 2 weeks better <bhill> brad will be on vacation next week <smullan> ... who should edit doc? bhill: happy to edit if has access fjh: sig was orig ietf and w3c doc, but xml enc was not, trying to release rfc for 2nd ed to be consistent ... some feedback from ietf, still moving forward tlr: separation of normative and informative refs ... fjh: using tracker, gerald seeing if makes sense ... issues under current wg now ... issues have 3 states, closed, open, raised ... issues can be raised by anyone, wg agrees they become open but not yet doing that ... suggest we move all raised to open? <gedgar> I think that is apt <smullan> RESOLUTION: move all raised issues to open status fjh: everyone should look at issues and add notes if appropriate <gedgar> I will add descriptions <gedgar> and I will aggregate similar issues <fjh> <gedgar> place add this as an action for me. <esimon2> back in 5 <gedgar> I have to drop off. <fjh> fjh: at f2f hal suggested we have categories <fjh> categories - security, performance, features, operational errors ... go thru papers and summarize them again? ... produce requirements and assumptions, and if so any volunteers? pdatta: part of the work should go into requirements doc fjh: work on requirements first, then look at other profiles such as this one <fjh> review wg requirements draft against workshop papers and other profiles once we have a draft <fjh> <smullan> fjh: should review this and see if there is anything we want to keep kelvin: not require verifier to use full xml stack initially, reducing attack surface <smullan> kelvin: move work to signer where possible kelvin: about doing simple verification first before handing it over to an xml parser pdatta: order of attributes may be a problem kelvin: only a problem if doc is reserialized ... make assumption that xml is binary blob? ... goal - separate crypto from xml processing hal: don't see benefit to signer canonicalizing kelvin: only benefit is to maintain compat with existing algs hal: need to be really clear on assumptions fjh: maybe take a look at exi work, see similarities or compatibiliites <fjh> EXI public page <fjh> fjh: might be useful to separate issues from solution scantor: c14n may not be sufficient for the use cases that have emerged scantor: if specs prohibit PIs, then that may be fatal issue tlr: compatibility of signature as well as document format assumed, eg document that allows PIs kelvin: nothing in spec that prohibits PIs bhill: would be good to not only have more work on signer, but also allow reverse for more capable receiver <fjh> scribe: Frederick Hirsch bhill: would like to see symmetric minimal profile, either for signer or receiver <scribe> ScribeNick: tlr hal: would like to see specific proposal ... looked at this quite a lot, seen approaches where performance burden ... can be put primarily of sender / receiver <bhill> brad is concerned with existing tech's (e.g. javascript) ability to serialize in canonical form hal: not aware of any algorithm where can have simple sender by having complex receiver ... not trying to say it's impossible, but not sure... tlr: that is scott I believe scantor: can have multiple receivers need to remember this scott: also, cases where you don't worry as much about compatibility, but all sorts of cases where processing instructions likely to be problem ... in some cases, PIs might make sense, in others, not hal: long lifetime signatures, performance might not be issue hal: for long lifetime signatures, performance might not be a large issue scott: leaning that direction too ... but: attack surface ... ... document processing on the desktop fjh: I think we need to talk about this on the requirements level kelvin: strawman meant to generate discussion fjh: that works really well scott: one of the weaknesses of original spec is that, dealing with stuff at once, a very general spec was created ... instead of having multiple ones that are segmented by problem space fjh: maybe need to look at the segments separately ScottC: parallel tracks? fjh: next steps -- what would be most useful right now? <scantor> yes, that was me kelvin: postings about assumptions or requirements would be useful ... could take action item to document requirements and assumptions I was making ... <scribe> ACTION: kyiu to document requirements and assumptions in simple signing strawman [recorded in] fjh: capture two issues ... <fjh> issue: signing with multiple intended receivers, and/or long lived signatures <trackbot> Created ISSUE-45 - Signing with multiple intended receivers, and/or long lived signatures ; please complete additional details at . <fjh> issue: acceptability of PI for various environments/segments/use cases <trackbot> Created ISSUE-46 - Acceptability of PI for various environments/segments/use cases ; please complete additional details at . fjh: anything else? ... in that case, we're through the agenda ... ... close to top of the hour ... Next meeting: Next week, 10am Eastern -- adjourned --
http://www.w3.org/2008/08/12-xmlsec-minutes.html
CC-MAIN-2013-48
refinedweb
1,659
53.95
include file hidsdi.h Discussion in 'C++' started by HMS Surprise, Jan 20, 2007. - Similar Threads #include "file" -vs- #include <file>Victor Bazarov, Mar 5, 2005, in forum: C++ - Replies: - 4 - Views: - 808 - Exits Funnel - Mar 6, 2005 include file in include filePTM, Nov 12, 2007, in forum: HTML - Replies: - 1 - Views: - 470 - Andy Dingley - Nov 12, 2007 ASP Include file error <!-- #include file="" -->naveeddil, Jan 4, 2008, in forum: .NET - Replies: - 0 - Views: - 764 - naveeddil - Jan 4, 2008 /* #include <someyhing.h> */ => include it or do not include it?That is the question ....Andreas Bogenberger, Feb 21, 2008, in forum: C Programming - Replies: - 3 - Views: - 1,271 - Andreas Bogenberger - Feb 22, 2008 Re: Include and Include FileGregory A. Beamer, Jul 28, 2009, in forum: ASP .Net - Replies: - 2 - Views: - 515 - Gregory A. Beamer - Jul 28, 2009 ASP Error 0126 include file not found, when using ".." in include file path - Replies: - 10 - Views: - 699 - Mike - Jan 11, 2007 ASP Error 0126 include file not found, when using ".." in include file path - Replies: - 0 - Views: - 390 - Eric - Jan 9, 2007 Perl / cgi / include file a la #includeme, Mar 26, 2010, in forum: Perl Misc - Replies: - 10 - Views: - 1,166 - ccc31807 - Mar 26, 2010
http://www.thecodingforums.com/threads/include-file-hidsdi-h.459950/
CC-MAIN-2016-30
refinedweb
201
81.63
[Optional] Connect the root domain to the DNS namespace. An NIS+ client can be connected to the Internet using the name service switch. Workstations, if they are also DNS clients, can have their name service switch configuration files set to search for information in DNS zone files--in addition to NIS+ tables or NIS maps. Configure each client's /etc/nsswitch.conf and /etc/resolv.conf files properly. The /etc/nsswitch.conf file is the client's name service switch configuration file. The /etc/resolv.conf lists the IP addresses of the client's DNS servers; it is described in Solaris Naming Setup and Configuration Guide. Test the joint operation of NIS+ with DNS. Verify that requests for information can pass between the namespaces without difficulty. If operating NIS+ in parallel with NIS, test the transfer of information. Use the nispopulate script to transfer information from NIS to NIS+. To transfer data from NIS+ to NIS, run nisaddent -d and then ypmake. (See the man pages for more information.) Use scripts to automate this process. Establish policies for keeping tables synchronized, particularly the hosts and passwd tables. Test the tools used to maintain consistency between the NIS and NIS+ environments. Decide when to make the NIS+ tables the real source of information. Test operation of NIS+ with both DNS and NIS. Test all three namespaces together to make sure the added links do not create problems.
http://docs.oracle.com/cd/E19455-01/806-2904/6jc3d07hs/index.html
CC-MAIN-2017-04
refinedweb
236
60.11
c# constructors interview questions and answers paper 193 - skillgunNote: Paper virtual numbers may be different from actual paper numbers . In the page numbers section website displaying virtual numbers . What is the output of the following code? public class A { public A(int x) { } } public class B:A { public B(int y) { } } Code will not compile because class B is not having any fields or data members. Code will not compile because derived class constructor can not call base class constructor. Code will compile but exception while creating the object of class B. None of the options are correct. As per the C# language rule always derived class constructor must call base class constructor. Back To Top
http://skillgun.com/csharp/constructors/interview-questions-and-answers/paper/193
CC-MAIN-2016-50
refinedweb
116
67.15
Jim O'Neil Technology Evangelist Last week when I wrote about some of the new search capabilities in IE8, I touched on the accelerator feature in IE8, since each search provider is by default installed as an accelerator. Today, we’ll talk about how to build custom accelerators to take additional actions like mapping, blogging, or finding the definition of a word. Prior to IE8 Beta 2 what we now call accelerators were called activities, and I’m pretty happy with the name change, because they truly do accelerate tasks we do all the time – like cutting and pasting an address from one page into another, say Live Maps, to get directions. Here’s a registration page for our upcoming Northeast Roadshow. When I select the address, I get a visual cue (the blue-box with arrow) that there’s an accelerator available. Clicking this yields the list of accelerators, and I can now highlight the Map with Live Search option to get a map overlay, as part of what’s known the preview action. If I actually click the menu item, I’ll get a new page at maps.live.com with the address populated; this is what’s known as executing the accelerator. At its core, an accelerator is a web service that is invoked via the standard HTTP methods of GET or PUT, possibly passing in some input parameters. For instance, when I selected the address text and hovered over Map with Live Search above, IE called out to a page at maps.live.com and passed in the currently selected text as a query parameter. The request sent by IE looked something like this: The result of that request is what provides the preview map on the page. Likewise, if I actually click the Map with Live Search menu item, IE will issue a slightly different HTTP GET request, one that will actually bring up the default Live Search Maps site in a separate tab with my address already entered. So to get an idea of how all this works, let’s build an accelerator from scratch. Now a task I seem to do a lot when preparing presentations is creating tiny URLs for reference links in my PowerPoint slides. Tiny URLs are obviously much shorter and therefore quicker and less error-prone to transcribe if folks are taking notes. On my end though, it’s just like a tedious map look up; I’m looking at the page I want to reference, but then I have to open another site like tinyurl.com or is.gd, paste the URL in, get the result, then copy and paste that into my slides. It sure would be nice to just right click on the page and have an option that shrinks the URL, perhaps creates a nice anchor, and then puts it in the clipboard so I can Ctrl-V it into my PowerPoint slide. So that’s our goal, and in getting there we should touch on most of what makes accelerators tick. tinyurl.com is.gd The definition of an accelerator is contained in a XML file that uses OpenService Description Format… hmm, sounds a lot like OpenSearch Description format that we discussed last week, and it is. The OpenService Description Format includes a number of components, including homepageURL display <name> <icon> activity Now we need to come up with an XML document that will describe our URL shrinking accelerator. There’s a number of services out there that will compress URLs, but I’ll use tinyurl.com here (for a reason that will be come clear later). TinyURL actually has an API, but it’s not all that discoverable from their site. A quick Live Search reveals that it amounts to a simple HTTP GET request passing the URL to be shrunk as a parameter called url. So, for instance, to get a tiny URL of my blog, you’d issue the following HTTP request (which you can actually do just by pasting in your browser’s URL field): When I do that, I get the following, which is exactly what I’m looking for! Next, we need to build up our OpenService Description File to make that GET request, passing in the URL of the current page (since we’re presuming that page contains the content to be referenced in my presentation). Here’s the XML, with a more-or-less line by line explanation below it. 1: <?xml version="1.0" encoding="UTF-8"?> 2: <openServiceDescription xmlns=""> 3: <homepageUrl></homepageUrl> 4: <display> 5: <name>Shrink with TinyURL</name> 6: </display> 7: <activity category="Shrink"> 8: <activityAction context="document"> 9: <preview action="{documentUrl}" /> 10: <execute method="post" action=""> 11: <parameter name="url" value="{documentUrl}" type="text" /> 12: </execute> 13: </activityAction> 14: </activity> 15: </openServiceDescription> The top level element in the document (line 2) is the openServiceDescription which points to the schema for the namespace. openServiceDescription homepageURL on line 3 provides the host of the service, and in line 4 is the display element which provides the text we’ll see in the IE Accelerator menu. (I didn’t provide an icon here). Best practice is to use a name of the format “verb with service name,” where verb indicates the general service category, like Search, Blog, Translate, etc. The category defines the organization of the accelerators in the menu and in the Manage Add-ons dialog in IE. In line 7, I define the activity and assign it a category of Shrink, which is a new custom category, since none of the built-in ones seemed to fit the bill. Within the activity can be multiple actions, where each action can have a different context. My particular accelerator applies to the current document (line 8), but you can see where I might also want my accelerator to shrink a specific link I’ve selected within the page. For that, I’d add another activityAction and use a context of link. The other context value is selection, which we saw in action with the Map with Live Search functionality at the beginning of this post. activityAction An activityAction can have a preview and an execute. The optional preview provides the floating display as you hover over the accelerator menu item in IE. It’s designed for a quick preview and has definite size constraints (320 pixels wide and 240 high), so you typically won’t want to cram a lot of information in there, or add controls that would require scrolling. For the preview (line 9), we use the API URL I mentioned earlier, and we can pass it some information from the context. Here, we pass {documentURL}, which is the URL of the page we’re currently viewing in the browser. Different contexts (document, selection, link) enable different variables, the list of which can be found in the OpenService Format Specification. {documentURL} The execute action (line 10) refers to what happens when we select the accelerator menu item (versus just hover over it). So, here, we’ll mimic the actions a user would take directly on the TinyURL site by sending an HTTP POST operation with the URL parameter passed as a form variable (hence the parameter definition on line 11). The result of the execute action will be a new tab page in IE that shows the TinyURL result page with our shrunken URL. To get the accelerator to your users, you need to provide a tiny bit of JavaScript, just as we did to install the Search Provider last week. So, for example, the following bit of markup will put a button on your page that when pressed will prompt the user to install the accelerator. (Ignore the seemingly odd file name; that URL does indeed point to the XML document hosted on my blog site.) <input type="button" Value="Add TinyURL Accelerator" onclick='window.external.AddService("");' > <input type="button" Value="Add TinyURL Accelerator" onclick='window.external.AddService("");' > And here’s the button that will do just that: There’s also a isServiceInstalled method on the window.external object, so you can check if it’s already there and then not include the redundant link to install. isServiceInstalled window.external Now that the accelerator is installed (and if you pressed the button above, it should be), you’ll see the option “Shrink with TinyURL” under All Accelerators on your IE8 context menu. For instance, here you can see the shrunken URL for last week’s post in the preview for the accelerator. Granted, it doesn’t look like much, but the URL definitely goes to the right place. What I really wanted to be able to do here is cut-and-paste this text (or automatically push it to the clipboard) so I could quickly put it in my PowerPoint slide. Unfortunately, while I can select the text, I can’t copy it here. I’m not sure why, but am trying to find out if this is by design. So unfortunately at this point, I’d be relegated to re-keying in the URL in my PowerPoint document… yuk. Of course, I could add another layer in here, and have my accelerator point to a service that I have created which goes out to TinyURL, gets the shortened URL and then builds a slightly more capable preview with a link (or button) that could provide more functionality and a nicer view. I’ll forego doing that for this exercise. The other action is, of course, executing the accelerator, which occurs when you select the associated menu item, versus just hovering over it. What occurs then, as defined in our OpenService Description file, is that we POST a request to tinyurl.com, just as if it had been initiated on the tinyurl.com home page. The result is a new tab in IE with our translated URL… or you might see the following: TinyURL actually tries to copy the shrunken URL to your clipboard, which is something I want to do, so I’ll Allow access and we end up with the following page, as well as the URL in my clipboard, ready for pasting into PowerPoint! Now if you’re feeling adventurous, you can set your preferences to automatically allow clipboard access so you’re not met with that prompt. This is configurable via IE’s Tools>Internet Options dialog on the Security tab for whatever zone you’re interested in. Keep in mind that allowing programmatic access may enable a nefarious site to read what’s on your clipboard as well as write to it. So, this isn’t quite as slick what I had in mind, and now I end up with a new tab in my browser that I really don’t need, but it got me what I wanted in a clunky sort of way. If I were willing to invest some time providing a wrapper service for TinyURL (or whatever other shrink service is out there), I could probably get a better experience. For what it’s worth, I thought I’d try to game it by making the preview action the same as the execute action. I knew the result would look pretty awful given the size of the preview, but if it prevented a new tab, that might be worth it. Unfortunately, while the action works, I’m not prompted to allow clipboard access, and if I explicitly allow clipboard access, still no joy. That should be enough to get you going, but before you re-invent the wheel, keep in mind there’s quite a few accelerators already out there – including one for TinyURL and others for similar services – in the Add-ons Gallery. I didn’t spot one including the preview action that I was hoping for though. For documentation on configuration of accelerators and the format of the OpenService Description file, refer to the following MSDN articles: OpenService Accelerators Developer Guide OpenService Format Specification for Accelerators OpenService Accelerators Developer Guide OpenService Format Specification for Accelerators Of course, there’s a number of folks that have blogged on this topic as well and a few Channel 9 videos here: IE8: Accelerators ARCast.tv: Enabling Accelerators on your Web Site IE8: Accelerators ARCast.tv: Enabling Accelerators on your Web Site Let’s see, for next week the likely topic is Web Slices. Complementing accelerators, which I talked about last week , Web slices are the other significant end-user
http://blogs.msdn.com/b/jimoneil/archive/2009/05/02/it-s-for-ie-day-week-5.aspx
CC-MAIN-2014-23
refinedweb
2,076
56.08
The QAccessibleInterface class defines an interface that exposes information about accessible objects. More... #include <QAccessibleInterface> Inherits QAccessible. Inherited by QAccessibleObject.: The QAccessibleInterface defines the API for these three concepts.. The central property of an accessible objects is what role() it has. Different objects can have the same role, e.g. both the "Add line" element in a scrollbarbar. If an accessible object provides information about it's. Destroys the object. Returns the text property t of the action action supported by the object, or of the object's child if child is not 0. See also text() and userActionCount().. See also rect(). Returns the number of children that belong to this object. A child can provide accessibility information on it's own (e.g. a child widget), or be a sub-element of this accessible object. All objects provide this information. See also indexOfChild(). Asks the object, or the object's child if child is not 0, to execute action using the parameters, params. Returns true if the action could be executed; otherwise returns false. action can be a predefined or a custom action. See also userActionCount() and actionText(). Returns the 1-based index of the object child in this object's children list, or -1 if child is not a child of this object. 0 is not a possible return value. All objects provide this information about their children. See also childCount(). Returns true if all the data necessary to use this interface implementation is valid (e.g. all pointers are non-null); otherwise returns false. See also object().: The following code demonstrates how to use this function to navigate to the first child of an object: QAccessibleInterface *child = 0; int targetChild = object->navigate(Child, 1, &child); if (child) { // ... delete child; } Note that the Descendent value for relation is not supported. All objects support navigation. See also relationTo() and childCount(). Returns a pointer to the QObject this interface implementation provides information for. See also isValid(). Returns the geometry of the object, or of the object's child if child is not 0. The geometry is in screen coordinates. This function is only reliable for visible objects (invisible objects might not be laid out correctly). All visual objects provide this information. See also childAt().(). Returns the role of the object, or of the object's child if child is not 0. The role of an object is usually static. All accessible objects have a role. See also text() and state(). Sets the text property t of the object, or of the object's child if child is not 0, to text. Note that the text properties of most objects are read-only. See also text(). Returns the current state of the object, or of the object's child if child is not 0. The returned value is a combination of the flags in the QAccessible::StateFlag enumeration. All accessible objects have a state. See also text() and role().(). Returns the number of custom actions of the object, or of the object's child if child is not 0. The Action type enumerates predefined actions: these are not included in the returned value. See also actionText() and doAction().
http://doc.trolltech.com/4.0/qaccessibleinterface.html
crawl-001
refinedweb
527
61.73
Tutorial Week 4 Questions - What is a branch delay? The goal of this question is to have you reverse engineer some of the C compiler function calling convention (instead of reading it from a manual). The following code contains 6 functions that take 1 to 6 integer arguments. Each function sums its arguments and returns the sum as a the result. #include <stdio.h> /* function protoypes, would normally be in header files */ int arg1(int a); int arg2(int a, int b); int arg3(int a, int b, int c); int arg4(int a, int b, int c, int d); int arg5(int a, int b, int c, int d, int e ); int arg6(int a, int b, int c, int d, int e, int f); /* implementations */ int arg1(int a) { return a; } int arg2(int a, int b) { return a + b; } int arg3(int a, int b, int c) { return a + b + c; } int arg4(int a, int b, int c, int d) { return a + b + c + d; } int arg5(int a, int b, int c, int d, int e ) { return a + b + c + d + e; } int arg6(int a, int b, int c, int d, int e, int f) { return a + b + c + d + e + f; } /* do nothing main, so we can compile it */ int main() { } The following code is the disassembled code that is generated by the C compiler (with certain optimisations turned of for the sake of clarity). 004000f0 <arg1>: 4000f0: 03e00008 jr ra 4000f4: 00801021 move v0,a0 004000f8 <arg2>: 4000f8: 03e00008 jr ra 4000fc: 00851021 addu v0,a0,a1 00400100 <arg3>: 400100: 00851021 addu v0,a0,a1 400104: 03e00008 jr ra 400108: 00461021 addu v0,v0,a2 0040010c <arg4>: 40010c: 00852021 addu a0,a0,a1 400110: 00861021 addu v0,a0,a2 400114: 03e00008 jr ra 400118: 00471021 addu v0,v0,a3 0040011c <arg5>: 40011c: 00852021 addu a0,a0,a1 400120: 00863021 addu a2,a0,a2 400124: 00c73821 addu a3,a2,a3 400128: 8fa20010 lw v0,16(sp) 40012c: 03e00008 jr ra 400130: 00e21021 addu v0,a3,v0 00400134 <arg6>: 400134: 00852021 addu a0,a0,a1 400138: 00863021 addu a2,a0,a2 40013c: 00c73821 addu a3,a2,a3 400140: 8fa20010 lw v0,16(sp) 400144: 00000000 nop 400148: 00e22021 addu a0,a3,v0 40014c: 8fa20014 lw v0,20(sp) 400150: 03e00008 jr ra 400154: 00821021 addu v0,a0,v0 00400158 <main>: 400158: 03e00008 jr ra 40015c: 00001021 move v0,zero - arg1 (and functions in general) returns its return value in what register? - Why is there no stack references in arg2? - What does jr ra do? - Which register contains the first argument to the function? - Why is the move instruction in arg1 after the jr instruction. - Why does arg5 and arg6 reference the stack? The following code provides an example to illustrate stack management by the C compiler. Firstly, examine the C code in the provided example to understand how the recursive function works. #include <stdio.h> #include <unistd.h> char teststr[] = "\nThe quick brown fox jumps of the lazy dog.\n"; void reverse_print(char *s) { if (*s != '\0') { reverse_print(s+1); write(STDOUT_FILENO,s,1); } } int main() { reverse_print(teststr); } The following code is the disassembled code that is generated by the C compiler (with certain optimisations turned off for the sake of clarity). - Describe what each line in the code is doing. - What is the maximum depth the stack can grow to when this function is called? 004000f0 <reverse_print>: 4000f0: 27bdffe8 addiu sp,sp,-24 4000f4: afbf0014 sw ra,20(sp) 4000f8: afb00010 sw s0,16(sp) 4000fc: 80820000 lb v0,0(a0) 400100: 00000000 nop 400104: 10400007 beqz v0,400124 <reverse_print+0x34> 400108: 00808021 move s0,a0 40010c: 0c10003c jal 4000f0 <reverse_print> 400110: 24840001 addiu a0,a0,1 400114: 24040001 li a0,1 400118: 02002821 move a1,s0 40011c: 0c1000af jal 4002bc <write> 400120: 24060001 li a2,1 400124: 8fbf0014 lw ra,20(sp) 400128: 8fb00010 lw s0,16(sp) 40012c: 03e00008 jr ra 400130: 27bd0018 addiu sp,sp,24 - Why is recursion or large arrays of local variables avoided by kernel programmers? - Compare cooperative versus preemptive multithreading? - Describe user-level threads and kernel-level threads. What are the advantages or disadvantages of each approach? A web server is constructed such that it is multithreaded. If the only way to read from a file is a normal blocking read system call, do you think user-level threads or kernel-level threads are being used for the web server? Why? Assume a multi-process operating system with single-threaded applications. The OS manages the concurrent application requests by having a thread of control within the kernel for each process. Such a OS would have an in-kernel stack assocaited with each process. Switching between each process (in-kernel thread) is performed by the function switch_thread(cur_tcb,dst_tcb). What does this function do? - What is the EPC register? What is it used for? - What happens to the KUc and IEc bits in the STATUS register when an exception occurs? Why? How are they restored? - What is the value of ExcCode in the Cause register immediately after a system call exception occurs? - Why must kernel programmers be especially careful when implementing system calls? - The following questions are focused on the case study of the system call convention used by OS/161 on the MIPS R3000 from the lecture slides. - How does the 'C' function calling convention relate to the system call interface between the application and the kernel? - What does the most work to preserve the compiler calling convention, the system call wrapper, or the OS/161 kernel. - At minimum, what additional information is required beyond that passed to the system-call wrapper function? - In the example given in lectures, the library function read invoked the read system call. Is it essential that both have the same name? If not, which name is important? - To a programmer, a system call looks like any other call to a library function. Is it important that a programmer know which library function result in system calls? Under what circumstances and why? Describe a plausible sequence of activities that occur when a timer interrupt results in a context switch.
http://cgi.cse.unsw.edu.au/~cs3231/21T1/tutorials/week04.php
CC-MAIN-2022-33
refinedweb
1,028
68.3
This small article shows how to extend the ASP.NET Label Control, so it reads resource strings from an XML file, which is stored in memory as a Cached DataSet with cache-dependency to the XML-file. Each web page has its own XML-file where texts are stored. Label DataSet A control like this might come in handy if you need to translate your web application into other languages, or if the owner of the web site wants to change the “static” texts in the web pages by just editing the XML-files. The program could easily be extended so the resource texts are read from another source, like a database, Web Service or a resource file, but I wanted to keep this article fairly small and easy, just to show the general idea. I’ve used this technique in production, but since we use a web farm in production, having the resource strings in files isn’t that convenient, so instead I keep all strings in a database. Its also a good idea to give the web application owner, a nice interface for changing the texts. I might write another article to show you how to do this. Some of the .NET features used in the sample project: Cache The Control is called TextControl because it handles texts from a resource of strings. Perhaps a name like Text or StringResource is better, but TextControl will have to do. Feel free to change it TextControl The central part of the code is made up from a single custom control, which inherits from, and extends the ASP.NET Label control. The control also uses a helper class called XMLResource, which will be explained later. XMLResource [DefaultProperty("Key"), ToolboxData("<{0}:TextControl</{0}:TextControl>")] public class TextControl : System.Web.UI.WebControls.Label The reason I wanted to inherit from the Label control instead of the base Control class is that I want to use the rendering functions that are already implemented in the Label control for different fonts, colors and stuff. I’m lazy The TextControl needs to know what text string it should get from its resource of texts, so therefore I added a new property to it called Key. I might as well have re-used the inherited Text property that is already in there, but I had better use for that Text property (shown later). Key Text private string key; [Bindable(true), Category("Appearance"), DefaultValue(""), Description("ID/Key of the resource text to get")] public string Key { get { return key; } set { key = value; } } There really isn’t much to say about the code snippet above. Its important to have the right attributes or the property might not show up in the property dialog in VisualStudio.NET. The final (and interesting part) of the control is the code that renders the output in both run-time and design-time. To do this you must override the Render() method of the Label class. When the ASPX page renders content, the page calls this Render() method for each control on the page. Render() protected override void Render(HtmlTextWriter output) { try { //get the text string from the resource //the Text property is used as "default" value Text = new XMLResource().GetValueFromKey(Key, Text); //call base class for rendering base.Render(output); } catch //catch design-time exceptions { //render the Text property with brackets String tmpText = Text; Text = "[" + Text + "]"; //call base class for rendering base.Render(output); //put back the default text without brackets Text = tmpText; } } As you can see in the code above, I’m using a try/catch block to handle errors, that might happen when we’re getting the text from the resource. I’m getting the texts from an XML-file with the same name as the ASPX file (as described in the introduction), so if the TextControl sits in an ASPX page called Default.aspx, the resource XML file for that page is called Default.xml and located in the same directory as the ASPX page. try catch To get the name of the ASPX file, I use the CurrentExecutionFilePath property of the Request object. The Request object is accessed via the current HttpContext, which isn’t available at design-time, so therefore I catch the exception thrown and show the default text within square brackets. You might as well prevent the exception in the XMLResource class (shown below) but this works fine for me. CurrentExecutionFilePath Request HttpContext If the requested string (based on the Key) isn’t found or if an exception occurs, I show the default text, which I get from the re-used Text property of the parent Label control. So, how do we get the text from the resource file? All is done in the XMLResource class, which I’ll try to explain below. The XMLResource class has two methods; one public to get the requested text string and one private, which get the XML file from a cached DataSet. First the public method: public String GetValueFromKey(String key, String defaultValue) { DataSet ds = GetResourceDS(); //filter out everything except our resource string in a dataview DataView dv = ds.Tables[0].DefaultView; dv.RowFilter = "key = '" + key + "'"; if(dv.Count > 0) //key found, show the value return dv[0]["value"].ToString(); else //key not found return default value return defaultValue; } It’s pretty simple. Get a DataSet, which contains all the resource strings for this ASPX page. Then filter out our text string based on the key. If the key isn’t found, the default value is returned. private DataSet GetResourceDS() { //Try to get the DataSet from the Cache first //Note that this one bombs at design time, (we have no HttpContext) //but this exception is caught in the custom control DataSet ds = (DataSet)HttpContext.Current.Cache[HttpContext.Current. Request.CurrentExecutionFilePath]; if(ds == null) { //no DataSet in the Cache, get a new one and store it in the cache //get the text-id from the resource file for our web-page ds = new DataSet("resourceStrings"); //build the name of the xml file from the name of the web // page we're sitting in String fileName = HttpContext.Current. Request.CurrentExecutionFilePath; fileName = fileName.Substring(0, fileName.LastIndexOf(".")) + ".xml"; try { //read ds from the xml file ds.ReadXml(HttpContext.Current.Server.MapPath(fileName)); } catch (System.IO.FileNotFoundException) { //xml file not found, we will return the empty DataSet } //put in Cache with dependency to the xml file HttpContext.Current.Cache.Insert(HttpContext.Current. Request.CurrentExecutionFilePath, ds, new CacheDependency(HttpContext.Current. Server.MapPath(fileName))); } return ds; } The GetResourceDS method is longer, but not too complicated. First it tries to get the DataSet from the built in .NET Cache object, which is very cool. As a Cache-key I use the name of the ASPX page. If the DataSet wasn’t in the Cache, I create a new DataSet and read in the content from the XML file, which should have the same name as the ASPX page where the TextControl is used (as explained earlier). GetResourceDS The cached DataSet should expire whenever someone updates the XML file, right? So, therefore I add a cache-dependency, which points at the XML file. So now, when the file is updated, the Cache object detects this and removes the cached DataSet from its memory. The ASP.NET Cache might be even more useful if you decide to put all your texts into one big, single XML file. There is no reason to read that XML file every time a TextControl is rendered, right? To use the TextControl from VisualStudio.NET, you need to add the assembly containing the control to the toolbox. Load up VisualStudio.NET and create a new ASP.NET application. Then add a WebForm and bring it up in design view. Now right click in the Toolbox containing all the other built-in server controls and select “Customize Toolbox...” from the popup menu. Now select the tab named “.NET Framework Components” and use the “Browse...” button to find the DLL containing the TextControl. The sample project has the TextControl in the MyControls.dll assembly. VS.NET will automatically find and activate the TextControl inside the MyControls DLL. You can put the control on any of the different tabs in the Toolbox, but I prefer to have it together with the other server controls. The TextControl is now ready for use on a web page. Create a WebForm called WebForm1.aspx and drag/drop the TextControl from the Toolbox on it in design view. Select the TextControl on the ASPX page and look at the property dialog. Change the Key property to “key1” (for example) and optionally put some text in the Text property. It should look similar to this in the HTML view: <form id="Form1" method="post" runat="server"> <cc1:TextControl </cc1:TextControl> </form> Note that VS.NET automatically added a reference to MyControls in the project view and also added code at the top of the file for registering the custom control: <%@ Register TagPrefix="cc1" Namespace="MyControls" Assembly="MyControls" %> The only thing to do now is to create the XML file containing the resource strings. Just add a new XML file called WebForm1.xml in the same directory as your newly created ASPX page. The XML file is pretty simple and looks like this: <?xml version="1.0" encoding="utf-8" ?> <resourceStrings> <string> <key>key1</key> <value>sampleValue 1</value> </string> <string> <key>key2</key> <value>sampleValue 2</value> </string> </resourceStrings> Each string node in the XML file makes up a key/value pair in the resource file. string The web page is ready for testing and should show a plain web page with the text “sampleValue 1” on it. If you change the text “sampleValue 1” in the XML file into something else and reload the page, it should show the new value at once. The XMLResource class can also be used from code behind to get and set texts at run-time. Just call the public method GetValueFromKey() from the code behind: GetValueFromKey() //set the text of the label in run-time Label1.Text = new MyControls.XMLResource().GetValueFromKey("key2", Label1.Text); As I wrote earlier, there are lots of things you could (and should) do with this code to use it in production, but I hope this little article can get some of you into making your own controls, which is very fun and really, really useful. I recommend doing similar controls for Buttons, Hyperlinks and so on, the owner of the web site might want to change the texts of all the submit buttons to SAVE or DO IT... Some things that I’ve added to this control in a production.
http://www.codeproject.com/Articles/3457/Extending-the-Label-Control?msg=1527929
CC-MAIN-2014-35
refinedweb
1,771
62.07
Accessing intrisic asp.net objects (ie Application, Session) from an assembly Discussion in 'ASP .Net' started by Johan Riis Johansen, Aug: What is the namespace and assembly name of generated assemblySA, Aug 9, 2004, in forum: ASP .Net - Replies: - 0 - Views: - 515 - SA - Aug 9, 2004 Accessing ASP.NET Session or Application under old ASPRavi Ambros Wallau, Jun 17, 2005, in forum: ASP .Net - Replies: - 6 - Views: - 519 - Ravi Ambros Wallau - Jun 17, 2005 Problem calling assembly which references another assembly from an asp page, Mar 3, 2006, in forum: ASP .Net - Replies: - 3 - Views: - 1,876 reference .NET assembly in JAVA assembly, Jan 24, 2007, in forum: Java - Replies: - 5 - Views: - 698 - Vitaly - Jan 28, 2007 Accessing ASP Session from ASP.NET via Session cookieDax Westerman, Aug 18, 2003, in forum: ASP General - Replies: - 1 - Views: - 215 - Dax Westerman - Aug 19, 2003
http://www.thecodingforums.com/threads/accessing-intrisic-asp-net-objects-ie-application-session-from-an-assembly.62994/
CC-MAIN-2015-11
refinedweb
143
64.3
on Mon Oct 27 2008, "Robert Dailey" <rcdailey-AT-gmail.com> wrote: > On Fri, Oct 24, 2008 at 1:07 PM, Stefan Seefeld <seefeld at sympatico.ca> wrote: > > Robert Dailey wrote: > > Hi, > > What happens if I do the following? > > using namespace boost::python; > > import( "__main__" ).attr( "new_global" ) = 40.0f; > import( "__main__" ).attr( "another_global" ) = 100.0f: > > My main concern here is performance. I'm wondering if each call to > import() results in a disk query for the script in question and loads it > from there. I'm also wondering if the second import() above will simply > read from a memory cache or something. > > As the above code is only a wrapper around the Python runtime, you are really > asking about how Python handles repeated 'import' calls. I'm pretty sure > importing a module while it is already imported will do (almost) nothing. > However, I'm not sure whether a module is actually unloaded as soon as the last > reference goes away (such as after the first line above is completed), so I > can't give a definite answer. > > I'm sure you'll get better answers when asking on a Python forum directly. > > I posted about this on the Python mailing list but I'm receiving no responses :( Python keeps a dictionary in sys.modules that maps module names to module objects. Import looks there first and doesn't hit the filesystem if it finds anything. -- Dave Abrahams BoostPro Computing
https://mail.python.org/pipermail/cplusplus-sig/2008-October/013890.html
CC-MAIN-2016-50
refinedweb
239
67.45
ioctl_ficlonerange, ioctl_ficlone — share some the data of one file with another file Synopsis #include <sys/ioctl.h> #include <linux/fs.h> int ioctl(int dest_fd, FICLONERANGE, struct file_clone_range *arg); These ioctl operations first appeared in Linux 4.5. They were previously known as BTRFS_IOC_CLONE and BTRFS_IOC_CLONE_RANGE, and were private to Btrfs. Conforming to This API is Linux-specific. Notes Because a copy-on-write operation requires the allocation of new storage, the fallocate(2) operation may unshare shared blocks to guarantee that subsequent writes will not fail because of lack of disk space. See Also ioctl(2) Colophon This page is part of release 5.04 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at. Referenced By ioctl(2). The man page ioctl_ficlone(2) is an alias of ioctl_ficlonerange(2).
https://dashdash.io/2/ioctl_ficlonerange
CC-MAIN-2022-27
refinedweb
147
59.4
Tech Off Thread17 posts Forum Read Only This forum has been made read only by the site admins. No new threads or comments can be added. C# using alias and generic types. Conversation locked This conversation has been locked by the site admins. No new comments can be made. I've started using the using alias in C# when I only need a couple of types from a namespace. This sort of thing works fine. using SValidator = System.Xml.Schema.XmlSchemaValidator; using SInfo = System.Xml.Schema.XmlSchemaInfo; but is is possible to do it with generic types? If I only want BindingList<T> from System.ComponentModel, how do I express that? This doesn't work. using BindingList = System.ComponentModel.BindingList<T>; or this using BindingList<T> = System.ComponentModel.BindingList<T>; or this using BindingList = System.ComponentModel.BindingList; Do I have to import the whole ComponentModel namespace when I only want to have one generic type? Why do you mind 'import the whole ComponentModel namespace'? Is there any overhead in doing that? Not doing so, will the compile work faster? Sorry for not having answered your question but adding more... I don't think that works, you will probably have to use the whole namespace. Is there a reason you would want to do this? I can think of a problem that occurs when you import the entire namespace: naming conflicts between classes with the same name. Here's an example: Since both System.Data and Xceed.Grid (3rd party component) contain a class DataRow, the compiler can't figure out which one I mean. So I have to explicitely type System.Data.DataRow or Xceed.Grid.DataRow. But other than that, I don't see a problem, and I usually import entire namespaces. Well it reduces the number of things I'm not interested in that show up in intellisense all the time. Other than that I'm not really bothered, it doesn't seem to make a lot of difference to the compile time. In that case, you can still import the entire namespace but add an alias to it: using System.Data; using xceed = Xceed.Grid; Then just type xceed.DataRow, instead of the whole namespace. Very useful when working with Office interop, since you have many duplicate types in Microsoft.Office.Interop.Word, Microsoft.Office.Interop.Excel, etc. I actually like that - a lot of what I know about the framework comes from wandering about the narrow corridors of Intellisense to see what comes up. It's a wonderful tool to explore the framework. I prefer the object browser for that. The reason you'd want to do this would be to allow you to write the same code as if you'd done a "using" on the whole namespace, but leaving a clear "trail of breadcrumbs" back to the type itself. If I write: using library1.gizmos; using amazing.doodads; using yet.another.library.doohickeys; //... class Example { Thingummy<float> myThing; } It's not clear where "Thingummy" comes from without relying on IDE features, and it's even less clear what I'm using from each of the namespaces. Whereas, if I can do this: using Frobnicator = library1.gizmos.Frobnicator; using SuperDoodad = amazing.doodads.SuperDoodad; using Thingummy = yet.another.library.doohickeys.Thingummy; //... class Example { Thingummy<float> myThing; } It becomes clearer where Thingummy comes from, *and* it becomes clear precisely what I'm using out of those namespaces. Sometimes you use so much stuff from a namespace and it's so clear that you are best to use the entire namespace. Sometimes you use so few things that you might as well just fully specify them in the few places you use them. However, I find that many things fall in between these extremes, and it's frustrating that this only works so long as I'm not using generics. Agreed. I wish there was a way to configure what was displayed. Better not to confuse the issue with IronPython. That import statement you described is more like reflecting on the generic List type and creating a Type variable named l pointing to that than a using statement. Iron Python allow partial imports (read using): import clr clr.AddReference("System.Data") from System.Data import DataRow as TableDataRow from System.Collections.Generic import List as l So doing partial imports (using) is possible via the DLR. By C# spec non type specified aliasing is not allowed in C# 2.0 (I quote everything below from there): 20.5.8 Using alias directives Using aliases may name a closed constructed type, but may not name a generic type declaration without supplying type arguments. For example: namespace N1 { class A<T> { class B {} } C# 2.0 SPECIFICATION class C {} } namespace N2 { using W = N1.A; // Error, cannot name generic type using X = N1.A.B; // Error, cannot name generic type using Y = N1.A<int>; // Ok, can name closed constructed type using Z = N1.C; // Ok }## End quote of C# 2.0 Spec In short when in doubt read the spec as your party may vary. But the point is it could be possible with a using. A decision was made to limit it in C#. I am interested in why. I mean the hit would be taken at compile time since Generics are resolved then in the C#. (List<int> is resolved to one class and List<string> another as specilization of generic classes are needed during the compile process.) I understand that Iron Python allows line by line running of code so this may muddie the waters a bit. The nongeneric example of doing semantically the same thing with a non generic was shown earlier in the thread. I am curious why the line was drawn where it was. It certainly is possible in IL as Iron Python proves is this a DLR feature that is limited in the CLR? Sorry for confusing my terms using CLR (Common Language Runtime) instead of DLR (Dynamic Language Runtime). Visual Basic seems to not have equal limatation from what I can tell from looking at the spec. Very interesting. No, it isn't. One is a doing a compile-time type resolution (C# using); the other is doing a run-time type resolution (Python import). There's a difference, subtle but it's there. Visual Basic seems to not have equal limatation from what I can tell from looking at the spec. Very interesting In VB 2005, Imports GenericList = System.Collections.Generic.List(Of T) does not work, but Imports StringList = System.Collections.Generic.List(Of String) does. In IronPython 2.0A6, from System.Collections.Generic import List as GenericList works by creating a Python type for the generic list from which you can do this: >>> StringList = GenericList[str] >>> StringList <type 'List[str]'> >>> list = StringList() >>> list <List[str] object at 0x0000...> I'd like to second that this limitation is bad design. I'd be happy with: using list = System.Collections.Generic.LinkedList; or even: using list<X> = System.Collections.Generic.LinkedList<X>; But I am relegated to: using whydoescshavetheseweirdrestrictions = System.Collections.Generic; Then: new whydoescshavetheseweirdrestrictions.LinkedList<X>() Rather than the much simpler: new list<X>() You can do this with the more powerful language F#.
https://channel9.msdn.com/Forums/TechOff/212689-C-using-alias-and-generic-types
CC-MAIN-2017-39
refinedweb
1,205
68.47
”. This documentation describes both the pickle module and the cPickle module. Warning The pickle module is not intended to be secure against erroneous or maliciously constructed data. Never unpickle data received from an untrusted or unauthenticated source. The the Pickler encounters an object of a type it knows nothing about — such as an extension type — it looks in two places for a hint of how to pickle it. One alternative is for the object to implement a __reduce__() method. If provided, at pickling time __reduce__() will be called with no arguments, and it must return either a string or a tuple. If a string is returned, it names a global variable whose contents are pickled as normal. The string returned by __reduce__() should be the object’s local name relative to its module; the pickle module searches the module namespace to determine the object’s module. When a tuple is returned, it must be between two and five elements long. Optional elements can either be omitted, or None can.) Optionally, an iterator (not a sequence) yielding successive dictionary items, which should be tuples of the form (key, value). These items will be pickled and stored to the object using obj[key] = value. This is primarily used for dictionary subclasses, but may be used by other classes as long as they implement __setitem__().__(). An alternative to implementing a __reduce__() method on the object to be pickled, is to register the callable with the copy_reg module. This module provides a way for programs to register “reduction functions” and constructors for user-defined types. Reduction functions have the same semantics and interface as the __reduce__() method described above, except that they are called with a single argument, the object to be pickled. The registered constructor is deemed a “safe constructor” for purposes of unpickling as described above.
http://docs.python.org/2/library/pickle.html
CC-MAIN-2013-48
refinedweb
305
53.61
Just trying my first project after setting up my Aduino UNO (Cayenne Luminosity Example) but when I try to go to stage 2 I get the Error Message Please fix the following errors: Connection error. don’t know why I am getting this error. I am connected with USB Serial to my Laptop, I changed sketch to use Cayenneserial.h and followed all the instructions.see below: /* Cayenne Luminosity Example This sketch sample file shows how to change the brightness on a LED using Cayenne Dashboard. The Cayenne Library is required to run this sketch. If you have not already done so you can install it from the Arduino IDE Library Manager. Steps: - In the Cayenne Dashboard add a new Custom Widget, and select Slider. - Select a virtual pin number. - Set min value to 0 and max value of 1. - Set LED_VIRTUAL_PIN to the pin number you selected. - Connect the LED’s legs to GND, and to a PWM pin (3, 5, 6, 9, 10, and 11 on most Arduino boards). Use a 1k resistor if possible. Schematic: [Ground] – [LED] – [1k-resistor] – [PWM Pin] - Set LED_DIGITAL_PIN to the PWM pin number you selected. - Set the token variable to match the Arduino token from the Dashboard. - Compile and upload this sketch. - Once the Arduino connects to the Dashboard you can use the slider to change LED brightness. */ #define CAYENNE_PRINT Serial // Comment this out to disable prints and save space // If you’re not using the Ethernet W5100 shield, change this to match your connection type. See Communications examples. #include <CayenneSerial.h> #define LED_VIRTUAL_PIN 1 #define LED_DIGITAL_PIN 6 // Cayenne authentication token. This should be obtained from the Cayenne Dashboard. char token[] = “j8gqsftp5v”; void setup() { Serial.begin(9600); Cayenne.begin(token); } CAYENNE_IN(LED_VIRTUAL_PIN) { // get value sent from dashboard int currentValue = getValue.asInt(); // 0 to 1023 analogWrite(LED_DIGITAL_PIN, currentValue / 4); // must be from 0 to 255 } void loop() { Cayenne.run(); } Thanks in advance Graham D Midgley
https://community.mydevices.com/t/please-fix-the-following-errors-connection-error/1849
CC-MAIN-2018-43
refinedweb
322
67.45
hi guys, i'm learning C at the moment and i'm writing a little program which needs as input a decimal value, and by choice, converts it to octal, hex, or the ascii character. it would be nice to learn, and to add to the program, the option of converting the decimal value to binary. but my problem is, i know how to convert decimal to binary by head, but not how to do this if the decimal value is a variable (in this case an integer) here is what i've got so far, its not that fancy coding, but hey, i'm learning #include <stdio.h> int main() { int a, b, ask; printf("\nThis is a number converter.\n"); printf("Enter a decimal value: "); scanf("%d",&ask); printf("\nWhich output do you like?\n"); printf("1 = hex, 2 = octal, 3 = character :"); scanf("%d", &a); switch(a) { case 1: printf("Do you want a leading \"0x\" for the output?"); printf("\nyes = 1, no = 2 : "); scanf("%d",&b); switch(b) { case 1: printf("\nThe value %d has the hexadecimal value of 0x%x\n\n",ask,ask); break; case 2: printf("\nThe value %d has the hexadecimal value of %x\n\n",ask,ask); break; default: printf("\nThis is not a valid option\n"); break; } break; case 2: printf("\nThe value %d has the octal value of %o\n\n",ask,ask); break; case 3: printf("\nThe value %d has the character value of %c\n\n",ask,ask); break; default: printf("\nThis is not a valid option\n"); return 0; } return 0; } let's say i've inputted the value 32, how can make it 0100000 without having to make a table in the program, which looks up the value? is there an standard option for in C, like %x gives the hex value?? or do i need to write a function? and if so, how would i do this? thanks in advance for the replies.... If you mod a number by two until you cannot do so anymore you will get the binary equivalent of it. Modding (or modulusing) a number is where you get the remainder given when you divide it by another number. For example, 2 mod 3 is 2 (zero remainder 2). If you have the number ten and want to convert it to binary, you do the following: (% is the c modulus operator) Code: 10 % 2 = 0 10 / 2 = 5 5 % 2 = 1 5 / 2 = 2 2 % 2 = 0 2 / 2 = 1 1 % 2 = 1 1 / 2 = 0 // take the answers to the moduluses: 0101 // reverse them and you have your number: 1010 = 10 (in decimal) I won't give you c code to add that functionality because it will be more fun to do it yourself. If you get stuck (which I doubt you will), pm me and I'll give you more help. I believe there is a c library that can do it for you, but it's more fun this way :P ac [edit]I changed the example to make it more readable, putting the moduluses and divisions into two separate columns[/edit] 10 % 2 = 0 10 / 2 = 5 5 % 2 = 1 5 / 2 = 2 2 % 2 = 0 2 / 2 = 1 1 % 2 = 1 1 / 2 = 0 // take the answers to the moduluses: 0101 // reverse them and you have your number: 1010 = 10 (in decimal) I agree with gothic_type on this one, if you like code then why not program this on your own? Plus, you can reuse the function later... just make a file and put all the functions you like in it.. then you can include it in your proggies... yup, OO /\\ thanks, i haven't thought about the mod before, i'll give it a try, at least now i know where to look for The modulus operator is also handy for other conversions such as hex. Because hex is base 16 (I hope I'm right on that ) you just modulus and divide by 16 instead of by 2. It's a slightly different process to decimal-binary conversion, however. ac ok, i get the point, but the next problem would be displaying the hex, since it contains numbers and characters.... I assume you know of the switch statement? Basically simple hex (as in 0 - 255 I believe) is made up of 2 characters. The first is multiplied by 16, then the second is added. So if you only have two characters available, the highest number is FF which is (15x16)+15 == 255 Basically you have to have some sort of algorithm which displays a number if x<10 and letters corresponding to the number if x>10 (if you can understand that). If you want, I'll post a program that I wrote to convert decimal to hex, but you should have a try first yourself. If you don't understand what I wrote, try searching google for a table that gives you hex and decimal beside each other and work out the relationship in order to create an algorithm. That's how I made my program. ac Hmm an exercise that come to mind right now is... to make a function that would accept 3 variables base1, base2, number. The number is in base1 and you need to convert it to base 2. Let's say you can do this only for numeric characters... of course, it's just an idea for an exercise. gothic_type, yes i do know about the switch statement as you can see in above code, and this is surely something worth trying... hypronix: i don''t understand what you mean, if number is of base1, then why would you need 3 vars as input in the function??? lepricaun, you would need three vars because you need to know what base the original number is in (or I suspect you do). The following example should illustrate it for you: What base is 10 in? a) Base 2 b) Base 10 c) Base 16 If you can give me the "correct" answer to the above question choosing only a, b, or c, I will give you a pat on the back. ac [edit]and the comment about whether or not you knew the switch statement was semi-sarcastic (I'm afraid to admit ) I was trying to say "think for yourself"[/edit] Forum Rules
http://www.antionline.com/showthread.php?257426-converting-decimal-to-binary-in-C
CC-MAIN-2014-35
refinedweb
1,064
72.8
mlock, munlock, mlockall, munlockall - lock and unlock memory Synopsis Description Errors Availability Colophon #include <sys/mman.h> int mlock(const void *addr, size_t len); int munlock(const void *addr, size_t len); int mlockall(int flags); int munlockall(void); mlock() and mlockall() respectively lock part or all of the calling processs virtual address space into RAM, preventing that memory from being paged to the swap area. munlock() and munlockall() perform the converse operation, respectively unlocking part or all of the calling processs virtual address space, so that pages in the specified virtual address range may once more to be swapped out if required by the kernel memory manager. Memory locking and unlocking are performed in units of whole pages.. munlock() unlocks pages in the address range starting at addr and continuing for len bytes. After this call, all pages that contain a part of the specified memory range can be moved to external swap space again by the kernel.. POSIX.1-2001, SVr systems, that... mmap(2), setrlimit(2), shmctl(2), sysconf(3), proc(5), capabilities(7) This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at.
http://manpages.sgvulcan.com/mlockall.2.php
CC-MAIN-2017-47
refinedweb
204
52.39
>From: "Luis A. Lopez" <address@hidden> >Organization: UPRM >Keywords: 200406162151.i5GLpQtK019904 McIDAS scripting Hi Luis, > Sorry I bother you so much but I need more help: No worries. >When I give this command into Mcidas GUI it works fine > >IMGDISP RTNEXRAD/N0R ID=JUA LINELE= 230 230 PLACE=C MAG= 1 1 EU=BREF SU=X >ALL=1 SF=YES OK, good. Another way of doing the same thing is: IMGDISP RTNEXRAD/N0R ID=JUA STA=JUA EU=BREF ALL=1 SF=YES or IMGDISP RTNEXRAD/N0R 1 ID=JUA STA=JUA EU=BREF SF=YES The SF=YES is only needed if you want to switch to the frame after the image is loaded. >command line > >imgdisp.k RTNEXRAD/N0R ID=JUA LINELE= 230 230 PLACE=C MAG= 1 1 EU=BREF >SU=X ALL=1 SF=YES;imgdisp.k 1 ../images/doppler/test.gif Since your object is to create a GIF (tm) rendition of the image that is loaded, the second command should be 'frmsave.k', not 'imgdisp.k'. >but if I run the command from the commandline (using programs in >mcidas/bin) and add the imgsave command, the image alwways comes empty, do >I need to add any other parameter when running from command line?? OK, the problem you are having comes from not understanding something about what is going behind the scenes. Here goes: McIDAS applications use two shared memory segments to communicate with one another. Part of one of the memory segments is where the display of data is actually done. When you run a McIDAS session and see image displays, etc., you are actually running several McIDAS programs at the same time. When you display an image in a McIDAS session, IMGDISP actually displays the image in one of the shared memory segments. The only reason you can see the image is that a McIDAS application called 'mcimage' is running, and it gets an event that says that the content of the shared memory segment has changed, so it should visualize the shared memory for the user. The two shared memory segments used are created either by the application 'mcenv' (which is run for you when you start a McIDAS session) or by each routine individually. By putting together two McIDAS commands on a single Unix command line separated with semicolons, you have not gotten away from the fact that each McIDAS application (imgdisp.k in your example) is creating the shared memory segments upon startup AND destroying those segments on completion. So, the frame represented by the shared memory segment from the first imgdisp.k command exists while that command is running, and then disappears when the command exits. The second imgdisp.k command (which should be frmsave.k) then creates its own new shared memory segments, and there is no image displayed in those. Here is what you want to do: mcenv imgdisp.k RTNEXRAD/N0R ID=JUA STA=JUA EU=BREF frmsave.k 1 ../images/doppler/test.gif exit Here, 'mcenv' creates the memory segment; imgdisp.k displays the most recent NEXRAD Level III base reflectivity product in the only frame that exists ('mcenv' creates a session with 1 frame by default); and then 'frmsave.k' saves the displayed image to the file test.gif. You can get more information on the flags supported by 'mcenv' using the McIDAS HELP command: help.k mcenv Notice that 'mcenv' is in lower case. Commands whose executables end in ".k" would need to be capitalized: help.k IMGDISP 'mcenv' creates a session with frame size of 480x640, number of image colors equal to 48, and number of graphic color levels of 8. You can verify this from the online help, and from running a mini McIDAS session: mcenv f.k gu.k TABLE exit So, what I am recommending is modifying your command sequence slightly: mcenv -c 128 -g 32 -f address@hidden imgdisp.k RTNEXRAD/N0R ID=JUA STA=JUA EU=BREF map.k H frmsave.k 1 ../images/doppler/test.gif exit This 'mcenv' invocation creates a single 600x800 frame that supports 128 image colors and 32 graphic colors. I also added the MAP invocation to draw a map on top of the image displayed. Given the above, the construct in mcrun.sh and mcbatch.sh should start making more sense. For instance, here is the 'meat' of mcrun.sh: cd $MCDATA mcenv << EOF # put McIDAS-X commands you want to run here, one command per line. # Example (note that these lines are commented out!!): # # dataloc.k ADD RTGINI adde.unidata.ucar.edu # imgdisp.k RTGINI/GE1KVIS STA=KMIA EU=IMAGE SF=YES REFRESH='EG;MAP H' # frmsave.k 1 miamivis.gif # done exit 'mcenv' is run to create a session in which multiple applications can be run one after the other. Last comment: notice that you must always exit the 'mcenv' session. Running 'mcenv' is like running a new invocation of a shell from the Unix command line. If your default shell is the C Shell, then your ~/.cshrc file will be sourced upon setup. This is the reason that the installation instructions for the user 'mcidas' have you create the following construct in .cshrc: # C-shell environment variable definitions for the user 'mcidas' # umask umask 002 # MCHOME and McINST_ROOT setenv MCHOME $HOME setenv McINST_ROOT $MCHOME # NOTE: conditional definition is only needed for C-shell users if ( ! ${?MCPATH} ) then setenv MCDATA $MCHOME/workdata "$MCHOME/data/ADDESITE.TXT" setenv XCD_disp_file $MCDATA/DECOSTAT.DAT if ( ! ${?path} ) then set path=${MCGUI} else set path=(${MCGUI} $path) endif endif # Limit ADDE transfers to compressed ones setenv MCCOMPRESS TRUE # CD to the McIDAS working directory cd $MCDATA The 'if' construct prevents MCDATA, MCPATH, etc. from being redefined once MCPATH has been defined. The reason for this is that your MCPATH environment setting actually gets modified when you run 'mcenv'. The modification is that a new directory is appended to the end of MCPATH, the directory is a subdirectory of the ~/.mctmp directory. To get a feeling for what is going on, try the following: echo $MCPATH mcenv echo $MCPATH exit If the 'if' construct was not guarding against redefining MCPATH, the ~/.mctmp/... subdirectory appended to the end of MCPATH would disappear and there would be bad, hard to understand consequences. >Thank you for your support. No worries. You are at a disadvantage since you have not attended a workshop where the concepts that we have been talking about in the past couple/few emails are explained. The good news is that once you get a feeling for what is going on behind the scenes you will be able to create quite complex and appealing displays easily..
https://www.unidata.ucar.edu/support/help/MailArchives/mcidas/msg02758.html
CC-MAIN-2022-40
refinedweb
1,111
64.81
Setting Up On-premise Kubernetes: Machine Learning Pipelines - 244 Setting Up On-premise Kubernetes: Machine Learning Pipelines .in this multi-part series, I’ll walk you through how I set up an on-premise machine learning pipeline with open-source tools and frameworks. in this multi-part series, I’ll walk you through how I set up an on-premise machine learning pipeline with open-source tools and frameworks. Prologue: Model Training is Just A Tiny Part When most people think about machine learning, they imagine engineers and data scientists tweaking network architectures, loss functions, and tuning hyper-parameters, coupled with the constant retraining until the results are satisfactory. Indeed, training machine learning models takes a lot of hard work. A tremendous amount of time and resources are expended on research and experimentation. However, there comes a point in time when you need to start to productionize the model that you’ve lovingly trained and tuned. And oh, by the way, the model is expected to perform as well on next weeks’ batch of data. It slowly dawns on you that Machine Learning is much bigger than models, hyper-parameters, and loss functions. It’s also what happens before, during, and after training. And it doesn’t end there, because you would also need to think about re-training, especially when you get new data, since there’s no guarantee that the model is going to generalize as well. There’s a very well known diagram that succinctly illustrates the issue: In short, you need to build a machine learning pipeline that can get you from raw data to the trained model in the shortest possible time. But here’s the catch: because you’re part of a scrappy startup and not flushed with VC money, you’re going to have to make do with the servers you have, and not rely on the paid cloud offerings of Amazon, Microsoft or Google, at least for the time being. This is because you need a safe environment to learn and experiment in — one that won’t unexpectedly shock you with a nasty bill at the end of the month. Who You Are You could be a software engineer at a company that’s starting to think about putting its machine learning models to production, or you could be running solo and curious about what “real-world” machine learning looks like. In both cases, you would need to know about machine learning pipelines. What You Need to Know You should be comfortable with Linux. The examples will assume Ubuntu Linux 18.04, though slightly dated or more recent versions shouldn’t cause any major issues. You should have some working knowledge of Docker. If you know how to build images in Docker, and how to execute containers, you should be good to go. If you don’t, you shouldn’t worry too much: I’ll guide you with enough background information, and code examples will be explained. While this is an article about Machine Learning pipelines, this article is not about the intricacies involved in training a model. We’re going to use Kubernetes. You don’t need to be an expert in it. If you are completely new to Kubernetes, that’s OK. By the end of the series, you’ll have at least some hands-on experience. On the other hand, I’m not going to go very deep into Kubernetes specifics. Some commands I’ll have to gloss over in the interests of brevity. Besides, the real objective here to help you deploy machine learning pipelines as efficiently as possible. Here are some other assumptions that I’m making about you, the astute reader: - you’re not entirely clueless about Machine Learning - you have access to some relatively beefy servers (ideally more than one) that contain Nvidia GPUs - you have an existing machine learning code base that’s written in Python - you don’t work in a unicorn startup or Fortune 500 and therefore are not so flush with cash that you can happily spin up multiple V100s. What Are We Going to Do? Machine learning pipelines only recently have gotten more love and attention, and people are just only beginning to figure everything out. Put in another way, there are multiple ways to build machine learning pipelines, because every organization has unique requirements, and every team has their favorite tool. What this series aims to offer is one possible way to do it, and that’s especially important when you’re starting out, because the amount of information is often very overwhelming. Also, installing Kubernetes is a daunting affair, littered with many roadblocks. I hope this article helps with smoothening that path. After you’ve learned a way to build a machine learning pipeline, you’ll then be equipped with enough skills and knowledge to go build one to suit your organization’s needs. Here’s a list of some of the tools I’ll cover in this series: - Docker - Kubernetes - Rancher - KubeFlow/KubeFlow Pipelines - Minio - Tensorflow On On-premise As you’ll realize soon as you follow through the series, many of these tools assume that you have storage on Amazon S3 or Google Cloud Storage, which, to put it mildly, not a very good assumption. Thus this series shows how to work around some of these limitations without losing any of the functionality. Of course, at some point in time, you’ll outgrow and would need something more capable. However, especially when you’re starting (that is, you happen to be the first Data Engineer on the team), then on-premise would seem a more cost-effective and ultimately the more educational choice. Installing Kubernetes the Easy Way with Rancher Let’s start immediately with one of the harder bits — Installing Kubernetes. The main thing you need to know about Kubernetes is that it’s a container-orchestration system for automating application deployment, scaling, and management. There are many ways to install Kubernetes, and it’s not a trivial process. Fortunately, that’s tools like Rancher make the installation process much more pleasant and less error-prone. In particular, we’re going to use the Rancher Kubernetes Engine (RKE) to help us install Kubernetes. At the point of this writing, the latest stable release of rke is 1.0.0. Step 0: Prepare the Machines The following steps assume that you have access to two Linux machines that are connected to the same LAN. We’re going to set up a minimal cluster consisting of two machines, one named master and the other worker. Of course, you can name your machines whatever you want, as long as you designate one machine to be master, and the rest to be workers. If you only have access to one machine, you can get by with creating two virtual machines, and make sure to enable Bridged Adapter. In fact, in preparation for this article, I’m testing everything out of Oracle’s VirtualBox. Here are my settings: Notice here that I have two VMs: master and node. Enable the Bridged Adapter and also setting Promiscuous Mode to Allow All. The downside to that is that you wouldn’t be able to access the GPUs, and you would most likely notice that the performance won’t be ideal because Kubernetes tends to be quite demanding in terms of resources. Again, that’s OK if you’re trying this at home or have only access to a single machine at the moment. Here are some important details about the machines (you should have them on hand too for the configuration steps that follow): DNS and Load Balancing In a production environment, you would need a hostname to point to your Kubernetes cluster. However, in this article I’m assuming you don’t have one readily available, so we’re going to have to fake it. Another thing I won’t cover — to keep things simple — is load balancing when it comes to the Rancher installation. For our purposes, I’m going to use rancher-demo.domain.test as the hostname. In both machines, open /etc/hosts file: sudo vim /etc/hosts Enter the following: 192.168.86.35 worker 192.168.86.35 rancher-demo.domain.test 192.168.86.36 master 127.0.0.1 localhost Notice here that the worker node has the additional hostname of rancher-demo.domain.test. In a slightly more realistic environment, you’d have something like NGINX as a front-end to load balance between multiple worker nodes. *Note: If you’re using a Virtual Machine, then most likely you’d be using the Ubuntu Server image, which typically doesn’t come with a desktop environment. Therefore, you should also have an entry in the host computer to include this: 192.168.86.35 rancher-demo.domain.test That way, you’ll be able to access Rancher from a browser on the host computer.* Step 1: Obtain the rke Binary Important!: This step should only be performed on master. Head over to the GitHub page to download the rke binary. Next, rename the binary to rke, followed by making it executable. Finally, move the binary to a location in the PATH, where /usr/local/bin is usually a good choice. Important: make sure you select the right binary for your OS! $ wget $ mv rke_linux-amd64 rke $ chmod +x rke $ sudo mv rke /usr/local/bin Now let’s see if everything works: $ rke This should return: NAME: rke - Rancher Kubernetes Engine, an extremely simple, lightning fast Kubernetes installer that works everywhere USAGE: rke [global options] command [command options] [arguments...] VERSION: v1.0.0 AUTHOR(S): Rancher Labs, Inc. COMMANDS: up Bring the cluster up remove Teardown the cluster and clean cluster nodes version Show cluster Kubernetes version config Setup cluster configuration etcd etcd snapshot save/restore operations in k8s cluster cert Certificates management for RKE cluster encrypt Manage cluster encryption provider keys help, h Shows a list of commands or help for one command GLOBAL OPTIONS: --debug, -d Debug logging --quiet, -q Quiet mode, disables logging and only critical output will be printed --help, -h show help --version, -v print the version Step 2. Preparing the Linux Hosts Important: these steps are to be performed on all of the machines. a) Install Docker First, make sure that Docker 19.03 is installed on all the Linux hosts: $ curl -fsSL | sudo apt-key add - $ sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable edge" $ sudo apt-get update $ sudo apt-get install -y docker-ce To make sure that the Docker service is running correctly, execute the following: $ sudo systemctl status docker This should return: ● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2019-12-28 03:01:03 UTC; 27s ago Docs: Main PID: 4118 (dockerd) Tasks: 8 CGroup: /system.slice/docker.service └─4118 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock Dec 28 03:01:03 master dockerd[4118]: time="2019-12-28T03:01:03.179311453Z" level=warning msg="Your kernel does not support swap memory limit" Dec 28 03:01:03 master dockerd[4118]: time="2019-12-28T03:01:03.179509363Z" level=warning msg="Your kernel does not support cgroup rt period" Dec 28 03:01:03 master dockerd[4118]: time="2019-12-28T03:01:03.179608175Z" level=warning msg="Your kernel does not support cgroup rt runtime" Now execute the following command so that you can use the docker command without sudo: $ sudo usermod -aG docker $USER Let’s try it out: $ docker run hello-world Whoops! docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post: dial unix /var/run/docker.sock: connect: permission denied. See 'docker run --help'. The reason you are getting this is that you need to log out first: $ exit Once you’re logged in, try again: $ docker run hello-world You should see this: Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. b) Set up SSH keys In case you haven’t had SSH keys set up, perform the following step on master: $ ssh-keygen $ eval "$(ssh-agent -s)" $ ssh-add ~/.ssh/id_rsa Then, copy the public key to all the worker nodes. Since we only have one worker node: $ ssh-copy-id [email protected] You need to make sure that $USER can SSH into the nodes. For example, make sure you can access worker from master: On both nodes, configure the SSH server to allow port-forwarding: % sudo vim /etc/ssh/sshd_config Uncomment the following: AllowTcpForwarding yes c) Turn swap off To turn off swap: $ sudo swapoff -a Open /etc/fstab in your favorite editor and comment out the swap file entry : $ sudo vim /etc/fstab d) Apply sysctl settings $ sudo sysctl net.bridge.bridge-nf-call-iptables=1 e) DNS on Ubuntu 18.04 In this version of Ubuntu onwards, the way DNS is set up has changed. To revert to the previous behavior: $ sudo apt install resolvconf Edit the nameserver settings: sudo vim /etc/resolvconf/resolv.conf.d/head Add the following entries: nameserver 8.8.4.4 nameserver 8.8.8.8 Restart the resolveconf service: % sudo service resolvconf restart Step 3: Creating the Cluster Configuration File Important: the following step should only be performed on master. It’s time to finally install Kubernetes with rke! Before doing this, make sure that you have a list of IPs and hostnames for the nodes. The table from Step 0 would be very helpful for this step. You’ll need to run rke config to create a cluster configuration file. It will present you with a bunch of questions that are used to generate the configuration file: $ rke config Here’s an example of the questions and answers based on the table. Remember to adapt it to your users, hostnames, IP addresses, and SSH key locations. Also note that the master node should have the role of control plane and etcd, while the worker nodes should have the role of worker. If you ever make a mistake, you can always start over with Ctrl + C and running the command again: [+] Cluster Level SSH Private Key Path [~/.ssh/id_rsa]: [+] Number of Hosts [1]: 2 [+] SSH Address of host (1) [none]: 192.168.86.36 [+] SSH Port of host (1) [22]: [+] SSH Private Key Path of host (192.168.86.36) [none]: ~/.ssh/id_rsa [+] SSH User of host (192.168.86.36) [ubuntu]: ubuntu [+] Is host (192.168.86.36) a Control Plane host (y/n)? [y]: y [+] Is host (192.168.86.36) a Worker host (y/n)? [n]: n [+] Is host (192.168.86.36) an etcd host (y/n)? [n]: y [+] Override Hostname of host (192.168.86.36) [none]: master [+] Internal IP of host (192.168.86.36) [none]: [+] Docker socket path on host (192.168.86.36) [/var/run/docker.sock]: [+] SSH Address of host (2) [none]: 192.168.86.35 [+] SSH Port of host (2) [22]: [+] SSH Private Key Path of host (192.168.86.35) [none]: ~/.ssh/id_rsa [+] SSH User of host (192.168.86.35) [ubuntu]: ubuntu [+] Is host (192.168.86.35) a Control Plane host (y/n)? [y]: n [+] Is host (192.168.86.35) a Worker host (y/n)? [n]: y [+] Is host (192.168.86.35) an etcd host (y/n)? [n]: n [+] Override Hostname of host (192.168.86.35) [none]: worker [+] Internal IP of host (192.168.86.35) [none]: [+] Docker socket path on host (192.168.86.35) [/var/run/docker.sock]: [+] Network Plugin Type (flannel, calico, weave, canal) [canal]: flannel [+] Authentication Strategy [x509]: [+] Authorization Mode (rbac, none) [rbac]: [+] Kubernetes Docker image [rancher/hyperkube:v1.16.3]: This generates cluster.yml, the RKE cluster configuration file: nodes: - address: "192.168.86.36" port: "22" internal_address: "" role: - controlplane - etcd hostname_override: "" user: ubuntu docker_socket: /var/run/docker.sock ssh_key: "" ssh_key_path: ~/.ssh/id_rsa ssh_cert: "" ssh_cert_path: "" labels: {} taints: [] - address: "192.168.86.35" port: "22" internal_address: "" role: - worker hostname_override: "" user: ubuntu: "" backup_config: null: plugin: flannel options: {} node_selector: {} authentication: strategy: x509 sans: [] webhook: null addons: "" addons_include: [] system_images: etcd: rancher/coreos-etcd:v3.3.15-rancher1 alpine: rancher/rke-tools:v0.1.51 nginx_proxy: rancher/rke-tools:v0.1.51 cert_downloader: rancher/rke-tools:v0.1.51 kubernetes_services_sidecar: rancher/rke-tools:v0.1.51 kubedns: rancher/k8s-dns-kube-dns:1.15.0 dnsmasq: rancher/k8s-dns-dnsmasq-nanny:1.15.0 kubedns_sidecar: rancher/k8s-dns-sidecar:1.15.0 kubedns_autoscaler: rancher/cluster-proportional-autoscaler:1.7.1 coredns: rancher/coredns-coredns:1.6.2 coredns_autoscaler: rancher/cluster-proportional-autoscaler:1.7.1 kubernetes: rancher/hyperkube:v1.16.3-rancher1 flannel: rancher/coreos-flannel:v0.11.0-rancher1 flannel_cni: rancher/flannel-cni:v0.3.0-rancher5 calico_node: rancher/calico-node:v3.8.1 calico_cni: rancher/calico-cni:v3.8.1 calico_controllers: rancher/calico-kube-controllers:v3.8.1 calico_ctl: "" calico_flexvol: rancher/calico-pod2daemon-flexvol:v3.8.1 canal_node: rancher/calico-node:v3.8.1 canal_cni: rancher/calico-cni:v3.8.1 canal_flannel: rancher/coreos-flannel:v0.11.0 canal_flexvol: rancher/calico-pod2daemon-flexvol:v3.8.1 weave_node: weaveworks/weave-kube:2.5.2 weave_cni: weaveworks/weave-npc:2.5.2 pod_infra_container: rancher/pause:3.1 ingress: rancher/nginx-ingress-controller:nginx-0.25.1-rancher1 ingress_backend: rancher/nginx-ingress-controller-defaultbackend:1.5-rancher1 metrics_server: rancher/metrics-server:v0.3.4 windows_pod_infra_container: rancher/kubelet-pause:v0.1.3 ssh_key_path: ~/.ssh/id_rsa ssh_cert_path: "" ssh_agent_auth: false authorization: mode: rbac options: {} ignore_docker_version: false kubernetes_version: "" private_registries: [] ingress: provider: "" options: {} node_selector: {} extra_args: {} dns_policy: "" extra_envs: [] extra_volumes: [] extra_volume_mounts: [] cluster_name: "" cloud_provider: name: "" prefix_path: "" addon_job_timeout: 0 bastion_host: address: "" port: "" user: "" ssh_key: "" ssh_key_path: "" ssh_cert: "" ssh_cert_path: "" monitoring: provider: "" options: {} node_selector: {} restore: restore: false snapshot_name: "" dns: null Time to bring the cluster up! % rke up Wait as rke sets up the Kubernetes cluster: INFO[0000] Running RKE version: v1.0.0 INFO[0000] Initiating Kubernetes cluster INFO[0000] [certificates] Generating admin certificates and kubeconfig INFO[0000] Successfully Deployed state file at [./cluster.rkestate] INFO[0000] Building Kubernetes cluster INFO[0000] [dialer] Setup tunnel for host [192.168.86.35] INFO[0000] [dialer] Setup tunnel for host [192.168.86.36] # Many more lines ... INFO[0044] Finished building Kubernetes cluster successfully A few more files would have been created at this point: $ ls cluster.rkestate cluster.yml kube_config_cluster.yml You should keep these files in a safe location if ever you need to recreate the cluster. You’ll need to copy kube_config_cluster.yml to a location where Kubernetes can find it: $ mkdir ~/.kube $ cp kube_config_cluster.yml $HOME/.kube/config Install Kubectl Note: this step should only be done on the master node. Next, you should install the Kubernetes command-line tool, kubectl: curl -s | sudo apt-key add - echo "deb kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list sudo apt-get update sudo apt-get install -y kubectl Once this step is completed, we can test it out by listing all the nodes that rke created: % kubectl get nodes NAME STATUS ROLES AGE VERSION 192.168.86.35 Ready worker 53m v1.16.3 192.168.86.36 Ready controlplane,etcd 53m v1.16.3 Success! Let’s do something else. We can inspect what containers were created: % kubectl get pods --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE ingress-nginx default-http-backend-67cf578fc4-dk9l4 1/1 Running 0 49m ingress-nginx nginx-ingress-controller-bnwlv 1/1 Running 0 49m kube-system coredns-5c59fd465f-7gbff 1/1 Running 0 49m kube-system coredns-5c59fd465f-mhzdb 1/1 Running 0 49m kube-system coredns-autoscaler-d765c8497-p2zj4 1/1 Running 0 49m kube-system kube-flannel-vkxc6 2/2 Running 0 54m kube-system kube-flannel-xjtst 2/2 Running 0 54m kube-system metrics-server-64f6dffb84-hs99g 1/1 Running 0 49m kube-system rke-coredns-addon-deploy-job-kdwxm 0/1 Completed 0 49m kube-system rke-ingress-controller-deploy-job-rpvrq 0/1 Completed 0 49m kube-system rke-metrics-addon-deploy-job-x2m2j 0/1 Completed 0 49m kube-system rke-network-plugin-deploy-job-h5ffz 0/1 Completed 0 55m Don’t worry about what pods are at this point. Just think of them as containers for now. Install Helm 3 Note: this step should only be done on the master node. Helm is a Kubernetes package manager and is very handy for deploying applications and services onto Kubernetes clusters. We’ll use Helm to install Rancher and some other supporting services. $ curl | bash helm should be installed into the PATH: Downloading Preparing to install helm into /usr/local/bin helm installed into /usr/local/bin/helm Install Rancher Using Helm Note: This step should only be done on the master node. $ helm repo add rancher-stable Create a namespace for Rancher: $ kubectl create namespace cattle-system Install cert-manager Note: this step should only be done on the master node. Cert Manager helps with automatically provisioning and managing TLS certificates in Kubernetes. There are options to use certificates from Let’s Encrypt for example, but for now, we shall keep things simple and use the default certificates generated by Rancher. Note: here we are installing a slightly outdated version of cert-manager because the latest one (0.12) seems to have installation issues. Follow these steps to install cert-manager onto the Kubernetes cluster: $ kubectl apply -f $ kubectl create namespace cert-manager $ kubectl label namespace cert-manager certmanager.k8s.io/disable-validation=true $ helm repo add jetstack $ helm repo update $ helm install --name cert-manager \ --namespace cert-manager \ --version v0.9.1 \ jetstack/cert-manager Check that everything went well: kubectl get pods --namespace cert-manager NAME READY STATUS RESTARTS AGE cert-manager-5b9ff77b7-x6vgn 1/1 Running 0 44s cert-manager-cainjector-59d69b9b-nrgkf 1/1 Running 0 44s cert-manager-webhook-cfd6587ff-8tcgt 1/1 Running 0 44s Note that you might have to wait for some time (usually just a few minutes) for all the STATUS to turn to Running. Install Rancher Finally, you can install Rancher, which, among other things, provides a nice interface to manage your Kubernetes cluster(s): $ helm install rancher rancher-stable/rancher \ --namespace cattle-system \ --set hostname=rancher.example.com Check that everything went well: kubectl -n cattle-system rollout status deploy/rancher Waiting for deployment "rancher" rollout to finish: 0 of 3 updated replicas are available... Wait till all the replicates have been updated before performing the next step. Now, since we don’t have a load balancer, we need to perform an additional step to be able to access the Rancher UI. Create the following file an name it ingress.yml and fill it with the following (adapt the host to whatever you have picked): apiVersion: extensions/v1beta1 kind: Ingress metadata: name: rancher-demo-ingress spec: rules: - host: rancher-demo.domain.test http: paths: - path: / backend: serviceName: rancher-demo servicePort: 443 Then run: $ kubectl apply -f ingress.yml After that, Rancher should available at: Accept the security exception your browser might complain about and you should be greeted with the following screen with a prompt to create a password and set the domain name (already pre-filled). Go ahead and do that: Give Rancher a few moments to set things up. Once done, you should get an overview of your cluster: Go ahead and click around and revel in the fruits of your labor! Summary If you’ve reached this stage, you should congratulate yourself on persevering. Installing a Kubernetes cluster isn’t for the faint of heart, even with tools like Rancher to somewhat ease the process. Let’s review what we’ve done. We went through why training ML models are just the tip of the proverbial iceberg, and that a lot of other supporting software needs to come together to put these models into production. More importantly, we set up a non-trivial Kubernetes cluster with the Rancher Kubernetes Engine and installed Rancher to manage the cluster. This is no mean feat. However, we still haven’t done any machine learning deployment yet! That will be the next article in the series, where we install Kubeflow, an open-source machine learning platform. Suggest: ☞ Machine Learning Zero to Hero - Learn Machine Learning from scratch ☞ Platform for Complete Machine Learning Lifecycle ☞ Introduction to Machine Learning with TensorFlow.js ☞ Top 4 Programming Languages to Learn In 2019 ☞ What is Python and Why You Must Learn It in [2019] ☞ Top 4 Programming Languages to Learn in 2019 to Get a Job
https://geekwall.in/p/GuN2ofrD/setting-up-on-premise-kubernetes-machine-learning-pipelines
CC-MAIN-2020-16
refinedweb
4,114
55.74
Hi, Does anyone have a C program with source code for reading a sector from a hard drive with int25 or int13 ? The program I was trying to use is below, it was written in MS C 5.10, I have TurboC 2.0. If I include the far pointer it won't compile, if I don't include it, it doesn't like the FP_ statements. Any help/comments would be appreciated. Thanks, Kevin /* Read a Sector from the Harddrive */ #include <stdio.h> #include <dos.h> struct parm_block { unsigned long start_sector; unsigned num_of_sectors; char far *buffer; } main() { union REGS inregs, outregs; struct SREGS segregs; /* original code had struct far parm_block p_block; */ struct parm_block p_block; /* construct parameter block */ p_block.start_sector =0; p_block.num_of_sectors = 1; p_block.buffer = (char far *) farmalloc(512) ; /* buffer for 1 sector */ /* call function */ inregs.h.al = 0x02; /* drive c */ inregs.x.cx = 0xffff; /* extended calling format */ inregs.x.bx = FP_OFF(p_block); /* xfer pblock offset to bx */ segregs.ds = FP_SEG(p_block); /* xfer pblock segment to ds */ int86x(0x25, &inregs, &outregs, &segregs); /* read sector to buffer */ if ((outregs.x.cflag & 0x01) == 0x01) { printf("\nError Code: %x", outregs.x.ax); /* check for error*/ exit(1); } /* Process sector here*/ exit(0); } Code from The indispensible PC hardware book by Hans-Peter Messmer
https://cboard.cprogramming.com/c-programming/1970-c-source-code-int25-code-help.html
CC-MAIN-2017-26
refinedweb
211
69.18
How do you check if a variable is an array in JavaScript?). This question already has an answer here: - Check if object is array? 37 answers I would like to check whether a variable is either an array or a single value in JavaScript. I have found a possible solution... if (variable.constructor == Array)... Is this the best way this can be done? Thought I would add another option for those who might already be using the Underscore.js library in their script. Underscore.js has an isArray() function (see). _.isArray(object) Returns true if object is an Array. I was using this line of code: if (variable.push) { // variable is array, since AMAIK only arrays have push() method. } The universal solution is below: Object.prototype.toString.call(obj)=='[object Array]' Starting from ECMAScript 5, a formal solution is : Array.isArray(arr) Also, for old JavaScript libs, you can find below solution although it's not accurate enough: var is_array = function (value) { return value && typeof value === 'object' && typeof value.length === 'number' && typeof value.splice === 'function' && !(value.propertyIsEnumerable('length')); }; The solutions are from function isArray(myArray) { return myArray.constructor.toString().indexOf("Array") > -1; } This is an old question but having the same problem i found a very elegant solution that i want to share. Adding a prototype to Array makes it very simple Array.prototype.isArray = true; Now once if you have an object you want to test to see if its an array all you need is to check for the new property var box = doSomething(); if (box.isArray) { // do something } isArray is only available if its an array There are multiple solutions with all their own quirks. This page gives a good overview. One possible solution is: function isArray(o) { return Object.prototype.toString.call(o) === '[object Array]'; } Something I just came up with: if (item.length) //This is an array else //not an array I have created this little bit of code, which can return true types. I am not sure about performance yet, but it's an attempt to properly identify the typeof. also blogged a little about it here it works, similar to the current typeof. var user = [1,2,3] typeOf(user); //[object Array] It think it may need a bit of fine tuning, and take into account things, I have not come across or test it properly. so further improvements are welcomed, whether it's performance wise, or incorrectly re-porting of typeOf. I personally like Peter's suggestion: (for ECMAScript 3. For ECMAScript 5, use Array.isArray()) toString() is changed at all, that way of checking an array will fail. If you really want to be specific and make sure toString() has not been changed, and there are no problems with the objects class attribute ( [object Array] is the class attribute of an object that is an array), then I recommend doing something like this: //see if toString returns proper class attributes of objects that are arrays //returns -1 if it fails test //returns true if it passes test and it's an array //returns false if it passes test and it's not an array function is_array(o) { // make sure an array has a class attribute of [object Array] var check_class = Object.prototype.toString.call([]); if(check_class === '[object Array]') { // test passed, now check return Object.prototype.toString.call(o) === '[object Array]'; } else { // may want to change return value to something more desirable return -1; } } Note that in JavaScript The Definitive Guide 6th edition, 7.10, it says Array.isArray() is implemented using Object.prototype.toString.call() in ECMAScript 5. Also note that if you're going to worry about toString()'s implementation changing, you should also worry about every other built in method changing too. Why use push()? Someone can change it! Such an approach is silly. The above check is an offered solution to those worried about toString() changing, but I believe the check is unnecessary. If you are using Angular, you can use the angular.isArray() function var myArray = []; angular.isArray(myArray); // returns true var myObj = {}; angular.isArray(myObj); //returns false function isArray(x){ return ((x != null) && (typeof x.push != "undefined")); }
http://code.i-harness.com/en/q/bb5fe
CC-MAIN-2018-43
refinedweb
692
57.98
Ticket #2433 (closed defect: fixed) paste.util.mimeparse.best_match compatibility with '*' mime type Description Copying here the content of email I sent to the TG2 ML as it has been asked to me to open a ticket about this issue. As RFC 2616 media range in HTTP_ACCEPT should be specified as media-range = ( "*/*" | ( type "/" "*" ) | ( type "/" subtype ) ) *( ";" parameter ) so when "all" is meant "*/*" should be passed, but some user agents, like the facebook external link retriever pass '*' instead of '*/*' this makes paste.util.mimeparse.best_match crash on paste.util.mimeparse.parse_mime_type paste.util.mimeprase.best_match is used by Turbogears to detect which template to render, and so each TG2 application crashes when contacted by facebook. A solution is to change paste.util.mimeparse.parse_mime_type to support the '*' syntax by adding if parts[0].strip() == '*': just before (type, subtype) = parts[0].split("/") this fixes the problem and I have already patched all my deployed TG2 apps, but I think that a more general fix might be good and also people at paste and mimeparse might be interested in having the patch. (This happens with Paste-1.7.2 at least) The working version of the parse_mime_type method is the following one: def parse_mime_type(mime_type): """Carves up a mime_type and returns a tuple of the (type, subtype, params) where 'params' is a dictionary of all the parameters for the media range. For example, the media range 'application/xhtml;q=0.5' would get parsed into: ('application', 'xhtml', {'q', '0.5'}) """ parts = mime_type.split(";") params = dict([tuple([s.strip() for s in param.split("=")])\ for param in parts[1:] ]) if parts[0].strip() == '*': (type, subtype) = parts[0].split("/") return (type.strip(), subtype.strip(), params) Change History comment:2 Changed 9 years ago by brondsem I'm encountering this exception fairly frequently. And #2487 describes the same problem, I think. It looks like Paste 1.7.3 was release recently, and includes some mimeparse fixes. As a bit of a side note: very frequently our controllers only have one @expose type, so in lookup_template_engine, if len(self.engines) == 1, that content_type could be used and best_match does not have to be called at all. comment:4 Changed 9 years ago by chrisz Does this only affect TG 2.0.x? If not, the milestone should be set to 2.1. comment:5 Changed 9 years ago by brondsem - Milestone changed from 2.0.* bugfix to 2.1 It effects 2.1b1 also. comment:6 Changed 9 years ago by chrisz - Status changed from new to closed - Resolution set to fixed The paste guys have an issue in their trac for this, and a fix in the paste trunk as of 13 months ago — and it still hasn't been released. Guess I'll monkeypatch for now. Sigh.
http://trac.turbogears.org/ticket/2433
CC-MAIN-2019-30
refinedweb
462
67.15
Active Directory in a Real-Life Global Organization Henderson, a part of AMPits larger global parent companycame about when AMP purchased Henderson Investors. Henderson originally was a company based in the United Kingdom. AMP's own investment company, AMP Asset Management, had some branch offices around the globe. When the Henderson and AMP Asset Management organizations came together to form Henderson Global Investors, they had no effective network, and had disparate systems and services. For staff members around the globe to communicate with each other was, needless to say, difficult. Most offices had Lotus Notes and some Microsoft Exchange, but often the base operating systems for desktops and servers were different between and within some of the regions around the globe. Senior management saw that the company needed to develop a world-class global presence, not just in the Asset Management field (its core business), but also within their internal IT systems. KCI was contracted to begin to assist Henderson to develop the internal systems network and standards, and to provide a global communications system in the form of an intranet to support its business. This project included the development and deployment of the infrastructure, business processes, and the code to get the systems up and running. The best part of all? It needed to be done in 120 days! With such tight timeframes, planning and design began almost immediately. Because the solution was to be delivered on Microsoft platforms, KCI and Henderson enlisted Microsoft New Zealand's help to design and deliver the AD structure. One of the largest problems was coming up with a design that would allow each of the IT sections around the globe to retain control of its existing domains. With a rollout time of only 120 days, it would take too long to migrate all the existing users to a new single domain (and IT managers in the regions did not want to lose control of their own region's resources). It was decided that a dis-contiguous namespace would be implemented, and each of the region's domains would reside under a single parent domain. Figure 1 highlights the design, but note that I have changed the names of the domains for the purposes of this article. Figure 1 Design of the AD forest for Henderson. But why a dis-contiguous namespace? Well, because Henderson was part of AMP, the larger global organization, the Henderson domain needed to be able to support any new companies that became part of the IT strategy that Henderson was designing. To this end, if AMP becomes part of the Henderson AD forest, a new tree just needs to be created within the existing forest (off of the Root domain), and voila! AMP is part of the AD without compromising or giving up control of its own internal systems.
https://www.informit.com/articles/article.aspx?p=23569&seqNum=3
CC-MAIN-2019-43
refinedweb
471
50.16
HTML, CSS, and Javascript in Visual If you want to learn more about the basic languages, you can follow the below link A client-side language such as HTML, CSS, or Javascript is responsible for displaying content on a browser (front-end). If we want to perform server-side tasks like a filesystem and connect with the database; then we need to learn server-side languages e.g. Nodejs, and PHP. You have the option to choose between different server-side languages. If you are a WordPress lover, then PHP is the way to go. If you want to write Javascript on the server, then Nodejs is the option. As mentioned, Javascript is used to load dynamic content (UI) without refreshing the page e.g. validating user input, popup modal/ads, toggling dark and light mode, etc. But if the UI of the website becomes more complex, then handling it with Javascript could be a very lengthy task. So, we need a more robust UI library, Reactjs. React is the JavaScript library for building user interfaces and is the most popular among developers. It helps you manage a lot of things easier with features like Virtual DOM(normal DOM updates are slow), handling data with states, component-based structure, etc. Along with ReactJS, we need a framework that makes our development workflow smoother e.g. Page route, SSR, SSG, code automation, image optimization, etc. The most popular React frameworks are Gatsbyjs and NextJS. As I’m more inclined towards Gatsbyjs, here I’ll discuss the Gatsbyjs framework. Gatsby is a modern web framework built on top of React and GraphQL. We can use Gatsbyjs to build both static and dynamic sites. To get started with Gatsbyjs, you can choose the **.js file located in the src/pages folder serves as a page route. To start running the Gatsby project, we can execute the below command in the terminal. npm run develop After, Your site is now running at To perform a backend task, you need a backend server. Luckily, in Gatsby, we can write serverless functions without running servers. To create a serverless function, we can create a **.js file at the src/api location in the project. In the front end, we can execute the serverless function by sending HTTP requests to the respective API route. For example, the newsletter.js file located at src/api create the API route at. So to execute the respective function from the frontend, we can send the HTTP response to the respective API route as shown in the below code: import axios from "axios" async function onSubmit(data: { name, email }) { let subscribe = await axios.post(`/api/newsletter`, { name: String(data.name), email: String(data.email), }); if (subscribe?.data?.message === "success") { console.log("Great!!!"); } } To store the user’s data we need a database. There are many options to choose between the database e.g SQL or non-SQL. To interact with the database, we need a server e.g. Express web server. We can’t interact with the database using the client (front-end). Some of the database companies allow the developer to perform CRUD (create, read, update, and delete) operations on the database using the API. In such a case, we have an API layer on top of the database layer. Instead of interacting directly with the database, we can send the HTTP requests to the API route to perform the CRUD operation. In this way, we can perform CRUD operations with both clients (frontend) and server sides applications. For example, Sanity_io is the unified content platform. To mutate and retrieve the data from the Sanity server, we can send the HTTP request to the respective API route along with the query parameter. To deploy your website, you need to have a public domain and a host server. If you don’t have a public domain, don’t worry you can host your website on the subdomain of the host server. The most popular hosting website are listed below. - Netlify - GitHub Pages - Heroku - Vercel - Render - Surge - Firebase Depending on the hosting website, you might have many options to build and deploy your website. But, the approach that we can follow is to push your code on Github (ship your code) and then deploy it on the netlify server as shown below Deploy code on Netlify Deploy code on Netlify Netlify is the hosting platform to host your assert/code live on the web. Netlify triggers a build command whenever you push your code up on Github. After your website is successfully built, netlify generates a public URL that you can visit to view your website. Final Words I’ve briefly discussed how you can build your website online. To start off, practice some code online and get your hands dirty with some side projects. Some of the projects that you start doing right now are listed below: - Build a responsive website with HTML, CSS, and Javascript - Build a todo list with React Project - Store users’ details in the database. In case you are interested in a more in-depth course, you can check out the Gatsby js course.
https://hackernoon.com/a-very-early-introduction-to-building-your-own-web-app-with-code
CC-MAIN-2022-33
refinedweb
857
73.58
: Beginning Java Exception in thread "main" Please help. Michael Baca Greenhorn Posts: 17 posted 11 years ago Not sure what I'm doing wrong, but I keep getting this error when trying to run my program from source as in java GameLauncher.java: Exception in thread "main" java.lang.NoClassDefFoundError : GuessGame at GameLauncher.main(GameLauncher.java:4) Here is the code for GameLauncher.java: public class GameLauncher { public static void main(String[] args) { GuessGame game = new GuessGame(); game.startGame(); } } And from GuessGame.println("Playe is right?" + p2isRight); System.out.println("Player three got it right?" + p3isRight); System.out.println("Game is Over"); break; //Game is over, so break out of the loop } else { //we must keep going because no one got it right! System.out.println("Players will have to guess agian."); } // end if/else } // end method } // end class } And just in case from Player.java: public class Player { public void guess() { int number = 0; //Where the guess goes number = (int) (Math.random() * 10); System.out.println("I'm Guessing" + number); } } This is from the book Head First Java 2nd Edition. The book suggests(?) I use: jave GameLauncher.java to run it. Compiling gives me errors about an unresolved symbol on the three lines with guessp# = p#.number; reffering to the . just before number... Any ideas? Post Reply Bookmark Topic Watch Topic New Topic Similar Threads GuessGame errors Head First Java Book, Chapter 2 Please Help with Guessing Game (Head First Java) GuessGame Errors From Head First Java Very new to java
https://coderanch.com/t/398758/java/Exception-thread-main
CC-MAIN-2016-44
refinedweb
252
69.79
. By the way. Unix passwords cannot be decrypted due to a trap-door algorithm during encryption. Unix test passwords in the crypted state: You enter the password, it gets encrypted and is then compared with the crypted password in the password file. There for when you crack password you test a large set of passwords(dictionaries) by crypting and comparing it with the crypted entry in the passfile. If you have further questions feel free to ask further questions. Regards Ian to find it. Can you give me the exact site please. Thanks Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes! Learn how Concerto can help you. There is a new version available, but haven't found it on shareware.com Is there anything simpler out there... As was mentioned in previous respoense to your question, you cannot decrypt passwords. What you do is encrypt a password, then later, encrypt "test" passwords and see if they match the previously encrypted password - i.e., you never can see the original password in "clear" text - you can only test against the already encrypted one. Email me at taggart@outdoingit.com if you want to try to clarify things more. Scott Suggestion 1 1. For each letter pick a random number between 1 and 7. 2. Rotate the bits of the character left or right by the random number 3. Store the random number then the character for each character Then when you want to decrypt the password reverse the bitwise rotation for each character. Its simple but effective. Suggestion 2 1. Take the first character and mask the bottom 3 bits. 2. take the value between 0 and 7 and rotate the bits of the next character left/right by that value. etc.. etc.. #include <stdio.h> char s64[]="abcdefghijklmnopqrs main(){ char key[10]; char salt[3]; char pass[14]; srandom(time(0)+getpid()); salt[0]=s64[random()&63]; salt[1]=s64[random()&63]; printf("enter password: "); fgets(key,9,stdin); strcpy(pass,crypt(key,salt printf("crypt(%s,%s)=%s\n" while( 1 ){ printf("enter guess: "); fgets(key,9,stdin); if( strcmp(pass,crypt(key,pass printf("Correct\n"); exit(0); }else{ printf("Wrong\n"); } } }
https://www.experts-exchange.com/questions/10036177/Password-Encryption.html
CC-MAIN-2017-51
refinedweb
389
66.74
1. Matrixes in CVXOPT are column-major By the code: G=cvxopt.matrix([[1.,1],[-1,2],[2,1],[-1,0],[0,-1]])I thought I created a 5-by-2 matrix (5 horizontal rows and 2 vertical columns). However, I got a 2-by-5 matrix. In [72]: G Out[72]: <2x5 matrix, In [73]: print G [ 1.00e+00 -1.00e+00 2.00e+00 -1.00e+00 0.00e+00] [ 1.00e+00 2.00e+00 1.00e+00 0.00e+00 -1.00e+00] 2. The matrixes must be of type float. Make sure your matrixes are of type float, even though your coefficients are integers. Earlier I created a matrix: In [53]: q=cvxopt.matrix([[-2],[-6]]) Later I got the error like TypeError: 'q' must be a 'd' matrix with one column This is because the matrix is not of type float: In [54]: q Out[54]: <1x2 matrix, To fix, simply make at least one element float, e.g., "1." Then the type code will become d. In [89]: q Out[89]: <1x2 matrix, 3. Generating the matrixes needed for your optimization problem. First of all, the cvxopt formulates quadratic programming so much simpler than MATLAB. Here is how cvxopt formulates the problem: $$ \begin{array}{ll} \mbox{minimize} & (1/2) x^TPx + q^T x \\ \mbox{subject to} & G x \preceq h, \\ & Ax = b. \end{array} $$ The boundaries for all variables can be defined as part of the matrix G - just use eyes. E.g., the lower boundary constraints $$x_1 > 1, x_2>2, x_3> 3 $$ is just $$ \begin{bmatrix} -1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & -1 \end{bmatrix} \begin{bmatrix} x_1\\ x_2 \\ x_ 3 \end{bmatrix} < \begin{bmatrix} -1\\ -2\\ -3 \end{bmatrix} $$ Note that in either MATLAB's or cvxopt's formulation, the linear terms are always on the side of "smaller than or equal to". Hence, the minus one above. MATLAB formulations have two additional column arrays for upper and lower boundaries: $$ \begin{array}{ll} \mbox{minimize} & (1/2) x^THx + f^T x \\ \mbox{subject to} & A x \preceq b, \\ & A_{eq}x = b_{eq}, \\ & lb \preceq x \preceq ub. \end{array} $$ Apparently, there are lazy people who wants to have a straightforward conversion from MATLAB's formulation to cvxopt's. However, I am not sure whether that translation is out-dated because cvxopt changed their APIs. Here is an easier one. Let the MATLAB version be x = quadprog(H,f,A,b,Aeq,beq,lb,ub, ...)This is how you do it in cvxopt: import numpy import cvxopt import cvxopt.solvers n = H.shape[1] # n is the number of variables P = H q = f G = numpy.vstack([A, -numpy.eye(n), numpy.eye(n)]) h = numpy.vstack([b, -lb, ub]) A = Aeq b = beq sol = cvxopt.solvers.qp(cvxopt.matrix(P), cvxopt.matrix(q), cvxopt.matrix(G), cvxopt.matrix(h), cvxopt.matrix(A), cvxopt.matrix(b)) x = sol['x'] If you don't have lbnor/and ub, no need to have it/them in Gand h. Put things togetherSo, let's see an example. The example in MATLAB Optimization Toolbox can be solved in cvxopt as follows (in iPython shell): In [81]: G=cvxopt.matrix([[1.,1],[-1,2],[2,1],[-1,0],[0,-1]]) In [82]: P=cvxopt.matrix([[1,-1],[-1,2.]]) In [83]: q=cvxopt.matrix([[-2,-6.]]) In [84]: h=cvxopt.matrix([2,2,3,0,0.]) In [85]: Solv=cvxopt.solvers.qp(P.T, q, G.T, h) pcost dcost gap pres dres 0: -1.0389e+01 -8.2778e+00 2e+01 9e-01 1e+00 1: -7.2856e+00 -9.9286e+00 3e+00 1e-16 4e-16 2: -8.1161e+00 -8.6188e+00 5e-01 8e-17 2e-16 3: -8.2068e+00 -8.2359e+00 3e-02 6e-17 3e-15 4: -8.2220e+00 -8.2224e+00 3e-04 5e-17 1e-15 5: -8.2222e+00 -8.2222e+00 3e-06 8e-17 6e-16 Optimal solution found. In [86]: print Solv['x'] [ 6.67e-01] [ 1.33e+00] 1 comment: Thank you for this guide! I have tried to debug my code by myself but in vain. This topic is really helpful.
http://forrestbao.blogspot.com/2015/05/guide-to-cvxopts-quadprog-for-row-major.html
CC-MAIN-2017-13
refinedweb
708
68.47
One of my friends read my last post and, after an analogy involving candy stores and Japanese wrappers (or was it Japanese rappers? I think both would have worked), I decided it might be a good idea to put up some sample code to demonstrate some of the things I was talking about. I'm going to use some test code from the MVC module - mostly because I'm the most deeply into that code right now, but also because writing my own MVC framework makes me look like a total stud. At least to people who consider the definition of "total stud" to include things like "can write own MVC framework." Hell, just recognizing that fact makes me a total stud. Once again, with said group of people. Let's take a look at a Controller: namespace Test.MVC.ControllerCommon { [ControllerRegistration("/I/Am/Many/Levels/Deep/{id}")] [ViewFilePreference("/Default.aspx")] public class DeepController : StandardController { [CommandRegistration("Default")] public override void Index() { MVCContext.Current.Context.Items["TextToDisplay"] = "Index"; } [CommandRegistration("List")] [ViewFilePreference("/List.aspx")] public void List() { MVCContext.Current.Context.Items["TextToDisplay"] = "List"; } [CommandRegistration("Edit")] public void Edit(int id) { // Not implemented in this test } } } When the website is first started up, Global.asax runs an Initialize routine that does a bunch of stuff, one of which is to create a static instance of URL routing information for that application. As part of this, it will go through the DLLs for a website and look for classes that have that ControllerRegistration attribute on them. For each one that it finds, it creates an instance of that class and stores it in a collection (specifically, a tree hierarchy where each piece of that ControllerRegistration value is a node). It also creates a ControllerDescriptor object that has properties that mirror all of those attributes and contain those attribute values and stores that in the tree as well along with the controller object. In this case, this object will be instantiated and put in the tree at /I/Am/Many/Levels/Deep (the {id} is a parameter field and not used directly in matching the pattern). In that same spot will also be a ControllerDescriptor object whose properties will be some of those attributes along with the values supplied as well as a reference to the Controller object whose attribute values it holds. There's some other stuff in there, too, that a Controller might want to work with, but that's the basic idea. For every derived Controller class, you have a ControllerDescriptor object that holds the values of the attributes you put in your Controller class. So, the website receives a request to, and our Router class starts looking through those descriptors for a pattern that matches. It finds one and uses that descriptor to pull this controller object and supply whatever additional information (via the associated ControllerDescriptor) it needs to route properly. For example, Default.aspx will kick off the Index() method, while Edit.aspx will fire off the Edit method. Obviously, I'm glossing over a lot of other things that go on, but that's the basic idea. The point here isn't to explain how controllers work. The point is to illustrate how the metadata is used. In this case, the metadata is stored in those custom attributes, as opposed to a database lookup table or an XML file. What does this buy us? One could argue that a downside is, when you make changes, you have to recompile as opposed to changing the database or a config file. This is true and, for some code, we store the metadata in the database specifically for this reason. However, you have to look at how your code is being used and come up with your best option for that code. It's not a universal truth that storing metadata in the database is always best because you don't have to recompile, just as it's not a universal truth that storing metadata in attributes is the best because it's fast, self-documenting, and testable. In this case, we're talking about how our controllers map to URLs and the functionality we want to serve up. This is something that is not going to change dynamically on the fly. If there is a change to be made to existent mappings, then I've obviously changed functionality somewhere else, and a recompile is going to be necessary, anyway. If I haven't changed functionality anywhere, why would I need to change a mapping? Granted, someone might put in an incorrect mapping, but since we're talking about actually serving up the right web page, even a lazy tester is going to notice that they're not on the Edit screen. I mean, different places have different levels of testing rigor, but I assume "being on the right page" is a pretty fundamental priority. So, in this case, using attributes for metadata makes a lot of sense. It's fast, easy, and there's lots of functionality and testability behind it, and it's very easy to make additions or changes.
http://geekswithblogs.net/ontheledge/archive/2009/09/15/alexander-the-greats-code-samples.aspx
CC-MAIN-2020-34
refinedweb
850
60.65
A Flutter Toast plugin. Supported Platforms - Android fix BadTokenException and no notification permission required - IOS use # add this line to your dependencies toast: ^0.0.6 import 'package:toast/toast.dart'; Toast.show("Toast plugin app", duration: Toast.LENGTH_SHORT, gravity: Toast.BOTTOM); MIT License example/README.md Demonstrates how to use the toast plugin. This project is a starting point for a Flutter application. Add this to your package's pubspec.yaml file: dependencies: toast: ^0.0.6 You can install packages from the command line: with Flutter: $ flutter packages get Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more. Now in your Dart code, you can use: import 'package:toast/toast.dart'; We analyzed this package on May 8,/toast.dart. (-2.48 points) Analysis of lib/toast.dart reported 5 hints: line 8 col 20: Name non-constant identifiers using lowerCamelCase. line 9 col 20: Name non-constant identifiers using lowerCamelCase. line 10 col 20: Name non-constant identifiers using lowerCamelCase. line 11 col 20: Name non-constant identifiers using lowerCamelCase. line 12 col 20: Name non-constant identifiers using lowerCamel.
https://pub.dev/packages/toast/versions/0.0.6
CC-MAIN-2019-22
refinedweb
191
54.69
Difference between revisions of "Xmonad/General xmonad.hs config tips" Revision as of 20:34, 7 February 2009! Contents - 1 Making window float by default, or send it to specific workspace - 2 Making windows unfloat - 3 Ignoring a client (or having it sticky) - 4 Adding your own keybindings - 5 Displaying keybindings with dzen2 - 6 Adding your own mouse bindings - 7 Skipping the Scratchpad workspace while using CycleWS - 8 Do not show scratchpad workspace in status bar or dynamicLog - 9 Sharing a configuration across different hosts - 10 Binding keys to a specific layout - 11 Using local state in the config file Making window float by default, or send it to specific workspace This example shifts Rythmbox to workspace "=" and XDvi to "7:dvi", floats Xmessage, and uses manageDocks to leave gaps for status bars automatically. All this is combined with the default xmonad manageHook. This step-by-step tutorial covers initially setting up a manageHook, too. -- module imports and other top level definitions myManageHook = composeAll [ className =? "Rhythmbox" --> doShift "=" , className =? "XDvi" --> doShift "7:dvi" , className =? "Xmessage" --> doFloat ,"] See the FAQ about using xprop to get the properties of windows. See also the documentation for ManageHook. Making windows unfloat A related task is - how do I unfloat windows of a particular class or name?: main = xmonad $ defaultConfig { terminal = "urxvt" } `additionalKeysP` [ ("M-<Up>", windows XMonad.StackSet.swapUp) , ("M-x f", spawn "firefox") ] This is also described in [1].' Adding your own mouse bindings Adding your own mouse bindings is explained in [2] If you have a mouse with more than 5 buttons you can simply use '6' instead of 'button6' which isn't defined. ,((0, 6), (\w -> focus w >> windows W.swapMaster)) Skipping the Scratchpad workspace while using CycleWS The Actions.Plane and Actions.CycleWS extensions allow many ways to navigate workspaces, or shift windows to other workspaces. Plane is easier to set up, CycleWS allows nearly any behaviour you'd ever want. The Util.Scratchpad module provides a configurable floating terminal that is easily shifted to the current workspace or banished to its own "SP" workspace. Most people want the "SP" tag ignored during workspace navigation. Here's one way to do that with Actions.CycleWS, ready to be customized, for example to use HiddenEmptyWSs instead of HiddenNonEmptyWSs, etc. Note that notSP is defined in the where clause of this example. It is just another name for (return $ ("SP" /=) . W.tag) :: X (WindowSpace -> Bool) Likewise, for getSortByIndexNoSP, look in where clause. --. Do not show scratchpad workspace in status bar or dynamicLog You can also use fmap (.scratchpadFilterOutWorkspace) on a ppSort in your logHook. , logHook = dynamicLogWithPP defaultPP { ppSort = fmap (.scratchpadFilterOutWorkspace) $ ppSort defaultPP or import XMonad.Util.WorkspaceComp.
https://wiki.haskell.org/index.php?title=Xmonad/General_xmonad.hs_config_tips&diff=prev&oldid=26345&printable=yes
CC-MAIN-2022-05
refinedweb
443
57.27
How to use xlrd library to read excel file Python xlrd is a very useful library when you are dealing with some older version of the excel files (.xls). In this tutorial, I will share with you how to use this library to read data from .xls file. Let’s get started with xlrd You will need to install this library with below pip command: pip install xlrd and import the library to your source code: import xlrd import os To open your excel file, you will need to pass in the full path of your file into the open_workbook function.It returns the workbook object, and in the next line you will be able to access the sheet in the opened workbook. workbook = xlrd.open_workbook(r"c:\test.xls") There are multiple ways for doing it, you can access by sheet name, sheet index, or loop through all the sheets sheet = workbook.sheet_by_name("Sheet") #getting the first sheet sheet_1 = workbook.sheet_by_index(0) for sh in workbook.sheets(): print(sh.name) To get the number of rows and columns in the sheet, you can access the following attributes. By default, all the rows are padded out with empty cells to make them same size, but in case you want to ignore the empty columns at the end, you may consider ragged_rows parameter when you call the open_workbook function. row_count = sheet.nrows col_count = sheet.ncols # use sheet.row_len() to get the effective column length when you set ragged_rows = True With number of rows and columns, you will be able to access the data of each of the cells for cur_row in range(0, row_count): for cur_col in range(0, col_count): cell = sheet.cell(cur_row, cur_col) print(cell.value, cell.ctype) Instead of accessing the data cell by cell, you can also access it by row or by column, e.g. assume your first row is the column header, you can get all the headers into a list as below: header = sheet.row_values(0, start_colx=0, end_colx=None) # row_slice returns the cell object(both data type and value) in case you also need to check the data type #row_1 = sheet.row_slice(1, start_colx=0, end_colx=None) Get the whole column values into a list: col_a = sheet.col_values(0, start_rowx=0, end_rowx=None) # col_slice returns the cell object of the specified range col_a = sheet.col_slice(0, start_rowx=0, end_rowx=None) There is a quite common error when handling the xls files, please check this article for fixing the CompDocError. Conclusion xlrd is a clean and easy to use library for handling xls files, but unfortunately there is no active maintenance for this library as Excel already evolved to xlsx format. There are other libraries such as openpyxl which can handle xlsx files very well for both data and cell formatting. I would suggest you to use xlsx file format in your new project whenever possible, so that more active libraries are supported. If you would like to understand more about openpyxl , please read my next article about this library. As per always, welcome to any comments or questions. Thanks.
https://www.codeforests.com/2020/05/25/use-xlrd-library-to-read-excel-file/
CC-MAIN-2022-21
refinedweb
516
68.3
View Complete Post. When a request is submitted and the response is recieved and before the page loads with the response, is there a way to control the user to press any key board buttons? When a client clicks on a button, a request is generated and sent to the server. Server performs appropriate actions, and gives the response to the client, and the client load the response page. During this process, at the client end, is there a way to restrict the user from pressing any keys. Any events to de-activate user keys? Thanks in advance.=" When I call this method from my wcf serivce : public override Restaurant[] GetAll() { return (from c in GetContext().Restaurants orderby c.Name select c).ToArray(); } I get following inner exception : 2.<BeginOnUI>b__0)} When I use a web request to get response from a URL address which is based on SSL. ServicePointManager.CheckCertificateRevocationList = true; var webReq = (HttpWebRequest)WebRequest.Create(""); var webResp = (HttpWebResponse)webReq.GetResponse(); I will get one of the following exception information. Categories: Hall of Fame Twitter Terms of Service Privacy Policy Contact Us Archives Tell A Friend
http://www.dotnetspark.com/links/65974-understanding-request-and-response.aspx
CC-MAIN-2017-13
refinedweb
187
60.31
Yes. It definitely makes sense to me. Let’s get the 0.9.3 release out without breaking changes. If we decide to keep Carlos’ changes and/or modify them, there’s no reason it cannot go into 0.9.4. Advertising Thanks, Harbs > On May 17, 2018, at 11:30 AM, Piotr Zarzycki <piotrzarzyck...@gmail.com> > wrote: > > Carlos, > > Those changes were not properly discussed. Let's wait till the end of the > discussion and proper fix. I personally prefer wait even another month than > release something what can change significantly. > > Is that make sense to others ? > > Thanks, Piotr > > 2018-05-17 10:26 GMT+02:00 Carlos Rovira <carlosrov...@apache.org>: > >> Hi, >> >> just find the imports with problems, fix them and committed. If there's no >> others this should fix the release. >> >> If you see the commit, the changes are easy, and no more of some secs to do >> for our users, in case they use this core classes. >> >> Let's see what Jenkins reports in the following build >> >> >> 2018-05-17 10:16 GMT+02:00 Carlos Rovira <carlosrov...@apache.org>: >> >>> Hi Piotr, >>> >>> I think we are getting sufficient progress I the discussion thread to >>> still think about a revert. I'm most for change things from this point, >>> that should be the normal way from 0.9.2 to 1.0. We can as well hold a >> bit >>> the release until we have cleared all this. As I said, if we revert, and >>> release 0.9.3 with old code, blog examples will not work at all, and that >>> will suppose lots of people in the internet trying us and failing. >>> >>> Think that: >>> >>> 1) There's no breaking changes at all about functionality >>> 2) The change was only: >>> a) move things from Basic to Core >>> b) rename packages on some of that 2.a) things >>> >>> >>> So the real problem now for me is 2.b) and that's the reason why jsonly >>> build is failing, since we have things in framework with not examples >>> referencing it, and since SWCs does not validate CSS beads, when used >> that >>> CSS in final app that fails. I think that's for me a major problem, and >>> will prefer to focus in find that code and fixing it. >>> >>> I'm trying to focus this morning on doing this, and hope to fix on that >>> way jsonly >>> >>> >>> 2018-05-17 10:08 GMT+02:00 Piotr Zarzycki <piotrzarzyck...@gmail.com>: >>> >>>> It's not about the minor changes in his app in my opinion. In the result >>>> of >>>> the discussion it may end up that you will revert everything and >> solution >>>> will be completely different. What will be the experience of the created >>>> app on the user sight ? >>>> >>>> 2018-05-17 10:05 GMT+02:00 Carlos Rovira <carlosrov...@apache.org>: >>>> >>>>> Hi Harbs, >>>>> >>>>> that was returned to the old way, actually we have the same than >> before >>>>> refactor: >>>>> >>>>> import org.apache.royale.html.Group; >>>>> >>>>> public class NodeElementBase extends Group >>>>> >>>>> Maybe the problem is that we don't have any example of ButtonBar in >>>>> examples? and thus I was not aware of that concrete component? >>>>> >>>>> I'll try to see that and if we need, I'll create and example now for >>>> that. >>>>> >>>>> The change to solve this in your code base is really easy and direct: >>>>> >>>>> search all "import org.apache.royale.html.supportClasses.DataGroup;" >>>> and >>>>> replace with "import org.apache.royale.core.DataGroup;" >>>>> >>>>> (for me is clear that DataGroup is a Core piece, that will be used not >>>> as >>>>> Basic or Jewel implementation, but as a "core" piece used for the rest >>>> of >>>>> UI sets) >>>>> >>>>> I'll be looking at it right now >>>>> >>>>> Thanks for exposing it! :) >>>>> >>>>> Carlos >>>>> >>>>> >>>>> >>>>> 2018-05-17 8:49 GMT+02:00 Harbs <harbs.li...@gmail.com>: >>>>> >>>>>> Having trouble getting this email to “take”. Trying a paste link >>>>> instead... >>>>>> >>>>>> It looks like it does have issues. >>>>>> >>>>>> I just pulled the 0.9.3 branch. >>>>>> >>>>>> I get a lot of these warnings when I compile the framework: >>>>>> <> >>>>>> >>>>>> I used it to compile my app, and I get runtime errors due to missing >>>>>> components. This seems to be due to HTML not subclassing Group. >>>>>> >>>>>> Here’s an example of elements which go AWAL: >>>>>> <> >>>>>> >>>>>> Everything below “ul" is missing. >>>>>> >>>>>> Harbs >>>>>> >>>>>>> On May 16, 2018, at 10:45 PM, Alex Harui <aha...@adobe.com.INVALID >>>>>> <mailto:aha...@adobe.com.INVALID>> wrote: >>>>>>> >>>>>>> I'm pretty sure the branches were cut before the changes in >>>> question. >>>>>> You can pull down the branches and build them to verify. Or look at >>>>> their >>>>>> history on GitHub. >>>>>>> >>>>>>> Om, did you see a date for when Maven SCM would be released? The >>>> only >>>>>> response I got from the Maven folks was to build Maven SCM from >>>> sources. >>>>>> If it is going to be more than a week, I might actually try that. >>>>>>> >>>>>>> -Alex >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Carlos Rovira >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> >>>> Piotr Zarzycki >>>> >>>> Patreon: * >>>> <>* >>>> >>> >>> >>> >>> -- >>> Carlos Rovira >>> >>> >>> >> >> >> -- >> Carlos Rovira >> >> > > > > -- > > Piotr Zarzycki > > Patreon: * > <>*
https://www.mail-archive.com/dev@royale.apache.org/msg04607.html
CC-MAIN-2018-22
refinedweb
817
74.19
Bill Huey <billh@mag.ucsd.edu> writes:> > you havent tried this, have you? The new 2.2 kernel includes a rather fast> > file namespace cache implementation, it takes ~5 microseconds to look up a> > file. Too slow?> > Things like .so file in /usr/lib, icons in /usr/something/ will be automatically> skipped since this stuff is contained within the application or OS resource fork,> so the search space for a particular file under HFS is much smaller in MacOS> than with Win32/Unix since everything is treated as a file within those OSes. > > That's why a rather broken MacOS can search for a file name much faster than> Win32/Unix, because there aren't that many files to search in the first place.> > All the libs/icons/sound file are not file within the FS. Which is great on a _single user_ system like a Mac. But shouldn't bedone on a multi user system, as all of the above are just defaultswhich can be overridden by multiple users at the same time.-- James Antill -- james@and.org-To unsubscribe from this list: send the line "unsubscribe linux-kernel" inthe body of a message to majordomo@vger.rutgers.eduPlease read the FAQ at
http://lkml.org/lkml/1999/6/23/109
CC-MAIN-2017-26
refinedweb
204
72.87
Using a Hybrid Connection with your Web App allows you to easily connect to on-premise resources. We recently improved the experience with Hybrid Connections by moving from BizTalk Services to Azure Relay. In this post, I'll address some of the things you should be aware of so that you can avoid problems. In this post: Don't Use an IP Address for Your Endpoint, and Be Careful with Fully-Qualified Names Azure Relay Hybrid Connections Don't Work in Windows Server 2008 R2 Hybrid Connection User Logging Doesn't Work with Azure Relay Hybrid Connections Make Sure that the Date and Time are Correct If Whitelisting, Ensure You Whitelist the Service Bus Gateways When Using SQL Express, Don't Use Names Instances and Enable TCP/IP When Using SQL Server, Configure it for a Static Port Use the Correct Connection String If your status is "Connected" but the connection isn't working, check connectivity to Service Bus Update your Hybrid Connection Manager Classic Hybrid Connections are End of Life on May 31, 2018 Don't Use an IP Address for Your Endpoint, and Be Careful with Fully-Qualified Names When you configure your Hybrid Connection, it's a bad idea to use an IP address for the endpoint because it can prevent the Hybrid Connection from working. When your Web App connects to a resource whose DNS name maps to a Hybrid Connection endpoint, it will send that traffic through the Hybrid Connection. However, if you use an IP address, the Web App won't be able to detect that this is a connection that should go through the Hybrid Connection. The result is that your Hybrid Connection simply doesn't work. Instead of using an IP address for your endpoint, you should typically use the hostname of the server hosting the resource you are trying to connect to. That means that it's often a bad idea to use a fully-qualified name as well. See this post for more information. Azure Relay Hybrid Connections Don't Work in Windows Server 2008 R2 There are currently two "flavors" of Hybrid Connections; Hybrid Connections that use Azure Relay (the new Hybrid Connections) and Classic Hybrid Connections that use BizTalk Services. (Classic Hybrid Connections are being deprecated, but if you have any existing ones, you can still use them.) You can install the Hybrid Connection Manager on Windows Server 2008 R2 for use with a Classic Hybrid Connection, but you can't use new Hybrid Connections on Windows Server 2008 R2. That's because Azure Relay Hybrid Connections use Web Sockets, and Web Sockets are only supported in Windows 8/Windows Server 2012 and later. If you run the Hybrid Connection Manager (version 0.7.3 and later) on a machine running Windows Server 2008 R2, you'll see a warning telling you that only Classic Hybrid Connections will work. Pay attention to that warning! You can still add an Azure Relay Hybrid Connection, and it will still show "Connected" in the Hybrid Connection Manager, but it won't work because Windows Server 2008 R2 does not support Web Sockets. Hybrid Connection User Logging Doesn't Work with Azure Relay Hybrid Connections When you have problems with your Hybrid Connection, there are a few options available for logging. On the machine running the Hybrid Connection Manager, you can use System.Net tracing or you can view the Service Bus entries in Event Viewer. See this post for more information. You can also enable Hybrid Connection User Logging in your Web App by setting an App Setting of HYBRIDCONNECTIVITY_LOGGING_ENABLED with a value of 1. This will add a Hybrid Connection log into your LogFiles folder. However, it's important to note that, as of now, User Logging doesn't work with the new Azure Relay Hybrid Connections because of the new architecture involving Service Bus. We're investigating the possibility of enabling this, but we have no ETA and it may not be possible. Make Sure that the Date and Time are Correct The Hybrid Connection Manager connects to Azure Relay using Secure Sockets Layer (SSL) on port 443. If there's a problem with your SSL handshake or connection, it will break your Hybrid Connection. If you find that your Hybrid Connection works initially, and then it stops working after about 10 minutes, that's a sign that you need to check the date and time on the machine running the Hybrid Connection Manager. Make sure they are correct because if they're not, your SSL connection may not work. If Whitelisting, Ensure You Whitelist the Service Bus Gateways Some network environments require that outbound communicates are whitelisted. If you're in one of those environments, you need to whitelist both the Service Bus endpoint URL and the Service Bus gateways that service your Hybrid Connection. You can find the Service Bus endpoint URL by clicking on your Hybrid Connection in the Hybrid Connection Manager. In the Details dialog, you'll see the Service Bus endpoint URL as shown in the figure below. The Service Bus Endpoint URL You also need to whitelist the Service Bus gateways. (These are the resources that actually accept the request into the Hybrid Connection and pass it through the Azure Relay system. Here's some architectural info.) The address of the Service Bus gateway is in the following format. G#-prod-[stamp]-sb.servicebus.windows.net "#" is a number between 0 and 127. Service Bus gateways are load balanced as load increases, so more are added dynamically up to a total of 128. (Going up to 128 gateways is extremely rare, but to be safe, you want to ensure you whitelist all of them.) "[stamp]" is the name of the instance within your Azure data center where your Service Bus endpoint exists. You can find out the stamp using nslookup on the Service Bus endpoint. In the figure below, you can see the output of nslookup for the Service Bus endpoint shown in the figure above. Service Bus Stamp In this case, my stamp is sn3-010. Therefore, to whitelist my Service Bus namespaces, I would want to whitelist URLs like this: G0-prod-sn3-010-sb.servicebus.windows.net G1-prod-sn3-010-sb.servicebus.windows.net G2-prod-sn3-010-sb.servicebus.windows.net G3-prod-sn3-010-sb.servicebus.windows.net . . . G126-prod-sn3-010-sb.servicebus.windows.net G127-prod-sn3-010-sb.servicebus.windows.net If you're lucky, you can whitelist using a wildcard, but if not, whitelist them all. When Using SQL Express, Don't Use Named Instances and Enable TCP/IP If you're using your Hybrid Connection to connect to SQL Server Express Edition, make sure that you use the Default instance and not a named instance. (More information here.) You also want to ensure that you've enabled TCP/IP so that SQL Server Express can accept remote connections. Find out more about that here. When Using SQL Server, Configure it for a Static Port If you're using your Hybrid Connection to connect to SQL Server, make sure that you configure SQL Server to listen on a static port. Find out more about that here. Use the Correct Connection String Make sure that your connection string is using the correct server name. Just as when you created your Hybrid Connection endpoint, when you are configuring the connection string in your app, you typically want to use just the hostname of the machine running the resource your connecting to. In other words, use the same connection string that you would use in your Web App if it were being hosted on-premise. In fact, that's one of the great things about Hybrid Connections; you don't have to change your connection string when you move from development on-premise to staging and production in the cloud. If your status is "Connected" but the connection isn't working, check connectivity to Service Bus Assuming you aren't using a Classic Hybrid Connection, if your status shows "Connected" but your Hybrid Connection isn't working, it might be because you don't have connectivity to Service Bus from the machine where the Hybrid Connection Manager is running. This could be because of problems in your network, or it could be because of a transient problem in Azure. To check Service Bus connectivity, you can use Telnet or PowerShell. To test using Telnet, open a command prompt on the machine where the Hybrid Connection Manager is running (you'll need to do this as an administrator) and run the following command, replacing ServiceBusNamespace with your Service Bus namespace's name. telnet ServiceBusNamespace.servicebus.windows.net 443 To test using PowerShell, open PowerShell as an administrator and run the following command, replacing ServiceBusNamespace with your Service Bus namespace's name. Test-NetConnection -computer ServiceBusNamespace.servicebus.windows.net -Port 443 If this test fails, it's possible that your network is blocking the outbound traffic. Check with your network administrator. It's also possible that there is an issue in Azure. You can check the Azure Status Page for any current issues. Update your Hybrid Connection Manager If you are running a version of the Hybrid Connection Manager earlier than Version 0.7.5, you should update. As of Version 0.7.5, we have added a feature that will notify you if there is an update. Prior to Version 0.7.5, there was no update notification. Keeping the Hybrid Connection Manager updated is important in order to avoid any problems. You can click the "Download Hybrid Connection Manager" link in the Azure portal to update. You can also browse to to download the latest version. Classic Hybrid Connections are End of Life on May 31, 2018 If any of your existing Hybrid Connections are Classic Hybrid Connections (the ones that were based on BizTalk), you'll want to make plans to update them to Azure Relay Hybrid Connections as soon as possible. As of May 31, 2018, Classic Hybrid Connections will no longer be supported. You can read about this change and how you can migrate your BizTalk Hybrid Connections to Azure Relay in Christina Compy's blog post.
https://blogs.msdn.microsoft.com/waws/2017/06/30/things-you-should-know-web-apps-and-hybrid-connections/
CC-MAIN-2019-18
refinedweb
1,704
59.53
It worked! Thanks a lot! I recall trying raw_input before but it threw an error that time. It worked now though It worked! Thanks a lot! I recall trying raw_input before but it threw an error that time. It worked now though Python has two major versions: python2 and python3. Python3 is the newer and should be used, but is not backward compatible with python2. raw_input vs input is a good example of this. python2 is also near its End of Life (EOL). What am I doing wrong with line 5? I tried moving around the “return” The example is just that, an example. Your program should have a very different structure. return can only be used in the body of a function. S is not defined, yet i’m missing how the variables were defined in the examples. What should I be looking at? Currently you have an identity function… def shut_down(s): return s Then you have some code that includes the variable s which was defined not in global scope, but in the function. It will surely raise an error. How do we get that code into the function, before the return statement, and also ensure the return value is correct for our purposes? Hi there, Just playing around with this exercise: I’ve got two codes here - one works but the other doesn’t…It would be great to get some help understanding this! Thank you! The code (indents don’t seem to show up): def shut_down(s): if s == “yes” or “Yes” or “Y” or “y”: print “Shutting down” elif s == “no” or “No” or “n” or “N”: print “Shutdown aborted” else: print “Sorry” shut_down(“no”) This prints “Shutting down”, but the argument I inputted was “no”. Why is this!? This alternative version of the code works perfectly: def shut_down(s): s = s.lower() if s == (“yes”): print “Shutting down” elif s == “no”: print “Shutdown aborted” else: print “Sorry” shut_down(“No”) I should add that, with the first example, if I replace every or with and then the code does work. But this makes no sense to me either! In an earlier lesson, and and or were defined as: " * and , which checks if both the statements are True ; or, which checks if at least one of the statements is True;" So based on this above definition, or seems like the more logical choice than and surely?.. Thank you for your help! Kind regards, Alex Ah i half just figured it out!!: def shut_down(s): if s == “yes” or s == “Yes” or s == “Y” or s == “y”: print “Shutting down” elif s == “no” or s == “No” or s == “N” or s == “n”: print “Shutdown aborted” else: print “Sorry” This now works perfectly. def shut_down(s): if s == “yes” and s == “Yes” and s == “Y” and s == “y”: print “Shutting down” elif s == “no” and s == “No” and s == “N” and s == “n”: print “Shutdown aborted” else: print “Sorry” This just prints “Sorry” whatever you write. So that explains I was correct to want to use or, rather than and, I just hadn’t written the correctly! But I still don’t understand why and works when I wrote it incorrectly!? Using and means all of the conditions have to be true. Which can’t be. How can one string equal multiple different strings?
https://discuss.codecademy.com/t/faq-functions-review-functions/372161?page=2
CC-MAIN-2020-29
refinedweb
557
80.72
Why is Java Considered Un-Cool? 1782 jg21 writes "After the Slashdot discussion on Paul Graham's 'Great Hackers' essay, it had to happen. Java developers have taken umbrage at Graham's assertion that "Of all the great programmers I can think of, I know of only one who would voluntarily program in Java. And of all the great programmers I can think of who don't work for Sun, on Java, I know of zero." Now in JDJ Sachin Hejip pinpoints the Top Reasons Why Java is Considered Un-Cool and to tries to debunk them. He levels some of the blame at the Java compiler for "too much chaperoning" and speculates that Java fails the geek test precisely because "it's such a language-for-the-masses." But isn't he missing the point? Enterprise-grade apps and "coolness" may be inapproriate bedfellows. Besides, does any language offer both?" What is this responding to.. exactly? (Score:4, Interesting) He almost entirely fails to discuss any of the attributes that Graham assigns to languages that 'Great Hackers' like to use. In particular, Graham claims that terser languages are more powerful [paulgraham.com], because studies have shown that coders churn out a pretty constant number of lines per day, regardless of the programming language. Java is anything but terse. I could go on, particularly since the Sun JVM isn't open source, and Graham makes a point of claiming that Great Hackers prefer to use open source tools. I think frantic defensive articles regarding Java aren't helping anyone. The managers that choose Java don't read Paul Graham articles, and I doubt Paul Graham much cares what a Java-oriented business journal has to say about his articles. Please note that I am just relating the opinions that Graham has put on his website. I do not necessarily share his views. Re:What is this responding to.. exactly? (Score:5, Funny) Hell, could you ever imagine an orginization like Apache producing Java code. If that ever happens I'm giving up and moving to Jakarta [apache.org]. Re:What is this responding to.. exactly? (Score:5, Insightful) Re:What is this responding to.. exactly? (Score:5, Insightful) Hey, waitaminute, who let the *managers* choose? "Fred, here's a saw. Go pound some nails in." Depends ... (Score:5, Interesting) In my experience (which isn't huge with Java, but I've used it for commercial work), one of the things I liked most about Java was that it actually tended to save me lines of code. Oh, sure it's got an explicit full-on syntax, but I'm comfortable with that. What I was most impressed with was there was a vast amount of standard data types and APIs available to accomplish a very huge amount of stuff. Looking at C++ and the like, the APIs are anything but cross-platform. (Any helpful links to a good C++ API (not GUI toolkits) which is both POSIX and Windows might make me use that some more.) For the type of code I was writing at the time (oddly enough, server side stuff behind a web front-end, no GUI) I found I could always find a standard routine to do what in the past I've had to implement from scratch. I also specifically loved the good type checking and the like. I want that from my languages. I'm actually planning on using it for some projects I want to work on for myself. Would I say it's the perfect language? Nope. Would I claim it has all of the shiniest language features? Nope. Do I, as an old-school C-coder, think it's a straight-forward API rich language that I can get stuff done in? Damned straight! Since I don't grok functional-programming and I despise languages with really wierd syntax and the like, for me, Java is like the Toyota Camry of languages. For the way I use it, it's fine. Re:Depends ... (Score:5, Informative) I used ACE for a previous multithreaded server and the project was very successful. We developed on Linux and FreeBSD but had no difficulty porting to Solaris, and could have ported to Windows with a couple of days of effort (we had use the occasional POSIX-specific idiom, but this was our own fault, not the toolkit). The author, Douglas Schmidt, is a well-known standards wonk and performance freak -- an interesting combination that results in a kit that provides full cross-platform support while running hard with C++'s approach of "you don't pay for it if you don't use it." The kit included a full CORBA ORB [wustl.edu] that supported realtime operation (ie, bounded maximum delay). Probably the best compliment I ever heard about ACE was a from a very senior coworker who commented that ACE was "not bad, for C++." Trust me -- from him, that was high, high praise. Having said all that, when I have to share the tree with other developers, Java is my favorite mainstream language. Re:What is this responding to.. exactly? (Score:5, Insightful) This is true, but that is not the whole picture. One of the things that was obvious right away is that minimizing the number of things the programmer can do wrong causes a significant jump in the effective productivity of the programmer. Brooks talks about this in the Mythical Man Month as it related to assembly versus high level languages, but we do see the same effect when moving between a language like C and something like Smalltalk or Java. It has been my experience that a good programmer writes more and higher quality code in Java versus C or C++, largely due to three factors: 1. Mandatory exception handling forces error handling down into the code where it can best be dealt with. In other words, you have to work harder to not handle abnormal situations. 2. Garbage collection eliminates whole classes of memory mismanagement problems. 3. Standard libraries contain many useful classes that had to be written independently in C/C++ (leading to a variety of different container classes, for instance, of widely varying usability and quality). All three of these affect both time to deliver and quality of delivered code. We're not talking about minimal changes in productivity, either. I've been watching and working with Java and C++ since ... well, pretty much since they made it out of the laboratory. The improvement in real world productivity seen with Java is a factor of two to four greater on average versus C/C++ (measured by "how long does it take to get this feature to work", which is not necessarily the same as "how much code did I have to write"). Often lower for GUI work (depending on which GUI toolkit/tools you're using) but much higher for network code. Moreover, bug counts in released code are dramatically lower, like one tenth as many, and they tend to be less serious (a feature may fail, but seldom does the entire application fail). In any case I guess I would have to vehemently disagree with Graham's contention that great hackers don't use Java. I suspect that is more a matter of which circles you run in, as that certainly doesn't hold true in my experience. There are fewer using it today than three or four years ago, but I surmise that that is mostly a matter of language maturity; the best programmers tend to sit on the bleeding edge, and that's not Java anymore. Your mileage may vary, contents may have settled during shipping, etc. Re:Also Speed (Score:4, Insightful) Java is optimized Re:Also Speed (Score:5, Funny) "They who would trade essential CPU cycles to gain a little temporary security deserve neither CPU cycles nor security." -- B3nj4m1n Fr4nx0rlin Hmmm, it seemed considerably funnier in my head... -Stephen Re:Also Speed (Score:4, Insightful) The VAST majority of software being written is high-level business applications; hence there are at least an order of magnitude more JOBS available for application programmers than systems programmers. For virtually all business apps, programmer productivity, code maintainability, and predictable scalability are FAR more important than raw execution speed. This is where Java puts C++ to shame. Re:What is this responding to.. exactly? (Score:5, Insightful) This is an interesting example, because I think in the real navy, there's a straightforward answer: Sometimes your preparation fails. In the example you gave, there are *two* points of failure. The first is that you can't find the directory you pointed at, and the second is that you can't get a listing of it. Making those things be separate forces you to consider the failure cases. A large part of what Java is about is failsafe enterprise-level applications. When you write to that level of safety, you need to identify the different causes of issues. In the same way, your day-sailer on a 12' boat doesn't shout to his crewmate "Prepare to tack!" because there isn't any reason to. If you're sailing an 80' schooner, however, you do shout to your crew of six "prepare to tack!" And then you wait in case someone shouts back, "Port side winch is jammed!". -Zipwow Why is Java Considered Un-Cool? (Score:4, Funny) Re:Why is Java Considered Un-Cool? (Score:5, Insightful) Hey, I *like* java, but this kind of crap is definitely shooting yourself in the foot [noncorporeal.com] material. Re:Why is Java Considered Un-Cool? (Score:5, Insightful) I understand that truly cross-platform programs are a difficult problem. But that doesn't change the fact that Java is pretty bad at it. And don't even get me started on the fact it has multiple GUI API's. Re:Why is Java Considered Un-Cool? (Score:5, Insightful) Re:Why is Java Considered Un-Cool? (Score:4, Informative) 2) No pointers. Real programmers know how to use memory properly. That is all. Real programmers also know how pointer aliasing can absolutely kill optimization. They therefore avoid pointers wherever possible, resorting instead to constructs such as Fortran 90/95/03's ALLOCATABLE(:) arrays. How about (Score:5, Insightful) These, "my programming language is better than the rest and here is a list why" arguments are BS. Every situation is different, every problem requires different tools/methodologies to solve. You wouldn't go into the carpentry business and claim your hammer is the best hammer for every single job would you? You would be laughed at and possibly hit in the head with said hammer. Same goes with programming languages. Re:How about (Score:5, Insightful) There are cases where you want to choose the best tool for the job because some options are just terrible. There are also cases where you should stick with what you know. If I'm banging out a quick workflow integration app that needs a GUI on a Mac, AppleScript may be the 'best' language for the job, but it's also true that I don't work with AppleScript much and my level of expertise in it is low enough that I would probably get the job done faster and better if I did it in Objective-C despite its not being the best language for the task. This "best tool for the job" analogy shouldn't be taken too far. Comparing hammers to programming languages is like comparing hammers to engineering contractors. Its just a tool (Score:5, Informative) Java is a tool - just like every other programming language. People do/don't use Java for many reasons - the choice of a programming language in a commercial environment depends on many different factors. I work in Java - I can't say it excites me but it does the job. Wait (Score:5, Insightful) This is news? COBOL (Score:5, Insightful) Re:COBOL (Score:5, Funny) Well, considering what COBOL programmers are earning these days, Java might be a valuable skill in the future. Re:COBOL (Score:4, Interesting) Which is why you have "sentences" and "paragraphs" and why COBOL is so damned wordy. It is supposed to read like English. And if you go to some trouble with the naming of your variables you can almost make it like that. Perl is the opposite of COBOL. Succinct to the point of incomprehensibility. cheapest that still gets the job done... (Score:4, Interesting) Yet you have to look at the initial assumption of Ada as a programming language *for embedded systems.* For the Ada target market, they had studies indicating that 90% of the programming "cost" was spent in maintenance. From this perspective, initial coding is a nit. Even debug was rated as more expensive than initial coding. So you have to look at the meaning of the word, "cheapest." (If they mean cheapest tools, regardless of suitability to the job, I have to agree with your attitude, though.) Re:COBOL (Score:4, Insightful) We need to require new academic standards for programmers. First, CS majors need to have at least one class where they are required to debug, maintain, update, and add new features to someone else's uncommented 10000 line perl program. The second part of the course would be writing a new program. Students have the choice of commenting or not. If the student turns in a well organized and commented program, they will be given a well organized an commented program to debug and modify on the final. If they turn in an uncommented and/or poorly organized program, they will be given such a program (but not their own) to debug and modify on the final. (Yes, I do maintain code for a living, why do you ask ?) That said, why don't you like Java ? It has the obtuseness of C, the verbosity of COBOL, and even more compiler restrictions than Pascal. What else could you ask for ? Dean G. Too verbose (Score:4, Insightful) Using the language you just "feel" as if there should be an easier way. I'm no fan of microsofts products but I think C# is an excellent language to program in. It addresses alot of Java's shortcomings and it is a joy to program in. Not responding (Score:4, Funny) What's not to love about Java? (Score:5, Funny) The freedom from corporate interference of Visual Basic. The speed of an interpreted language. And you wouldn't believe how efficiently it uses RAM and CPU power. I don't see why everyone doesn't use Java! Who cares? (Score:5, Insightful) From my employer's point of view, it makes me more productive than (most) other languages would, since I spend less time worrying about crap like header files, pointers, memory leaks, and so on. So everyone wins. "Cool" stopped being important when I turned 18. Paul Graham isn't Cool, Duh. (Score:4, Interesting) When I read Graham's article, I was disappointed. It had that air of someone being passed by, by a lot of fun. Saying Java isn't cool is like saying Scheme or ML isn't cool. It's just a personal preference, and when you express it, you run the risk of sounding anal and/or ignorant. His older articles were better considered. Here's my utterly ignorant statement of the day: No matter how many ultra-cool hackers I know tell me that Lisp and Scheme and ML are cool, I never have fun using them. They force my brain into such an unpleasant state of nerdliness that the only thing I can program in them is a mathematical proof or some sort of logical system.. in short, I'm forced to become a boring CS professor using them. Don't bother debunking reasons why Java isn't cool. The only path to cool is the acceptance of luserdom. Only when you have nothing to lose will you dare to do something audacious. Look at punks. The only time they're cool is when most of society considers them fringe lunatics with no social graces. And then the rock happens again. It's when they're "cool" that the music invevitably begins to suck. Being called uncool is a blessing in disguise. Thanks Paul. Re: Cheap Shot (Score:5, Funny) It's an indictment of Aristotle, Kant, the Enlightenment and the Scientific Method that all of our attempts at formalizing the universe blow up in our faces. Until we approach every program as the algebraic systematic proof of a string-theoretic electrical circuit model, we will be burdened by the inexorable piles of poo that is the vast majority of the software written today. Re:Paul Graham isn't Cool, Duh. (Score:4, Insightful) You could take the approach that every piece of software you write has to have that level of detail and accuracy, proof-like precision if you will. I think you'd find that your productivity would be far lower in terms of logical constructs completed per unit time. This is probably an acceptable trade-off if you write control systems for nuclear power plants or if you work for NASA where budget and time-frame are vastly greater than for your average business programming problem. But for most applications, there is not only a set of requirements, things it needs to do, but a very short period of time to make it do them in. And if you go to the boss and tell him it's going to take 14 months and cost 1.3 million dollars because everything has to be written as a logical proof, he's just going to fire your ass and get a team of third-world guys to puke it out in Java in 3 months. I'd love to be proven wrong here - if you can show me a study that indicates that use of ML or some other language type results in substantially more bug-free code _without_ sacrificing development speed, then by all means, I'll admit that I'm wrong. My own personal experience is limited to small apps I've written in OCaml, which were cool and everything, but OCaml isn't purely functional, and I found several aspects of its use quite painful, despite feeling very "elite" as I hacked away in a semi-functional language. Most particularly, the idea of not specifying an explicit contract between chunks of a system with the types of information passed between them really irks me - to me this makes a development language unusable by more than one person, or even by one person in a sizeable programming project. I constantly refer back to other chunks of my code to see what type of data I need to feed to some function or method - and when using somebody else's code I'm far more likely to be interested in the interface than the implementation. Without that kind of separation, I don't see how this stuff is usable (I can't "keep the whole proof" in my mind at one time when I'm doing mathematics either, that's why you have lemmas and theorems and other mini-proofs that you call out to). Maybe somebody can point me to a more usable version of a functional language that doesn't "feature" static typing, or that was designed with real programming tasks in mind and thus would be worthy of more study re: the development speed and team usability characteristics I mentioned above? Re:Paul Graham isn't Cool, Duh. (Score:5, Insightful) Languages like Java or Basic are not cool for me personally because they did not teach me anything. These languages are primarily designed to protect the computer from the programmer. I think the proliferation of buggy programs is due to languages like Java or Basic that make it easy for a person without the proper training to program. Engineers need to go through very rigerous tests to certify their expertise before they are allow to design and build a bridge. Why should programming be different? Java pays!!! (Score:5, Interesting) Why is Java UnCool? (Score:5, Insightful) But Java....Java was designed to be easily learned, and to especially be used in web-based apps. To Unix geeks, that makes it kind of the Visual Basic for the Slashdot crowd. Not something to brag on. Fact is, it's a great language, and it's still growing. A friend of mine is a professional Java developer (mostly server side stuff), and he's one of the brighter bulbs in the lamp. He loves it, and still thinks Java's potential is largely untapped. Whereas we know what C can and can't do, Java is still growing. He thinks it'll be used (and used effectively) for things we can't even imagine yet. Re:Why is Java UnCool? (Score:5, Insightful) That's not it at all. First off, I'd say Lisp (not C) is the geek Gold Standard--most of your top-name geeks, from Mccarthy on through RMS to Jamie Zawinski and ESR have been LISP hackers, with the notable exception of kernel/systems guys. Even GIMP was written by LISP fans. But C is definitely in the running, primarily because it fits a (rather large) niche very well--it's the closest thing to a portable assembly out there when you need to get down to the nuts and bolts and still be kind of portable. [Note that I am not supporting any of the following arguments, merely enumerating what I think some of the objections to Java are.] What Java doesn't do, from a geek standpoint, is fill a niche very well. A true hacker wants a language that is committed; if you're going to be strongly typed, be VERY strongly typed and have a decent type inference mechanism a la Haskell or ML. If you're going to be dynamically typed, by really dynamic like Scheme and Lisp. If you're going to be OO, support it fully like Scheme, Python, and Objective C (and geeks tend to support the Scheme-world definition of OO). And if you're going to be functional, do _that_ full-out like Lisp and ML. Note that these are all language features. Most geeks want to support a language based on the language itself, not on the libraries or the implementation ("those can be fixed" is the somewhat insightful and somewhat naive argument). As a language, Java isn't anything new and doesn't fit any of those areas as well as other languages. I think it's almost secondary that Java is a B&D language; it's the failure to be pure about how it implements various programming paradigms and type structures that gives it the geek *yawn*. C++ suffers from the same thing. Enterprise grade and Cool (Score:5, Interesting) Perl. No, seriously - properly written perl is both "enterprise grade" and as cool as hell. Of all the languages I've ever worked in, nothing let me build systems as easily, as robustly, and as QUICKLY as perl did. Remember the Daimler - Chrysler merger? Perl was the glue that unified the HR systems and LDAP directories. As far as I know, it still does. Our LDAP - LDAP replicator tool (written in Perl) was a damn sight more reliable than the native replicators, plus it would do schema translation, plus it had a smaller footprint. Somehwere along the way, perl seems to have picked up a bad reputation for being illegible and obscure - and certainly one has the freedom to write the cliched "line noise" programs if one wishes. But perl done right can not only be legible, it can be beautiful. DG Oh come on (Score:5, Insightful) Java is seen as uncool precisely because it protects you from your own mistakes -- it's an attempt to make programming approachable to the masses, and the fact that it's forgiving makes it look like programming with training wheels. And just like the 50 year old MBA will never fit in with the Harley crowd, Java programming will never be seen as cool as "real" hackers' languages like C. If *Java* is uncool.... (Score:5, Funny) Totally mis-informed (Score:4, Informative) The number of mis-informed posts on this subject is staggaring. An attempt to debunk some of them: Java is slow - This is a myth. A long-running Java app running under HotSpot will over time grow to be faster than nearly any simmilar C or C++ app. Why? Because the Vm can over time learn how the codepath actually is executing and optimize it at the assembly level. The only way you could consistantly achive performance as good would be to hand-code the whole app in assembly, and thati s assuming you already know in advance exactly how the program will be used so you know what paths to optimize. This is highly unlikely. Java UIs are slow - Java UIs are only as slow as your toolkit. Yes, Swing blows ass. But there are Java bindings for Gtk, Qt, and wxWindows, all of which are pretty cross-platform. And there is also the SWT toolkit from IBM which uses native widgets when possible, and when not falls back on its own widgets. Java needs a VM so you can't run it everywhere - THis has to be the dumbest one of all. Since when can you write any resonably complex C or C++ application for multiple platforms without some effort? Any C/C++ app targetting anything more than basic POSIX will be littered with #ifdefs everywhere. With Java at least you can complile it just once, then ship multiple VMs , rather than having to adust your code and re-compile for every target platform. Debunking Pro-Java Myths (Score:4, Informative) Here are his usenet posts [google.com] on the subject. Re:Debunking Pro-Java Myths (Score:5, Insightful) Some of his posts are grossly incorrect. Examples: But the semantics for many programs would not be correct, since Java requires array bounds checking. Disabling it means that you're not compiling Java. True, if youe xceed the bounds of an array in a Java app you will get an array out of bounds exception - but that is the worst that can happen, a nasty error message. However, this is a totally different can of worms in C/C++. If you don't check the bounds of every single array, you could be exposing buffer overlows in your application, which is a huge security hole. +1 for Java. You've posted three examples of code that you claimed was as fast or faster in Java than in C++, and every one of them, when compiled properly, turned out to be faster in C++ than in Java. Faster when run how many iterations under hotspot? 1? 10? 100? In Java you have to write nine copies of the basic sort function: one for arrays of chars, one for arrays of doubles, one for arrays of Objects, etc. For one, most people use the Collection or List interfaces for utility classes so that you can pass in any type of object, be it an ArrayList or a linked list, so in the Real World(tm) this is rarely an issue. Additionally, Java 1.5 has templates so it is a moot point. I could go on and debunk more of his debunking, but I can tell from his posts that ihe is quite biased and is not being resonable. Just for reference, I am *not* a Java developer. I write a lot of C++ code and a lot of java code, both are ideal for certain situations. For example, desktop apps with need for a fast startup time will always be best written in C++ until Java Vms are built into the OS. But for long-running business applications, where startup time is not a huge requirement and ease of development, debugging, and security are a higher priority, Java wins hands down. Re:Totally mis-informed (Score:4, Insightful) But I am a JAVA developer using Borland JBuilder X (one of the leading JAVA IDEs, implemented in JAVA) on a 3Ghz machine. The UI is the slowest, most unresponsive thing on my system. If the maker of one of the leading JAVA IDEs can't package their system (w JDK of their choice, toolkit of their choice, etc) so that its responsive on a modern machine using XP Pro, then I think it's fair to say that JAVA is slow for GUIs. (Yes, XP pro sucks, but every other app on my machine, most of which are written in C/C++, work fine.) Try eclipse - even using SWT, my experience is that its about as unresponsive, compared to Microsoft's C++-coded IDE, and even compared to Emacs, which is largely written in bytecoded LISP (and not even a very fast LISP) and has been known as a hog for decades. Also, while hotspot VMs in principle can grow to faster cpu performance than native compilation, the major cause of JAVA's slowness is space cost, not time, plus startup time (of the JVM, classloader, etc). I've never heard of any JVM which is reasonable in space terms. Most need a 10M resident set for hello world, and go up very fast with increasing complexity of app. Starting BEA (_the_ leading JAVA app server) on my system takes 30 seconds. This is absurd. (And it's not even precompiling the JSPs needed, because as soon as I hit a page, it chokes again for multiple seconds.) Plus, htere are things that native compilers are better at than hotspots, as they can make lower-level decisions than a bytecode compiler while they can still see the source tree. I don't think either type of compiler is clearly better than the other, but I don't think its fair to say that JIT is always faster. Try using a few JAVA apps, then using a few C++ apps, and see which one works better. That said, JAVA has a huge security advantage over C/C++. Even experts screw up sometimes using those languages (look at the occasional security hole in carefully coded bits of core unices). _Any_ garbage collected, bounds-checked language has much of what JAVA has (excluding secure classloaders, sandbox, bytecode verification) for security, in fact. Some, such as OCaml and Common LISP, can potentially be far faster than JAVA, especially at compute-intensive tasks. If speed is no object, use Python or Perl (and I know, sometimes they're just as fast). Tool choice depends on the task. And sometimes the task is "interface to these twelve hoary enterprise systems using the same language the standards committee decided the other twelve hundred programmers will use." Don't laugh. I think the analogy from JAVA to COBOL has some truth to it...and just think how much better of a COBOL JAVA is, in most ways. But that doesn't mean that Paul Graham should like JAVA. He made his career by seeking out the kind of problem that is NOT subject to the above constraints, but very different ones. (Did anyone actually _read_ his article? Or his other 30?) Why am I still hearing this? (Score:5, Insightful) Java is slow - This is a myth. I honestly don't understand why people are still repeating this. It _is_ slower than either native C++ or Java bytecode is not easy to optimize, having been originally intended for interpretation (my, how silly that seems now!). This is usually a minor issue compared to memory. I also suspect that, using the standard Java libs, IO is bound to be slower than a more direct approach unless the JVM takes some shortcuts and makes some methods into special cases. But actually, from the point of view of my actual work it doesn't matter what the reason is -- performance critical serious number crunching is done in C++, and that's pretty much a universal, because everyone relevant has made the same simple observations I have. This C++ can then be wrapped with a Java interface for the benefit of other systems that depend on Java and for people who only care about whether the system is Java or not (and so that it works with WebSphere now that the company is locked into WebSphere, heh heh). So, _whyyyyyyy_ am I _stilllll_ told by posters on Maybe it's because... (Score:5, Insightful) By the way, I frequently use a very cool Java desktop app - It's an Amp/Effect editor from Line 6 that controls their Guitar and Bass Amps - It's all Java, looks and runs fantastic. Check it out if you have a Podxt [customtone.com]. First Impressions, then second (Score:4, Insightful) By the time of the second impressions, Sun and Java zealots started to become annoying, promising silly things like it was faster than native code. Maybe in some cases it is, but certainly not where it counts: the GUI. Oz Java's problem is Sun's mismanagement (Score:5, Insightful) Sun has let the technology stagnate while Microsoft has caught up (and IMHO surpassed) Java with their Plus I don't know what's going on at Sun marketing, but they've descended Java into acronym hell. Plus the naming conventions don't really make sense now. The new version of Java is J2SE5 (I'm not even sure that it is this now). I'm taking this from the perspective of desktop developers (rather than the server side as they seem to use Java fine). Java really does blow, and there are now better technologies to use. Sun has even ignored integrating other, better technologies (*cough* SWT) due to NIH syndrome. If Sun went and fixed their mistakes rapidly (a bit late IMHO) then Java could still be cool. But everyone on the desktop who's used it considers it a steaming POS. Oh double negative, why do you haunt me!!! (Score:5, Funny) Why do I get the feeling I wouldn't want to debug this guys code?? This is mostly babble. (Score:5, Interesting) First, I've read Graham's essay, and his definition of "Great Hacker" is on the vague side, and consists largely of platform advocacy. It turns out that his "great hackers" are all people he knows. Fair enough: He can't really judge anybody else. But that leaves him with such a small and selective set of data that his conclusions are meaningless. For example: He claims that all "great hackers" refuse to work on Windows. He works at companies developing software for UN*X. Not surprisingly, most of the programmers he knows are UN*X people, who don't work on Windows. So what? This proves nothing at all. He has merely suggested (however plausibly) that Windows developers tend not to develop for UN*X and vice versa, which is tautological. Dennis M. Ritchie has a Windows box on his desk these days, but Graham doesn't know Ritchie personally, so Ritchie's not considered. Graham's working from a thin set of anecdotes. Secondly (and this has been said before [ericsink.com]), Graham's "great hackers" are prima donnas who refuse to deal with practical problems outside some very limited set of problems that they enjoy. I remember a story about Richard Feynman helping paint the walls at Thinking Machines when he worked there; I guess Feynman wasn't a "great hacker". Finally, I often hear from Java advocates that the memory-lebensraum problem and the speed problem are due to programmers not understanding the internals well enough to work around their flaws. This is not said to be true of any other programming language on Earth, as far as I know. It all sounds like a crock to me. Knowing the tools better will always help, but if only an expert can write usable code -- not great, but merely usable -- the language is junk, or at best the implementation is junk. Who Gives A Shit? (Score:5, Insightful) Java works well in some environments and for some tasks, and poorly in others, and a lot of that depends on the programmer, not the platform. Besides, success is its own argument. If you can't understand why Java is so big these days, maybe that's your fault, and not the world's. Overheard in a recent Sun board meeting... (Score:4, Funny) Bill Joy: What's wrong with it? Exec1: No one's using it. BJ: The hell they aren't. Java's everywhere. Exec2: Well, maybe, but no one wants to use it. BJ: Why? Exec3: Maybe because the performance sucks compared to programs written in C++? BJ: That can't be it. Sun hardware doesn't perform very well either, and people use our servers all the time! By the way, you're fired. *uncomfortable silence* BJ: Well, why else can it be unpopular? Exec1: Sir, I think geeks won't want to use it because it's not cool enough for them. BJ: Not cool enough for geeks? How the fuck does that even make sense? Someone get marketing on the phone and tell them we need an X-TREME mascot for Java, right away. That'll make it "cool" enough for these geeks. Secretary: Yes, sir. Right away sir. BJ: Alright, now then, what else is on the radar? Same reason as everything else (Score:5, Funny) Let me summarize the attitude: Java Basher vs. Java Apologist (Score:5, Interesting) ``you cannot really make your friends go ga-ga at amazingly brief programming constructs.'' Right. When you have to write BufferedReader in = new BufferedReader(new InputStreamReader(System.in)), that indeed doesn't give a strong sense of brevity. Nor does public static void main(String argv[]). ``Java has been considered slow for ages.'' And it's still slow. Each time a new release comes out, people get into the debate of Java is slow vs. you moron did you actually test that? Well, after 1.4 I have given up on testing. It's slower than unoptimized C for all programs I have tested with. Probably this is because I use the wrong kind of tests (ranging from simple loops and calculations to simple chat servers and clients), but just the fact that there are such wrong programs tells something, IMO. And startup time and memory usage continue to amaze me. ``Swing is a brilliant, although hard to learn, API.'' If it's hard to learn, what makes it brilliant? Certainly not its good performance or integration with the host environment. Themability and portability are good, but other toolkits have these, too. ``Java is a strongly typed language therefore you have to tell the compiler exactly what you intend to use.'' That's a fallacy. ML is also strongly typed, yet you don't have to tell the compiler the type you want to use. ``Java is popular. Anything that is popular has lost its elite status and therefore is not cool.'' You mean like Linux, Apache, Perl, PHP, gcc, etc. etc. etc. etc.? Actually, now that I have read the full article, I don't think the author was trying to debunk any myths at all. More just summing up the points, so that those who want to defend/attack Java know where the battle is. Bad article (Score:5, Insightful) Just like the last article slashdot linked from this source. For one, it's a straw-man argument. He gets to set up the 10 greivances that he'll knock down. How about he ask Paul for a list of 10 greivances to knock down? Secondly, the greivances he picks and his arguments against them clearly show that he's incapable of thinking in the way that people who despise java think, which makes him a poor arbiter of such things. Would a great hacker really say "Java sucks because it doesn't have a cool IDE like MS Visual Studio?" Java still playing catch up with Smalltalk (Score:5, Insightful) I'm amazed that how all of the current "state of the art" Languages/Frameworks still haven't caught up to Smalltalk yet. Smalltalk is a Language/Library/ and integrated development environment all in one. It's had for over twenty years: Java/C#/.Net wish they had all of this "20 year old" tech. They are good Languages/tools that are slowly evolving into Smalltalk. Why don't you just save time and go to the top of the food chain? It's amazing how one research lab, Xerox Parc, could have been SO far ahead of its time. Its like software has stood still for twenty years. You can explore it via the open source squeak project. Understand it is written for coders by coders so it takes a little work to come up to speed on it, but in my option, well worth the effort. And Morphic just rocks. [gatech.edu] Great Programmers? (Score:5, Insightful) Martin Fowler of Refactoring does Java. Erich Gamma of Design Patterns is a major player on the Eclipse project. Besides why should people consider a language cool at all? Shouldn't it be, "What I can do with a language" is considered cool? Why I Dislike Java (Score:5, Insightful) public class hello { static public void main(String[] argv) { System.out.println("Hello world!"); } } Since everyone likes readability, I'd like to ask what part of "static public void" helps you to understand the program. Let's compare this to, oh say Perl. print "Hello World\n"; Which, as Perl's reputation precedes it, is obviously harder to understand. Javs relies on vast ammounts of knowledge drilled into the heads of students. If the OO paradigm wasn't so popular, Java would be entirely obtuse. Anything not memorized must be looked up. You wanted to add that integer to the float? Too bad. Go look it up type converting. Additionally I'd like to conjecture that the human mind is better at remembering small things than large ones. Therefore, system.out.println() is more difficult to remember than print. I'd rather remember something like "-e" (Perl) to test for file existance, than the Java equivalent, which I have looked up and since forgotten (though I've used each the same number of times). While C may be verbose, it allows you to have near complete control of the physical operations of the hardware (e.g. when you delete memory or use a pointer, this has a physical analogue). Java is both verbose (lots of commands to do simple stuff), clunky (really long commands), and forces you to use the OO paradigm whether or not the problem demands it. It's these reasons why I dislike it. Re:Why I Dislike Java (Score:5, Insightful) I use Perl when I have a task suited for Perl, Java when it better suits a task. I do agree that it's difficult to do some simple things in Java... I personally feel that it's benifits outweigh it's detractions in most cases though. Top reasons why Java *is* cool... (Score:5, Informative) 1. It runs everywhere unmodified. This has got to be the coolest thing of all, and the reason I adopted Java in the first place. At the beginning this was not always true, due in major part to the AWT graphics libraries, but today it is. 2. It's more productive to work with it, leading to fewer bugs. This is very important in business apps. I certainly no longer get C/C++ pointer problems, memory leaks, or perl syntax error problems. 3. It is fast (ok, it loads slow the very first time, but with JDK1.5 this seems to being addressed as well). Somehow Java lends itself so easily for users to write efficient code (i.e.: multithreading is a snap and platform-independent), that somehow the applications we've been replacing with it simply run at least twice as fast as the older C++, VB, and perl apps. 4. It is simple. Sure, some hackers like garbage-looking code because they think the harder to understand their code the cooler it is, but in my book the cleaner and simpler code wins any day, specially when programming in a team environment. I think Java should be given credit as the environment that brough simplicity back to programmers in the internet age (just as VB did in the client-server day). 5. You can use multiple tools to develop the same code base. Heck, and now with ANT (possibly one of the coolest tools in recent times) you can choose your IDE (or command-line if that's your thing) and move the project back-and-forth between IDEs to take advantage of each (GUI design, refactoring, etc). Choice is a good thing. 6. I'll repeat it again: How cool is it to develop in Windows and drop the app unmodified in Linux or OS/X and see it run as expected with NO changes to the code? Or if you prefer, develop in Linux and deploy in Windows. Either way it works. 7. It is standard. Sure, it is not open source but then again not everything has to be. I think the fact that open sourcers advocate freedom should be reason enough to allow other companies to choose if they want to free their software or not. It is their choice. The fact that it is standard means that Java is protected from the "Unix division plage" where now almost no Unix is compatible with any other Unix. Geez, even Linux is starting to become incompatible with all the different versions of itself. Sometimes centralized control is a good thing. Debunking the debunking (Score:5, Interesting) Java has considerably fewer surprises: on this one he might have a point. I might say "Java has fewer orthogonal features" instead. For instance, there's little ability to do metaprogramming in Java (unless you use AspectJ). There's just lots of interesting things you can't do -- and interesting things can also be hard to understand or cause surprises. Java's compromise is arguably valid, though not very exciting. Java has been considered slow: obviously he doesn't understand where Graham is coming from. Many interesting languages are slower than Java, including many of the languages that Graham suggests (Perl, Python, Scheme). Swing disasters continue: again, he doesn't understand Graham. To address his criticism of Java, you must ask "is Swing fun to program" not "are Swing apps fun to use". Java is strongly typed: well, sure. ML is a statically typed cool language. And Lisp, Python, and Smalltalk are all strongly typed. (If you don't understand the distinction between strong and static, read this [artima.com].) The problem is really that Java doesn't trust the programmer, not the specifics of its typing. Though if you trust the programmer, static typing starts seeming a lot less useful. And yes, great hackers don't like languages that don't trust them, for obvious reasons. Java has a vast library that is available to all Java developers: this is a guy with a Common Lisp background. He certainly has no problem with good libraries, and he never mentions any problem with extensive libraries. Programming in an open field can be fun sometimes, and can help you think about things differently, but libraries are never a detraction (you can always ignore them if you want). Java did not have a good IDE: I don't think Graham said that great hackers really like Visual Basic, and that's why they don't use Java. I laugh just considering that argument. Java is popular: if you ever listen to the users of languages like Smalltalk and Lisp, they will bemoan at great length that they are not as popular as they deserve. Though you'd only know this if you ever looked at these communities. Java is an application programming platform: so are Lisp, Smalltalk, Python, etc. Most of the kinds of languages Graham is talking about are not systems programming languages. It's nice this guy tried, but he really doesn't understand what Graham is talking about. Which is kind of the point -- to understand Graham's perspective you need to have the intellectual curiosity to do non-work-related projects, using environments that are unfamiliar to you. You need to reflect on those experiences and make judgements about what you like and what you don't like. If you've only used Sun and Microsoft languages, you won't get it. That doesn't mean you can't do good work in Java, but if that's all you do, then you won't be much of a hacker at all. As a Language Geek... (Score:5, Interesting) As the fortune file puts it, "A language that doesn't affect the way you think about programming is not worth knowing." Learning C was a mind-expanding experience for me because it let me do anything I wanted and because it taught me about self-contained functions. Learning Smalltalk was a mind-expanding experience because it was this giant, full-featured language built out of a few simple principals. Learning Perl was a mind-expanding experience because it was this hideous, misshapen monstrosity of a language where every single wart turned out to make my life easier. Learning Lisp was a mind-expanding experience because you could extend the syntax of the language itself from inside the language. And Java? It's basically just C++ with some of the better ideas from Smalltalk (or Lisp, Eiffel, Sather, Modula-3 or whatever) grafted onto it. Been there, done that, got the T-shirt. That's not to say that Java isn't useful--it is. It's just not exciting. There are jobs for which Java is the right tool and some of those are even interesting from a hacker's point of view. It's just that the language itself that isn't interesting. The only time I consider brushing up on my Java skills again is when I'm looking for a job. (As an aside, my take on Paul Graham's comments is that if a company is looking for Java programmers, it's a bad sign because it means that the suits are making technical decisions. I'm inclined to agree with that--if the company is run by people who think Java is cool, you have to wonder what other kinds of decisions they are making.) Disclaimer: I've done very little in the way of Java programming, although I did once write a compiler for it. Re:Maybe because it's slow ? (Score:4, Informative) This isn't to say Java is perfect for everything, but it is for some things. Re:Maybe because it's slow ? (Score:5, Funny) Re:Maybe because it's slow ? (Score:5, Informative) Everyone thinks "Java is slow" because the only time they experience Java is in a Swing app. Swing is VERY bloated and therefore very slow. The only other "slow" processes in Java are Garbage Collection, which is pretty minimal if the app is written correctly, and the initial startup of the VM. Look, for example, at Eclipse IDE. Eclipse is a Java app, and its extremely powerful and not very slow. Why? They use their own widgets that have less overhead, they are not using Swing widgets. Also, a correctly written OpenGL java app has been proven to perform at 85% the speed of its C counterpart (yes C, not C++). A couple of guys (I can't find the link) ported QuakeII to java to get this statistic. Not bad considering the relative youth of OpenGL bindings in Java. I once had a "Java Sucks" attitude myself (I've been a hardcore C++ programmer for over 9 years), but I must say, after using the language for quite some time (~2 years), I've become very fond of it, and have written several large & FAST Java apps -- in about 70% of the time it would have taken to write in C++. Well... (Score:5, Insightful) But as corporations nowadays still have little budget left for buying their employees decent PC's, JAVA still has this practical limitation. Re:Well... (Score:4, Insightful) you never did device drivers or realtime systems, did you? Re:Well... (Score:5, Insightful) Re:Well... (Score:5, Interesting) Please break it gently to Google! Re:Well... (Score:5, Insightful) 1. C programmers write 10 lines of REALLY LOUSY Java code and decide that proves their point about Java being slow. 2. People like you WANT it to be slow. I'm sorry, comparing Java programming against device driver writing? That's the height of hypocrisy. Just because you're sore that *you* can't write high performance Java code while maintaining the beauty of an OO design, doesn't mean you have to take it out on everyone else. BTW: 4k games [dnsalias.com] Amazing OpenGL game [puppygames.net] More Java games [grexengine.com] JDiskReport [jgoodies.com] Best BitTorrent client ever [sf.net] etc, etc, etc. Re:Well... (Score:5, Insightful) 20 years ago, you wouldn't have used a C based Unix machine in place of a Mainframe, now would you? Back then, OSes were written in "safe" languages like ALGOL, FORTRAN, and LISP. Because you can't do the low level stuff in Java. You can, and you can't. Generally, you can't do it in Java because the API has been designed to prevent it. This is INTENTIONAL for security reasons. You wouldn't want an ActiveX control to install itself as a device driver, would you? But it *can* be done in Java as long as you have an appropriate API toolkit. JNode has one, and Sun actually provides such a kit [javapos.com] for all the embedded Java development going on. I never wrote about the slowness thing, I just didn't like the "you can do anything in Java" statement made by the parent poster. I apologize if I misinterpreted, but your post did make it sound like you were referring to Java having too poor of performance to act as a platform for things like Device Drivers. Re:Well... (Score:5, Informative) In many situations, Java absolutely thrashes VBS/JS/Python/Perl. In other situations, it doesn't. The numbers certainly shouldn't lead you to conclude that Java is the slowest of them all. Re:Well... (Score:5, Interesting) Umm, depends on what you consider a "reasonable" language. C says 3 == 3.0 Lisp says (= 3 3.0) but not (eq 3 3.0) Forth will just compare the most-significant word of 3.0 to 3, though you have to bend over backwords to get a floating point number on the data stack to begin with The ML family will throw a type error Scripting languages will for the most part either promote 3 or demote 3.0 I think there's a lot of variety in what a "reasonable" language will do in such a situation. Re:Maybe because it's slow ? (Score:4, Informative) I've tried the 1.5 beta and it seems to go a long way toward addressing this problem. It feels as fast as native, and easily beats gcj in my own unprofessional benchmarks. But massive Java applications like Eclipse and NetBeans still perform horrendously slow for me, even with the server vm, and I doubt it can be blamed on any gui toolkit. Re:Maybe because it's true (Score:4, Informative) Re:Maybe because it's slow ? (Score:5, Informative) I have no complaint about the speed of a Java application once it is up and running. The only problem I have is that the runtime takes so long to heave its vast bulk into memory and fiddle with stuff before the app. gets control. Notice that as the size of the app. grows, and the time you spend in it begins to dominate the time you spend getting there, this becomes less and less a problem. But it's still noticeable. The time-to-first-interaction is painful here on a box that opens non-Java, non-Gnome app.s in what my human nervous system perceives as zero time. There's no reason writ in stone for code compiled to an abstract architecture, running on a suitable interpreter, to be slower than native code. It could be *faster*, if the architecture is well-designed and the interpreter well-written. I have no doubt that someone could trot out an app. which runs faster in Java than in native machine code made from well-crafted C. Re:Maybe because it's slow ? (Score:4, Informative) I have no complaint about the speed of a Java application once it is up and running. The only problem I have is that the runtime takes so long to heave its vast bulk into memory and fiddle with stuff before the app. gets control. You should try using Java apps compiled with gcj or one of the commercial traditional Java compilers. There's nothing set in stone that requires Java to be interpreted. JRE 1.5 should help quite a bit also. Re:Maybe because it's slow ? (Score:5, Insightful) You are correct that this model has a start up delay which can be seen as a problem if you do a lot of startups, but like many applicatons say a web server that starts a JVM and keeps it running while the server is up it is a one time charge. I find that given the saftey of the language especially around automatic garbage collection compared with C++ my envirionment is rock stable and the online Web apps we have only come down with the hardware needs maintenance. The folks compainign about MS Java have a good complaint as that was an old buggy version of Java that has not been in general use for years by people using Java from the Sun source. The new versions of Java 1.4 I write my code on NT and W2k platforms (java 1.4.2) and field the same code on WNT W2k Sun Solaris with out modification and no changes for envirionments. With C++ or C# and the java clone this is impossible at this time. I have in the past had to field C++ code on different platforms and that was not a very nice time. How do you want to spend your time. Collecting your own Garbage, writting very very carefully so you can use your code in different environments, or do you want to just get the job done right and once and get on with it? Re:Maybe because it's slow ? (Score:5, Insightful) That being said, Java has no way of hinting to the compiler "this is going to be constant for a long while now", or "I'm going to run this loop a couple of million times in a bit, you might want to JIT it real good". Without those, the compiler doesn't really have a hope. Also, it's not a case of interpreted languages not being cool. Perl, Python and a myriad of other languages are all interpreted (or run as some kind of byte-code), and no-one complains. Then again, I've seen Java out-paced by many of these languages (most of which compile the program to byte-code at start-up faster than Java loads), which suggests to me that Java is just a poor interpreted language. If you've seen how JVMs work internally, I think you'll agree with me. Re:Are your apps constantly restarting? (Score:5, Insightful) In UNIX, a program is usually a tiny little thing which passes its output to other tiny little things, creating a network of programs controlled by a lightweight master program. Because of this, programs HAVE to have a small footprint and have to start up and close down quickly. A good UNIX program does only what it's supposed to, and then it quits. In a Java/C#/Windows program, you generally start the program once per day/week/year. The program, once started, calls objects with functions that operate the same as individual programs in the UNIX paradigm. Because the program is doing all of the work and all of the flow control, it doesn't matter if the thing starts or stops quickly, doesn't matter if it uses a lot of memory, because you're not going to be using that memory for a whole lot else. A good Java program does so much, it's almost like its own windowing or operating system. The essence of "I don't understand OOP, it's full of bloat" is the perception of what a program is and does. If you think a program should do one small thing and then pass its output or control to another program, you're essentially in the OOP mentality already...substituting processes for objects and programs for functions. On the other hand, if you believe as I do that programs should sit open and ready to use on a whim, even the fast startup time of the average UNIX utility is too much. You need the memory allocated, the commands loaded and ready to handle whatever you've got to do -- which is why OOP makes sense. You don't start your notebook every time you need to jot a note (I don't anyway)...you just pick it up and write. Anyway, to get on topic: I always thought Java *WAS* cool. All the under-40 programmers I know LOVE Java, even if they don't use it. It's almost a spiritual thing (I plainly remember wearing a "Java is the Way" back when I was a Java coder) and it's even more mysterious because the older generation of C coders didn't like it. Not disposing of objects and relying on GC is the programmatic equivalent of not cleaning your room. And a good UML diagram reads like a map of a futuristic city. Re:Are your apps constantly restarting? (Score:5, Interesting) The truth is though, not all applications can be distilled down into simple pipe/filter utility-type solutions. In these cases I typically like objects. If you understand OO programming, and I have found few who can both claim they understand and actually do (its about a 1:5 ratio from my experience) you can build very complex/robust systems very quickly. The tradeoff, memory. In this case I usually use java. Yes, its restrictive, and you can't do everything you can in a different language like Smalltalk or C++, but for most things it is capable. Its also cross-platform, if you know what you're doing, and there are hundreds of "standardized" API's for doing lots of stuff. Not to mention, because of those API's, you can actually get cross-platform database connectivity, web applications, and in theory but not really yet, enterprise services. If it comes to writing simple utilities, throw away code, anything that I feel falls into less than 100-200 lines of Perl code, I'll use Perl typically. My experience with Perl is that it doesn't scale, from a software management perspective, as nicely to large complex systems. Its usefulness though, is that you can do some pretty powerful stuff, without having to get bogged down in datatypes, complex exception handling, complex string manipulation and other language-isms that you have to deal with when you use a more strict language like C, C++, or Java. I also like the fact that anything I can write in C I can typically write just as easy in Perl, so for some of that systems programming type stuff that Java doesn't do so well, its nice to use Perl and not have to get into the guts of a C program As for C/C++, I avoid them whenever I can :). Only when doing embedded programming do I get into C and C++ is typically on a supporting existing code type basis. Again though, it comes down to right tool for the job. I've had this argument time and time again with PHP, Perl, and Python programmers and it always seems to come down to size/scope of the problems they are trying to solve. Most people who love these tools have written what I view as smaller applications. They have never had to write an e-commerce system that ties together multiple enterprise datasources, call into SOAP/CORBA etc services on another box, etc. Or the other thing I experience is that if they have, they end up reinventing some API/technology/feature that was already present in Java or that had they implemented their solution in Java would have made their life much easier. Anyway, this has been my experience, and this is the toolset I use to solve the problems that arise in my world. Everybody is different, use the right tool. Re:Maybe because it's slow ? (Score:4, Informative) / System.html#gc() [sun.com] Re:Maybe because it's slow ? (Score:4, Insightful) I wouldn't count on that. The classes of vulnerabilities that affect typical C and Java programs are just different. Of course, buffer overflows aren't a problem for typical Java programs. On the other hand, lack of synchronization is not such a big problem in the C world. For example, if you write a web application in C, it's quite unlikely that it exposes data from a different session if you hit the browser's back button. With Java, such problems do occur (because the same servlet object is used in different sessions and some programmers use it to store session-specific data). Re:Maybe because it's slow ? (Score:5, Insightful) Flash 6 can install on accident even on a dial-up modem. You won't be accidentally downloading a huge runtime to get Java installed. Re:a few reasons (Score:4, Insightful) I have no idea what you mean about byte code making it harder. You compile things into a JAR, in most OS's you can double click the JAR and run it. How is that difficult? Tons of production software is written in Java. Especially server side. C/C++ are out there but the reality is that they are too hard to use for very large project. It can and will be done successfully but it costs a fortune. I can do so much more using Java with so much less budget that its amazing. As far as being multiplatform. It comes close. I've never had any huge problems outside of cosmetic differences that might need to be tweaked, but that it easy. I was even doing 3d graphics on the mac and demoing them blindly on a windows PC without testing on Windows (I refuse to own one of those) and had no problems. Re:who cares what he says? (Score:5, Insightful) That's right, he used LISP. Re:who cares what he says? (Score:4, Informative) Re:who gives a shit about paul graham? (Score:4, Insightful) 1. Because of his personal programming style, he would never like java anyway 2. Eventually Java (like anything else subject to technological change) will become unpopular and he will be proven correct 3. He prides himself on his nerdyness and doesn't care what management types think of him. He is looking for acceptance from the slashdot geek, who will more often than not agree with his language preferences Re:Why, Python, of course. (Score:5, Insightful) That's exactly the problem of Perl, having more than one way to do one thing. It's fine when you're the only one who reads your code. People tend to learn a subset of Perl that does everything. But what if you're collaborating with other people who know a different subset, and generally a different coding style? Of course style can be enforced, like the Linux or GNU guidelines for writing C. But at that point you could just as well make the language itself clear and consistent, which is just what Python does. Mauve Was Cool In Its Day (Score:4, Interesting) In its day, mauve was all the rage: -kgj Re:One word. (Score:5, Informative) At least this way you don't have to maintain it, but if you add Hope that helps! Re:One word. (Score:5, Informative) This issue was solved a long time ago. You put your Re:One word. (Score:5, Insightful) Re:Swing (Score:4, Insightful) the real reason (Score:5, Insightful) the job of an organization developing a software product (whether it's a company, an open source team, whatever), is to get a product out. nobody outside the project cares about languages or anything else, as long as it all works in the end. but to get a product out, the manager eventually has to pick a strategy. they usually fall somewhere in between the two extremes: A) use a few brilliant (possibly well paid) hackers and let them do the work. they're smart, and good enough to rely on to just do it. managing them is like herding cats, but why would you need to? B) use an army of keyboard monkeys and manage the hell out of them. these guys can pound out mediocre code, but with enough software engineering from the top down, well defined specs, and massive testing and integration, their work is sieved into a release-quality product. real hackers hate being marginalized, having their creativity stifled (yes, for those of us who actually write code, not just implement specs, creativity is involved), having to do the dumb solution just because everyone else is too weak to do their part of the smart solution. java is not a bad language. i think many would agree that is it at least decent (i think it's pretty good, actually). but java is the language of the B coders. it is made to be easy and idiot proof, like visual basic. you cannot do "neat hacks" in java, because if you could, the B coders would screw it up and produce worse code. java is a great language for the B coders. but the choice of java for a project is often a leaning toward strategy B. it's the "we can get any code monkey off the street to do this". it's the grunt work software that real hackers don't want to do, and what B coders are hired for. perl, a RAD (and rad) programming language, does not suffer this stigma. perl is accepted by hackers, precisely because it is not idiot proof. it's easy to confuse the B coders (and yourself) with some maliciously written ascii barf. you can do some crazy tricks in perl. it does not lend itself well to software engineering and the micromanagement of the B coders. perl is a hacker's language. many real hackers i've seen instinctively feel resentment towards java and the like, because they see marginalization of the software industry. java is for the blue collar coders, part of the greater plan of "software factories", where reproducability, meeting deadlines and specs, and easy replacement of people is way more important than doing cool shit. those of us who wish to stay at the top of the game, to do the cool shit, to write the programs that interest us the right way are often drawn to the languages that keep out the idiots, that have a higher barrier of entry, and let us do the cool hacks. i don't dislike java, and i don't dislike you B coders out there (you know who you are). i just don't want to be one of you. thanks for reading my long-ass post, p. Re:the real reason (Score:5, Insightful) I am a java coder. I consider C/C++ a knowledge based coding language. If you take your time to learn all the tricks of the trade in C, you will probably be a better coder than I am. Java isn't as tricky of a language, most everything you need is in the javadocs. I can gaurantee you that the C++ master would write cleaner code than the casual java coder, and probably even better than the java master, the difference being the java coder doesn't have to know every nook and cranny of the coding language to write a good program. I would never presume to call the C++ programmer more intelligent than the java programmer, merely more knowledgable and likely more passionate. I personally don't use java with the desire to become a java guru or a programming master, i just want to write software that works, and i don't want to spend a great deal of time doing it. I don't program for the joy of programming, i program for the joy of solving a problem. The amazing thing about java is that it gives the ability to write software to just about anyone. Yes there are B coders in java, but many of them are A engineers who see coding as a means to an end, not the end itself. Whether they can write good software or not is a function of their intelligence, in my opinion, not of their language choice. Re:the real reason (Score:5, Interesting) It is good that you don't want to work for hte big software shops, as it would never happen. Let me give you a manager's persepctive on why "cool hackers" are not desireable as hires; you just listed all the reasons why I would never, ever hire you in a million years to work on my major financial system.1. You think you are too smart to work from a spec. Implementing a spec does not leave no room for creative solutions to problems. It just guarantees that you won't be a typical "midnight cowboy" loner who programs an 31337 solution that does not actually meet the requirements of the users. I will take someone who can solidly do the work I need done over a genius who gives me a creative app that fails to implement the spec any day of the week. And I will have more confindence in the B coder who I know is not a prima donna. 2. You look down on the concepts of testing and integration. Imagine 40% of financial derivative deals in the world financial market suddenly unable to be valued and executed for a day, a week, a month - that is what happens if my system goes down. If an appliation outage means potential damage to the company and a noticeable impact to the world financial market, testing is not just a good idea. It is everything. Hell, yeah, I manage the hell out of my team. I don't sit at their desks and micromanage them, though, and you seem to think that the former implies the latter. I just make damned sure that everything we do is extremely well-tested, lest we cost the bank millions of dollars with a simple error. 3. You actually think "cool" matters. There are places where this is true, such as perhaps game companies. But my own time in the candyland of the late 90s boom showed me that coolness is not nearly as important as delivery and reliability. You may deliver good, cool code, but as a manager I am not at all sure I can rely on you unless I coddle you and keep you happy. 4.You have disdain for your potential teammates. I will never hire an "A" programmer if that means getting someone with your attitude. Instead I will hire what you call "B" programmers (many of them extremely bright people at the top of their field). I will treat them with respect and empower them to make their own decisions as much as possible. And day to day I will worry much less about them than you because you come off as an arrogant ass who thinks highly of himself and cannot work with others. Enjoy your work on the "big" apps with the other A programmers. Those of us who build software that keeps the world running have other things to do. The Bell Curve (Score:5, Insightful) you're welcome, thanks for posting it However, I think you miss a few important concepts in your post. 1) Not all "A coders" are hackers. - I've worked with the elite programmers that do believe that requirements and documentation are good and that a process produces better results. It seems that these are usually the elite and experienced, but not always. 2) Not all hackers are "A coders". - "B coders" are hackers too. Seen it too many times. Just like anything else, there are more "B coders" and "C coders" that are hackers than there are "A coders". It is just a fact of life, that there is always an elite FEW, but and abudance of mediocrity. i.e., just because you are a hacker, doesn't mean you're good. 3) Managers are people too. - There are many "B managers" and an elite few "A managers". And usually, an "A manager" is worth a team of "A coders" to a company. 4) Teams are usually a cross section of the population. - Rarely are there teams full of code monkeys, or full of "A coders". Here is where a great manager is important. An "A manager" will allow enough room for each person to do what they need to, but ensure that each is able to work with the other. I've been lucky enough to have "A managers", and they make a world of difference to individuals and to projects. 5) Programming languages are just tools. - Use the best tool for the job. Saying you choose a language based on your ability to do "neat hacks" is idiocracy. If I see someone putting nails into a wall with a screw driver, I think - "Damn, that guy is good with a screw driver", and "what a friggen' idiot". Reading your post it is obvious that you are either an elitist with a lot of bad experiences, or someone with no experience. Either way, I hope your next manager is an "A manager", you really need some help. Re:Lack of Flexibility (Why *I* don't like java) (Score:5, Insightful) No, you use the Command or Strategy patterns to solve the problem the function pointer "hack" is used for in C/C++. Java doesn't have function pointers because it's not C. I am sorry if anything non-C frightens you, but it's time to move on. If language A doesn't have feature B of language C, it means you need to learn something new instead of just apply the knowledge of C to everything. C is just assembly that has put on finer clothes, trying to look like a higher-level programming language. Re:Java doesn't play nice with other children (Score:5, Informative) Compile in kernel support for misc binaries on linux. Read Documentation/binfmt_misc.txt to learn how to use it. Read Documentation/java.txt to learn how to use it with java. On any recent version of windows it works to just type the name of the jar file. Here I am with some code written in Java, and I want to call it from Tcl. Write a quick C wrapper, link the .o in, and package require... no...? How do I do that, then? 0 511-legacy.html [javaworld.com] The first google hit -- Here I am with a library written in C, or Fortran, and I want to call it from Java... well, how badly do I want it? / [sun.com] It is really easy. Re:Because it is a limiting language (Score:5, Insightful) First you say: Yeah, and your point is? In case you didn't notice, passing functions as arguments does not make the worlds most legible / maintainable code. On the other hand, an explicit interface is both legible and maintainable, plus you have an explicit place for documenting the interface (Javadoc in the interface definition). Then you go on to say: This is an implicit downcast: It compiles perfectly and works as expected. The last line of this: Is an upcast. and I dare you to find a list implementation in any type-strong language that doesn't require an upcast in this situation. You need it to be able to store objects of an anonymous type on a list. How such misinformed tripe ends up at +5, I'll never know...
https://developers.slashdot.org/story/04/08/24/1230245/why-is-java-considered-un-cool?sbsrc=thisday
CC-MAIN-2017-34
refinedweb
13,573
71.65
26 March 2009 19:42 [Source: ICIS news] TORONTO (ICIS news)--Germany's chemical producers are leading the drive towards energy savings and efficiencies, Ulrich Lehner, head of the country's chemical industry association VCI, said on Thursday. Chemical products helped customers save far more energy and greenhouse gas emissions than were generated in making those products, Lehner said in a speech to delegates at an energy forum in ?xml:namespace> In terms of greenhouse gas emissions, chemical products helped save up to five times the emissions that were caused in their production, translating into a huge overall reduction in carbon dioxide (CO2) emissions, Lehner said. Lehner outlined three end markets for chemicals and plastics - cars, houses and detergents – to make his point. The use of light plastics materials in the car industry had tripled over the past 30 years, translating into annual fuel savings of 500m litres, equivalent to 1.3m tonnes of CO2 emissions, in In construction, chemical and plastics-based insulation products helped households achieve large savings on their heating costs, Lehner said. Another example were detergents, where enzymes and related biotechnical processes had made it possible to wash clothes at much lower temperatures than before, translating into big energy savings for consumers. At the same time, the highly energy-intensive chemicals industry had managed to drastically reduce its own energy use and greenhouse gas emissions over the years, Lehner said. In fact, companies had “de-coupled” production growth from energy use, he said. While chemical production grew 43% from 1990 to 2006, the industry managed to cut energy use by 27% and reduce greenhouse gas emissions by 45% during that period, Lehner said. Lehner also reiterated VCI’s earlier warning of additional high costs He warned of costs of €900m ($1.2bn) by 2013 and at least €1.2bn by 2020. This compares with VCI’s previous estimate, from before the EU’s emissions compromise in December, of €1.0bn by 2013 and €2.0bn by 2020. “We remain convinced that the immense sums of money we have to pay for emissions certificates are better used for research and development by the industry, that would achieve better results for climate protection,” Lehner
http://www.icis.com/Articles/2009/03/26/9203670/chemical-industry-leads-energy-savings-drive-vci-chief.html
CC-MAIN-2014-41
refinedweb
366
50.57
Tracker Edge firmware One difference between the Tracker One. The Tracker Edge Firmware API Reference is also available. Using off-the-shelf releases In your product in the console, click on the Firmware icon. . Development device setup If you are going to develop firmware for the Tracker One or Tracker SoM, you have to perform a few additional steps. - Your firmware will typically be based on Tracker Edge, as outlined below. This is not a requirement and you can build your own firmware from the ground-up, however you will not have the cloud configuration, location event support, and the libraries for the GNSS (GPS), IMU (accelerometer), CAN bus, and other Tracker-specific peripherals. - All Tracker devices must be part of a product, as described in setup. - By default, Tracker devices are not claimed to your account. This may affect development. Mark as development device - Go to the console. - Open the product containing your Tracker device. - In the Device List, click the ... button and then Mark development device. For more information, see Development devices. Claiming the device By default, Tracker devices are not claimed to your account. This will affect the workflow in Workbench and there are two options: Leave unclaimed You can choose to leave your device unclaimed, however: When prompted to select the Tracker device you want to work with, will need to specify it by Device ID (24 character hex) or hit Esc and manually put the Tracker in DFU mode (blinking yellow) using the buttons on the device. You will not be able to subscribe to events from your custom firmware. Claim Or you can claim the device to your account. You can do so with the Particle CLI. Get the device ID of the tracker. It will be displayed in the device list where you marked the device as a development device, above. Use the Particle CLI command: particle device add <device-id> Replace <device-id> with the 24-character hex device ID. Getting the Tracker Edge Firmware You can download a complete project for use with Particle Workbench as a zip file here: Version: - Extract tracker-edge.zip in your Downloads directory - Open the tracker-edge directory in Workbench; it is a pre-configured project directory. In order to use the Geofencing features, Tracker Edge v17 is required.. Overview A typical main source file looks like this: #include "Particle.h" #include "tracker_config.h" #include "tracker.h" SYSTEM_THREAD(ENABLED); SYSTEM_MODE(SEMI_AUTOMATIC); #ifndef SYSTEM_VERSION_v400ALPHA1 PRODUCT_ID(PLATFORM_ID); #endif PRODUCT_VERSION(1); SerialLogHandler logHandler(115200, LOG_LEVEL_TRACE, { { "app.gps.nmea", LOG_LEVEL_INFO }, { "app.gps.ubx", LOG_LEVEL_INFO }, { "ncp.at", LOG_LEVEL_INFO }, { "net.ppp.client", LOG_LEVEL_INFO }, }); void setup() { Tracker::instance().init(); Particle.connect(); } void loop() { Tracker::instance().loop(); } This doesn't look like much, but a lot of stuff happens behind the scenes and is cloud-controllable: - Publishing location periodically, or when movement larger than a specified radius occurs - Publishing on movement sensed by the IMU (inertial measurement unit, the accelerometer) - Control of the RGB status LED Digging into this: These are some standard Tracker include files that you will likely need: #include "Particle.h" #include "tracker_config.h" #include "tracker.h" This is the recommended threading and system mode to use. SYSTEM_THREAD(ENABLED); SYSTEM_MODE(SEMI_AUTOMATIC); Since all Tracker devices must belong to a product, you should set the product ID and version. You can either set the product ID to PLATFORM_ID which means use the product that the device has been added to, or you can set the product ID to your actual product ID value. The version is arbitrary, though it should be sequential and can only have value from 1 to 65535. #ifndef SYSTEM_VERSION_v400ALPHA1 PRODUCT_ID(PLATFORM_ID); #endif PRODUCT_VERSION(1); This block is optional, but sets the logging level. It's sets it to TRACE by default, but sets a lower level of INFO for Device OS and tracker internal messages. SerialLogHandler logHandler(115200, LOG_LEVEL_TRACE, { { "app.gps.nmea", LOG_LEVEL_INFO }, { "app.gps.ubx", LOG_LEVEL_INFO }, { "ncp.at", LOG_LEVEL_INFO }, { "net.ppp.client", LOG_LEVEL_INFO }, }); Setup calls Tracker::instance().init(). This is required! Since the sample uses SYSTEM_MODE(SEMI_AUTOMATIC) you should call Particle.connect() at the end of setup(). You can add your own code to setup() as well. void setup() { Tracker::instance().init(); Particle.connect(); } The loop() function must always call Tracker::instance().loop(). You should do this on every loop. You can add your own code to loop, however you should avoid using delay() or other functions that block. If you would like to publish your own events (separate from the location events), you can use the Tracker cloud service to publish safely without blocking the loop. void loop() { Tracker::instance().loop(); } For more information about the reason for using Tracker::instance() and the singleton pattern, see application note AN034 singleton pattern. Adding to the location event It's easy to add additional data to the location event. For example, if you wanted to include the speed in the location event, along with the GNSS position information, you could modify the sample above to be like this (beginning lines omitted in the code below but are still required): void locationGenerationCallback(JSONWriter &writer, LocationPoint &point, const void *context); // Forward declaration void setup() { Tracker::instance().init(); Tracker::instance().location.regLocGenCallback(locationGenerationCallback); Particle.connect(); } void loop() { Tracker::instance().loop(); } void locationGenerationCallback(JSONWriter &writer, LocationPoint &point, const void *context) { writer.name("speed").value(point.speed, 2); } Note the additions: - Calls Tracker::instance().location.regLocGenCallback()to register a location generation callback in setup(). - Adds a new function locationGenerationCallback(). - In the function adds a value to the loc object using the JSON Writer API. If you look at the location event, you can see the new field for speed (in meters/second): { "cmd":"loc", "time":1592486562, "loc":{ "lck":1, "time":1592486563, "lat":42.469732, "lon":-75.064801, "alt":321.16, "hd":122.29, "h_acc":6.7, "v_acc":12, "cell":37.1, "batt":98.8, "speed":0.05 }, "trig":[ "time" ], "req_id":4 } You can add more than one value, and you can also add JSON objects and arrays. Initially this will not be shown in the map view, but is a possible future enhancement. It is stored, even though it's not visible on the map. To check the latest data on a device, you can query the Cloud API using the curl command. In order to do this you will need: - Your product ID. Replace 1234in the command below with your product ID. - A product access token. Replace 903a7ab752f2dcf8ed8ffffffffffff24b467131in the command below with your access token (see below). - The device ID you want to query. Replace e00fce68ffffffffff46f6in the command below with the device ID (24-character hex). curl "" This should return something like this. Note the addition of the speed data from our custom location event callback. {"location":{"device_id":"e00fce68ffffffffff46f6","geometry":{"type":"Point","coordinates":[-75.064801,42.469732,337.16]},"product_id":9754,"last_heard":"2020-06-18T14:04:43.000Z","gps_lock":true,"timestamps":["2020-06-18T14:04:43.000Z"],"properties":[{"hd":214.36,"h_acc":4.3,"v_acc":10,"speed":0.04}],"device_name":"Test-TrackerOne","groups":[]},"meta":{}}. To estimate the data usage when adding additional fields, see this page. Multi-function pins The Tracker One has three multi-function pins on the M8 port: If you enable Serial1 you cannot use the pins for I2C or GPIO. Serial1.begin(9600); If you enable Wire3 you cannot use the pins for Serial or GPIO. Wire3.begin(); This feature is also available on the Tracker SoM, however on the Tracker SoM you have access to Wire on pins D0 an D1, so there is less of a need to use Wire3. Note that they map to the same I2C peripheral so you cannot use Wire and Wire3 at the same time! If you do not enable Serial1 or Wire3, you can use the pins are regular GPIO, including all pin modes, INPUT, INPUT_PULLUP, INPUT_PULLDOWN, and OUTPUT. These pins have a 3.3V maximum and are not 5V tolerant!. Subscribing to events By default, Tracker One and Tracker SoM devices are unclaimed product devices. One caveat of this is that your firmware cannot use Particle.subscribe to subscribe to events. You can either: Use Particle.functioninstead of subscribe, as functions and variables work with unclaimed product devices. Claim the Tracker devices to an account. Often this will be a single account for all devices, possibly the owner of the product. For more information, see Device claiming. Using GitHub with Tracker Edge GitHub is a tool for source code control, issue, and release management. It's great for managing Particle projects in Workbench. For many uses, it's free, too. There are many features, entire books, and tutorials about Git (the underlying source code control system) and GitHub (a service that allows you to store files in the cloud). This is just an overview. Source code control allows you to have a secure record of all of the changes you've made to the source over time. You can roll back to previous versions and compare versions. It also makes sure you have a copy of all of your source separate from your computer, in case something happens to it. Sign up for a GitHub account if you have not already done so. You will select a username at this point, which will be your primary method of identification, not your email address. Your username will be shown publicly in many instances, so keep that in mind. Most operations are centered around a repository. In many cases, each repository will be a single project. However, in some cases you might want to store multiple Particle firmware projects in a single repository when they are related. For example, if you were writing Bluetooth LE (BLE) communication software, one firmware might be for the central role and one might be the peripheral role, but since they're both part of one project you'd store the source in a single repository. Each repository can be public or private. If you are creating an open-source project or library, public typically used. Using GitHub teams multiple users can access private repositories. Everyone working on a project should always have their own GitHub account; you should never share an account. While you can download code from the GitHub website, you will probably want to install a desktop GitHub client on your computer. You should install both the graphical and command line options. There is also support for GitHub built into Visual Studio Code (Particle Workbench), but it uses your computer's GitHub desktop installation so you still need to install a desktop client. Creating a mirror In the example above we just use Clone to make a private copy of the source on your computer. There is another option that is more common when working with Tracker Edge projects: Mirror. A mirror allows you to make a private copy of a repository and link the two, so you can later merge any changes in the original with your changes! This is a power user feature, so you'll need to use some command-line git commands to make it work. Create a new GitHub repository in your account. In this case, I created tracker-test1 and made it a private repository. Since we're going to mirror, it's not necessary to create a README or LICENSE. git clone --bare cd tracker-edge.git git push --mirror Run the commands to mirror the changes into the repository you just created. Be sure to change the last URL to match the URL for your repository! At this point you can delete the tracker-edge.git directory as it's no longer needed. git clone cd tracker-test1 git submodule update --init --recursive Make a clone of your repository and initialize the submodules. Open your project in Workbench: - Open Particle Workbench. - From the command palette, Particle: Import Project. Select the project.properties file in the tracker-test1 directory. - Run Particle: Configure Workspace for Device, select version 1.5.4-rc.1, 2.0.0-rc.3, or later, Tracker, and your device. - Run Particle: Compile and Flash. Now that you have a mirror, you're free to do things like update main.cpp and even edit the other Tracker source as desired. When you Stage, Commit and Push, the changes will be saved to your own GitHub private repository only. cd tracker-test1 git remote add official Link the two repositories. This makes it possible to merge changes from the official version later on, when new versions of Tracker Edge are released. This merge is smart, so it won't overwrite your changes if there are no conflicts, but if both you and Particle changed the same lines of source, this may be flagged as a conflict and you will need to manually figure out which to keep. You only need to run this command once. cd tracker-test1 git pull official develop This is how to merge updates from the official repository into yours. When a new version of Tracker Edge is released, you run a command to pull the changes from that release into your repository. You then resolve any conflicts and then push the changes to your repository. The steps are: - Pull the changes from the official repository - Resolve any conflicts - Push the merged changes to your repository. cd tracker-test1 git pull official release/v8 If you prefer, you can merge to a specific release instead of develop. Making a source code change Once you've made some source changes and tested them, you might want to Commit and Push these changes. Before you can commit you need to Stage your changes, which lets Git know you indeed want to upload all of these changes. The easiest way is to click on the Stage All Changes (1) + button. It's hidden by default but will appear if you hover over the spot. Enter a commit message in the box (2). This can be a reminder of why you made the change. Click the Commit icon (3) (check mark). This saves a record of the changes, but the changes still only live on your computer. For personal projects like this you will typically just push to master. This sends the data to the GitHub servers. For more complex projects with team members, code reviews, etc. you will likely use a more complex process of Pull Requests instead. - Click on the ... (Views and More Actions) at the top of the Source Control tab. Select Push. Now the changes should be visible on the GitHub web site. Also if other team members Fetch and Pull the project they'll get your latest changes. To summarize: - Stage indicates this file should be committed - Commit marks all of the changes are ready to go as one package of changes - Push uploads the package of changes to GitHub Sending commands When viewing a device in the console, in the functions and variables area on the right, is the cmd box. . Learn More - The Tracker Edge Firmware API Reference has more information on the available APIs. - The Tracker Eval Board I2C Example shows how to add I2C sensor data to your location publishes.
https://docs.particle.io/firmware/tracker-edge/tracker-edge-firmware/
CC-MAIN-2022-27
refinedweb
2,516
66.13
The ReCode Project is a community-driven effort to preserve computer art by translating it into a modern programming language. -- ReCode Project An admirable aim, but unfortunately they chose Processing, when other more elegant languages are available. I had a browse through the index of artworks, and Roger Coqart's Traveling Through the Square Series caught my eye. I wasn't particularly taken by Sermad Buni's implementation on the site, the output seemed buggy and the code complicated and long. So I decided to write my own using the Haskell programming language and the wonderful Diagrams library. I'm using the painter's algorithm to draw hollow edges, which is much easier than trying to draw the separate shapes that appear. I draw all the edges with a thick black line in one go, then overlay with thin white lines in the same locations. To determine the edges, the image is divided into a grid of cells, each having four possible edges: at the top and left and both diagonals. The boundaries of the image are treated specially to have a solid edge, the inner edges have a fixed probability of being present or absent. import Diagrams.Prelude import Diagrams.Backend.SVG.CmdLine (defaultMain) import Data.Array (array, indices, range, (!)) import Data.List.Split (chunksOf) import System.Random (newStdGen, randoms) main = newStdGen >>= defaultMain . diagram diagram g = let a = grid g in (flatten thin white a <> flatten thick black a) # bg white grid g = let bs = ((1, 1), size) in array bs $ range bs `zip` chunksOf 4 (coins probability g) flatten w c a = mconcat (map (cell a) (indices a)) # lw w # lc c # lineCap LineCapRound cell a ix@(i, j) = let [top, left, down, up] = a ! ix top' = j == 1 || top left' = i == 1 || left right = i == fst size bottom = j == snd size in mconcat [ top' ? edge (i , j ) (i + 1, j ) , left' ? edge (i , j ) (i , j + 1) , down ? edge (i , j ) (i + 1, j + 1) , up ? edge (i , j + 1) (i + 1, j ) , right ? edge (i + 1, j ) (i + 1, j + 1) , bottom ? edge (i , j + 1) (i + 1, j + 1) ] a ? b = if a then b else mempty edge (a, b) (c, d) = let p (x, y) = p2 (fromIntegral x, fromIntegral y) in p (a, b) ~~ p (c, d) coins p g = map (< p) (randoms g) size :: (Int, Int) size = (32, 18) probability :: Double probability = 0.7 You can download this Haskell source code, and some earlier versions are on lpaste if you're into code evolution.
https://mathr.co.uk/blog/2014-07-08_recode_project_traveling_through_the_square_series.html
CC-MAIN-2020-10
refinedweb
421
71.34
Hi– Little bit of conundrum. I have a variables that tracks information about methods. So it needs to work within the context of the class hierarchy. At the same time I need to access that information from the instance level. I worked it out with one exception --singleton, b/c I do something like: class Foo def self.dolist( name ) list = nil ancestors.each do |a| if d = a.instance_variable_get("@dolist") list = d[name.to_sym] break if list end end list end def foo self.class.dolist() end end This works unless there is singleton in the hierarchy that has @dolist defined. But I don’t want to call directly on the singleton in foo in case the singleton doesn’t exist --I think that would be an exceedingly inefficient. Is there another way? Thanks, T.
https://www.ruby-forum.com/t/class-method-call-via-the-singleton-or-not/76110
CC-MAIN-2021-39
refinedweb
136
69.38
Introduction Deep in your innermost being, you’ve always known you were destined to learn Clojure. Every time you held your keyboard aloft, crying out in anguish over an incomprehensible class hierarchy; every time you lay awake at night, disturbing your loved ones with sobs over a mutation-induced heisenbug; every time a race condition. Learning a New Programming Language: A Journey Through the Four Labyrinths To wield Clojure to its fullest, you’ll need to find your way through the four labyrinths that face every programmer learning a new language: - The Forest of Tooling A friendly and efficient programming environment makes it easy to try your ideas. You’ll learn how to set up your environment. - The Mountain of Language As you ascend, you’ll gain knowledge of Clojure’s syntax, semantics, and data structures. You’ll learn how to use one of the mightiest programming tools, the macro, and learn how to simplify your life with Clojure’s concurrency constructs. - The Cave of Artifacts In its depths you’ll learn to build, run, and distribute your own programs, and how to use code libraries. You’ll also learn Clojure’s relationship to the Java Virtual Machine ( JVM). - The Cloud Castle of Mindset In its rarefied air, you’ll come to know the why and how of Lisp and functional programming. You’ll learn about the philosophy of simplicity that permeates Clojure, and how to solve problems like a Clojurist. Make no mistake, you will work. But this book will make the work feel exhilarating, not exhausting. That’s because this book follows three guidelines: - It takes the dessert-first approach, giving you the development tools and language details you need to start playing with real programs immediately. - It assumes zero experience with the JVM, functional programming, or Lisp. It covers these topics in detail so you’ll feel confident about what you’re doing when you build and run Clojure programs. - It eschews real-world examples in favor of more interesting exercises, like assaulting hobbits and tracking glittery vampires. By the end, you’ll be able to use Clojure, one of the most exciting and fun programming languages in existence! How This Book Is Organized This book is split into three parts to better guide you through your valiant quest, brave fledgling Clojurist. Part I: Environment Setup To stay motivated and learn efficiently, you need to actually write code and build executables. These chapters take you on a quick tour of the tools you’ll need to easily write programs. That way you can focus on learning Clojure, not fiddling with your environment. - Chapter 1: Building, Running, and the REPL - There’s something powerful and motivating about getting a real program running. Once you can do that, you’re free to experiment, and you can actually share your work! - In this short chapter, you’ll invest a small amount of time to become familiar with a quick way to build and run Clojure programs. You’ll learn how to experiment with code in a running Clojure process using a read-eval-print loop (REPL). This will tighten your feedback loop and help you learn more efficiently. - Chapter 2: How to Use Emacs, an Excellent Clojure Editor - A quick feedback loop is crucial for learning. In this chapter, I cover Emacs from the ground up to guarantee you have an efficient Emacs/Clojure workflow. Part II: Language Fundamentals These chapters give you a solid foundation on which to continue learning Clojure. You’ll start by learning Clojure’s basics (syntax, semantics, and data structures) so you can do things. Then you’ll take a step back to examine Clojure’s most used functions in detail and learn how to solve problems with them using the functional programming mindset. - Chapter 3: Do Things: A Clojure Crash Course - This is where you’ll start to really dig into Clojure. It’s also where you’ll need to close your windows because you’ll start shouting, “HOLY MOLEY THAT’S SPIFFY!” at the top of your lungs and won’t stop until you’ve hit this book’s index. - You’ve undoubtedly heard of Clojure’s awesome concurrency support and other stupendous features, but Clojure’s most salient characteristic is that it is a Lisp. You’ll explore this Lisp core, which is composed of two parts: functions and data. - Chapter 4: Core Functions in Depth - In this chapter, you’ll learn about a couple of Clojure’s underlying concepts. This will give you the grounding you need to read the documentation for functions you haven’t used before and to understand what’s happening when you try them. - You’ll also see usage examples of the functions you’ll be reaching for the most. This will give you a solid foundation for writing your own code and for reading and learning from other people’s projects. And remember how I mentioned tracking glittery vampires? You’ll do that in this chapter (unless you already do it in your spare time). - Chapter 5: Functional Programming - In this chapter, you’ll take your concrete experience with functions and data structures and integrate it with a new mindset: the functional programming mindset. You’ll show off your knowledge by constructing the hottest new game that’s sweeping the nation: Peg Thing! - Chapter 6: Organizing Your Project: A Librarian’s Tale - This chapter explains what namespaces are and how to use them to organize your code. I don’t want to give away too much, but it also involves an international cheese thief. - Chapter 7: Clojure Alchemy: Reading, Evaluation, and Macros - In this chapter, we’ll take a step back and describe how Clojure runs your code. This will give you the conceptual structure you need to truly understand how Clojure works and how it’s different from other, non-Lisp languages. With this structure in place, I’ll introduce the macro, one of the most powerful tools in existence. - Chapter 8: Writing Macros - This chapter thoroughly examines how to write macros, starting with basic examples and advancing in complexity. You’ll close by donning your make-believe cap, pretending that you run an online potion store and using macros to validate customer orders. Part III: Advanced Topics These chapters cover Clojure’s extra-fun topics: concurrency, Java interop, and abstraction. Although you can write programs without understanding these tools and concepts, they’re intellectually rewarding and give you tremendous power as a programmer. One of the reasons people say that learning Clojure makes you a better programmer is that it makes the concepts covered in these chapters easy to understand and practical to use. - Chapter 9: The Sacred Art of Concurrent and Parallel Programming - In this chapter, you’ll learn what concurrency and parallelism are and why they matter. You’ll learn about the challenges you’ll face when writing parallel programs and about how Clojure’s design helps to mitigate them. You’ll use futures, delays, and promises to safely write parallel programs. - Chapter 10: Clojure Metaphysics: Atoms, Refs, Vars, and Cuddle Zombies - This chapter goes into great detail about Clojure’s approach to managing state and how that simplifies concurrent programming. You’ll learn how to use atoms, refs, and vars, three constructs for managing state, and you’ll learn how to do stateless parallel computation with pmap. And there will be cuddle zombies. - Chapter 11: Mastering Concurrent Processes with core.async - In this chapter, you’ll ponder the idea that everything in the universe is a hot dog vending machine. By which I mean you’ll learn how to model systems of independently running processes that communicate with each other over channels using the core.async library. - Chapter 12: Working with the JVM - This chapter is like a cross between a phrase book and cultural introduction to the Land of Java. It gives you an overview of what the JVM is, how it runs programs, and how to compile programs for it. It also gives you a brief tour of frequently used Java classes and methods, and explains how to interact with them from Clojure. More than that, it shows you how to think about and understand Java so you can incorporate any Java library into your Clojure program. - Chapter 13: Creating and Extending Abstractions with Multimethods, Protocols, and Records - In Chapter 4 you learn that Clojure is written in terms of abstractions. This chapter serves as an introduction to the world of creating and implementing your own abstractions. You’ll learn the basics of multimethods, protocols, and records. - Appendix A: Building and Developing with Leiningen - This appendix clarifies some of the finer points of working with Leiningen, like what Maven is and how to figure out the version numbers of Java libraries so that you can use them. - Appendix B: Boot, the Fancy Clojure Build Framework - Boot is an alternative to Leiningen that provides the same functionally, but with the added bonus that it’s easier to extend and write composable tasks. This appendix explains Boot’s underlying concepts and guides you through writing your first tasks. The Code You can download all the source code from the book at. The code is organized by chapter. Chapter 1 describes the different ways that you can run Clojure code, including how to use a REPL. I recommend running most of the examples in the REPL as you encounter them, especially in Chapters 3 through 8. This will help you get used to writing and understanding Lisp code, and it will help you retain everything you’re learning. But for the examples that are long, it’s best to write your code to a file, and then run the code you wrote in a REPL. The Journey Begins! Are you ready, brave reader? Are you ready to meet your true destiny? Grab your best pair of parentheses: you’re about to embark on the journey of a lifetime!
https://www.braveclojure.com/introduction/
CC-MAIN-2019-04
refinedweb
1,656
60.65
Cast an array to some arrays I would like to expand a Ruby array (which may contain some subarrays) into another array of arrays like in these examples: Example 1: [:foo, :bar] [ [:foo, :bar] ] Example 2: [:foo, :bar, [:ki, :ku]] [ [:foo, :bar, :ki], [:foo, :bar, :ku] ] Example 3: [:foo, :bar, :baz, [:a, :i, :u, :e, :o], :qux] [ [:foo, :bar, :baz, :a, :qux], [:foo, :bar, :baz, :i, :qux], [:foo, :bar, :baz, :u, :qux], [:foo, :bar, :baz, :e, :qux], [:foo, :bar, :baz, :o, :qux] ] Example 4: [:foo, :bar, :baz, [:a, :i, :u, :e, :o], [1, 2], :qux] [ [:foo, :bar, :baz, :a, 1, :qux], [:foo, :bar, :baz, :i, 1, :qux], [:foo, :bar, :baz, :u, 1, :qux], [:foo, :bar, :baz, :e, 1, :qux], [:foo, :bar, :baz, :o, 1, :qux], [:foo, :bar, :baz, :a, 2, :qux], [:foo, :bar, :baz, :i, 2, :qux], [:foo, :bar, :baz, :u, 2, :qux], [:foo, :bar, :baz, :e, 2, :qux], [:foo, :bar, :baz, :o, 2, :qux] ] Example 5: [:foo, [[], :c], :bar] [ [:foo, [], :bar], [:foo, :c, :bar] ] Example 6: [:foo, [[:a, :b], :c], :bar] [ [:foo, [:a, :b], :bar], [:foo, :c, :bar] ] Note. Only subarrays need to be expanded. Therefore, in examples 5 and 6, the sub-arrays are not expanded. Thanks a lot for any suggestions or piece of code. source to share I used an idea product to achieve this functionality: def trans(a) b = a.map{|e| [e].flatten(1)} b.first.product(*b.slice(1..-1)) end For example, this code: puts trans([:foo, :bar]).inspect puts trans([:foo, :bar, :baz, [:a, :i, :u, :e, :o], [1, 2], :qux]).inspect puts trans([:foo, [[], :c], :bar]).inspect puts trans([:foo, [[:a, :b], :c], :bar]).inspect Gives the following: [[:foo, :bar]] [[:foo, :bar, :baz, :a, 1, :qux], [:foo, :bar, :baz, :a, 2, :qux], [:foo, :bar, :baz, :i, 1, :qux], [:foo, :bar, :baz, :i, 2, :qux], [:foo, :bar, :baz, :u, 1, :qux], [:foo, :bar, :baz, :u, 2, :qux], [:foo, :bar, :baz, :e, 1, :qux], [:foo, :bar, :baz, :e, 2, :qux], [:foo, :bar, :baz, :o, 1, :qux], [:foo, :bar, :baz, :o, 2, :qux]] [[:foo, [], :bar], [:foo, :c, :bar]] [[:foo, [:a, :b], :bar], [:foo, :c, :bar]] EDIT: Explanation of the above code. The general idea is that we want to get the product of all the elements in the array. If you look at the Array # product documentation , you can see that it does what you want - we just need to name it appropriately. First, it product works with arrays, so we have to make sure that all the elements in our original array are the array itself. This is the task of the first line of the function: b = a.map{|e| [e].flatten(1)} We will convert all elements to an array using map . The transformation makes an array with an element e inside and then aligns that new array. Either the original element was an array, or it was not; if it was not an array, [e].flatten(1) it will do nothing and return [e] ; if it was an array, it [e] will evaluate to [[x]] , which will then be flattened to [x] . 1 tells you flatten to go only 1 depth level. Then we only need to call product for the first element passing the remaining elements of the modified array as an argument: b.first.product(*b.slice(1..-1)) Here b.slice(1..-1) means: take elements from b, starting from the second to the last. Finally, the asterisk indicates that we do not want to pass the array as an argument, but instead the elements of the array. source to share You seem to want to have the Cartesian product of the elements of the array in question. This code should work for you: array = [:foo, :bar, :baz, [:a, :i, :u, :e, :o], [1, 2], :qux] array.inject([[]]) do |product,element| result = [] if element.is_a?(Array) product.each do |tuple| element.each do |last| result << tuple + [last] end end else product.each do |tuple| result << tuple + [element] end end result end You can simplify it a bit by moving the conditional expression into a loop, but this will make it less efficient. source to share Given that you are using examples and not something explicit, I suggest having a trawl through the Array documentation . To get started, consider the following methods: .combination.to_a .shift .transpose .flatten .zip .take How you implement depends on whether you know what you are transforming in each case, or if you are trying to create something in common (ie extend the Array class. For each, I will manipulate the input array into the target array. Example 1 is simple: input = [:foo,:bar] target = Array.new target << input => [[:foo,:bar]] In the rest of the examples, there are several ways to get there, depending on what you are trying to do and how you want the ruby to know what to do when the entrance is presented. In example 2, the first is to write directly: input = [:foo, :bar, [:ki, :ku]] target = Array.new target << [input[0], input[1], input[2][0]] target << [input[0], input[1], input[2][1]] Or playing with array methods: target = input.pop target = [input, input].zip(target).flatten target = [target[0..(target.size/2)-1], target[target.size/2..-1]] Or, if you don't know which part of the array contains the submatrix, you can detect it: input.each do |i| if i.class == Array holding = i end end It really depends on how you want to identify and manipulate the array! source to share
https://daily-blog.netlify.app/questions/1891264/index.html
CC-MAIN-2021-43
refinedweb
920
68.4
Asked by: How to add click event handler to Custom User Control Question Hello. I want to know how I can add an event such as Button.Click to my custom control so that I can make something happen when it is clicked. I'm rather new to C# and WPF programming so I hope I don't sound too dumb.. Any help is appreciated. (Request clarification if needed.) I am making a TestButton class to see how hard events are to handle. Can someone tell me how to add a .Click event? Tuesday, November 24, 2020 6:03 PM - Edited by Alexander125 Tuesday, November 24, 2020 6:19 PM - Moved by Jack J JunMicrosoft contingent staff Friday, November 27, 2020 6:41 AM All replies Hello, See the following where the RoutedEventHandler is specified as. My GitHub code samples GitHub page Check out: the new Microsoft Q&A forumsTuesday, November 24, 2020 9:02 PM This didn't really help. At least the stackoverflow link didn't... It showed how to add a button with a click event I think. I want to know how to add a click event, or other event, (like TextChanged) to my actual UserControl.Tuesday, November 24, 2020 9:31 PM So, I got this code to work: public class MyButton : Button { // Create a custom routed event by first registering a RoutedEventID // This event uses the bubbling routing strategy public static readonly RoutedEvent TapEvent = EventManager.RegisterRoutedEvent( "Tap", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MyButton)); //Button is clicked protected override void OnClick() { RaiseTapEvent(); } But when I change the "MyButton : Button" to "MyButton : UserControl", run the program and click the object, it does nothing.Wednesday, November 25, 2020 2:13 AM Hi Alexander125, For questions about WPF, I suggest you ask the question on the Microsoft Q&A forum and you can get more professional answer. Thank you for your understanding. Best Regards, Daniel Zhang "Visual c#" forum will be migrating to a new home on Microsoft Q&A ! We invite you to post new questions in the "Developing Universal Windows apps" forum’s new home on Microsoft Q&A ! For more information, please refer to the sticky post.Wednesday, November 25, 2020 8:46 AM Thank you.Wednesday, November 25, 2020 6:01 PM
https://social.microsoft.com/Forums/en-US/e592211a-dad6-4bb9-a85a-11234089073e/how-to-add-click-event-handler-to-custom-user-control?forum=Offtopic
CC-MAIN-2022-33
refinedweb
378
64.41
13 December 2007 11:12 [Source: ICIS news] SHANGHAI (ICIS news)--Quanzhou Quangang Ocean Polystyrene Resin Co (Quanzhou Ocean) expects to restart its 120,000 tonne/year polystyrene (PS) plant in March 2008, an official said on Thursday. ?xml:namespace> Market players do not expect the PS unit will run at high operating rates because of falling PS demand growth in ?xml:namespace> The PS plant, located in the southern city of Quanzhou, had been offline due to profitability issues since the third quarter of 2006 before it was put up for auction on 23 August. Founder Group acquired the plant and Quanzhou Ocean Chemical Harbor Co, another Shantou Ocean Enterprises Group (SOE Group) company, for a combined total of yuan (CNY) 350m ($47m). SOE used to own another PS producer called Shantou Ocean First Polystyrene Resin Co ( The two PS enterprises had a combined capacity of 270,000 tonnes/year. (
http://www.icis.com/Articles/2007/12/13/9086474/quanzhou-ocean-to-restart-ps-plant-in-march-2008.html
CC-MAIN-2014-52
refinedweb
151
59.37
Win extra savings between Sept.12-30! Medium Size 3.5 channel metal rc Helicopter Discount Free Inspection 200 Pieces (Min. Order) 3.5 Channel RC Toy Helicopter Metal Structure Helicopter with GYRO US $0.01-99 / Piece 1000 Pieces (Min. Order) 2016 Hot product interesting infrared alloy 3.5 channel rc helicopter Discount Free Inspection US $9.98-10.4 / Piece 24 Pieces (Min. Order) Most popular 4 channel fuselage battery mini rc toy helicopter Discount Free Inspection US $11.62-12.82 / Box 24 Boxes (Min. Order) Hot selling long flight time 3.5 channel rc helicopter for sale Discount Free Inspection US $21-22 / Piece 10 Cartons (Min. Order) 3.5 channel rc helicopter toys wholesale Discount Free Inspection US $10.25-13.75 / Piece 36 Pieces (Min. Order) Hot sales 3.5 channel alloy RC helicopter with GYR with remote control function and light/All reports passed Discount Free Inspection US $9.6-10.6 / Piece 500 Pieces (Min. Order) 3.5 Channel rc helicopter with gyroscope for sale Discount Free Inspection 1 Carton (Min. Order) LS-309 IR with gyro 3.5 Channel RC Helicopter Discount Free Inspection 5 Cartons (Min. Order) 2015 Hot selling 3.5 channel propel rc helicopter for kids/control helicopter Discount Free Inspection US $5-13 / Piece 1 Piece (Min. Order) 3.5 channel rc alloy model helicopter for ages 8+ Discount Free Inspection US $10.139-10.488 / Piece 48 Pieces (Min. Order) RC Helicopter M3 3.5 Channel Mini Indoor Co-Axial Metal Remote Control Helicopter w/ Built in Gyroscope Discount Free Inspection US $5-9 / Unit 1 Unit (Min. Order) wholesale 3.5 channel gyro cyclone mini rc helicopter on sale Discount Free Inspection US $38.9-42 / Box 54 Boxes (Min. Order) 2015 christmas best gifts for boys 3.5 channel rc helicopter US $35.0-35.0 / Piece | Buy Now 1 Piece (Min. Order) Small waterproof rechargeable 2.4G 3.5 channel hobby model toy rc helicopter Discount Free Inspection US $13.67-19.33 / Piece 1500 Pieces (Min. Order) 3.5 channel rc toy rc rescue helicopter & rc ufo US $17.04-17.50 / Piece 5 Cartons (Min. Order) S6 3.5 channel rc helicopter RC super Mini helicopter with GYRO remote control toys 30pcs Discount Free Inspection US $11.84-12.47 / Piece 1 Piece (Min. Order) New design 3.5 channel RC Helicopter with GYRO Discount Free Inspection US $15-20 / Box 10 Cartons (Min. Order) 2016 new mini helicopter kids airplane toys RC 3.5 channel rc helicopter super gyro helicopter US $8.09-8.09 / Piece | Buy Now 48 Pieces (Min. Order) R21826 24CM 2.4G 3.5 Channel RC Simulation Console Helicopter Used Helicopter For Sale Discount Free Inspection US $13.9-16.9 / Piece 4 Pieces (Min. Order) Radio and gyro 3.5 channel alloy series rc helicopter US $15.20-24.15 / Piece 5 Cartons (Min. Order) Amazing Arrow Helicopter GW-S977,3.5 Channel Remote Control RC Helicopter with Camera Discount Free Inspection US $19.17-21 / Piece 1 Piece (Min. Order) 3.5 Channel Metal Flashing RC Hobby Helicopter Discount Free Inspection 5 Cartons (Min. Order) USA Rescue Medical Helicpter RC Model ERC-cf0208 3.5 channel Remote Control Helicopter Discount Free Inspection US $5-10 / Piece 100 Pieces (Min. Order) UDI Toy U12A 3.5 Channel 2.4g RC Helicopter With Camera ,Large Alloy RC Helicopter RTF Discount Free Inspection 1 Piece (Min. Order) Best selling syma small size mini 3.5 channel rc helicopter Discount Free Inspection US $11.35-13.61 / Set 1 Set (Min. Order) Radio Control Rc helicopter 3.5 channel toys for kids US $8.8-9.8 / Piece 1 Piece (Min. Order) import toys from china 3.5 channel Alloy rc helicopter 2013 hot summer toys helicopters toy for adult US $1-18.00 / Piece 1 Carton (Min. Order) 3.5 channel gravity rc helicopter with protection panel RC8135577-3A US $16.45-16.45 / Piece | Buy Now 32 Pieces (Min. Order) T-Smart unbreakable rc helicopter for kids 3.5 channel mini infrared control helicopter Discount Free Inspection US $1-11 / Piece 5 Cartons (Min. Order) 1.68m 3.5 Channel RC Wireless Control King QS8008 Helicopter US $66-77 / Piece 15 Pieces (Min. Order) New metal 3.5 channel infrared control long flight time rc helicopter Discount Free Inspection US $7.39-7.49 / Piece 36 Pieces (Min. Order) remote control helicopter china drone 3.5 channel rc helicopter US $17-19 / Piece 2000 Pieces (Min. Order) 3.5 Channel 2.4G Infrared Gyroscope Semi-micro RC Helicopter Yellow Discount Free Inspection US $7.4-9.7 / Piece 1 Piece (Min. Order) 3.5 channel rc ah-64 apache helicopter 8 Pieces (Min. Order) Syma S107W 3.5 Channel RC Helicopter with Gyro Helicopter Toy US $10.56-14.3 / Set 1 Set (Min. Order) Aircraft engine 3.5 channel alloy series rc helicopter price with 2 speed modes Discount Free Inspection US $25-27.5 / Piece 1 Piece (Min. Order) SJ320 44cm 1100mah 3.5 channel rc petrol helicopter with gyro led light HY0069646 Discount Free Inspection US $0-500 / Piece 12 Pieces (Min. Order) Extreme- 3.5 channel Rc Helicopter Durable High Speed US $20-30 / Piece 12 Pieces (Min. Order) AliSourcePro Haven't found the right supplier yet ? Let matching verified suppliers find you. Get Quotation NowFREE Do you want to show 3.5 channel rc helicopter or other products of your own company? Display your Products FREE now! Related Category Product Features Supplier Features Supplier Types Recommendation for you related suppliers related Guide Trade tools
http://www.alibaba.com/showroom/3.5-channel-rc-helicopter.html
CC-MAIN-2016-36
refinedweb
943
63.15
Parse out testing_done field from commit messages Review Request #9890 — Created April 24, 2018 and updated Previously, one had to manually add comments in the testing done section online for any testing they did for a given patch. However, now if one was to post something with "Testing done:"in the commit message it will split that out into the Testing Done section when posting. Ran unit tests. Created a test repository on a local server and posted the following review requests testing cases with: 1. Summary, Description and Testing Done 2. Summary and Description With a previous Summary, Description and Testing Done: 1. Update Summary 2. Update Description 3. Update Testing Done With a previous Summary and Description (no Testing Done): 1. Add Testing Done Testing different ways of 'Testing Done' inputs: 1. 'testing done' 2. 'testing done:' 3. 'Testing done' 4. 'Testing done:' 5. 'testing Done' 6. 'testing Done:' 7. 'tEstIng DOnE:' Summary suggestion: "Parse out testing_done field from commit messages" Can you re-flow this as: result = { 'key': 'value', } How about: "Determine if the commit message contains testing done information." You can add: only_testing_done = i == 1 and remove the computation for it below. This will be a cheaper computation. We will also need to set it to False before in the elsestatement. Comments should never have first-person statements. They are not the justification for your changes -- the commit message is. You can explain something is, but not why something changed. An explanation of why something changed doesn't make sense when you're looking at a file -- it only makes sense when you're looking at the commit as a whole. And when you're doing that, you can read the commit message for justification. These sorts of comments are unnecessary because they can be inferred from the if statements. Comments should be full sentences: they should begin with a capital letter and end with a period. Missing module-level docstring. Docstring should be of the format: "Unit tests for rbtools.clients.SCMClient" Docstring should be of the form """Testing SCMClient.get_commit_message when ...""" If it goes over 79 characters and wraps, the trailing """should be on its own line. Same below. ALL_CAPSis reserved for module-level and class-level constants. This would be fine as commit_message Single triple-quotes ( '''). Double quotes are reserved for docstrings only. Same below. Only module-level and class-level constnats should be ALL_CAPS. This is fine as commit_message. We're using these immediately, so I don't know that this is necessary. Same below. We are doing this in every test. We can do: def setUp(self): super(SCMBaseClientTests, self).setUp() self.client = SCMClient() and use self.clientin all the tests. We like to keep all common set-up / teardown logic in these methods. See unittest.TestCase docs for information about setUp, etc. Instead of this, how about: self.assertEqual( client.get_commit_message([]), { 'summary': lines[0], 'description': '', 'testing_done': lines[3], }) That way we test all three at once and test that there are no other keys returned. Same below. Is this still a todo? Undo this. "summary, description, or testing done" instead of saying the field names over again, how about: "override the options for each guessed field" (in lieu of "get the ... options") Leftover debugging? :) We're doing this thrice, so we should probably refactor this into a method. "Return" over get. Can you add args/ returns to this docstring? On second thought, you may want to hold off on these docstring changes since I believe David has a pending change that updates all docstrings in RBTools to bring them up to spec. Once that lands, you can rebase off of it. ``summary``, ``description``, and ``testing_done`` :py:class:`difflib.SequenceMatcher` :py:class:`Score` I assume {field}_pairis a tuple, so can we do: summary_score = SequenceMatcher(None, *summary_pair).ratio() description_score = SequenceMatcher(None, *description_pair).ratio() testing_done_score = SequenceMatcher(None, *testing_done_pair).ratio() Ideally, we could also do this in a dict comprehension and splat into the Scoreintializer: raw_scores = { field_name: SequenceMatcher(None, *field_pair).ratio() for field_name, field_pair in ( ('summary_score', summary_pair), ('description_score', description_pair), ('testing_done_score', testing_done_pair), ) } return Score(**raw_scores) This needs to be updated with args, returns, etc but needs to be based of David's docstring change. Leftover testing code? :) Can we format this as: result = { 'summary': lines[0], 'description': b'', 'testing_done': b'', } Blnank line between these. This comment is redundant. This needs to be in the if r.match(line)block above. Instead of doing .strip() on each line, how about we remove those calls and do: return { key: value.strip() for key, value in six.iteritems(result) } Module docstrings need to be first, e.g. """Unit tests for rbtools.clients.SCMClient.""" from __future__ import unicode_literals # .... Mind adding a comment same as above to indicate what this is doing? Also those comments are missing periods, could you add them? No blank line here. Leftover debugging? Docstring summaries should be written in the imperitive mood (i.e., they give an order or command). In this case, it would be "Check" over "Checks", e.g. Check if the guess value for a given field is True or False However, we could also write this as: Determine whether or not we should guess a given field. Also missing args/returns. Can you revert changes to this file? See my comment in rbtools/utils/review_request.pyfor the reasoning. Can you revert the changes to this file? I don't think we want to match on testing done, since a LOT of changes have "ran unit tests" as testing done, we would get lots of false positives. Can you write your testing done without "I" statements, e.g. "Ran unit tests." "Created a test repository..." "is description and [i:] is testing done" This is unnecessary with the above assignment. We are doing this when we assign resultabove. WIth the above comment, this would be elif not summary Docstrings should be in the following format: """Single line summary. Multi-line description. """ This can just be """Unit tests for rbtools.clients.SCMClient.""" unicode. Missing type: bool bool Instead of enumerating all these cases, how about: if guess_summary: self.options.summary = guessed_summary if guess_description: if not guess_summary: # If we're guessing the description but not the summary # (for example, if --summary was included), we probably # don't want to strip off the summary line of the # commit message. if guessed_description.startswith(guessed_summary): self.options.description = guessed_description else: self.options.description = \ guessed_summary + '\n\n' + guessed_description else: self.options.description = guessed_description if guess_testing_done: self.options.testing_done = guessed_testing_done Can you revert all changes to this file? git checkout master -- rbtools/utils/match_score.py Can you revert all changes to this file? git checkout master -- rbtools/utils/review_request.py Just two comments. This is looking really good! :) We can optimize this to only check for a testing done when we have a description. We also don't need to enumerate all cases if we do the work of parsing out the testing done when we find it. if len(lines) >= 3 and lines[0] and not lines[1]: # We have a description. This may also contain a testing done. description = lines[2:] for i, line in enumerate(description): if r.match(line): result['testing_done'] = '\n'.join(description[i:]) description = description[:i - 1] result['description'] = '\n'.join(description) This code will be a lot easier to follow and understand. Why is this lines[0:]now? This used to be lines[1:]. As it stands, idoesn't match up with the actual line number so tests should be failing. # We have a clear "Summary\n\nDescription"-style commit message so we can split out the description. What if len(lines) == 2and lines[1]is not empty, e.g. This is a summary this is a description This should end up with result = { 'description': "This is a summary.\nThis is a description.', 'summary': 'This is a summary.', 'testing_done': '', } Commends should be a full sentence, beginning with a capital letter and ending with a period. # We do not have a clear "Summary\n\nDescription"-style commit message so we assume everyting is the description. What about the case of a commit message like: Testing done: foo What happens in the case of a commit message like: A commit message Testing done: Testing done: I did tests Your code below does enumerateon description. However, it is a blank string in the case where we only have summary and our loop expects a list! I suggest we do description = []here and do the following on lines 298--304: if description: for i, line in enumerate(description): if r.match(line): # ... break result['description'] = '\n'.join(description) This way we skip the case where description is a We should breakhere. "a summary." I know I suggested the max()solution, but let's make this more clear by doing the following: if i == 0: # The entire description is the testing done, so # the resulting description will be empty. description = [] else: description = description[:i - 1] ,after description Re-flow these to take full advantage of the 79 character limit. Let's call this field_value "Whether or not we are posting a new review request." Whether or not the given field should be guessed. Since this method is being modified with new results, the documentation should be updated to use the modern docstring format. You'd need to make the following changes: - Change "Returns" to "Return" in the summary (we're moving to that style everywhere else). - Add an "Args" section detailing what revisionsis. - Add a "Returns" section detailing what's in the dictionary and what string types to expect. See I don't believe b''is correct. We're working with Unicode strings everywhere else, and setting them when we set result['description']below. This should go in the second ifblock below, instead of pass. We don't need to default it to anything above. I'd rather we explicitly strip as we set above, and just return resulthere. That way, we're not doing any unnecessary rebuilding of a dictionary, and we're very clear with what's going into it. These should all be test_get_commit_message_with_.... The get_part is missing from the test names. The dedenting and alignment and everything makes this a bit less ideal for readability. Can you change all these to this form: commit_message = ( b'This is the summary.\n' b'\n' b'Testing Done:\n' b'....\n' ) That may seem more "noisy" (the bprefixes and \n), but with unit tests it's very important to clearly see the data you're working with, and so it's an advantage in this case. We know where every newline is and where the start of every line is, and code doesn't start to run into other code below it due to the indentation. Can you compare against the explicit strings we're expecting? That helps with readability and prevents issues down the road as logic changes. This comment applies to all tests. There's an alignment issue here. It's also lacking the extended_helpfrom the other --guess-*flags. -greally should be implying all the guess options. It's better to start with a "truthy" version first, inversing this if/else. So: if guess_summary: ... else: ... Can you change this to do: '%s\n\n%s' % (guessed_summary, guessed_description) You seem to have posted two changes here. Can we reword this as: The first line of the commit messages of the given revisions will be used as the summary. Can we also mention this will attempt to find a Testing Done section? Can we reformat this as: result['testing_done'] = \ '\n'.join(description[i + 1:]).strip()
https://reviews.reviewboard.org/r/9890/
CC-MAIN-2018-34
refinedweb
1,929
60.01
At times the user may want to set up a test that verify that the actual value differs from the expected value. The tester supports this version of tests with the checkFail method. It works for the primitive types, the wrapper classes, the user defined types, as well as traversals and maps. checkFail Here is a simple example of its use: public class Song{ protected String title; private int time; // the playing time public Song(String title, int time){ this.title=title; this.time=time; } // Produce a new song with the same title, but decreased time public Song changedTime(int dec){ return new Song(this.title, this.time - dec; } } // Tests: class Examples{ Song song1 = new Song("title1", 4); Song song2 = new Song("title2", 2); public void testMethods(Tester t){ // make sure the time has been changed... t.checkFail(song1.changedTime(2), song1); }} A similar variant can be used to verify that an inexact comparison fails. The method checkInexactFail works for the prinitive types, the wrapper classes, the user defined types, as well as traversals and maps. checkInexactFail Caution: The test checkInexact fails whe the two values involved in the comparison are of the primitive types or are instances of wrapper classes that represent exact values (i.e. whole numbers, characters, boolean values, and bytes). As the results, the corresponding checkInexactFail test will succeed. checkInexact Here are examples of its use: // test should succeed: t.checkInexact(123000.0, 128000.0, 0.1); // test should fail: t.checkInexactFail(123000.0, 128000.0, 0.1); // test should fail: t.checkInexact(143000.0, 128000.0, 0.1); // test should succeed: t.checkInexactFail(143000.0, 128000.0, 0.1); // test should fail (comparing exact values): t.checkInexact(123000, 128000, 0.1); // test should succeed (comparing exact values): t.checkInexactFail(123000, 128000, 0.1); The last two cases will produce the messages: Attempt to make inexact comparison of exact primitive or wrapper data. and Test failed because we cannot make inexact comparison of exact primitive or wrapper data. Tests for checkFail variant are included with user types tests. Here is the source code for this test suite. You can also download the entire souce code as a zip file. Complete test results are shown here. Tests for checkInexactFail variant are included with inexact values tests.
http://www.ccs.neu.edu/javalib/Tester/UsersGuide/CheckFail.html
crawl-003
refinedweb
379
58.38
Opened 14 years ago Closed 14 years ago Last modified 14 years ago #2786 closed defect (fixed) TIFF SetMetadata corrupts XML string Description Attached are two files containing what was written to TIFF using SetMetadata, and the metadata read back from the tiff. The returned metadata in the metadata domain, <Metadata domain="xml:ESRI" format="xml">, is no longer a valid XML string. It's not clear when the XML is changed, before it's written to TIFF, or before it's returned from tiff driver. Attachments (3) Change History (8) comment:1 by , 14 years ago comment:2 by , 14 years ago Frank, I am using GDAL 1.6.0. However I did have a minor local fix, which added ! in front of EQUAL. Otherwise the metadata are not saved. CPLErr GTiffDataset::SetMetadata( char papszMD, const char *pszDomain ) { bMetadataChanged = TRUE; return oGTiffMDMD.SetMetadata( papszMD, pszDomain ); } comment:3 by , 14 years ago I have confirmed the original bug, using the following mechanism: #include "gdal_priv.h" int main() { char *apszMD[2] = { "<GeodataXform xsi:type=\"typens:PolynomialXform\" xmlns:xsi=\"\" xmlns:xs=\"\" xmlns:typens=\"\"> <PolynomialOrder>2</PolynomialOrder> </GeodataXform>", NULL }; GDALAllRegister(); GDALDataset *poDS = (GDALDataset *) GDALOpen("wrk.tif",GA_Update); poDS->SetMetadata( apszMD, "xml:ESRI" ); GDALClose( (GDALDatasetH) poDS ); } The problem seems to be missing support for the special xml: domain prefix in the GeoTIFF driver. There are also issues with the geotiff driver's _temporary_ tests which I will fix. comment:4 by , 14 years ago I have corrected the GeoTIFF driver to support the special handling of xml: domain metadata in trunk (r16147) and 1.6 branch (r16148). I have also added testing for this in autotest (r16150). Unfortunately, the xml metadata in any previously produced files will be corrupt. I have also ported a small variation on this into 1.5 branch (r16161). comment:5 by , 14 years ago I have confirmed that the fix solved the problem. Gao, The TIFF file is rather badly corrupted in the metadata tag. I have been unable to reproduce a similar problem writing out metadata. I used the following script with trunk, 1.5, and 1.4 branches. Can you indicate what version the file was generated with?
https://trac.osgeo.org/gdal/ticket/2786
CC-MAIN-2022-40
refinedweb
361
57.67
On Wed, Jul 28, 2021 at 11:11:30AM -1000, Richard Henderson wrote: > On 7/28/21 10:37 AM, Peter Xu wrote: > > A quick fix attached; would that work for us? > > Looks plausible, though perhaps just as easy to list the 5 platforms as just > the one: > > #if defined(__linux__) && \ > (defined(HOST_X86_64) || \ > defined(HOST_S390X) || \ > ...) > # define HAVE_KVM > #endif That looks good to me, especially for the long term to identify whether kvm is with us, but for the short-term I hope I can still use the (literally :) simpler patch as attached so hopefully that'll be more welcomed as rc2+ material.. Note again that the kvm.h inclusion is only for kvm dirty ring test in migration-test so far, meanwhile that's only supported on x86_64, so we won't lose anything on the rest 4 archs. Thanks! -- Peter Xu
https://lists.gnu.org/archive/html/qemu-devel/2021-07/msg06864.html
CC-MAIN-2021-43
refinedweb
142
70.87
In this example, we are going to create a method which will do the followings:- - Extract unique characters from two strings then group them into two separate lists. - Create a new list consists of the characters in those two lists. The character within the list must only appear once and only consists of lowercase a-z characters. Below is the solution. - Create two lists with non-repeated characters from the given two strings. - Loop through all the lowercase characters (from a-z) and if this character appears within any of those two lists then appends them to a new character list. - Turn that new list into a string and then returns that new string. import string def longest(s1, s2): s1 = list(set(s1)) s2 = list(set(s2)) s3 = [] for character in string.ascii_lowercase: if character in s1 or character in s2: s3.append(character) return ''.join(s3) We will use the string module ascii_lowercase list property to save all the typing we need in order to create the lowercase letters list. Homework : Create a new string which only consists of non-repeated digits in the ascending order from two given strings. For example, s1 = “agy569” and s2 = “gyou5370” will produce s3 = “035679”. Write your solution in the comment box below this article. Do you finish the homework all by your own? Please follow and like us: 1 Comment You can use set operations to solve this as a one-liner: def solve(s1, s2, whitelist): return ”.join(sorted((set(s1) | set(s2)) & set(whitelist)))
https://kibiwebgeek.com/combine-two-strings-with-python-method/
CC-MAIN-2021-04
refinedweb
255
65.01
Ruby Array Exercises: Check whether 7 appears as either the first or last element in a given array Ruby Array: Exercise-2 with Solution Write a Ruby program to check whether 7 appears as either the first or last element in a given array. The array length must be 1 or more. Ruby Code: def check_array(nums) return (nums[0] == 7 || nums[nums.length-1] == 7) end print check_array([1, 2, 7]),"\n" print check_array([7, 1, 2, 3]),"\n" print check_array([14, 7, 1, 2, 3]) Output: true true false Flowchart: Ruby Code Editor: Contribute your code and comments through Disqus. Previous: Write a Ruby program to check if a value exists in an array. Next: Write a Ruby program to pick number of random
https://www.w3resource.com/ruby-exercises/array/ruby-array-exercise-2.php
CC-MAIN-2021-21
refinedweb
126
60.45
ExtUtils::MakeMaker::Tutorial - Writing a module with MakeMaker use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Your::Module', VERSION_FROM => 'lib/Your/Module.pm' ); This is a short tutorial on writing a simple module with MakeMaker. It's When you run Makefile.PL, it makes a Makefile. That's the whole point of MakeMaker. The Makefile.PL is a simple program which loads ExtUtils::MakeMaker and runs the WriteMakefile() function to generate a Makefile.. A simple listing of all the files in your distribution. Makefile.PL MANIFEST lib/Your/Module.pm File paths in a MANIFEST always use Unix conventions (ie. /) even if you're not on Unix. You can write this by hand or generate it with 'make manifest'. See ExtUtils::Manifest for more details. This is the directory where the .pm and .pod files you wish to have installed go. They are laid out according to namespace. So Foo::Bar is lib/Foo/Bar.pm.. Instructions on how to install your module along with any dependencies. Suggested information to include here: any extra modules required for use the minimum version of Perl required if only works on certain operating systems A file full of regular expressions to exclude when using 'make manifest' to generate the MANIFEST. These regular expressions are checked against each file path found in the distribution (so you're matching against "t/foo.t" not "foo.t").: ExtUtils::ModuleMaker, Module::Install, PAR
http://search.cpan.org/~yves/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Tutorial.pod
CC-MAIN-2017-43
refinedweb
233
53.07
QTcpServer - different behvaior in debug & release Hi there I'm using a QTcpServer to allow external connections to my program. When using in debug mode, everytime a new client connects, the signal "newConnection" of QTcpServer is called and everything works fine. When using in release mode, the signal is not called and hence clients cannot connect. This is even more surprising that it worked very well in previous release version, and I have not modified the class hosting the QTcpServer. The server class is as follow: @ IPServer::IPServer(){ server = new QTcpServer(); if(!server->listen(QhostAdress::Any, 50869)){ outApp.SendEmail("myEmail@outlook.com", "server did not start"); }else{ outApp.SendEmail("myEmail@outlook.com", "server started"); connect(server, SIGNAL(newConnection()), this, SLOT(NewConnection())); } } @ The slot "NewConnection" is called in debug but not in release. I receive the email "server started" in both debug and release. I'm using Qt 5.5.1 on Windows 7 & Qt Creator with mvsc2013 compiler. Can you provide some help please? Thanks hi This is on the same PC? Its 100% sure its not firewall or scanner related? Hi mrjj Clients and server are not on the same PC. If it was due to the firewall, I assume it would be the same issue in both debug & release? - mrjj Lifetime Qt Champion last edited by mrjj @reezeus said: I mean when u run in release vs debug. same pc? Well the actual exe would be different so say the debug was "accepted" and release not. For some security solutions just the fact that is located in another folder would be enough. Its seems very odd so just asking if u tested with firewall off, just be sure. (NetSh Advfirewall set allprofiles state off) Didn't get it right indeed: yes debug & release are both tested on the same PC. Both versions are in the same directory (the one created by default by Qt): one folder for the debug and one folder for release. Note that the issue arises before I deploy the app, i.e. just by starting the program from within the release folder. I have tried several clean/run qmake/build all. What if u run directly in VS ? I don't think I can run my Qt code in VS, I believe I first need to install the VS plugin for Qt? I've never compiled Qt code with VS, I use Qt only with Qt creator. Yes, same behavior.. Sure, will do this when I have some time. Where should I upload the files? @reezeus There is no upload function here. I use dropbox as it very easy to share. But if sample very small, its fine to post directly. .h file: #ifndef IPSERVER #define IPSERVER #define HEADER_FENSERVEUR #include <QtWidgets> #include <QtNetwork> #include "emailoutlook.h" class IPServer : public QWidget { Q_OBJECT public: IPServer(); void SendToAll(const QString &message); private slots: void NewConnection(); void DataReceived(); void DisconnectClient(); private: EmailOutlook outApp; QTcpServer *server; QList<QTcpSocket *> clients; quint16 sizeMessage; }; #endif // IPSERVER .cpp file: #include "ipserver.h" IPServer::IPServer() { outApp = EmailOutlook(); server = new QTcpServer(this); if (!server->listen(QHostAddress::Any, 50869)) { qDebug() << "Server cound not start" + server->errorString(); } else { qDebug() << "Server has started on port " + QString::number(server->serverPort()) + ". Clients can now connect."; connect(server, SIGNAL(newConnection()), this, SLOT(NewConnection())); } sizeMessage = 0; } void IPServer::NewConnection() { //SendToAll("New Client connected"); QTcpSocket *newClient = server->nextPendingConnection(); clients << newClient; SendToAll("New Client connected"); connect(newClient, SIGNAL(readyRead()), this, SLOT(DataReceived())); connect(newClient, SIGNAL(disconnected()), this, SLOT(DisconnectClient())); } void IPServer::DataReceived() { QTcpSocket *socket = qobject_cast<QTcpSocket *>(sender()); if (socket == 0) return; QDataStream in(socket); if (sizeMessage == 0) { if (socket->bytesAvailable() < (int)sizeof(quint16)) return; in >> sizeMessage; } if (socket->bytesAvailable() < sizeMessage) return; QString message; in >> message; SendToAll(message); sizeMessage = 0; } void IPServer::DisconnectClient() { SendToAll("New client disconnected"); QTcpSocket *socket = qobject_cast<QTcpSocket *>(sender()); if (socket == 0) return; clients.removeOne(socket); socket->deleteLater(); } void IPServer::SendToAll(const QString &message) { QByteArray paquet; QDataStream out(&paquet, QIODevice::WriteOnly); out << (quint16) 0; out << message; out.device()->seek(0); out << (quint16) (paquet.size() - sizeof(quint16)); for (int i = 0; i < clients.size(); i++) { clients[i]->write(paquet); } } The IPServer class is initialized from another class: IPServer *myServer; myServer = new IPServer(); ok. This code can someone else run and see if it can reproduced on other pc? I have recompiled on another PC with Qt version 5.5.0 (still mvsc2013 compiler) and it works fine; debug, release & deployed. It could be. Although it was working fine in previous release with Qt 5.5.1.
https://forum.qt.io/topic/64450/qtcpserver-different-behvaior-in-debug-release/17
CC-MAIN-2020-16
refinedweb
743
58.08
Opened 6 years ago Closed 6 years ago Last modified 6 years ago #26095 closed Cleanup/optimization (wontfix) Same behaviour of dict.items and defaultdict.items in DTL Description Recently I've struggled over the defaultdict-issue mentioned here. In my opinion it may be more intuitive if dictionaries and defaultdicts behave the same (as in plain Python). Change History (9) comment:1 Changed 6 years ago by comment:2 follow-up: 4 Changed 6 years ago by comment:3 Changed 6 years ago by comment:4 Changed 6 years ago by Do you have an idea of how this could be solved without breaking backward compatibility? See #25574 for the discussion that added this mention in the docs. Thank you for the fast reply! I've read about #25574 before but don't see the point about a backward incompatibility. Existing templates should work as before and a key 'items' will still mask the object-method. But defaultdicts don't have to get typecasted to dicts to work like dicts in the DTL anymore. Or do I miss something? comment:5 Changed 6 years ago by I'm concerned the proposed PR with have an adverse effect on performance. Maybe you could see what djangobench has to say. comment:6 Changed 6 years ago by Well, the isinstance()-call is about 4 times slower than the direct access (d[bit] alone takes about 98 ns. (on a dict with a single entry)). %%timeit if isinstance(d, defaultdict): pass res = d[bit] 1000000 loops, best of 3: 378 ns per loop Whether this is a real bottleneck depends how often Variable.resolve gets called and - may be more important - other time consuming parts of the application. Will try djangobench the next days. Thank you for the review so far. comment:7 Changed 6 years ago by In #django-dev, FunkyBob says, "My rule is - never pass defaultdict to a template. In the [fairly simplistic] profiling I've run on templates, isinstance is _the_ biggest cause of time in template rendering." Feel free to reopen if you come up with an alternate implementation. comment:8 Changed 6 years ago by Further to the above: - remember this is an isinstance test for every step of every lookup. - what about when someone subclasses dict and gives it a missing method? Same problem, won't be solved - precedent : once we special case handling of one type, I worry more will come... comment:9 Changed 6 years ago by Some final thoughts, but at the very beginning: I'm in no way annoyed that the patch doesn't get merged! As funkybob mentioned, isinstance is called for every step of every lookup. So a template like this will cause 4 additional calls: {% for k, v in d.items %}{{ k }}:{{ v }}{% endfor %} I have set up a tiny script (with 1000 times the above snippet) for some simple profiling to get a feeling for the impact: from django.template.base import Context from django.template.engine import Engine s = '{% for k, v in d.items %}{{ k }}:{{ v }}{% endfor %}' d = {'one': [1]} n = 1000 s *= n engine = Engine() t = engine.from_string(s) context = Context({'d': d,}) #res = t.render(context) The last line is commented out to get the overhead for preparing the template and the context. Calling 'python -m cProfile -s cumulativ _profile.py' now gives a fairly large output: 322295 function calls (316792 primitive calls) in 0.420 seconds ... 20469 0.005 0.000 0.005 0.000 {built-in method isinstance} isinstance() gets called 20469 times. Most of these calls are because of 's *= n'. Uncommenting the last line now renders with the unpatched version: 464331 function calls (455828 primitive calls) in 0.543 seconds ... 50472 0.012 0.000 0.012 0.000 {built-in method isinstance} shows that isinstance gets called excessively and takes about 7 ms additional runtime. Rendering with the patched version should produce even 4k more calls: 468330 function calls (459827 primitive calls) in 0.517 seconds ... 54471 0.013 0.000 0.013 0.000 {built-in method isinstance} This is the case and runs 1 ms longer. To prepare a context for 4k lookups it may take some additional time for accessing a db and the template may not come from a prepared string but from another io-channel. All in all I think that the impact of the patch is insignificant. @funkybob: you further mentioned a precedent. Well, that may be a point. IMHO it's quiet ok to expect as least surprise using dicts and defaultdicts as these datatypes are builtins resp. from the standard library. One can not assume that individual modified classes derived from these types will have no unexpected behaviour in the way the DTL-lookup works. But that's just my opinion and there may be other ones. Do you have an idea of how this could be solved without breaking backward compatibility? See #25574 for the discussion that added this mention in the docs.
https://code.djangoproject.com/ticket/26095?cversion=1&cnum_hist=5
CC-MAIN-2022-27
refinedweb
834
73.37
Programming errors a compiler will detect in C++ By: Stanley B. Printer Friendly Format Part of the compiler's job is to look for errors in the program text. A compiler cannot detect whether the meaning of a program is correct, but it can detect errors in the form of the program. The following are the most common kinds of errors a compiler will detect. Syntax errors. The programmer has made a grammatical error in the C++ language. The following program illustrates common syntax errors; each comment describes the error on the following line: // error: missing ')' in parameter list for main int main ( { // error: used colon, not a semicolon after endl std::cout << "Read each file." << std::endl: // error: missing quotes around string literal std::cout << Update master. << std::endl; // ok: no errors on this line std::cout << "Write new master." <<std::endl; // error: missing ';' on return statement return 0 } Type errors. Each item of data in C++ has an associated type. The value 10, for example, is an integer. The word "hello" surrounded by double quotation marks is a string literal. One example of a type error is passing a string literal to a function that expects an integer argument. Declaration errors. Every name used in a C++ program must be declared before it is used. Failure to declare a name usually results in an error message. The two most common declaration errors are to forget to use std:: when accessing a name from the library or to inadvertently misspell the name of an identifier: #include <iostream> int main() { int v1, v2; std::cin >> v >> v2; // error: uses " v "not" v1" // cout not defined, should be std::cout cout << v1 + v2 << std::endl; return 0; } An error message contains a line number and a brief description of what the compiler believes we have done wrong. It is a good practice to correct errors in the sequence they are reported. Often a single error can have a cascading effect and cause a compiler to report more errors than actually are present. It is also a good idea to recompile the code after each fixor after making at most a small number of obvious fixes. This cycle is known as edit-compile++
https://www.java-samples.com/showtutorial.php?tutorialid=1448
CC-MAIN-2021-43
refinedweb
371
61.67
Cache Busting in .NET In this article, we are going to look for cache bursting techniques in .NET MVC and .NET Core, When a browser requests the server to get a static file, the browser will download this file, and then it will cache them to improve & optimize performance. Doing this caching helps the browser not to download files on every request and use cached files. This caching is one of the most important things to do when optimizing websites which ultimately saves a lot of data for end uses/visitors. Optimizing the website performance includes setting up the long expiration dates for the static resources such as images, stylesheet & javascript. Doing that server tells the browser to cache your file for that time. However, this leads to a one-issue what happens if developers are changing any of the static files? So it’s sure the browser is not going to know that developer has changed some files because the browser will look for the cached file only as the file URL is not going to change. the technique to solve this problem is called cache bursting. One way to solve this problem is link needs to point to a different URL so the browser will download it again. Fingerprinting- Forcing the browser to download the file again is called fingerprinting. This technique is about adding parameters to the URL of a static file It could be random or value derived from the file logic. This way browser is tricked into seeing this new URL as different from another URL and due to a change in URL we tell the browser to cache the file with a new URL. we usually add a parameter with the date of the file’s last modification which is converted to a number of ticks (a 64-bit integer) now once the timestamp is included in the URL browser will consider it as a new file and then request that from the server instead of cache. Implementation .NET MVC / .NET Core- 1) Removing caching entirely – This is usually done by appending the different randomly generated query string parameters. For example, something like a timestamp. <script src=”~/jquery.js?dt=@(DateTime.Now.Ticks)”></script> This will add a timestamp as a query string and every time browser will download files from the server instead of cache. Definitely, this is going to solve our problem but it is very inefficient as it’s going to download files from the server on every request. 2) Modify timestamp only when the file is updated It now includes a timestamp, which is automatically updated every time the file is modified. Since the browser considers the whole URL (including query string parameters) of the file, it will not be considered the same as the earlier one. For this approach, you need to deploy your application on an IIS server and make use of URL rewriting which basically avoids the refreshing of the static file every time on the server. For this approach use the below steps, i) Add an extension method for URL with a timestamp using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Caching;using System.Web.Hosting;using System.IO;namespace CacheBurstingMVC{public class CacheUrlExtension{public static string Extend(string relativePath){if (HttpRuntime.Cache[relativePath] == null){string absolutePath = HostingEnvironment.MapPath(“~” + relativePath);DateTime date = File.GetLastWriteTime(absolutePath);int index = relativePath.LastIndexOf(‘/’);string result = relativePath.Insert(index, “/v-” + date.Ticks);HttpRuntime.Cache.Insert(relativePath, result, new CacheDependency(absolutePath));}return HttpRuntime.Cache[relativePath] as string;}}} ii) Use the extension method for static files. @{Layout = null;}<!DOCTYPE html><html><head><meta name=”viewport” content=”width=device-width” /><title></title><link rel=”stylesheet” href=@CacheBurstingMVC.CacheUrlExtension.Extend(“/Content/styles.css”)/></head><body><div>Home</div></body></html> iii) Adding URL rewrite on IIS server <system.webServer><rewrite><rules><rule name=”fingerprint”><match url=”([\S]+)(/v-[0–9]+/)([\S]+)([\S]+)” /><action type=”Rewrite” url=”{R:1}/{R:3}” /></rule></rules></rewrite></system.webServer> Test Results- 3) Versioned approach In this approach, you are going to append the version number after the static file and according to that version number, it will download the new file from the server if the version is changed otherwise it will get the file from the cache. <script src=”~/jquery.js?v=@(AppVersionNumber)”></script> Thank You, See you in the next article !! You can reach out or connect to me over here, If you want some technical topics to be discussed with group of participants please raise a request on following link:
https://vaibhavbhapkarblogs.medium.com/cache-busting-in-net-5efaeaf4288f?readmore=1&source=user_profile---------4----------------------------
CC-MAIN-2021-43
refinedweb
761
53.92
This action might not be possible to undo. Are you sure you want to continue? DANIEL A FOXVOG LECTURER IN ASSYRIOLOGY (RETIRED) UNIVERSITY OF CALIFORNIA AT BERKELEY Revised May 2012 CONTENTS PREFACE THE SUMERIAN WRITING SYSTEM TABLE OF SYLLABIC SIGN VALUES PHONOLOGY NOUNS AND ADJECTIVES THE NOMINAL CHAIN PRONOUNS AND DEMONSTRATIVES SUMMARY OF PERSONAL PRONOUN FORMS THE ADNOMINAL CASES: GENITIVE AND EQUATIVE THE COPULA ADVERBS AND NUMERALS THE ADVERBAL CASES INTRODUCTION TO THE VERB DIMENSIONAL PREFIXES 1: INTRODUCTION DIMENSIONAL PREFIXES 2: DATIVE DIMENSIONAL PREFIXES 3: COMITATIVE, ABLATIVE-INSTRUMENTAL, TERMINATIVE CORE PREFIXES: ERGATIVE, LOCATIVE-TERMINATIVE, LOCATIVE THE VENTIVE ELEMENT RELATIVE CLAUSES: THE NOMINALIZING SUFFIX -a PREFORMATIVES (MODAL PREFIXES) THE IMPERATIVE IMPERFECTIVE FINITE VERBS PARTICIPLES AND THE INFINITIVE APPENDIX: CHART OF VERBAL PREFIX CHAIN ELEMENTS APPENDIX: THE EMESAL DIALECT INDEX EXERCISES 3 4 16 18 23 28 31 38 39 46 51 54 61 69 73 78 83 90 95 102 109 117 127 150 151 152 153 2 PREFACE Entia non sunt multiplicanda praeter necessitatem William of Ockham This grammar is intended primarily for use in the first year of university study. A few exercises have been provided to accompany study of the lessons, some artificial, others drawn from actual texts. Both require vocabulary lookup from the companion Elementary Sumerian Glossary or its equivalent. Upon completing this introduction, the student will be well prepared to progress to sign learning and reading of texts. Konrad Volk's A Sumerian Reader (Studia Pohl Series Maior 18, Rome, 1997-) is a good beginning. This introduction may also be of benefit to those who have already learned some Sumerian more or less inductively through the reading of simple royal inscriptions and who would now like a more structured review of its grammar, with the help of abundant textual illustrations, from something a bit more practical and pedagogically oriented than the available reference grammars. Cross-references have often been provided throughout to sections in Marie-Louise Thomsen's earlier standard The Sumerian Langauge (Copenhagen, 19872), where additional information and further examples can often be found for individual topics. A newer restatement of the grammatical system is Dietz Otto Edzard's Sumerian Grammar (Leiden, 2003). An up to date quick overview is Gonzalo Rubio's "Sumerian Morphology," in Alan S. Kaye (ed.), Morphologies of Asia and Africa II (2007) 1327-1379. Pascal Attinger's encyclopedic Eléments de linguistique sumérienne (Fribourg, 1993) is a tremendously helpful reference but beyond the reach of the beginner. Abraham H. Jagersma's new revolutionary. The chronological abbreviations used here are: OS Sarg. Ur III OB Old Sumerian period Sargonic period 3rd Ur Dynasty (Neo-Sumerian) period Old Babylonian period (2500-2350 (2350-2150 (2150-2000 (1900-1600 BC) BC) BC) BC) For those who may own a version of my less polished UC Berkeley teaching grammar from 1990 or earlier, the present version will be seen to be finally comprehensive, greatly expanded, hopefully much improved, and perhaps worth a serious second look. My description of the morphology and historical morphophonemics of the verbal prefix system remains an idiosyncratic, somewhat unconventional minority position. Jagersma's new description, based in many repects upon a subtle system of orthographic and morphophonological rules, is now popular especially in Europe, and it may well become the accepted description among many current students of Sumerian grammar. This annual revision has replaced the sign value nì with níĝ throughout, modified several textual illustrations, improved translations, and updated references for and descriptions of some phenomena. The pagination however remains virtually the same. Guerneville, California USA May 2012 3 The standard reference for sign identification remains R. go" /du/ "to build" /du/ "to release" A system of numerical subscripts. Attinger (Fribourg. R. serves to identify precisely which sign appears in the actual text. Borger's Assyrisch-babylonische Zeichenliste (AOAT 33/33a. TRANSLITERATION CONVENTIONS A. Multiple-syllable signs muru múru mùru muru4 Note that the diacritic always falls on the FIRST VOWEL of the word! There is variation in the systems employed in older signlists for multiplesyllable signs. Borger's index system which is used here is as follows: Single-syllable signs du dú dù du4 (= du1) (= du2) (= du3) etc. Labat's Manuel d'Epigraphie akkadienne (1948-). 2006). which has seen numerous editions and reprintings. In the earliest editions of his signlist which may still be encountered in libraries. especially in Labat. Mittermayer & P. although the best new sign list for OB Sumerian literary texts is the Altbabylonische Zeichenliste der sumerisch-literarischen Texte by C. for example: /du/ "to come. and diacritics over vowels representing subscripts. Y.THE SUMERIAN WRITING SYSTEM I. Labat carried the use of diacritics through index numbers 4-5 by shifting the acute and grave accents onto the first syllable of multiple-syllable signs: murú murù múru mùru (= muru2) (= muru3) (= muru4) (= muru5) 4 . Sign Diacritics and Index Numbers Sumerian features a large number of homonyms — words that were pronounced similarly but had different meanings and were written with different signs. Rosengarten's Répertoire commenté des signes présargoniques sumériens de Lagaš (1967) is indispensible for reading Old Sumerian texts. 1978) is now the modern reference for sign readings and index numbers. placing the diacritics on the first syllable of multi-syllable signs. in the phrase a-SIS "brackish water". or sis? Rather than commit oneself to a possibly incorrect choice. it is vital that the beginner become familiar with it. New values of signs.LU. a variety of conventions exist. For example. 3) When one wishes to identify a non-standard or "x"-value of a sign.hašhur. A sign presumed to have been omitted by 5 . one may indicate this doubt by choosing its most common value and writing this in CAPS. finally. are given an "x" subscript. They are also sometimes seen written lower case on the line separated by periods: ĝiš. du. e.g. which then does not represent tuku4. Upper case (capital) letters (CAPS) are used: 1) When the exact meaning of a sign is unknown or unclear. they have more than one value or reading. in the sentence KA-ĝu10 ma-gig "My KA hurts me" a body part is intended. the x-value is immediately followed by a known value of the sign in CAPS placed within parentheses. du3. du2. and Brackets In unilingual Sumerian contexts. lu[gal] or [lugal]. however. But the KA sign can be read ka "mouth".HAŠHUR. and so it has been maintained here. is the current convention of the new Pennsylvania Sumerian Dictionary. but rather tuku2. for example dax(Á). Very commonly Akkadian words are written in lower case roman or italic letters with Sumerian logograms in CAPS: a-na É. Upper and Lower Case.g.TE. e. Since the system of accents is still current in Sumerological literature.This would not be a problem except for a number of signs which have long and short values. Many signs are polyvalent." In some publications one also sees Sumerian words written in s p a c e d r o m a n letters. but using them only for index numbers 2 and 3. In this case. Italics. the pronunciation of the second sign is still not completely clear: ses. used here and in later editions of Labat. for example énsi(PA. Labat gives the latter reading as túku. du4. i. e.SI) or ugnim(KI. For example. 4) When one wishes to spell out the components of a compound logogram. etc.GAL-šu "to his palace. B. kìri "nose" or zú "tooth. túk(u)! Borger's AbZ system.ÚB.g. dax "side. When the particular reading of a sign is in doubt. that more and more frequently the acute and grave accents are being totally abandoned in favor of numeric subscripts throughout. This. Partly or wholly missing or broken signs can be indicated using square brackets. CAPS can used to tell the reader that the choice is being left open." and the exact part of the face might not be clear from the context. is more consistent. with Akkadian in either lower case roman letters or italics. pronunciations for which no generally accepted index numbers yet exist. 2) When the exact pronunciation of a sign is unknown or unclear." Note. are written with superscripts in Sumerological literature. often.KUŠ. Determinatives. In bilingual or Akkadian contexts. By writing KA one clearly identifies the sign to the reader without committing oneself to any of its specific readings. or. Sumerian words are written in lower case roman letters. for example.e. that is. unpronounced indicators of meaning.ĜAR). For example. in CAPS on the line in Akkadian contexts: gišhašhur or ĜIŠ. the sign túk can be read /tuk/ or /tuku/. A Memorial Volume for Jeremy Black [London.) Consequently. The writing system itself makes no such linkages and does not employ any sort of punctuation. But nominal chains often consist of adjectives.g. while a sign deleted by a modern editor is indicated by double angle <<angle>> brackets. One rule of thumb is: the longer the the chain. Cunningham. when one attempts to formulate a rule for the linking of the elements in the agglutinative chains peculiar to Sumerian. and relative clauses beside head nouns and suffixes." Zeitschrift für Assyriologie 92 [2002] 60ff. C. 6 . we do not usually transcribe words.the ancient scribe is indicated by the use of <angle> brackets.: énsi(PA. one must attempt to develop one's own sensitivity to how Sumerian forms units of meaning. and G. e. Black. periods link the parts of compound signs written in CAPS. J. Our systems of linking signs and words are intended only to help clarify the relationships between them and to aid in the visual presentation of the language. the less likely its subsections will be linked with hyphens. dependent genitive constructions. and hyphens are used elsewhere.SI) kuš É. "Sumerian Word Classes Reconsidered. 2010] 41-52. "Sumerian Lexical Categories.TE. and the linking or separation of various parts of nominal chains in unilingual Sumerian contexts is very much subject to the training and idiosyncrasies of individual scholars. One should take as a model the usual practices of established scholars." in Your Praise is Sweet. appositions. but many current scholars are now beginning to write the adjective as a separate unit: dumu-tur or dumu tur "child small" = "the small child" Verbal adjectives (past participles) may or may not be linked: é-dù-a or é dù-a "house built" = "the built house" The two parts of a genitive construction are today never linked unless they are components of a compound noun: é lugal-la "the house of the king" In the absence of a universally accepted methodology. however. Components of nominal compounds are normally linked: dub-sar lú-má-lah4 "scribe" "boatman" Simple adjectives were always in the past joined to the words they modify. The formal definition of a Sumerian word remains difficult (cf. we only transliterate Sumerian sign by sign. while periods separate the elements of Sumerian words or logograms. Verbal chains consist mainly of affixes which are always linked together into one unit. hyphens are always used to transliterate Akkadian. In Sumerian contexts. Conventions for Linking Signs and Words Hyphens and Periods In Akkadian contexts.ÍB-ùr an-šè "governor" "shield" "towards heaven" Problems arise. The main criterion at work is usually clarity of presentation. One should also try to be consistent. above or below) another sign.g. Thus a transliteration ba:bi:bu would signify: 7 . this. especially in older texts.g. abyss" EN+ZU = suen "Suen (the moon god)" More complicated compound signs may feature a number of linked elements. will actually be the standard way to transliterate it: IRIxA CITY times WATER = "the city IRIxA" Two signs joined closely together. e." Some ligatures also feature an archaic reversal of the order of their components. with parentheses marking subunits. with the base sign and added sign separated by an "x": KAxA MOUTH times WATER = naĝ "to drink" If the reading/pronunciation of such a sign also happens to be unknown. za:gìn for written GÌN-ZA instead of normal za-gìn "lapis lazuli. the resulting new sign may be described by writing both components in CAPS. are called "ligatures. The parts of ligatures are traditionally linked with a "plus" character. by necessity. a colon may be used to tell the reader that the order of the signs on either side of the colon is reversed in actual writing. although some scholars will also use a period: GAL+LÚ BIG plus MAN = lugal "king" GAL+UŠUM BIG plus SERPENT = ušumgal "dragon" SÌG+UZU HIT plus FLESH = túd "to beat. especially when they share one or more wedges in common or have lost some feature as a result of the close placement." Colons can also be used to indicate that the proper order of signs is unknown.Plus (+) and Times (x) in Sign Descriptions When one sign is written inside (or.MÁŠ) Colon = amaš "sheepfold" In publications of archaic or Old Sumerian texts in which the order of signs is not as fixed as in later scribal tradition.: DAG+KISIM5x(UDU. e. whip" ZU+AB = abzu "(mythical) subterranean ocean. and from Ur (1st Dynasty. Signs depicting concrete objects form the ultimate basis of the archaic system. Logogram is the term used by modern Sumerologists. second or third!" II. Schmandt-Besserat has demonstrated that cuneiform writing per se developed rather abruptly towards the end of the 4th millennium from a system of counting tokens that had long been in use throughout the Ancient Near East. as opposed to signs which represent syllabic values or mere sounds. oddly enough. ox" áb "cow" Other signs were a bit more abstract. however. 2600 BC the texts become completely intelligible and feature a developing mixed logographic and syllabic cuneiform writing system. The term "pictogram (pictographic)" is used exclusively to refer to the signs of the archaic texts. 2700 BC). The terms "ideogram (ideographic)" and "logogram (logographic)" are interchangeable and refer to signs which represent "ideas" or "words" respectively. for us to identify as yet. however. Many of these old documents are still difficult to read. in which "pictures" were drawn on clay with a pointed stylus. Other archaic texts come from later Uruk levels. but are still comprehensible: a "water" ĝi6 "night" Many other archaic signs. but much new progress has recently been made. ORIGIN AND DEVELOPMENT OF THE SIGN SYSTEM D."I have no idea which sign comes first. too specific and detailed. from Jemdet Nasr. They may represent whole objects: kur "mountain" šu "hand" še "(ear of) grain" or significant parts of objects: gudr "bull. The large number of 8 . ca. are either too abstract or. By ca. 3100 BC). Our oldest true texts. are the pictographic tablets that come from level IVa at Uruk (ca. alternative ways of generating signs were developed. to be read á "arm.e. the imperfective plural stem of the the verb du "to come." Strokes over the mouth portion produces SAĜ-gunû. go (plural)". could not easily express more abstract ideas or processes. Compare the following two sets of signs: SAĜ KA DA Á In the first set. Therefore. Hatchings over the arm portion produces DA-šeššig. gunû and šeššig Signs One method of generating new signs was to mark a portion of a base sign to specify the object intended." Compound Signs New signs were generated by combining two or more signs: 1) Doubling or even tripling the same sign: DU DU = su8(b) "to come. decorated") or šeššighatchings (due to the resemblance of the strokes to the early cross-hatched form of the Sumerian sign for grain.often minutely differentiated signs characteristic of the archaic texts suggests that an attempt was made to produce one-to-one correspondences between signs and objects. še). to be read ka "mouth. but later came to be read either an "sky" or diĝir "god" Combining two (or more) different signs to produce a new idea by association of ideas: KAxA mouth+water = naĝ "to drink" KAxNINDA mouth+bread = gu7 "to eat" A+AN water+sky = šèĝ "to rain" 9 . arm and hand). The marks are called by the Akkadian scribes either gunû-strokes (from Sumerian gùn-a "colored. the base sign is da "side" (i. a shoulder. This system no doubt soon became unwieldy." In the second set. using a sign which originally depicted a star. go" AN AN AN 2) = mul "star". moreover.. the base sign is saĝ "head. and. ZÚ. each with its own separate pronunciation. the association of "many values" with a particular sign.BAR Polyvalency sun+zubar = zubar/zabar "bronze" The most important new development by far was the principle of polyvalency. This became a very productive and simple method of generating new logographic values.NÍĜINxA encircled area+water = ambar "marsh" NÍĜINxBÙR encircled area+hole = pú "well" MUNUS+UR 3) female+dog = nig "bitch" Adding to a base sign a phonetic indicator which points to the pronunciation of a word associated in meaning with the base sign: KAxME mouth+me = eme "tongue" KAxNUN mouth+nun = nundum "lip" EZENxBAD walled area+bad = bàd "city wall" UD. farmer" "furrow" "nose" "tooth" "word" "scepter" "to beat" "foreman" "light. time" "shining. For example: apin "plow" can also be read uru4 engar àbsin kìri zú inim ĝidri sìg ugula ud babbar àh diĝir "to plow" "plowman. day. white" "dried. withered" "god(dess)" ka "mouth" can also be read pa "branch" can also be read utu "sun" can also be read an "sky" can also be read 10 . syllabic signs (sound values derived from word signs). grammatical elements which were not really logograms. modified somewhat from the Sumerian to render different sounds in the Akkadian phonemic inventory and then expanded over time to produce many new phonetic and even multiple-syllable values (CVC. and VowelConsonant syllabic values formed the basis of the Akkadian writing system. where the sign for an object which could easily be drawn was used to write a homophonous word which could not so easily be depicted. VCV. Determinatives were presumably not to be pronounced when a text was read.. but it adds to the difficulty of learning the Sumerian writing system. e. When Sumerian died as a spoken language. Determinatives were still basically optional as late as the Ur III period (2114-2004). 76 A. for which no proper Sumerian logograms existed. or purely phonological. To use the example of the "plow" sign above. A determinative is one of a limited number of signs which. etc. and to show that they are not actually part of a word we transliterate them. but. Some now speak of 11 .g. Rebus Writing and Syllabic Values At some point rebus writings arose. reed. wooden. values of signs became possible. For example. The Sumero-Akkadian writing system was still in limited use as late as the 1st century A. became also the standard sign for ti "rib" as well as for the verb ti(l) "to live. in unilingual Sumerian context at least. they became obligatory. copper or bronze objects. places. a limited set of some ninety or so Vowel. the picture of an arrow."hither. the use of determinatives arose. For example. pronounced /ti/. when placed before or after a sign or group of signs. that is. the last known texts are astronomical in nature and can be dated to ca. CVCV). or persons. A regular system of syllabic values also made possible the spelling out of any word — especially useful when dealing with foreign loanwords.D.Determinatives To help the reader decide which possible value of a polyvalent sign was intended by the writer. indicated syntactic relationships within the sentence.D. as superscripts. The system thus served the needs of Mesopotamian civilizations for a continuous span of over 3200 years – a remarkable achievement in human history. Finally. since meanings of words thus written are divorced entirely from the original basic shapes and meanings of their signs. the logograms mu "name" or ga "milk" could now be used to write the verbal prefixes mu. rather. With the expansion of the rebus principle the development of syllabic. the polyvalent sign APIN is read apin if preceded by a "wood" determinative: giš apin "plow" lú engar - if preceded by a "person" determinative: engar "plowman" but uru4 "to plow" or àbsin "furrow" elsewhere. especially an abstract idea. ORTHOGRAPHY The fully developed writing system employs logograms (word signs). depending upon context. and determinatives (unpronounced logograms which help the reader choose from among the different logographic values of polyvalent signs) to reproduce the spoken language. deities."let me"." The adoption of the rebus principle was a great innovation. III. Consonant-Vowel. forth" or ga. indicates that the determined object belongs to a particular semantic category. two of which incorporate full glosses: 1) The sign ĝeštug is written: PI 12 . an Akkadian scribe could write the sentence "The king came to his palace" completely syllabically: šar-ru-um a-na e-kal-li-šu il-li-kam. "great beast of prey") (lit. They are also commonly used to write words for which there is no proper logogram. He would be just as likely.KALAG > > naĝ usu "to drink" "strength" (combining KA "mouth" and A "water") (combining Á "arm" and KALAG "strong") Such compound logograms should be differentiated from compound words made up of two or more logograms. Logograms Many Sumerian logograms are written with a single sign.: KAxA Á. "stone fashioner") Logograms are used in Sumerian to write nominal and verbal roots or words. for example: èn ba-na-tarar "he was questioned." Texts in the Emesal dialect of Sumerian feature a high percentage of syllabic writings. to use the common Sumerian logograms for "king" and "palace" and write instead LUGAL a-na É. e. resulting in a compound sign or sign complex which has a pronunciation different from that of any of its parts. Emesal ka-na-áĝ = Emegir kalam "nation". For example." Other logograms are written with two or more signs representing ideas added together to render a new idea. since many words in this dialect are pronounced differently from their main dialect (Emegir) counterparts." An early native gloss may rarely become fixed as part of the standard writing of a word. however. we normally transliterate glosses as superscripts as we do determinatives.g. and in Akkadian as a kind of shorthand to write Akkadian words which would otherwise have to be spelled out using syllabic signs. e. sa-tu < Akkadian šadû "mountain. Emesal u-mu-un = Emegir en "lord." We also occasionally encounter main dialect texts written syllabically. For example.the received system as logophonetic or logosyllabic in character. The best example is the word for "ear.g.: kù-babbar kù-sig17 ur-mah za-dím "silver" "gold" "lion" "lapidary" (lit. for example a "water. intelligence".GAL-šu il-li-kam. "white precious metal") (lit. but usually only from peripheral geographical areas such as the Elamite capital of Susa (in Iran) or northern Mesopotamian sites such as Shaduppum (modern Tell Harmal) near Baghdad. e. which can be written three different ways.g. Syllabic signs are occasionally used as glosses on polyvalent signs to indicate the proper pronunciations. Syllabic Signs Syllabic signs are used in Sumerian primarily to write grammatical elements. "yellow precious metal") (lit. Sometimes this phonetic writing is a clue that the word in question is a foreign loanword. ) The following determinatives are placed AFTER the words they determine and so are referred to as post-determinatives: ki ku6 mušen nisi(g) zabar place fish bird greens bronze cities and other geographic entities fish." ĝiš is also used before hašhur "apple (tree or wood)" even though this sign has no other reading. they are often employed obligatorily even when the determined logogram is not polyvalent. e. person woman. female god pot reed tree. m) lú munus (abbr. rather than. e. crustaceans birds. For example. e. amphibians. not actually attested in Sumerian texts (P. herbs. Or 51 [1982] 358f. nú "to sleep" but gišĝèšnu(NÚ) "bed. other winged animals vegetables (the obsolete reading sar "garden plot" is still also seen) bronze objects (often combined with the pre-determinative urudu) 13 .g. Other common functions are to help the reader distinguish between homonymous words. cereals city names (previously read uru) copper (and bronze) objects body parts. d) dug gi ĝiš i7 (or íd) kuš mul na4 šim túg (or tu9) ú iri urudu uzu Meaning one.g. stars and constellations stones and stone objects aromatic substances (woolen) garments grassy plants. while the wood determinative ĝiš may be used before the PA sign to help specify its reading ĝidri "scepter". sìg "to beat. While they were probably developed to help a reader chose the desired value of a polyvalent sign. meat cuts *An Akkadian invention.. They begin to be used sporadically by the end of the archaic period. resin garment grass city copper flesh Category personal names (usually male) male professions female names and professions* deities vessels reed varieties and objects trees." The following determinatives are placed BEFORE the words they determine and so are referred to as pre-determinatives: Determinative I (abbr. They are orthographic aids and were presumably not pronounced in actual speech. (item) man. woods and wooden objects canals and rivers leather hides and objects planets. insects. wood watercourse skin star stone aromatic.g. f) diĝir (abbr. Steinkeller. ad "sound" and gišad "plank" or between different related meanings of a word.2) The sign ĝéštug is written: geš-túg PI 3) The sign ĝèštug is written: geš PItúg Determinatives Determinatives are logograms which may appear before or after words which categorize the latter in a variety of ways. : dùg. rather than Inana. however. e. in fact." as in "the adjective du10 has a /g/ Auslaut. such redundant writings can again provide help in the correct reading of polyvalent signs: AN-na can only be read an-na "in the sky. many names of Sumerian rulers. Despite the inconsistency. interior" In the older literature the long values were generally used everywhere. or the king Mesannepadda. etc. du11 gudr. the verbal chain analyzed as mu+n+a+n+šúm "he gave it to him" can be found written both as mu-naan-šúm or mu-un-na-an-šúm. For example. at the end of a word complex or nominal chain or when followed by a consonantal suffix.g. Certainly it was the short values that were taught in the Old Babylonian scribal schools. Sumerologists began to bring the transliteration of Sumerian more in line with its actual pronunciation by utilizing the system of short sign values which is still preferred by the majority of scholars. After World War II. rather than Mesanepada. deities and cities known from the early days of Assyriology are still found cited in forms containing doubled consonants which do not reflect their actual Sumerian pronunciations. Sharlach. For example. If hidden Auslauts create extra problems in the remembering of Sumerian signs or words. ku5 níĝ. When the ergative case marker -e "by" is added." Direction of Writing A shift in the reading and writing of signs took place sometime between the end 14 .g." Probably basically related to the preceding phenomenon is the non-significant doubling of consonants in other environments. ox" kudr. just as the phrase an+a "in the sky" can be written an-a or an-na. the phrase "by the good child" would thus have been transliterated dumu-dùg-ge. ku5(dr). gu4 "good" "to do" "bull. e. nì šag4.g.. though at first it will be sufficient just to learn the short values together with their Auslauts. du10 dug4. etc. thus giving both a "long" and "short" value for each sign. the goddess Inanna. Zeitschrift für Assyriologie 97 [2007] 4 n. But this has the disadvantage of suggesting to the reader that an actual doubling of the consonant took place. i.Long and Short Pronunciations of Sumerian Roots Many Sumerian nominal and verbal roots which end in a consonant drop that consonant when the root is not followed by some vocalic element. du10(g). to judge from the data of the Proto-Ea signlists (see J. the same phrase was pronounced /dumu duge/. šà "to cut" "thing" "heart. Klein & T. the rules of orthography offer one great consolation: a final consonant picked up and expressed overtly in a following syllabic sign is a good indication as to the correct reading of a polyvalent sign. KA-ga can only be read either ka-ga "in the mouth" or du11-ga "done." while AN-re can only be read diĝir-re "by the god. although there is now a tendency to return to the long values among Old Sumerian specialists. We know this is so because the writing system "picks up" the dropped consonant of the adjective and expresses it linked with the vowel in a following syllabic sign: dumu-du10-ge. This hidden consonant is generally referred to by the German term Auslaut "final sound. the simple phrase "the good child" is written dumu-du10. 16). Eventually one must simply learn to be comfortable with both the long and short values of every sign which features an amissible final consonant. e.e." Our modern signlists assign values to such signs both with and without their Auslauts. For example. and it was presumably actually pronounced /dumu du/. and." whereas KA-ma can only be read inim-ma "of the word. 2500 BC. and the pictures of objects represented by each sign are seen in their normal physical orientation. as in mu-na-an-šúm "he gave it to him" "he is king" . 1750. Direction of Script. just as an English word may have more than one common meaning. "Three Problems in the History of Cuneiform Writing: Origins. One or more of the logographic values may function as a syllabic sign.the logogram an in the meaning "high area" . Sumerian expresses the human experience with a relatively limited word stock.the logogram diĝir "god. 15 .the syllable am6 (in Old Sumerian). In a signlist such as Labat's one will see the shift shown as having taken place sometime between the Archaic and Ur III periods.the logogram an in the meaning "sky. By 1200 BC signs were being written consistently left to right in a line. although at least one modern scholar places the onset of the change as early as ca. Picchioni. and M. IV.the determinative for deities. goddess" . ca. the sign AN can represent: . 1200 BC according to current theory." in Visible Language XV/4 (1981) 419-440.the logogram an in the meaning "(the sky-god) An" .of the Old Babylonian period (1600 BC) and ca. In the archaic pictographic texts signs were written from the top to the bottom of a column. Literacy. "The Direction of Cuneiform Writing: Theory and Evidence. as in den-líl "(the god) Enlil" . with the the orientation of signs now shifted 90 degrees counterclockwise. any particular Sumerian sign may have three kinds of uses: 1) It will usually have one or more logographic values. each with a different pronunciation." CDLI Bulletin 2003:2 (Internet). even though this practice may be anachronistic for the middle 3rd to early 2nd millennium texts that form the classical Sumerian corpus. 2) 3) For example. Powell. one must continually strive to develop a feeling for the basic meaning of any particular Sumerian word and how it can be used to convey a range of ideas for which modern languages use different individual words. although a monumental inscription such as the law code stele of the later OB king Hammurapi. For a description of this phenomenon see S. M. Fitzgerald." Studi Orientali e Linguistici 2 (1984-85) 11-26.the syllable an. A single value may itself have more than one meaning. READING CUNEIFORM In summary. still clearly shows the original direction of writing. heaven" . as in lugal-am6 REMEMBER: A WORD WHICH FEATURES AN AMISSIBLE AUSLAUT DROPS ITS FINAL CONSONANT WHEN IT IS NOT FOLLOWED BY A VOWEL. "pisan dub-ba and the Direction of Cuneiform Script. Modern practice is to continue to publish cuneiform texts and to read cuneiform in the left to right orientation for all periods except for the earliest. One of the logographic values of a sign may function as a determinative. TABLE OF SYLLABIC SIGN VALUES: V, CV, VC Syllables shown linked are written with the same sign. VOWELS: a 'à i ì e u ù ú u8 STOPS: CV Labials ba Voiced ┌────────┐ │bi bé│ └────────┘ bí Voiceless ┌──┐ ┌────────┐ ┌──┐ │bu│ pa │pi pe│ │pu│ └┬─┘ └────────┘ └┬─┘ └─────────────────────────────────┘ tu Dentals Velars ┌────────┐ ┌──┐ ┌──┐ │di de│ │du│ ta │ti│ te └────────┘ └┬─┘ └┬─┘ ┌──┐ dè │ │ │dì├──────────┼────────────────────┘ └──┘ │ ┌─────┐ ┌──────┐ │ │(d)rá├─────┤(d)re6├─┘ └─────┘ └──────┘ ┌────────┐ ┌────────┐ ga │gi ge│ + gu ka │ki ke│ └────────┘ └────────┘ ┌──┐ gú ┌───┐ │gé├──────────────────────────────┤ke4│ └──┘ └───┘ ┌─────────┐ │gi4 ge4│ └─────────┘ da ku STOPS: VC Labials aB ┌────────┐ │iB eB│ └────────┘ ┌────────┐ │íB éB│ └────────┘ ┌────────┐ │iD eD│ └────────┘ ┌────────┐ │iG eG│ └────────┘ uB ┌──────────────────────┐ │ Voiced versus voice- │ │ less values are not │ │ distinguished by │ │ separate VC signs. │ │ │ │ B = b or p │ │ D = d or t │ │ G = g or k │ │ Z = z or s │ └──────────────────────┘ Dentals Velars aD aG uD uG 16 FRICATIVES Dentals sa ┌────────┐ │si se│ └────────┘ ┌────────┐ │zi ze│ └────────┘ zé ši su ┌──┐ │sú│ │ │ │zu│ └──┘ aZ za ┌────────┐ │iZ eZ│ └────────┘ uZ Palatals ša Velars ha še šu aš iš eš uš ┌──┐ ┌──┐ │šè├──────────────────────────────┤éš│ └──┘ └──┘ ┌────────┐ ┌──────────────────────┐ │hi he│ hu │ah ih eh uh│ └────────┘ └──────────────────────┘ hé NASALS ┌────────┐ │ni né│ └────────┘ ne ┌───┐ ma │mi │ me │ │ │ │ │ │ ┌──┐ │ │ ┌────┐ │ĝá│ │ĝi6│ │ĝe26│ └─┬┘ └───┘ └─┬──┘ └────────────┘ na LIQUIDS la lá ┌────────┐ │li le│ └────────┘ lí lu al il el ul nu ┌────┐ │mu │ │ │ │ │ │ │ │ │ │ĝu10│ └────┘ ┌───┐ │an │ in en │ │ │ │ èn │ │ ┌────────┐ │am6│ │im em│ └───┘ └────────┘ am àm ┌───────────────┐ │áĝ ìĝ èĝ│ └───────────────┘ ┌──┐ │un├─┐ └──┘ │ │ │ um │ │ │ │ ┌──┐ │ │ùĝ├─┘ └──┘ ┌────────┐ │ri re│ └────────┘ ┌────────┐ │rí ré│ └────────┘ ┌────────────────┐ │rá re6│ └────────────────┘ ra ru ar ár ┌────────┐ │ir er│ └────────┘ ur úr 17 PHONOLOGY What is known about the pronunciation of Sumerian has come down to us very much filtered through the sound system of Akkadian, the latter itself determined only by comparison with the better known phonemic systems of other Semitic languages. A phoneme is a minimal speech sound (phone), or a small group of related sounds (allophones), which is capable of signaling a difference in meaning. In English, /b/ and /p/ are separate phonemes because they can differentiate two otherwise identical words, for example "bit" versus "pit." A phoneme can have several different pronunciations (allophones, phonological realizations) and still be recognized as "the same sound." For example, when spoken at normal conversational speed English "ten" and "city" feature two different "t" sounds. "City" has a "flapped d" a bit like the "r" in Spanish pero. Every language has a limited number of vocalic and consonantal phonemes which together constitute its unique phonemic inventory. Phonemes are indicated by slashes /b/, phones by square brackets [b]. The Akkadian scribal schools produced signlists and vocabularies which spelled out syllabically how Sumerian signs or words were to be pronounced. These syllabic spellings are the basis of our understanding of the Sumerian sound system, but they are essentially only Akkadian pronunciations of Sumerian vocables. Sounds or distinctions between sounds which did not exist in the Akkadian phonemic inventory were spelled out as best as possible, as the Akkadian speakers heard or understood them. For example, the essential difference between the sounds that we transcribe as /b/ vs. /p/ or /d/ vs. /t/ and /g/ vs. /k/ might have been one of minus or plus aspiration rather than a voiced vs. voiceless contrast as in English, e.g. [p] vs. [ph]. Aspiration refers to a following slight puff of air. Voicing refers to the vibration of the vocal cords. A "b" is voiced, a "p" is voiceless. Unlike English, voiceless stops in French or Dutch, for example, are unaspirated. But Akkadian, like English, probably featured only the latter phonemic contrast, and voiced vs. voiceless is how Akkadian speakers no doubt distinguished and pronounced the Sumerian sounds. Our standard transcription of the Sumerian sound system should thus be regarded as only an approximation of how Sumerian was actually pronounced. VOWELS (§4-15) Vowels definitely known to have phonemic status include /a/, /e/, /i/ and /u/. A few scholars, most notably S. Lieberman, have posited the existence of an /o/ phoneme, but this idea has not yet gained general acceptance. How the four standard vowels actually sounded in all phonological environments will never be known. By convention we pronounce them with roughly "European" values, as in Spanish or German; English speakers should by all means avoid "long" (alphabet) pronunciations: /a/ /e/ /i/ /u/ always as in "father", as in "play" or "pet", as in "tree" or "tip", as in "who" or "hood", never never never never as as as as in in in in "day" or "bat" "she" "lie" "use" Sumerian had no true phonemic diphthongs such as /aw/ or /oy/. but there are indications of /y/ or /w/ semivowel glides between vowels, e.g. written mu-e-a-áĝ possibly pronounced as /m(u)weyaĝ/. A /y/ representing an /n/ before a root may lie behind writings such as ba-e-√ or ba-a-√ for ba-an-√ or ì-a-√ for in-√ in Ur III and OB texts. When transcribing words Sumerologists will sometimes separate neighboring vowels with an apostrophe, as in the personal name written a-a-kal-la but transcribed A'akala. This convention is only for legibility; it does not indicate the existence of a Sumerian 18 aspirated. Gelb MAD 22. Specific assimilation. J. and deletion phenomena will be described individually as they are encountered throughout this grammar. cf. nor is it reflected in Sumerological literature. claims the existence of vowel length within roots. and will certainly turn out to be better described in terms of replacement or deletion of vowels rather than contraction. length usually seems to be only allophonic. As mentioned earlier.. elision.J. serving to take the place of another sound. 2003 13f.glottal stop (a catch or hiatus produced at the back of the throat. Smith in Journal of Cuneiform Studies 59 (2007) 19-38. This rule is not rigorously observed in later periods. Steinkeller maintains that "Sumerian roots did not have (what is traditionally transliterated as) voiceless consonants in the final position" (ZA 71.) is inadequate. both gag and kak as spellings for the noun "peg" or both bàr and pàr for the verb "to spread out. Sumerian stops may originally have featured a contrast other than voiced vs. 32f. 19 . and one should. for example. For the pattern of i/e vowel harmony in Old Sumerian Lagaš verbal prefixes see Thomsen §7." P. Accordingly the final stops permitted are thus only /b d g/ and not /p t k/. CONSONANTS (§16-30) The consonantal phonemes of Sumerian are conventionally represented as follows: STOPS AND NASALS Labial Dental Velar FRICATIVES Dental Palatal Velar Glottal l l2 r Voiced b d g z Voiceless p t k s š h (H) Nasal m n ĝ Uncertain Articulation dr LIQUIDS Stops Stops are consonant sounds which feature an interruption or stopping of the air stream. See now a more nuanced discussion of vowel quality and length by E. I. read gag rather than kak at least in older Sumerian texts. as between the two English words "I am" when pronounced slowly and distinctly). In Pre-Old Babylonian period Sumerian compensatory lengthening exists. probably unaspirated vs. The phenomena she describes have never been studied rigorously and as a whole.M. generally following predictable patterns. Thomsen's discussion of vowel "contraction" (§14f. 27. for example. and since modern scholarship is based heavily upon Akkadian lexical materials the student will consequently encounter transliteration variations even in current Sumerological literature. Thus an Ur III text might write in-gi-ì (presumably pronounced [ingi:] with or without nasalization) instead of in-gi-in (a colon [:] indicates lengthening of a preceding sound). This contrast is the source of some differing Akkadian spellings for the same Sumerian word.). most often the lengthening of a vowel to compensate for the loss of a following /n/. In scholarly works one will find. In all periods both progressive or anticipatory assimilation (conditioned by a preceding sound) and regressive or lag assimilation (conditioned by a following sound) are common in many environments. Edzard. voiceless. Certain vocalic elements will undergo regular sorts of modifications in specific grammatical and phonological environments. Elsewhere. and Sumerologists are only now beginning to use the symbol ĝ in close transliteration to distinguish the nasal /ĝ/ from the stop /g/.The Phoneme /dr/ Most scholars now accept the existence of a phoneme /dr/. 117. the aspirated counterpart of the phoneme we transliterate as /z/ but he claims was pronounced as an unaspirated voiceless [ts]." In §3. More recently. but as yet this character is generally available only in typeset books and journals or in linguistically oriented academic word processing programs like Notabene Lingua." and du7/ru5 "to gore. a composite character which can be found in the character sets of modern word processors. The Velar Nasal /ĝ/ The velar nasal [ŋ]. 5 and Journal of Cuneiform Studies 35 (1983) 249f. and so. based on the existence of its variant sign values dù/rú. Note that in a number of Sumerian words now known to contain /ĝ/ the phoneme may also be found transcribed as an /n/ or /m/. one finds the words kíĝ "work". regardless of the older conventional spellings encountered in the literature. also de5(g)/ri(g) "to fall. Steinkeller. Journal of Near Eastern Studies 46 (1987) 56 n. hun. Jagersma argues for an affricate of the shape [tsh]. J. When learning Sumerian it is vital to learn to write and pronounce correctly all words containing this phoneme. The Akkadian sound system did not feature this phoneme. (If /dr/ is indeed an actual phoneme. The pronunciation is still uncertain.3. properly pronounced as /udrubu/] — especially in texts outside of Sumer (Ebla and Ugarit) — probably indicates that the consonant /*dr/ was a (retroflex?) fricative which was perceived in these areas as /s/ or at least closer to /s/ than to /r/ or /d/. or nimgir for niĝir. Candidates for initial /dr/ include dù "to build"." See P. also spelled /dr/ or /ř/. summarized previous scholars' views concerning /dr/ and concluded that the writings which illustrate it "may be evidence of a sound change in progress (rhotacism) whereby intervocalic /-d-/ became /-r-/. As a result." is now generally transliterated as a /g/ capped by a caret (^) symbol. usually rendering it with a /g/. Edzard 2003. is now beginning to be seen. or even better proper kíĝ. thanks to a special Sumerian orthographic convention. balaĝ "harp" or saĝ "head" are frequently still written simply balag and sag. sometimes also with an /n/ or /m/. Yang Zhi. 18f. Thus gudr+a(k) "of the ox" is written gud-rá while gudr+e "by the ox" is written gud-re6. but rá and re6 remain the standard writings. although a sign value kíg.. but at present there is no equally obvious way to identify such occurrences with certainty." /dr/ has been identified in final position in a dozen or so words. Black in RA 84 (1984) 108f. sanga for saĝa. especially by Akkadologists. For example. we should in fact probably be transcribing the DU sign as drá and dre6 in such cases. 20 . also with /ng/ or /mg/. and alam or alan in current publications. the combination of /dr/ and the following /a/ or /e/ will properly be written with a DU sign. most notably dingir for diĝir. including signlists. to be read either rá or re6 respectively. When a word ending with /dr/ takes a grammatical suffix featuring a vowel /a/ or /e/. Medial /ĝ/ is also seen regularly written ng or mg in a few words. and the Akkadian lexical texts consequently spelled out Sumerian signs or words containing it only approximately.2 of his forthcoming new grammar. as in English "sing. fell. or of synchronic alternation resulting from allophony" and that "There is no need to assume an 'extra' sound which is neither [d] nor [r]. for example. The practice is still not yet universal. More ideal is a /g/ capped by a tilde (~) symbol. proposes instead /r/ with a caret (^).) In the Akkadian-speaking environment of the Old Babylonian school texts the phoneme usually resolves itself orthographically as a simple /d/ sound or occasionally as /r/. It was first thought to be a biarticulated stop. the existence of the phoneme /ĝ/ was deduced only a few decades ago. huĝ "to rent" or alaĝ "figure" still generally written kin. The /dr/ phoneme may well occur in initial or medial position in other words. in Journal of Ancient Civilizations 2 (Changchun [1987] 125) suggested that "The presence of an /s/ in the spelling of this city name [Adab. In English. in all but the newest Sumerological literature the frequent 1st sg. but in unilingual contexts. however. An affricate combines a stop with a following fricative. and so current scholars transliterate the sign as ĝu10 when the value featuring the velar nasal is required. now given the values èĝ and ìĝ alongside áĝ. A sibilant is a fricative produced in the front or middle of the mouth which has a "hissing" quality." i. its correct values. the same sign is used. Fricatives refer to sounds produced by friction of the air stream against parts of the mouth or throat. the so-called women's dialect. The phoneme usually transliterated as /h/ in Sumerological contexts is the sound written "ch" in German "doch.It is now clear that /ĝ/ is a common phoneme in Sumerian. It should be noted. Liquids The precise pronunciations of the liquids are uncertain. as in ĝá-e "I" or ĝuruš "adult male. Fricatives We assume that the Sumerian sibilants /s/ and /z/ were pronounced approximately as in English. Thus. the writing -mu of the possessive pronoun is actually correct in some contexts. The phoneme /š/ is the sound "sh" as in "wish. and pronouncing properly." A velar or glottal fricative is produced further back in the mouth or throat.O. MU-MU) "my name. with the value ùĝ. like "s" or "f. has tried to build a case for the existence of a kind of glottal "barrier" phoneme. as in this grammar. but mu-ĝu10 (wr. For completeness one must also mention the rare value ĝe8(NE) seen in Emesal contexts. for example. In Akkadian contexts and in typeset publications it can be transliterated as an h with a breve below it. the main dialect of Sumerian. which he symbolizes as /H/ and P. /ĝu/ is the proper pronunciation for the word "my" in Emegir. We now know that to render the syllable /ĝu/ the Sumerians used the sign MU. To spell out words featuring the syllable /aĝ/. perhaps a true [h]. 17 for an overview of the orthographic treatment of the phoneme /ĝ/. and that it can occur in any position in a word." The presence of an /ĝ/ in final position is most clearly seen when the word is followed by a suffixed /a/ or /e/. The sign value ĝe26 is relatively new and is only now coming into general use. For the syllable /uĝ/ the sign used was UN. on the other hand. See the Table of Syllabic Sign Values on p. in his 2003 grammar (pp. /eĝ/ or /iĝ/ the sign used was ÁĜ. in which case proper Sumerian orthography employs the sign ĜÁ to write a syllable composed of /ĝ/ and the following vowel. 19-20). although A. the sound occurs only in medial or final position. Compare the participle bùluĝ+a "nurtured" written bùluĝ-ĝá with the infinitive bùluĝ+e+d+e "to nurture" written bùluĝ-ĝe26-dè. and once again the student must be aware of an older writing of a sign while now carefully distinguishing between. which is also used in Sumerian liturgical texts.e. the diacritic can be omitted since. like [ts] or [dz]. while /mu/ is the pronunciation in Emesal. The /r/ phoneme could have 21 . until very recently at least. regardless of context. the Emesal dialect equivalent of the Emegir dialect word /halam/ "to destroy" was pronounced /ĝeleĝ/. In older literature one will find only the sign value ĝá. but we must transliterate it as ĝe26 instead. Unfortunately. If the vowel is /a/. Edzard. as in English "house". If the vowel is /e/. has never been accepted for Sumerian. ĜÁ represents the sound /ĝa/ and we transliterate it as ĝá." . mu "name". that D. Attinger and a few others now symbolize as a glottal stop /'/. possessive pronoun -ĝu10 "my" will still be found written -mu. a voiceless velar fricative [x]." To complicate matters. the existence of a voiceless glottal fricative [h] phoneme. for example. and the latter was normally written out syllabically as ĝe6-le-èĝ. Jagersma now describes /z/ as an unaspirated affricate [ts]. to which consequently we have now assigned the values ĝi6 and ĝe6. thus. To spell out words containing the initial syllable /ĝi/ or /ĝe/ the Sumerians employed the MI sign. and some practice may be needed to pronounce it smoothly when it begins a word. /uzud/ may well reduce to /uz/. Steinkeller (Third-Millennium Texts in the Iraq Museum (1992) 47) following E. offers arguments discounting the existence of a second /l/ phoneme. 1956) 1-44. little further work has been accomplished on stress in Sumerian and its effects on word structure. primarily in the words líl "air". 151. as in Spanish perro vs. It is highly unlikely that it was pronounced like the American English "r" which is a retroflexed vowel rather than a true consonantal sound. Sumerian may have had two kinds of /l/ phonemes. dul/dul4 and in a few more poorly attested roots. or apocope. A similar example may be the adjective commonly written kalag-ga "strong." but which is probably better understood as a syncopated form kalag+a > /kalga/." which had long been read ùz but currently is read ud5 to account for instances with a following -da sign. in which case we should now regularly transliterate kal-ga. The primary /l/ phoneme was probably pronounced approximately as it is in English. Common pronunciation modifications in Sumerian that are probably stress related are instances of aphaeresis. túl. As briefly indicated above." or ù-tu(d)/tu(d) "to give birth. A slightly different phenomenon is the deletion of intervocalic nasals in pairs of sign values such as sumun/sun "old. whence the standard sign value ÙZ. though American scholars may prefer to use that pronunciation in the classroom. also the 3-tablet Emesal-Vocabulary.. Emesal-Studien (Innsbruck. M. some of which is likely due to stress patterns. it is differentiated from the main dialect mainly by regular sound changes. EMESAL DIALECT (§559-566) In addition to the main dialect of Sumerian called eme-gi7(r) or eme-gir15 "native tongue. may be much more extensive in Sumerian than the conservative logographic writing system has led us to believe." used mainly for direct speech of female deities and in religious lamentations and liturgical texts recited by the gala priest recorded from the Old Babylonian to Late Babylonian periods. deletion of sounds at the beginning. for a quick overview of the sound correspondences in context. See Manfred Schretter. when followed by a vowel becomes /uzd/. This second /l/ phoneme is never given any distinguishing diacritic in the literature. It occurs only rarely. that is." AOAT 1 (1969) 157ff." tumu/tu15 "wind. and di4(l)-di4(l)-lá "children" (a specialized pronunciation variant of *tur-tur-ra) and perhaps also in ul. Materials for the Sumerian Lexicon IV (Rome. e. Yoshikawa. Jagersma 2010 also denies its existence. pél "to spoil". Krecher's groundbreaking "Verschlusslaute und Betonung im Sumerischen. Acta Sumerologica 12 (1990) 339344. A reading ud5 would therefore not be strictly necessary. The second /l/ phoneme is evidenced thus far only in final position and in only a few words. When no vowel follows. and so we pronounce it for convenience like a standard /l/.been trilled or flapped. uzud+a > /uzuda/ > /uzda/ written ùz-da." umuš/uš4 "understanding. gibil "new". which." Examples of deleted sounds within reduplicated words are the adjectives dadag "pure" < dág-dág or zazalag "shining" < zalag-zalag. syncope. STRESS-RELATED PHENOMENA Since J." there existed a female dialect or sociolect called eme-sal "thin/fine tongue. but this is only an assumption." etc. 22 . Sollberger has recently reaffirmed a nice solution to the problem of the proper pronunciation of the word for "goat. Compare the variants ù-sún/sún "wild cow. The long form of the word can be understood as /uzud/. See further the appendix to this grammar on p." nimin/nin5 "forty." súmun/sún "wild cow.g. or it could even have been a voiced velar fricative as is found in German or French. pero. middle or the ends of words. We have absolutely no idea of how it was actually pronounced. The phenomenon of sound deletion. occasionally also by substitutions of different words altogether." sumur/súr "angry. though it is attested in Proto-Ea 875 and so must be regarded as the standard OB value. P. 1990) for an exhaustive treatment of the subject. several types of lateral resonants occur among the world's languages. It is indicated orthographically by the use of the sign LÁ rather than LA when a word ending with it is followed by an /a/ vowel as in líl+a(k) "of the air" written líl-lá. ADJECTIVES AND ADVERBS NOUNS AND NOMINAL COMPOUNDS (§47-78) Words that can be classed as nouns in Sumerian." u5 "cabin."thing" or the obsolete formative nu. feminine." bùru "hole." ki-tuš "place (of) dwelling" > "residence. temple.g.such as nam-lugal "kingship"." lú-éš-gíd "man (of) rope pulling" > "surveyor." or zà-mu(-k) "edge of the year" > "New Year. gi-nindana(-k) "reed of one nindan (length) > measuring rod. Compounds featuring the productive formative níĝ. ka-làl "mouth (that is) honey." kù-sig17 "yellow silver" > "gold". or the frozen cohortative verbal forms ga-ab-šúm "let me give it" > "seller. "inanimate." nam-um-ma "old (wailing) women (as a group)"." 2) 3) 4) 5) 6) 7) Gender (§37) Sumerian features a kind of grammatical gender which has nothing to do with the natural gender categories masculine vs. Some grammars use the terminology "animate" vs." gu4-gaz "cattle slaughterer." which can be misleading." and a number of verbal roots employed as nouns such as bar "exterior." saĝ-men "head crown." nu-kiri6(-k) "man of the orchard" > "orchard-keeper. or things." or niĝir-sila(-k) "herald of the street. Abstract nouns derived by means of the abstracting prefix nam. or é "house." Many occupation names are genitive phrases such as lú-ur5-ra(-k) "man of the loan" > "creditor." the last two being genitive constructions." á-dah "one who adds an arm" > "helper." balaĝ-di "harp player." níĝ-sa10 "buying thing" > "price." an-úr "heaven base" > "horizon. Compounds consisting of one or more nouns and a participle such as dub-sar "tablet writer > scribe." an-šà "heaven center. referring to individual human beings." ki-ùr "place (of) leveling)" > "terrace. include primary nouns like dumu "son. but also for 23 ." Genitive phrases are common.g. sacrilege." iri-bar "city exterior" > "suburb." ti "life. Or 39 [1970] 81). Words which are in origin actually short phrases but which function syntactically as nouns." kisal-luh "courtyard cleaner." nam-ti(l) "life. since the impersonal category is used not only for lifeless objects." The stock of primary nouns was relatively limited."person" (< lú). Participles with clear verbal meanings used as substantives such as îl "porter. law." é-šà "house interior." or ba "allotment." or nu-èš(-k) "man of the shrine" > "priest. places. Compounds consisting of a noun and a common adjective such as é-gal "big house" > "palace. e. such as the frozen nominalized verbal forms ì-du8 "he opened" > "gatekeeper" and in-dub-ba "that which was heaped up here" > "demarcation mound" (see Sjöberg." as are many proper nouns. Instead. animals." ĝír-udu-úš "knife (of) sheep killing. and the language relied instead upon a large number of different types of nominal compounds to render experience." za-dím "stone fashioner" > "lapidary. dnin-ĝír-su(-k) "Lord of Girsu" (chief male deity of the capital city of the state of Lagaš)." See the lesson on participles for other such examples. nouns are viewed as either personal." kalam-šà "country interior." nu-bànda "junior (boss-)man" > "overseer. which can function as heads of nominal chains (see next lesson). whether singular or plural." nam-dumu "children (as a group)." nam-úš "death." gan-tuš "let me live here" > "settler. or impersonal. such as níĝ-gi-na "verified thing" > "truth. including most notably: 1) Compounds formed by juxtaposition of primary nouns such as an-ki "heaven and earth.NOUNS. child"." sa-pàr "net (of) spreading" > "casting net." é-kur "house (that is a) mountain" (the temple of the god Enlil in Nippur). nam-mah "loftiness. generally referring to persons viewed as a group (collectives). e." dub-sar-mah "chief scribe." é-muhaldim "house (having a) cook" > "kitchen"." níĝ-gig "bitter/sore thing. varying with plural forms. Sumerian features a great deal of redundancy in the marking of grammatical relations." for example en-en "all the lords. compare the occupation written ugula íl (collective) varying with ugula íl-ne (plural). Number (§65-77) Sumerian nouns may be understood as singular. -e-ne properly appears only when a preceding noun ends in a consonant. /n/ designating near-deixis "this one here". however. for example." Such a form probably represents an abbreviation of an underlying doubly reduplicated form diĝir-gal diĝir-gal. in fact. This rule breaks down by the Old Babylonian period. The original difference between these elements was one of deixis (pointing. and the demonstrative suffix -ne "this" and independent demonstrative pronoun ne-e(n) are certainly related to the possessive suffix -(a)ni "his."by/for them" and the nominal personal plural marker -(e)ne. while OB lú-ù-ne (< lú-e-ne) "persons" is a common but hypercorrect writing (the epenthetic vowel often assimilates to a preceding vowel). the impersonal by the element /b/. and "objectified" individual persons referred to scornfully or dismissively — all of which are certainly animate. It is important to note that the language is flexible and does not always show a plural form where we might expect it. that"." Reduplication of adjectives may serve the same function as reduplication of nouns. a construction that is rare but definitely occurring. the personal category is nearly always signalled by the presence of a consonantal element /n/. A number of nouns are intrinsically collective. plural.animals. and in the marking of personal dative objects. In addition. and the notion conveyed is possibly something akin to "all individual persons or items. Thus lugal-e-ne "kings" and dumu-ne "sons" are correctly written. her" and probably also to the personal plural locative-terminative verbal infix -ne. The basic form of the suffix seems to have been simply -ne." The noun is plural. demonstrating). living things." In Old Sumerian texts collectives are very common. groups of persons. both meaning "foreman of porters. for example érin "workers. and /b/ far-deixis "that one there. their" and as a demonstrative "this. every single lord. To summarize the marking of number on nouns: No Mark The noun is usually singular. The Sumerian pronominal suffix -bi." As in many other languages. In the pronominal paradigms where the distinction is maintained. in the marking of plural nouns. or collective (referring to items or individuals viewed as a group) in number. and vice versa. but may also be understood as plural or collective. and so. functions both as a possessive pronoun "its. as in diĝir-gal-gal "all the great gods. An explicit mark of the plural of personal nouns only (note that it features the personal gender deictic element /n/). The converse is true in 24 Reduplicated Noun Reduplicated Adjective Plural Suffix -(e)ne . information supplied by the verb or by the context will help to clarify. an explicit nominal marker of the plural can be omitted from the subject noun with no loss of meaning. the 3rd person pronominal forms probably developed from demonstratives. if a subject is already marked as plural by a verbal affix. impersonal distinction is made evident only in certain 3rd person pronoun forms. The personal vs. where the epenthetic /e/ vowel may appear even when it is not needed to separate the initial /n/ of the suffix from a preceding consonant. troops" or ugnim "army. it never occurs with animals or things. 3 dabin àga-ús é-gal-la ì-gu7 3 (ban) barley meal was eaten by the guards in (-a) the palace (Nik I 131 1:4-2:1 OS) Here "guards" is a collective. mighty." tur "small." Reserved usually for assortments or mixtures of animals or things. for example kalag-a "strong. even though these seem to function as simple adjectives without any recognizable past participial meaning. 376-403. Suffix -hi-a A past participle meaning "mixed. but even after J. can be produced from verbal stems using the nominalizing (relativizing) suffix -a. -(e)ne may co-occur with plural reduplication. it is ordinarily difficult to sense a difference in meaning between an adjective with and without -a. 25 {dab5+a+(e)ne} {àga-ús+(e)ne} . Thus the noun lugal may be translated "the king. either definite ("the") or indefinite ("a").g.0." Adj." cannot be convincingly demonstrated.4 dabin àga-ús-ne gu4-da ì-da-gu7 4 (ban) barley meal was eaten by the guards with (-da-) the oxen (Nik I 130 1:1-3 OS) Here "guards" is written explicitly plural. for example zi(d) vs. lú-du10-ga "the good man.Old Sumerian: -ne often appears where -e-ne is expected. see Thomsen §80).0." A third kind of adjective regularly takes the same suffix -a. for example é dù-a "the house which was built" > "the built house." "a king. ADJECTIVES (§79-83) Forms of Adjectives Simple adjectives like gal "big. Finally. zi-da "righteous." or the like." or ĝen "ordinary" are basically verbal roots functioning as noun modifiers: iri-gal "the big city. for example: u8 udu-hi-a "assorted ewes and rams" or anše-hi-a "various donkeys (of different ages or sexes). Another common kind of adjective. lú šuku dab5-ba-ne The men who (-a) took subsistence allotments (HSS 3. then the contrast may consist in whatever slight difference in meaning can be discerned between a simple adjective as a kind of present participle "good man" and a past participle lú-du10-ga "the man who is/was good." for example lú-du10(g) "a good man" vs." mah "great." That the distinction may be one of lesser or greater "determination" or "definiteness." dumu-tur "the small child. 0. e." Several examples: 0. Krecher's major 1978 study (Or 47." lugal-lugal-ne "all the kings. also in form a (past) participle. Finally. If the adjectival suffix -a is truely identical with the nominalizing particle -a." Whether this -a is indeed identical with the nominalizing suffix -a is still a matter of occasional controversy." or just "king" as required by the context. 2 1:2 OS) ARTICLES Sumerian has no articles. common adjectives may also occasionally take the suffix -a." In form they are perfective participles (described in the final lesson). en-en-né-ne "all the lords. " Occasionally one encounters such revealing syntax as péš ĝiš-gi níĝ kun-gíd kun-gíd-da "canebrake mice. and it seems clear that this reduplication may signify either intensification of the adjectival idea or plurality of the modified noun (as noted above). the plural reduplication of roots commonly seen in verbal forms is naturally to be expected also in adjectives. níĝ-gi-gina "all the laws" (Gudea Statue B 7:38 Ur III). Since adjectives are basically verbal roots. The third example shows the same construction with kalag. e. Thus diĝir-gal-gal might indicate "the very great god" or "the great gods. law" {gi(n)+a} vs. 53 3:2-3 OS) Reference to a single bread makes the meaning unambiguous. Cf.tigi-níĝ-du10(-ga) Constructions Related to the problem of adjectives marked with the suffix -a are appositional attributive constructions which employ the term níĝ "thing" between a head noun and a modifying adjective that often. kal-kal "very precious." vs." Following are two examples featuring adjectival roots with suffix -a and a níĝ which seems to serve only a stylistic purpose. though not always. further the plural past participle de5-de5-ga "collected ones (dead animals)" or níĝ-gi-na "right thing. 1 extra-small beer-bread (Genava 26. which regularly takes the suffix -a: dím-ma níĝ sa6-ga Excellent judgment (Šulgi B 10 Ur III) ĝišbun níĝ du10-ga mu-un-na-an-ni-ĝál He produced a fine banquet there (-ni-) for her (-na-) (Iddin-Dagan A 204 OB) uruda níĝ kal-ga Strong Copper (Debate Between Copper and Silver passim OB) Multiple adjectives A noun can be qualified by multiple adjectives.g. 26 {du10(g)+(a+)ak+am} {sa6(g)+a} {du10(g)+a} {kal(a)g+a} {zu+a kal+a+(a)ni} . for example: anše tur mah donkeys small and big (Nik I 203 iv 1 OS) sá-du11 kas gíg du10-ga-kam it is (-am) a regular offering of (-ak) good black beer (TSA 34 3:10 OS) (lú) zu-a kal-la-ni (persons) who were known and dear to him (Lugalbanda and Enmerkar 5 OB) Reduplication of Adjectives Adjectives are often reduplicated. immaculate. Some textual examples: 4 ninda-bàppir-gal-gal 1 ninda-bàppir-tur-tur 4 extra-big beer-breads. šen-šen "very clean. where one might otherwise expect just níĝ kun-gíd-gíd-da. A good example is the poetic expression tigi níĝ du10-ga "tigi-hymn which is a good thing" = "the good tigi-hymn. including participles (marked with -a)." Many common adjectives reduplicate to indicate intensity. kal "precious" vs. within a nominal chain. things with very long tails" (Nanna's Journey 275 OB)." or šen "clean. features the suffix -a. 2 mùd gaz-gaz-za 2 smashed m. e. clean. THE IMPERSONAL GENDER CATEGORY REFERS TO PERSONS VIEWED AS A GROUP. si12si12(SIG7) vs. though with a change in the writing: OS bar6-bar6 > OB babbar(BAR6). notably ku7-ku7 "sweet. Civil. color terms tend to be reduplicated. In this grammar adjectives will generally be linked in transliteration except when to do so would produce awkwardness or render a nominal chain less clear. Compare common OB ku10-ku10 (or kúkku)) "dark. In early texts some color adjectives are explicitly reduplicated. For the term "white" the reduplicated pronunciation continues into later periods. but the adjective is ambiguous. In modern editions more and more scholars are now beginning to omit the hyphens and transliterate adjectives as words separate from their head nouns. More frequent was the writing gíg which is probably always to be read giggi(GÍG)." Other color terms are only sometimes reduplicated in later periods. dappled. 27 . dim-gal-gal ki-a mi-ni-si-si Many (very) big mooring poles he sank into the earth (Gudea. 1:1 OS) Reference to a single pine makes the meaning unambiguous." Transliterating Adjectives In older text editions adjectives are regularly transliterated linked with hyphens to the nouns they modify." A few non-color adjectives are also standardly reduplicated. REMEMBER: THE PERSONAL GENDER CATEGORY REFERS TO PERSONS VIEWED INDIVIDUALLY. Both conventions have drawbacks. but linking can also produce awkwardly long chains and can tend to obscure the notion of what is a "word" in Sumerian. AND TO THINGS. The term "black" on the other hand was rarely written reduplicated: gíg-gíg. zazalag (< zalag-zalag) "shining. 32. TO ANIMALS. Linking the adjective aids in analysis and translation by emphasizing the structure of the nominal chain involved.-vessels (DP 488 2:2 OS) Unclear: plural reduplication or "smashed to bits"? {gaz-gaz+a} In languages like Sumerian which show reduplicated nominal or verbal roots.". sig7(-ga) "yellow/green. Cyl A 22:11 Ur III) Verb shows plural reduplication. 44. gùn(-na) "multi-colored. WHETHER SINGULAR OR PLURAL. EBLA 1975-1985 (1987) 155 n.1 gišù-suh5-gal-gal 1 very large pine (VS 27. See the discussion by M.g. or gùn-gùn(-na) vs." dadag "pure" (< dág-dág). and that the initial /a/ or /e/ of the suffixes -(a)ni or -(e)ne is not present when the preceding element ends in a vowel. In what context below. Below. e. the expected orthographic realizations will be shown as sequences of sign values linked by hyphens (-). grammatical analyses will be shown as sequences of lexical and grammatical elements linked by pluses (+). indirect object.THE NOMINAL CHAIN An ordinary Sumerian verbal sentence or clause will feature a verbal complex and one or more nominal complexes which correspond to such English syntactic categories as subject. does one find the written sign value né(NI) rather than ne. object. or the choice of one sign rather than another in the writing of the same syllable in different grammatical contexts. gal+a > gal-la rather than gal-a. taking the form: ┌──────────────┐ │PRONOUN + CASE│ └──────────────┘ In all subsequent illustrations of simple nominal (and verbal) chains. All nominal chains consist minimally of two elements: a head noun (simple. The next several lessons will discuss the component elements of nominal chains. As you begin. and adverbial or prepositional phrases. for example.g. Because these complexes are partly agglutinative linkages of stems and affixed grammatical elements. you will note that the final /i/ vowel of the possessive and demonstrative suffixes -(a)ni and -bi is regularly deleted before the plural marker -(e)ne. they have come to be referred to as chain formations or simply chains. for example. if present. be careful also to note also regular orthographic conventions such as the optional non-significant "picking up" of a final consonant of a root in a syllabic sign used to write a following vowel. Such chains are therefore always quite short. In all illustrations of grammatical phenomena throughout this grammar. The ordering of elements in the most basic type of nominal chain is as follows: Required Optional Required ┌────┐ ┌────────────────────────────────────────────────────────────┐ ┌────┐ │NOUN│ + │ADJECTIVE + POSSESSIVE/DEMONSTRATIVE PRONOUN + PLURAL (e)ne │ + │CASE│ └────┘ └────────────────────────────────────────────────────────────┘ └────┘ An independent pronoun may take the place of a noun in a nominal chain. and how each resulting chain is finally represented by the writing system. or reduplicated) and a case marker which indicates the relationship between the head noun and the other parts of the sentence. The head noun may be modified by several other elements which. pay particular attention to the ways in which stems and agglutinative grammatical affixes combine and affect each other phonologically. fall between it and the case marker in a definite sequence. compound. or bé(BI) rather than bi? What grammatical information is conveyed by these different writings? It is highly likely that certain Sumerian orthographic practices were designed intentionally to supply clues to correct understanding of forms! Chain Elements dumu+Ø dumu+(a)ni+Ø > > Written Realization dumu "the son" (subject) dumu-ni "his/her son" Case and Optional Affixes absolutive case (-Ø} possessive + absolutive 28 . The position of each permitted class of element in the nominal chain is referred to as its rank order within the chain. but no modification of the pronoun is permitted. either by a genitive construction or when the ADJECTIVE slot in the chain is filled by more complex attributives such as relative clauses or other types of appositions. each unit. To illustrate. It can be a nominal compound such as those described in the previous lesson." or an apposition such as iri uríki "the city Ur. when modified by a following element. Keep in mind that the head noun of a nominal chain need not be a single noun." For example: dub-sar-tur-re-ne en en-bi the junior scribes all those lords 29 ." an asyndetic compound of two different nouns such as an ki "heaven (and) earth" or ama ad-da "mother (and) father. the last example above can be progressively built up as follows: {dumu + tur} {{dumu + tur} + bi} {{{dumu + tur} + bi} + (e)ne} {{{{dumu + tur} + bi} + (e)ne} + da} small son that small son those small sons with those small sons The analysis of a nominal chain becomes a bit more difficult when the head noun is further modified. Such expanded types of nominal chain will be described in later discussions of the genitive case marker and of the nominalizing suffix -a. and so forth. larger unit which then may be modified by another following element. forming with that element a new. a noun pluralized by reduplication such as diĝir diĝir "all the gods.dumu+(a)ni+e dumu+bi+e dumu+(e)ne+Ø dumu dumu+Ø dumu+tur+ra dumu+tur+(a)ni+Ø dumu+tur+bi+ra dumu+tur+(e)ne+ra dumu+(a)ni+(e)ne+ra > > > > > > > > > dumu-né "by his/her son" dumu-bé "by that son" dumu-ne "the sons" dumu dumu "all the sons" dumu-tur-ra "for the small son" dumu-tur-ra-ni "his/her small son" dumu-tur-bi-ra "for that small son" dumu-tur-re-ne-ra "for the small sons" dumu-né-ne-ra "for his/her sons" dumu-tur-bé-ne-da "with those small sons" possessive + ergative case (-e} demonstrative + ergative plural + absolutive reduplication + absolutive adjective + dative case (-ra} adjective + possessive + absolutive adjective + demonstrative + dative adjective + plural + dative possessive + plural + dative adjective + demonstrative + plural + comitative case (-da) dumu+tur+bi+(e)ne+da > When analyzing longer nominal chains it is sometimes helpful to think of a chain as a concatention of subunits. REMEMBER: A PROPER NOMINAL CHAIN REGULARLY ENDS WITH A CASE MARKER! THE PARTS OF A NOMINAL CHAIN ALWAYS APPEAR IN A FIXED ORDER. in accordance with their rank-order position within the nominal chain. See G. usually the goddess Inana: kù dinana(k) "Holy Inana. often with short adverbial expressions as in ana+šè+(a)m ("what" + terminative case + copula "it is") > a-na-šè-àm "it is for what" = "why?"." or ùĝ saĝ-gig2-ga "the people having Black Heads" = the Sumerians. See the later lesson on the copula. LUMMA (Padova. A copula may also follow a case marker. where the adjective kù(g) "holy" is often found preceding the name of a divinity. and the relationship of that chain to the rest of the sentence will be indicated by the verbal chain or must be inferred from context." Compare ki-siki-bi-ta-me "they (the women) are (-me) from (-ta) that place of wool (weaving)" (HSS 3." Perhaps kù here is better described as a foregrounded (emphasized) adjective standing in apposition to a following noun: "the holy one." This poetic form must be kept distinct from personal names which are genitive constructions of the form kù-dDN(-k) "Silver of (a Divine Name). 384. When this occurs. which is to be translated not "king who is a weighty arm" (apposition) but rather "king who has a weighty arm. Preposed adjectives Adjectives virtually always follow the nouns they modify. This term from Sanskrit grammar means "(having or characterized by) much rice" and describes paratactic phrases such as lugal á-dugud. 2006) 73 n. 24 6:11 OS). KEEP THIS RANK ORDER FIRMLY IN MIND! 30 ." Likewise é bur-sa7-sa7 is a "temple having many beautifully formed bur vessels. the copula can replace the final case marker." which have Akkadian parallels of the shape kasap-DN. One frequent exception occurs in literary texts. Inana. or in predicative genitive constructions such as ĝá+ak+am ("I" + genitive case + "it is") > ĝá-kam "it is of me" = "it is mine.an ki-a ama ad-da-ni iri Lagaški-a Bahuvrihi modifiers in (-a) heaven and earth his mother and father in the city Lagaš Another very common type of modification of the head noun in Sumerian is the bahuvrihi attributive. Copula-final chains A nominal chain will sometimes end with an enclitic copula (one of Sumerian's two verbs "to be"). Marchesi. INDEPENDENT PRONOUNS (§90-99) The following are the standard citation forms: ┌────────────────────────────────────────────────────────────┐ │ │ I. Such secondary forms may have originated by analogy with the fuller paradigms of Akkadian. the 1st and 2nd plurals are merely free-standing forms of the enclitic copula: -me-en-dè-en "we are. This -e element probably had an original determining or topicalizing function. Fuller paradigms can be reconstructed from the later literary and grammatical texts produced in the Akkadian scribal schools. In other cases forms are as yet not attested or probably never existed at all. her │ │ │ │ Pl 1 me-en-dè-en (it is) we. Alternately. especially combined 31 ." -me-en-zé-en "you are. and some are obviously secondary. the independent pronouns are generally used only for emphasis or clarity. us │ │ 2 me-en-zé-en (it is) you │ │ 3p e-ne-ne (older a-ne-ne) they (personal). some pronominal forms are only attested from periods in which Sumerian was no longer a living language — in some cases only in scholastic grammatical texts — and these must be viewed with caution. Finally. especially 1st and 2nd plurals (see. the two forms may be historical elisions: /ĝae/ > /ĝe:/. The 3rd person forms a-ne and a-ne-ne are found in the Gudea texts and earlier. in earlier periods at least. filled in the paradigms with artificial forms of their own creation. should actually be read ĝe26-e (just ĝe26 in Gudea). pronominal elements which are theoretically predictable but not yet actually or reliably attested are indicated by a question mark (?). The chief exception is their use in nominal sentences. she. Note that what appears to be the demonstrative (or ergative?) suffix -e seems to have been historically added onto the later forms of some of these pronouns.PRONOUNS AND DEMONSTRATIVES Early Sumerian texts preserve only a relatively small number of basic pronouns. it is possible that the normal citation form of the 1st sg. The Summary of Personal Pronoun Forms illustrates how they combine phonologically and orthographically with following case markers. /zae/ > /ze:/. for example. him. A few may even have been the work of Akkadian scribes who. the independent pronoun paradigm below). In the various pronominal paradigms detailed throughout this introduction and also gathered together for ease of comparison in the Summary of Personal Pronoun Forms at the end of this lesson. me │ │ Sg 1 ĝá-e (older ĝe26) │ 2 za-e (older zé) you │ │ 3p e-ne (older a-ne) he. most plural forms are conspicuously absent. while elements which the general pattern of the language seems to preclude entirely are indicated by a dash (—). but the traditions behind these sources are uncertain and the forms they display often seem fanciful or otherwise doubtful. In view of the 2nd person sg. Whatever the source. independent pronouns can appear as heads of nominal chains and take case postpositions to indicate their relationship to the rest of the sentence. form zé‚ found in the Gudea inscriptions. unhappy with the more limited Sumerian patterns. them │ │ │ └────────────────────────────────────────────────────────────┘ (or ĝe26-e) (OB also èn) Like nouns. Many Sumerian pronominal forms appear to be historically related." Since the affixes of the verbal complex are already capable of expressing most required pronominal ideas. Compare the paradigms of the possessive pronouns plus following absolutive. that if a sentence seems to lack a needed ergative or locative-terminative case marker it may well be hidden in a possessive suffix. ĝá-a-kam "it is mine. in the Gudea texts. is not related either to the 1st sg. e." for which see the next lesson. attested in the living stages of the language.) -zu-ne-ne by your -zu-ne-ne-a in your │ │ 3p -(a)ne-ne their -(a)ne-ne by their -(a)ne-ne-a in their │ │ │ └─────────────────────────────────────────────────────────────────────────────────┘ The first column shows the standard citation forms of the possessive pronouns. 2075 BC) we find -ĝu10-u8 < -ĝu10-e. In the Ur III Shulgi hymns (originals composed ca. Note that the mark of BOTH the ergative and the locative-terminative cases is -e. independent pronoun or to the verb ĝen "to come. i. See also Thomsen §105-106. and a nominal chain showing only a possessive at the end could therefore represent either a syntactic subject/patient (absolutive case) or an ergative agent or a locative-terminative indirect object. I would add the following notes and alternative explanations to Thomsen's description of these elements: The main task involved in learning the possessive suffixes is recognizing the ways in which they combine with following elements. an assimilation of -e to the preceding /u/ vowel and a possible lengthening: /ĝue/ > /ĝuu/ pronounced [ĝu:]. the singular forms in particular since many plurals are rarely. the case of the subject or patient. conventionally represented by the symbol Ø). is a zero morph (i. probably to be transliterated rather as -(a)-né-e. for example such writings as -(a)-ni-e in the royal inscriptions of Gudea (ca.with the genitive and the copular verb "to be" in predicative genitive constructions. The mark of the absolutive." POSSESSIVE SUFFIXES (§101-110) The Form of the Possessive Pronouns The Summary of Personal Pronoun Forms illustrates how the possessive suffixes combine with following case markers (be aware that most plural forms are hypothetical). obvious form after possessives. no overt suffix.e. then. and locative case markers: ┌─────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ABSOLUTIVE (-Ø) ERGATIVE (-e) LOCATIVE (-a) │ │ LOC. ergative. (-e) │ │ │ my -ĝu10 by my -ĝá in my │ │ Sg 1 -ĝu10 │ 2 -zu your -zu by your -za in your │ │ 3p -(a)ni his/her -(a)né by his/her -(a)na in his/her │ │ 3i -bi its -bé by its -ba in its │ │ │ │ Pl 1 -me our -me by our -me-a in our │ │ 2 -zu-ne-ne your (pl. Thus the phrase lugal-ĝu10 could represent either "my king" {lugal+ĝu10+Ø} or "by my king" {lugal+ĝu10+e}. You will recall from the discussion of the rank order of the nominal chain that the elements which can follow possessives in a nominal chain include only the personal plural marker -(e)ne. the case markers. Keep in mind. however. Note in passing that the interjection ga-na "Up! Come on!" found. 32 . one normally cannot distinguish between possessives with and without a following -e. 2120 BC). and/or the enclitic copula. for example.g. On the whole. if ever.-TERM. In normal orthography -e seldom appears in any clear.e. Exceptions do occur. the locative should never elide to any preceding vowel regardless of the context. as in lú-ù-ne instead of lú-ne < lú+(e)ne "men. and neither should we. Thus lugal+ani+Ø "his king (subject)" should be transliterated as lugal-a-ni. or lugal-(e)ne. lugal(a)-ni. These helping vowels are regularly written in classical OB Sumerian. but lugal+ani+e "by his king" (ergative) as lugal-a-né. which usually occurs with a sg. as zà-bi-a and é-ba. barring a few erroneous -ne-ne-ne forms): ┌───────────────────────────────────────────────────────────────────┐ │ │ │ SINGULAR PLURAL │ │ │ my king lugal-ĝu10-ne my kings │ │ 1 lugal-ĝu10 │ 2 lugal-zu your king lugal-zu-ne your kings │ │ 3p lugal-a-ni his/her king lugal-a-né-ne his kings │ │ 3i lugal-bi its/their king lugal-bé-ne its kings │ │ │ └───────────────────────────────────────────────────────────────────┘ 33 . -zu-ne-ne is the proper possessive pronoun. Transliterate as written: lugal-ni. In fact. the NI and BI signs can also be read né and bé. The first shows the two terms zà-ba "at its edge" and é-bi-a "within its temple" while the second writes the same forms. In reading texts one will encounter the possessive chain -zu-ne as well as the paradigmatic 2nd person pl. lugala-ni." -zu-ne represents a 2nd person sg. possessive suffix -zu-ne-ne. unattested. Exceptions to the standard paradigm do occur. persons. Do not confuse them. element paradigm shown immediately below. Compare the similar use of /e/ in the personal plural marker -(e)ne. but unlike them it always appears overtly after the /e/ vowels of the plural possessive pronouns. lugal-ne.g. Thomsen (§104) believes that the initial /a/ vowel of the 3rd sg. head noun. to my knowledge.) sons. the choice of values is entirely up to the reader of a text. and that an epenthetic or helping vowel /a/ is inserted before them whenever a preceding stem ends in a consonant." The rank order of the nominal chain permits the insertion of a personal plural marker between a possessive suffix and a following case marker.) son. Like ergative and locative-terminative -e it properly replaces the /u/ and /i/ vowels of the singular possessive pronouns. Statue B 8:34-37 and Cylinder B 18:1-3. e. 16 above) shows. and pl. Having lost contact with the practices of the spoken language. It is the view here. ergative and locative-terminative forms compare the possessive pronouns + personal pl. later scribes even begin to regard the helping vowels as required parts of the suffixes and often write helping vowels where they are not needed. The variation must be stylistic. -zu suffix plus the personal pl. forms -(a)ni and -(a)ne-ne is deleted before vowels. in earlier periods.g. rather." Do not yield to the temptation of adjusting early. For the deletion of the /i/ vowels in the 3rd person sg. etc. The Sumerians probably pronounced the helping vowels. especially in connection with the pronominal suffixes -(a)ni and -bi. and it indicates a plural personal noun. The locative case is marked by the suffix -a. conversely. Thus. but are frequently omitted. but they felt no need to write them consistantly.Related to this phenomenon is the matter discussed by Thomsen in §107. Though it is not universal practice. e. element -(e)ne. while the later Akkadian scribes will adhere to the rules and regularly write lugal-a-ni and lugal-e-ne. in this grammar the presence of a presumed case marker -e after the possessive suffixes -ni and -bi will consistently be indicated by the transliterations -né and -bé. they render different ideas. apparently "defective" writings by inserting an /a/ or /e/ into your transliterations of actual text. As the Table of Syllabic Sign Values (p. The plural marker -(e)ne combines with the singular possessives as follows (plural suffixes plus -(e)ne are. Compare two nearly exactly parallel Gudea passages. that the basic shapes of the pronouns are -ni and -ne-ne respectively. for example dumu+zu+(e)ne > dumu-zu-ne "your (sg. dumu+zunene > dumu-zu-ne-ne "your (pl. however. at least in writing. a Pre-Sargonic or Gudea text may write lugal-ni "his king" or lugal-ne "kings". evil-doing.e. inimical ones: in order to perform their smiting (i.e. see next lesson). associated vowels serving in many contexts only prosthetically or epenthetically — i. Conversely. Cat 533:7-10 Ur III) nin9 bàn-da-ĝu10-gin7 ír-ĝu10 hé-še8-še8 May you weep my tears (i.Note that the epenthetic vowel /e/ of the plural marker -(e)ne does not appear after the /u/ vowel of the 1st and 2nd person forms. 130:10-11 Ur III) tukum-bi Ur-àm-ma sipa nam-érim-bi ù-un-ku5 dub-bi zi-re-dam If Ur'amma the shepherd has sworn an oath about this. these pronouns can also indicate a more general referential connection between the possessor and the possessed. Compare the similar phenomena in the possessive pronoun plus ergative case paradigm above. the one concerning this) is to be canceled (Fish. Uses of the Possessive Pronouns In addition to literal possession.e. be bitter to him)! (Urnamma 28 2:13-14 Ur III) en-líl-le sipa dur-dnamma-ra ki-bala érim-gál-la-né si mu-na-an-sá Enlil put in order for Ur-Namma his hostile rebel lands (i. the one loved by her). personal -(a)ni and impersonal -bi is deleted.e. and these deletion patterns provide good illustrations of the view held throughout this grammar that in Sumerian the preponderance of grammatical information is conveyed principally by consonantal elements. as helping or anaptictic sounds at the beginning or in the middle of words respectively — to initiate or separate consonantal elements and so to render them pronounceable. the revealing of it)? (Šulgi C 111 Ur III) á-tuku hul-ĝál érim-du-bé-ne tu10-tu10-bi kè(AK)-dè Its mighty. JCS 21. its tablet (i.e. He shall not bring up its complaint (i. (Enmerkar and Ensuhgirana 277 OB) (2) They can indicate an objective genitive relationship: a-ba-a ĝá-gin7 búr-búr-bi mu-zu Who like me will know its revealing (i. The same deletion of /i/ occurs when -(a)ni or -bi are followed by the genitive (-ak) or locative (-a) postpositions (producing -(a)na or -ba. 29 1:46-48 Ur III) (3) They can indicate kinds of indirect object relationships: nam-ti-il níĝ-gig-ga-ni hé-a May life be his bitter thing (i. TCS 1. a complaint about it)! (Sollberger. those hostile to him) (Urnamma B 14 Ur III) inim é-gal-kam inim-ĝar-bi nu-mu-tùm It is a command of the palace. and /e/ does appear after the resulting consonantal elements /n/ and /b/. the smiting of them) (Civil. tears concerning me) like my little sister! (Dumuzi's Dream 14 OB) 34 d . the /i/ vowel of the 3rd sg.e.e.e.e. (1) They can indicate a subjective genitive relationship: ki-áĝ-ĝá-ni-me-en You are (-me-en) her beloved (i. an-[nu-ú] "this" (Emesal Vocabulary III 157 in MSL IV 42). Sale Documents No. "this one here. -ne "this" 35 . and so it can be translated "its.e. that. referring to far-deixis. 271). or just ne (compare the copular form ne-me "these are they" in Steinkeller. a figure of himself) and set it up for prayer (Gudea Statue M 2:7-3:2 Ur III) {mu+n+da+n+nú} iri-na ú-si19-ni zà-bi-a mu-da-a-nú In his city. 45:10 Ur III). those" depending upon context. AOAT 25. níĝ ne-e "(who has done) this thing" (Ur-Namma A 156). the seed for the begetting of me) in the womb (Gudea. which identifies ne-e as the Emesal pronunciation of the main dialect word meaning "this thing.e.e. This demonstrative also occurs as an independent pronoun ne-en. ones made of them) be fit for the king's palace! (Enki and the World Order 221f. Steinkeller. Cyl A 3:8 Ur III) alaĝ-na-ni mu-tu nam-šita-e ba-gub He created his stone figure (i. Sale Documents p. those unclean with respect to him) he made lie at (-a) its edges (Gudea Cyl B 18:1) giš giš tir-zu mes kur-ra hé-em gu-za-bé é-gal lugal-la-ke4 [me]-te hé-em-mi-ib-ĝál May your forests be of mountain mes-trees! May their chairs (i. this" -bi functions both as the 3rd sg. p. ne-e. his unclean ones (i. its dwelling (i. 93 n.e. their. For a possible etymology note ne-e = níĝ-e = Akk.arhuš-ĝu10 igi-ni-šè hu-mu-ra-ab-bé May you say my mercy (i. impersonal possessive suffix and as the most commonly used demonstrative. mercy for me) before him! (Hallo.e. 218:36 Larsa letter) ĝá-e ús-sa-zu-me-en I am your follower (i. 34 n. dwelling in it) was not suitable there (Lament over Sumer and Ur 307) {tuš+e+bi+Ø} (4) They can indicate an even more tangential connection or relationship: a-ĝu10 šà-ga šu ba-ni-du11 You put my seed (i. 59. "that one there." though frequently its demonstrative force is more general: "the pertinent or relevant one. this.e." In certain contexts it has been compared to the article "the" (P. OB) DEMONSTRATIVE ELEMENTS (§133-138) -bi "that. the one who follows after you) (Enmerkar and Ensuhgirana 278 OB) é-gal-la-na níĝ-gu7 la-ba-na-ĝál tuš-ù-bi nu-ub-du7 In his palace there was nothing for him to eat.e. The demonstrative sense is probably the more basic." Cf." -ne is rare. do not confuse it with the personal plural suffix -(e)ne. -ne indicates near-deixis. recede. way over there. in olden times. especially in standard expressions built on the noun gú "river bank. Civil & R. They normally occur with case markers and/or the copula to form a variety of interrogative expressions. enclitic copula "he/she/it is"): a-ba-àm a-na-aš/šè(-àm) a-na-àm a-na-gin7(-nam) me-a me-šè me-ta cf. the" -še "that nearby" ur5 "this (one)" INTERROGATIVE PRONOUNS (§111-127) The basic interrogative pronouns are a-ba "who?" (personal). a-na "what?" (impersonal).. Green.. -e seems to have a a near-deixis or determining force. e. It may have the sense "near one's adressee" (M." It is often combined with a possessive suffix and dimensional case postposition to produce adverbial expressions such as: ní-ba ní-bi-ta ní-bi-šè in itself by itself for itself Used with genitive -ak it may be translated "(one's) own" as in é ní+ĝu10+ak+a > é ní-ĝá-ka "in (-a) the house of (-ak) my self" > "in my own house." A related expression is built on the nominal compound ní-te (var." Like its counterpart -ri.g. "that one yonder. and me-a "where?"." -e "this." Compare the later lexical equivalent nesû "to withdraw. JCS 30 (1978) 145). over here" (Enlil and Sud 70 OB). occurring especially in such phrases as ur5-gin7 "like this. Biggs.." or modified by a possessive suffix as in ní-zu "yourself.-ri "that one there" -ri indicates remoteness in space or time." Non-lexical references are somewhat rare except in stereotyped phrases. over there . "(as for) this one. it functions as an adjective. the so-called Isolating Postposition -ri." The connection of this -ri with a homophonous suffix. The commonest such expressions include (-am is the 3rd sg. relax.. It occupies the position of an adjective in the nominal chain. -še is a rare suffix known mainly from lexical sources. thus" or ur5-šè(-àm) "because of this. RA 60 (1966) 7). This is an independent impersonal pronoun. remains unclear (see M. me-te) – unrelated to the above compound verb "to cool oneself" – occuring in such expressions as: 36 . en-šè it is who? (it is) for what? it is what? (it is) like what? in where? towards where? from where? to until? = = = = = = = = who is it? why? why? how? where? whither? whence? how long? REFLEXIVE EXPRESSIONS (§129-132) ní "self" can occur either as a self-standing noun as in the compound verb ní . gú-ri-ta .te(n) "to cool oneself.g. en-na-me-šè. gú-e-ta "from yonder side. way back then. u4-ri-a "on that remote day." e. from this side. e." or u4 "day." lú-na-me níĝ-na-me ki-na-me u4-na-me neutral term and may be translated verbal form with which it occurs "some king did not come > no king ki "place. e.g. e. it has also been described as an indefinite pronoun. it may be transliterated either linked with a hyphen to a preceding head noun or left as a self-standing word. anything. herself by himself by themselves his/her own {ní-te+(a)ni+Ø} {ní-te+(a)ni+e} {ní-te+(a)nene+e} {ní-te+(a)ni+ak+Ø} INDEFINITE ADJECTIVE (§128) The indefinite adjective na-me "any" functions as a positively or negatively depending upon whether the is positive or negative. 77:5 Ur III). any(one). nowhere sometime. never Since it is often used elliptically." It often modifies lú "person." níĝ "thing. And like other adjectives it will normally appear in a nominal chain ending in a case marker. <lú> na-me.ní-te-ni ní-te-né ní-te-ne-ne ní-te-na himself. THEIR" ALSO REGULARLY FUNCTIONS AS A DEMONSTRATIVE "THIS. none something. RELATIVE PRONOUNS The following nouns or interrogative pronouns can function as virtual relative pronouns in contexts discussed in the lesson on relative clauses and the nominalizing particle -a: lú níĝ ki a-ba a-na the person (who) the thing (which) the place (where) (the one) who (that) which REMEMBER: A NEEDED ERGATIVE OR LOCATIVE-TERMINATIVE POSTPOSITION -e MAY BE HIDDEN IN A PRECEDING POSSESSIVE PRONOUN! THE POSSESSIVE PRONOUN -bi "ITS.g. nothing somewhere. no (one). Like other adjectives. THAT"! 37 . time": some(one). ki-na-me-šè "to some/no other place" (TCS 1.g. lugal-na-me nu-um-ĝen came. SUMMARY OF PERSONAL PRONOUN FORMS INDEPENDENT PRONOUNS (§91) Absolutive & Ergative (Ø/e) 1 2 3p 1 2 3p ĝá-e (ĝe26-e) za-e (older zé) e-ne (older a-ne) me-en-dè-en me-en-zé-en e-ne-ne (older a-ne-ne) Dative (ra/r) ĝá-(a)-ra/ar* za-(a)-ra/ar* e-ne-ra/er — — e-ne-ne-ra/er Dimensional (da/ta/šè) ĝá-(a)-da za-(a)-da e-ne-da — — e-ne-ne-da *An -e.or assimilated -a. forms.-Term. (e) -ĝu10 -zu -(a)-né -bé -me -zu-ne-ne -(a)-ne-ne Dative (ra) -ĝu10-ra/ur -zu-ra/ur -(a)-ni-ra/ir -bi-ra/ir -me-ra/(er?) -zu-ne-ne-ra/er -(a)-ne-ne-ra/er Terminative (šè) -ĝu10-šè/uš -zu-šè/uš -(a)-ni-šè/iš -bi-šè/iš -me-šè -zu-ne-ne-šè -(a)-ne-ne-šè Genitive (ak) 1 2 3p 3i 1 2 3p -ĝá -za -(a)-na -ba -me -zu-ne-ne -(a)-ne-ne Locative (a) -ĝá -za -(a)-na -ba -me-a -zu-ne-ne-a -(a)-ne-ne-a Dimensional (da/ta/šè) -ĝu10-da -zu-da -(a)-ni-da -bi-da -me-da -zu-ne-ne-da -(a)-ne-ne-da Plural ((e)ne) -ĝu10-ne -zu-ne -(a)-né-ne -bé-ne ? ? ? Note that many plural forms are reconstructed or attested only in OB or later grammatical texts./Loc.vowel may occur between the pronouns and case markers in 1st and 2nd sg. 38 . POSSESSIVE PRONOUNS (§101-110) Absolutive (Ø) 1 2 3p 3i 1 2 3p -ĝu10 -zu -(a)-ni -bi -me -zu-ne-ne -(a)-ne-ne Erg. The remaining cases are adverbal in function. but often also by corresponding affixes in verbal forms (the ergative and dimensional prefixes and the subject/patient affixes). like any other. THE GENITIVE CASE (§161-168) The Genitive Construction The genitive postposition links two nouns to form a genitive construction. resulting in an expanded nominal chain which. Thus in a sense the genitive postposition can be said always to co-occur with another case marker — the only postposition that may ordinarily do so." The head nouns of both the regens and rectum may be modified by adjectives or other attributives. which mark verbal subjects. standing between any primary adjectival element and any following possessive or demonstrative pronoun and/or personal plural marker. When a sentence or clause features both a phrase marked with an adverbal postposition and a corresponding verbal affix. and plural markers — subject to certain restrictions in the ordering of elements. possessive or demonstrative pronouns. Study both the structure and the phonological and orthographic shapes of the following examples (deletion of the final /k/ of the genitive will be discussued below): {é} + {lugal+ak} + Ø {é} + {lugal+ak} + a > > é lugal-la The house of the king é lugal-la-ka In (-a) the house of the king 39 . Returning to the discussion of the rank order of the nominal chain. All regular genitive constructions consist basically of three components: (1) a nomen regens or "ruling/governing noun". are. the following represents the structure of an expanded nominal chain featuring a single genitive construction (cf. Since they only relate substantives. The genitive postposition is therefore a different sort of syntactic element. in contrast to the English prepositions which render similar ideas but which stand before the nouns to which they refer. and convey locational or directional ideas. (2) a nomen rectum or "ruled/governed noun". Thomsen §46): REGENS RECTUM GEN REGENS MODIFIERS CASE ┌────────────┐ ┌─────────────────────────────────────┐ ┌───────────────────┐ ┌──────┐ │ noun + adj │ │ noun + adj + poss/dem + plural + ak │ │ poss/dem + plural │ │ case │ └────────────┘ └─────────────────────────────────────┘ └───────────────────┘ └──────┘ The rectum (with its genitive marker) can be thought of as a kind of secondary adjectival modifier of the regens. and which must ultimately end with a case marker. The case postpositions fall into two broad categories. marked not only by nominal postpositions. serving to indicate relationships between nouns and verbs. The adverbal cases. The genitive and equative cases indicate relationships between one noun (or pronoun) and another and so may be described as adnominal in function. may include the usual adjectival. by contrast. pronominal or plural modifiers. the verbal affix can be said to repeat or resume in the verbal complex information already stated in the nominal part(s) of the sentence. the genitive and equative cases are marked only by nominal postpositions. (3) and the genitive postposition -ak "of. agents. and objects.THE ADNOMINAL CASES: GENITIVE AND EQUATIVE The ten suffixed case markers of Sumerian are conventionally referred to as postpositions since they stand after the nouns to which they refer. but it is nevertheless conventionally referred to as a case marker. {dumu} + {lugal+ani+ak} + e > dumu lugal-a-na-ke4 By (-e) the son of his king šeš-tur lugal-mah-a-ke4-ne The young brothers of the lofty king > šeš-tur lugal-mah-za-bé-ne Those young brothers of your lofty king {šeš+tur} + {lugal+mah+ak} + ene + Ø > {šeš+tur} + {lugal+mah+zu+ak} + bi + ene + Ø Multiple Genitive Constructions A Sumerian nominal chain can feature a second or, less commonly, even a third embedded genitive construction, although a third genitive is never graphically indicated. In such cases, one genitive construction becomes the new rectum of another construction, and the genitive postpositions accumulate at the end of the chain: regens + {regens + rectum + ak} + ak regens + {regens + {regens + rectum + ak} + ak} (+ ak) For example: é dumu+ak+Ø é dumu lugal+ak+ak+Ø é dumu lugal úri(m)ki+ak+ak+ak+Ø > > > é dumu The house of the son é dumu lugal-la-ka The house of the son of the king é dumu lugal úriki-ma-ka The house of the son of the king of Ur A chain featuring a double or triple genitive construction could theoretically become quite complex if its components were extensively qualified, but in practice adjectival or pronominal qualification tends towards a minimum in such forms, presumably for the sake of clarity. If such qualification is desired, the language can make use of an anticipatory genitive construction (described below) to help break a long chain into more manageable subsections. Form of the Genitive Postposition The genitive postposition in its fullest form takes the shape /ak/. It is, however, subject to special phonological rules depending upon the elements which precede or follow it. More formally, it can be described as a morphophoneme //AK// with four phonemic realizations depending upon its phonological environment, that is, whether it is preceded or followed by a vowel (V), a consonant (C), or a zero morph — i.e. by a word-boundary (#) — which functions phonotactically like a consonant. It is pronounced as follows: /ak/ in environment /k/ /a/ /Ø/ in environment in environment in environment C__V V__V C__C C__# V__C V__# é lugal+ak+a é dumu+ak+a > é lugal-a-ka > é dumu-ka In (-a) the king's house In the son's house To (-šè) the king's house The king's house To the son's house The son's house 40 é lugal+ak+šè > é lugal-a-šè é lugal+ak+Ø > é lugal-a é dumu+ak+šè é dumu+ak+Ø > é dumu-šè > é dumu Stated less formally, /a/ is retained when a consonant precedes, and /k/ is retained when a vowel follows. There are a few exceptions to the above scheme. First, in the V__# environment, very rarely /a/ unexpectedly appears instead of /Ø/, probably to resolve a possible ambiguity. For example, using the above illustration é dumu-a might be written instead of é dumu. Second, in pre-Old Babylonian orthography the presence of a /k/ was apparently considered a sufficient sign of a genitive, and an otherwise needed /a/ is often not written, although it was possibly pronounced, e.g. é lugal-ka rather than é lugal-la-ka. In older texts, even a noun's Auslaut can fail to appear, for example ùnu-kam "it is (-am) of the cattle herdsman" rather than expected ùnu-da-kam < unud+ak+am, as in Nik I 220 ii 4. In the earlier stages of this predominately logographic writing system often only the most significant elements were spelled out; the rest could be left for the native speaker to supply. When a genitive directly follows a possessive pronoun, the vowels /u/ and /i/ of the sg. pronouns do not appear, and -ak thus behaves as it always does when following consonants. But following the final /e/ of the plural pronouns -ak behaves as expected: ┌─────────────────────────────────────────────────────────────┐ > -ĝá of my │ │ Sg 1 -ĝu10+ak+Ø │ 2 -zu+ak+Ø > -za of your │ │ 3p -(a)ni+ak+Ø > -(a)-na of his, her │ │ 3i -bi+ak+Ø > -ba of its, their (coll.) │ │ │ │ Pl 1 -me+ak+Ø > -me of our │ │ 2 -zunene+ak+Ø > -zu-ne-ne of your │ │ 3p -(a)nene+ak+Ø > -(a)-ne-ne of their (personal) │ └─────────────────────────────────────────────────────────────┘ For example: ká iri+ĝu10+ak+Ø ká iri+ĝu10+ak+šè é-mah lugal+(a)nene+ak+Ø é-mah lugal+(a)nene+ak+a > > > > ká iri-ĝá The gate of my city ká iri-ĝá-šè To (-šè) the gate of my city é-mah lugal-la-ne-ne The lofty house of their king é-mah lugal-la-ne-ne-ka In (-a) the lofty house of their king Note that the possessive pronoun -bi "its/their" and the demonstrative suffix -bi "that" are the same element and so follow the same phonological rules. Thus ká tùr+bi+ak > ká tùr-ba can be translated either "the gate of its/their pen" or "the gate of that pen." Genitive and Locative Compared When a locative case postposition -a is suffixed to a possessive pronoun, the /u/ and /i/ vowels of the singular pronouns are again deleted, and the resulting forms thus look PRECISELY THE SAME as the genitive forms when no other vocalic suffix follows which will cause the /k/ of the genitive to appear. The two paradigms differ, however, in the plural, where locative -a always appears while the /a/ of the genitive is always deleted. Compare the following possessive pronoun + locative paradigm with the preceding possessive + genitive paradigm: 41 ┌─────────────────────────────────────────────────────────────────────┐ │ ┌────────┐ │ > -ĝá in my │ │ Sg 1 -ĝu10+a │ 2 -zu+a > -za in your │ │ 3p -ani+a > -(a)-na in his, her │ │ 3i -bi+a > -ba in its, their (collective) │ │ └────────┘ │ │ Pl 1 -me+a > -me-a in our │ │ 2 -zunene+a > -zu-ne-ne-a in your │ │ 3p -anene+a > -(a)-ne-ne-a in their (personal) │ └─────────────────────────────────────────────────────────────────────┘ Thus the nominal chain é-za can represent either "of your house" {é+zu+ak} or "in your house" {é+zu+a}, and one must rely upon context to decide which meaning is appropriate. Compare a fuller form featuring both a genitive and a locative: é lugal-za-ka "in the house of your king" {é lugal+zu+ak+a} where the vocalic locative marker causes the /k/ of the genitive to be pronounced. Contrast, on the other hand, a chain such as é lugalza-šè, which ends in the terminative case marker -šè "towards." Here again -za- can only be analyzed as pronoun plus genitive even though the final /k/ is not visible; a locative is impossible since only the genitive can be followed by another case marker. Thus analyze é lugal+zu+ak+šè "to the house of your king." Irregular Genitive Patterns There are four noteworthy uses of the genitive which do not conform to the strict REGENS + RECTUM + AK pattern: 1. ANTICIPATORY GENITIVE (§164). Here the rectum precedes the regens, and the regens is marked by a possessive suffix in agreement with the rectum: lugal+ak diĝir+(a)ni+Ø é+ak lugal+bi+Ø > > lugal-la diĝir-ra-ni é-a lugal-bi Of the king his god = The god of the king Of the house its owner = The owner of the house The anticipatory genitive is an EXTREMELY common Sumerian construction, used not only as a stylistic alternative to the ordinary genitive construction, but also to help simplify more complex nominal chains by breaking them into more manageable subsections. It is also a pattern that is REGULARLY missed by the beginner and so one which should be kept firmly in mind in the early stages of study. 2. GENITIVE WITHOUT REGENS (§167). Here the regens has been deleted and is merely understood: úri(m)ki+ak > úriki-ma "he of Ur, the Urimite," standing for an underlying <dumu> úriki-ma "son/citizen of Ur" or <lú> úriki-ma "man of Ur." Compare Old Sumerian DP 119 4:6 where previously listed personnel are summarized as Géme-dBa-ú-ka-me "they are (personnel) of Geme-Ba'u(-k)"; many parallel texts actually write the expected lú. This sort of elliptical genitive construction is common in gentilics (terms referring to ethnic origin or national identity), as above, in names of occupations, and in connection with certain types of subordinate clauses which will be discussed later apropos of the nominalizing suffix -a and the syntax of relative clauses. 3. PREDICATIVE GENITIVE. Here a genitive without regens is used with a form of the copular verb "to be" to generate predicates of nominal sentences or clauses. (A nominal sentence is an "X = Y" sentence in which the subject is identified with a predicate noun, pronoun, or adjective, as in "Šulgi is king," "the king am I," or "the king is great.") 42 This construction is especially common with independent pronouns but can also occur freely with nouns. The following independent pronoun paradigm features the 3rd sg. copular element /am/ "it is"; an extra written -a- vowel is common in the 1st and 2nd person singular forms: ┌─────────────────────────────────────────────────────────────┐ │ Sg 1 ĝá+ak+am > ĝá-(a)-kam it is of me, it is mine │ │ 2 za+ak+am > za-(a)-kam it is yours │ │ 3p ene+ak+am > e-ne-kam it is his/hers │ │ │ │ Pl 1 — │ │ 2 — │ │ 3p enene+ak+am > e-ne-ne-kam it is theirs │ └─────────────────────────────────────────────────────────────┘ The regens underlying such constructions can be thought of as a repeated subject deleted by a syntactic rule to avoid redundancy, for example: kù-bi lú-ne <kù> ĝá-a-kam <lú> iri-ba-kam That silver is <silver> of me = That silver is mine This man is <a man> of that city = This man is of that city 4. GENITIVE AS IMPLICIT AGENT (§166). A genitive can be used in several different contexts to imply an agent, as in older epithets of the form: dumu tud+a an+ak+Ø > dumu tu-da an-na Textual instances: maš apin-lá è-a PN engar-kam {engar+ak+am} They are (-am) the lease-tax goats brought in of (i.e. by) PN the farmer (Nik I 183 1:3-5 OS) udu gu7-a PN kurušda-kam They are sheep used of (i.e. by) PN the animal fattener (Nik I 148 5:2-4 OS) {kurušda+ak+am} child born of (the god) An = child born by An gù-dé-a lú é dù-a-ke4 By (-e) Gudea, the man of the built house (i.e. the one who built it) (Gudea Cyl A 20:24 Ur III) {dù+a+ak+e} This older participial construction with an agent implied by a genitive often occurs in royal inscriptions in alternation with a much more common and more widely used pattern in which the agent is explicitly marked by the ergative postposition -e. This more productive second pattern, which will be mentioned again in the description of Sumerian relative clauses, is referred to as the Mesanepada Construction, after the name of an early king which illustrates it: mes an+e pà(d)+a > mes an-né pà-da Youth chosen by An Lastly a caution: The beginning student should keep in mind that that most proper names are actually short phrases, and many common divine and royal names are actually genitive constructions which are not always obvious from their usual citation forms, for example: d d nin-ĝír-su nin-hur-saĝ d nin-sún < < < d d nin ĝirsu+ak nin hursaĝ+ak d nin sún+ak Queen of (the city) Ĝirsu Queen of the Mountains Queen of the Wild Cows 43 inana dumu-zi-abzu ur-dnamma d d < < < nin an+ak dumu-zi abzu+ak ur dnamma+ak d d Queen of Heaven Good Child of the Abzu Dog of (the goddess) Namma When such genitive-based names are followed by vocalic grammatical markers, the /k/ of the inherent genitive naturally reappears, a common source of confusion the first few times it is encountered, for example: d nin+ĝirsu+ak+e > > > d nin-ĝír-su-ke4 by (-e) Ningirsu(-k) by the son of Ur-Namma(-k) of the field of Ninsuna(-k) dumu ur-dnamma+ak+ak+e a-šà dnin+sún+ak+ak+ak dumu ur-dnamma-ka-ke4 a-šà dnin-sún-na-ka-ka A similar confusion can also arise when one first encounters nouns with an intrinsic /k/ Auslaut, i.e. stems that end with an amissible consonant /k/ which, like that of the genitive marker, is regularly deleted when no vowel follows, for example: énsi(k)+Ø > ensí the governor (subject) by the son of the governor in (or of) the mouth dumu énsi(k)+ak+e > dumu énsi-ka-ke4 ka(k)+a/ak > ka-ka In the second phrase, the presence of two /k/ sounds may, at first glance, suggest the presence of two genitive markers, an incorrect analysis since only one complete genitive construction (regens + rectum + ak) can be accounted for. The last word could be taken for a reduplicated noun. * THE EQUATIVE CASE (§214ff.) Like the genitive, the equative case indicates a relationship between nouns or pronouns. Also like the genitive, it is marked only by a nominal postposition; it has no corresponding infix in the verbal chain. It has the basic meaning "like, as," but in subordinate relative clauses (discussed in a later lesson) it can take on temporal adverbial meanings such as "just as" or "at the same time as," "as soon as." It is also seen in a variety of standard adverbial expressions such as ur5-gin7 "like this, thus" or húlla-gin7 "happily," or a-na-gin7 "like what, how." The equative is most often written with the sign GIM, traditionally read simply -gim. There is good evidence, however, that it is more properly to be read -gin7 and some indication as well that the final /n/ could be dropped. Thus the sign GIM has also been read in the past -gi18 or -ge18 by a few earlier scholars. The problem of determining the actual pronunciation arises owing to the existence of a number of conflicting syllabic writings, including: -gi-im, -gi-in, -ge-en, -gi/ge, -ki/ke, or -gé/ke4 (the last three instances represent single signs with two possible readings). For a nice discussion of all these forms see now D. Frayne, Royal Inscriptions of Mesopotamia, Early Periods 1 (2008) 95. The pronunciation may have varied with time and place, and so, for convenience, we will follow the current convention of reading the equative as -gin7 and leave the ques-tion of its precise pronunciation open. Examples: ama-ni-gin7 dumu-saĝ lugal-la-gin7 a-ba za-e-gin7 like her mother like the first-born son of the king who (is) like you?" 44 * * * * REMEMBER: A GENITIVE CONSTRUCTION = REGENS + RECTUM + AK! THE /a/ OF THE GENITIVE POSTPOSITION IS LIABLE TO DELETION, BUT THE LOCATIVE POSTPOSITION -a IS NEVER DELETED! THE ANTICIPATORY GENITIVE IS THE ONE OF COMMONEST AND MOST COMMONLY OVERLOOKED SYNTACTIC PATTERNS OF SUMERIAN! 45 "I am the king" or "the king is mighty" or most generally "X = Y. pronominal elements should be analyzed as belonging to a copular stem /me/. form.e the 3rd sg. When the preceding consonant is the /k/ of the genitive postposition -ak.g. the easiest solution is to posit two allomorphs." The syllable /am/ could also be joined with a preceding consonant in a closed-syllable sign Cam. it conveys no notion of tense. -(e)n. lugal-lam (the doubling or "picking up" of the /l/ in the final sign is only an orthographic convention). §108) The enclitic copula is conjugated. for example. e. If the latter. The first is the proper verbal root ĝál "to be present. THE ENCLITIC COPULA (§541-546. which occur in different contexts.AN) (or -am6(AN) before the time of Gudea). serves for both personal and impersonal/collective subjects. In keeping with the general hypothesis in this grammar that meaning is primarily carried by consonantal elements in the systems of Sumerian grammatical affixes. é lugal-la-kam "it is the house of the king. that is. It indicates an identity between two substantives or between a substantive and an adjective. and its paradigm is that of the verbal subject (to be discussed in detail later). -Ø. The copula occurs most often as an enclitic. This is the position taken here. as is also the case when these subject pronouns occur in finite verbal forms." Since it only indicates an identity. -(e)š.e. e. i. -(e)nzen." When a vowel precedes the 3rd sg. the /e/ is an epenthetic or helping vowel which is placed between consonantal elements to render them pronounceable and that the verbal subject paradigm is then formally just: -(e)n. In simple contexts a copula is optional and often omitted. then the /e/ of the stem /me/ is deleted in the 3rd sg. I would maintain that here. For example. The resulting form is written -àm(A. i. If the former. ┌────────────────────────────────────────────────────────────────┐ │ 1 me + (e)n > -me-en I am │ │ 2 me + (e)n > -me-en you are │ │ 3p/i m + Ø > -(V)m/-àm he/she/it is. they are │ │ │ │ 1 me + (e)nden > -me-en-dè-en we are │ │ 2 me + (e)nzen > -me-en-zé-en you are │ │ 3p me + (e)š > -me-eš they (personal) are │ └────────────────────────────────────────────────────────────────┘ -am6 in OS An old question in the description of the copula forms is whether the /e/ vowel which appears in all of the non-3rd sg. lugal-àm "he is king. the /k/ and the copula are usually written together using the KAM sign: ak+m > -a-kam. then the copular stem is just /m/ in all forms. as in dumu-zu-um "he is your son" or ama-ni-im "she is his mother. an epenthetic vowel /a/ serves to separate that consonant and the the following copular stem /m/. linking them as subject and predicate." or "will be" according to context. which marks predicates of non-verbal or nominal sentences. -eš. verbal subject marker has no overt representation. an unstressed element which must always be suffixed to another word. In view of the variant /me/ which can appear in finite copulas (see below). or belonging to the pronominal elements. as. etc. /m/ and /me/. Note that the symbol Ø here again indicates a zero morph. -en. and can be translated "is/are." The second is a syntactic element with the form /me/ or /m/ whose basic function is copular." "was/were. properly the second (predicate) part of a nominal sentence.THE COPULA There are two verbs "to be" in Sumerian. copula also ends in a consonant." 46 . to exist. copula there is no need to insert an epenthetic vowel /a/ before the /m/. When a word or grammatical suffix preceding the 3rd sg. though such a form is more often seen written with two syllables: lugal-la-àm. -(e)nden. Note that in this paradigm the 3rd person sg.g. while the 3rd person plural is reserved for personal subjects only. e.you are my father! (Gudea Cyl A 3:6-7 Ur III) zé-e-me maškim-a-ni hé-me It is you who must be his inspector! (Sollberger.g. lú-bi lugal-gin7-nam {lugal+gin7+am} "that man is like a king. it was indeed I who gave PN to PN2! (TCS 1. The writing -me-éš (or -me-eš) begins to appear regularly in the later Ur III period. all might be said to stand in the unmarked absolutive case)." On the other hand.you are my mother! I am one who has no father . but predicates can indeed be marked for the adnominal equative case. it is regularly deleted. I am the king!" = "It is indeed I who am the king!" Some textual examples: ama nu-tuku-me ama-ĝu10 zé-me a nu-tuku-me a-ĝu10 zé-me I am one who has no mother . In Gudea and other Ur III texts. TCS 1. form is usually written just -me.but in later texts one occasionally sees a hyper-correct -àm written here as well. See textual examples at the bottom of this page. Since copular constructions are non-verbal. the 1st or 2nd sg. 128:6-7 Ur III} PN PN2-ra zi lugal ĝá-e-me ha-na-šúm (By the) life of the king. sagi-me-eš "they are cupbearers" (CT 50.g. copula in all contexts. 81:3-7 Ur III) {nu+tuku+me+n} {zé+me+n} {zé-e+me+n} {hé+me+en} {ĝá/ĝe26-e+me+n} {hé+na+Ø+šúm+Ø} {dative -ra is resumed by -na-} 47 . In Old Sumerian the 3rd pl." When the subject of a copular sentence or clause is an independent pronoun. the copula can be combined with a pronominal subject to provide a particularly strong emphasis: ĝá-e-me-en lugal-me-en "I am I. though it can be retained for emphasis: <ĝá-e> lugal-me-en "I am king. Study the following nominal sentences: ĝá-e lugal-me-en za-e ir11-me-en ur-dnamma lugal-àm nin-bi ama-ni-im šeš-a-ni ad-da-zu-um lú-tur-e-ne šeš-me-eš é-zu gal-la-àm munus-bi ama lugal-a-kam é-bi ĝá-a-kam I (emphasized) am the king You (emphasized) are a slave Ur-Namma is king That lady is his mother His brother is your father The young men are brothers Your house is big That woman is the mother of the king That house is mine (lit. At least some later scribes apparently lost sight of the phonotactic rules and came to regard -àm as the mark of the 3rd sg. where final /n/ is not always written in a variety of contexts. 36 7:8). of me) In the preceding simple illustrations the subjects and predicates are not marked for case (alternately. rather than -me-eš. copula can be written as just -me rather than -me-en. although the full form is known. e. they may ordinarily feature no adverbal case markers. rather than an enclitic. 22:11). often a preformative such as the precative hé. and their herdsman (NSGU 138:8 Ur III) PN-àm ma-an-šúm bí-in-du11 "It was PN. Falkenstein (see discussion and references in NSGU II pp. ki-ma "like" (Proto-Aa 8:2. one that came floating in on the water (Gudea Cyl A 15:26) THE FINITE COPULA (§536-540) The copula can also function as a quasi-finite verb." It can represent strong emphasis in the view of A. 36-37 ad No. as in a married state (NSGU 22:9-11) gù-dé-a šà dnin-ĝír-su-ka u4-dam mu-na-è For Gudea the meaning of Ninĝirsu came forth like daylight (Gudea Cyl A 12:18-19 Ur III) muš-mah-àm a-e im-diri-ga-àm It was like a great snake.ADDITIONAL FUNCTIONS OF THE COPULA The copula frequently serves to mark off appositions or parenthetical insertions within sentences. with the addition of a verbal prefix. é-šu-šúm-ma ì-zàh-àm. they being 180. being a slave of PN2 — she having fled to the é."not. -àm = Akk. 89). he gave it to me. built the palace." Common forms include: {ud+am} 48 . For the copula as such a similative particle compare a Sumerian-Akkadian bilingual lexical entry where Sum. W. let" or the negative nu. but this usage is usually difficult to understand and is thus often disregarded in translation. MSL 14. Some examples for study: udu ab-ba-ĝá 180-àm ù gáb-ús-bi The sheep of my father. (he being) the king. Heimpel studied the use of the copula to mark a comparison. — was caught by PN3 during the <time> of harvest (NSGU 214:29-33) {nu+n+da+šub+Ø+a+am} u4 inim lugal nu-ù-da-šub-ba-àm ba-sa10-a When he was sold — the king's word not having been laid down concerning him (NSGU 71:12-13) {nu+n+nú+Ø+a} PN PN2-[da] nam-dam-šè-àm da-ga-na nu-ù-nú-a That PN had not lain in (-n-) the bedroom with PN2."may. A possible example of such a use is: 1 sìla mun-àm ka-ka-né ì-sub6-bé 1 quart of salt it shall be that will be rubbed onto her mouth (Ur-Nammu Code §25 Ur III) Occurrences of the copula at the end of sentences or clauses generally seem likewise to mark off parenthetical or emphasized information. buru14-ka PN3-e in-dab5 PN. varying with the equative postposition -gin7 "like" (Studia Pohl Series Minor 2 (1968) 33-36). as in dšul-gi-re lugal-àm é-gal in-dù "Shulgi(r)." he declared (NSGU 127:4-5) PN géme PN2-kam. though he was not a minister.. variant has e-me-a) sug hé-me-àm Truly it had become as a swamp (Ur-Namma 27 1:10 Ur III) PN dumu PN2 gudu4 — nu-mu-kuš ì-me-àm — PN3 dumu PN4 gudu4-ke4 ba-an-tuk PN. 30). filled its outskirts (Lamentation over Ur 211 OB) (-e. though they were not broken potsherds. 26 3:5-6 OS with Lagaš vowel harmony) {i+me+Ø+a} One occasionally encounters finite copulas with odd shapes. saĝ-nu "he is not a slave" (so P. including forms in which a finite copular stem is conjugated using an added enclitic copular suffix.is often employed to render the form finite when no other verbal prefix is present: {i+me+(e)n+a+ak+šè} á-nun ĝal zà-še-ni-šè húl-la ì-me-en-na-ke4-eš Because I was one evincing great strength. (Inana's Descent 291 OB) {i+me+š+a+ak+eš} {nu+me+Ø+a} ùĝ-bi šika ku5-da nu-me-a bar-ba ba-e-si Its people. (NSGU 208:26-28) {hé+a(m)+Ø} Some have described the negated finite copula instead as a negative enclitic copula. e.resumes -a) é-ki saĝa e-me-a Eki. the copular stem allomorph /me/ appears in all forms. (CT 50. Third-Millennium Texts (1992) p. daughter of PN2 the gudu4-priest — she being a widow — was married by PN3 son of PN4 the gudu4-priest (NSGU 6:2-4 Ur III) 49 I {i+me+am+Ø} . Steinkeller." In this context.. ki PN-ta šu la-ba-an-ti-a Whether it be that silver or that barley — that he had not received it from (the place of) PN .hé-em or hé-àm nu-um or nu-àm nu-me-eš Example: may he/she/it be! he/she/it is not they are not {hé+m+Ø} {nu+m+Ø} {nu+me+š} (abbreviated as hé-a or hé) (abbreviated as nu) kù-bi hé-a še-bi hé-a. are often used to convey the notion "although. (Šulgi A 27 OB) (= elliptical <nam> .-ak-šè) ur-saĝ ug5-ga ì-me-ša-ke4-éš Because they were slain heros (Gudea Cyl A 26:15) lú igi-na sukkal nu-me-a The person in front of her. even though.. linking it in transliteration to the preceding head noun. pi-lu5-da u4-bi-ta e-me-am6 It was as the custom was in former times (Ukg 4 7:26-28 OS. e.g. and the neutral vocalic prefix ì. delighting over his strong thighs. Copular subordinate clauses. though he used to be the temple administrator..g. formed by suffixation of the nominalizing (relativizing) particle -a. Indeed.in ETCSL and Thomsen §364. is occasionally employed as a finite verbal root with both copular and existential meaning. -Ø. -(e)š." with which cf. 2 Sarg. that was in fact my brother Ninĝirsu! (Gudea Cyl A 5:17 Ur III) ga-na is an interjection here employed as a prefix. A common form is V+nu+Ø > in-nu "was not. lú-še lugal-ĝu10 in-nu. THE BASIC VERBAL SUBJECT PARADIGM IS -(e)n. {gana+me+(a)m+Ø} šu al-la nu-ù-da-me-a-aš {nu+n+da+me+Ø+a+šè} Since the hand of (the official) Alla was not (involved) with him (NSGU 43:4 Ur III) Here the copula is construed as a completely regular finite verb. 50 . THE PREFORMATIVE nu.] did not exist (Emerkar and the Lord of Aratta 12 OB) kù ad-da ì-nu If there be no silver of (belonging to) Adda OSP 2.. (Gilgameš and Aga 70-71 OB) kur dilmunki [(. in-nu = Akk. ú-la "not (being)" (MSL 4. -(e)nzen. -(e)n. were that man my king .) REMEMBER: A COPULA NORMALLY LINKS THE TWO HALVES OF A NOMINAL "X = Y" SENTENCE.. -(e)nden. often in constructions featuring a minimal verbal prefix used primarily to make the form finite. 47 rev. 164:24)." which as a preformative normally negates verbal forms.AS A FINITE VERB nu. See other examples with prefixes other than ì.."not.šeš-ĝu10 dnin-ĝír-su ga-nam-me-àm Hey..)] x in-nu The land of Dilmun [. lú-še lugal-ĝu10 hé-me-a That man was not my king. A COPULA MAY ALSO INDICATE AN EMPHASIS OR COMPARISON OR SET OFF A PARENTHETICAL INSERTION. g. for example: dili-né dili-zu-šè diri-zu-šè silim-ma-né min-na-ne-ne húl-la-né/na he alone. pronoun + terminative) gal-bi-šè téš-bi-šè greatly." Compare the regular use of -e with infinitives discussed in the final lesson. but it is more likely that the sign BI should be read instead as -bé‚ i. Krecher in ASJ 9 (l987) 74 and Attinger." tur "(in a) small (way). e. NABU 1990/3.e." or hul "evilly. distinct from the terminative marker /še/. Eléments de linguistique sumérien (1993) §105d." gal "greatly. great < téš each. 86) 51 . well together < gal big. distant < ul ancient (c) the sequence -bi-šè (3rd sg. single ul4 to hurry That the suffix -bi is merely the 3rd sg. bíl-la-bé búr-ra-bé diri-bé gibil-bé húl-la-bé lipiš-bé téš-bé ul4-la-bé feverishly openly surpassingly newly happily angrily all of them quickly < < < < < < < < bíl to be hot búr to free. both of them (mìn+(a)nene+e} (impersonal: min-na-bé both of them) he joyfully (cf. well forever forever < gal big. by himself (impersonal: dili-bé they alone) by yourself more than you he being well {silim+a+(a)ni+e} the two of them. The commonest of these are short phrases consisting usually of only a bare adjectival or verbal root. great < sudr to be far away. single (d) -bi This last may be a shortened form of -bi-šè." Attinger Eléments §105 now calls this the "adverbiative" marker /eš(e}/. that is. or a verbal root with a nominalizing (participializing) -a suffix. Otherwise. húl-la-e húl-húl-e happily very happily < húl to be happy < ditto (b) the terminative case marker -šè (or -éš/eš) "to. loosen diri(g) to surpass gibil to be new húl to be happy lipiš anger téš each.ADVERBS AND NUMERALS ADVERBS (§84-89) Adverbs of Manner Simplex adverbs such as English "fast" or "well" are rare in Sumerian. a category of phrases ending in case markers. followed most often by: (a) the locative-terminative -e "by. Yuhong. gal-le-eš sud-rá-šè ul-šè greatly." These nonmarked adverbs are enumerated by J. impersonal possessive pronoun -bi used with a less evident deictic meaning is suggested by the somewhat rarer adverbial expressions formed by means of other possessive pronouns. mah "loftily. and note that -e often elides to a previous vowel. Sumerian renders adverbial ideas mainly by means of adverbial expressions. There are only a handful of bare adjectival (verbal) roots which can function with adverbial force. the suffix -bi plus a locative-terminative case marker -e which provides the adverbial force in place of the terminative. and the following should be learned as independent words: ì-ne-éš a-da-al/lam i-gi4-in-zu now now as if. here to that place. suggests instead "know (this) for sure!" < *i-gin-zu." ablative -ta "from. instead of that.Temporal. and other possessive pronouns are regularly employed. the locative -a "in. and Localizing Adverbial Expressions (§184. Interrogative Expressions A list of adverbial expressions based on interrogative pronouns such as a-na-šè "why?" will be found in the lesson dealing with pronouns and demonstratives. to the fore. at the fore to the front. when. opposing. on the occasion of that in front of him at its front. igi-zu in Gudea) (B. Common examples include: ĝi6-a itu-da u4-ba u4-bi-ta u4-da u4-dè bar-zu-šè mu-bi-šè nam-bi-šè igi-na igi-bé igi-šè eger-bé eger-bi-ta gaba-bi-šè ki-a ki-ba ki-bi-šè ki-ta ki-ĝá šà-ba šà-bi-ta ugu-bi-a zà-ba in/during the night in a month.) 52 . thither from the place. at. monthly on that day. chez moi in the middle of it. beside it {itud+a} {ud+bi+a} {ud+a} {ud+e} {ki+ĝu10+a} See also the later lesson on relative clauses for a discussion of adverbial subordinate clauses constructed in the same manner as these sorts of adverbial phrases. 101. inside it out of it. i. thereafter facing. about that for the sake of that. after that (locally and temporally) since then. 205) These are ordinary nominal chains ending in dimensional case postpositions." or locative-terminative -e "by. Causal. here in this place. from it on top of it at it's edge. thence in/at my place. Alster in Fs. then since that time. afterwards in/on the day. today by day because of you. Sentence Adverbs The origins of terms which Thomsen calls Modal Adverbs (§149) are uncertain. at that time. as though (wr. Georg Molin (1983) 122f. with me. or confronting it in place.e." In this case the suffix -bi is once again more obviously deictic in meaning. for your sake because of that. before behind that." terminative -šè "to. {2+ak+am+šè} mu dnanna kar-zi-da a-rá 2-kam-aš é-a-na ba-an-ku4 Year Nanna of the Good Quay entered his temple for the second time (Formula for the 36th regnal year of Šulgi of Ur) REMEMBER: ADVERBS ARE USUALLY SHORT NOMINAL CHAINS ENDING IN CASE MARKERS. including important data from the Ebla texts and discussion of other numerical constructions. 2-kam-ma 2-kam-ma-ka u4 2-kam-ma-ka the second (one) for the second time on the second day For a clear and up-to-date description of numerals. MOST OFTEN -e. diš min." This construction can be extended by the addition of a second genitive /ak/ often with a following locative -a. mìn eš5 limmu. e. by itself/themselves {aš+(a)ni+e} {min+(a)nene+Ø} The adjectives didli (< dili-dili) "several. -bé OR -bi-šè 53 . by himself the two of them alone. Numerical Expressions Cardinal numbers can be combined with possessive pronouns and case markers to generate adverbial expressions. umun5 ussu ilimmu u 60 600 ĝeš(d) ĝeš(d)u 3600 šár 36000 šáru Ordinal Numbers Ordinals are formed in the first instance by use of the genitive /ak/ followed by the copula /am/.g. dili-bi-šè alone. miscellaneous" and hi-a "mixed.NUMERALS (§139-142) Cardinal Numbers 1 2 3 4 5 6 7 8 9 10 aš. límmu ía àš inim. u4 2-kam "second day. -šè. -eš. dili. aš-a-né. assorted" are often found qualifying nouns especially in administrative texts. aša-né min-na-ne-ne dili-bé.g. pp.g. various. see Edzard 2003. 61-67. e." e. e. viz. lú-didli-e-ne lú-igi-nigin2-didli anše-hi-a the various men miscellaneous inspection personnel assorted donkeys Multiplication is indicated by use of the term a-rá "time(s).g. 39) speaks of ergative and adessive -e. it marks an otherwise dative object when that object is an impersonal noun: lugal-ra "to the king" but é-e "to the house. 145 n. This sense can be quite general. Zólyomi)." téš-e "all together." The locative-terminative is the case normally found with the so-called infinitive." Jagersma 2010 §7. later Jacobsen." However one wishes to phrase it. The locative-terminative is often used to form adverbial expressions (a use shared with terminative -šè. morphologically identical but functionally differentiated." and only then to attempt to define the directional or locational idea more precisely with the help of the context. -e refers to a locality or an object "by. Compare the two quite different functions of the ablative-instrumental case (below). one may regard the postposition -e as the mark of "one case with two functions. 169) The absolutive case is unmarked. see below)." Conversely. there is an intimate syntactic connection between dative and ergative/locativeterminative rection. As the mark of the ergative case. Black [2010] 47) states: "The ergative case marker can be analyzed as a further grammaticalization. Most importantly. Attinger). This is the case of the sentence subject or patient (defined in the lesson introducing the verb).3 states that the ergative "is not only homonymous but also cognate with the directive case marker. however. thus. adessive (Steiner. at" or "on. G. "by" whom or "because" of which the event takes place. Krecher. the doer or causer of a verbal event. and only if their underlying (or historical) identity is understood can we then feel free to speak of the ergative and the locative-terminative as if they were two separate cases. For examples see the lesson on participles and infinitives. or to produce a more general kind of adverbial clause. this is essentially the position taken in this grammar. it will be seen later that a dative is used instead of an ergative to mark a second personal agent in a causative sentence. adessive ("near. Steiner (ASJ 12. Jagersma. next to. by")." u4-dè "by day. as one. For example: húl-la-e "happily. and it is sometimes helpful to translate the locative-terminative first as "with respect to" or "regarding. Most scholars doubtless prefer to treat them as distinctly different homophonous cases. one whose full implications are only now becoming better understood. Thus. onto").THE ADVERBAL CASES ABSOLUTIVE -Ø (§38-42. -e refers to the agent. 54 . symbolized as -Ø. or directive (Edzard. onto" which the event takes place. at." ul4-ul4-la-e "hurriedly. Cunningham (AV J. is not entirely clear. rather than the more familiar nominative/ accusative orientation which is basic to our Indo-European languages. even if they possibly split off from a single case at some time in the past. It combines functions of allative ("to. Some scholars have referred to this case as the allative (early Jacobsen). scholars now call this case the ergative. and so to avoid limiting the range of meaning the less specific traditional term is retained here. whose relationship. the directive (also referred to as the locative-terminative) being lexically bleached from a meaning such as 'in(to) contact with' to performing the more abstract function of marking the subject of a transitive verb. G. or more theoretically is marked by a zero morph. upon. The locative-terminative also has a number of more specialized uses. It serves either to link the infinitive as a kind of indirect object with the main verb of the sentence." Similarly." ur5-re "in this fashion. locative ("on") and terminative ("to the end point") cases. ERGATIVE & LOCATIVE-TERMINATIVE -e (§170-174) As Thomsen observed (§170). following modern linguistic practice for languages like Sumerian whose subject/object marking system is primarily ergative/absolutive in character. As the mark of the locative-terminative case. Referred to as the agentive in older literature. The locative-terminative occurs in distributive phrases especially in conjunction with the ablative-instrumental postposition -ta. Compare the phenomenon of the usual OB writing of the infinitive dù-ù-dè "to build" with its standard Old Sumerian equivalent dù-dè. regularly assimilates to that preceding vowel and then appears in speech as lengthening of the vowel.g.g. especially in later texts where older phonotactic rules are no longer being consistently followed. both representing underlying {dù+e+d+e}. -e can appear as -a after a preceding /a/ in Ur III and earlier texts. Attinger. which occasionally show an -e instead of expected -ra." -e often does not appear in writing when preceded by a vowel. ir11 géme ù dumu-níta dumu-munus-ni A-na-ha-né-e ba-na-gi-in "The slave. here we will follow the practice of writing the 3rd person possessive pronoun plus hidden loc. however. the foreman {ugula+ra} 55 . as in the OB writing lú+e > lú-ù "by the man. especially in OB. the form it takes after consonants (including amissible Auslauts and the genitive -ak even when the Auslaut or /k/ is not graphically visible). Impersonal objects occurring with verbs that normally take a dative object are marked instead with a locative-terminative -e." i. after the possessive suffixes in particular. In texts from periods earlier than the first half of the Ur III Dynasty -Vr is frequently omitted after a vowel and always in Pre-Sargonic (OS) texts at least in writing. instead of completely disappearing after another vowel." For examples see P. Similarly. ASJ 4. When it follows a vowel." See Thomsen's discussion and examples at §172. in which the marker serves to anticipate a following specification or to topicalize or focus attention upon the marked noun (or pronoun): lugal-e "with respect to the king. e. compare the following two Pre-Sargonic Lagaš passages (from VAT 4718 and DP 425 respectively): en-ig-gal nu-bànda ú-ú ugula e-na-šid E. One might speculate that -e. a qualification of sheep (e." "as for the king. a case without a direct syntactic connection with a verb) or even "vocative" -e. at least for personal nouns. Eléments de linguistique sumérienne (1993) §112a or C.-term.The locative-terminative can function as a kind of weak demonstrative or determining element. like the terminative (see below) it can also. Acta Sumerologica 22 (2000) 322f. Contra Thomsen and some others. -ra contrast can be neatly demonstrated by a pair of common Ur III bureaucratic expressions. especially another /e/. and as -ù (or -u8) after an /u/. 132:5) and an occupation: gud-e ús-sa lugal-ra ús-sa (sheep) that follow the oxen (men) that follow the king The usual citation form of the dative is -ra.g. we will write the plural sequences -(a)ni+ene and -bi+ene as -(a-)né-ne and -bé-ne. In this use it is probably related to the near-dexis demonstrative suffix -e. See the lesson dealing with demonstrative pronouns. the overseer put it to the account of U. although the lengthening is not normally indicated in writing.e. Woods. mark the second member of a comparison with impersonal nouns (the personal dative serves this function with personal nouns and pronouns): é-bi é-gal lugal-a-ke4 gal-àm "that temple is bigger than the king's palace. the slave woman. The -e vs. and his son and daughter were certified (as belonging) to Anahani" (RTC 290:11-12 Ur III). rarely. but exceptions are not uncommon. DATIVE -ra (§175-179) The dative case can only be used with personal nouns or pronouns. The rule is not absolute. it may also appear only as -Vr." Finally. sequences -(a)ni+e and -bi+e as -(a-)né and -bé respectively rather than -(a)ni and -bi. This is probably also the function which has sometimes been described as casus pendens -e (Latin "hanging case. and the presence of a dative is then graphically indicated only by a dative dimensional prefix in the verbal chain. ĝuruš-e 10 sìla-ta "(rations) per/for (-e) a worker 10 quarts each (-ta). e. For example." "the king in question. en-ig-gal nu-bànda ú-ú agrig-ra e-na-šid E. go in to go up to. pleasing to to be painful. hurtful to to love (lit. -n. Perhaps the most common use of the dative case is the so-called ethical or benefactive dative. "to mete out love to") Like the locative-terminative with impersonal nouns. as in the following legal passage:) (here -ra replaces expected comitative -da) Finally. 7: maš-da-ri-a En-èn-tar-zi-ra mu-na-de6 The taxes were brought to (king) Enentarzi {en+entar+zi(d)+ra} In later stages of the language the old phonotactic rules were often dispensed with and -ra could be employed in all contexts. the steward {agrig+ra} An OS example of -ra following an amissible consonant occurs in DP 59 rev. 88) that the dative can mark a second (instrumental) agent. present to With certain kinds of verbs. diĝir-ir9-ra diĝir-re-e-ne-er rib-ba Mighty god. and in this general sense it can appear with most verbs. the overseer put it to the account of U. bow to Position before: Emotion: to be there. it will be seen (p. replaces other expected postpositions. be present before to stand before to be good. verbs of: Motion towards: du/ĝen ku4(r) te(ĝ) gurum ĝál gub sa6 gig ki(g) áĝ to to to to come. or lugal-la-ni-ra depending upon the conventions of the period. e. lugal-lani-ir. however. an OB bilingual grammatical text. doing something "for the benefit of" someone.g. -ra. but in particular with verbs of giving such as: šúm ba to give to to allot. more outstanding than (all) the gods (Ibbi-Suen B A 38 OB) d A-nun-na-ke4-ne za-e šu-mu-un-ne-íl-en Thus you were lifted up higher than the Anunna-gods (Išme-Dagan X 18 OB) {diĝir+ene+ra} (danunak+ene+ra} lú-ne-er an-diri = eli annîm rabi He is greater than this one (OBGT I 332. especially in Ur III texts. Thus the phrases lugal+ra "for the king" and dumu lugal+ak+ra "for the son of the king" were always written lugal-ra and dumu lugal-la-ra. apportion.resumes -ra) Occasionally. for example. approach bend. as the quintessential personal oblique case marker. personal dative -ra can mark the second member of a comparison with personal nouns or pronouns. while lugal+ani+ra "for his king" could be written lugal-la-ni. 56 . the dative is used (with personal nouns or pronouns) to convey directional or locational ideas. go to enter. Its meaning is "(together) with. H. Sale Documents. Limet. This fact has led several current scholars to propose that the locative actually features some initial consonantal sound. he colored it with lapis (Enki's Journey 7 OB) {kù(g)+a. Temporally it can signify "on (a certain day)" or "at/in/during (a certain time). Steinkeller. L'Anthroponymie 87 + n. greater than all divine powers (Gudea. to hang the neck with) Certain verbs of emotion: húl saĝ-ki gíd ní te su zi to to to to be happy with frown at be afraid of get (fearful) gooseflesh at The comitative can express simple conjunction." (The free-standing conjunction ù "and. Unlike the /a/ of the genitive marker -ak. me-bi me-gal-gal me-me-a diri-ga Its divine power is a very great divine power. 1. beside. 57 . alongside. and so some refer to the "conjunction" -bi-da "and. Cyl A ix 12 Ur III) èš-nibruki èš abzu-a ab-diri Shrine Nippur: the shrine surpassed the Abzu (Išme-Dagan C 1 OB) COMITATIVE -da (§188-194) The postposition -da is assumed to have been derived from the noun da "side" through the process called grammaticalisation. dispute with embrace (lit. zagin+a} In Ur III texts and personal names -a occasionally takes the place of dative -ra. u4+bi+a > u4-ba "in that day" = "at that time. p.) The sequence -bi-da is frequently shortened to -bi in this use. rival quarrel with compete. perhaps a glottal stop (so Jagersma). on. Functioning as a "locative of material" -a can indicate the substance from or with which something is made: é kù-ga i-ni-in-dù na4za-gìn-na i-ni-in-gùn He built the temple with silver." by contrast. then" or uzud gúrum-ma šid-da "goats accounted for during (the time of) the inspection. for example: Verbs of mutual or reciprocal activity: sá du14 mú a-da-man du11 gú lá to to to to be equal with. therewith." For example." but it may also be freely translated "into." and with such general senses it can occur with many different types of verbs. Often combined with the suffix -bi it can link two nouns in a nominal phrase. among. e. -a can mark the second member of a comparison. 15." The locative -a is a stable vowel. See Thomsen §181. measure up to. it is apparently never elided to a preceding vowel (although nominalizing -a followed by locative -a is normally written as a single /a/ in OB verb forms). Like the terminative or locative-terminative. It also occurs regularly to mark indirect objects with. which prevents elision to a preceding vowel.LOCATIVE -a (§180-186) The locative postposition -a generally has the meaning "in. is a loan from Akkadian used also to link clauses." or the like depending upon context.g. 7) 58 . both men cow and calf male and female Note the position of -bi-da before a genitive -ak in the following: maš-da-ri-a ki-a-naĝ en-èn-tar-zi du-du sanga-bi-da-kam "It is (-am) the m. In its ablative use its basic meaning is "removal or separation in space or time. SACT I 171:1-4 Ur III) (Both references apud Steinkeller.: lipiš-ta šà-ga-ni-ta šà-húl-a-ni-ta with anger > angrily with his/her heart > willingly with his/her happy heart > happily In many instances it is difficult to decide whether -ta is being used in a locative or instrumental sense. as in diĝir-e é-mah-ani-ta nam in-tar "The god decreed destiny from (within) his lofty temple. time": u4-bi-ta u4 é ba-dù-a-ta from that day. using?) an oven (Kang." especially with u4 "day." In its instrumental use -ta signifies "by means of. since that time. either an orthographic variant of -da to be transliterated as -dá. after (the time that something happened). 62 n." It is also used adverbially to describe emotional states. Examples: lú lú-da áb amar-bi-da nita munus-bi man with man cow with its calf male with female = = = man and man. An Old Sumerian variant of -bi-da is -bi-ta.-tax for the libation places of both Enentarzi and Dudu the administrator" (Nik I 195 1:4-2:3 OS). e. Bulletin on Sumerian Agriculture 8. the comitative case also provides the only way in Sumerian to convey the notion "to be able. In an abilitative function. a usage M. 74:1-2 Ur III) (45 sheep and goats) gir4-ta ba-šeĝ6 (45 sheep and goats) were roasted in (with. See CAD L 152 le'û lexical section for bilingual paradigms from the Old Babylonian and Neo-Babylonian grammatical texts. To illustrate: é in-da-an-dù He built (-n-dù) the house with/by him(self) (in-da-) = He was able to build the house ABLATIVE-INSTRUMENTAL -ta (§203-212) As its name indicates." Temporally it can be used in adverbial phrases or subordinate clauses to signify "when. with.g." as in "to cut with an ax. their" (possessive pronoun).and so one must keep in mind that a suffix -bi can signify conjunctive "and" as well as "that" (demonstrative pronoun) or "its. thereafter since the day that (-a-) the temple had been built The ablative tends to replace the locative especially in certain stereotyped expressions such as sahar-ta tuš "to sit down in the dust. or possibly an actual instrumental -ta postposition with comitative force." "out of (an area or container).g. for example: 1 sila4-ga ne-mur-ta ba-šeĝ6 1 suckling lamb was roasted in (with?) hot embers (BIN 3." "to fill with water. Civil has characterized as "location of remote deixis" (JAOS 103 (1983) 63). šu-níĝin 158 udu sila4-bi-ta "total 158 sheep and lambs" (VAT 4444 2:3). a pronunciation variant." Spatially it signifies "away from (a place)." also frequently when action is being described which occurs within a place away from that of the speaker. the ablative-instrumental postposition -ta has two different functions. since. e." This meaning is indicated only in the verb by a comitative dimensional infix. forever. 254-5) now assigns this adverbgenerating function to a newly identified morpheme which he calls the adverbiative with a pronunciation /eš(e)/.) Scholars normally do not attempt to apply these still uncertain rules of phonological variation and for convenience normally read the sign ŠÈ as šè in most environments." Compare the following two sets of parallel passages: igi-bi-šè é ba-sa10 Before them (the witnesses) the house was bought (Steinkeller. much. such as "to look at. a term that calls to mind the Akkadian terminative-adverbial -iš suffix which also generates adverbs. pp. téš-bé. Compare é-me-eš-e ĝe26-nu "Come into our house!" (Inana-Dumuzi Y 33) to be analyzed {é+me+(e)še}. The sign ŠÈ. who refers to this function as Terminativ-Adverbialis. The general meaning of the terminative is "motion towards and terminating at" a locus or goal. Thomsen therefore introduced a hybrid form /eše/ as the basic citation form of the terminative." or u4-ul-la-šè "unto distant days.TERMINATIVE -šè (§195-202) The usual citation form of the terminative is -šè. 38) for the terminative with possessive suffixes. to be distinguished from the proper terminative with a pronunciation /še/. 96: 3-5). 68:17) ĝiš UR. Steible. See the Summary of Pronouns Chart (p. No. gal-bi-šè "greatly" or saĝ-biš for saĝ-bi-šè "to its fore/top. as in the synonymous expressions téš-e. Compare writings such as gal-le-eš vs." "to pay attention to." Jagersma 2010 cites the personal name marked with a terminative lú-níĝ-lagar-e-eš (FAOS 17. In this function the terminative varies rather freely with the locative-terminative. Attinger's separation of the traditional terminative into two related but functionally different morphemes. FAOS 9/2 129. but the terminative required by the verb is retained in the verbal prefix -n-ši.. 5:1'-2' OS) {en-en+ene+šè) ka-ta è-a lugal-ĝá-šè ĝizzalx hé-em-ši-ak I have paid attention to what has issued from the mouth of my master (Išme-Dagan A 135 OB) igi-zi mu-un-ši-in-bar-re-eš sipa dur-dnamma-ra They directed a righteous eye towards him. 73:18 Ur III) igi-bé saĝ ba-šúm Before them (the witnesses) the slave was given over (ibid." en-en-né-ne-šè hal-ha-dam It is to be distributed to all the (ancestral) lords (DP 222 r. It is common not only with verbs of motion and action but also with with verbs of perceiving or attending. well. also has the value éš. (See also immediately below for P." "to listen to. téš-bi-šè "together." Note that Attinger (1993. as one." u4-dè-eš "like the day." DN-ra nam-ti PN-a-šè a mu-na-šè-ru He dedicated (the votive object) to the deity DN for the life of PN (Common OS dedicatory phraseology) An important secondary use of the terminative is to form adverbial expressions like gal-le-eš "greatly. Cf. however. 3:10 OS) {Vn+da+n+lá+Ø} 59 .UR-šè e-da-lá He waged man-to-man combat with him (Ent 28. There is evidence to show that the terminative could be pronounced /eš/ when preceded by a consonant or /š/ or /še/ when preceded by a vowel. to shepherd Ur-Namma (Ur-Namma B 36 Ur III) The personal dative postposition -ra here replaces -šè. Sales Documents No. 168-70."toward him. The Elementary Sumerian Glossary which is a companion to this grammar includes many compound verbs. on. 295323) supplies the typical case used to mark the indirect object for many common verbs including standard compound verbs. many Sumerian verbs are normally associated with or require complements (indirect objects) standing in particular adverbal cases. This is especially true of what are termed "compound verbs." verbal roots with specific nominal patients (objects) which when used together render ideas often expressed by single words in our familiar western languages. It is a helpful resource when one begins to analyze complete Sumerian sentences. among. Thomsen's Catalogue of Verbs (pp. into. beloved of Nanna. towards. 9:1 OS) Probably related to this adverbiative function is the use of the terminative in the meaning "as. for (persons) in. during together with from. which) by. king (whom) Enlil chose in his heart as the shepherd of the nation and of the four quarters of the world (Šu-Sîn No.áĝ "to measure out love" = "to love" presupposes an indirect object indicating the someone (dative) or something (locative-terminative) that is loved. those and 60 . COMPOUND VERBS AND THE STANDARD RECTION OF VERBAL COMPLEMENTS As previously mentioned." Compare the expression diri-zu-šè "more than you" (Letter Collection B 5:6 OB) For other examples and other specialized uses of the terminative see Thomsen §198-200. TRANSLATE THE LOCATIVE-TERMINATIVE FIRST AS "with respect to. that.UR-e e-da-lá He waged man-to-man combat with him (Ean 1." THEN USE CONTEXT TO CLARIFY ITS MEANING! THE NOMINAL SUFFIX -bi HAS THREE USES: POSSESSIVE: DEMONSTRATIVE: CONJUNCTIVE: its. within. by means of to. and occasionally notes the case postpositions commonly occurring with particular verbs. as. (adverb formative) d IF IN DOUBT. REMEMBER: ABSOLUTIVE ERGATIVE LOCATIVE-TERMINATIVE DATIVE LOCATIVE COMITATIVE ABLATIVE-INSTRUMENTAL TERMINATIVE -Ø -e -e -ra -a -da -ta -šè (zero mark of the subject/patient) by (whom. at. listed by their head nouns. their this. out of. upon. 5-11 Ur III) Like the locative-terminative the terminative can mark the second member of a comparison on the pattern of é-gal-la-ni é-zu-šè mah-àm "his palace is greater than your temple. the compound verb ki(g) . in the role or status of. For example. for. for (things) to. next to. 7. these. for" as in: ur-dma-mi maškim-šè in-da-an-gi4 He sent back Ur-Mami with him as the commissioner (NSGU 121:5 Ur III) šu-dsuen ki-áĝ dnanna lugal den-líl-le šà-ga-na in-pà sipa kalam-ma ù an-ub-da-límmu-ba-šè Šu-Sîn.ĝiš UR. an intransitive verb takes only a subject. there is no apparent distinction between transitive and intransitive verbs.INTRODUCTION TO THE VERB ERGATIVITY (§38-42. and the notion of "direct object" is not particularly useful at all in describing the working of the verbal system. 275-278) In an Indo-European subject/object or nominative/accusative language." In Sumerian. on the other hand. as in "the king (subject) built the house (object). an ergative language. An agent. on the other hand. Here we will also follow this practice and speak of a either a subject or patient which experiences or undergoes a state. As you begin your study of the verb. like English. the notion of "subject" takes on a decidedly larger meaning. Now compare the same sentences with agents added: lugal-e lú ba-an-úš By the king the man died = The king caused the man to die = The king killed the man lugal-e é ba-an-dù ┌─────────┐ lugal+e lú+Ø ba+n+√+Ø └────────┘ By the king the house was built = The king caused the house to be built = The king built the house 61 ┌────────┐ lugal+e é+Ø ba+n+√+Ø └────────┘ . verbal subject (also -Ø. process or event. even though both are marked by the same absolutive case. The term ergative (derived from a Greek verb meaning "to work. which show a nominative/accusative opposition in their basic verbal morphology. versus an agent (from Latin agere "to do") which causes that state or event to happen." A transitive verb. as in "the king (subject) died. They are also represented in the verbal chain by the suffix of the 3rd sg. Scholars currently working with Sumerian as an ergative language now however follow modern linguistic practice and make a syntactic distinction between the subject of an intransitive verb and the patient (virtual direct object) of a transitive verb. ordinarily requires not only a nominative subject but also an accusative direct object towards which the action of the verb is "directed" or transferred (thus Latin trans-itivus "gone across"). ba. see later in this lesson). will │ │ always be a strictly optional addition to a sentence. both standing in the unmarked absolutive case (-Ø). it will be very helpful to keep the following axiom in mind: ┌───────────────────────────────────────────────────────────────┐ │ Every regular Sumerian sentence or clause will always contain │ │ a subject (or patient). │ └───────────────────────────────────────────────────────────────┘ The following two sentences have precisely the same basic syntax in Sumerian: lú ba-úš é ba-dù The man died The house was built lú+Ø ba+√+Ø └───────┘ é+Ø ba+√+Ø └───────┘ lú and é are a subject and patient respectively.is a verbal prefix unimportant to the present discussion. do") is used by linguists both to label the case which marks this agent and also to distinguish the languages which feature such an ergative/absolutive contrast from those. " A perfective verbal form will usually refer to an event which has taken place in the past. but it can also refer to a event which the speaker believes will definitely take place sometime in the future. subjects and agents: ba-úš ba-dù He died. The underlying purpose for such incorporation of nominal information in the verb is to provide a means of pronominalizing that information. ongoing. by contrast. and it will be avoided in this introduction. in Sumerian (and in many other ergative languages) by the absolutive case." i.e. while the subject of a transitive verb is marked differently. what we would normally call the subject of an intransitive verb and the direct object of a transitive verb are both marked by the same case. on the other hand. observe how the suffix -Ø and infix -n. lugal "king" is the agent. TENSE AND ASPECT (§235-241) While English and other modern European languages show aspectual characteristics.) A sentence may also feature additional "participants. ba-an-úš ba-an-dù He killed him. a patient and a dative indirect object for example. the root dù "to build" transitive. The root úš "to die" would be considered intransitive in English. rather than nominal. if we wish to gain any sense at all of how Sumerian might have understood the notion "to build (something)" we have no other choice in English but to resort to a passive translation: "to cause (something) to be built. Since there is. Since it is technically possible for a sentence to contain two kinds of participants which are not a patient and agent. typically the nominative case. but it can 62 . in which verbal events are viewed in the simplest terms as either "completed" or "non-completed. In a nominative/accusative system. marked by the ergative case postposition -e and in the verbal chain by the 3rd sg. the subjects of both intransitive and transitive verbs are marked by the same case. [1975] article on the ergative system of Sumerian. e. An imperfective verbal form will usually refer to an event which is happening in the present or will be happening in the future. personal pronominal prefix -n. typically by the accusative case. I refer to the subject/patient and agent as the "first" and "second participant" respectively. is a predominately aspectual language. You may note that Thomsen (§277-286) refers to a Sumerian verb featuring only a subject as having only "one participant. It was built. the remaining verbal forms would still be complete Sumerian sentences." Mentally converting apparent transitive roots to passives may help initially to simplify the task of analyzing Sumerian verbal forms.(see the full paradigm later in this lesson). their verbal systems are predominately tense oriented (the major exceptions are the Slavic languages. a variety of indirect objects such as dative or locative phrases. Lastly. this terminology is useful only in carefully defined circumstances.g. Sumerian. no meaningful intransitive/transitive distinction in Sumerian." (Similarly. while the object of a transitive verb is marked differently." A verb featuring both a patient and an agent is then referred to as a "two participant construction. in which tense and aspect are central and grammatically distinct features)." To characterize the ergative pattern more generally in terms of our familiar subject/ direct object and transitivity contrasts: In an ergative language.in the examples above resume in the verbal chain information already supplied in the nominal chains of the sentences. but with pronominal. in Sumerian by the ergative case. If all the nominal chains of the four preceding examples were deleted. lú and é remain in the absolutive case. dù "to be built. however.Both sentences are again identical in structure. in my Orientalia 44 (Rome. He built it. placed after the root and any stem modifiers (discussed elsewhere). them (personal) │ │ 3i √-√ they. THE SUBJECT/PATIENT PARADIGM FOR PERFECTIVE (hamţu) VERBS (§279. while the imperfective can be translated by English past.also refer to action that was on-going in the past. but only for personal subjects. This subject is also marked in the perfective verbal chain by a corresponding pronominal suffix. as follows: ┌───────────────────────────────────────────┐ │ Sg 1 -(e)n I. suffix becomes just -e. Two contiguous lines from a scribal debate may show both uses (unless the first also illustrates pluralization): 63 . both are marked by -Ø. us │ │ 2 -(e)nzen you │ │ 3p -(e)š they. even though this practice may be a later innovation. albeit reversed. he/she/it goes. number. she/her. For example: máš-gán máš-gán-bi ba-bir-bir All its settlements were scattered apart (Uruk Lament 5:9 OB) sahar-du6-tag4-bi eden-na ki ba-ni-ús-ús Its many burial mounds he laid upon the ground in the steppe (Ent 28-29. especially in the older stages of the language. 294-299) A nominal chain representing the (intransitive) subject or (transitive) patient of a sentence stands in the absolutive case. present or future tense forms which do not emphasize or imply completion of action. Whether the apparently optional deletion of /š/ is a matter of phonology (a difference of dialect or idiolect?) or of orthography is not clear. and gender. conjugated for person.resumes -a} Just as adjectives could be reduplicated to indicate either pluralization or intensification of the root idea. it │ │ │ │ Pl 1 -(e)nden we. as in I/you go vs. OS) {-ni. slow") in reference to the Sumerian perfective and imperfective aspects. The Sumerian perfective can theoretically therefore be translated by English definite past or future forms ("did. did/will do repeatedly. 1:30f. For the 3rd person singular no distinction is made between personal and impersonal subjects. iterative or habilitative expressions will sometimes prove helpful ("was/is/will be doing. me │ │ 2 -(e)n you │ │ 3 -Ø he/him. Many scholars make use of the native Akkadian grammarians' terms hamţu ("quick") and marû ("fat. and the practice will be continued here for convenience despite some past concerns about its appropriateness (see Thomsen §231). For the 3rd person plural the suffix -(e)š is used. In Old Sumerian the final /š/ can be dropped. contrast exists. them (impersonal) │ └───────────────────────────────────────────┘ (also just -e in OS) (reduplication) The contrast in the singular between 3rd and non-3rd persons is less startling if one recalls that in the present tense of English verbs a similar. Progressive. and the 3rd pl. will certainly do"). there is some later evidence to suggest that reduplication of the root in finite verbs could likewise convey intensification as well as pluralization. This sometimes happens even within the same text as in Nik I 7 or Nik I 14 which show both ba-ug7-ge-éš and ba-ug7-ge "they died" in different lines. Reduplication of the verbal root (represented above as √-√) could serve to indicate plurality of 3rd person impersonal (and occasionally personal) subjects. used to do/always does"). by me │ │ 1 -Ø/ʔ │ 2 -eyou. this helping vowel can assimilate to the vowel of the preceding verbal stem. by them │ └───────────────────────────────────────┘ (Jagersma 2010 posits glottal stop) (-Ø. elements are problematic in most periods. in my view. to separate that consonant from the following consonantal subject suffix.é dù-dù-a-ni mu-un-gul-gul èrim-ma-ni mu-un-bu nunuz ĝar-ĝar-ra-ni bí-in-gaz-gaz ab-ba im-mi-in-šú Her (Bird's) well-built house he (Fish) thoroughly destroyed. shown in parentheses. the preradical position. by him/her │ │ 3i -bit. See the appended Verbal Prefix Chain rank order chart. The 1st and 2nd sg. In it he smashed all her laid eggs and cast them into the sea (Bird and Fish 107f. etc.) Examples: ba+du+n ba+gub+n ba+tuš+Ø ba+dù+Ø ba+tu(d)+nden ba+ku4(r)+nzen ba+šub+š ba+dù+dù > > > > > > > > ba-du-un ba-gub-bé-en (ba-gub-bu-un) ba-tuš ba-dù ba-tu-dè-en-dè-en ba-ku4-re-en-zé-en ba-šub-bé-eš (ba-šub-bu-uš) ba-dù-dù I/you go away I/you stood He/she/it sat down It was built We were born You (pl.e.before OB) (-n. marked by the postposition -e.or assimilated -V. by it/them │ │ │ │ 1 — │ │ 2 — │ │ 3p -n-√-(e)š they. This agent is also marked in a perfective verbal chain by a corresponding verbal prefix conjugated as follows: ┌───────────────────────────────────────┐ I. they. best considered an epenthetic helping vowel used. As can be seen in the following examples. 290-293) A nominal chain representing the agent of a sentence stands in the ergative case. OB) The /e/ vowel of the subject pronouns. (In the traditional Poebel-Falkenstein description the /e/ vowel is regarded instead as morphologically a part of the suffixes (-en.or assimilated -V. i. he tore up her storehouse. is.often unwritten until mid Ur III) The rank order position of the ergative prefixes in the verbal prefix chain is always the last slot before the root or. It may well be that in the earlier stages of the language the same contrast held here as in the paradigm for 64 . -eš. by you │ │ 3p -nhe/she.) entered They (people) were cast down They (things) were built THE AGENT PARADIGM FOR PERFECTIVE (hamţu) VERBS (§280. it is described as then elided or contracted when a preceding stem ends in a vowel. when a root ends in a consonant.).before OB) (-Ø. the first prefix slot to the left of the root as we transliterate the verbal chain. put another way. or -b-) vs. subject suffix -nzen. 3rd sg. go off to your city. in Ur III economic texts it is not uncommon for personal agents marked with the explicit plural element -(e)ne to be resumed in the verb by a collective -b. Sumerian Grammar in Babylonian Theory [1984]) show what is certainly an artificial distinction: 1st sg.are attested. e. let us take away THAT one (-b-)!" (in cohortative ga. The shape of this affix can give rise to ambiguous verbal forms. In this agent paradigm the distinction personal vs.often appears as an assimilated vowel until the end of Ur III. e. Similarly. The first includes a 3rd sg. -e. sequence -n-√-(e)š is used only for personal nouns. or perhaps lengthening of a preceding vowel). -n. -b.mark direct objects). An explicitly plural agent marker on the verb was probably felt not to be necessary when the nominal chain already conveyed this information. ba-ĝar-éš in Nik I 155 4:5).versus 2nd sg. -emay have been a reformulation or creation of the Akkadian scribes. personal prefix is discontinuous. Several of the Old Babylonian grammatical texts (J. like the corresponding possessive suffix -bi. is normally used only for impersonal nouns or collective groups of persons. The 3rd pl. -e-.g. that is. etc. but particularly in economic texts singular verbal forms are regularly used for plurals.forms preradical -n/b. -a. some vowel. a 3rd sg. subject marker -(e)š. -n. bí-in. non-3rd sg. On the other hand. marker -n-√-(e)š is used.element rather than -n-√-(e)š.g. ba+e > ba-a-. (-n.e. since the the prefixed -n. agent marker -n-√-(e)š. Black. The minimal verbal sentence ba-an-zi-ge-eš could thus actually represent either "He/she (-n-) caused them (-š) to rise" or "They (-n-√(e)š) caused me/you/him/her/it/them to rise"! The verb in the following context passage is ambiguous and could also be translated "they made him (etc.can be used to "objectify" or refer dismissively to persons. -n-√-(e)š is rare though not unknown in Old Sumerian (e. Compare the imperative which can be made plural using a 2nd pl. The second features the discontinuous 3rd pl.> bí-ì-. agent marker -n.prefix made plural by an added 3rd pl. and the prefix -b-. The 3rd pl. the -(e)š suffix displaces any suffixed subject marker. nu+e > nu-ù-. (-Ø-.) return": ki-ni-šè bí-in-gur-ru-uš He (-n-) made them (-š) return to his place (Puzur-Šulgi letter to Ibbi-Sin 40 OB. As late as Gudea only assimilated forms of 2nd sg.g.and a 3rd pl.resumes -šè) {b+n+gur+š} -n-√-(e)š is no doubt an early innovation. Compare the following: lú ba-zi lú-ne ba-zi-ge-eš lugal-e lú ba-an-zi lugal-e lú-ne ba-an-zi-ge-eš lugal-e-ne lú ba-an-zi-ge-eš The man rose The men rose The king caused the man to rise The king caused the men to rise The kings caused the man to rise {ba+zi(g)+Ø} {ba+zi(g)+š} {ba+n+zi(g)+Ø} {ba+n+zi(g)+š} {ba+n+zi(g)+š} The last two verbal forms are identical in form but not in function. e. and only the context could determine which meaning was intended. agent prefixes are not attested and presumably never existed. however. for example: 65 . 1st or 2nd person pl. i. it is composed of a prefix -nand a suffix -(e)š (an /e/ or an assimilated /V/ appears following a consonant) placed before and after the root respectively. subject suffix -(e)š. bí.the verbal subject. as in Inana's Descent 310: d inana iri-zu-šè ĝen-ba e-ne ga-ba-ab-túm-mu-dè-en "Inana.g. If the subject and agent were understood and marked only by pronominal elements in the verbal chain.and suffixed -(e)š can each have separate different uses. šub-lugal-ke4-ne e-dab5 "the king's underlings took it" (DP 641 8:8). Exceptionally. impersonal is preserved only in the 3rd person pronouns. the bare verbal chain ba-anzi-ge-eš would be ambiguous. Note further that when the pl. and 66 . patient} (no helping vowel needed) Whenever. when it is initial in a chain with no other prefix preceding.(§305-321) When one of the above ergative pronominal prefixes stands as the only element in a verbal prefix chain. this prosthetic vowel can be prefixed merely to show that the verbal form is finite. 156:1-5 Ur III) THE SO-CALLED CONJUGATIONAL PREFIX i." or conceivably even as an agentless sentence "the house was built. 100 2:1-4 Ur III) 130 gú 7 ma-na siki-sig17 ki Lú-dnin-ĝír-su dumu Ir11-ĝu10-ta dam-gàr-ne šu ba-ab-ti 130 talents 7 minas of yellow wool was received by the merchants from L. i. barring certain technical exceptions.) had built it (cohortative ga-) (precative hé-) (negative nu-) (prospective ù-) Lastly. the unfortunate result of these orthographic practices is that in early texts a sentence such as é ì-dù can be translated as "I. Umma No. agent is also often unmarked until later in the Ur III period. The following examples feature four common prefixed preformatives by way of illustration (refer to the appended Verbal Prefix Chain chart): ga+b+dù+Ø hé+n+dù+Ø nu+n+dù+š u+b+dù+Ø > > > > ga-ab-dù hé-en-dù nu-un-dù-uš ub-dù I indeed built it (-b-) He did indeed build it They did not build it When they (coll. and no other morpheme is marked by a prefixed element.5 1/3 (bùr) aša5-sig5 àga-ús Tab-ba-ì-lí-ke4-ne íb-dab5 5 1/3 bùr of good field were taken by the guards of Tabba-ili (Contenau. element is unmarked (-Ø-). Wilcke observed (AfO 25 (1974-77) 85 n.e. (HSS 4. Since the 1st sg. Thomsen §273). usually /i/. a verb must feature some prefix to be considered finite (cf. or he/she built the house. then — in the view of this grammar — the language employs a prosthetic vowel. an agent prefix is preceded by another prefix ending in a vowel (nearly all other possible prefixes)." dependent entirely upon context. 8) that in Old Sumerian texts from Nippur and Šuruppak at the northern border of Sumer. sometimes /e/ or /a/. to render certain forms pronounceable: Ø+dù+Ø e+dù+Ø n+dù+Ø b+dù+Ø n+dù+š > > > > > ì-dù e-dù in-dù ib-dù in-dù-uš I built it You built it He/she built it They (collective) built it They (personal) built it {agent + √ + 3rd sg. and the 2nd sg. the initial prosthetic vowel is only ì-. since by definition. C. The variation between ì. although its occasional appearance indicates that it was known or felt to be present morphologically. you. on the other hand. no helping vowel is needed.is mostly not indicated in writing. while in texts from Umma in the middle of Sumer it is only e-. For example: lú ĝen+Ø > lú V+ĝen+Ø > lú ì-ĝen The man went In texts earlier than the middle of the Ur III period the prefix -n. son of I. if a sentence does not feature an agent. (see Å. In PreSargonic Lagaš texts a. Since its primary function is to make finite a verbal form lacking any other prefix. (By contrast. in the Edubba text Scribe and His Perverse Son 132 the Nippur duplicates write ì-ne-éš "now. e. its oil he applied to the edge (Edzard.is manifested in other contexts besides the regular verbal prefix chain. minimal agentless verbs usually take the form ba-√ in this corpus. Westenholz. SRU 31 6:16-18 = OS property sale formula) {bi+n+dù+Ø} {bi+n+ak+Ø} In Sargonic and earlier texts the vowel a. Early Cuneiform Texts in Jena [1975] 8). In the PreSargonic Lagaš economic corpus. ì/e-√ forms are usually found in association with agentive or locative nominal chains which in later periods would be marked in the verb with a preradical /n/.and ba.g. One may speculate that the ultimate origin of the prefix ì. where -b.is also a component of the Stative Prefix al.) This phenomenon would help to explain why this prefixed /i/ sound came to be written with the sign whose other main reading is /ni/. for example. It is significant.often serves as such a finite formative (especially the so-called "passive" use of ba-). Pre-Sargonic and." and that "a.is common in the forms ab-√ or an-√. from ì-. and in such contexts it must usually be left untranslated. bí. alshould properly stand alone in a verbal form.sometimes take the form of agentless Akkadian statives (conjugated verbal adjectives. Finally. 13). texts of early Lagaš." while the duplicate from Ur in the south of Sumer writes e-ne-éš.as well as ì-. ZA 78.has come to be referred to as the Sumerian stative prefix. however. the other verbal locative prefix (see later). functionally indistinguishable. a few attestations of 67 . e-) in minimal ì+√ forms was a preradical /n/ used either with ergative or locative meaning. It is in my view an elegant solution to a perennial problem of Sumerian grammar. Sargonic texts. show a not entirely consistent system of i/e vowel harmony. should now be abandoned as a useless misnomer (cf. e-ĝar.(see below). near Umma. The foregoing interpretation of the uses of the verbal prefix element /i/ contrasts strongly with the traditional Poebel-Falkenstein explanation of the Conjugation Prefix ì-. referring to the prefixes mu-. There are.g.for use in such situations. often passive in sense.appears in other contexts. though to a lesser extent. where preradical /n/ is normally not pronounced. as well as in other times and places. a.appears in sentences where the agent is implied but not spelled out.is "characteristic of Fara. For example. D.frequently replaces ì.e. Edzard. This is by no means a rigid system. See Thomsen §7.(var.in agentless "passive" verbs especially before dative -na. ì-šúm vs. continued and amplified by Thomsen and others. to our eyes at least. however. possibly a dialectal feature. In any case the term Conjugation Prefix. in simple agentless verbs one often encounters verbal prefixes which do not seem to be strictly required by the meaning or syntax and which are consequently difficult to translate. Akkadian translations of verbal forms featuring al. THE STATIVE PREFIX al(Thomsen §353-358) Because some prefix is required to make a verb finite. Thus al. however. P. Further: gag-bi é-gar8-ra bí-dù ì-bi zà-ge bé-a5 Its peg-document he inserted into the wall.or -n. both in prosthetic and epenthetic vowels. The language actually has a special prefix al. /e/ before /e/ and /a/ sounds." differing in function from the ba.prefix in truly agentless sentences (Third-Millennium Legal and Administrative Texts [1992] 35). The prefix ba. e. Since alalways occurs in agentless sentences. Steinkeller notes that a. but only a few aspects of this interpretation are gradually gaining wider acceptance. 114 n.indicate a locus rather than an agent. that a. dependent upon the vowel of the root or to some extent that of preceding dimensional prefixes: /i/ before /i/ and /u/ sounds. paris "it was cut"). thereby defeating its original purpose by rendering it unnecessary. whether a subject or agent. featuring only a subject. although the patient can be topicalized by placing it before the agent.Verb.its co-occurring with a preformative.0 ku6 al-šeĝ-ĝá 10 (sìla) fish which has been cooked (Limet. The latter elided forms suggest that alshould probably be analyzed as an element /l/ plus a prosthetic vowel /a/ (see above). REMEMBER WHEN ANALYZING ANY SENTENCE: EVERY SUMERIAN SENTENCE OR CLAUSE ALWAYS CONTAINS A SUBJECT OR PATIENT.varies with simple non-finite past participles: 50 uruduha-bù-da dúb-ba 46 uruduha-bù-da dúb-ba 180 uruduha-bù-da al-dúb-ba NUM copper hoes.0. Textes No.of the negative preformative nu.prefix adds little or no information to the verbal form can be seen from the following three parallel entries from Ur III economic texts.Patient .or the obsolete nominal formative nu.< lú "person" — it is possible the stative prefix al. the word order is Subject .Verb. DETERMINE WHETHER AN AGENT IS PRESENT ONLY AFTER YOU HAVE IDENTIFIED THE SUBJECT OR PATIENT! TRANSLATE PUTATIVE TRANSITIVE VERBS PASSIVELY TO HELP LOCATE THE SUBJECT! 68 {al+šeĝ+Ø+a} (UET 3. featuring a patient and an agent.and li. the usual word order is Agent . SRU 20:32-33 Sargonic) 0. 396:1) {dúb+a} {al+dúb+Ø+a} {ù+(a)l+su8(g)+eš+a+ta} . where a participialized finite verb featuring a stative al. 311:1) (UET 3. In a verbless nominal sentence the subject normally precedes the predicate. In a transitive sentence. 13 OS) inim-bi igi-ne-ne-ta al-til This matter was concluded in front of them (Edzard.1. 312:1) (UET 3. That the al. IDENTIFY THE SUBJECT OR PATIENT BEFORE PROCEEDING FURTHER! A SENTENCE MAY CONTAIN AN AGENT. and the verb. These very rare exceptions include a negated form nu-al-√ or nu-ul-√ and prospective forms ul-√ or ù-ul-√. Since /n/ and /l/ alternate in certain contexts — compare the allomorphs la. Indirect objects and adverbial phrases typically stand between an initial nominal chain if present. beaten? A few other examples: 1/18 (bùr) 20 (sar) kiri6 gú pa5-PAD al-ĝál (acreage) of orchard existing on the bank of the PAD-ditch (MVN 3. In an intransitive sentence. although once again such chains can be topicalized by placing them at the beginning of the sentence. although poetic license in literary contexts permits exceptions.goes back to an early preradical locative prefix n+√ > an-√ which served merely to locate a minimal verb existentially "here" in space and so to render it finite. In a verbal sentence or clause the most reliable rule is that the verb stands in final position. 93:9 Ur III) diĝir-ama diĝir-a-a ul-su8-ge-eš-a-ta When the mother-gods and father-gods stood by (Lugalbanda in Hurrum 160 OB) BASIC SENTENCE SYNTAX Sumerian is basically an S-O-V language. whose description is more problematic and which will consequently be treated separately. these prefixes have also therefore been referred to broadly as dimensional infixes rather than dimensional prefixes. certain of the above elements will. is marked in the perfective verbal chain by a suffix.: mu+da+tuš+Ø e+da+ti(l)+Ø n+da+ti(l)+Ø b+da+gub+Ø ne+da+ĝen+Ø > > > > > mu-da-tuš e-da-ti in-da-ti ib-da-gub ì-ne-da-ĝen He He He He He sat with me lived with you lived with him/her stood with it came with them 69 . a pronominal element standing after the verbal root. The relative position of each prefix present in the chain is fixed: dative always comes before ablative. at least in the singular: ┌────────────────┐ │ Sg 1 mu/m │ │ 2 Ø/e/r │ │ 3p n │ │ 3i b │ │ │ │ Pl 1 ? │ │ 2 ? │ │ 3p ne │ └────────────────┘ (Jagersma 2010 posits also a glottal stop in some contexts) (unassimilated -e. Nominal chains standing in any of the remaining adverbal cases can be resumed in the verbal chain by a prefix.is not attested before OB) (me is predicted) (e-ne is predicted) The several forms of the 1st and 2nd sg. viz. The prefixes which resume locative. in my view. ablativeinstrumental and terminative prefixes. an element standing before the verbal root. require a preposed prosthetic vowel to render them pronounceable when they stand initially in a verbal prefix chain. This pattern holds for the dative.DIMENSIONAL PREFIXES I: INTRODUCTION The subject (or patient) of a sentence." In its fullest form. Edzard's 2003 Sumerian Grammar avoids the problem by instead using the neutral term "indicator. See the appended Verbal Prefix Chain chart (p. elements alternate according to period and the prefixed case markers with which they occur. and these prefixes therefore comprise one subset which henceforth will be referred to together as the dimensional prefixes. comitative. ablative always comes before ergative. standing in the absolutive case. Since the Falkenstein school of grammar maintained that the dimensional prefixes cannot begin a verbal form but must always be preceded by one of a number of Conjugation Prefixes (a term and analysis not employed in this grammar). according to the phonotactic scheme followed in this grammar. and locative-terminative nominal chains consist theoretically of pronominal elements only. 150) for a schematic representation of the rank order of prefixes. ergative. etc. this alternation will be discussed in detail apropos of the locative-terminative core prefixes. and represent a second subset of prefixes which henceforth will be referred to as the core prefixes (following Jacobsen). DIMENSIONAL PREFIX PRONOUNS (§428-430) The pronominal elements which can occur in dimensional prefixes are similar to the prefixes of the hamţu agent. Like the ergative pronominal elements. a verbal dimensional prefix consists of a pronominal element and a case element which correspond to the antecedent head noun and case postposition of a particular nominal chain. terminative. one locative-terminative prefix. see presently): LOCATIVE DATIVE ┌─────────┐ ┌─────┼──────┐ │ lugal-e nin-ra iri-a é ì-na-ni-in-dù └─────────────────────────┘ ERGATIVE COMITATIVE ┌────────────┐ *lugal nin-da iri-šè in-da-ab-ši-ĝen └───────────┘ TERMINATIVE ┌────────────┐ lugal nin-da iri-šè in-da-ĝen ┌─────┐ lugal nin-da iri-šè ib-ši-ĝen (a) A house was built by the king for the queen in the city (b) The king went to the city with the queen (c) (d) ditto ditto The above restrictions do not always apply when a comitative. Sentence (b) would have to be rendered either by (c) or (d) (although a prefix -ni.SYNTAX OF THE DIMENSIONAL PREFIXES (§423-427) Dimensional prefixes theoretically resume or repeat in the verbal chain information already present in one or more nominal chains of a sentence. Thus. Such instances used to be explained as deletions of specific "understood" pronominal objects.prefix. A verbal chain can (theoretically) contain a maximum of one ergative prefix. See the appended Prefix Chain Chart for restrictions. sentence (a) is grammatical but sentence (b) is not. for example: ┌───────┐ nin lugal-da in-da-tuš └─────┘ ┌──────┐ naĝar iri-šè ib-ši-ĝen └─────┘ The queen sat with the king The carpenter went to the city A sentence may contain a number of nominal chains. where three allomorphs of the ablative prefix are employed in sequence to give an overwhelming ablative sense to the verbal idea: (a) (b) (c) im-è im-ta-è ma-da-ra-ta-è It came out hither (-m-) It came out <from it> hither It came out-out-out for me! {m+√+Ø} {m+<b>+ta+√+Ø} {ma+*ta+*ta+ta+√+Ø} The last form is unusual and may represent a playful stretching of the resources of the language. as shown below in example (b).could substitute for the missing second prefix. A pronominal element and following case element refer back to an antecedant head noun (with any modifiers) and the final case postposition respectively of a particular nominal chain. and one other dimensional prefix. one dative prefix. 70 . but there are restrictions on the number and kind that can be resumed by full dimensional prefixes (pronominal element plus case marker). but it is apparently still good Sumerian and represents a good indication that the da/ta/ši case elements in particular may be used independently to add more amorphous directional ideas to a verbal form without reference to any specific goal or object. But compare form (c) from a Gudea royal inscription. A verbal chain may not contain two prefixes from the subset of comitative. ablative-instrumental or terminative case element is used without a pronominal element to lend a directional nuance to the meaning of the verb. ablative-instrumental. It might also feature a preceding secondary ba. for example. e. as well as prefixed pronominal elements. especially after Sumerian died out. dimensional prefixes are rarer in verbal forms in earlier texts when Sumerian was a living language. In the following illustrations it resumes dative and terminative objects: ┌─────────────┐ kur-gal-e sipa dur-dnamma-ra nam-gal mu-ni-in-tar The Great Mountain (= Enlil) decided a great fate for the shepherd Ur-Namma (Ur-Namma Hymn B 37 OB) ┌────────┐ e-bi i7-nun-ta gú-eden-na-šè íb-ta-ni-è That levee he extended from Princely Canal to Desert's Edge (Ent 28 ii 1-3 OS) Finally. marked only by the zero verbal subject pronoun (-Ø). omission of the nominal postposition. 36 14:1-3) One may suggest as a general principle that the marking in the verb of any information already present in the nominal parts of a sentence. the 3rd sg. 36 11:2-3 OS) PNN PN2 kurušda-da e-da-sig7 PNN lived with PN2 the animal fattener (CT 50. especially one present in an earlier sentence or clause.There is not always a clear one-to-one correspondence between the nominal chains of a sentence and the markers in the verb. is especially common.would refer pronominally to an understood nominal chain iri-šè "to the city": (a) (b) lugal iri-bi-ta ib-ta-è a-na-aš ib-ši-gi4 The king had left that city Why did he return to it? {b+ta+√+Ø) {b+ši+√+Ø} Further. either a case postposition or a dimensional prefix can be omitted for stylistic or other reasons without significant loss of information: lugal dumu-ni-da in-da-gub (a) lugal dumu-ni-da ì-gub (b) lugal dumu-ni in-da-gub The king stood with his son (full form) (shortened alternatives) In OS Lagash economic texts. since the marking of the same idea in both a nominal and verbal complex is redundant. did extensive resuming of nominal information in the 71 {lá+a+(a)nene+(ta)} . is basically optional and at the discretion of a particular speaker. As a result. For example.g. Only later. or vice versa. and the dimensional prefix -b-ši. pronominalize an understood nominal chain. PNN PN2 e-da-sig7 PNN lived with PN2 (CT 50. for example. assume that sentence (b) below directly follows sentence (a) in a narrative. and it often resumes non-locative nominal chains. lá-a-ne-ne nu-ta-zi It was not deducted from their surplus (Nik I 271 4:1 OS) dub-daĝal nu-ta-zi It was not deducted from the wide tablet (Nik I 210 4:1 OS) Alternative marking can even be found within the same text. e.(discussed in a later lesson) had a broad and quite general referential use. lugal "king" would then be the understood subject of (b).g. locative-terminative prefix -ni. A prefix may. a5 šu-tag .du11 in ." This was a highly productive method of new word formation and many such compound verbs exist.du11 u6 .du11 to to to to perform wing-flapping do a choosing do a scent-sniffing > smell do an earth-rubbing > perform a prostration to do a making-resplendent to perform a cleaning (of canals) to do a hand-touching > adorn (giš) to to to to to to to to to to to to to to desire do words.du11 še-er-ka-an . smell FULLY MARKED DIMENSIONAL PREFIX SEQUENCES RESUME EXPLICIT OR UNDERSTOOD ADVERBAL NOMINAL CHAINS. The verb of the base expression takes the form of a hamţu participle (explained later). Some common examples include: al .a5 kíĝ . run act/treat gently.du11 šùd . Examples: á .du11 mí . one can encounter OB verbs featuring core prefixes that resume both a locative and a locative-terminative as in Šulgi R 66: dnin-líl-da ki-ĝišbun-na-ka zà-ge mu-dì-ni-íb-si-éš "With Ninlil {mu+n+da} they filled the sides" (-e = -b-) in the feastplace (-a = -ni-).a5 si-im(-si-im) .du11 silim(-ma) . take care of. Ebeling in Analyzing Literary Sumerian (London. VOCABULARY NOTE 1 Auxiliary Verbs Many Sumerian compound verbs were formed using a head noun and one of the two auxiliary verbs du11(g) "to do" or a5(k) "to do." and "A propos de AK 'faire' I-II. For an analysis of this use of ak see also J. greet do decoration. Attinger. 208-275.luh šu . and note that M.du11 šu .su-ub pa .a5 pa-è .a5 en-nu-ùĝ . and often fanciful." Zeitschrift für Assyriologie 95 (2005) 46-64.a5 ki-su-ub . nurture perform a greeting.du11 inim . act do a prayer.è šu .tam ir . perform.du11 kaš4 .verb become the norm. 1993). marvel at work with the pickax/hoe perform the watch do work do sniffing. SOME DIMENSIONAL PREFIX CASE ELEMENTS ALONE CAN ADD NON-SPECIFIC DIRECTIONAL IDEAS TO THE VERB. exert oneself.tag REMEMBER: flap the wings" choose sniff a scent rub the earth > prostrate onself to make respendent to clean the hands to touch with the hand to to to to á-dúb .si-im ki . and verbs in literary texts from the Old Babylonian schools show the most elaborate. 3).du11 al . Civil accepts a meaning "to do" for du11 in these constructions (RAI 53 [2010] 524 n.a5 ir-si-im .a5 šu-luh . especially pp. pray wonder at. decorate use the hand.. sniff.dúb bar . Eléments de linguistique sumérienne (Fribourg.a5 Periphrastic Verbs The auxiliary verbs du11(g) and a5(k) are also used with ordinary compound verbs to form new periphrastic verbs whose meanings rarely seem to differ except stylistically from the simpler expressions. 319-764 for "du11/e/di et ses composés. dimensional prefix sequences. speak (often with elliptical patient <inim>) insult perform running.a5 bar-tam . To give only one minor example. 72 . For full listings of occurring forms and detailed discussions of morphology and syntax see P. 2007) 144ff. " šu-du8-an-ni (BibMes 1.8.and 3rd pl. 30:6 Ur III) for hé-na-lá-e-ne "Let them pay him!". By contrast. it is apparently formed with the pronominal elements /m/ and /n/ bound to a case element /e/. -ne-. as units.is well attested in all periods.instead of usual -ne-.stands initially in the prefix chain. -ne-a.5. in-ne-gub-ba-a. in-na-an-du11. me. ma. identical in form and possibly in origin with the locative postposition -a. íb-bé regularly instead of íb-e "he says. 1 mato me │ │ 2 -rato you │ │ 3p -nato him.g. etc. pronominal element -e-. e.for na-mu-." or the frequent initial prefix sequence nam-mu. it must be preceded by the prosthetic vowel /i/ (in some contexts or dialects /a/ or /e/). ba-an-na-šúm. Compare the following forms with and without a preceding negative preformative nu.to be doubled. inimma-an-ni (AuOr 14.or -ne-. again in connection with /n/ sounds. 20 rev. Cf.1. ki an-na-áĝ-ĝá-ni. The 1st and 2nd plural prefixes are on the whole quite rare. It is seen elsewhere in the grammar.) "his guarantee" for šu-du8-a-ni. the prefixes ma-. Edzard 2003.may likewise have been an artificial creation based on the 2nd sg. the dative prefix consists of a pronominal element /m/. When one of the prefixes -ra-.and ba. Of the plural prefixes.may initiate a chain without the help of this vowel. her │ │ 3i bato it. 3' Sarg. cites at least one instance of a 3rd pl. hé-na-lá-en-ne (TCS 1. /r/. also of the locative-terminative prefix -ni. especially in initial position. -na. These dative prefixes are always written as bound open syllables. -ne. them (impersonal) │ │ │ │ pl. In the 1st and 3rd person plural. created by analogy with 1st sg. /n/. but also with /m/ or even /b/. meis found only in a few OB texts and might have been an innovation. No prosthetic vowel is needed when a dative prefix is preceded by another prefix ending in a vowel. the pronominal and case elements are never written separately. 73 . an-ne-šúm. 163 1:2' Ur III) for inim-ma-ni "his word. na-an-ni-in-è.DIMENSIONAL PREFIXES II: DATIVE THE DATIVE PREFIX PARADIGM (§431-437) ┌─────────────────────────────────────────────┐ │ sg."not": ma-an-šúm ì-ra-an-šúm ì-na-an-šúm ba-an-šúm *me-en-šúm ì-ne-en-šúm nu-ma-an-šúm nu-ra-an-šúm nu-na-an-šúm la-ba-an-šúm *nu-me-en-šúm nu-ne-en-sum He gave it (not) to me He gave it (not) to you He gave it (not) to him/her He gave it (not) to them He gave it (not) to us He gave it (not) to them (nu+ba > la-ba-) (hypothetical) In most periods it is common for the /n/ of -na. or /b/ bound to a case element /a/. This is an orthographic feature with no morphological significance (in the view of most scholars) which should be discounted when analyzing verbs. and -e-ne.or -ne. 1 meto us │ │ 2 -e-neto you │ │ 3p -neto them (personal) │ └─────────────────────────────────────────────┘ (attested in OB only) (attested in OB only) In the singular. probably identical in origin to the locative-terminative postposition -e. 12. resumed in the verb by the prefix -ni-. it can be used only with personal referents. its ethical dative or benefactive use ("to do something for the benefit of someone") may have been a secondary development. prefix ba-. Thus the dative is basically a directional element. for example: um-ma-bé ad gi4-gi4 ba-an-šúm ab-ba-bé inim-inim-ma ba-an-šúm To its old women he gave advising.SYNTAX OF THE DATIVE (§438-440) The dative is a personal case exclusively.-term. See the comments and examples of T.(Thomsen §337. Edzard 2003. was probably the original function of the prefix ba-. and in the verbal chain by a corresponding prefix.). A dative object is marked in a nominal chain by the postposition -ra (or -r or -Ø after vowels). and that the nominal postposition -ra and the personal dative pronoun series in the verbal chain were secondary innovations. While this is a generally applicable rule.8. the dimensional prefix represents a pronominal object. Many verbs of motion which we would not necessarily associate with the idea of a dative goal show this personal/dative vs. over time it came to acquire additional uses.1. impersonal/locative-terminative contrast. It might well turn out that dative and locative-terminative will ultimately best be explained as merely the personal and impersonal forms of the same basic case. the same species of rection or direction of motion (see now G. it is marked in a nominal chain not by dative -ra but by the locative-terminative postposition -e and in the verbal chain by the 3rd sg. 74 . especially impersonal datives. to its old men he gave consulting (Curse of Agade 29-30 OB) There has been speculation that historically -e was regularly used with personal nouns as well. If there is no nominal chain present.3) While the marking of locative-terminative goals. note that nouns construed as collectives fall into the impersonal gender category. Examples: lugal-e engar-ra še ì-na-an-šúm énsi-ke4 lú-ne-er níĝ-ba ì-ne-en-šúm diĝir-ĝu10 nam-lugal ma-an-šúm nam-ti-sù ì-ra-an-šúm The king gave barley to the farmer The governor gave gifts to the men My god gave kingship to me To you he gave long life If an otherwise dative object is impersonal. impersonal forms: ┌─────┐ lugal-e érin-e še ba-an-šúm šagina-ne-er kù-babbar ì-ne-en-šúm └──────────────┘ ┌──┐ inim diĝir-ra an-e ba-te lugal-ra ì-na-te └────┘ The king gave barley to the troops To the generals he gave silver The word of the god approached heaven It approached the king OTHER USES OF THE PREFIX BA. Jacobsen in JAOS 103 (1983) 195 note j. 341-351. Orientalia 68 (1999) 251-3). Zólyomi. 12. as in "to approach" or "to come/go to" a person (dative) or a place or thing (loc. and it is entirely permissible for an ordinarily personal noun to be used as a collective and thus be marked by -e and resumed in the verbal chain by "impersonal dative" ba-. like the locative-terminative. Following are several artificial illustrations of parallel personal vs. ZA 45 (1939) 180f. with unusual and probably artificial Akkadian translations (OBGT VII 207208.and ba-da. The Sumerian Conjugation Prefixes as a System of Voice (Leiden. passive. Finally. out of").forms. presumably." a category of prefix which. -t. it occurs commonly with (agentless) forms of the verb úš "to die.and -ra-) to form the the emphatic ablative prefix sequences ba-ta-. PASSAGES ILLUSTRATING THE PREFIX BAba. three directionaltering uses and one tense-related use: the separative (i. see the appended Verbal Prefix Chain chart for a schematic view of its rank and occurrence restrictions." and many scholars now describe this ba. One wonders whether these ablative sequences were originally derived from the adverbial expressions bar-ra or bar-ta "outside.must be assigned a rank order slot immediately preceding that of the other dative prefixes. in an abbreviated and reinterpreted form.e. it is not unthinkable that Akkadian speaking scribes may sometimes have employed the apparently at least partially corresponding Sumerian element ba.e. although the du/ĝen paradigm of the Old Babylonian Grammatical Texts does employ several ba-me. or other forms of spatial or temporal removal from the area of the speech situation. ablative). reflexive." ba. Archiv für Orientforschung 25 (1974/77) 85 + n. *ba-ba-. 6. reflecting its expanded new range of uses. Ablative ba. Wilcke. the arguments of C." as in ba-úš "he died. This use is common in verbal forms with no agents. ba-na-.as an indicator of passive or middle voice.in the prefix chain must have changed.may also function with a less obviously directional meaning as a substitute for the prefixed prosthetic vowel /i/. in my view. originally the same rank as the other dative prefixes. ba-ra." With the verb de6/túm "to bring" it varies regularly with the ventive prefix mu. Woods in his The Grammar of Perspective.among the "Conjugation Prefixes. and now the description of the "middle marker" ba." See discussion in Falkenstein." or ba-gub "he stood. which was almost certainly derived from the noun u4 "day. It does not co-occur with itself." or the dimensional prefix -da. 219-229). For example. and perfect.in Jagersma 2010 §21.infix. ba-ne-. it eventually became capable of co-occurring with the 2nd and 3rd person personal dative prefixes: ba-ra-. to the head of the verbal chain in the manner of the prospective preformative ù-. Her extended discussion of this traditional descriptive category can be found in §341-351. i.in ways similar to their Akk. despite its "dative" origin. While it had the same origin and so. particularly in the OB schools which were responsible for creating or preserving most of the extant Sumerian literary texts upon which we in turn base much of our grammatical description. reflects an inadequate overall analysis of the verbal prefix system. Since Sumerian and Akkadian existed intimately together for a very long time in a linguistic area (German Sprachbund).or *ba-me-. and does not occur with 1st person prefixes in proper Sumerian contexts. At some stage in the history of the language the rank order of ba. Thomsen. frequently co-occurring with the proper ablative dimensional case elements (-ta. *ba-ma.used to resume locative-terminative goals a na8-na8 nu-na-šúm-mu anše a na8-na8 nu-ba-šúm-mu He used not to give him (-na-) drinking water. 2008). In any event. For such a view see the early work of C. destroying." which became attached.is consistently equated with the Akkadian verbal infix -twhich has four different meanings depending upon grammatical context. ba.which derives from the noun da "side. following Falkenstein."hither" to add opposing directional nuances: mu-un-de6 "he brought it in" vs.It often serves as a kind of non-specific ablative marker ("away from.(< ba-ta-) discussed later. ba-an-de6 "he took it away. as in é ba-dù "the house was built. time. it should be noted that in the collection of bilingual Old Babylonian Grammatical Texts (OBGT) ba. he used not to give the donkeys (-e) drinking water (Ukg 6 2:6'-9' OS) {anše+e} 75 . classes ba.is often seen with verbs of actual or figurative taking away. and male and female slaves to the temple (Biga. TSA 13 5:4 OS) PN-e nu-èš sagi ir11 géme é-e ba-šúm PN gave a nu'eš-priest. 57) 76 {ba+n+túm+e+Ø} {bí.resumes -e} .and ba-) ká-silim-ma-bi gišal-e bí-in-ra kur-kur-re silim-silim-bi ba-kúr He struck its Gate of Well-Being with a pickax. Cyl B 1:15 Ur III) anzumušen-gin7 gù dúb-da-zu-dè igi-zu-ù a-ba ba-gub At your making (your) voice quaver like the Anzu bird. 149:3-4 Ur III letter order) {ba+su8(g)+(e)š} {ba+n+šúm+Ø} {m+n+tu(d)+Ø. ba+n+gub+Ø} {m+ba+b+e+Ø} {igi+zu+e} 30 gú ésir-àh ésir-àh tár-kul-la-ke4 ba-ab-dah-e He shall add 30 talents of dry bitumen to the dry bitumen of the mooring posts (Sollberger. royal gur.anše surx(ÉREN)-ra-ke4 ba-su8-ge-éš They (the men) were stationed by the team-donkeys (Genouillac. TCS 1.) alaĝ-na-ni mu-tu nam-šita-e ba-gub He created his stone figure and set it up for prayer (Gudea Statue M 2:7-3:2 Ur III) énsi-ke4 diĝir iri-na-ke4 rá-zu im-ma-bé The governor performs a prayer to the god of his city (Gudea. Fs. NSGU 212:14 Ur III) Agentless Verbs with bamu lugal-la ba-pà mu lugal-la in-pà A royal oath was sworn A royal oath he swore (legal phrases. he shall take away the slave (Falkenstein. J. and for all the lands all their well-beings turned hostile (Curse of Agade 125-126 OB) Ablative baPN-e nam-érim-bi un-ku5 ìr ba-an-túm-mu When (u-) PN has sworn an oath regarding this. 355:1-4 Ur III) ur-dig-alim-ra ù-na-du11 4 dumu-dab5-ba 1/5 še <gur> lugal-ta hé-ne-šúm-mu gur hé-ne-gi-né še hé-ne-tag-tag-ge ù 8 še gur-lugal-àm dumu-dab5-ba bala-sun-na-ke4 ha-ba-ab-šúm-mu Say to Ur-Igalima: Let 1/5 royal gur of barley each be given to the 4 "seized citizens"! Let the gur be verified and all the barley be set aside(?) for them! Further. cf. Klein 30 2:9-12 Sarg. a cup-bearer. 8 gur. Sales Documents p. Steinkeller. of barley let him give to the "seized citizans" of the old term! (MVN VII 398:1-9 Ur III letter order.resumes -e} {ba. note alternation of -ne. who could stand before you? (Šulgi X 113 Ur III) im siki-ba-ke4 gù ba-dé The wool-ration tablet has been called for (TCS 1. RESUMES "IMPERSONAL DATIVES.E.0 še gur-saĝ+ĝál é-a ba-si en-ig-gal nu-bànda é-é-bar-dbìl-àga-mes-šè-dù-a ì-si 608 s. PARTICULARLY IN AGENTLESS "PASSIVE" (OR MIDDLE) VERBAL FORMS 77 . I.0. DATIVE PREFIXES RESUME ONLY PERSONAL DATIVE OBJECTS.CAN FUNCTION ALSO AS AN ABLATIVE MARKER OR AS AN UNTRANSLATABLE SUBSTITUTE FOR A PROSTHETIC /i/ PREFIX. NOMINAL CHAINS MARKED BY THE POSTPOSITION -ra ba.-gur of barley were stored in the house.-storehouse (Nik I 83 1:1-2 & 5:4-7 OS) {in+si+Ø} REMEMBER: WITH THE EXCEPTION OF ba-. Eniggal the overseer put it into the E." NOMINAL CHAINS MARKED BY THE LOCATIVE-TERMINATIVE POSTPOSITION -e NON-DATIVE ba.8.udu ba-ur4 udu nu-ur4 mu é ba-dù mu lugal-e é mu-dù The sheep were plucked The sheep were not plucked (standard Ur III administrative terminology) Year the temple of DN was built Year the king built the temple (standard Ur III year-formula terminology) {mu+n+dù+Ø} 10. which is used only adverbially. especially before loc. the pronominal elements -Ø-. For more on the functions or meanings of these cases see the earlier lesson on the adverbal case postpositions.include -di. Most instances of the prefix sequence ba-da.and -ne.assimilates to preceding vowels before OB) (-n. to be dealt with in greater detail both in a separate lesson and under the discussion of the ergative and locative-terminative prefixes in the next two lessons. Each can. either before or after the 2nd sg. As expected.and -ši. 17 for the variant dam neda(PI)-ni for dam nitadam-a-ni in Ur-Namma Code §9. As will be seen.or -dì(TI)-. never with pronominal elements. See Yıldız. plus an ablative-instrumental prefix -ta. -ta.frequently occur together with a preceding pronominal element which represents the object of the case element. SRU 98 2:2 = 99 4:15 (Sargonic).or before a verb containing an /e/ vowel as in an-dè-e11 (= an-da-e11) in Edzard.DIMENSIONAL PREFIXES III: COMITATIVE.is predicted) (-e-ne. and perhaps compare the value /nigida/ for the PI sign. The case elements -da-.whose /t/ 78 {mu+da+√+Ø} {e+da+√+(e)n} {Ø+da+√+Ø} {b+da+√+Ø} {nu+n+da+√+Ø} He went with me I (-en) went with you He went with you He went with it He did not go with him (no prosthesis) (no prosthesis) (prosthesis) (prosthesis) (no prosthesis) . See the Verbal Prefix Chain chart for the relative rank ordering of these prefixes within the chain.│ │ 3p -n│ │ 3i -b│ │ │ │ pl. 1 mu-/-ʔ. terminative and ablative-instrumental prefixes exhibit few phonological difficulties and can be treated together as a unit. directional. the ablative prefix -ra.often unwritten before OB) (me. pronoun is the ventive element. -n-."with them" is regularly written with a single sign -neda(PI)-. PRONOMINAL ELEMENT PARADIGM (§290-293) The pronominal elements which can occur with -da-.or bound to a following -b. 1 ? │ │ 2 ? │ │ 3p -ne│ └───────────────────┘ (Jagersma 2010 §16. pronoun -e. TERMINATIVE AND ABLATIVE-INSTRUMENTAL The comitative. usually the head noun of an antecedent nominal chain.2. also be used without a pronominal element to add an adverbial.(and -ri-) is a development from ablative-instrumental -ta. -b. probably with ablative meaning.│ │ 2 -e-/-Ø. Assimilated forms of -da.require a preposed prosthetic vowel to render them pronounceable when they stand initially.and -ši.in the writing -dab6(URUDU)-. Or 50. and -dè-. -ta.-term. Thus: mu-da-ĝen e-da-ĝen-en ì-da-ĝen ib-da-ĝen nu-un-da-ĝen COMITATIVE (§441-450) The usual form of the comitative prefix is -da-.has been suggested) The 1st sg. In OS the 3rd pl. dimensional nuance to a verbal idea. personal prefix -ne-da. In OS and Gudea it can also occur written as -da5(URUDU). however.5 posits glottal stop) (-e. -ni-.are to be analyzed as the prefix ba-. 92 + n.include: ┌───────────────────┐ │ sg. beside" is certainly to be derived from the noun da "side. below and Thomsen §449. at his side) (Sollberger. In OS Lagaš texts it is subject to an old system of vowel harmony (Thomsen §309) in which /ši/ becomes /še/. Examples of standard comitative uses: ki šà húl-la dnin-líl-lá-šè en-líl dnin-líl-da mu-dì-ni-in-u5 To the place that gladdens the heart of Ninlil he made Enlil ride together with Ninlil (Šu-Suen royal inscription.< *ba-ta-. 197:7-8 Ur III) u4 den-líl-le gù-zi e-na-dé-a nam-en nam-lugal-da e-na-da-tab-ba-a When Enlil called righteously to him and linked en-ship with kingship for him (Lugalkinedudu of Uruk 2:4-8 OS) a-nun-na diĝir šeš-zu-ne hé-me-da-húl-húl-le-eš {hé+mu+e+da+húl-húl+e+š} May the Anuna.e. See The infix -da. 60:3) The personal dative -ra here replaces expected -da on Urmes. 34 12:9-11 Ur III) d d {mu+n+da+n+n+u5+Ø} nin-ĝír-sú-ke4 iri-ka-gi-na-da e-da-du11-ga-a šu nu-dì-ni-bal-e "Ninĝirsu shall not overturn what he spoke about with (king) Irikagina. This vowel harmony also affects an initial prosthetic vowel. i. written with the ŠÈ sign like the terminative postposition. you can inform my mother who bore me (Dumuzi's Dream 13 OB) TERMINATIVE (§451-459) The terminative case element is normally written -ši-. before verbal roots featuring the vowels /e/ or /a/.has become voiced because of its position between two vowels: ba-da. 303:6-7 Ur III) dub ba-ba-ti 720 še gur ur-mes-ra in-da-ĝál-la The tablet of Babati (concerning) 720 gur barley which is with Ur-mes (TCS 1. Civil JCS 21. 79 d d ." Compare the syntax of the noun and infix in the following passages: dub énsi-ka-bi da lú-gi-na-ka ì-ĝál The governor's tablet concerning this (-bi) is with Lugina (lit. your brother gods.expresses the idea "to be able": sahar gišdupšik-e nu-mu-e-da-an-si-si You cannot fill earth into (-e) work baskets (Hoe and Plow 12 OB) eden ama ugu-ĝu10 inim mu-e-dè-zu-un O desert. rejoice greatly over you! (Ur-Ninurta B 46 OB} nin-líl-da ki ĝíšbun-na-ka zà-ge mu-dì-ni-íb-si-éš With Ninlil they filled the feasting-place to the limits (Šulgi R 66 Ur III) In its abilitative function (Thomsen §448) -da."(together) with. (Ukg. TCS 1. 34:1 OS) šitim in-da-ĝál [ha]-ab-da-an-sar-re The builders (who) are with him: have him write about them! (TCS 1. what will be my reward? (Enki and Ninhursaĝ 224 OB) šu-tur-bé mu-bé šu uru12-dè ĝèštu hé-em-ši-gub Should he set (his) mind to (-ši-) erasing the lines of this inscription (Gudea Statue B 9:12-16 Ur III) ABLATIVE-INSTRUMENTAL AND ABLATIVE (§460-469) ABLATIVE-INTSTRUMENTAL -ta In its ablative use the basic meaning of -ta.as early as the Pre-Sargonic period." Temporally it signifies "when. including ba-.-šè.is "motion to.is also attested." In its instrumental use it signifies "by means of.frequently takes the shape -da-. e-šè-ĝar ì-ši-šid." Spatially it signifies "away from (a place). e. when preceded by a dative prefix ending in an /a/ vowel.preceding roots in /i/ or /u/: e-šè-ĝen." "out of (an area or container). It can assimilate as -ti. especially following the prefix ba.g. Lambert. By the time of Gudea -ta. ì-ši-gub The basic meaning of -ši. For example: ki-sur-ra iri-na-ka íb-te-bal (If) she passed out from the boundary territory of her city (Code of Ur-Namma §17 Ur III) ABLATIVE -ra-ta. since.preceding roots in /e/ or /a/: -ši. although this is not obligatory. toward" an end-point: ĝe26-e dnin-hur-saĝ-ĝá mu-e-ši-túm-mu-un a-na níĝ-ba-ĝu10 If I bring Ninhursaĝa to you.is "removal or separation in space or time.as mentioned above. with. 369 No. 12-14 7:26-29 OS Nippur) The ablative-instrumental prefix is normally -ta-. RA 73. after (the time that something happened)." itu-ta u4 24 ba-ta-zal From the month day 24 has passed away (ArOr 27.before -ni. 17:7 Ur III . rushes were growing up away from me (Dumuzi's Dream 27 OB) 80 ú > > > > ma-ra-an-šúm ì-ra-ra-an-šúm ì-na-ra-an-šúm ba-ra-an-šúm He He He He gave gave gave gave it it it it away away away away to to to to me you her them . 101 1:1-3 Sargonic) 10 anše-apin 2 kù gín-kam du6-gíd-da ì-ta-uru4 He had Long Hill plowed with 10 plow-donkeys (at a cost) of 2 shekels of silver (M. and an allomorph -te.a standard dating formula) 1 gu4-ĝiš á-gúb-bì ab-ta-ku5 1 yoke-ox whose (-bi) left horn has been cut off from it (Westenholz.: ma-*ta-an-šúm ì-ra-*ta-an-šúm ì-na-*ta-an-šúm ba-*ta-an-šúm Examples: númun ma-ra-zi-zi únúmun ma-ra-mú-mú Rushes were rising up away from me.may also change to -ra-. OSP 1. ]. Ablative(-instrumental) prefixes used with non-specific. adverbial meaning.(cf. smashing.derived from -ta-) to emphasize the ablative idea. bal-e-bí-ib) "Turn away the teeth of the locusts (or birds)!" (Farmer's Instructions 66 OB). in particular the more emphatic sequences ba-ta-. thoroughly. ba-ta-zal) From the month day NUM has passed away (standard date formula) u4 2 u4 3 nu-ma-da-ab-zal They did not let 2 or 3 days pass Gudea Cyl A 23:2 Ur III {ga+mu+ra+*ta+ba-al) {nu+m+ba+*ta+b+zal+Ø} In such forms -ra." 81 . they may not co-occur in a chain. Compare hur-saĝ 7-kam bé-re-bal "he crossed over the 7th mountain" (var.can be referred to as the ablative prefix. Compare the additive progression of ablatives in the following Gudea passages: u4 ki-šár-ra ma-ta-è Daylight came out on the horizon for me (Cyl A 4:22 Ur III) {ma+ta+è+Ø} {mu+ra+ta+è+Ø+a} u4 ki-šár-ra ma-ra-ta-è-a diĝir-zu dnin-ĝiš-zi-da {mu+ra+*ta+*ta+ta+è+Ø} u4-gin7 ki-šár-ra ma-ra-da-ra-ta-è The daylight that came out on the horizon for you was your god Ninĝišzida. locative-terminative prefix -ri. Ablative -re/ri. and in a half dozen attestations all three forms were used together for extraordinary emphasis. for example: lugal-e ugnim eden-ta iri-ni-šè ib-ši-in-de6 "The king brought the army from the desert to his city.must be distinguished from the 2nd sg. Compare also the imperative zú bur5mušen-ra bal-e-eb (vars. totally" to the verbal idea. the terminative and the ablative-instrumental (or ablative) prefixes are mutually exclusive. im-te-bal) (Gilgameš and Huwawa version A 61). out of. which morphologically can hardly represent anything other than {ba+ra+bal}. In such contexts we may suppose that the use of the ablative adds some notion like "completely.(as well as with a -da. like daylight he came out-out-out on the horizon for you (Cyl A 5:19-20) A final variation appears in OB literary texts.> -re/ri. A sentence can certainly feature two nominal chains marked by terminative and ablativeinstrumental postpositions." are especially common with verbs of destroying..gu4 ú-gu dé-a-zu gú-mu-ra-ra-ba-al Your lost ox I will recover for you (NSGU 132:4-5) itu-ta u4 NUM ba-ra-zal (var. -ra. bal-a-[.or ba-da. but only one of them can be resumed in the verbal chain. and ki-sur-ra iri-na-ka íb-te-bal "(If) she passed over the boundary of her city" (Code of Ur-Namma §17). finishing and the like. It is in this sense that -ra.(see next lesson). As the Verbal Prefix Chain chart shows. ba-ra. killing.can co-occur with -ta. The root should probably be read /bel/ instead of /bal/ in order to account for the unusual assimilation pattern: {m+ba+*ta+bel+bel} > *im-ma-ra-bel-bel > im-me-re-bel-bel. when -ra.(< ba-ta-) "away from. Thomsen §468) almost always in conjunction with the root bal as in the form im-me-re-bal-bal "He crossed over them all (the mountains)".never takes an associated pronominal element but functions only to add an ablative — but not instrumental — idea to the meaning of the verb. as distinct from the ablativeinstrumental. See now P. -na. would at least suggest that in certain instances the stem tuš was used for singular marû as well as hamţu forms. 76) that the sg. Steinkeller. SEL 1 (1984) 5 also for lu5(g) or lu5(k) "to live" said of animals. pl. marû form might be /su(š)/. 78 and Thomsen § 270. si12) See P. for example -tuš-ù-ne or tuš-ù-bi rather than -dúr-ru-ne or dúr-ru-bi. writings which lack a following /r/ that expicitly indicate a value /dur/. Attinger. ABLATIVE-INSTRUMENTAL AND TERMINATIVE PREFIXES CAN BE USED WITH OR WITHOUT PRONOMINAL ELEMENTS: ib-ta-ĝen "He went from it" ba-ta-ĝen "He went away" ABLATIVE -ra. not all of which is completely convincing. tuš durun marû dúr (so Edzard. Gordon in Journal of Cuneiform Studies 12 (1958) 48. Attinger also suggests (p. pl. dúr-ru-un. n. pl. dwell" sg. with the same plural stem sig7 2) gub "to stand" sg. REMEMBER: THE COMITATIVE.VOCABULARY NOTE 2 Plural Verbs A few verbs show complementary stems depending upon whether their subjects (patients) are singular or plural. ba-ra.CAN APPEAR ONLY AFTER ONE OF THE DATIVE PREFIXES ma-. -ra-. Note that the standard grammars treat the verb tuš as one of this second group of verbs. See pages 118f. ti(l) sig7 (= se12.OR baTHE PREFIX SEQUENCES ba-ta. Orientalia 48 (1979) 55f. both following P.LEND AN EMPHATIC ABLATIVE SENSE TO THE MEANING OF THE VERB 82 . 6. reside" sg. durunx(TUŠ. in the lesson on imperfective finite verbs for their paradigms. Thomsen reads durun) durun See Edzard 2003.AND ba-da. as well as on the textual evidence assembled by E. These include: 1) ti(l) "to live. pl. offering the following paradigm: hamţu sg. šu4(g)(Gudea) (& indicates one sign written above another) 3) tuš "to sit. Steinkeller. dú(TU)-ru-n(a) (Gudea) Four additional verbs show complementary marû (imperfective) and hamţu (perfective) as well as plural stems. NABU 2010 p. 75-77 for further discussion. who bases his view on Presargonic and Sargonic forms of the type previously read ì-dúr-rá-a but which are now being read ì-tuš-ša4-a. tuš durun(TUŠ).TUŠ)(OS). gub(DU) su8(g)(DU&DU). While there may indeed exist some evidence for the Edzard/Thomsen paradigm in later periods. These verbs are usually referred to as plural verbs. -Ø. is the origin and signification of the vowels /u/ and /i/ in the locative-terminative series? Several interpretations have been advanced. The descriptions of the morphology and uses of the locative-terminative prefixes have been many and varied.-term. historically reinterpreted and reused within the verb as the case element of the personal dative. Since they can convey locational. ba-e-) and usually -Ø. and the locative-terminative prefixes. comitative. T. but since they also serve to mark essential core syntactic relations. the former an archaic element particularly associated with 1st and 2nd person morphemes. It does.earlier 3 the same element In the singular. The following exposition represents a personal reinterpretation of the evidence and is offered here more as an argument than as a proven statement of fact.in OB. The perfective (hamţu) ergative prefixes occupy the rank slot immediately before the root. but in the view of this grammar they are formally related to the ergative prefixes and thus have related functions. of pronominal elements only. they will be henceforth referred to as the subset of core prefixes following the terminology convention established by T. unfor- 83 . and Thomsen's restatements have done little to bring order out of chaos.is a not further analyzable Conjugation Prefix.-term. 1 Pl ┌─────────────────┐ mu │ │ Ø/ʔ │ Ø/e1 Ø/e1 │ n2 │ │ n2 │ b b │ ├─────────────────┤ │ — ? │ │ — ? │ │ │ n-√-š ne3 └─────────────────┘ ┌────────────────┐ │ ma mu │ │ ra ri │ │ na ni │ │ ba bi │ ├────────────────┤ │ me ? │ │ ? ? │ │ ne3 ne3 │ └────────────────┘ -e. The locative-terminative prefixes generally resume either locative-terminative or locative nominal chains. What.in OB. while mu. The ergative and loc. several of which are possibly secondary. See the Verbal Prefix Chain chart for an overview of their forms and associated occurrence restrictions. again in the view of this grammar. often an assimilated -V. seen in the locative postposition. respectively: ergative Sg 1 2 3p 3i 1 2 3p da/ta/ši dative loc. the object of the case elements da/ta/ši and dative *a (and *e). ba-a-.CORE PREFIXES: ERGATIVE & LOCATIVE-TERMINATIVE The locative-terminative prefixes occupy the next to the last rank slot before the verbal root. prefixes consist fundamentally. one which occurs before the root (ergative) and dimensional case elements which begin with consonants (da/ta/ši). they can be broadly classed with the latter as dimensional prefixes.earlier 2 -n. Jacobsen (Zeitschrift für Assyriologie 78 (1988) 161-220). /u/ and /i/. the four paradigms resolve into two basic patterns. There is a simpler and much more interesting explanation. and so represent a subset of prefixes rather different in form from the dative. postposition -e. ablative-instrumental and terminative prefixes. Jacobsen maintains that both /u/ and /i/ are case elements. which usually consist of both pronominal and case elements.or vocalic allophone /y/ especially Ur III (nu-ù-. bí-ì-. directional or "dimensional" ideas. The traditional Falkenstein model explains the vowel /i/ as a form of the loc.) The vowel in the case of the dative may be the locative marker /a/. (The plural forms. are omitted from the present discussion. assimilated -Vin Ur III. THE FORM OF THE ERGATIVE/LOCATIVE-TERMINATIVE PREFIXES Compare the paradigms of pronominal elements which mark the perfective agent. and another which occurs before the vowels /a/. however.-term. in 3rd person forms at least. the loc. -e.(= dative -ne-) cannot start a verbal form without an initial prosthetic vowel. originated historically. -ni-.-term. series is thus originally identical with the ergative series.: r+n+√ > ì-ri-in-√ n+b+√ > ì-ni-ib-√ ne+n+√ > ì-ne-en-√ BUT nu+r+n+√ > nu-ri-in-√ nu+n+b+√ > nu-ni-ib-√ nu+ne+n+√ > nu-ne-en-√ Why the epenthetic vowel associated with /m/ was /u/ rather than /i/ remains unclear. Just as the ergative and loc. but it does help to unify some otherwise isolated features of verbal morphology and syntax. merely the ergative prefixes used a second time in the prefix chain.│ │ m+b > mu-ubr+b > -ri-ibn+b > -ni-ibb+b > bí-ib.│ │ 3p -(a)ni + a > -(a)-na -na. /u/ and /i/.-term. not *mu-a-).-term.g. It is easier to accept that the loc. -zu contrasting with 3rd sg. -na-. -ĝu10 and 2nd sg. carry a load of not just three but four morphemes: person. and -ne-. The view that /u/ and /i/ originated as non-morphemic helping vowels in the locativeterminative prefix paradigm is reinforced by the vowel deletion pattern of the same possessive suffixes. /u/ occasionally appears as a helping vowel instead of more common /a/ again in connection with /m/ in ventive imperatives. All are theoretically possible and most are commonly occurring.-term. as anaptyctic vowels. except that the consonants /m/ and /r/ replace the non-pronounced zero morph of the 1st person and the (problematic and possibly secondary) /e/ of the 2nd person. most visibly the stable /n/ and /b/ elements. The loc. e.│ │ 3i -bi + a > -ba ba. then.tunately. Compare also the (similarly unexplained) contrast of /u/ and /i/ in the possessive pronoun suffix paradigm: 1st sg.-term. depend heavily upon historical speculation and so must remain merely an hypothesis. I suggest that the loc. so too the final /u/ and /i/ of the singular possessives does not appear when a vocalic grammatical marker immediately follows. m+a > ma-. The following represent all possible sequential combinations of locative-terminative and ergative elements.(-re-?) n+e > -ni. ┌───────────────────────────────────────────────────────────────────────────┐ │ m+Ø > mur+Ø > -rin+Ø > -nib+Ø > bí│ │ m+e > mu-e (me-) r+e > -ri. number and case. gender. e." "you with respect to you"). serving to separate continguous consonantal elements. co-occurrence of two 1st or 2nd person markers: "I with regard to me. and -ne. historically. prefixes are essentially consonants when one recalls that the ergative prefixes. -(a)ni and -bi.(-né-?) b+e > bí│ │ m+n > mu-unr+n > -ri-inn+n > -ni-inb+n > bí-in. prefixes -ri-. Just as prosthetic /u/ and /i/ are not required before the vocalic case element *a in the dative prefix paradigm (e. although a few are unlikely owing to their semantic improbability (i.│ └───────────────────────────────────────────────────────────────────────────┘ Like the dative prefixes -ra-.│ │ 1 -ĝu10 │ 2 -zu + a > -za -ra. cases are marked by the same postposition.g.│ └──────────────────────────────────────────┘ This deletion phenomenon suggests that /u/ and /i/ also serve an anaptyctic function 84 . de6+m > de6-um "Bring it here!".e.g. Compare the singular possessive pronouns followed by the locative postposition with the corresponding singular dative prefixes: POSSESSIVE plus LOCATIVE DATIVE ┌──────────────────────────────────────────┐ + a > -ĝá ma. prefixes are. Like Sumerian. prefixes. /ĝ/. when I went out to the street the heart pounded there with respect to me (mu-) (Man and His God 34 OB) where the underlying ideas could as well have been rendered by a construction involving a possessive pronoun: gú-bi e-zi "(Of Sumer and Akkad) you raised their neck". a young man.-term. a thing painful to him) (Ur-Namma 28 2:13-14 Ur III) usar ér-ĝu10 nu-še8-še8 The neighbor does not cry my tears (i. the Mayan languages are all basically ergative in nature. and /s/ or /z/ have historically changed to /r/ (have become rhotacized) in other languages. /n/ and /b/ to be pronounced when standing before the consonantal case postpositions -da. the loc. -šè or at the end of a nominal chain.(and -e-) as well as -b. and. Above all.e. /ĝ/ and /m/ regularly alternate in the two major Sumerian dialects. as a corollary we suddenly find ourselves in possession of a powerful new analytical tool. both marked by the same postposition -e. it helps to explain why a loc. prefix always seems to co-occur with a following ergative prefix. despite their several phonological differences. as possessive pronouns when prefixed to nouns. ergative element -b. tears with respect to me) (Lugalbanda and Hurrum 155 OB) IMPLICATIONS Apart from the simplicity it brings to the description of the morphology of the loc. If. the theory advanced here is especially productive of new. then in those periods of the language in which only the 3rd impersonal sg. prefixes are merely the ergative prefixes used a second time in the same verbal chain.e. A relationship between the possessive pronouns and the loc. prefixes might be illustrated by such passages as ki-en-gi ki-uri gú bí-i-zi With respect to (-*e = bí-) Sumer and Akkad you 'raised the neck' (Iddin-Dagan B 29 OB) ĝuruš-me-en sila-šè um-è-en šà mu-un-sìg I. permitting the purely consonantal carriers of information. If the presence of a loc. with some phonological changes. a structural parallel is provided by the Mayan language group. Furthermore.in connection with the possessives.-term. If the above is correct.are regularly written). more general referential force: nam-ti-il níĝ-gig-ga-né hé-na {hé+n+a5+Ø} May life be made into his painful thing (i. Emegir and Emesal.-term. or šà-ĝu10 in-sìg "my heart pounded there. Of course one is led inevitably to ask whether the possessive suffixes were originally identical with the ergative and locative-terminative prefixes in form and basic function. moreover. I believe that this is indeed the case. and in all Mayan languages the ergative verbal affixes which mark the agent also serve. why it always immediately precedes it (most obvious in OB and later when -n. -ta.. then it is no wonder that the two series of elements should always appear to occur together and have neighboring rank order slots in the prefix chain. historically speaking.term." Conversely. insights into the historical development of the components of the verbal prefix chain and the fundamental relationship and functions of the "two" ergative and locative-terminative cases.-term. compare the following uses of the possessive pronoun with a non-possessive. /z/. element always presupposes the presence of a following ergative element.regularly appears in writing {bi+e+zi+Ø} 85 . albeit admittedly speculative. 8. bí. object of the dimensional prefixes da/ta/ši. -ra. see Edzard 2003. to me. One is tempted to suggest that the 2nd sg. I prefer to take it as a given feature. to bí-.and -ni. Chicago Sumerologists some time ago voiced the theory that bí.thou" orientation of spoken interchange might have influenced the choice of the 2nd sg. personal prefix -ni-. for example.do not therefore function strictly parallel to loc. dative prefix -ra. marker mu. a dative prefix plus a locative-terminative case element. In this view.and.e. -ri.prefix may never feature a dative.-term. This school of thought in fact posits two prefixes. In this view. though the conditioning factors responsible for such reductions are not always clear.resumes the locative postposition -a. ablative-instrumental or terminative dimensional prefix. Since locative nominal chains are common in Sumerian sentences. comitative. counterpart of -ni-. loc. a product of earlier stages in the pre-literate historical development of the prefix chain about which we will never know.-term.(and me-). There is no such restriction on the use of -ni-. Lastly. the only permitted choice for the former was the 3rd sg.also as the 1st sg. The prefix -ri.21-26.to the Poebel-Falkenstein category of Conjugation Prefixes.as part of the core prefix subsysterm. loc. i.before the root. just as the core prefix bí. if a speaker wished to include both a 3rd sg.and -ri.was then re-employed as a new dative postposition -ra. Krecher. Part of the problem lies in an important co-occurrence restriction on the use of bí-. "You built it there" {b+*e+√} or "He/she built it there" {b+*n+√}. as well as for its subsequent development as a purely directional ventive element (treated in the next lesson) with a primary meaning "in my direction. the use of the 1st sg. §12. and since the locativeterminative prefixes -ni. /*I/ infixed case marker.-term.-term. although the form makes no distinction among 1st. Further.which is not further analyzable and the 3rd sg. -ni. now calls the former prefix the "locative 2" and the latter the "directive" following J.which is analyzable as /n/ plus a loc.before the root.is actually derived from a sequence *ba+I. Thus bí-dù might represent "I built it there" {b+Ø+√}.may resume both personal and impersonal nouns. the recognized primacy of the 1st-2nd person "I . but *ì-na-bí-in-dù is not.— virtually all pre-OB stages — the presence of a loc.must have been the inspiration for the use of mu. -niperforms the non-locative core prefix functions that will be described below. according to some. the way was opened to adopt them as well in the development of the dative prefixes ma-. prefix -ra. perhaps in view of the tradition of assigning bí.were both used to resume locative nominal chains 86 . while loc. mu. the genderless locative -ni. hither. Both of these homophonous prefixes are capable of "reducing" to a homophonous -n. At any rate. but after all the dative is an exclusively personal case. Once the use of the consonants /m/ and /r/ as 1st and 2nd sg.and bí. 2nd or 3rd persons. prefix and. as merely the impersonal 3rd sg. In addition. for example.which is not related formally or functionally to the prefixes mu-. This is highly speculative. prefix becomes in itself an indication of the presence of some personal agent in the verbal form.-term." THE SO-CALLED LOCATIVE PREFIX -niMost current scholars speak of a locative prefix -ni. Why this restriction exists (or how it came about) is a perpetual problem for those interested in Sumerian grammar. a dative prefix in a verbal chain. Thus. Thus a form like ì-na-ni-in-dù "He built it there for him" is grammatical. and if an essential notion conveyed by the dative is "(to do something) for the benefit of some person".-term. Edzard. which in practice often resumes locative nominal chains.as a new all-person dative postposition -ra.was likewise to be derived from a parallel sequence *ra+I. A verbal chain which features a bí. locative -ni."reduces" to -b. personal locative-terminative -ni. past scholars have been reluctant to identify bí-. for his arguments. pronominal elements had been established. Such an apparent violation of the rules of Sumerian gender will seem less bothersome if one maintains that the contrast between the pronominal elements -n.as a generic.-term.to resume locative chains. which is in stark contrast to the actual regular use of bí. but it does not represent current opinion and must be regarded for now as an unproved minority position.to make proving theoretical positions conclusively difficult if not impossible.reduces.-term nominal chain.before the root.will never feature a preceding dimensional prefix. or perhaps to a tendency to avoid using them in a spatial sense to minimize ambiguity. the ergative prefixes generally mark the agent in perfective verbal forms.(see below). A spatial use of an ergative prefix is most often to be suspected when one encounters 87 . He therefore assumed that a loc. but this may be due to the fact that agentless "passive" sentences are simply less common in our texts. on(to).-term. There are enough such irregularities in the uses of localizing -ni. to -n. or next to a place). conversely.or -b-. since the locative element /a/ was reinterpreted historically as the prefixed personal dative case marker and no other verbal element was available to resume locative ideas. not all locative-terminative nominal chains are resumed in the verb by loc. To recapitulate.-term.markers could only represent locative ideas. and locative postpositions. past scholars came to regard -ni.and localizing -n. prefixes are really the ergative prefixes used a second time in the verbal chain. On the other hand. (-e) postpositions are historically identical. Thus. then is it not possible that ergative prefixes could also be used to indicate locative ideas. and so look like ergative elements. and the loc. Falkenstein had come to the conclusion that in certain instances preradical -n.are used to mark localizing ideas rather than agents one occasionally observes in certain texts a tendency for -n. however.and -b. Recall.normally resumes an "impersonal dative" object marked by a locative-terminative postposition. I believe the alternative description presented here has the virtues of greater simplicity and linguistic elegance.to mark locative dimensional objects more often than not. and a verbal chain featuring bí. Just as the nominal postposition -e can mark both an agent (by whom or which an event takes place) as well as a spatial idea (by. reduce to -n.or -b.begins to be written consistently. lose their vowels. the contexts in question obviously precluded the presence of an agent in the sentence. and a verbal chain featuring -ni. it is occasionally possible to demonstrate a contrasting preference in particular texts for preradical -b. bí.and bí.was fundamentally or originally one of deixis rather than the more rigid personal vs. impersonal distinction seen in the later stages of the language.is used for 3rd singular personal or impersonal nouns. This is doubtless one of the reasons many scholars have believed that the "locative prefix" -ni. and if the loc. why should the ergative prefixes which resume it in the verbal chain not be capable of representing spatial ideas as well? There is no doubt that they indicate agents much more often than locative ideas. Such phonological manipulation is unnecessary if one merely takes the evidence at face value. See additional discussion later in the lesson on imperatives. genderless.-term. when preradical -b. as we have maintained.-term. prefixes generally serve to resume both loc. unpredictably.could sometimes. From the time of the later Ur III texts.-term.is used only to mark 3rd person impersonal nouns. and. -ni.-term. after the pronominal element -n.to resume a loc. all-purpose locative prefix and to term it as such. -ni. SYNTAX AND FUNCTIONS OF THE CORE PREFIXES In practice. that loc. that the formally dative prefix ba.may feature a preceding dimensional prefix. prefixes.and -n.and -b. But if the ergative (-e) and loc.or bí. prefixes could indicate ergative ideas? By the time of his last descriptions of the verb. under unspecified conditions. For example. etc.-term.or -b. 88 .an -n. also mark an agent.marker in the verb in a seemingly agentless sentence. But since this represents a second occurrence of an ergative element in the same verb. it follows that such a use is an indication of the presence of a second agent in the sentence. substituting lú "man. person" for the impersonal collective noun ùĝ in the first sentence above. together with an otherwise unresumed locative nominal chain. for example: ┌─────┐ za-pa-áĝ-ĝu10 kur-kur-ra hé-en-dul ┌──┐ ní me-lám an-kù-ge íb-ús ┌─────┐ im-zu abzu-ba hé-éb-gi4 Let my tumult cover all the foreign lands (Sumerian Letters A 2:10 OB) Awesome splendor lay against the holy sky (Ur-Ninurta B 30 OB) Let your clay return to its abzu! (Curse of Agade 231 OB) Now to the converse. by. when I have had him drink it (elliptical patients <ú> "food" and <a> "water" or the like) (Dumuzi and Enkimdu 61 OB) ga nam-šul-la mu-ri-in-gu7 ù-mu-ni-gu7 ù-mu-ni-naĝ The existence of instrumental agents had not been generally recognized in part because Sumerian normally substitutes the dative postposition for the loc. D 13 OB) It can. on". an instrumental agent by whom the primary agent causes the event to occur. however. For example: ┌────────────┐ ùĝ-e ú-nir-ĝál bí-gu7 Princely food was eaten by me (-Ø-) {b+Ø+√+Ø} by the people (bí-) = I caused princely food to be eaten by the people = I caused the people to eat princely food (Genouillac TCL XV 12:75 OB) She (-n-) caused milk of nobility to be drunk by you (-ri-) (Lipit-Ištar D 6 OB) When (ù-) I (-Ø-) have had him (-ni-) eat it. with personal nouns. the theoretical personal equivalent would be: lú-ra ú-nir-ĝál ì-ni-gu7 Princely food was eaten by me for the man = I caused the man to eat princely food" The dative alone can indicate a second agent as in DP 584 vi 3-6 (OS): énsi-ke4 en-ig-gal nu-bànda mu-na-gíd The ruler had it (the field) measured by (nu-bànda-*ra = -na-) Eniggal the overseer. at.most often marks a locative idea "in. A locative-terminative prefix such as -ni. The result is a causative construction.or bí. For example: ┌───────┐ sig4 kul-ab4ki-a-ka ĝìri bí-in-gub ┌─────┐ éš-dam-ma ba-ni-in-ku4 ┌──┐ ĝissu-zu kalam-ma bí-lá He set foot in the brickwork of Kulaba (Enmerkar and the Lord of Aratta 299 OB) She caused her to enter the tavern (Inana and Bilulu 98 OB) You extended your shadow upon the country (Ninurta B Seg. Plural intrumental agents are nicely illustrated by the following two Old Sumerian passages. the more recent the time of incorporation and the less "core" or syntactically vital the nature of the information conveyed. TCS 1. In the second.) šu-níĝin 30 nindan 2 gi e aša5 gàr-mud en-ig-gal nu-bànda šeš-tuš-a e-ma-dù Total 30 nindan 2 rods of ditch. and as such it is no wonder that the locative-terminative subset can actually resume any other nominal postposition and often does.-gangs (DP 652 5:1ff. rubbed (his) lips upon me (mu-) (Inana and An B 17 OB. Eniggal the overseer caused to be constructed by (-*e) the š. the locative-terminative became a general indirect case marker par excellence. personal dative marker -ne-.) Some additional examples of the locative-terminative in context: ma-a-ra ĝiš ma-an-du11 ne mu-un-su-ub (My spouse) had intercourse with me. Emesal ma-a-ra = Emegir ĝá-a-ra) {V+ri+Ø+è+Ø} á zi-da-za dutu iri-è I will make Utu (the sun) come forth upon you (-ri-) at your right side (Eannatum 1 7:6-8 OS) é kù-ga i-ni-in-dù na4za-gìn-na i-ni-in-gùn gal-le-eš kù-sig17-ga šu-tag ba-ni-in-du11 He built the temple with (-ni) silver. and the summary of irrigation work performed features a verb containing the 3rd pl. greatly he did decorating to it (ba-) with (-ni-) gold (Enki's Journey 7-8 OB. Šulme the overseer caused to be constructed by them (-ne-) (DP 657 5:1-4. 622 10:3. and the summary of work performed features a verb containing the 3rd collective impersonal dative marker ba-: šu-níĝin 2 éš 2 gi e aša5 ambar-ra šul-me nu-bànda e-ne-dù Total 2 cords 2 rods of ditch. 240:9 Ur III letter order) (The compound verb šu .resumes -*e} nin-hur-saĝ-ra du10-zi-da-na mu-ni-tuš "She (Inanna) made Ninhursaĝ seat him (Eannatum) on her righteous knees (Ean 1 iv 24-26 OS) {mu+n+n+tuš+Ø} šu ha-mu-ne-bar-re Let him release them! (Sollberger.-term. In the first. indirect object. 89 . the first historically to be incorporated into the verbal prefix chain to judge from its position directly before the root. here pl. the text lists individual workers by name and the length of canal built by each. the texts lists impersonal gangs of unnamed workers by their size and foremen. etc. 617 8:5. he colored it with lapis lazuli. As the earliest prefixed adverbal marker employed in the verb apart from the ergative prefixes.bar takes a loc. Field of the Marsh. The relative positions of the remaining verbal prefix subsets may illustrate a history of progressive incorporation into the prefix chain: the farther out toward the beginning of the chain. cf.) GENERAL CONCLUSIONS One could speculate that the ergative/locative-terminative was a primitive and highly generic case marker. Garmud Field. although in the later stages of the language its principal use was to mark locative ideas. -ne-. illustrating the "locative of material") d {V+ne+n+dù+Ø} {Vm+ba+n+dù+Ø} (ba. " and in this sense its use is usually so idiomatic and its contribution to the meaning of a sentence so indeterminate that the modern reader is normally forced to leave it untranslated.when it precedes a loc.as in mu-da-gub "He stood with me. its basic meaning is "direction towards the speaker. Additionally. and to ma.and bi. object pronoun of the case markers -da-.e.and me-. the 1st sg. 150) as an upper case M. Additionally. loc.and -ši. it can. when preceded by /m/ ba.e.can assimilate as mi. forth. however co-occur with all other verbal dimensional or core prefixes. it cannot co-occur with them.g.when it precedes a dative -ra. element mu-. i. which likewise has explicit 1st sg. though once again the possibility of such a morphological loan into Akkadian is generally disputed.and bi. While this is disputed by several contemporary Semitists. FORM OF THE VENTIVE ELEMENT The Sumerian ventive element has two allomorphs: /m/ and /mu/.-term.or -na-. In the view of this grammar the basic form of this element is /m/." and. in most cases idiomatic usages which again are typically untranslatable.or -ri. It should also be compared with the formative suffix /m/ which appears on the other Akkadian dative suffixes (e. forth.(again Thomsen follows an older analysis.-term." Since it is identical with the aforementioned m. a more general meaning "here. In the contexts where it appears only as the consonant /m/ it cannot stand at the head of a verbal form without an initial prosthetic vowel to render it pronounceable. see §336 & 338). and the mu. -ta.(i. Examples: m+Ø+ĝar+Ø m+e+ĝar+Ø > > mu-ĝar mu-e-ĝar or me-ĝar (OB) I (-Ø-) set it (-Ø) up You set it up 90 . out into view. -šum "to him" vs. comes the rank order position of the ventive element. mu. before the prefixes ba. it is difficult to avoid suggesting that the Sumerian ventive was loaned into Akkadian as the ventive suffix -(a)m/ -(ni)m. In keeping with its use as a 1st person element. and directly before the dimensional prefix elements da/ta/ši. something on the order of "up. the allomorph /mu/ appears. when these function only abverbially without preceding pronominal elements. for which cf. and it is identical with the pronominal element /m/ of the 1st sg. Examples: m+ĝen+Ø m+ta+ĝen+Ø m+ba+ĝen+Ø > im-ĝen > im-ta-ĝen > im-ma-ĝen He came here He came away He came away He set up it there(in) He did not come here m+b+n+ĝar+Ø > im-mi-in-ĝar but: nu+m+ĝen+Ø > nu-um-ĝen In all other cases.assimilate as -ma. before the pronominal element /b/ followed by a vowel)." "hither. shown in the Prefix Chain Chart (p." It also has a more general meaning.THE VENTIVE ELEMENT Following the preformatives.and mu. dative prefixes ma. finally. and pl. dative). but before any other prefix. reference "to me" (1st sg.elements.and -mirespectively (this analysis differs substantially from earlier views. accusative -šu "him"). to me.which serves as the 1st sg. -ni. It appears as /m/ directly before the root. Thomsen §337-338). up. See Šulgi A 47: ùĝ saĝ-gíg-ga u8-gin7 lu-a u6-du10 hu-mu-ub-du8 (with var. and some believe that im-ma. Krecher in Orientalia 54 (1985) 133-181. This particular analysis of the forms of the ventive has only in part become more generally accepted. numerous as ewes." There are also cases in which (V)m. Many scholars. The phonotactic rules can be tabulated as follows: 1) M > (V)mbefore ┌────┐ │ √ │ │ da │ │ ta │ │ ši │ └────┘ ┌────┐ │ ba │ │ bi │ └────┘ with resulting assimilations ┌────────┐ │(V)m-ma │ │(V)m-mi │ └────────┘ 2) M > mu- before ┌──────────┐ │ Ø │ │ e │ │ n │ │ b │ │ ra/ri │ │ na/ni/ne │ └──────────┘ (OB variant m+e > me-) (i. -m. This phenomenon has lead some scholars to question whether 91 . is rare.m+n+ĝar+Ø m+n+n+ĝar+Ø m+n+da+ĝen+Ø m+ra+n+šúm+Ø m+r+n+šúm+Ø m+ne+n+šúm+Ø > > > > > > mu-un-ĝar mu-ni-in-ĝar or mi-ni-in-ĝar mu-un-da-ĝen mu-ra-an-šúm or ma-ra-an-šúm mu-ri-in-šúm or mi-ri-in-šúm mu-ne-en-šúm He set it up He set it up therein (-ni-) He came here with her He gave it to you He gave it by means of you He gave it to them Substantially the same rules hold in the imperative transformation. based in part on earlier suggestions of Thorkild Jacobsen in Materials for the Sumerian Lexicon IV (Rome. /r/ + any vowel) (i. for -du11) "The Black-Headed Folk.is missing from the verbal chain. where the chain of prefixes is switched as a whole to suffixed position. Heimpel at the University of California at Berkeley. -du. Thomsen for example. Foxvog and W. See the pertinent descriptions in Attinger 1993 and Edzard 2003. also the earlier substantial article on ventive phenomena by J. /n/ + any vowel) The preceding analysis. still speak of two separate elements. was elaborated in the early 1970's by D. J. whether before the root or one of the dimensional prefixes da/ta/ši.occurs before the root or a dimensional prefix where an expected resumptive -b.e. 1956). NOTES ON ORTHOGRAPHY AND USAGE 1) The sequence mu-ub-. though not unattested.and mu-.is a not further analyzable prefix. sent pleased admiration in my direction.e. variant me. i.is optional and unpredictable.before dative -ra. See Attinger.also offer the standard writing in a duplicate text. cypress. 1993 §177 for an exposition of the alternative explanations. but rather to be analyzed in some different fashion. 6) In reading Sumerian one will encounter a variety of exceptions. um-ma-) é-níĝ-GA-<ra>-za kišib ù-mi-kúr ĝiš ù-ma-ta-ĝar When you have altered the seals in your storehouse and set out wood from it é-níĝ-GA-ra-na kišib bí-kúr ĝiš im-ma-ta-ĝar He altered the seals in his storehouse and set out wood from it 3) The assimilation mu.and mu-ra. None of the several proposed analyses is especially convincing. Note in passing that unlike mu-√ forms im-√ verbal forms are apparently nonexistent in Lagash I PreSargonic texts and begin to appear regularly only in the time of the Gudea inscriptions.g. earlier views. parallel to OB mu-ri.some. e. See Attinger 1993. and counterarguments. which is not reflected in the writing.writings conceal a hidden assimilated /b/.occurring before the elements -n. from within the mountain of ebony ebony will be brought in for you 4) Some scholars have proposed that the prefix sequence mi-ni-. §178a for discussion. ordinary im-√. This is a seductive analysis. unless we posit a long-consonant phonological realization.e. it is reasonable to assume the that the ventive allomorph mu.> mi-ri. m+b+√ > mm+√ > im-√. ga-me-da-ab-du11. im:-√ vs.which occurs before it came into use by analogy with the mu. 5) Since the 2nd person agent marker -e. Compare the variation in the verbal prefixes of Gudea Cyl A 12:3-7: {m+ra+ta+è(d)+e+Ø} sig-ta gišha-lu-úb gišNE-ha-an mu-ra-ta-è-dè {m+ra+n+tùm+e+Ø} igi-nim-ta gišeren giššu-úr-me gišza-ba-lum ní-bi-a ma-ra-an-tùmu {m+ra+n+n+tùm+e+Ø} kur gišesig-a-ka gišesig ma-ra-ni-tùmu From above halub and nehan wood will come forth for you. attested first in the Gudea inscriptions. and it has the theoretical disadvantage of hypothesizing two forms of M with the same phonological shape. Perhaps the /mu/ allomorph served the same purpose as /(V)m/ in Old Sumerian. e. perhaps by analogy with the fuller paradigms of Akkadian subject pronouns.seems to have developed secondarily during the Ur III period.to be written with just a single /m/. many passages which show the OB 2nd sg.> ma-ra-.or -na. Compare the following three sets of parallel passages from Šulgi Hymn D 219/335 (Ur III) and Gudea Cyl A 6:23/7:23 & Cyl A 6:16/7:13-14 (Ur III): a) {ba+n+gul+Ø+a} níĝ ki-en-gi-ra ba-a-gu-la kur-ra ga-àm-mi-íb-gu-ul That which has been destroyed here in Sumer I will destroy in the foreign land (= im-mi-) níĝ ki-en-gi-ra ba-a-gu-la kur-ra ì-mi-in-gu-ul That which had been destroyed here in Sumer he destroyed in the foreign land b) (= um-mi-) šu-nir ki-áĝ-ni ù-mu-na-dím mu-zu ù-mi-sar When you have fashioned his beloved standard for him and written your name on it šu-nir ki-áĝ-ni mu-na-dím mu-ni im-mi-sar He fashioned his beloved standard for him and wrote his name on it c) (= um-mi-. and juniper will bring themselves in for you. not only in 92 . is not merely an assimilated (allomorphic) form of mu-ni-.g. or pure oddities in verbal prefix sequences in forms featuring the ventive element. Lugalbanda 106: inim ga-mu-e-da-ab-du11 "I will say a word regarding you" with var. from below cedar. Further. such (V)m.> ma. but as an argument from silence it is difficult to prove.and -b-. neologisms. though not all.< m(u)-e. 2) It is common in older texts for the double /mm/ of the assimilation m+bi > Vm-mi or m+ba > Vm-ma. literary texts.and me.." 93 . prefix.(a variant of mu-e-). e. agentless ba-dù "it was built. verbs featuring an agent are more likely to show a ventive. Elsewhere its meaning is more or less problematic. The following observations can be made: 1) In the dative prefixes ma. here. etc. which are mostly the products of the OB scribal schools.are known. including the above imperative found in the myth Inana's Descent. pronominal object or loc. ì-ma-.for im-ma-. e. zu "to know." 7) In the succinct language of Ur III administrative texts. while the me.prefix which contains the 2nd sg.it ALWAYS marks 1st person: ma+n+šúm+Ø > šúm+me+b > ma-an-šúm šúm-me-eb He gave it to me Give it to us! (OB imperative) Care must be taken to distinguish these true dative prefixes from (a) the -ma. 2) When it appears immediately before a dimensional case element da/ta/ši or an ergative prefix it MAY represent a 1st sg. while agentless verbs tend to show a "passive" baor a neutral ì. nu-um-ma-.that is a variant for mu-eis well attested in OB.often written with only one /m/ in earlier texts. hé-em-ma-. nu-ma-." frequently contrasting with the prefix ba.-term.infix in the assimilated sequence m+ba > -m-ma. ĝál "to exist.g." ĝál + ventive "to produce". element -e. but most often it doesn't: m+da+gub+Ø > m+n+šúm+Ø > mu-da-gub mu-un-šúm He stood with me He had me give it He gave it here (unusual) (usual) 3) When it appears before a dimensional prefix featuring an explicit pronominal object it NEVER has explicit 1st person reference: m+ra+n+šúm+Ø m+e+da+Ø+dù+Ø > > mu-ra-an-šúm mu-e-da-dù He gave it (up) to you I built it (up) with you 4) With certain motion verbs it OFTEN conveys the notion "hither.g. 6) Verbs of state can be given a directional nuance with the addition of a ventive. FUNCTIONS OF THE VENTIVE ELEMENT In only a few clearly defined contexts is it possible state that the ventive is definitely or most likely functioning with 1st person reference.g. consistent with its fundamental directional character.prefix. Compare the standard contrast in Ur III year formulas between plus-agent mu-dù {m+n+dù+Ø} "he built it" vs. dative me. and (b) the me. hé-ma." Only a few attestations of 1st pl. mu-e-ĝar or me-ĝar "you set it up.in its ablative use: m+ĝen+Ø ba+ĝen+Ø m+ba+ĝen+Ø m+n+de6+Ø ba+n+de6+Ø > > > > > im-ĝen ba-ĝen im-ma-ĝen mu-un-de6 ba-an-de6 He came here He went away He came away He brought it in He took it away (ventive) (ablative) (ventive + ablative) 5) Verbs of motion or action are in general more likely to show the ventive than verbs of state." zu + ventive "to recognize" or "to (make) learn. e. but also in Ur III economic and administrative documents at a time when new orthographic conventions are being established. although confident translation remains difficult. I will decree a good destiny regarding you (Šulgi D 384 Ur III) {ga+(mu+)r+b+tar} 12) Finally. i.8) Personal dative prefixes seem to attract the ventive. the second verb repeats the first with the addition of a ventive adding a nuance that is. iddinaššum < iddin-am-šum "he gave to him.) {b+n+du8+Ø+a) REMEMBER: THE VENTIVE ELEMENT HAS TWO MAIN CONTEXT-DEPENDENT USES: – 1ST PERSON PRONOMINAL OBJECT OF DIMENSIONAL/CORE PREFIXES – DIRECTIONAL PARTICLE MEANING "HITHER" or "UP.g. Compare the following earlier and later lines from a continuous narrative: {Vm+b+n+du8+Ø) á mu-gur le-um za-gìn šu im-mi-du8 He (the warrior) bent out (his) arm and held out a lapis writing-board (Gudea Cyl A 5:3 Ur III) á mu-gur le-um za-gìn šu bí-du8-a (The warrior) who bent out (his) arm and held a lapis writing-board (Gudea Cyl A 6:3f. I will decree destiny regarding you. untranslatable: lugal nam gi4-rí-íb-tarar nam-du10 gú-mu-rí-íb-tarar O king. my border territory!" he declared (Ukg 6 4:7'-9' OS) {Vm+b+n+du11+Ø) {b+n+du11+Ø) In the following hymnic passage." 9) The ventive may add a kind of telic nuance. possibly. "up to the required or final point.e. OUT. to the point of completion." as. the governor of Umma. Compare the following two passages involving the verb <inim> du11 "to say" where the ventive is untranslatable: e-ki-sur-ra dnin-ĝír-su-ka e-ki-sur-ra dnanše ĝá-kam ì-mi-du11 "The boundary ditch of Ninĝirsu and the boundry ditch of Nanše are mine!" he declared (Ent 28-29 4:24-28 OS) an-ta-sur-ra ĝá-kam ki-sur-ra-ĝu10 bí-du11 "The Antasurra is mine. mu-ra-. the ventive may perhaps be chosen instead to add a little directional color in place of the neutral. e. again. FORTH" 94 . meaningless vowel /i/: mu-na-an-šúm mu-ni-in-ĝar He gave it out to him He set it up there rather than rather than ì-na-an-šúm ì-ni-in-ĝar 11) In many other cases the ventive is an added stylistic feature too nuanced for confident translation. in the following: ur-lum-ma énsi ummaki en-an-na-túm-me e-ki-sur-ra dnin-ĝír-su-ka-šè mu-gaz Enanatum pounded Urlumma. mu-na-. mu-ne-. likewise with the Akkadian ventive. many sets of parallel passages could be adduced to suggest that the ventive adds a mild directional nuance to a verbal form. {m+n+gaz+Ø} all the way up to the boundary ditch of Ninĝirsu (En I 29 10:6-11:2 OS) 10) When a prefix chain begins with an element which requires a preceding prosthetic vowel. Current scholarship now generally refers to it as the nominalizing suffix. -a in most cases generates finite or non-finite relative clauses. Thomsen refers to it as the Subordination Suffix (§483-491. In such abbreviated writings it is difficult to decide whether the locative -a has elided to relativizing -a or if the combination of the two markers was perhaps pronounced as a long vowel whose length was not regularly indicated in writing. the man who built the house. while the OB scribes will consistently write ki áĝ-ĝá or ki áĝ-a. 512-518). rather than plene ("fully") as u4 é in-dù-a-a. Quite simply. but they are better avoided unless needed specifically to help clarify meaning.and any subject or imperfective agent pronominal suffixes. e." or "relativizing" particle. Finally.RELATIVE CLAUSES: THE NOMINALIZING SUFFIX -a The verbal suffix -a is known by several names which describe its apparent functions: the "nominalizing. One basic function is to transform an underlying finite declarative sentence into a relative or subordinate clause. áĝa for áĝ.g. For example. a relative clause 95 . personal plural and case markers. for example. ORTHOGRAPHY In certain periods the writing system often fails to show this -a suffix clearly. the /a/ vowel of the 3rd sg." participializing. in Gudea the participle ki áĝ+a "beloved" will often be written simply ki áĝ. possessive suffix -(a)ni or of the genitive postposition -ak. the vowel /a/ should be understood as the nominalizing suffix. The /a/ of the possessive normally appears only after consonants. Thus in the phrase é dù-a-ni "his built house" {é dù+a+(a)ni}. Whether one uses these longer values is a matter of individual taste or current convention. lugal-ni "his king" or é lagaški-ka "in the temple of Lagash. the temporal clause {u4 é Vn+dù+Ø+a+a} "on the day he built the house" might be written u4 é in-dù-a. Edzard 2003 recognizes several different homophonous -a suffixes depending upon grammatical context. The problem is orthographic rather than grammatical and goes hand in hand with the tendency of earlier texts not to write. This theory of an "overhanging vowel" (überhängender Vokal) has a basis in fact for a number of signs: such longer forms are actually attested in Akkadian signlists. For example. GENERAL SYNTAX The suffix -a occupies the last rank order position after any verbal stem modifiers including the modal suffix -(e)d.. etc. e.. when analyzing forms one must be careful not to misconstrue instances of a nominalizing -a followed by the possessive suffix -(a)ni. aka for ak. rather than the helping vowel associated with the possessive. Put another way." The presence of a following locative postposition -a is often obscured in later orthography by the suffix -a. either finite: lugal-e é in-dù The king built the house > lugal lú é in-dù-a The king. In reaction to this phenomenon earlier scholars have employed sign values which include a final /a/. Thomsen may be correct in stating (§483) that -a is a syntactic particle rather than the mark of a morpheme.g. occupying a place in an expanded nominal chain between the head noun (and any adjectives) and following possessive/ demonstrative. or non-finite (in which verbal prefixes are for the most part deleted): é ba-dù The house was built > é dù-a The house that was built A relative clause stands in apposition to a noun. g." du10(g)+a > du10-ga "good. Ur III)." as opposed to lú-du10 "a good man (in general). an agent. á mu-gur le-um za-gìn šu bí-du8-a "He who bent out (his) arm and held a lapis writing board" (Gudea Cyl A 6:3f. for example: é šub-ba é dù-a inim du11-ga the house that collapsed the house that was built the word that was spoken > > > the collapsed house the built house the spoken word {du11(g)+a} A subset of such simple participles are those adjectives which sometimes or regularly take an -a suffix like kal(a)g+a > kal-ga. e. by definition. In a sentence containing several coordinate relative clauses.g.) In more complex sentences the head noun of the extended nominal chain in question may be difficult to identify immediately. however. (a) representing the sentence underlying the relative clause is embedded in the nominal chain (b) to produce the expanded nominal chain (c): (a) (b) (c) lugal-e é-mah in-dù é-mah-bi-ta ┌────────────────────┐ é-mah │lugal-e <é-mah> dù-a│-bi-ta └────────────────────┘ > The king built the lofty temple From that lofty temple é-mah lugal-e dù-a-bi-ta From that lofty temple built by the king Note here that the patient of the sentence underlying the relative clause is deleted to avoid redundancy.e. -a commonly appears only on the last verb. (As will be seen later. or non-finite. or may even be deleted in certain standard idiomatic contexts." and so simple participles cannot themselves be marked for the presence of an agent.is embedded in a nominal chain as a kind of secondary adjective." The difference between a simplex adjective and one featuring a suffixed -a is normally a nuance which escapes us. The relative clause can. and each type of chain can be modified by a relative clause. NON-FINITE RELATIVE CLAUSES Clauses Modifying a Subject or Patient 1) In its simplest use -a is suffixed to non-finite verbal stems to produce short relative clauses which can often be translated as adjectival past (passive) participles. with prefixes and suffixes intact." or sa6(g)+a > sa6-ga "pleasing." 2) Non-finite verbal forms can. lú-du10-ga "the man who is good. include a nominal chain which does indicate the agent: lú-e é in-dù The man built the house > é lú-e dù-a The house built by the man 96 . and indirect objects or adverbial phrases. the verb becoming essentially a participle. feature no prefix other than the negative preformative nu. e. In the following illustration. in which most prefixes and suffixes are deleted.. The verb in a relative clause can be finite." i. Krecher (see Thomsen §80) has argued that an adjective with a suffixed -a is more "determined" than one without."not. the good man (about whom we're speaking). when the head noun of the expanded chain represents the agent of the relative clause. J. A sentence can contain nominal chains representing a subject. but the basic syntax will always be the same. "mighty. a relative pronoun is substituted for the nominal agent of the clause. but non-finite examples do exist (cf. Here a dependent genitive signals an implicit agent (cf. with deletion of the redundant head noun of the relative clause. common in Gudea and earlier Lagash royal inscriptions typically read by the beginning student. by) Ninĝirsu 3) The Mesanepada Construction refers to an nonfinite clause that contains an explicitly marked agent.This very common pattern is called the MESANEPADA CONSTRUCTION after the name of an early ruler which illustrates it: mes an+e pà(d)+a > Mes-an-né-pà-da The noble youth chosen by An In passing. for example: en-e a-huš in-gi4 The lord turned back the raging waters > en a-huš gi4-a The lord who turned back the raging waters (Gudea Cyl A 8:15 Ur III) 2) Note the deletion of the agentive marker in the preceding resulting relative clause. For example: 97 .(participial forms loosely referred to as infinitives) can be relativized: kù-babbar šúm-mu-dè {√+e+d+e} to (-e) give the silver > kù-babbar šúm-mu-da {√+e+d+a} the silver that is to be given The resulting relative construction can then feature a final copula: kù-babbar-bi kù-babbar šúm-mu-dam That silver is silver that is to be given {√+e+d+a+m} which. 517d). which often alternates with the Mesanepada Construction in strings of royal epithets. by implication. compare at this point an idiomatic circumlocution. Thomsen §515. Relative clauses can also feature nominal chains which supply other sorts of information. adverbal or adnominal: é iri-a dù-a lú úriki-šè ĝen-na inim galam-šè du11-ga é ur5-gin7 dím-ma the house built in the city the man who went to Ur a word artfully spoken (adverbial use of -šè) a house fashioned like this 4) Non-finite imperfective verbal stems featuring the modal suffix -(e)d. In all types of clauses featuring ergatives or dimensional indirect objects the adverbal case marker associated with the underlying source sentence is suppressed. Thomsen §14): énsi á šúm-ma dnin-ĝír-su-ka The governor who was given strength of (and. can become: kù-babbar-bi šúm-mu-dam That silver is to be given Clauses Modifying an Agent or Indirect Object 1) Clauses modifying an agent tend to be finite. Compare a clause featuring a personal dative object in its underlying declarative form: lú-ra kù-babbar ba-na-šúm Silver was given to the man > lú kù-babbar šúm-ma The man (to whom was) given silver 3) A possessive suffix can be used with the implication that the "possessor" is the agent of the clause. and have broader uses than the simpler non-finite constructions. and the resulting nominal chains are somewhat more complex. usually lú "man. which occur in contexts that recommend a translation in which the "possessor" is the implied agent: lú é dù-a-ke4 (Cyl A 20:24) lú é dù-a-ra (Cyl A 15:13) FINITE CLAUSES In finite clauses verbal affixes are not deleted. níĝ "thing" for impersonals.lú-ra kù-babbar ì-na-an-šúm He gave silver to the man > lú kù-babbar šúm-ma-ni His man (to whom) silver was given = The man to whom he gave silver Compare the possibly related idiomatic use of the genitive in the following phrases from the Gudea cylinders. it stands." AV Black (2011) 167-171. "Relative Clauses in Sumerian Revisited. convey more explicit information. Now all nominal chains must end with a case marker. each containing a relative clause standing in apposition to the head noun lugal. it stands in the absolutive case: (c) ┌──────────────────────┐ ┌────────────────┐ │lugal lú é+Ø n+dù+Ø+a │+ Ø úriki-šè V+ĝen+Ø └──────────────────────┘ Since the new expanded nominal chain in (d) represents the agent of the main verb in-dù. person" for personal nouns. See most recently F. In such cases a relative pronoun. Assume the following two source sentences: (1) lugal úriki-šè ì-ĝen (2) lugal-e é in-dù The king went to Ur The king built the temple By the man of the built house = By the man who built the house For the man of the built house = For the man who built the house {dù+a+ak+e} {dù+a+ak+ra} Either sentence can be embedded in the other as a restrictive clause. resulting in one of two new sentences: ┌──────────────┐ (a) lugal │ lú é in-dù-a │úriki-šè ì-ĝen └──────────────┘ ┌─────────────────────┐ (b) lugal │ lú úriki-šè ì-ĝen-na │ é in-dù └─────────────────────┘ The king who built the temple went to Ur The king who went to Ur built the temple In both new sentences new nominal chains have been generated. Karahashi. on the other hand. in the ergative case: (d) ┌───────────────────────────┐ ┌──────┐ │lugal lú úriki+šè V+ĝen+Ø+a │ + e é+Ø n+dù+Ø └───────────────────────────┘ └──────┘ 98 . is used in the relative clause to avoid repetition of the head noun representing the subject or agent of the new nominal chain. Simple Restrictive Clauses A finite relative clause is typically used when two declarative sentences having the same subjects or agents are merely to be linked as main and restrictive relative clauses. and since the new expanded nominal chain in (c) represents the subject of the main verb ì-ĝen. at least in writing. for example: iri-šè im-ĝen-na é-gal-la-ni in-dù When he had come to the city. resulting in potentially confusing forms such as: úriki-šè im-ĝen-na-ta é in-dù After he came to Ur. up to. behind (local) until. from the back of. he built his palace 99 . 412:2 Ur III) ┌─────────────────────────────────────────────────┐ u4 dinanna-ke4 igi nam-ti-la-ka-ni mu-un-ši-bar-ra-a When Inanna extended her eye of life out towards him (Gudea Statue C 2:11-13 Ur III) ┌─────────────┐ en-na ì-ĝen-na-aš Until he has come (Grégoire.resumes -šè} in/on the day (that). since like the day (that). There is no suppression of internal case markers and no use of relative pronouns. e. while in the year (that) after (temporal). on the day he entered the status of gala-priest (Fish Cat. a normal occurrence. as long as (temporal). and that in (b) the ergative at the end of the new nominal chain has elided to the preceding relativizing particle -a. lugal gišmes abzu-a dù-a "the king who planted the mes-tree in the Abzu" (Enki and the World Order 4 OB) Temporal and Causal Subordinate Clauses (§489-491) Finite relative constructions are commonly used with specific head nouns and case postpositions to form standard sorts of temporal or causal subordinate clauses.g.Note that in (a) the ergative postposition -e on lugal has been suppressed in the process of generating the relative clause. as far as (local) Note that the head nouns u4 "day" and eger "back" are VERY OFTEN idiomatically deleted. to a preceding relativizing -a. In such a subordinate clause an entire sentence is relativized and stands in apposition to the head noun of the newly generated clause. AAS p. after. he built the temple The confusion is compounded by the tendency of the locative postposition -a to be elided in later texts. when from the day (that). The structure of these subordinate clauses is slightly different from that of the nominal chains incorporating restrictive relative clauses discussed above. 1) Following are standard combinations of head noun and case marker employed with relativized sentences to generate temporal subordinate clauses: u4 SENTENCE+a+a u4 SENTENCE+a+ta u4 SENTENCE+a+gin7 mu SENTENCE+a+a eger SENTENCE+a+ta en-na SENTENCE+a+šè Examples: ┌───────────────────────┐ PN u4 nam-gala-šè in-ku4-ra-a (For) PN. during. resulting in a form which offers no clue as to its underlying structure. Note also the embedded clause of (c) can be abbreviated even further with the elimination of the relative pronoun and the ergative prefix on the verb to produce a simple past participle. 36 Ur III) {V+ĝen+Ø+a+šè} {Vn+ku4(r)+Ø+a+a} {-n. in place of because. for the sake of. whenever. compare. 205) Any of the preceding combinations of head noun and adverbal case marker can be used in simple nominal chains to produce adverbial phrases." ur-saĝ ug5-ga ì-me-ša-ke4-eš Because they were slain heros (Gudea Cyl A 26:15 Ur III) {V+me+(e)š+a+ak+šè}) TEMPORAL OR CAUSAL ADVERBIAL EXPRESSIONS (§184. afterwards to the rear of my house (local) 100 . This deletion phenomenon has led to the describing of the sequence -a-ke4-eš as an independent adverbial suffix meaning "because. With the temporal clauses above. since ┌──────────────────────────────────────────────┐ {Vn+zu+Ø+a+ak+šè} bar lugal den-líl-le á šúm-ma ì-me-a ì-zu-a-ke4-eš Because they (the people) knew that he was a king given might by Enlil (Utuheĝal's Annals 54 Ur III) ┌────────────────────────┐ bar še-bi nu-da-sù-sù-da-ka {nu+n+da+sud-sud+Ø+a+ak+a} Because he could not make this (large amount of) barley grow lushly (Ent 28-29 2:27 OS) (note the abilitative use of -da-) ┌───────────────────────┐ mu sipa-zi ba-ra-ab-è-a-šè sila-daĝal ki-a-ne-di ĝál-la-ba ér-gig ì-še8-še8 Because it (fate) had made the righteous shepherd go away. "if" at that time. bar. bitter tears were being wept in those broad streets where there was (once) dancing (Ur-Namma A 18-19 OB) ┌──────────────────────────────┐ nam é-kur ki-áĝ-ĝá-ni ba-hul-a-šè It being so that his beloved Ekur-temple had been destroyed (Curse of Agade 151 OB) 3) Like u4 or eger in temporal clauses. note that a possessive pronoun can replace the rectum in constructions that require a genitive. u4-da udu e-hád siki-bi é-gal-la a-ba-de6 "whenever the sheep was pure.standing for: u4 iri-šè im-ĝen-a-a é-gal-la-ni in-dù 2) The following combinations of head noun and case marker are commonly employed with a nominalized sentence standing as the rectum of a genitive construction to generate causal subordinate clauses: bar SENTENCE+a+ak+šè/a mu SENTENCE+a+ak+šè nam SENTENCE+a+ak+šè because. at the time. when. and its wool had been taken into the palace" (Ukg 6 1:18'-19' OS). mu. or nam is often deleted. for example. 201. thereafter. it being so that. then since that time. u4-da u4-ba u4-bi-ta eger é-ĝá-šè on the day. about on the occasion of. leaving only the suffixes to help indicate the causal idea. In the following examples. instead of. instead of. TSU 86 Ur III) because of that. made them liable for it) (Bauer. kù-babbar mu-na-an-šúm-a. 40 ad 10'. balum). for example. of speaking. Šubur the overseer "put it on their necks" (i. an oath to that effect) bar lugal den-líl-le á šúm-ma ì-me-a. a subordinate clause is made dependent upon a main clause which features a verb. nam-érim-bi in-ku5 That he had given him the silver. AS A KIND OF SECONDARY ADJECTIVE. *ana šum > aššum) (dead animals) for (feeding) the dogs because it had gotten lost (Limet. Compare perhaps the use of the Akkadian subjunctive suffix -u in oaths. OS) (again with an elliptical head noun <nam>?) An equally rare suffix is -na-an-na "without.e. Wilcke. seed) until the sheep-shearing (season) (TCS 1.e. OTHER SUBORDINATION DEVICES tukum-bi (or tukum) is the primary subordinating conjunction with the meaning 'if'. 78. 163:13) For adverbs of manner and localizing adverbial expressions see also the lessons on nouns. MVN 11. for the sake of" can produce causal clauses: ku6 ĝá-ĝar-ra-šè nu-mu-túm-a-ka-nam. šubur nu-bànda gú-ne-ne-a e-ne-ĝar Because they (the fishermen) had not brought in (the money) for the (amount of) fish assigned. A rare suffix -a-ka-nam "because of. 282:3) because of your king for my sake because of you because of this because of that (cf. IT ANSWERS THE QUESTION: "WHAT KIND OF?" 101 . by) his king (Gudea Cyl A 17:7) Let Him Live For My Sake! (Ur III personal name with an elliptical <nam>. MODIFYING THE HEAD NOUN. C. adjectives and adverbs. or knowing. commanding.e.eger-ĝu10-šè eger-a-na eger numun-na-šè en-na zú-si-šè bar lugal-za-ke4-eš bar-ĝu10-a bar-zu-šè bar-bi-ta mu-bi-šè mu ur-gi7-ra-šè mu ú-gu dé-a-šè nam-bi-šè nam-iri-na-šè nam é dù-da lugal-la-na-šè ĝá-ke4-éš-hé-ti after me (also in the sense "after I die") behind him after the sowing (lit. ì-zu-a-ke4-eš Because they (the people) knew that he was a king given might by Enlil (Utuheĝal's Annals 54 Ur III) REMEMBER: THE NOMINALIZING SUFFIX -a GENERATES RELATIVE CLAUSES. he swore that oath (i. A RELATIVE CLAUSE IS ALWAYS EMBEDDED IN A NOMINAL CHAIN. Akk. PN-na-an-na lú nu-ù-da-nú-a That except for PN no one had slept with her (NSGU 24:10'-11' Ur III) {nu+n+da+nú+Ø+a} In a usage called the "subjunctive" by Thomsen (§484). therefore For the Sake of His City (OS personal name) for the sake of the house that was to be built of (i. except for" (= Akk. ZA 59 (1969) 83 n. see Falkenstein. NSGU II p. AWL 183 2:2ff. shows a phonologically conditioned allomorph ha. Since the Emesal dialect uses a single prefix dè. Since not all members of this rank of prefixes are.is properly 1st person cohortative "let me" and assertive/affirmative "I shall. hu-) ga.is properly 3rd person precative "let him" and assertive/ affirmative "he will indeed. ga. pp.appears before the prefix mu.e. strictly speaking.was originally used for all persons and ga. Thomsen). {kù nu+m+Ø} > kù *nu-um > kù nu "It was not (made of) silver.in Ur III and later. li-) "not" (§359-365) nu. i. permission or ability. no other verbal prefix may precede it. ga." Compare the use of the precative (see below) with a following copula: hé-em or hé-àm Let it be!". WISH AND ASSERTION (POSITIVE AND NEGATIVE) (§366-403): Earlier views Recent traditional grammatical descriptions have given the following sorts of labels for this group of modal prefixes: hé.before bí. This outermost rank-order position suggests that this class of prefix was the last historically to have been incorporated into the verbal prefix chain. See discussions of Thomsen §359-421 and Edzard 2003. Likewise. hé-a or even just hé.before /a/ and /u/ sounds as early as the Pre-Sargonic period. however. The latter terms refer to the uses of a subclass of this class of prefix: the idea of modality in linguistics concerns such notions as obligation. NEGATIVE nu. M.before mu." and ba-ra. 102 .negates both finite and non-finite verbal forms. Civil. But both can also occur with other persons.(la-. nu+bi > li-bí-.respectively: nu+ba > la-ba-.represents a later 1st person development.PREFORMATIVES (MODAL PREFIXES) The preformatives have also been called modal prefixes (Civil.for all persons. or modal indicators (Edzard). Problems have always surrounded the understanding of these prefixes. In older descriptions.and gú. but this minimal form is perhaps better explained as a negated finite copula with a regular deletion of the final /m/. gú-) nanaba-raPrecative (or Optative) & Affirmative Cohortative & Affirmative Prohibitive (or Negative Precative) Affirmative (or Volitive or Negative Question) Vetitive & Categorical Negative hé.and du5) in place of precative hé. the traditional term preformative is retained here. which can also appear without a final /m/. necessity.(gi4-.where in all but the earliest periods it usually appears as la." and na. In OB nu.is its negative counterpart.in OB (Thomsen §394. can also occur with other persons. Thomsen describes one use of nu as the "negative counterpart to the enclitic copula" (§363).(ha-. hé. modal profixes (Jacobsen). modal elements.g. 113-127.everywhere except before the verbal prefixes ba. and a further allomorph hu. Similarly. it may be that main dialect hé.(with assimilated variants da.or li. RA 60 [1966] 15).or bí. a phenomenon in line with the gradual historical emergence of 1st and 2nd person forms in other verbal paradigms." See the lesson on the copula for more discussion.is its negative counterpart.occasionally takes the forms gi4. It is written nu. ba-ra-. The older term preformative refers to the rank order of the class: a preformative must always stand as the first element in a verbal chain.is occasionally employed as a verbal root meaning "not to be" as in in-nu "he is/was not. e. Civil has now ("Modal Prefixes. the speaker is stating that he both desires the event to happen and that he can visualize the certain completion of the event. When the notion of wish is combined with perfective aspect. i. While there is frequent inconsistency.) I will surely he will surely I did indeed he did indeed │ │ │ ┌───────────────┤ │ │ | ba-ra| | I/you/he certainly | will not. may he. with marû they often seem to express wish. Thus. on the other hand. The notion of wish combined with that of imperfective aspect could signify that the speaker desires that some event may happen. based on a modern two-category classification of modality.e." Deontic modality refers to "the necessity or possibility of an act. whether in the past or the future. but cannot yet visualize the completing of the event. The following schema. should not. he may not.with hamţu is affirmative rather than negative POSITIVE NEGATIVE Newer view M. rather. In this case. did not | | na. citing Edzard and Yoshikawa). expresses the will of the speaker about himself or others. stating that. one can hardly ask someone to do something already completed or in the past." It expresses ideas such as "he has to.." It expresses ideas such 103 .. and opinions of the speaker about his world. with hamţu they often seem to express assertion. ought to." In his article he presents a new description of the preformatives. should go. "deontic" vs. for instance. This formulation is very hypothetical. would it were. beliefs. may I let him. summarizes the possibilities. it is not in his power to state that the event will definitely happen. will not (if. "epistemic. Civil (1968 American Oriental Society lecture handout). and the resulting verbal form expresses an assertion or affirmation that the event definitely will take (or has taken) place. may he I would he would │ │ │ ┌────────────┤ │ │ (overlap) │ ba-ranaI. WISH ┌─────────────────┴──────────────────┐ │ │ marû hamţu │ │ results uncertain. depends upon another will depends upon speaker's will │ │ ┌──────┴───────┐ ┌────────┴────────┐ │ │ │ │ 1st person 3rd person 1st person 3rd person │ (1st & 2nd person) │ (1st & 2nd person) │ │ │ │ gahégahélet me. must not. results certain. his wish is tantamount to actuality. let us go. and so the verbal form expresses only a wish. "It is modality that in a great measure governs the aspect of the verb.It has been suggested that the meaning of these prefixes may depend in some measure upon whether they occur with marû or hamţu stems. and the imperative Go! or Do not go!" Epistemic modality "expresses the knowledge." Acta Sumerologica 22 [2000] 29-42) criticized the notion that a modal prefix "has different meanings dependent on the aspect of the verb" (so Thomsen p. I will go. borrowing features from M. 204. deontic modals naturally tend to have incompletive aspect. Since the marû/hamţu distinction is one of aspect. this phenomenon might be explained in the following way. This use may be labeled "subjunctive": "if X be true" (1) hé. saĝ-ki huš-a-ni hé-me-a Were that man my king.comes in first clause še nam-sukkal-e hé-du7 èn-bi tar-re-dam Whether the barley is indeed fit for the sukkal-office. were that his furious brow! (Gilgamesh and Akka 71-72 OB) 104 . 57 OB) (2) hé.as "he is. he can. must be. you don't know it to its very end! (Dialogue 1. 249:7-9 Ur III) nar za-pa-áĝ hé-en-du10 e-ne-àm nam-àm If a musician can make his sound pleasant. Mood and Modality (Cambridge. he is really a musician! (Proverbs 2. it is to be checked (Sauren. hopes: "let/may it happen" gú gišmá gíd-da i7-da-zu ú gíd-da hé-em-mú On your river banks where boats are towed let long grass grow! (Curse of Agade 264 OB) b) Epistemic function: depends upon some condition expressed by adjoining clause. Palmer. and passim. you should submit yourself to it! (Instructions of Shurppak 13 OB) (2) expresses desires. Genf No. if he is. may be. 1986) 18f. although he is.57 OB) a-rá hé-bí-šid zà-bi-šè nu-e-zu If the multiplication table has to be recited. Civil's categorization is incorporated in part into the following new description which also employs many of his examples: PRECATIVE (OPTATIVE) héa) Deontic function: (1) expresses obligation: "one should do it" na-de5 ab-ba níĝ kal-kal-la-àm gú-zu hé-em-ši-ĝál The advice of an old man is a very precious thing." See further F.occurs in both clauses: the condition is counterfactual or a set of possibilities lú ummaki hé lú kur-ra hé den-líl-le hé-ha-lam-me Whether he be a man of Umma or a foreigner may Enlil destroy him! (Entemena 28-29 6:17-20 OS) lú-bi lugal hé-em énsi hé-em Whether that person be a king or a governor (Šulgi E 78 Ur III) lú-še lugal-ĝu10 hé-me-a.R. TCS 1.markers. one should/must not" túg dan2-dan2-na-zu na-an-mu4-mu4-un You must not wear your well-cleaned clothes! (Gilgamesh and Enkidu 185 OB) (negative advice) á-ĝu10 ga-sù-sù á-ĝu10 na-an-gig-ge I want to extend my arms. Ur III) COHORTATIVE ga.= -e) the dry bitumen of the mooring posts."cannot. (Sollberger.thus mostly indicate either (accusative) direct objects or locative indirect objects. 269:4-7 Ur III) Note the contrast of marû stem with ha. 355:1-4 Ur III) 105 . shall not. SRU 85 r. must not" The vetitive follows a conditioning main clause and negates epistemic hé-. {hé+na+b+šúm+e+Ø} {bara+ba+n+dù+e+d+e(n)} 30 gú ésir-àh ésir-àh tár-kul-la-ke4 ba-ab-dah-e ĝá-e ga-na-ab-su He shall add 30 talents of dry bitumen (-b-) to (ba. 7001:3f.can by pluralized with the 1st pl. 21 OB) PROHIBITIVE (Civil: NEGATIVE OPTATIVE) (deontic) na." he declared (Edzard.or -b. (therefore) I cannot get afraid of it or get gooseflesh at it (Šulgi A 70) PN dam šà-ga-na-ke4 ha-ba-du12-du12 ba-ra-ba-dù-dè bí-du11 "Let PN be married by a spouse of her own desire. I will give it (back) to him. no one shall be detained for Urlumma! (ITT 4. and I myself will repay it (-b-) to him. I want to" ga. Sargonic) mu-lugal ur-lum-ma-ra lú ba-ra-ba-dù King's oath. (TCS 3. 1/2 gín kù-babbar é-zi-ĝu10 ha-na-ab-šúm-mu ĝá-e ù-ĝen ga-na-ab-šúm Let him give a half shekel of silver to Eziĝu! I myself. but plurals may be imperfective."may I. Civil states that cohortatives normally take a perfective stem. though not all. describing a consequence dub-sar gal-zu dnisaba-ka-me-en ĝéštu-ga šu hu-mu-ni-du7-àm Because I am a wise scribe of Nisaba. when he has come. I am perfect in intelligence (Šulgi A 19. Preradical -n. which can account for some. I would not hinder her. subject suffix -en-dè-en.comes in a following clause. preradical -n.or -b.but hamţu with ga-. as well as split-ergative patient marking (-b-) in both forms."do not. may my arms not get sore! (Lugalbanda II 170 OB) (negative wish) VETITIVE (Civil: NEGATIVE SUBJUNCTIVE) (epistemic) ba-ra. Michalowski has demonstrated that the cohortative can show splitergative patient marking. 2'ff. lugal-me-en ní ba-ra-ba-da-te su ba-ra-ba-da-zi Since I am king.(3) hé. g. 10). what did one man say to the other man? (Enmerkar and the Lord of Aratta 394 OB) PROSPECTIVE ù. Heimpel has suggested (JCS 33 [1981] 98). e. time. (b) in the introduction to certain types of direct speech." The function of the -n.kur-ra ga-an-ku4 mu-ĝu10 ga-an-ĝar {-n.-ta).may indicate a locus. The function of preradial -bin these split-ergative forms is clear. waššābu). When not 106 . on the other hand. translation. (c) in the letter formula ù-na-a-du11 . decided to." a less satisfactory meaning in view of the Akk. It usually marks a 3rd person impersonal patient. RA 87 (1993) 29-45. e.(a-. JAOS 88. usually of the shape ga-ab-√ (gáb-√ in OS) or ga-an-√. i-) "when. 1 OB) Civil: "consultative/deliberative" function. uruki na-nam uruki na-nam me-bi na-pà-dè Was not the city indeed here. Traditional grammars have recognized two different napreformatives: prohibitive (negative precative) "may he not" as opposed to affirmative "he will indeed..-a) or "after" (u4 . The analysis is simpler in the case of ga-√ forms.as a "presumptive volitive. that the apparent negative and positive meanings of na. resident" (Akk. "used as nomina agentis for transitive and intransitive verbs. ga-an-tuš "I would live in it" > "tenant..certainly developed from the noun u4 "day.." used in temporal subordinate clauses with the meaning "when" (u4 . though there are exceptions." Thomsen (§374) states that na + marû = prohibitive." approximately "did he not?" or "is it not the case that?". If ga-an-√ is properly used only with intransitive verbs. I want to establish my reputation there! (Gilgamesh and Huwawa 5 OB) e-ne ga-ba-ab-túm-mu-un-dè-en We want to take that one (-b-) away! (Inana's Descent 343 OB) eger dub-me-ka a-na-àm ga-ab-sar-en-dè-en What (-b-) is it we should write on the backs of our tablets? (Dialogue 3.. ga. AFFIRMATIVE na(§371-382) Civil calls this a mark of "reported speech" and notes that this prefix is used (a) in the opening passages of mythical or epical texts.can generate frozen nominalized verbal forms.." Jacobsen describes this affirmative na. ga-ti "I would live!" > "ex-voto gift. after" (§409-414) ù. then in at least some terms the -n. na-bé-a (see below).resumes -a} I want to go into the mountains. was not the city indeed here.." See a full discussion and exhaustive list of examples in G.g. W. and na. was not its divine power being revealed? (Nanše A 1 OB) en-e kur lú ti-la-šè ĝéštu-ga-ni na-an-gub The lord directed his attention to the mountain of the one who is alive (Gilgamesh and Huwawa 1 OB) ì-ne-eš lú lú-ù-ra a-na na-an-du11 Now.as capable of indicating a "negative rhetorical question.g. If it indicated a patient it could only mean "I would make him live.might be reconciled by regarding na. Selz. respectively" (Civil.in ga-an-√ forms is more equivocal. e. ga-ab-sa10 "I would buy it!" > "purchaser." translating approximately "he determined.+ hamţu = affirmative. . the crown of Lumma.is occasionally used to generate what have been termed "polite" imperatives. 10:23-29 OS) ì-ge-en arattaki ur adda sar-gin7 šu-ta im-ta-ri ĝá-e u4-ba ša-ba-na-gam-e-dè-en In the event that she (Inana) shall push away Aratta as if it were a dog running to carrion. ù. šu-) "so. if only I could make your body be here (Cohen. before an event described in a following main clause: (u+n+ak+Ø} dumu úku-rá-ke4 ur5 SAĜxHA-na ù-a5 ku6-bi lú nu-ba-dab6-kar-ré When a poor man's son has made a fish-pond loan. it is not uncommon for ù. considered most likely to be a coalescence of the negative and contrapunctive preformatives *nu-éš > nu-uš. Finally." (Gilgamesh Enkidu and the Netherworld 246 OB) šu-zu nu-uš-bí-in-tuku bar-zu né-eš-mi-in-ĝál If only I could (or: why can't I) hold your hand.(ša-.-a temporal subordinate clause: u4 dumu úku-rá-ke4 ur5 SAĜxHA-na in-ak-a-a.except before the verbal prefixes ba. um-). thus. u+bi > ì-bí. -dab6. therefore. OB) FRUSTRATIVE nu-uš. ù.written combined with a following consonantal prefix (un-. Eršemma p. In fact.above). on a day when) the sheep was pure. It appears to indicate an unrealizable wish (Jacobsen) or a rhetorical interrogative like "why not?" (Civil): nu-uš-ma-ab-bé-en "If only you could tell me (or: why can't you tell me).: u4-da udu e-hád siki-bi é-gal-la a-ba-de6 "whenever (lit. on that day.) {<inim> nuš+ma+b+e+n} {nuš+m+b+n+ĝál} 107 . were it that" (§418-420) This preformative.always appears in a subordinate clause indicating an event which took place. is the life of the Piriĝ-eden canal" (Ean 1. is poorly attested and restricted thus far to OB examples.to co-occur in a sentence with a temporal adverb based on u4.(compare the similar pattern for negative nu. which can assimilate to any following vowel. no one shall take away its fish! (Ukg 6 3:6'-9' OS. šè-.is an OS writing for -da-ab-) This sentence is functionally equivalent to one featuring an u4 .(Emesal né-eš. the prospective is normally written ù. but it is relatively rare and one can still only guess at its meaning from the contexts. I.respectively: u+ba > a-ba-.or ì. ub-. or will have taken place.. 94:36f. A nice older example is Ukg 6 1:11'ff.or bíwhere it may appear as assimilated a.has assimilated to the following ba-). Based on its OB occurrences it seems to indicate that an event takes place as a consequence of a preceding event: na-rú-a mu-bi lú-a nu mu-bé ši-e en men lum-ma nam-ti i7-piriĝ-eden-na The statue's name is not that of a man. shall therefore have to bow down to him! (Enmerkar and the Lord of Aratta 290f. correspondingly" (§404-408) This preformative. is attested quite early.or ni-iš-) "if only. and (so) its wool was taken away into the palace" (ù. rev. This use is most commonly seen in the formula which opens letters: (PN na-bé-a) PN2-ra ù-na-a-du11 "(What PN says) do say to PN2!" CONTRAPUNCTIVE ši. rather its name says: "(Ninĝirsu) the lord. . -n-ga. however. In OB and later it appears as (i)n-ga." serving to link two or more sentences or clauses which normally have the same agents or subjects.(la-.cannot start a verbal form without the help of a prosthetic vowel. li-) hé. gú-) nanaba-raù. must not when. In earlier periods in which preradical /n/ is normally not written in verbal forms. also. furthermore. appear following a proper preformative. and then. whether may I.in OS Lagaš. -n-ga.. e-ga. therefore if only and. furthermore 108 . it stands before all other prefixed elements and adds secondary information.. hu-) ga.. Like the pronominal element -n-. Cyl A 7:9-10 Ur III) alaĝ-e ù kù nu za-gìn nu-ga-àm This statue was neither (made of) silver nor moreover was it (made of) lapis lazuli.CONJUNCTIVE -n-ga. It can also be combined with the conjunction ù to express the notion "either . also. he should.(ša-.(ha-. (Gudea. ì-) ši. nor" as in the following: sipa-zi gù-dé-a gal mu-zu gal ì-ga-túm-mu Righteous shepherd Gudea knew great things and also delivers great things (Gudea. I shall may he not he shall (shall he not?) can not. šu-) nu-uš(i)n-ga- not may he. like them. or" or "neither .can appear simply as -ga-. consequently" (§322-328) This prefix is normally classed functionally among the preformatives since.or (i)m-ga-. after so. and so it must be described either as a secondary preformative or merely as a prefix whose rank order slot lies between the preformatives and the ventive element. -n-ga.g.(a-.can function rather like the Akkadian loanword ù "and.(gi4-. Statue B 7:49 Ur III) {V+(n)ga+túm+e+Ø) {nu+m+Ø} {nu+(n)ga+m+Ø} REMEMBER: NEGATIVE PRECATIVE COHORTATIVE PROHIBITIVE AFFIRMATIVE VETITIVE PROSPECTIVE CONTRAPUNCTIVE FRUSTRATIVE CONJUNCTIVE nu."and. It may. e. e. also cohortatives.marks the direct object "it". p. who saw in them a manifestation of Sumerian "split ergativity. element -ne. and it cannot as yet be considered as fully proven. The 3rd pl. an event visualized by the speaker as one which will indeed be completed rather than a wish which may or may not be realized depending upon outside circumstances. rather than the ergative patient/agent opposition found in declarative hamţu forms. The precise morphological significance of these variants is not always immediately clear. Thus it is possible to use an imperative to say "Marry her!" but impossible to use an imperative to say "Marry me!" For non-3rd sg. -Vb-zé-en or -Vm-zé-en when the context requires a preceding /n/ /b/ or /m/ element. including the secondary preformative -n-ga-. imperatives." No explicit suffixed subject/patient markers are permitted in imperative forms.). note that an imperative cannot be negated. the imperative transformation technically may be assigned the rank order of a preformative for descriptive purposes.here thus mark (accusative) objects rather than agents. Michalowski (JCS 32 (1980) 86ff. elements -n. be pluralized by adding the 2nd person plural subject marker -nzen to the end of the shifted prefix chain.in occurring forms in the OB texts from which most of our examples are drawn. but it must contend no less with inconsistencies in the choice of -n. pronouns -n.. Thus in the form zi-ga-ab "Make it rise!" -b.THE IMPERATIVE GENERAL CHARACTERISTICS (§495-498) The imperative can be described as a transformation of an underlying declarative verbal form in which the elements of a verbal prefix chain are shifted as a whole from prefix to suffix position. it takes no explicit 2nd person subject or agent marker. the corresponding personal form would then be zi-ga-an "Make him rise!" This is an attractive hypothesis. must not!" Since the imperative expresses a command. however. An imperative is an inherently 2nd person singular form. The relative rank order of the shifted prefix elements is maintained. A negative command ("Do not!") must therefore be expressed instead as a negated 2nd person declarative wish form using one of the negative preformatives na. that "the question of 'split ergativity' does not seem to be of any question in Sumerian.g. show a nominative/accusative marking scheme like declarative marû forms. it is always generated using a perfective verbal root.or -b-. although the presence of a 2nd person agent is of course implied by the presence of an object marker. displacing any underlying verbal suffixes. Since imperatives and plus-preformative verbal forms are thus mutually exclusive. as has been done in the Prefix Chain Chart. and the patients/objects one encounters are normally only those marked by the 3rd sg. person patients one must use a precative (hé-) or cohortative (ga-) construction. It may. 90f. See the interesting criticism of Edzard.or -b." In his view. to my knowledge.seems theoretically possible but is not attested.or ba-ra. who has a different interpretation of the -n/bpronominal data and who concludes. contrary to present opinion."You may. and the 3rd sg. 2003. A reduplicated root in an imperative form therefore signifies plurality of a subject or patient or intensification of the verbal idea. "Let him marry me!" 109 . This plural marker is written -zé-en.versus -b. since negation is accomplished only by means of one of the negative preformatives. A then intriguingly new analysis of the subject/object phenomena in the imperative was advanced by P. but it can also appear as -Vn-zé-en. For example: ba-an-du12 "He married her" > du12-ba-an "Marry her!" An imperative form may not feature a preformative. As a result of this restriction. Imperatives are frequently marked only for one of the 3rd sg.(more recently).and al-. Line 19 of the Nippur version of the OB Sumerian-Akkadian bilingual du/ĝen grammatical paradigm OBGT VII (MSL IV 89-99) shows ĝen-na = a-[lik] "Go!" while the Ur version (UET 7.MINIMAL IMPERATIVES (All examples to follow are drawn from actual text passages. lies on the northern periphery of ancient Sumer. The Ur version also omits six sections of the Nippur version featuring verbal forms beginning with the prefixes an. e. a development of the "Conjugation Prefix" ì.) {zi(g)+a} {e11(d)+e} The choice of the final vowel in these minimal forms may to some extent be ascribed to geographical dialect. very rarely /e/.) The most basic. consisting only of a hamţu root followed by a vowel. This final -a has been explained as an imperative marker (old). one that is localized in time and space. while Ur lies in its southern heartland. the find-place of the majority of the preserved OB literary tablets. pronominal elements -n/e/. or in some cases a sort of aspectual morpheme (M. thus tuš-a "Sit!" {tuš+V} corresponding formally to an agentless declarative form ì-tuš "He sat" {V+tuš+Ø}. Since minimal imperatives of this sort are not marked for patients (direct objects). Yoshikawa. ZA 69 [1979] 161ff. and since a large number of our source texts come from Nippur.: ĝen-na (rare: ĝen-né) zi-ga silim-ma šèĝ-ĝá tuš-a e11-dè Go! Rise! Be well! Rain! Sit! Descend! (Dumuzi & Geštinana 4ff. even though one may be syntactically present in the sentence: gul-a de6-a du11-ga-na di-ĝu10 ku5-dè Destroy it! Bring it! Say it to him! Decide my case! for for for for gul-la-ab de6-ab <inim> du11-ga-na-ab ku5(d)-dè-eb (Proverbs 9 E 4) 110 . In the root and a following final object element /b/: {zi(g)+b} {zir+b} {húl+b} {a5(k)+b} {bal+b) In other cases no anaptyxis is needed. or rarely the following consonantal elements. is required to separate the root from following examples /a/ appears between the zi-ga-ab zi-ra-ab húl-la-ab en-nu-ùĝ ak-ab bal-e-eb Make it rise! Erase it! Make them happy! Perform the watch! Turn them away! the presence of a patient (object). using or -b-.g. one can view such a form as a transformation of a minimal declarative form which must be marked by an otherwise nonsignificant anaptyctic vocalic prefix in order to make the form finite. it is no wonder that the preferred suffixed vowel of extant imperatives should likewise statistically turn out to be /a/. Nippur. Since an imperative is a finite verbal form. they will generally convey intransitive ideas. 101+) shows ĝen-né = a-lik.. The use of /a/ as an initial prosthetic vowel is much more common in Nippur and other Akkadian-dominated northern sites. see Thomsen §497). and commonest. following the normal phonotactic patterns of the prefix chain as described in earlier lessons. for example: ĝar-bí-ib sar-bí-ib Set it there! Make it run from there! {ĝar+b+b} {sar+b+b} An imperative is not always overtly marked for a patient. the religious and cultural heart of Sumer and the site of a major Old Babylonian scribal school. and the same vowel /a/. imperative forms are very short. usually /a/. possibily influenced by the phonological shape of the corresponding Akkadian ventive suffix -am. a view not generally accepted.e. Syntax demands a patient marker -b. In the following examples of minimal ventive imperatives note the absence of expected patient markers. One explanation for this phenomenon is that resumptive elements in the verbal chain are at bottom always optional. takes one of three forms: √-um (rare).)! expected: de6-mu-ub expected: zu-mu-ub rare writing rare writing usual writing (old reading: ĝá-nu) note reappearance of the /m/ before the plural suffix expected: ĝál-mu-ub expected: ĝar-mu-ub Emesal for zi(g)-gu-u(m) Come back here! Sleep. orthographically indistinguishable from im-√ standing for simple Vm+√. 505:31) is problematic. which seems merely to illustrate the common tendency for nasal consonants to drop in final position.-garment!" (Winter and Summer 211). -b-. Several observations on the phonological shapes of these minimal forms are in order.) The writing -àm instead of -um appears to be an OB convention. a ventive seems semantically difficult unless it adds a telic nuance "completely. as with ba.vs. Another is that at least some final /m/ markers might actually stand for an assimilation of {m+b}. (T. since an amissible consonantal Auslaut never appears when another consonant follows: de6-mu-un de6-mu-un-zé-en gi4-mu-un zi-mu-ub-zé-en Bring him in! Bring (pl. Compare also the /u/ associated with the 1st and 2nd sg. in line with the current suggestion of some scholars that a declarative form like im-√ can actually stand for Vm+b+√. is traditionally. possessive pronouns -ĝu10 and -zu rather than the /i/ of 3rd sg. -(a)ni or -bi Why the sound /u/ is preferred to /i/ in connection with an /m/ element (sound) remains an open question. Note that before the element mu-. Is the form a minimal ventive {ur11+V+m} with deletion of /m/ or just a minimal imperative {ur11+V} with assimilation of a final vowel to the vowel of the root? Cf. which involve a root vowel /u/. de6-um zu-àm te-(e)-àm ĝen-ù ĝen-nu ĝe26-nu ĝe26-nu-um-zé-en gi4-ù ù-sá kul-ù é ĝál-lu i-lu ĝar-ù sud-rá-áĝ zi-bu-ù Bring it here! Learn it (completely)! Approach there! Come Come Come Come here! here! here! here (pl. The use of /u/ as a anaptyctic vowel in association with the suffixed ventive element is in line with its appearance instead of epenthetic /i/ in the declarative ventive prefix form mu-. In both instances. albeit not always with the correct choice or -n. to be analyzed as √+a+m rather than √+Vm." With the above.or bí-.) me get up! {de6+m+n} {de6+m+n+zen} {gi4+m+n} {zi(g)+m+b+zen} 111 . m+n+√ > mu-un-√ rather than a *mi-in-√ parallel with b+n+√ > bí-in-√. hurry here! Open up the house! Set up a wail! Rise up light! A form such as ur11-ru "Plough it!" (PAPS 107. Jacobsen (AS 16 [1965] 71ff.) her here! Make him return here! Make (pl. or √-ù (most common). √-àm (more common). túgbar-dul5 tuk5-ù "Weave your b. i. contrast the following ventive forms which are explicitly marked for the presence of a patient.VENTIVE IMPERATIVES An imperative which features only a suffixed ventive element. corresponding to a declarative form m+√ > im-√. to the very end. explained as an assimilated or variant form of an "imperative suffix" -a or -e. √+m. The last form.) theorized that /u/ was an obsolete localizing case marker which he called the "tangentive" used in connection with 1st and 2nd person referents. any Auslauts are suppressed. but too simplistically. perhaps a neologism in which the "imperative suffix" -a takes the place of an epenthetic vowel. and note the gender error -b.) away!" ĝen-àm-ma-zé-en = at-la-ka-nim "Come (pl. The following first three examples show 1st sg.) away!" (OBGT VII 10 & 105. the presence or absence of a epenthetic vowel following the root can signal a difference in meaning. e.) 10 gín kù-babbar šúm-ma-ab Give me 10 shekels of silver! (Falkenstein. corresponding to the prefix sequence m+ba > im-ma-. Eretz-Israel 16. 142*:30 OB Emesal) ĝen-àm-ma = at-la-kam "Come (sg. reflecting either a misunderstanding of the proper use of an epenthetic vowel or an inappropriate application of the imperative formative -a or -e used in minimal imperatives. tell me your name! (Proverbs 5 D 5 OB} ki-tuš du10-ga-ma-ni-íb "Make (your) domicile pleasant there!" (Gudea Cyl A 3:1 Ur III) im-ma-al gú i7-da-ke4 i-bi-zu ĝar-ra-am-ma Set your eye upon the wild cow on the riverbank (Kramer. the minimal imperative kur-šè e11-dè in Dumuzi and Geshtinana 4-10. when a suffixed -ma.marks a 2nd agent) {è(d)+m+na+ra+b+zen} {ba(r)+m+n} {pà+m+n+b} In OB and later texts a superfluous vowel is sometimes written following the root even when there is no phonological justification for it. NSGU 20:7 Ur III) tukum-bi šu mu-ri-bar-re mu-zu du11-ma-ab If I release you. any Auslaut is suppressed before this dative prefix.) it come out for him! Release (the hand from upon) me! Make him swear a royal oath! (-ni. Just as a 1st sg. Fs.< m+ba. the last three ventive plus ba-: é-ĝu10 dù-ma Build my temple for me! (Biga. ma-an-šúm "he gave it to me.represents a shortened writing of the impersonal dative chain -Vm-ma. húl-húl-la-mu-un-da Rejoice greatly over him! (Inana E 19 OB) Note the hamţu reduplication. zú bur5mušen-ra bal-e-bí-ib (vars. an epenthetic vowel will properly appear between the root and the chain. bal-a-[ ]. and. bal-e-eb) Turn away there the teeth of the locusts/birds! (Farmer's Instructions 66 OB) šubur-a-ni kur-ta e11-dè-mu-na-ab Make his servant come up from the netherworld for him! (Gilgameš Enkidu and the Netherworld 240 OB) Cf." so too a corresponding 1st sg. dative imperative will properly show no epenthetic vowel between the root and following -ma-.unless "servant" here is an impersonal noun.for -n. and in this case. as in the preceding section. dative prefix ma. In carefully written texts. however. Klein 30 1:12 Sarg.g. On the other hand. any Auslaut will appear. primarily in connection with a following element -ma-. dative ma-.can start a declarative form without a preceding prosthetic vowel. Ur version) {dù+ma} {šúm+ma+b} {du11(g)+ma+b} {du10(g)+Vm+ba+n+b} {ĝar+Vm+ba} {ĝen+Vm+ba} {ĝen+Vm+ba+(n)zen} 112 .è-mu-na-ra-ab-zé-en šu ba-mu-u8 mu-lugal pà-mu-ni-ib Make (pl. prefix in the earlier line. one writes a nearly homophonous but erroneous {m+ba} sequence: ní-zu ba-ma-ra (var. but the second (intransitive) imperative again shows a -bi writing that resumes a locative postposition: 113 . reduplication {bí. does exist.= -ta} Compare however the following parallel passages.marking a patient... 152): é gú gi4-ib = gú ga-ab-gi4 = bi-ta-[am . ba+Vm+ba+*ta} Give away to me your terror! (Gilgameš and Huwawa version A 144. ] Return the house to the riverbank! (?) I will return it to the riverbank! (?) A further question is why the writing in these forms is BI rather than the BÍ which is the usual prefix writing in declarative verbal forms? Perhaps to avoid confusion with the dè and ne readings of the BÍ sign? In the following line the first (causative) imperative shows a -b. dative prefix (followed by an ablative -ra-).Clear scribal errors do creep into texts. 9'-10' (Black. generally but not always resuming either a locative or locative-terminative postposition. postposition elided to the suffix -zu. Studia Pohl Series Maior 12.-term. šà-ge guru7-ĝe26 an-ta ga-ab-gi4 šà-ge guru7-a-zu an-ta gi4-bi Let me go down to wherever my heart desires! Go down to wherever your heart desires! (Lugalbanda II 176/193 OB) {ga+b+gi4) {gi4+*b} -bi clearly serves the same purpose as the -b.. ] am-ša/ta? [.-term. √+b and √+bi In the following passages the use of /b/ and /bi/ is unremarkable: ĝen-nu dumu-ĝu10 ki-ta-ĝu10-šè tuš-a-ab = alka mārī tišab ina šapliya Come here my son and sit below me! (Examenstext A 3 Neo-Assyrian) lú-kúr iri-gibil-a al-dúr-ru-ne-eš ki-tuš-bi-ta sar-bí-ib Chase away from their dwellings the enemy living in the new city! (Letter Collection B 5:11-12 OB) {tuš+a+b} Be smashed to bits like a pot! Take away your house! Marry her! Take them all away! agentless verb patient not indicated patient indicated pl. ba-àm-ma-ra) {ba+ma+*ta. In the following literary passage. but why is the imperative not simply gi4-ib as predicted by the analysis employed in this grammar? The latter form.. compare the fragmentary OB grammatical text Ni4143. with ablative -ra-) With Vm+ba forms compare the following examples illustrating the use of the prefix ba(in its ablative function) without a preceding ventive element or helping vowel: dug-gin7 gaz-ba é-zu de6-ba du12-ba-an dab5-dab5-ba-ab LOCATIVE CONSTRUCTIONS When one of the pronominal elements /n/ /ni/ /b/ or /bi/ is not being used in an imperative to mark a patient (direct object) or second agent. while in the second the corresponding imperative features a -bi suffix that resumes a loc.that resumes a loc. while four textual duplicates write a correct 1st sg. postposition. In the first a cohortative verb features a preradical -b. var. it can mark a locus. though rare. in which the -ì was understood as the "Conjugation Prefix" ì. We are hampered in our analysis of this passage not just by the absence of an -ib suffix marking the object. likewise a form like √-ni-ib in which /ni/ clearly marks a locus or a second agent. Note also that elsewhere in the ĝar paradigm the epenthetic vowel is used correctly in imperatives. OBGT VI 56/105 (MSL IV 81-82): ĝar-bi = šukun "Place!" bí-ĝar = (taškun) "You placed" More interesting are the two contiguous forms OBGT VI 56-57 (MSL IV 81): ĝar-bi = šukun ĝar-ni = (blank) "Place!" Here -bi and -ni are given no explicit Akkadian grammatical correspondences such as accusative suffixes or causative infixes. although he admitted that a locative -ni suffix is also possible. but also by the lack of a predicted epenthetic vowel after the root to yield a form ĝar-ra-ni-ib which would be fully correct for this context. Farmer's Instructions p. i. the main Nippur version and the version of text C3 (Civil.u4-gig-ga u4 gaba-zu zi-ga-ab u4 é-za gi4-bi O bitter storm. So analyzed. 114 . √+n and √+ni A form like √-mu-un in which /n/ marks a patient (direct object) offers no orthographic or analytical difficulties. 90). Contrast the minimal imperative ĝar-ra which is given the same minimal Akkadian correspondence šukun "place!" at the beginning of the paradigm (OBGT VI 1). This would make sense if the OBGT compiler was aware that such minimal forms the -ni and -bi elements were properly used in this period only to mark loci.e.or -nithat regularly resumes a locative in declarative verbal chains. but understood -ì as a locative-terminative infix. O storm make your front rise. Falkenstein. a vocalic element symbolized by him as -*I. See discussion and examples of A. But the frequent OB minimal imperative form √-ni raises questions. On the other hand. where the three variants of the second imperative leave its morphological analysis somewhat equivocal: šid-bi du6-ul-(la-)ab zar-re-éš nu11-a-ab (var.that has not altered to become the imperative suffix -a. nu11-bí-[ib?] zar-re-éš nu11-bi šid-bi du6-lá Assemble a sufficient number(?) for it and lay down (the grain) in sheaves! Perhaps the OB scribes reserved -b primarily for marking patients. go. In the past √-ni has usually been read √-ì. while -bi was employed specifically to mark loci. a use not capable of being expressed through Akkadian verbal morphology. √-ì is not marked for the locative. a more pleasing sounding /gibi/ rather than /gib/. The orthographic phenomenon incidentally appears again in the OB grammatical texts. 49). It seems unlikely that -bi was employed for reasons of euphony. as does the fact that it is difficult to find an occurring OB or earlier verbal form √-Vn in which /n/ marks a locus. but it is undeniable that it is -n. √-bi and √-ni forms are in this respect once again anomalous. in Song of the Plowing Oxen 143/144 gu4 ĝen-a ĝen-a giššudun-a gú ĝar-ni "Go oxen. put the neck in the yoke!" the editor M.(see AOAT 25. cf. O storm return to your house! (Lamentation over Sumer and Ur 483) Compare also line 83 of The Farmer's Instructions. ZA 49 (1950) 132. Civil's solution is an option. Civil also read ĝar-ì. For loss of final /n/ cf. viz. perhaps with a deleted /n/ and compensatory vowel lengthening: /ĝari:/? A better solution probably lies in identifying those rare OB passages which do write an expected epenthetic vowel between the root and the -ni suffix. Cf. all OB. Initially. 181) gaba-kù-ĝá-a u4-gin7 è-ni Come out like the daylight upon (-a) my holy breast! (Enmerkar and the Lord of Aratta 102) {sa6(g)+ni} {è(d)+ni} 115 . cf.28-30). ĝéštu-ga-a-ni) Ezinu. pay attention to (-a) yourself! (Sheep and Grain 163 OB) The odd syllabically written variant /ĝéštug ani/ argues strongly against a reading a5-ì in the main text. SRU p. never ever to be altered! (Rim-Sin B 52 = Haya hymn) These following two OB examples feature intransitive verbs and locative indirect objects. despite the uncomfortable lack of expected epenthetic vowels. 86:7 apud Edzard. and all are missing a final /b/ and an epenthetic /a/: d ur-dnin-urta giššudun gú-ba ĝar-ni Place the yoke onto (-a) their necks. the prefix ì-√ for ergative in-√ is ubiquitous until late in the Ur III period.Conceivably pertinent is the common phenomenon of the loss of /n/ and its replacement by -ì seen sporadically in Ur III texts. The following examples of √-ni. ab-gi-ì "he verified it" (PBS 9. As in earlier examples Auslauts are suppressed: igi diĝir-za-ka sa6-ni Be pleasing in (-a) the eyes of your god! (Scribe and His Perverse Son 176. are all in transitive or causative contexts featuring oblique objects. è-a-ni) Like Šara the beloved son of Inana shoot forth your in barbed arrows like daylight! (Lugalbanda and Enmerkar 142-143 OB) d d ézinu ní-za ĝéštu a5-ni (var. such evidence favors a reading -ni in contexts featuring a locative indirect object. nu-ù-gi-ì for nu-un-gi-in "he did not verify it" (NSGU 213:22. lú še-numun ĝar-ra-za igi-zu ĝar-ni (var. MSL IV 69) im nam-ti-la-ke4 du-rí-šè nu-kúr-ru mu-bi gub-ni Make its name stand on (-e) the clay-tablet of life. ú-gíd-da bí-ì-mú "he made long grass grow there" (Šulgi D 338). The loss of medial /n/ is also common throughout the Ur III period. 123). Could ĝar-ì thus be an orthographic convention for a locative form ĝar+n > /ĝarin/. bí-in-è) "the Tummal he made replendent" (passim in the Tummal Inscription). While not dispositive. tum-maalki-e pa bì-i-é (var. ĝar-ra-ni) Keep your eye on (-a) the man who sets out the barley seed (Farmer's Instructions 49 OB) šára dumu ki-áĝ dinana-gin7 ti-zú-zu-a u4-gin7 è-ni (var. ìr nu-me-ì (for nu-me-en) bí-du11-ga "that he declared 'I am not a slave'" (NSGU 34:11). Ur-Ninurta! (Ur-Ninurta A 43) ù-na-a-du11 silim-ma-ĝu10 šu-ni-šè ĝar-ni Place my letter of greetings into (-šè) her hand! (Message of Ludingira 7) še guru7-e ĝar-ni Place the barley upon (-e) the grain-heap! (OBGT III 25. NABU 2004/75.). mainly locatives. have as their fundamental shapes /bi/. 125f. One might possibly compare certain finite imperfective verbs ending in a -dè suffix (see below. The neologisms of late Ur III texts and OB school texts often skew the analysis of the earlier spoken language.and -ni-. du6-da igi íl-la-[ni-íb(?] Sister. 78 OB) Conclusions Several conclusions may be drawn from the preceding discussion. and /m/ plus an epenthetic vocalic element — the position maintained in this grammar. PERFECTIVE VERBAL FORM. ĝar-ra-ni-ib. e. go out upon the hill. ONLY -u. 116 . it seems undeniable that both √-bi and √-ni mark indirect objects. IF VENTIVE. for additional examples and a different basic analysis of these phenomena. also 1st sg. lift your eyes upon the hill! (Dumuzi's Dream 76. NABU 2006/93. pg. {du6(d)+a} {è(d)+bi} REMEMBER: AN IMPERATIVE IS A FINITE. taking the place of rare or unattested √-b and √-n with that use. FORM WHICH CAN BE PLURALIZED BY ADDING THE SUFFIX /(n)zen/. vindicating the earlier proposals of Falkenstein. All this suggests that √-bi and √-ni are innovations that in particular syntactic contexts would be technically ungrammatical in earlier periods of the language. with a nearly complete absence of predicted postradical anaptyxis in √-ni forms and also with an absence of a final /n/ or /b/ element marking a patient/direct object in transitive forms. DECLARATIVE. Second.g. rather than /b/. Their arguments are seductive but rendered less convincing by lack of evidence from earlier periods and the general lack of data owing to the relative paucity of imperative forms in all periods. First. If these are truly the fundamental shapes of these elements.or bí-. The probable suppression of verb Auslauts before -ni. AN IMPERATIVE IS AN INHERENTLY 2ND PERSON SG. paired with a transitive imperative : nin9 du6-da è-bi. in which a modal element /d/ which would otherwise be subject to deletion at the end of a verbal chain may have been written as an allomorph /de/ in order to signal explicitly its presence. LIKE THE COHORTATIVE AND FINITE IMPERFECTIVE FORMS. Both consider these √-bi and √-ni forms which mark loci to be proof that the locative(-terminative) markers in declarative verbal forms. SHOWS A SPLIT-ERGATIVE MORPHOLOGY IN WHICH A FINAL /n/ or /b/ CAN MARK AN "ACCUSATIVE" DIRECT OBJECT. and /m/ before the root may be correct. as though -ni were functioning phonotactiically like a mu. /n/. THE IMPERATIVE.Compare the same intransitive verb è(d) with suffix -bi in a similar locative context. -um OR -àm. See now Attinger. mu-. /ni/ and /mu/. is also remarkable. /n/. bí. in OB imperatives. it must be stressed that these phenomena seem to occur almost exclusively in OB texts. WHOSE PREFIX CHAIN HAS BEEN SHIFTED AS A WHOLE TO A SUFFIX POSITION. with the response of Jagersma. THE SIMPLEST IMPERATIVES SHOW ONLY A SUFFIX -a OR. then the theory that they reduce to /b/. does not show any special marû stem. a perfective verb describes an event viewed by the speaker as completed and as a whole event. without regard for a beginning or ending point. This phenomenon is referred to in grammatical studies as hamţu reduplication or plural reduplication.g." See Thomsen § 225-226 for a list of common verbs which follow this pattern. unmarked. an event viewed as uncompleted or on-going. form of the verb.) The perfective stem is the basic. Krecher has suggested that this -e is in origin actually the marû stem of the principal Sumerian auxillary verb du11(g) "to do. Jacobsen.IMPERFECTIVE FINITE VERBS Up to now in this introduction. for his last statement on this matter. and we can generally translate a Sumerian perfective form with an English past tense form. we will freely employ the terminology hamţu vs. T. which can assimilate to a preceding vowel. marû pronominal suffix rather than a marû stem formative element. To summarize what has been said previously about tense and aspect. Jagersma. 117 . Practically speaking. pull Note that Edzard. but also possibly repetition or some variety of intensification of the root idea. according to the school of analysis originated by M. the form that usually appears in glossary or vocabulary listings. normally indicating plurality of an impersonal subject (patient)." certainly referring to the generation of literally "longer" imperfective stems by modification of perfective stems. which are called Regular Verbs. when dealing with ordinary finite verbs we will normally translate perfective forms in the past tense. and the use of different affix paradigms for the core pronominal subject (patient) and agent. marû in the following discussions. Ean 1 16:24 etc. to the hamţu root. THE IMPERFECTIVE (marû) STEM (§212ff. See "The Forerunners of Marû and Hamţu in Old Babylonian." in Riches Hidden in Secret Places (Winona Lake. discussions of the Sumerian verb have been limited to perfective verbal forms. also Thomsen. Yoshikawa. although it could just as well represent an event viewed as on-going in the past. Krecher. 2002) 63-71 as well as Thomsen. The imperfective stem is formed in one of four ways. and we can usually translate it with an English present or future tense form. p. while imperfectives can generally be translated in the present or future tense depending upon context (though descriptions of the /ed/ morpheme as a future tense marker can complicate this theory). three examples of which are: dù šúm gíd dù-e šúm-e gíd-e (or dù-ù) (or šúm-mu) (or gíd-i) to build to give to stretch. M. believe that this -e is a 3rd sg. They thus believe that this large class of verbs. and most others. The only modification seen with the perfective stem is reduplication. Civil has recently shown that the contrast was also known in Sumerian as lugud "short" versus gíd "long. In keeping with common practice. The Sumerian Language §231. Sumerian imperfective verbs are properly distinguished from perfective verbs in two ways: by a difference in the shape of the verbal stem. terms hamţu "quick" and marû "fat" respectively. traditional Poebel-Falkenstein school of analysis. This view is a feature of the older. See Edzard 2003. Later Akkadian scribes described Sumerian perfective and imperfective verbal stems with the Akk. See the next lesson on participles for more discussion of variations and peculiarities of marû stem formation. An imperfective verb describes. on the other hand. This is the commonest class of verbs. this grammar). J. 1) Affixation Class (M. although one occasionally encounters a context where a future tense form would be appropriate and theoretically possible (e. Here the marû stem is formed by suffixing an element -e.). Yoshikawa (not followed by all scholars). 83f. e-ta-è-dè (DP 339 rev. See Thomsen §228 for a list of common examples such as: ĝar gi4 naĝ zi(g) zu ĝá-ĝá gi4-gi4 na8-na8 zi-zi zu-zu to to to to to set." i. Such final consonant deletion apparently does not occur in pluralizing hamţu reduplication. distinguishable only in the sg. for example. and the pattern becomes that of an affixation class verb: túm/tùm for hamţu and túm-mu for marû. ĝen re7 /ere/ marû du su8(b) Both stems are written with the DU sign Both stems are written DU&DU or DU. now speaks of two verbs. calls "partial reduplication. túm. 3) Alternating Class Three verbs were originally said to comprise this class. and the status of this entire class is uncertain. ba-te-ĝe26-en 4) Complementary Verbs This is a class of four common verbs which show an entirely different root as the marû stem. supposedly showing a short hamţu form and a longer marû form with an added final consonant which appears when a vowel (e. a) Four stems: ĝen/du "to come. tùm. geleiten" referring to persons or animals which can move by themselves. lah5 túm/tùm lah4. See Edzard 2003. de6. lah4/5. the marû suffix -e) follows.DU P. This alternation may illustrate a tendency towards an increasing regularization of the method of marû formation. Also written erx(DU. lah5 is DU. 12. Further investigation is needed.g. lah5 de6 and túm are both written with the DU sign lah4 is written DU&DU. Sallaberger. mi-ni-in-tùm-uš "they brought it in there" (Bird and Fish 7). de6 lah4. 82. Meyer-Laurin. Steinkeller. reduplication of the hamţu root with regular deletion of a final consonant. 6). ZA 100 (2010) 1-14. è te/ti è(-d) te(-ĝ) to go forth to approach e. go" hamţu sg. AOAT 325 (2004) 557-576. and (2) bring II = "liefern" referring to objects which must be carried. pl. See also the description of the plural verb tuš/durun on p. marû sg. AV Klein [2005] 233 n.2 for examples of the phenomenon. tùm. In OB.g. Forms: hamţu sg. with some verbs it may be retained in either the first or second root. the older de6/túm distinction becomes less relevant.e. is not always complete.2) Reduplication Class This is the second most common class of verbs.DU. Forms: hamţu sg. These stems can vary for both aspect and number.: (1) bring I = "mit sich führen. whether in hamţu or marû reduplication. Cf. Here the marû stem is formed either by simple reduplication or by what Thomsen §227. 118 . place return drink rise know (na8 and naĝ are the same sign) Deletion of the final consonant of the reduplicated hamţu root. marû sg. pl.6. including: bi-iz bi-ir gùn te-en hal bi-bi-z(é) bi-ib-re gú-ug-nu te-en-te ha-al-ha to to to to to drip scatter be colorful cool apportion {biz+biz+e} {bir+bir+e} {gùn+gùn+e} {ten+ten} {hal+hal} A root which normally forms its marû stem by reduplication may occasionally form the marû stem instead by affixation of -e. mainly in the singular.g. But the verb ri was confused with de5(g) and does not belong to this class (see W.DU) in OS and er in Ur III b) Three stems: de6/túm "to bring" sg. pl. For the newest study see further V. 3:1) e. pl. by it/them │ │ │ │ 1 -│ │ 2 -│ │ 3p -n-√-(e)š they. they. them (personal) │ │ 3i √-√ they. For example: en-na ba-ug5-ge-a Until he shall die (Enki & Ninhursag 221 OB) níĝ igi-bi-šè gištukul la-ba-gub-bu-a A thing before which a weapon cannot stand (Lament over Sumer and Ur 298 OB) {ba+ug5+e+Ø+a} {nu+ba+gub+e+Ø+a} 119 . by him/her │ │ 3i -bit. an imperfective verb which does not feature an agent will properly show the same suffixed subject (patient) paradigm that is found in perfective forms.) (§294ff. them (impersonal) │ └─────────────────────────────────────────┘ A nominal chain representing the agent of a sentence stands in the ergative case. NABU 2011. by you │ │ 3p -nhe/she. This subject is also marked in the perfective verbal chain by a corresponding pronominal suffix. p. marked by the postposition -e. 6f. it │ │ │ │ 1 -(e)nden we. This agent is also marked in a perfective verbal chain by a corresponding conjugated verbal prefix as follows: Perfective Agent ┌───────────────────────────────────────┐ │ 1 -ØI. conjugated for person. (See Attinger. and gender as follows: Perfective Subject ┌─────────────────────────────────────────┐ │ 1 -(e)n I. for a new analysis.c) Two stems: du11(g)/e "to do" sg. du11(g) e e e The marû participle (and infinitive) uses the special stem di(d) d) Two stems: úš/ug7 "to die" sg. she/her. úš ug7/ug5 ug7/ug5 ug7/ug5 úš and ug7 are both written with the TIL sign By OB ug7 is used for all contexts. number. me │ │ 2 -(e)n you │ │ 3 -Ø he/him. us │ │ 2 -(e)nzen you │ │ 3p -(e)š they.) IMPERFECTIVE PRONOMINAL PARADIGMS To review the subject (patient) and agent paradigms for perfective (hamţu) verbs: A nominal chain representing the subject (patient) of a sentence stands in the absolutive case. by them │ └───────────────────────────────────────┘ Now. pl. by me │ │ 2 -Ø-/-eyou. -mu = Emesal for -ĝu10) {nu+dù+e+Ø} {na+dúb+e+Ø} An imperfective verb which features an agent. but one who walks evilly shall not pass (Ibbi-Suen B Segment B 6 Ur III) Note that the "passive" patient of dab5 and the "intransitive" subject of dib have exactly the same marû morphology. on the other hand. 12. where -(e)ne replaces -n-√-(e)š: Imperfective Agent ┌──────────────────────────────────┐ │ 1 -(e)n I │ │ 2 -(e)n you │ │ 3 -Ø he. Note that agent and patient case marking on nominal chains remains unaltered. p. 171:21. marks the agent by means of a suffix which is identical to that of the perfective subject except in the third person plural.86-103. 105 OB) bar-mu-uš na-dúb-bé It is shaken because of me (Eršemma No. the category of "patient markers" is theoretically shifted from the suffixed position seen with perfective verbs to a prefixed position. (places) where water had not come down (before)." See Michalowski.5. only the imperfective verbal chain can demonstrate this split ergative marking phenomenon. along with Edzard's objections in 2003.): 120 . vision was being reduced. it │ │ │ │ 1 -(e)nden we │ │ 2 -(e)nzen you │ │ 3p -(e)ne they (personal) │ └──────────────────────────────────┘ /(e)/ is here understood as an epenthetic vowel which appears after roots ending in a consonant. zi-du nu-dab5-bé érim-du nu-dib-bé In Kisiga.7. 1. starvation was being known (Lament over Sumer and Ur 305 OB) nu+e11(d)+Ø+a} (mu+ra+e11(d)+e+Ø) {nu+dab5+e+Ø} {nu+dib+e+Ø} {Vm+šú-šú+Ø} tùr nu-dù-e amaš nu-ĝá-ĝá Cattle pens were not being built. occupying the prefix slot of the perfective agent immediately before the root. Thomsen §42. P. 150-52. one who walks rightly is not seized. It can assimilate to the vowel of the root.du6-du6 ki a nu-e11-da a ma-ra-e11-dè Among the hills. their ancient well-founded city. At the same. in which finite imperfective verbs demonstrate a nominative/accusative orientation instead of the ergative/absolutive pattern seen in the perfective verb. The erstwhile patient of a verb is redefined as an accusative "direct object" while the agent becomes a nominative "subject. Most current scholars see in this pattern of pronoun shift a demonstration of split ergativity. Attinger offered the following full paradigm for the marû patient (direct object)(see his detailed argument in Zeitschrift für Assyriologie 75 [1985] 161-178 following on the earlier proposal of J. in imperfective forms the category of "agent markers" is shifted in the verbal chain from the prefixed position seen with perfective verbs to a suffixed position after the stem. van Dijk in Orientalia NS 39 [1970] 308 n. Journal of Cuneiform Studies 32 (1980). Attinger 1993. water will come down for you (Gudea Cyl A 11:14-15 Ur III) Kisigaki iri-ul ki ĝar-ra-ba. she. sheepfolds were not being set up (Nisaba Hymn 27 in Reisman Diss. Thus. u4 im-šú-šú igi im-lá-e šà-ka-tab ì-zu-zu The day was becoming obscured. her │ │ 3i -bit. the marking of imperfective objects is inconsistent throughout the early Ur III period Gudea texts: Object properly marked: an-dùl-daĝal-me ĝissu-zu-šè ní ga-ma-ši-íb-te You are (-me-en) a wide umbrella. since in the older. or as -e. them │ │ │ │ 1 -us │ │ 2 -you │ │ 3p -nethem (personal) │ └───────────────────────────────┘ (realized as /e/. It is difficult to demonstrate these 1st and 2nd person forms with confidence. One must keep in mind that before the Old Babylonian period and the death of spoken Sumerian the marking of most case relationships within the verbal chain was essentially optional. According to Attinger's analysis. In practice one usually sees only the 3rd sg.or an assimilated vowel. while the the perfective agent prefixes -n. perfective suffix -(e)n is shifted to prefix position.as a direct object marker. which is not yet fully accepted. the 1st/2nd sg. indistinguishable from 3rd sg. unto your shade I will go to refresh myself (Cyl A 3 14-15) aša5-gal-gal-e šu ma-ra-ab-íl-e e-pa5-e gú-bi ma-ra-ab-zi-zi All the great fields will "raise the hand" for you. forms can appear either as -n-. one normally encounters only the impersonal -b. /V/ or /n/) (perhaps me-?) In this scheme. -n. The levees and ditches will raise their banks for you (Cyl A 11:12-13) Object not marked: šà-bi ha-ma-pà-dè The meaning of it may she reveal to me (Cyl A 2:3) ĝiš-hur é-a-na ma-ra-pà-pà-dè All the plans of his temple he will reveal to you (Cyl A 7:6) nin-ĝir-su é-zu ma-ra-dù-e Ningirsu. particularly in texts from before the Old Babylonian period.Imperfective Object ┌───────────────────────────────┐ │ 1 -(e)nme │ │ 2 -(e)nyou │ │ 3p -nhim. and that only sporadically.prefixes and occasionally an -e.prefix for which an alternate explanation is often possible.is normally not written before the root even to mark the perfective agent.take on the function of imperfective direct object.or -b. ergative -n-.and -b. native Sumerian periods -n. For example. Further. I will build your temple for you (Cyl A 8:18) Objects inconsistently marked in continguous lines: 121 d (ga+m+ba+ši+b+te) (mu+ra+b+íl+e+Ø) (mu+ra+b+zi-zi+Ø) (hé+ma+(b)+pàd+e+Ø) (mu+ra+(b)+pàd-pàd+e+Ø) (mu+ra+(b)+dù+e+n) . the 1st and 2nd sg. Ningirsu. you have spoken to me.0. 186:6-7 Sargonic letter-order) PN1 nagar u4 30-šè PN2-ra hé-na-an-šúm-mu Let him give PN1 the carpenter (-n-) to PN2 for 30 days (TCS 1 218:3-6 Ur III) 10.0 še-sig5 gur-lugal PN-ra hé-na-ab-šúm-mu Let him give to PN 10 royal gur of good barley (-b-) (TCS 1 7:5-7 Ur III) mu-túm-e-a mu-lugal-bi in-pà He swore by the king's name that he will bring him (-n-) in (MVN 7.é u4-dè ma-ra-dù-e ĝi6-e ma-ra-ab-mú-mú The day will build the temple for you. JCS 29. the night will make it grow up for you (Cyl A 12:1-2) ur-saĝ ma-a-du11 šu-zi ga-mu-ra-ab-ĝar D nin-ĝir-su é-zu ga-mu-ra-dù me šu ga-mu-ra-ab-du7 Hero. they have a priest (-n-) in (his) prime doing the serving there (Hendursaga A 73-75) lú mu-sar-ra-ba šu bí-íb-uru12-a mu-ni bí-íb-sar-re-a Any person who shall "sweep the hand over" (= erase) this inscription and write his (own) name upon it (Anam 2:32-35 = RIM E4. I will put forth a trusty hand for you.resumes -a) .6. 37 Ad 1:9 letter Ur III) Some further examples from Old Babylonian texts: {mu+ra+(b)+dù+e+Ø} {mu+ra+ab+mú-mú} {ga+mu+ra+b+ĝar} {ga+mu+ra+(b)+dù} {ga+mu+ra+b+du7) {hé+na+n+šúm+e+Ø} {hé+na+b+šúm+e+Ø} (mu+n+túm+e+Ø+a) (ha+mu+ne+gi4-gi4+Ø} šeš-a-ne-ne ku-li-ne-ne èn-tar-re im-mi-in-kúš-ù-ne {Vm+b+n+kúš+e+(e)ne} His brothers and friends exhaust him (-n-) with questions (-bí-) (Lugalanda and Enmerkar 225f.2) PROBLEMS AND SCRIBAL ERRORS OB literary texts frequently feature textual variants or problematic verbal forms open 122 {b+b+ùr+e+Ø+a} {b+b+sar+e+Ø+a) (bí. they take a high priestess (-n-) though a kid-omen (-bí-). 526:4-5 Ur III) PN ù PN2 ha-mu-ne-gi4-gi4 PN and PN2 — let him send them (-ne-) back here (FAOS 19. I will make the me perfect for you (Cyl A 2:13-14) A few examples of object markings from early administrative texts: lú a-ga-dèki na-ne-gaz-e He must not kill men of Akkad! (Wilcke. I will build your temple for you.) e-ne-ne en ĝipar-ra bí-in-huĝ-e-ne {b+n+huĝ+e+(e)ne} Vm+b+n+dab5+e+(e)ne} ereš-diĝir máš-a im-mi-in-dab5-bé-ne {b+n+gub+e+(e)ne} gudu4 hi-li-a bí-in-gub-bu-ne They install a high priest (-n-) in the Gipar (bí-).4. (kur+a ga+n+ku4) kur-ra ga-an-ku4 mu-ĝu10 ga-an-ĝar I would go into (-n-) the mountains and establish there (-n-) my name (Gilgamesh and Huwawa 7 OB) Finally. the first showing a preradical -n. in which the 1st plural object is apparently written me-: [gu]-ti-umki lú ha-lam-ma-ke4 me-zé-er-zé-re-ne Gutim. apparent errors sometimes have logical explanations.to several different interpretations. King Urnamma.vs. -bobject markers in OB texts. idea? Or is mu-e. are wiping us out! (Lamentation over Sumer and Ur 230) {me+zé(r)-zé(r)+ene} One must also be careful to distinguish a preradical -n. both marû verbs seem to be grammatically faulty. does the following passage illustrate Attinger's 1st sg. agent marker which indicates a second agent in the sentence that accomplishes the action? me-en-dè: gišnimbar-gin7 šu nu-du11-ga-me a-na-aš mu-e-gul-gul-lu-ne giš má-gibil-gin7 sa-bíl-lá nu-ak-me a-na-aš mu-e-zé-er-zé-er-re-ne Us – Why do you (-e-) have them (-e-ne) destroy (us) like a palm tree.marks an unnamed locus "here": za-e é-ubur-ra ma-ra-an-dù-ù-ne For you they will build a milking house (-n-) (Sheep and Grain 136 OB) {mu+ra+n+dù+e+(e)ne} On the other hand. reconstructed from the same textual exemplars. with the 1st sg. me. the destroyers.unless the -n. In the following. 20 še [gur-lugal] ì-áĝ-e-a mu lugal in-pà Lugalheĝal declared that he will weigh out 10 shekels of silver when 5 days have passed from the month Mineš.is possibly employed because the object.a misunderstood writing for an actual 1st pl.direct object pronoun based on the 1st sg. AAS 78:5-6 Ur III) In addition to gender errors in the marû object marking system.rather than -b-. one will encounter many apparent errors in the choice of 3rd sg. which can make secure translation difficult. In the following. marker serving to render a 1st pl. In the following two lines for 123 .which marks an object from an -n. impersonal -b. the second lacking any preradical mark: 10 gín kù-babbar itu mìn-èš-ta u4-5-àm zal-la Lugal-hé-ĝál in-lá-e-a bí-in-du11 tukumbi nu-l[á]. especially common in OB texts.which resumes a locative. -n. -n.is apparently an error for impersonal -b.g. imperfective object marker in the form of mu-e(n)-.simply be a normal 2nd sg. despite our not having laid a hand(?) upon it? Why do you (-e-) have them (-e-ne) annihilate (us) like a new boat despite our not having plastered(?) it (with bitumen)? (Lamentation over Sumer and Ur 241-242 OB) Compare the following passage from the same text. is dead and now an impersonal lifeless corpse: ur-dnamma bára-gal kur-ra-ke4 mu-ni-ib-tuš-ù-ne They seat Ur-Namma on the great dais of the netherworld (Urnamma A 136 OB) In this late Ur III contract from Nippur. dative prefix me-? Or could -e. For example. He invoked the king's name that if he does not pay he will measure out 20 royal gur of barley (Grégoire. other sorts of problems are common in the marking of agents in OB passages. e. NSGU 7:15 Ur III) {hé+ba+zàh+e+d+eš} {ba+úš+e+d+a+a} {nu+ba+gi4-gi4+d+eš+a} dumu ù-ma-ni-ke4-ne arad-da la-ba-gi4-gi4-dè-ša-a That the children of Umani should not return (to court) about the slave (Falkenstein. Falkenstein ZA 55 (1963) 68 Ur III) u4 PN ba-úš-e-da-a Whenever (in the future) that PN may die (Falkenstein. The meaning of /d/ in OB finite verbs is sometimes not clear. might be done). should. because he didn't have to repay it. personal object. however. I must not sit (Letter of Aradmu to Šulgi No. prefixed. have described it as a mark of future tense. 25 OB) 124 . the day when a righteous hand is to be brought to my house for me (Gudea Cylinder A 11:18-19 Ur III) {nu-tuš+e+d+en} á-áĝ-ĝá lugal-ĝá-ke4 ì-gub-bé-en nu-tuš-ù-dè-en (As) I am serving at the instructions of my king. sg. lacking only an explicit preradical -n. Eames Collection Bab 9:1ff. The second verb. The following illustrative examples will therefore come mostly from earlier periods: tukum-bi u4-da-ta PN ù dumu-ĝu10-ne ha-ba-zàh-dè-eš If after today PN and my children might run away (ITT V 9594:2-3. or perhaps an allomorph of a localizing -n-? {m+e+ši+n+túm+en} ĝá-e dnin-hur-saĝ-ĝá mu-e-ši-túm-mu-un a-na-àm níĝ-ba-ĝu10 {m+e+túm+en+am} za-e dnin-hur-saĝ-ĝá mu-e-túm-mu-un-nam I: if I bring Ninhursaĝa here to you. whenever I might flee may it be a felony. agent marker repeating the suffixed agent marker -en. (is) to be released (Oppenheim. T. See the following lesson on participles and infinitives for more discussion and illustrations of the form and functions of /d/ in connection with non-finite verbal constructions. including Edzard. Is it a second. needs to be done) or obligation (ought. Ur III) mu lugal u4 ba-zàh-dè-na-ĝá NIR-da hé-a bí-in-du11 By the king's name. 1:4-6 Ur III} {nu+n+da+su-su+d+a+šè} {bar+e+d} {ba+zàh+e+d+en+a+ĝu10+a} {ma+ši+tùm+e+d+Ø+a} u4 temen-ĝu10 ma-si-gi4-na é-ĝu10 u4 šu-zi ma-ši-tùmu-da The day you shall sink my foundation (pegs) for me. Jacobsen proposed that it can further convey a "pre-actional" idea. is to be done). shows a preradical -ewhose interpretation is difficult. what will be my reward? You: if you indeed bring Ninhursaĝa here . necessity (must.. NSGU 64:16'-17' Ur III) dub lú nu-ub-da-su-su-da-ne {nu+b+da+su-su+d+a+(e)ne+ak+Ø} The tablet of the persons who don't have to repay it (Forde. usually called the /ed/-morpheme. may be suffixed to the marû stem of the verb to add what may be a modal nuance to the imperfective form.to mark the 3rd. NCT 19:52 Ur III) 1 máš gú-na šeš-kal-la mu nu-da-su-su-da-šè šu bar-re 1 tax-kid of Šeškalla. (Enki and Ninhursaĝa 224/226 OB) FINITE IMPERFECTIVE VERBS WITH SUFFIXED MODAL /d/ ELEMENT An element /d/. 2nd sg. referring to future situations which are "about to begin. 1." while others. he declared (BE 3/1.example. the first verb is nearly correct.. namely a notion such as possibility (can. " they declared (lines 40-41) {al+gaz+e+d+Ø} Compare {V+sè(g)+e+d+enden} 125 . when it stands as the last element in the finite verbal chain." the suffix -dè was occasionally placed at the end of finite verbal chains as a kind of allomorph of the /d/ element. and a nominalized finite verb nu-un-gi4-gi4-da "that one would not return against him" which anticipates the -bi pronoun in the main clause. which cannot occur by definition on non-nominalized finite verbal chains.). Thus. finite verbs are not nominal chain constructions. Analecta Biblica 12. It has no meaning per se. it has no syntactic function in such aberrant forms. Rim-Sin 25) Here nu-un-gi4-gi4-dè incorrectly conflates two commonly occurring variant forms: a negated infinitive nu-gi4-gi4-dè "to not return" with a locative-terminative -e loosely dependent upon a verb of speaking. the immediately preceding /d/ element would be deleted and there would be no explicit way to indicate the presence of this modal morpheme in the verb. on that day. This phenomenon is probably an OB innovation. In the two parallel forms the final 3rd person pl. With non-finite verbal forms this suffix is easily understood as the modal element /d/ plus locative-terminative -e. previous attempts to assign a special morphological function to this final /e/ are unnecessary. the following non-contestation formula from an Old Babylonian sales contract: u4-kúr-šè lú lú-ù nu-un-gi4-gi4-dè mu-lugal-bi in-pà-dè-eš That in the future one person shall not return (to court) against the other. that is. What then is the final /e/ element in such forms? In particular cases one can identify a reasonable origin for an unorthodox form. in finite imperfective verbs with a 3rd person sg. /d/ is thought to be regularly deleted (see the full description /d/ in the lesson on participles and infinitives).ĝá-e u4-ba ša-ba-gurum-e-dè-en And indeed I. The simplest answer may lie with the phonotactics of the /d/ element. Compare the following lines from the OB Homocide Trial (Jacobsen. In line 41 the verb should read al-gaz-e unless the form is a conflation of finite al-gaz-e and an infinitive gaz-e-dè. since non-finite forms follow the rules of nominal chain formation and so regularly end with a case marker (or the copula). But unless they are made into relative clauses by means of the nominalizing suffix -a. An obvious solution lay at hand. 44:20-22 Nippur. When /d/ is not followed by some vocalic element such as a subject pronoun. subject or agent marked by a final zero suffix (-Ø). While the final /e/ is in origin the locativeterminative case postposition. subject marker /(e)š/ renders the /d/ pronounceable: munus-e a-na bí-in-ak-e al-gaz-e-d[è] bí-in-eš "The woman. what was she doing (that) she is to be killed. a royal oath to that effect they swore (JCS 20. will consequently (ša-) have to bow down to him (Enmerkar and the Lord of Aratta 291) alaĝ-gin7 kùš-kùš-a dé-a-meš ì-sè-ge-dè-en-dè-en Are we to be made like statues which are poured into moulds? (Lamentation of Sumer and Ur 229) FINITE IMPERFECTIVE VERBS ENDING IN /de/ An old problem in Sumerian grammar has been the analysis of finite imperfective verbs ending in the suffix -dè. By analogy with ubiquitous infinitives of the shape ĝá-ĝá-dè "to place. Other cases however are not so easily explained. Thus. it only functions in this specific environment to make the /d/ element evident. 130ff. Sargonic) REMEMBER: IMPERFECTIVE STEMS ARE FORMED IN FOUR WAYS: AFFIXATION OF -e REDUPLICATION (WITH LOSS OF AMISSIBLE AUSLAUTS) (USE OF AN ALTERNATE STEM WITH ADDED FINAL COUNSONANT) SUBSTITUTION OF A DIFFERENT.nita 3-a-bi ù munus-bi igi gišgu-za PN-šè ì-gaz-e-dè-eš bí-in-e-eš "Those three men and that woman should be killed before PN's chair" they declared (lines 32-34) PNN al-gaz-e-dè-eš PNN are to be killed (lines 55-59) Two additional examples: {V+gaz+e+d+(e)š} {al+gaz+e+d+(e)š} kù mu-[un]-na-ba-e šu nu-um-ma-gíd-i-dè {nu+m+ba+gíd+e+d+Ø} (The god Numušda) offers him silver. 2'ff. DEMONSTRATE "SPLIT ERGATIVITY" IN THEIR SUBJECT-OBJECT PRONOUN PATTERNS. THE AGENT (NOW THE NOMINATIVE SUBJECT) APPEARS AFTER THE ROOT. 102 r 8f." for which a parallel in Šulgi D 393 offers namba-kúš-ù-dè-en. Another example: PN dam šà-ga-na-ke4 ha-ba-du12-du12 {bara+ba+n+dù+e+d+e(n)} ba-ra-ba-dù-dè bí-du11 "Let PN be married by a spouse of her own desire." he declared (Edzard. PBS 8/1. LIKE IMPERATIVES AND COHORTATIVE FORMS. Šulgi X 137 na-ba-an-kúšù-dè-e "may you not grow weary of this. subject/agent suffix -en. I would not hinder her. SRU 85 r. OB) {Vm+ba+b+kalag+e+d+Ø} Excluded from this discussion are those Ur III or earlier verbs which often drop the final /n/ of the 1st or 2nd sg. 126 . AND THE PATIENT (NOW THE ACCUSATIVE OBJECT) APPEARS IN THE PRERADICAL POSITION. but he would not accept it (Marriage of Mardu 77 OB) iz-zi im-ma-ab-kal-la-ge-dè He has to strengthen the wall (of the rented house) (Chiera. e.g. "COMPLEMENTARY" ROOT TRANSITIVE AND CAUSATIVE IMPERFECTIVE FINITE VERBS. CORRESPONDING ERGATIVE AND ABSOLUTIVE CASE MARKERS ON NOMINAL CHAINS ARE UNAFFECTED. England. With the addition of a nominalizing -a suffix this form becomes what is usually described as a past (active or passive) participle: ki áĝ-a "(that which is) loved." má-gíd "boat tower. This imperfective form may be the basis of such occupational terms as ad-gi4-gi4 "one who returns the voice > advisor" or maš-šu-gíd-gíd "one who reaches the hand into the kid > diviner. It might possibly add an irrealis. implying the constancy. although participles can be negated by means of the negative preformative nu-. An added -a suffix may make the participle more definite or merely relativize the form. This form is the basis of nominal compounds such as níĝ-ba "alloted thing > portion. is to be done)." or of such attributive forms as á-tuku "having strength > powerful. duration. a process without an inherent end-point (an atelic event). since the verbal root begins the form also in the case of the imperative transformation and the rare OB so-called prefixless-finite construction." níĝ ba-e The doing of a thing with concern for the process. chiefly necessity (must./a/ níĝ ba níĝ ba-e níĝ ba-e-d + /a/ níĝ ba-a níĝ ba-e-a níĝ ba-e-d-a Meaning allot a thing allotting a thing a thing having to be allotted Describes a thing done without concern for or emphasis on the on-going process of doing it." ki-ùr "leveled place > terrace." za-dím "stone fashioner > lapidary. Jacobsen thought that it can also convey a "preactional" idea. Gudea Cyl A 6:26 ur-saĝ níĝ-ba-e ki áĝ-ra "for the hero who loves gifts. gift." here with a dummy patient níĝ "thing. needs to be done) or obligation (ought." or u4 iri gul-gul "the storm (which goes about) destroying cities. repetition or potentiality of the event. including those formed by reduplication or root alternation): Form hamţu participle marû participle marû participle + /d/ níĝ ba . Their interrelationship may be described in terms of differences of aspect and presence or absence of the modal suffix /d/ and the nominalizing suffix -a." sa-pàr "cord spreader > net. /d/ may add modal ideas to the participle. Basic Structure of Participles and the So-called Infinitive 1) The non-finite verbal forms of Sumerian are." nir-ĝál "being lordly > authoritative." i." níĝ-tuku "having things > rich. distinguished from finite forms by the absence of verbal prefixes. or a process with an inherent end-point (a telic event). This form can could be described as a present participle. attributives such as gal-di "one who does things in a great manner. referring 127 níĝ ba-e-d ." nin9 mul-mul "the ever radiant sister. generally speaking.PARTICIPLES AND THE INFINITIVE THEORETICAL CONSIDERATIONS The following first two sections were originally part of a position paper presented to the 1992 meeting of the Sumerian Grammar Discussion Group held in Oxford. for whom the loving of gifts is perhaps an unchanging." that will be used paradigmatically in the following presentation (ba-e represents any marû stem." an-dùl "sky coverer > canopy. also simple purpose (in order to. Compare the nonfinite forms of the root ba "to allot." níĝ-nu-tuku "not having things > poor.e. regularity or permanance of an event." or of such occupational terms as dub-sar "tablet writer > scribe. however. for the purpose of doing). constant feature of his character. conditional nuance. This distinction is not absolute." Cf. distribute." Cf. 2) Participles (verbal adjectives) and the "infinitive" are structurally related. " 5) To help simplify the analysis of "infinitives" one may identify two basic types of infinitive constructions." and in his last statement (2003. especially in OB finite verbs. If the finite verb in the sentence é in-dù "he built the house" is relativized. though sometimes the two parts are separated by modifiers of the head noun and or adverbial expressions.e." Edzard (1967) described it as a Tempuszeichen par excellence." The difference in meaning between a participle or infinitive with and without a nominalizing -a is sometimes difficult to appreciate. one should keep in mind the basic relativizing function of the nominalizing suffix -a. i. studied by J. Note in passing that when analyzing infinitive constructions in this ergative language. The term "infinitive" will be used here for convenience only. the rules of nominal chain formation. at least with intransitive finite verbs." Substituting a non-finite past participle or present participle plus modal /d/ in the last phrase yields: {é dù-a}-bi-šè "towards that house which was built" or {é dù-e-da}-bi-šè "towards that house which is/was to be built. or as a more independent adverbial expression. expanded nominal chains. the form in which it occurs. is unclear (see later on imperfective finite verbs." The final -e is the locative-terminative case marker which links the infinitive construction with the rest of the sentence. standing in the positions of a head noun and adjective in a nominal chain. e. For example: (a) kù šúm-mu-dè (b) kù šúm-mu-da to (-e) have to give silver silver which has to be given {šúm+e+d+e} {šúm+e+d+a} In (a) the infinitive šúm+e+d functions as an attributive modifier.) A ba-e-d form with a loc. Frequently the meaning of /d/. such a use of /d/ would seem to be redundant. In (b) šúm+e+d is relativized. with possessive pronouns in the imperfective Pronominal Conjugation (see below) or in a copular sentence such as kù-bi (kù) šúm-mu-dam "that silver is (silver which is) to be given. Krecher (1978) and discussed in this grammar in the early lesson on nouns and adjectives. lú-du10-ga vs. Perhaps the problem is comparable in some cases to the distinction between simple adjectives with and without an -a suffix. But if it conveys a future tense idea it probably developed that use secondarily. for example {é in-dù-a}-bi-šè "towards that house which he built. and it can seem to have that kind of use. unless the chain is embedded within another chain either as an attributive adjectival clause or as the regens of a genitive construction. -a generates attributive relative phrases or clauses which then occupy the rank order slot of a primary or secondary adjective in new. 3) It is a fundamental axiom of Sumerian grammar that a proper Sumerian verbal sentence or clause must feature on a basic level a subject (patient) and a verb. case marker.-term. 128 . 82) he again takes it as a future indicator. for example. the resulting clause é in-dù-a can be used as the head noun and attributive of a new nominal chain. consisting of a subject (patient) and a modifying participial verbal complex √(marû)+d. whether as a loose indirect object of a verb of speaking. ba+e+d+e. a present participle with a modal nuance. approximately "the ought to be given silver. p. The case normally seen with a simple infinitive is loc. whether described as participle or infinitive. giving verbal roots passive translations in "transitive" contexts can sometimes be helpful. and since the marû stem already connotes present or future action. as a way of referring to non-finite forms with suffixed /d/ in certain contexts. An infinitive construction is actually a kind of verbal clause. The verbal complex must always end with a case marker (or a case-masking copula). simple lú-du10. -e.-term.to future situations which are "about to begin. for example. 4) In addition to applying to non-finite forms. This -e often functions in form and meaning like the "to" used with English infinitives.g. often a kind of gerundive. those with and those without a relativizing -a suffix. is generally referred to as the Sumerian infinitive. but in closer analysis one should always keep in mind that it is basically a marû participle with an added modal meaning. and before CV case markers. which functions phonotactically like a word boundary. in his view the [e] seen in association with the /d/ element is a component of an /ed/ morpheme. parallel to the [a] of the genitive /ak/. Edzard's analysis presupposes an epenthetic vowel [e] in certain contexts. It is retained before a vowel. i. 129 . The following summarizes a collection of actually occurring forms that illustrate the above proposed full deletion scheme in conjunction with the application to marû participles (infinitives) of nominal chain rules and the nominalizing suffix -a. would analyze instead Vb+šúm+e+Ø.e. and c) before the absolutive case marker -Ø. 2) The preceding phonotactic scheme looks somewhat like that of the genitive case marker /ak/. the participle is. who speaks as follows of four allomorphs of what has traditionally been called the /ed/ morpheme: a) b) c) d) [ed] after a C [(e)d] after a [e(d)] after a [(e)(d)] after and before a V V and before a V C "in final position" a V "in final position" in a form such as gi4-gi4. which do not differentiate marû stems. Granted. 132. The Yoshikawa system. Steiner in Journal of Near Eastern Studies 40 (1981) 21-41 with M. one holds both with the above full phonolgical deletion scheme for /d/ and also Yoshikawa's marû formative -e. OSP 2. this grammar assumes the existence of Yoshikawa's /e/ marû stem formative and that the modal element is properly just /d/. all marû participles taking the form ba-e are instead to be analyzed as ba+e(d). after all. Instead. however. Compare an infinitive such as the Old Sumerian hal-hal-dè (Westenholz. 3) If. the language permits a parallel total deletion also in the case of genitive forms like ama dumu "the mother of the child" {ama dumu+ak+Ø}. for the sake of discussion. Note that Edzard's analysis of the /d/ element differs from that of this grammar in that Edzard. As an attributive phrase within a nominal chain. followed by this grammar. + agent + future}. has not accepted the existence of Yoshikawa's marû stem-forming suffix -e. The [k] is deleted before a) a consonant (the possessive pronouns and the CV case markers). For such roots it is the presence of the /ed/ element which generates a marû participle or an infinitive. any actual explicit phonological mark of an infinitive (cf. b) at a word boundary (#)." where the final -e suffix represents a coalescence of three morphemes: Vb+šúm+e {3rd sg.g. those scholars who hold with Edzard's view that the base element is /ed/ must likewise hold that marû participles based on marû stems formed using Yoshikawa's -e suffix which are distinct from "infinitives" featuring modal /ed/ do not exist.Phonotaxis of the Element /d/ 1) The most recent comprehensive description of the modal /d/ element is that of Edzard 2003 p. which on its face argues against the presence of any such epenthetic vowel between the final consonant of the root and the /d/ element. following Falkenstein. In other words. On the other hand. e. in which the /Ø/ represents two morphemes {3rd sg. 44 2:2). capable of being followed by a possessive/demonstrative pronoun and a case marker. called Regular Verbs or Normalform Verbs. at the end of an anticipatory genitive chain. For the present. This older analysis in part has led earlier scholars to conclude that there is a large class of verbal roots. This is possibly why Edzard opted for a general meaning of "future tense" rather than any modal meaning in his descriptions of the /ed/ morpheme. + agent} and the -e only one {marû}. For a more detailed traditionalist discussion of this matter compare for example G. one is left with the uncomfortable result that a number of Sumerian "infinitives" will not show the /d/ element. Yoshikawa's differing views in Journal of Near Eastern Studies 27 (1968) 251-261. With this view of /ed/ compare the Poebel-Falkenstein-Edzard analysis of imperfective finite verbs like ib-šúm-e "he will give it. This view would raise the question of how one would translate all these /ed/ forms with any consistency. Edzard's allomorph (d) above). One can make the analogy complete by theorizing that /d/ is also deleted before CV possessive pronouns but not -(a)ni or -(a)nene. conjugation) Notice the two different possible sources for the copular sequence ba-e-dam. restated together here: locative comitative genitive -a + word boundary -a + locative ba+e+d+a ba+e+d+da ba+e+d+ak ba+e+d+a+# ba+e+d+a+a > > > > > ba-e-da ba-e-da ba-e-da ba-e-da ba-e-da (anticipatory genitive) (regens of a genitive) (locative often elided) Some of the old problem of determining the functions of infinitival /ede/ vs. Compare the following: e-sír é-ba-an 2-a kéš-re6-dè To tie sandles into two pairs (PDT 361:4-5 Ur III) 60 sa gi ki PN-ta a-šà kéš-e-dè maš-maš-e šu ba-ti Mašmaš received 60 bundles of reed from PN to tie up a field (Nik II 182:1-4 Ur III) 324 sa gi ka i7-da i7 damar-dsuen é ĝá-ra kéš-dè 324 bundles of reed at Ka'ida. to tie up an established house (Kang. sg.ba-e-d before a possessive pronoun and a case marker 1 2 3 3 sg. /eda/ forms may stem in part from such multiple possible origins of the /ba-e-da/ sequence. textual references for verbal forms which could feature a phonotactically concealed /d/ will be avoided to lessen confusion in the basic presentation of data. At the end of this lesson. copula pronoun + case ba+e+d+a+# ba+e+d+a+a ba+e+d+a+m ba+e+d+a+(a)ni+e > > > > ba-e-da (regens of a genitive) ba-e-da(-a)(locative often elided) ba-e-dam ba-e-da-né (pron. sg.term. per. In the example sets to follow. locative comitative terminative genitive 3rd sg. imp. sg. sg. the river of Amar-Suen. however. loc. ORTHOGRAPHIC PECULIARITIES ASSOCIATED WITH THE INFINITIVE OR PARTICIPLE It is not uncommon for an infinitive showing the /d/ suffix to feature a verb which does not look like a proper marû stem as currently understood. loc. loc. SACT II 161:1-4 Ur III) {ĝar+a+Ø} kuš {kéš(e)dr+e+d+e} 130 . ba+e+d+ĝu10+Ø ba+e+d+zu+a ba+e+d+(a)ni+a ba+e+d+bi+a > > > > ba-e-ĝu10 ba-e-za ba-e-da-na ba-e-ba ba-e-d before a case marker or the 3. + + + + abs. copula ba+e+d+Ø ba+e+d+e ba+e+d+a ba+e+d+da ba+e+d+šè ba+e+d+ak ba+e+d+Vm > > > > > > > ba-e ba-e-dè ba-e-da ba-e-da ba-e-šè ba-e-da ba-e-dam (anticipatory genitive) ba-e-d plus nominalizing -a and nominal chain elements word boundary locative 3rd sg. Note further the number of different possible underlying morphemic origins for the sequence ba-e-da which can result from the deletion scheme. a selection of passages has been assembled which could reasonably be adduced to illustrate a concealed final /d/. copula absolutive ergative/loc. Compare the writing dù-dè generally found in texts from before Ur III. AWL 21:2 OS). In earlier texts at least one can suppose that abbreviated. SYNTACTIC PECULIARITIES ASSOCIATED WITH THE PARTICIPLE OR INFINITIVE 1) Often one encounters a participial or infinitival construction which lacks a subject (patient) head noun or required agent. e. A nice literary example featuring ellipsis of both agents and patients is: <lú> <níĝ> húl-húl-le-me-en <lú> <níĝ> du10-du10-ge-me-en <lú> giri17-zal nam-nun-na u4 zal-zal-le-me-en (A man) making all (things) joyous am I. Note that the value kè for the AK sign is attested in the OB Proto-Ea sign-list and. Gilgameš and Aga 58: dím-ma-ni hé-sùh(u) galga-ni hé-bir-re "so that his reasoning will become confused. Many roots containing a /u/ vowel show this property. e." or "mnemonic" writing is possibly at work in such cases. the alternate analysis of an allomorph /k/ before modal /ed/.g." More problematic is the very common writing AK-dè "to do. cit. For example. 46ff. non-plene writing of the marû stem particularly in earlier texts." In some cases native sign lists justify our choosing a sign value that shows a homorganic final vowel (überhängender Vokal) to produce a desired lengthened marû stem where needed.) posits for infinitives the allomorph kè(AK) before modal /d/. Attinger.g. with the plene writing dù-ù-dè which is standard in later texts. In many of these cases one may posit an elliptical noun. the last shows an abbreviated writing. further. Cf. One might conjecture that the spoken language in such cases supplied the lengthened vowel needed to indicate a marû stem generated by an assimilated -e suffix. or gu4-ĝu10 gu7-dè hé-naab-šúm-mu "let him give my ox to him to be fed" (Sollberger.The first reference shows a plene (full) form of the infinitive. 1'-3' Ur III). show the same tendency to abbreviated. typically <lú> or <níĝ>. in which a hamţu root is written but the corresponding marû stem is supplied by the reader." In other cases no such native justification exists. še-numun še anše gu7-dè "seed barley and barley to feed the donkeys" (Bauer. but the same phenomenon may be at work. that a variant syllabic writing ke4-dè is found in texts from Garšana (see Jagersma 2010 §28. his judgment disarrayed. a man who makes things numerous am I (Šulgi A 55 Ur III) 131 d . a form showing a proper marû stem plus /d/ and the locative-terminative. In the written language the presence of a following /d/ element may have been felt to be a sufficient indicator of the presence of a marû stem. as in the Gudea inscriptions." tuk/tuku "to have. "to feed (animals)" is normally written gu7-dè in OS or Ur III texts. TCS 1. proposes in his later study in Zeitschrift für Assyriologie 95. a student of Edzard. especially those featuring an /u/ vowel. & 208ff. kúr/kúru "to alter." for which M. make. P. Powell in his study of this verb (loc. Other roots. Powell suggested (Fs. the second shows a slightly simplified plene writing." or ur11/uru4 "to plow.7). Finally. "morphographemic. Such interpretations argue for the analysis {AK+e+d+e} > kè-dè. 3330 rev. As M. the hamţu stem is simply the same sign read ùr. cases exist where no simple orthographic explanation can easily be found for infinitives apparently built on hamţu stems. An example can be seen in the writing of the infinitive as uru12-dè "to level". to understand the underlying structure." ku5/kudr/kur5/kuru5 "to cut. (a man) making all the days pass in splendor and pomp am I (Šulgi B 175-176 Ur III) With this compare a parallel passage without ellipsis of either patient or agent: šul-gi lú níĝ lu-lu-me-en Shulgi. (a man) making all (things) pleasant am I. Diakonoff (1982) 317): "Verb roots with vowels in final position are rarely written plene in the infinitive because it is not necessary to do this to avoid confusion. or agent can be pronominalized. 54 2:15/18 Sarg. OS) Elliptical for <lú/ùĝ> <níĝ> íl "thing-carrying personnel" mu nu-ĝál-la-ka mu hé-ĝál-la In a year of (things) not being present (i. indirect object.) {íl+(e)ne+Ø} {nu+ĝál+a+ak+a} {dùg-dùg+e+ĝu10+a} húl-húl-le-ĝá du10-du10-ge-ĝá About my causing (people) to rejoice and making (things) pleasant (Šulgi E 33 Ur III) nin-men-na-ke4 tu-tu al-ĝá-ĝá Ninmena was setting up birthing (people/animals) (Hymn to the Hoe 27 OB) uri5ki-ma ur-bé úr bàd-da si-im-si-im nu-mu-un-ak-e The dogs of Ur no longer sniff (things) at the base of the city wall (Lament over Sumer and Ur 350 OB) lá-a-ne-ne nu-ta-zi From their surplus (items) it has not been deducted (Nik I 271 4:1 OS) {lá+a+(a)nene(+ta)} d {tud-tud+Ø) 2) When a marû participle serves as the regens of a genitive construction.Some other examples: PN ugula íl-ne PN nu-bànda íl-ne PN. the rectum represents the implicit subject or patient of the participle: ùnu-dè du9-du9 dugšakir-ra-ka-na u4 im-di-ni-ib-zal-e The cowherd spends his day in his churning of the churn (Enki and the World Order 30 OB) zi-zi šú-šú tigi za-za-am-za-am-ma-ka ki bí-zu-zu-a About how I always knew the places for the raising and lowering of (the strings of) the tigi and zamzam instruments (Šulgi E 34 Ur III) 3) A subject (patient). of plenty) (Edzard. dwelling in it was not fitting for it (Lament over Sumer and Ur 307 OB) 60 še gur ki dumu In-si-naki-ke4-ne-ta ù še tuku-ni 60 gur barley from the citizens of Isin and the barley which is being held by him (TCS 1.e. 198:3-5 Ur III) * * * * * * {tuš+e+bi+Ø} {tuk+e+(a)ni+Ø} 132 . SRU No. of want) A year of (things) indeed being present (i. the foreman/overseer of porters (DP 140 3:2 & 142 3:3f. represented in the participial construction by a possessive pronoun: é-gal-la-na níĝ-gu7 la-ba-na-ĝál tuš-ù-bi nu-ub-du7 In his palace there was nothing for him to eat.e. ) ama nu-tuku-me ama-ĝu10 zé-me a nu-tuku-me a-ĝu10 zé-me I am one having no mother .you are my mother! I am one having no father . guard(s) > porter(s) > > > > sleeping quarters residence food item gift It is also the stem seen in periphrastic compound verbs of the type ir si-im .du11 "to do hand-touching" > "to decorate.a5 "to perform ground-rubbing" > "to prostrate oneself" or šu-tag .you are my father! (Gudea Cyl A 3:6-7 Ur III) {nu+tuku+me+(e)n} {zé+me+(e)n} {ba+me+(e)š} du11-ga zi-da inim ki-bi-šè ĝar (Nudimmud) he of the righteous command. Examples: é-igi-íl-eden-na Temple lifting (its) eye over the steppe (Ent 16. 39:16-17 Sarg.a5 "to perform scent-sniffing" > "to smell" ki su-ub . for example: apin-ús gir4-bil ĝír-lá gu4-gaz igi-nu-du8 kù-dím lú-éš-gíd(-k) lú-kaš4 lú-zàh (lú-)má-gíd munu4-mú àga-ús(-ne) íl(-ne) ki-nú ki-tuš níĝ-gu7 níĝ-ba plow follower oven heater knife wearer ox smiter not-seeing (person) silver fashioner person of cord pulling running person fleeing person boat pulling (person) malt grower crown follower(s) <load> carrier(s) lying place sitting place eating thing alloted thing > > > > > > > > > > > plowman oven tender butcher cattle slaughterer blind(ed) worker silversmith field surveyor courier fugitive boat tower maltster > soldier(s). MAD 4 No. including many different occupation terms." This kind of bare hamţu participle is common both in ordinary contexts and particularly in earlier literary texts. where it conveys an aspectual nuance that is difficult for us to distinguish from that of a marû participle. putting the word into its place (Šulgi D 316 Ur III) 133 .EXAMPLES FOR STUDY ORGANIZED BY GRAMMATICAL CONTEXT HAMŢU PARTICIPLE WITHOUT NOMINALIZING -a The bare hamţu stem is a component of numerous common and proper nouns. 3:7 OS = temple name) šu-níĝin 50 lú igi-níĝin dba-ú ga-kù munu4-kù ba-me They are a total of 50 supervisory personnel of Bau providing holy milk and malt (Genouillac TSA 5 13:1-4 OS) še hal-bi íb-ta-zi zíz ús-bi šà-ba ì-ĝál The (cost of the) distributing of the barley was deducted. and the (cost of the) treading(?) of the emmer is included in it (Gelb. loving justice like Suen (Ibbi-Suen B Segment A 41'-43' Ur III) su-ĝá á-sàg níĝ-hul ĝál-e a im-ma-ni-ib-tu5 In my body the evil-producing Asag demon took a bath (Man and His God 74 OB) {-b. fitting to be gazed at. imperfective aspect. heart of the gods. The compilers of the OB Lú lexical series were certainly aware of some sort of difference. ba. foundation of heaven and earth.diĝir-re-ne-er gub-bu gal zu-ĝá "In my knowing well (how) to stand (serving) before the gods" (Šulgi E 17 Ur III) en-líl temen an-ki-bi-da {ge(n)-ge(n)+e} šibir ùĝ ge-en-ge-né šu du8 su4-un su4-un-na-ni kur-ra dib-dib-bé me ní-te-na-ke4 kìri šu ĝál Enlil.resumes -e} d d d ur-saĝ usu ir9-ra me-galam-ma šu du7 diĝir me-dím gu4-huš igi bar-bar-re-dè du7 {til+e. the translations follow the Akkadian. lord rendering decisions. making perfect the artful me's. marû participles in the following pairs of bilingual lexical entries (OB Lu B ii 7/9/23/25). like a wild cow that makes noise with its voice in drinking {Šulgi X 94 Ur III) mu en-nun-e dama-dsuen-ra ki-áĝ en eriduki ba-huĝ Year: Noble-High-Priest-Loving-Amar-Suen was installed as high priest of Eridu (Amar-Suen year 8 Ur III) i7-lú-ru-gú šà diĝir-re-e-ne en ka-aš bar níĝ-érim-e hul gig d suen-gin7 níĝ-si-sá ki áĝ Ordeal River. lú níĝ tuku lú níĝ tuku-tuku lú téš tuku lú téš tuku-tuku = = = = ša-a-ru-ú-um ra-a-šu-ú ša bu-uš-tam i-šu-ú ba-a-a-šu-ú rich. having mighty strength. holding onto (-e) the staff which makes the people secure. god having the limbs of a fierce bull. hating evil. (Hymn to Numushda for Sîn-iqišam 37 OB) gùd-bi-šè á dúb ì-ak-e Toward its nest it (Bird) does wing-flapping (Bird and Fish 111) {dúb+Ø V+ak+e+Ø) How this simple hamţu-stem participle without suffixed -a differs in meaning from that of the marû participle is not clear. apart from what may deduced in theory from the difference in perfective vs. making obeisance to his own divine powers (Šulgi E 1-4 Ur III) nin-a-zu gu4-sún naĝ-a ad-ba gù di-dam Ninazu.resumes -e} a-a-zu dsuen-gin7 zi ti-le ki ba-e-a-áĝ Hero. Compare the use of different Akkadian expressions to render hamţu vs. like your father Suen you loved to enliven life. god. prosperous one who acquires one who has dignity very decent(?) 134 . whose beards pass over the mountains. e. OS) 5. who built the Eninnu temple (Ukg 10-11 4:5-9 OS) en-mete-na énsi lagaski ĝidri šúm-ma den-líl-lá ĝéštu šúm-ma den-ki-ka šà pà-da dnanše Enmetena. father who made everything numerous" (Ur-Ninurta A 30 OB) Unless the first participle is simply not nominalized note here that a single -a suffix appears only on the last of two participles. including many occupation names and proper nouns.DU)-ra-ne ì-gu7 5 g. used) by Urdu the š. given the scepter by Enlil.0 še gur-saĝ+ĝál [... See also the earlier lesson on relative clauses and the nominalizing suffix -a.HAMŢU PARTICIPLE WITH NOMINALIZING -a iri-ka-gi-na lugal lagaski lú é-ninnu dù-a Irikagina. chosen by the heart of Nanshe (Ent 28-29 5:19-27 OS) udu gu7-a ur-du6 šùš-kam It is a sheep eaten (i. governor of Lagash.. given understanding by Enki. the marû participle is a ubiquitous 135 .] é-gal-ta erx(DU.-measures of barley were eaten by the [.] who came from the palace (Nik I 133 3:1-5 OS) mu nu-bànda ù gàr-du damar-dsuen kaskal-ta er-ra-ne-šè (Small cattle) for the overseers and soldiers of Amar-Suen who had come in from the road (Legrain. the man of the temple building (Gudea Statue A 3:7-4:2 Ur III) an numun è a-a níĝ-nam šár-ra An. MARÛ PARTICIPLES WITHOUT NOMINALIZING SUFFIX -a The bare marû stem is a component of numerous nouns. king of Lagaš..0. who made the seed come forth. for example: balaĝ-di(d) ga/ì-gùr-ru lú-búr-ru lú-kaš4-e sig4-dím-me umbin-ku5-ku5 zi-du é-me-ur4-ur4 i7-lú-dadag i7-NINAki-šè-du nin-ba-ba nin-lú-ti-ti harp doer milk/oil carrier person who reveals it person doing running brick fashioner nail cutter righteous goer > > > > > > > harpist milk/oil carrier dream interpreter runner brickmaker manicurist righteous person Temple That Gathers (All) The me's (or plural reduplication?) River That Purifies (<*dag-dag) a Person (= the ordeal river) Canal Going to NINA Lady Who Allots (PN) Lady Who Makes A Person Live (PN) Over and above its use in such nominal formation.-official (Nik I 150 2:4ff. TRU 334:2-3 Ur III) {erx+a+(e)ne+e) {er+a+(e)ne+šè} gù-dé-a lú é dù-a-ka nam-ti-la-ni mu-sù She shall prolong the life of Gudea. his instrument which has a (famous) name. the lapis lazuli house. the holy chamber.and. especially common Marû participles have both verbal and nominal characteristics. MARÛ PARTICIPLES FOLLOWED BY POSSESSIVE OR DEMONSTRATIVE PRONOUNS in literary contexts. the collection of the verbal preformpronominal suffixes naĝa4-mah dnanše ki-gub-ba-bé tag4-e-ba Upon that one leaving the great mortar of Nanše on its pedestal (Ean 62 side IV 3:7'-8' OS) šà-ge du11-ga eme-a ĝá-ra-a a-ba-a ĝá-gin7 búr-búr-bi mu-zu Of what is said by the heart or put upon the tongue. the place where you refresh yourself. which makes the sound echo (Gudea Cyl A 6:24-25 Ur III) kur-sig itima-kù ki ní te-en-te-en-zu é-kur é za-gìn ki-tuš-mah ní gùr-ru-zu As for your deep mountain. has known the interpreting of it? (Šulgi C 110-111 Ur III) {tag4+e+bi+a} {ĝar+a+ak} {aba+e} balaĝ ki-áĝ-ni ušumgal kalam-ma gišgù-di mu tuku níĝ ad gi4-gi4-ni {gi4-gi4-(a)ni+Ø} His beloved harp. Dragon of the Land. the exalted residence bearing fearsomeness (Enlil A 76-77 OB) u4-da u4 ug5-ge-ĝu10 nu-un-zu If she does not know my dying day (Dumuzi's Death 12 OB) gu4-si-dili-gin7 bàd e11-dè-zu-ù At your knocking down a wall like a battering ram (CBS 11553:5' Šulgi hymn.and productive feature of the Sumerian language. your Ekur. like me. 7:12-16 OS) é-ki-šuku-bi uz-ga èš ĝá-ĝá ne-saĝ-bi kur ĝeštin biz-biz-zé é-lùnga-bi i7idigna a-ù-ba ĝál-la-àm Its ration-place house a treasure establishing shrines — its first-fruits offerings a mountain always dripping wine — its brewery is one that produced a Tigris in its flood (Gudea Cyl A 28:9-13 Ur III) {di+Ø} {ten-ten+zu+e} {gùr+e+zu+e} {ug5+e+ĝu10+Ø} {e11(d)+e+zu+e) {du+(a)ni+e) {ím+e+d+(a)ni+e} {ĝá-ĝá+Ø} {biz-biz+e+Ø} {ĝál+a+m+Ø} 136 . at his having to hurry he is a falcon (Enmerkar and Ensuhgirana 40 OB) MARÛ PARTICIPLES FOLLOWED BY ADVERBAL CASE MARKERS Absolutive Subject -Ø ki-sur-ra dnin-gír-su-ka-ta a-aba-šè maškim di e-ĝál-àm From the Kisurra of Ningirsu to the Sea there existed one who performed the function of maškim (Ukg 4. cited PSD B 41 Ur III) kíĝ-gi4-a du-né šeg9-bar-ra-àm ím-mi-da-né súr-dùmušen-àm The messenger: at his going he is a wild ram. they can appear with or the personal plural marker -(e)ne in addition to case markers. In examples that follow it will be seen that they can be negated with ative nu. as nominal chain attributives. who. -ĝen = -me-en)) níĝ-GA buru5mušen dal-dal ki-tuš nu-pà-dè-dam Possessions are flying birds which cannot find a place to alight (Sumerian Proverbs 1.18 OB) ní-zuh é bùru-bùru gišig gub-bu za-ra suh-ù A thief. 12:41-44 OS) {tar+(e+)e} {Vm+b+n+kúš+e+ne) {-bi.u4-bi-ta inim im-ma gub-bu nu-ub-ta-ĝál-la Though in those days words standing on clay did not exist (Enmerkar and the Lord of Aratta 504 OB) u4-bi-ta <inim> im-ma gub-bu hé-ĝál im si-si-ge ba-ra-ĝál-la-am3 Though in those days <words> standing on clay existed. causing good seed to be born. he bound to the hand (Bird and Fish 6 OB) The late lexical list Nabītu I 17 describes ù-tu(d) as the marû stem of tu(d). pulling out door-pivots JCS 24.resumes -e} lugal-ĝu10 útug-mah kur-érim-ĝál-la saĝ sahar-re-eš dub-bu ki-bal-a ša5-ša5 e-ne-er mu-na-an-šúm en dnu-nam-nir-re To my king: a lofty mace which in the evil-doing land heaps up heads like dirt and smashes the rebel land Lord Nunamnir did give (Ur-Namma B 52-54 Ur III) šeš-kal-la ù en-ú-bi-šu-e še ĝiš ra-ra ì-til Šeškala and Enubišu have finished threshing the barley (SET No. 106:3 OB Emesal: ga-ša-an = nin. whose flood is pure. 107 No. 137 . suh+e+Ø} šeš-a-ne-ne ku-li-ne-ne. you are the honey of the mother who bore you (Inana-Dumuzi C 22) kur gul-gul ga-ša-an é-an-na-ĝen I am the mountain destroyer. who stands (firm) in its strength (Šulgi A 42 Ur III) nin9 mul-mul làl ama ugu-za-me-en Sparkling sister. let it bring constanting flowing water for Nanše (Ukg 4-5. 265:1-4 Ur III) {ra-ra+Ø} {ù-tu(d)+Ø} a zi-[šà]-ĝál numun-zi ù-tu šu-šè im-ma-ab-lá Lifegiving water. burrowing into houses. Absolutive Patient -Ø i7 kù-ga-am6 šà-bi dadag-ga-am6 dnanše a zal-le hé-na-tùm A canal which is holy. èn tar-re im-mi-in-kúš-ù-ne His brothers and friends exhaust him (-n-) with questioning (-bi-) (Lugalbanda and Enmerkar 225-226 OB) Whether the stem of the verb is marû or hamţu is not clear. 1:12) {mul-mul+Ø} {gul-gul+Ø} {dal-dal+Ø} {bùru-bùru+Ø. either way an instrumental ergative -e is required. gub+e+Ø. putting clay (tablets) into clay (envelopes) certainly did not exist (Sargon Legend 53 OB) {gub+e+Ø} {si(g)+si(g)+e+Ø} {nu+kúš+e+Ø} piriĝ nam-šul-bi-ta nu-kúš-ù ne-ba gub-ba-me-en I am a lion never relaxing in its vigor. making doors stand (open). queen of the Eanna temple (Eršemma No. udu šum-šum-e dumu-ni hé-en-šum-e May the man (elliptical <lú>) who slaughters cattle slaughter his wife. ghee.. renders the verdicts of the country for that place (Šulgi X 142-143 Ur III) (or perhaps just hamţu {zu+e}?) d {du-du+e} {zu+e+e} {du. declared: "The boundary levees of Ningirsu and Nanše are mine!" (Ent 28 4:19-29 OS) Ergative -e falls only on the 2nd participle. no tax is imposed (Ur-Namma C 80 Ur III) {íl-íl+e} 138 . may the man (<lú>) who butchers sheep butcher his child! (Curse of Agade 237-238 OB) Locative-terminative -e buru14-mah-ĝu10 ní-bi íl-íl-i níĝ-ku5 nu-ak-e Upon my huge harvest.. {utud+e)} nin en ù-tu-dè lugal ù-tu-dè dnin-men-na-ke4 tu-tu al-ĝá-ĝá Queen who gives birth to en's. The participle tu-tu lacks an overt patient. 13-17 Ur III) {nu+šilig+e+Ø} {búr-búr+bi+Ø} šà-ge du11-ga eme-a ĝá-ra-a a-ba-a ĝá-gin7 búr-búr-bi mu-zu Who knew. Cyl A 19:26-27 Ur III) ištaran ki-en-gi-ra šà-ta níĝ-nam zu-ù di kalam-ma ki-bi-šè ì-kud-re6 He. This sort of ellipsis is especially common in literary contexts. {tu(d)-tu(d)+Ø} Ninmenna(k) establishes birthing (Hymn to the Hoe 26-27 OB) Conversely. and grapes never cease at his place of offerings (Amar-Suen 11. at the end of the ergative nominal chain. the revealing of what has been spoken by the heart or put into upon the tongue (Šulgi C 110-111 OB) Ergative -e lú ninda-tur ka-a gub-ba-gin7 du-du-e nu-ši-kúš-ù Like a man who has put little food in his mouth.GÁNA kar-kar níĝ-érim du11-du11-ge {Vm+bi+n+du11} e-ki-sur-ra dnin-ĝír-su-ka e-ki-sur-ra dnanše ĝá-kam ì-mi-du11 Il.du+e} sig-ta du igi-nim-ta du-e á-šed-bi-šè ní hé-eb-ši-te-en-te-en The one coming from above or from below refreshes himself under its cool branches (Šulgi A 32-33 Ur III) Note that the ergative marker appears only on the second participle. raising itself up.. the Ishtaran of Sumer who knows everything from birth. doer of evil things. taker of fields. constantly going about (still) does not tire him (Gudea. {kar-kar.du11-du11(g)+e} íl énsi ummaki(-a) a-šà. the ruler of Umma. at the end of the chain. the lord who decides the fates. here ergative -e appears three times at the ends of parallel chains. unless the -e on utud+e is the marû formative. likewise in the following example. d nu-nam-nir en nam tar-tar-re kur níĝ-daĝal-la-ba mu-zu im-mi-in-mah Nunamnir. like me. for which one may posit an elliptical <lú>. made your name great in the wide lands (Hymn to Numushda for Sin-iqišam 42-43 OB) {tar-tar+e} {gaz-gaz+e} gu4 gaz-gaz-e dam-ni hé-en-gaz-e. who gives birth to kings.é làl ì-nun ù ĝeštin ki sískur-ra-ka-na nu-šilig-ge mu-na-an-dù The house (where) syrup. at her having sat down upon the dais. 222 No.me-li-e-a u4-dè šu-ni-a im-ma-ši-in-gi4 u4 úru gul-gul-e šu-ni-a im-ma-ši-in-gi4 šu-ni-a im-ma-ši-in-gi4 u4 é gul-gul-e Woe. No. 48:1 Ur III) 1 máš-ga má-gan ba-úš šà ù-tu-da 1 suckling Makkan kid. holding onto the staff which makes the people secure (Šulgi E 1-2 Ur III) {ge(n)-ge(n)+e} ì-ne-éš dutu u4-ne-a dutu an-na gub-bé-e Now Utu. the distant lands. as Utu was standing in the sky. he has handed it over to the house-destroying storm (Lament over Destruction of Sumer and Ur 175-177 OB) u4-bé á áĝ-ĝá kur-ra-ke4 si sá-sá-e an hé-da-húl ki hé-da-húl On that day. on this day. (Enki and Ninhursaĝa 50-51 OB) The plene writing suggests the stem is marû. (Enmerkar and Ensuhgirana 49 OB) The locative-terminative here has adverbial force. foundation of heaven and earth. possibly plural reduplication) {du+gin7} {zuh-zuh+gin7} 139 . died during birthing (JCS 28. Or 54 (1985). The locativeterminative here has adverbial force. 28 Ur III. he has handed it (the city) over to the storm. the seat of splendor. ur-bar-ra sila4 šu ti-a-gin7 ul4-ul4-le im-ĝen Like a wolf capturing a lamb he came quickly. may Earth rejoice! (Incantation to Utu 260-261 OB) d {gul-gul+e} (sá-sá+e} en-líl temen an-ki-bi-da šibir ùĝ ge-en-ge-né šu du8 Enlil. Locative -a 1 sila4 ù-tu-da ba-úš 1 kid. he has handed it over to the city-destroying storm. 91:1-2 Ur III) ki-bala kur-bad-rá è-a-né sùh-sah4-a u4 mi-ni-ib-zal-zal-e At his having gone forth into the rebel lands. SACT 1. mother Nintu. over the correct performing of the orders of the netherworld may Heaven rejoice. the seat that makes things abundant (Hymn to Nintu-Aruru 40 OB) {lu-lu+a} MARÛ PARTICIPLES FOLLOWED BY ADNOMINAL CASE MARKERS OR THE COPULA dùrùr dili du-gin7 Like a donkey stallion going alone (Šulgi A 74 Ur III) mušen téš-bé nunuz zuh-zuh-gin7 Like birds stealing eggs together (Civil. died during birthing (Kang. he spends his days in the crunching-of-battle (Inana E 25) d {gub+e+e} {utud+a} nin-tu ki-tuš [giri17]-zal-la ki-tuš níĝ lu-lu-a ama dnin-tu bára tuš-a-né Nintu. being a man who makes things abundant.= variant) nu-zu-ù-ne um-ši-húl-húl-e-eš The ones who do not know <anything> shall greatly rejoice (Uruk Lament E 28 OB) ki-bi-šè ku4-ku4-da bí-in-eš en nam tar-re-ne The lords decreeing destinies comanded that they (the looted treasures) should be brought back into their places (Nippur Lament 274 OB) MARÛ PARTICIPLES FOLLOWED BY THE NOMINALIZING SUFFIX -a i7-NINAki-du-a The Canal Going to NINA (Ukg 1 3:6' OS) lugal ninda sa6-ga gu7-gu7-a šuku-re <šu> im-ma-an-dab5 The king who used to eat fine food (now) took rations (Lament over Destruction of Sumer and Ur 304 OB) lú inim-inim-ma lú èn-du búr-búr-ra A man of incantations. (Lament over Destruction of Sumer and Ur 335-336 OB) (-ù. 75 4:1-4 OS) {è(d)-è(d)+(e)ne+e} {nu+zu+e+(e)ne+e} ì-bi lú ì nu-zu-(ù-)ne ì-im-du9-du9-ne Its butter was being churned by men who did not know butter. Read the verb alternately as uru4ru) an ki téš-ba sig4 gi4-gi4-àm Heaven and earth were crying out together (NFT 180 2:2 OS) ĝiš-hum-bi é-gal i7-mah-ha me-lám gùr-ru-àm Its (the boat's) cabin was like a palace in a great river.= -e} {Vm+ba+n+dab5+Ø} {búr-búr+a} {nu+zu+e+(e)ne+Ø} {tar+e+(e)ne+e} 140 . a man who interprets songs (Letter of Igmil-Sîn to Nudimmud-saga 8 OB) {gu7-gu7+a+e} {ba. bearing divine radiance (Šulgi D 359 Ur III) lú ĝá ì-šub-ba dnanše-ka sig4 dím-me-me They are men fashioning bricks in the brickmold shed of Nanše (DP 122 2:4-5 OS) d {ur11+e+ak+e} {gi4-gi4+(a)m+Ø} {gùr+e+(a)m+Ø} {dím+e+meš} Šul-gi lú níĝ lu-lu-me-en ninda ĝiš ha-ba-ni-tag {lu-lu+me+(e)n} I. offered bread there (Šulgi A 55 Ur III) {sá+e+me+(e)n} an lugal-da bára an-na-ka di si-sá-e-me-en With An the king on the dais of An I administer justice correctly (Enki and the World Order 74 OB) MARÛ PARTICIPLES WITH PERSONAL PLURAL -(e)ne ninda-bi saĝ-apin apin-dur surx(ERIM) è-è-dè-ne šu ba-ti Those breads were received by the plow-leaders bringing in the teams' cable-plows (VS 14. Shulgi.47 OB.lú a-šà ur11-ru-ke4 a-šà hé-ur11-ru Let the man of field plowing plow the field (Proverbs 4. Nintu. O youth. her city of noble citizens. whose name no one can decipher? (Gudea Statue B 8:48 Ur III) nin an-ki-a nam tar-re-dè dnin-tu ama diĝir-re-ne-ke4 The lady. to prolong your days upon my holy lap filled with life (Ur-Ninurta A 83f.47 OB) d {ergative -e} (ergative -e} {ur11+e+ak+e} {su-ub+e+d+ak+e} {nu+pàd+e+d+(a)m} níĝ-GA buru5mušen dal-dal ki-tuš nu-pà-dè-dam Possessions are flying birds which cannot find a place to alight (Proverbs 1. when the exalted crown and throne of kingship had descended from above (Flood Story Segment B 6-7 OB) {bir-bir+e+a+Ø) ki-en-gi ki-uri bir-bir-re-a ki-bi-šè bí-in-gi4-a He who restored Sumer and Akkad which had been repeatedly scattered (Formula for Hammurapi Year 33 OB) MARÛ PARTICIPLES WITH MODAL ELEMENT /d/ suen mu-ni lú nu-du8-dè Suen.. when she was to decide fate in heaven and earth. of kingship was about to descend from above. mother of the gods.. was ordered to be plundered (Lament Over the Destruction of Sumer and Ur 179) {-b.= -e} d {bar+e+d+e} {AK+e+d+e} {si+a+ĝu10+e} 141 . (Gudea Statue A 3:4-6 Ur III) lú a-šà ur11-ru-ke4 a-šà hé-ur11-ru lú še šu su-ub-bu-da-ke4 še šu hé-eb-su-ub-bé Let the man of field plowing plow the field Let the man who is to collect (esēpu) barley collect the barley (Proverbs 4. OB) ur-dninurta lugal-e di-bi pu-úh-ru-um nibruki-ka dab5-bé-dè bí-in-du11 Ur-Ninurta the king ordered that this case was to be tried in the assembly of Nippur (OB Homocide Trial 17-19) ki-nu-nir-šaki iri nam-dumu-gi7-ra-ka-ni kar-kar-re-dè ba-ab-du11 Kinunirša. pure me's resplendent (Enlil's Chariot = Išme-Dagan I 5 OB) úr-kù nam-ti-la si-a-ĝu10 u4-zu sù-sù-dè šul den-líl-le é-kur-ta á-bi mu-un-da-an-áĝ Enlil instructed him from the Ekur.[u4 x] x nam-lugal-la an-ta è-dè-a-ba (è(d)+e+a+bi+a) {è(d)+a+bi+a) men-mah gišgu-za nam-lugal-la an-ta è-a-ba On that [day] when the .18 OB) di-ku5 ka-aš bar-re-dè igi mi-ni-in-ĝál lul zi-bi mu-zu She (Ninegala) has set her eye upon (-e) the judge about to render the decision and will make known the false and the true (Nungal A 37 OB) INFINITIVE {√(marû)+d+e} WITHOUT NOMINALIZING -a 1) Dependent upon a finite verb of speaking or commanding me-kù-sikil-zu pa-è kè-dè á-bi mu-un-da-áĝ He instructed him to make your holy. 130ff. JCS 20.= -e} {ba. DAS No. wife of PN2. Ur III) 1 ma-na kù-luh-ha igi-nu-du8-a sa10-sa10-dè PN. SRU 42 1:1-5 OS) 1 udu-nita PN níĝ gu7-dè ba-de6 PN took 1 ram for eating (lit.) PN ù PN2 su-su-dè PN3-ra ba-an-ši-ku4-re-eš PN and PN2 were made liable to PN3 for replacing it (this money) (Steinkeller. reduplication} (-ši. 197:6 Ur III} Compare the following exactly parallel passage: lú-zàh dab5-dab5-dè ĝen-na (Rations for PN) who had gone to seize runaways (Lafont.2) More loosely dependent upon another finite verb tukumbi lú lú-ù kiri6 ĝiš gub-bu-dè ki-ĝál in-na-an-šúm If a man gave uncultivated land to another in order to plant an orchard with trees (Code of Lipit-Ištar 12:50-53 OB) gaz-dè ba-šúm He was given over to be executed (Durand.:59 OB) PN PN2-ra su-su-dè ba-na-gi-in PN was certified as having to replace it for PN2 (NSGU 188:12'-14' Ur III) šu-tur-bé mu-bé šu uru12-dè ĝèštu hé-em-ši-gub If he shall set his mind to erasing the name on this inscription (Gudea Statue B 9:12f. 125:6 OB) gaz-dè ba-an-šúm-mu-uš They gave him over to be executed (AnBib 12. for a thing to be eaten) (Selz FAOS 15/1 157 1:1ff. OS) bar-udu-siki PN-e ZUM kè-dè e-ne-lá PN weighed out to them wool sheep fleeces to be combed (Selz. 199:18 Ur III) {pl. 95 4:1-2 OS) gù-dé-a é dnin-ĝír-su-ka hur-saĝ nu11-bar6-bar6-ra-gin7 ù di-dè ba-gub Gudea made the temple of Ningirsu stand to be marveled at like a mountain of white alabaster (Gudea Cyl A 24:17ff. 124 OB) lú-zàh dab5!-dè ĝen-na (Rations for PN) who had gone to seize a runaway (Lafont.= -e} 142 . RA 71. dam PN2-ke4 ba-de6 PN. took 1 mana refined silver to buy an iginudu-slave (Edzard. DAS No.= -e} {ba. Sales Documents 330:12-14 Ur III) ár kè-dè la-ba-ab-du7-un You are not fit for doing praising (of yourself) (Dialogue 2:59. FAOS 15/2 No. to inspect the good first day. on the day of rites (Iddin-Dagan A 169-175 OB) gù-dé-a é-ĝu10 dù-da ĝiskim-bi ga-ra-ab-šúm Gudea. the case marker that could reveal it is placed only on the last infinitive. to perfect the me on the day of the new moon. he put down a resting place for my lady at the new year. Princeton 522:3-5 Ur III) With this compare the following: 143 . Ur III) {tùm(u)+d+a+ak+šè} mu kišib lugal-é-mah-e tùm-da-šè kišib lú-igi-sa6-sa6 Seal of Lu-igisasa instead of the seal of Lugal-emahe which has to be brought (Sigrist. that my glory be proclaimed in all the lands. (Šulgi A 36-38 Ur III) {nu+šub+e+d+e} {tar+e+d+ani+e} nam kur-kur-ra tar-re-da-né u4-saĝ zi-dè igi kár-kár-dè u4-nú-a me šu du7-du7-dè zà-mu u4 biluda-ka nin-ĝu10-ra ki-nú ba-da-an-ĝar As he was about to (or that he might?) decree the fate of all the lands. or the boundary ditch of Nanše. 38 2:2f. that my praises be performed in the nation. so that no one might enter his house (to take it) he established (his) freedom (Gudea Statue R 2:6-7 Ur III) {kudr+e(+d)?} {gin+e+d+e} 20 ĝuruš u4-4-šè e kuru5 gi-né-dè 20 workers for 4 days to cut and make secure ditches (Oberhuber Florence 29 Ur III) (kudr here may feature a concealed /d/.3) Adverbial clauses (usually marked with -e) independent of a main verb ù níĝ en-na ĝál-la-aš é-a-na lú nu-ku4-ku4-dè ama-ar-gi4 mu-ĝar!? Moreover. regarding whatever property of the lord that may exist. I will give you the sign of the building of my house (Gudea Cylinder A 9:9-10 Ur III) d {dù+e+d+ak} {Emesal for ha-lam+e+d+e} inim den-líl-lá zi-da gel-èĝ-dè gùb-bu zu-zu-dè en-líl lú nam tar-tar-re-dè a-na bí-in-ak-a-ba To make the word of Enlil destroy on the right and make it known to the left..) mu-ĝu10 u4 ul-li-a-aš ĝá-ĝá-dè ka-ta nu-šub-bu-dè ár-ĝu10 kalam-ma a5-a5-dè ka-tar-ĝu10 kur-kur-ra si-il-le-dè In order that my name be established for distant days and that it not fall from the mouth.GÁNA tùm-dè an-ta bal-e-da . others read as a finite verb am6-ta-bal-e-da) {AK+e+d+a+ak+šè} 2/30 4 sìla ì-ĝiš mu ì túg-gé kè(AK)-da-šè 2/30 (gur) 4 silas of sesame oil for oil that is to be put on cloth (CT 5. in order to take away fields (Entemena 28-28 6:9-16 OS. OB) INFINITIVE FOLLOWED BY NOMINALIZING -a OR LOCATIVE -a Some infinitives ending in /a/ can easily be understood from their syntax as relative clauses featuring the nominalizing suffix -a: lú ummaki-a e-ki-sur-ra dnin-ĝír-su-ka-ka e-ki-sur-ra dnanše-ka {bal+e+d+a} a-šà. Enlil.. what did he do? (Lament of the Destruction of Sumer and Ur 164f. he about to determine all the fates. den-líl-le hé-ha-lam-me May Enlil destroy the man of Umma who may come from above across the boundary ditch of Ningirsu. 229:5-7 Ur III) nam é dù-da lugal-na-šè ù ĝi6-an-na nu-um-ku4-ku4 For the sake of the house that is to be built of his king he does not sleep (even) at midnight (Gudea Cylinder A 17:7-8 Ur III) {tùm(u)+a+ak+šè} {dù+e+d+a} Other infinitives show a locative suffix -a. looked upon (Eridu Lament A 86-87 OB) INFINITIVE ENDING IN A COPULA "Infinitives" featuring copulas are very common among the laconic remarks found in economic and administrative texts.mu kišib lugal-níĝ-lagar-e tùm!-a-šè kišib a-gu ì-ĝál Instead of the seal of Lugal-niĝlagare. Princeton 1. We must assume that since all the following feature relative clauses. they are marked with a nominalizing -a in addition to a final (elided) locative -a: mu šar-kà-li-šarri púzur-eš4-tár šagina é den-líl dù-da bí-gub-ba The year that Šar-kali-šarri stationed Puzur-Eštar the general at the temple of Enlil which was to be built (Goetze.ÚS. the seal of Agu was produced (Sigrist. the people of Simaški and Elam.SÁ kè(AK)-da On new year's day at the festival of Bau when the betrothal gifts are to be made (Gudea Statue E 5:12-13 Ur III) {tar(-tar)+e+d+a) u4 a[n-k]i-a nam tar-[(tar-)re-d]a On the day when (all) the fates were to be decided in heaven and on earth (Gudea Cylinder A 1:1 Ur III) u4 diĝir-zi-da du-da On the day when the righteous god was to come (Gudea Cylinder B 3:25) (bí. JAOS 88 (1968) 56 Sarg. e. which will be brought. the destroyers. dah-dam gi-né-dam kud-ru-dam su-su-dam tùmu-dam tur-re-dam ze-re-dam maš ĝá-ĝá-dam kišib ra-ra-dam (interest) is to be added (testimony) is to be confirmed (reed) is to be cut (grain) is to be replaced (item) is to be taken (money) is to be subtracted (tablet) is to be broken (loan) is to bear interest seal is to be impressed {gi(n)+e+d+am} {kudr+e+d+am} 144 . 24:8-9 Ur III) Though the patient inim is often omitted with this compound verb. 86-87 No. dub-šen-kù lú igi nu-bar-re-da lú SUki elamki lú ha-kam-ma-ke4 [igi i-ni]-in-bar The holy treasure box.= -a} u4 zà-mu ezem dba-ú níĝ-MÍ. upon which no person should look.= -a} kù-bi ki-su7-ta šúm-mu-da <inim> bí-in-du11 "That silver is to be given from the threshing field." he said (Çiğ et al. which should be distinguished from the nominalizing element -a in more careful analysis of texts..g. the original locative rection is normally preserved in the nominal and verbal chains. ZA 53.) (bí. while the repeated passage on the clay "envelope" covering the tablet shows the same infinitives ending in copulas: itu šu-numun-a saĝ-šè lá-e-dè (envelope: lá-e-dam) tukumbi nu-lá 2-àm tab-bé-dè (envelope: tab-bé-dam) mu lugal ì-pà To pay it (the silver) in the month Šu-numun-a. AWL 24 OS) Compare the following parallel where the unusual terminative is replaced by the normal locative-terminative: še-numun še anše gu7-dè PN-ra PN2-e ĝanun-gibil-ta e-na-ta-ĝar PN2 set out for PN from the new storehous seed barley and barley to feed the donkeys (Bauer. Ur III) POSSIBLE INSTANCES OF INFINITIVES/PARTICIPLES FEATURING A CONCEALED /d/ {gu7+e+d+šè} še-numun še gu4 gu7-šè PN-e GN-šè ba-de6 PN took away to GN seed barley and barley for feeding the oxen (Bauer. Catalogue 534:4-9 Ur III) (i7-zu) i7-mah ki-utu-è igi nu-bar-re-dam (Your river) is a great river at the place of sunrise. Eames Collection P1 7-11 Ur III) A few further examples: {hal-ha(l)+d+am} en-en-né-ne-šè hal-ha-dam (The offerings) are to be distributed to all the (ancestral) lords (DP 222 12:1'-2' OS) ig gišeren-na é-a šu4-ga-bi diškur an-ta gù-nun di-da-àm Its doors of cedar that stood in the temple were (like) Iškur (the rain god) making a loud noise from the sky (Gudea. AWL 21 OS) {gu7+e+d+e} 145 . even though the syntax properly favors one or the other form. That the difference between the two constructions was felt to be slight is suggested from the following Ur III passage where the text has two infinitives ending in -e. (Gudea Cyliner A 16:18f. it is to be replaced (Fish. to double it two-fold. Cylinder A 26:20-21 Ur III) šimna4 é-a šu4-ga-bi é gudu4 kù a nu-šilig5-ge-dam Its stone basins which stood in the temple were (like) the holy house of the lustration priest where water must never cease (Gudea. the governor. and that if he has not paid it. (so) he swore by the name of the king (Oppenheim. Cylinder A 29:5-6 Ur III) lugal-hé-ĝál-e ezem-mah-šè tùm-mu-dam tukum-bi nu-mu-de6 sú-sú-dam It is to be brought in to the Great Festival by Lugal-heĝal. if he has not brought it in (by then). dependent on a verb of speaking.Frequently in economic texts one sees copular infinitives varying with an ordinary infinitive ending in locative-terminative -e. which is not to be looked upon (Ibbi-Suen B Segment A 24' Ur III) lú é lugal-na dù-dam énsi-ra To the person who was about to build his king's house. at the beginning(?). igi utu-è ki nam tar-re-ba Facing sunrise. nu+šub+e+d+e} songs) not pass by the ear. with -ni. both then followed by pronominal suffixes. These constructions form simplified kinds of temporal relative clauses. p. the exalted shrine (Enlil's Chariot 2 OB) {kudr+e+d+Ø} é-e kur gišeren kuru5 nu-me-a ha-zi-in-gal-gal ba-ši-in-dé-dé As for the temple.as well?) only to the last of the two infinitives at the end of the chain. See Edzard 2003.resuming -a. one built on the hamţu stem with nominalizing -a suffix. that the houses would shake and the storehouses would be scattered (Curse of Agade 84-86) THE PRONOMINAL CONJUGATION The pronominal conjugation refers to hamţu or marû participles conjugated by means of possessive pronouns. especially marû forms. though it was not a mountain where cedar was to be cut. {gin+e+d} {gam+e+d+e) kalam gi-né sig-nim gam-e-dè In order to make the land just and subdue the lower lands (Ibbi-Suen 1-2 1:12-13) eger-bé níĝ-na-me nu-ša6-ge-dè {tuk4+e+d} {di+d+e} é tuk4-e èrim ság di-dè d na-ra-am-dsîn máš-ĝi6-ka igi ba-ni-in-du8-a {ba. the other built on the marû stem with the modal /d/ extension and nominalizing -a suffix.é-a-ni dù-ba mu-na-du11 He spoke to him about that building of his house (Gudea Cylinder A 1:19 Compare the following parallel with explicit /d/: é-a-ni dù-da mu-na-du11 He spoke to him about the building of his house (Gudea Cylinder A 4:20) In this and the preceding line the verbal chain abbreviates an underlying verb <inim> mu-na-ni-in-du11. he poured out (molten bronze in the form of) great axes against it (Curse of Agade 112-113 OB) urudu é dù máš-a nu-mu-un-dè-ĝál He could not produce a "must-build-a-temple" in the extispicy (Curse of Agade 95 OB) (èn-du-ĝu10) So that (my (Šulgi X 57 In this and is suffixed {dù+e+d+Ø} ĝéštu-ge nu-dib-bé ka-ta nu-šub-bu-dè {nu+dib+e+d. They are mostly encountered in OB literary contexts. There are two paradigms.resumes -e} When Naram-Sîn had seen in a dream that after this nothing would be pleasant. not fall from the mouth Ur III) the next two references the case marker -e (and also -d. the place where the fates are to be decided (Gudea Cylinder A 26:3) inim nu-kúr-ru-da-na ù-tu-ba bí-in-du11 He commanded its having to be created with his unalterable word (Numušda Hymn for Sîn-iqišam A 47 OB) {dù+e+d+bi+a) {dù+e+d+a) {tar+e+d+bi+a} {nu+kúr+e+d+ani+a} {utud+d+bi+a} {dím+e+d+zu+a} é-kur èš-mah-a-na dím-me-za bí-in-du11 (Enlil) spoke about your having to be fashioned in his Ekur. 137-142 and Thomsen 146 . ku4-ra-ĝu10(-ne) {kur9+a+zu+ne} 2 sg. "when. possibly šu nu-du11-ga-me. — {kur9+a+(a)nene} 3 pl. when she sat in the beer there was joy (Lugalbanda and Enmerkar 19-20 OB) ummaki e-bé bal-e-da-bé Whenever Umma might cross over this ditch (Ean 1 rev. sa-bíl-lá nu-ak(a)-me "despite our not having touched it. ku4-ku4-da-ĝu10-ne ku4-ku4-da-zu-ne ku4-ku4-da-ni ku4-ku4-da-bi — ku4-ku4-da-en-zé-en** — {kur9+kur9+d+a+ĝu10+ne} {kur9+kur9+d+a+zu+ne} {kur9+kur9+d+a+(a)ni} {kur9+kur9+d+a+bi} {kur9+kur9+d+a+enzen} *For this form. 5:37-38 OS) {bal+e+d+a+bi+e} {bal+bal+e+d+a+ni+e} lú muš-mir-te-gin7 bal-bal-e-da-né As for the man who was turning over and over like an m. or while. or is about to do something. forms was previously read as -dè and connected with comitative -da (so Thomsen). ku4-ra-zu(-ne) {kur9+a+(a)ni} 3 sg.§519-521 for their descriptions of these forms with examples and discussion of some unresolved questions.2 calls it an "old locational case marker. ku4-ra-ni {kur9+a+bi} i. 1 pl. ku4-ra-bi {kur9+a+me} 1 pl." while the marû forms are normally given present-future translations occasionally with modal ideas like obligation or necessity. based on a variant writing -né in a few eme-sal contexts. see Michalowski. when great winds produce scattering. p. with a locative meaning. Jagersma 2010 §20. ku4-ra-me* 2 pl. 2 sg. **For this form. reads it instead as -ne." "despite our not having plastered it. 3 sg. received it (the purchase price) (BIN 8. p. The paradigms are as follows: {kur9+a+ĝu10+ne} hamţu 1 sg. described as not attested by Edzard. i." Examples: PN ti-la-né šu ba-ti PN. The final suffix on 1st and 2nd sg. In 3rd person occurences the possessive suffixes generally hide a locative-terminative postposition used with adverbial force." in LSUr 241-242 OB. 352 2:1-3 OS) {tìl+a+(a)ni+e} {gub+a+(a)ni+e) kaš-a gub-ba-né níĝ giri17-zal kaš-ta tuš-a-né mud5-me-ĝar When she (the beer goddess) stood in the beer there was delight. Hamţu forms may usually be translated "when. Edzard 2003. This is probably an OB artifical creation. or has to do. for you indeed they build a milking house (Sheep and Grain 134-136 OB) 147 . The -ne suffix on 1st and 2nd person forms may have served the same function. Krecher. someone did something. Wilcke now identifies this -ne as the demonstrative suffix -ne in RAI 53 (2010) 29-32. 2 pl. cf. following J. JCS 30 (1978) 115:4 (OB literary letter).-snake (Šulgi D 173 Ur III) {du+d+a+bi+e} im-tur-tur-e iri-a du-da-bé im-gal-gal-e ság di-da-bé za-e é-ubur-ra ma-ra-an-dù-ù-ne When light winds go through the city. when he was still alive." Compare the adverbial expression dili-zu-ne 'you alone'. 3 pl. or while. ku4-ra-ne-ne marû 1 sg. something does." "without doubt cognate with the local prefix [ni] 'in'. described as not attested by Edzard. C. For example: mu lugal u4 ba-zàh-dè-na-ĝá NIR-da hé-a bí-in-du11 "By the king's name. while that ug-lion was chasing after the piriĝ-lion day did not pass. this (is) what he did to them (Lamentation over Sumer and Ur 72 OB) 148 . Confident translation of the stylistic nuance involved is often difficult. providing anomalous forms which confound attempts to create universal paradigms. No. TCS 1. on my day (when) I should flee may it be a felony. 115:2-6 Ur III) {ba+zàh+e+d+en+a+ĝu10+a} {tu(d)-tu(d)+a+zu+e} {b+Ø+dug4+a+ĝu10+e?} d en-líl sipa saĝ-gi6-ga-ke4 a-na bí-in-ak-a-bi Enlil. by its front it was a piriĝ-lion That piriĝ-lion chases after the ug-lion. 1:4-6 Ur III} PN še hé-ĝál bí-du11-ga-ĝu10 hé-na-ab-šúm-mu Let him give (the barley) to PN. Here the pronominal conjugation cooccurs with a finite verbal form to give an uncertain temporal nuance to the clause: eger-bi-šè ug-àm saĝ-bi-šè piriĝ-àm ug-e piriĝ im-sar-re piriĝ-e ug [im]-sar-re ug-e piriĝ im-[sar]-re-da-bé piriĝ-e ug im-[sar]-re-da-bé u4 nu-um-zal ĝi6-[u3-na] nu-ru-gu2 By its back it was an ug-lion. midnight was not opposed(?) (Enmerkar and Ensuhgirana 82-87 OB) Here." he declared (BE 3/1. combined marû and hamţu features produce an odd hybrid form: tu-tu-a-zu ha-ra-gub-bu-ne Let them stand by you while you are giving birth (Enki and Ninmah 36 OB) PRONOMINAL SUFFIXES ON FINITE VERBS Perhaps comparable with pronominal conjugation constructions are a certain class of finite verbal forms featuring possessive pronoun suffixes.še gur10-gur10-ru-da-zu-dè When you have to reap the barley (Farmer's Instructions 74 OB) {gur10-gur10+e+d+a+zu+dè} With the Sumerian locative-terminative postposition in this construction compare the use of the preposition ina "in" in the following Akkadian glosses to an OB Nisaba hymn: é-engur-ra ki tuš-a-né : a-gu-ur i-na wa-[ša]-bi-šu abzu eriduki-ga dù-dù-a-né : ap-sa-am e-ri-du i-na e-pe-ši-i-šu hal-an-kù šà kúš-ù-da-né : i-na ha-al-la-an-ku i-na mi-it-lu-ki-šu When he (Enki) took his place in the Engur Temple. when he had built all of the Abzu of Eridu as he was about to deliberate in the Halanku (Nisaba A 40-42) Finally. at(?) my having commanded "Let there be barley!" (Sollberger. While that piriĝ-lion was chasing after the ug-lion. the shepherd of the Black-Headed. OB literary texts are replete with neologisms. that ug-lion chases after the piriĝ-lion. a-e íb-si The subsistence field of the workers. 17) ) umuš-bi in-sùh-àm líl-e bí-in-sìg-ga-àm He confused its judgment. all of it (Eridu Lament C 26 OB) (b) (c) (a) u4 gištukul elam-a ba-sìg-ga The day when weapons struck in(to) Elam (BIN 9. Šū-Sîn inscription Ur III) ká silim-ma-bi gišal-e bí-in-ra He struck the Gate of Well-Being with (-e) a pickax (Curse of Agade 125 OB) é-kur za-gìn-na dù-a-ba gišal-e hé-em-mi-in-ra He struck with (-e) a pickax upon (-a) that lapis lazuli Ekur. has filled with (-e) water (ITT 2 3116 = FAOS 19 Gir16 Sarg. One must always remain patient and flexible when reading Sumerian! (a) li gišú-sikil kur-ra-kam izi-a bí-si-si Juniper. letter) giš (b) (b) (a) saĝ-du-bé tíbir im-mi-ra He caused (his) palm (-Ø) to strike upon (-e) their heads (JCS 21. he smote it with (-e) a wind-phantom (or: to the wind) (Nippur Lament 104 OB) d (b) (c) en-líl-le dur-an-ki-ka gišmitum-a ba-an-sìg Enlil struck upon Duranki (-a) with (-a) a divine weapon (Lament over Sumer and Ur 139 OB) 149 . a field of wheat. smite. the pure plant of the mountains. 196 n. 4-7. strike. the (b) passages demonstrate rection altered in the direction of instrumental ideas." In the following three example sets." ra "to beat upon (-e)." and sìg "to hit upon (-e/a). 30 4:24f.VOCABULARY NOTE 3 Multiple Rection Verbs Many verbs show variation in rection (indirect object case preference) in some cases possibly owing to the influence of Akkadian syntax. GÁNA gig-ga. he filled repeatedly into the fire (Gudea Cyl A 8:10 Ur III) ig-bi mah-àm ul-la mi-ni-in-si Its doors (which) were lofty: he filled them with (-a) flowers (Ur-Namma B 26 Ur III) GÁNA šuku surx(ÉREN)-ra. the (a) passages demonstrate the normal rection. Common examples are si "to fill into (-a). and the (c) passages show ungrammatical conflations of rection marked by double case postpositions. JCS 30. may only be preceded | bi | b Transform. b. e. Terminative. ri) | ta (te.THE SUMERIAN VERBAL PREFIX CHAIN MODAL VENTIVE DATIVE DIMENSIONAL PREFIXES CORE PREFIXES PREFIXES DA TA ŠI RA L-T Erg ───────┬─────┼─────┼──────┬──────────┼──────────────────────────────────────┼──────┬──── | | M | BA │ SINGULAR │ Comitative. and | | hé | | |──────┴──────────┘ Ablative-Instrumental may be | | | | -> | 1 ma | preceded by a pronominal | | ga | C | |──────┬──────────| element (mu. function may only | mu | Ø | be preceded by a preformative | | ─────────────┤ ┌────────────────────────────────────────────────────────┼──────| Imperative │ | Loc. ne) | | | o | | | 2 ra |──────────────────────────────────────| | na | n | | |──────────| | Terminative | | | j | | | 3p na | Comitative | ši {šè) | | na | u | | └──────────| da |─────────────────────────| | | n | | -> 3i ba | (dè. │ | by the ventive or a preformative | | ─────────────┴─────┴────────────────────────────────────────────────────────┴──────┴──── Stative al (exceptionally preceded by ù. di) | Ablative | Ablative| | ba-ra | c | | | | ra | Instrumental | ri | e/Ø | t | | | | (re. Dative prefix except in | ni | n | | |──────┬──────────| emphatic Ablative sequences | | ši | nga | | | 2 e-ne? | such as ma-da-ra-ta-è | | | | | | └──────────────────────────────────────| | nu-uš | | | | 3p ne <-------------------------> | ne | n--š | | | | | | | └──────┴─────────────────────────────────────────────────┼──────| | -> mu. ti) | | nu | i | | PLURAL |──────────────────────────────────────| | | v | |─────────────────| Ablative ra appears only after | | ù | e | -> | 1 me | a sg.with Loc.or nu-) ──────────────────────────────────────────────────────────────────────────────────────── 150 .-Term. n.-Term. bi. THE EMESAL DIALECT Eme-sal "fine tongue" is usually described as an example of a linguistic women's language or dialect (sociolect). See the lengthy study of Manfred K. Borger in AOAT 305 (2003) 622f. sweet speech. almost no evidence to show that eme-sal was actually spoken by Sumerian women in historical times. regarding OS Lagaš-Girsu). not munus.(abstract formative) šúm "to give" /b/ < /g/ a-ba zé-eb i-bí šà-ab = a-ga (àga) "rear" dug3 "good" igi "eye" šag4 "heart" /u/ < /i/ su8-ba u5 ù-mu-un uru = sipa(d) "shepherd" ì "oil" en "lord" iri "city" (other) e-zé = ka-na-áĝ li-bi-ir ši-pa-áĝ šu-um-du-um ţu-mu udu "sheep" kalam "nation" niĝir "herald" zi-pa-áĝ "breath" nundum "lip" dumu "son" 151 . some having linguistic features in common with the Sumerian example." referring certainly to what might be described as a kind of softening of the spoken language brought about by the kind of phonological modifications that characterize the dialect. The following illustrate a few of the known eme-sal spellings. Eme-sal differs from the main dialect eme-gir15 "native tongue" in two ways. Now it is understood that eme-sal has something of the sense of "fine. however. In a few cases completely different words are employed. Innsbruck. 1990). More often one sees certain types of phonological modification of both consonants and vowels. Women's dialects are well known among the world's languages. it has even been suggested that it may instead have served. or at least originated. and until fairly recently it was thought that the Sumerian term for "woman" was in fact sal. as a geographical dialect (see most recently Josef Bauer in OBO 160/1 [1998] 435f. Some word substitutions include: ga-ša-an = ir nin "mistress" túm "to bring" mu-lu ta = lú "person" a-na "who Some phonological modifications include: /m/ < /ĝ/ da-ma-al = dìm-me-er èm(ÁĜ) ma-al -mà(ĜÁ) mar me-ri mu -mu na-ma daĝal "wide" diĝir "god(dess)" níĝ "thing" ĝál "to be" -ĝá "in/of my" ĝar "to place" ĝìri "foot" ĝiš "wood" -ĝu10 "my" naĝa "alkali" /ĝ/ < /m/ e-ne-èĝ na-áĝzé-èĝ = inim "word" nam. Earlier scholars attempting to explain eme-sal were to some extent misled by the fact that the term sal is written with the MUNUS "woman" sign." an occupation almost exclusively of males of uncertain sexual orientation. Emesal-Studien (IBK Sonderheft 69. and syllabic spellings are a good sign that one is in an eme-sal context even if not all words in a particular text are consistently given proper eme-sal spellings. delicate. genteel. For a full list of attested eme-sal words see R. since it is mainly seen used in the speech of female deities in Sumerian literary contexts and in the language of 2nd and 1st millennium temple liturgies performed by the gala "lamentation priest. Furthermore. eme-sal words cannot be written logographically but must be spelled out syllabically. Since eme-sal modifies the pronunciation of common words. There is. Schretter. 104f. adverbial) 35.. -eš(e) (adverbiative) 59 finite copula 49f. 51 -bi-da (conjunctive) 57 comitative postposition 57f.(Conjugation Prefix) 66f.. i-gi4-in-zu. dative postposition 55f. possessive 32f. anticipatory genitive 42 auxiliary verbs 72 ba. imperatives 111-113 verbal prefix chain chart 150 vowel harmony.80f.. 114-116 locative -n. ga. predicative genitive 43 pronominal conjugation 146-148 pronouns dimensional prefixes 69. with verbs 148 relative 37 summary chart 38 reduplication 26f. terminative prefix 79f. -a (nominalizing) 95ff.INDEX a. 67. rection 60 copula 30.79 ablative -ra. 114-116 instrumental agent 88 loss of final /n/ 126 ma-na-. me-a 36 Mesanepada construction 97 mi-ni-.87f.. hé.and -b. 100f. -kam-ma-ka 53 locative -a 56f. 151 equative 44f.(preformative) 105 bahuvrihi modifiers 30 -bi (demonstrative.102 nu as verbal root (in-nu) 50 nu-uš. imperative 109ff. 46ff. 118f. 59 ši.92 marû finite verbs 117 marû stem formation 117-119.92 -n-ga. syllabic sign values chart 16f. 79 152 . demonstrative adjectives 35f. 147 ní "self" 36 nu. mi-ri. ergativity 83ff..before ba-) 106f. relative clauses 95ff. periphrastic verbs 72 plural verbs 82. 78 dative paradigm 73 demonstrative 35 hamţu agent 64-6 hamţu subject/patient 63 independent 31 marû agent and object 120f.before bí-) 106f. 130f.106f. interrogative pronouns 36 -kam. vocative) 55 /(e)d/ in non-finite forms 127-130 /(e)d/ in finite forms 124-6 emesal dialect 22. -ri (demonstrative adjective) 35 second agent 88 sentence adverbs 52 subordinate clauses 99f. -a-ka-nam 101 a-ba 36 a-da-al/lam 52 a-na 36 a-rá (multiplication) 53 abilitative -da.107 number 24 numerals 53 participles 127ff. OS Lagaš 19. ba-e. ur5 (demonstrative pronoun) 36 ventive 90ff.86f. adverbs 51f.74-77 ba-a-. 135f. ablative -ra/re/ri.81 ablative-instrumental prefix 80 ablative-instrumental postposition 58 adverbial expressions causal 52. in-nu 50 infinitives 141ff.107 terminative postposition 58f. igi-zu 52 ì.(stative prefix) 67f. ì-ne-éš 52 im-√ = Vm+b 91f. 54 -e (casus pendens. compound verbs. al. ergative 61f.(= ù. 63f. gender 24 genitive as implicit agent 43 genitive construction 39ff.105f. -šè (adverb formative) 51.(positive) 106 -na-an-na 101 na-me 37 -ne (demonstrative adjective) 35. ma-ra.83 ba-ra.(negative) 105 na.(conjunctive) 108 na. ì.(= ù. didli 53 -e (adverb formative) 51. 101 local 52 temporal 52. ù. locative -ni. comitative prefix 78f. genitive without regens 42f.. so check the glossary carefully. Some forms are nominal compounds. noting any possible alternate translations.EXERCISE 1 NOUNS. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 lú-ne é-é dumu-dumu-ne diĝir-gal diĝir-re-ne diĝir-gal-gal-le-ne dumu-zi hur-saĝ-galam-ma níta-kal-ga munus-sa6-ga nam-lugal ki-sikil-tur ki Lagaški gu4-áb-hi-a šu-sikil bàd-sukud-rá níĝ-ba šeš-bànda nu-giškiri níĝ-gi-na níĝ-si-sá dumu-níta a-ab-ba-sig dumu-munus dub-sar-mah é-bappir uzu ti. All forms are absolutive nominal chains whose analyses must end with the marker -Ø. ADJECTIVES Analyze morphologically using plus (+) symbol and translate. uzu ti-ti 153 . NOUN PLURALS. EXERCISE 2 NOUN PLURALS. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 diĝir-zu á-dugud-da-ni dumu-bi ama-kal-la-ĝu10 lugal-zu-ne-ne ama-ne-ne diĝir-bé-ne diĝir-ra-né-ne lú-mah-bi gú-ri iri-gal-me nam-ti-ĝu10 nam-ti-la-ni ur-saĝ-zu-ne níĝ-na-me igi-zi-da-ni dub-sar-tur-ĝu10-ne ki-tuš-kù-ga-ni a-a-kal-la-ni nin igi-sa6-sa6-ĝu10 (Enlil and Sud 25 OB) 154 . Don't forget to put an absolutive -Ø at the end of each analyzed chain. Use the Glossary to identify any nominal compounds. POSSESSIVE AND DEMONSTRATIVE PRONOUNS Analyze carefully and translate. EXERCISE 3 ADNOMINAL CASES POSSESSIVE AND DEMONSTRATIVE PRONOUNS Analyze and translate. for" 25 26 27 28 29 30 31 32 33 34 35 i7 a-šà-ba-ka gú-gibil-bi ká uru-šè giš ig ká uru-ka lú é-gal uru-ba-ka-ke4-ne-gin7 é dnin-ĝír-su-ka dumu dnin-hur-saĝ-ĝá-ka-ke4-ne nam-ti énsi-ka-šè Inana nin kur-kur-ra nin É-an-na-ka é me-huš-gal an-ki-ka-ni nu-bànda kù-dím-ne (OSP 2. towards. note all possible alternative analyses. 50 1:6/3:9 Sarg. This exercise employs the following case postpositions: locative -a terminative -šè 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 é lugal-la é lugal-la-na é lú é dumu-ne é lú-ka é lú-ne-ka é-gal lugal-la é-gal lugal-ba-ka é-gal lugal-ĝá-šè é diĝir-mah-e-ne é diĝir-ra-bi é diĝir-ba-gin7 é-mah diĝir-gal-gal-le-ne-ka nam-lugal uru é-gal nam-lugal-la-ĝu10-šè ama dumu-dumu-ne ama dumu-dumu-ke4-ne-gin7 ir11-zi dam lugal-la-ka lugal-kal-ga diĝir-ra-ni lugal-ĝá nam-kal-ga-ni é-ba diĝir-mah-bi dumu-ne ama-kal-la-ne-ne é-ĝá giš "in" "to.) ki-a-naĝ lugal-lugal-ne (RTC 316 Ur III) d ig-bi lú uru-ke4-ne é-é-a-ne-ne 155 . Remember to use the absolutive postposition -Ø in the absence of any other case. patron of the city Nippur goddess of passion and conflict. INDEPENDENT PRONOUNS Deities d d En-líl Inana d Iškur d Nin-urta(-k) d Šákkan Ènnigiki Ki-en-gi(r) Úri(m) ki highest earthly god. farmer god and war god. cult center of the moon god Nanna(r) Places 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 bàd-sud-rá-bi bàd é-gal-ĝá-kam lugal nin Ki-en-gi-ra ì-me-en-dè-en é-bi é-ĝu10 nu-um. patron of Karkar son of Enlil. cult center of the chthonic healing god Ninazu Sumer Ur. patron of Ĝirsu god of wild animals Ennigi. ki-tuš-kù en Úri nin-ĝu10 dInana á-dah-ĝu10-um (Annal of Utuheĝal 29 Ur III) za-e: dIškur lugal-zu-um dŠákkan šùš-zu-um bar-rim4 ki-nú-zu-um (Sheep and Grain 171 OB) nar za-pa-áĝ-ĝá-ni du10-ga-àm e-ne-àm nar-àm (Proverbs 2+6 A 73 OB) Iškur-ra á-dah-ha-ni-me-eš (Lugalbanda and Hurrum 401 OB) a-ne-ne dumu Ènnigiki dumu Úriki-ma-me-éš (Šulgi D 373 Ur III) En-líl en za-e-me-en lugal za-e-me-en (Enlil and Ninlil 144 OB) ur-saĝ an-eden-na men-bi-im eden-na lugal-bi-im (Enki and the World Order 354 OB) ĝá-e ù za-e šeš-me-en-dè-en (Proverbs 8 D 2 OB) an-na dili nun-bi-im ki-a ušumgal-bi-im (Enlil A 100 OB) Nin-urta ur-saĝ dEn-líl-lá za-e-me-en (Ninurta B 29 OB) sá-du11 kas-gíg-du10-ga-kam (Nik I 59 3:9 = TSA 34 3:10 OS) me-bi kù-kù-ga-àm (Ibbi-Suen B Segment B 11 Ur III) d d d ki -ma-ka-kam 156 . patron of Uruk god of rain.EXERCISE 4 COPULA. ADVERBIAL EXPRESSIONS.EXERCISE 5 ADVERBAL CASES. DEMONSTRATIVES Analyze and translate these nominal chains 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 u4-bi-ta u4-ba u4-ul-la-ta u4-ri-a gù-nun-ta á-kal-ga-ni-ta šà-húl-la-zu-ta šà uru-ka šà uru-ba-ta šà-bi-ta bar uru-ka eger é-ĝá-ta 37 igi é-babbar-ra-ka igi-zu-šè igi-ba ugu-ba gú i7-da-ke4 gaba hur-saĝ-ĝá-šè da é-za-ke4 da-bi-šè saĝ-bi-šè ul-šè mah-bi-šè galam-šè gal-le-eš 1/6 (gur) zíz ninda Géme-dNanše Munus-sa6-ga-bi (DP 149 8:4-6 OS) 26 27 28 29 30 31 32 33 34 35 36 ul4-la-bé nam-bi-šè téš-bi-šè u4-dè-eš ní-bi-šè dili-zu-šè an-ta ki-šè ugu saĝ-ĝá-na-ke4 gú-e-ta gú-ri-šè ì-ne-éš hur-saĝ an-ki-bi-da-ke4 (Grain and Sheep 1 OB) 157 . EXERCISE 6 SIMPLE PERFECTIVE VERBS, COPULA, ADVERBIAL EXPRESSIONS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 za-e uru Lagaški-a ba-tu-dè-en? dumu uru-ba nu-me-en, ama-ĝu10 Úriki-ma in-tu-dè-en tukumbi lú énsi Lagaški-a-ka ì-me-en, énsi-ra a-na e-a5? ĝa-e, šitim-saĝ iri-me-en, é-gal énsi kalam-ma-ka ì-dù ù ku-li-sumun-zu uru-me-a a-na in-a5? ku-li-ĝu10, naĝar-ra-àm, giš gu-za giš banšur é-gal énsi-ka-ka in-dìm-dìm a-na-gin7 é-gal Lagaški-a e-dù? dili-ĝu10-šè nu-dù, ĝiš-hur-bi ì-a5, ùĝ uru-ke4 kíĝ íb-a5 ir11 énsi-ke4 im giš ù-šub-ba íb-ĝar, sig4 ki-sikil-la íb-du8 lú uru-ke4-ne téš-bi-šè é-gal sig4-ta in-dù-uš énsi é dNin-ĝír-su diĝir Lagaški-a-ka-ka ì-ku4, dam dumu-ni e-ne-da ì-ku4-re-eš igi bára-kù-ga-ka ì-gub, šu-ni alaĝ diĝir-ra-šè in-zi sizkur in-a5 énsi šà-húl-la-ni-ta é-ta u4-dè-eš ba-è, saĝ-ĝá-ni an-šè in-íl zi-da gùbu-na piriĝ ì-nú-nú (Gudea Cyl A 5:16 Ur III) Gù-dé-a ì-zi, ù-sa-ga-àm! ì-ha-luh, ma-mu-dam! (Gudea Cyl A 12:12-13) é-bi Ambarki-a ì-dù-dù (Ukg 6 1:8'-9' OS)) ĝalga kalam-ma sug-ge ba-ab-gu7 (Lamentation over Ur 232 OB) mu dAmar-dSuen lugal-e gišgu-za dEn-líl-lá in-dím (Date formula for Amar-Suen year 3 Ur III) d Ba-ú-al-sa6 (OS personal name; dBa-ú is the chief goddess of Ĝirsu) Šu-ni-al-dugud (OS personal name) inim-bi al-til (Edzard, SRU 54 3:27 Sargonic legal text) 158 EXERCISE 7 PERFECTIVE VERBS, DIMENSIONAL PREFIXES 1 2 3 4 šu-nígin 5 udu-nita eger gúrum-ma-ta udu-siki-šè ba-dab5 (Nik I 155 4:1-4 OS) ùĝ e-da-lu ùĝ e-da-daĝal (Iddin-Dagan B 55 OB) 3 lú anše surx(ÉREN)-ke4 ba-su8-ge-éš (HSS 3, 24 4:14-16 OS) En-líl lugal kur-kur-ra ab-ba diĝir-diĝir-ré-ne-ke4 inim-gi-na-ta dNin-ĝír-su dŠára-bi ki e-ne-sur (Ent 28-29 1:1-7 OS) 1 sila4 é-muhaldim-ma ba-sa6 (Nik I 197 1:6-2:2 OS) en a-ba e-diri a-ba e-da-sá? (Sjöberg, Mondgott Nanna-Suen 45:25 OB) aga-zi nam-en-na mu-da-an-kar (Exaltation of Inana 107 OB) ad-da-ĝu10 mu-da-sa6 (Schooldays 11 OB) dub-a-ni mu-da-ĝál (TCS 1, 353:6 Ur III) Ba-ú-ma-ba (personal name) lú Ummaki-ke4 E-ki-surx(ÉREN)-ra-ke4 izi ba-szúm (Ukg 16 1:1-3 OS) (surx is here a variant writing for sur) mu a-rá 3-kam-aš Simurrumki ba-hul (Šulgi year 33 Ur III) utu-è-ta utu-šú-uš èrim-bi ba-tur (Curse of Agade 195 OB) èn ì-ne-tar (TCS 1, 135:9 Ur III - 1st sg. agent) ad-da dumu-ni-ta ba-da-gur (Lamentation over Sumer and Ur 95 OB) ki-sikil-bé ki-e-ne-di ba-an-šúm ĝuruš-bé á gištukul-la ba-an-šúm di4-di4-lá-bé šà-húl-la ba-an-šúm (Curse of Agade 31-33 OB) d d 5 6 7 8 9 10 11 12 13 14 15 16 159 EXERCISE 8 DIMENSIONAL PREFIXES, COMPOUND VERBS Proper nouns: An d Iškur d Enlil d Nanna(r) Nibruki Ur-dNamma(-k) Šulgi(r) The sky god, source of kingship (written without a divine determinative) The god of rain Highest earthly god, source of governing power The moon god, patron of the city-state of Ur Nippur, the city of Enlil, Sumer's religious capital First king of the 3rd Ur dynasty (2112-2095 BC) Second king of the 3rd Ur dynasty (2094-2047 BC) When you have identified the nominal chain representing a patient, use the glossary to check whether the patient and verbal root are considered to be a compound verb with a special meaning. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 u4-ri-a dnanna dumu den-líl-lá-ke4 an-ta ki-šè igi-zi-da-ni íb-ši-in-bar. d nanna diĝir uríki-ma-ke4 šul-gi dumu ur-dnamma-ka šà-kù-ga-na in-pà. lú 36,000-ta šu-ni íb-ta-an-dab5, gù ì-na-an-dé: "šul-gi-ĝu10, šà-kù-ĝá ì-pà-dè-en, ukkin diĝir-re-ne-ka nam-zu ba-tar!" an-e nam-lugal an-ta ba-ta-an-e11, šul-gi lugal uríki-ma-šè in-ši-in-ku4 d d d nanna-re suhuš giš gu-za-na ì-na-an-gi, bala-sù(d)-rá nam-šè ì-na-an-tar. en-líl-le é nibruki-ka-ni-ta nam-ur-saĝ nam-kal-ga níĝ-ba-šè ì-na-an-ba. iškur-re a hé-ĝál-la i7-da in-ĝál, bala hé-ĝál-la ì-na-an-šúm. diĝir-gal kalam-ma-ke4-ne ùĝ uríki-ma-ke4 nam-du10 ba-an-tar-re-eš. nam-bi-šè lugal-le diĝir-ra-né-ne-ra gal-le-eš ki ì-ne-en-áĝ. šul-gi sipa kalam-ma-ke4 níĝ-si-sá-e ki ba-an-áĝ, níĝ-gi-na ùĝ-ĝá-né ba-an-ĝar. á den-líl-lá-ta ur-saĝ-kal-ga ki-bala giš tukul-ta in-gaz, lugal-bi in-dab5. ki-bala-ta kù-sig17 kù-babbar-bi íb-ta-an-e11, kisal dnanna-ra-ka in-dub. u4-ba lugal-le sig4 in-šár, bàd uru-na in-dù, saĝ uru an-šè íb-ši-in-íl. é-mah dnanna diĝir-ra-ni-ir ì-na-an-dù, alam diĝir-ra é-a in-ku4. u4 zà-mu-ka-ka dili-ni-šè é diĝir-ra-na-šè ib-ši-ĝen, šùd ì-na-an-rá. "diĝir-ĝu10, igi nam-ti-la-zu mu-ši-bar, inim-zu-uš ĝeštú íb-ši-ĝar"; "nam-lugal kalam-ma ma-(a-)šúm. u4-ul-lí-a-šè mu-zu kur-kur-ra mah-àm!" šul-gi lugal-àm é-gibil-ta íb-ta-è. inim-ma-ni diĝir-ra-ni-ir ì-na-sa6. e-ne ì-húl. lú uru-ke4-ne téš-bi-šè lugal-la-ne-ne-da in-da-húl-le-eš. 160 3 Ur III) šu-níĝin 60 máš-gal 8 uzud ur-gi7-re ba-ab-gu7 (PDT 346 rev. 36:1-3 Sargonic) 12 sìla ésir-é-a dug-ĝeštin(-e) ba-ab-su-ub (Contenau Umma 99:1-2 Ur III) nam-lú-ùlu-bé gištukul ki bí-íb-tag (Lamentation over Sumer and Ur 394 OB) eden-eden-na ú-làl bí-mú-mú (Nisaba Hymn for Išbi-Erra.D. 1 uzud. (1970) 111 OB) giš giš 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 161 . 1 máš-gal 1 máš ug7-ug7-ga-àm géme uš-bar-e-ne ba-an-gu7-éš (Hilgert. 41 rev. 13'-14' Ur III) še-šuku engar-re šu ba-ab-ti (Gomi.EXERCISE 9 CORE PREFIXES 1 2 1 sila4-ga ne-mur-ta ba-šeĝ6. 224:17 Ur III) 1 é sar uru-bar abul-tur-ra-ka an-ĝál (Edzard. ki lugal-šè ba-an-ku4 (Legrain TRU 327 1-3 Ur III) 2 gu4 ú 26 u8 8 udu-nita 2 sila4-nita. Reisman Diss. OIP 115 66:11-10 Ur III) mes-e saĝ bí-sa6 (Gudea Cyl A 7:17 Ur III) munus-e lú-igi-níĝin-ne ninda e-ne-gu7 (DP 166 iii 6-iv 1 OS) niĝir-e sila-sila-a si gù ba-ni-in-ra (Sumerian Letters B 12:3 OB) bàd Unuki-ga gu mušen-na-gin7 eden-na ba-ni-lá-lá (Lugalbanda and Enmerkar 305 OB) érin-e di bí-íb-du11 ba-ab-de6 (NSGU 215:16 Ur III) "udu-ĝu10-um" bí-in-du11 (NSGU 120a:9 Ur III) kišib Lú-dEn-líl-lá di-ku5 íb-ra (UET 3. SRU No. 157 No. D. 119:6 Ur III) eren-bi tùn-gal-e im-mi-ku5 (Gudea Cyl A 15:22 Ur III) im-ba igi ì-ni-bar (TCS 1. ASJ 3. ù lú-né-ne mu lugal-la a-ab-ba-nim-ta a-ab-ba-sig-šè mu-ni-in-zu-uš nam-bi-šè dEn-líl itima-kù-ga ba-an-ku4 šà-ka-tab-ba ba-an-nú (Curse of Agade 209 OB) ká silim-ma-bi gišal-e bí-in-ra (Curse of Agade 127 OB) en uru-bar-ra en uru-šà-ga líl-e ba-ab-lah4-eš (Lamentation over Sumer and Ur 345) 162 . (= -an-e-eš) da giš banšur-gal-la-ke4 im-mi-in-dúr-ru-né-eš. sig4-bi ki-šè ba-ši-šub. é-gal-sumun-na giš An-né dumu lugal-ba gu-za ad-da-na-ka ùr-bi ba-šub. šeš-a-ni ku-li-ni téš-bi-šè kisal é-gal-la-ka ib-su8-ge-eš. kaš mu-ne-en-bal. take" do" stand" sit. ad-bi uru-šè mu-un-de6-eš. giš lugal-gibil-le lú lú-bé-ne giš tir-ra-ke4-ne giš tir-šè íb-ši-in-re7-eš. tir-ra ĝiš bí-in-kud-re6-eš.EXERCISE 10 CORE PREFIXES. PLURAL VERBS Proper Nouns: Plural Verbs: (hamţu) Unu(g)ki An Singular de6 du11(g) gub tuš ĝen The city of Uruk The patron god of Uruk Plural lah4 e su8(g) dúr(-ru-un) re7 "to "to "to "to "to bring. ĝiš-bi ad-šè íb-ši-in-a5-ke4-eš. ĝissu-daĝal é-gal-la-na-šè ní íb-ši-in-te-en-eš. e-ne zà-gu-la-a dili-né ib-tuš. šà uru-ka im-mi-in-dub-bé-eš. go" giš 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 lugal-sumun unuki-ga ba-úš. lugal-le mu-ni kur-kur-ra ì-ni-in-mah. u4-ba lugal-e šà-húl-la-ni-ta ùĝ-e ĝišbun im-ma-an-ĝar. ĝuruš kalam-ma-ke4 é-gal-gibil šà unuki-ga-ka mu-na-ni-ib-dù. reside" come. lú-ù-ne in-naĝ-ĝe26-eš. lú-ù-ne in-gu7-uš. VENTIVE. u4-bi-ta lú kalam-ma-ke4-ne uru-uru-ne-ne-a silim-ma bí-in-dúr-ru-né-eš. gúg kaš-bi-ta šà-ga-ne-ne íb-ta-an-húl-le-eš. silim mu-na-né-eš. gúg-ku7-ku7 giš banšur-ra mu-ne-ni-in-ĝar-ĝar. za-dím kalam-ma-ke4 šà é-gal-ba-ke4 na4 za-gìn-na šu-tag ba-ni-ib-du11. bí-in-tuš. LOCATIVE. EXERCISE 11 VENTIVE 1 2 3 4 5 6 a-a-ĝu10 dEn-líl-le mu-un-túm-en (Lugalbanda and Enmerkar 101 OB) ù-šub mu-dúb sig4 u4-dè ba-šub (Gudea Cyl A 19:13 Ur III) ki šà-húl-la dNin-líl-lá-šè dEn-líl dNin-líl-da mu-dì-ni-in-u5 (Šu-Sin B 12:9-11. e-ba na-rú-a e-me-sar-sar (Ent 28-29 2:1-5 OS) ur5 mu-du8 šu-šu mu-luh (Gudea Statue B 7:29) hur-saĝ Ur-in-gi-ri-az a-ab-ba igi-nim-ta na4nu11-gal-e mu-ba-al im-ta-è útug ur-saĝ-3-šè mu-na-dím (Gudea 44 2:2-3:4. 34 Ur III) e-bi i7-nun-ta gú-eden-na-šè íb-ta-ni-è. a sculpted mace-head) PN1 PN2 šu-[i] lú-inim-ma-bi-[šè] im-ta-è-è-[eš] min-a-bé é dŠára-ka nam-érim-bi íb-ku5 (NSGU 40:3'-8' Ur III) En-ki-ke4 An ki-mah-a im-ma-an-tuš An-ra dEn-líl im-ma-ni-in-ús d Nin-tu zà-gal-la im-mi-in-tuš d A-nun-na ki-ús ki-ús-bé im-mi-in-dúr-ru-ne-eš (Enki's Journey 106-109 OB) abul-la-ba izi mu-ni-in-ri-ri (Exaltation of Inana 44 OB) u4 é dNin-ĝír-su mu-dù 70 gur7 še é bi-gu7 (Ur-Nanše 34 3:7-10 OS) u4-bi-a ku6-e ambar-ra nunuz ki ba-ni-in-tag mušen-e ka ĝiš-gi-ka gùd im-ma-ni-in-ús (Bird and Fish 22-22 OB) šà-ba gi-gun4 ki-áĝ-ni šim-gišeren-na mu-na-ni-dù (Gudea Statue B 2:9-10 Ur III) ú-du11-sa6-<ga->ni igi-šè mu-na-ĝen. JCS 21. (Gudea Cyl B 2:9-10) d d 7 8 9 10 11 12 13 14 Lamma-sa6-ga-ni eger-né im-ús áb-zi-da amar-zi mu-ni-šár-šár ùnu-bi bí-ús u8-zi-da sila4-zi mu-ni-šár-šár sipa-bi im-mi-ús (Gudea Statue F 3:16-4:4 Ur III) é-kur èš-mah-a mi-ni-in-ku4-re-en (Römer SKIZ 7:10 OB) igi-bi šim-bi-zi-da mi-ni-gùn (Lugalbanda I 58 OB) 15 16 163 . . Is there an error here?) nin An-ra diri-ga (Exaltation of Inana 59 OB) aša5 zà Ambarki-ka ĝál-la-a (DP 387 5:2-4 OS) mu Šar-rum-kīn Si-mur-umki-šè ì-ĝen-na-a (ECTJ 151:10-13 Sarg.. (Ninurta and the Turtle B 17 ON) ur-mah gištukul-la bí-til-a-ĝu10 (Šulgi B 76 Ur III) kišib ra-a-bi (Oppenheim Eames 158f. chief goddess of Ĝirsu. PN2-da mu-da-ĝen-na-a. Ur III) mušen gištukul-kal-ga-zu bí-dab5-ba-šè . Princeton No. lú dba-ú kur-re lah5-ha-me (DP 141 6:1-2 OS) má-gur8 ur5-gin7 dím-ma u4-na-me lugal-na-me den-líl dnin-líl-ra nu-[mu-ne]-dím (Civil. most famous of the Old Akkadian kings (Divinized) 4th king of the 3rd Ur dynasty 1 2 3 ùĝ saĝ-gíg-ga numun-zi íb-i-i-a (Nippur Lament 17 OB) En-an-né-pà-da (OS personal name) 4 ĝuruš engar šà-gu4 itu Šu-numun-ta u4 26-àm ba-ra-zal-la-ta itu Ezem-dŠul-gi u4 21-àm zal-la-aš (Sigrist. NOMINALIZING SUFFIX -a Proper Nouns: Ba-ú Nin-líl Šarrum-kīn d Šu-dSuen d d Consort of the god Ninĝirsu. Ur III) giš 4 5 6 7 8 9 10 11 12 13 14 15 16 tukul-e gub-ba gištukul-e in-gaz (Lamentation over Ur 224 OB. 34 13:6-11 Ur III) kù-luh-ha saĝ-da sá-a (Nik I 294 i 4 OS) 5 ĝuruš gu4-e ù anše ús-sa (Yildiz-Gomi UTAMI 2233:2 Ur III) 50 (silà) ninda-šu éren giškiri6 dŠu-dSuen-ka gub-ba ib-gu7 (Oppenheim Eames C 13:1ff. patron of Nippur Sargon. year name) 164 . mu-túm (RTC 19 3:3-7 Ur III) šu-níĝin 20 lá-4 lú. 513:1-5 Ur III) PN lú-ni. JCS 21. Consort of the god Enlil.EXERCISE 12 RELATIVE CLAUSES. The king is speaking) gala hé lú-bàppir hé agrig hé ugula hé . Kar-silim-ma-ke4 hu-mu-ni-ús (Hammurapi Sippar Cylinder.EXERCISE 13 PREFORMATIVES 1 2 3 4 5 6 7 8 9 10 11 12 13 énsi-bi ku-li-ĝu10 hé! (En I 35 5:2-3 OS) PNN giškiri6 ĜÁ-dub-ba-ka aša5-ga nu-gub-ba-me (MVN 7. i7Buranun Zimbirki-šè hu-mu-ba-al. 86 2:3 OS personal name referring to a child's birth) 14 15 16 17 165 . KVM 32. (Ukg 1 4:26-29 OS) im-zu abzu-ba hé-eb-gi4..two PNN) ga-e-gi4 Éreški uru dNisaba-šè (Enlil and Sud 29 OB) an-ta hé-ĝál ha-mu-ra-ta-du (Gudea Cyl A 11:8 Ur III) "ìr nu-me-en" bí-in-du11 (NSGU 34:4 Ur III) bàd Zimbirki sahar-ta hur-saĝ-gal-gin7 saĝ-bi hé-mi-íl. 224 rev. ambar-ra hu-mu-ni-in-níĝin. 7 Ur III) diĝir-re-e-ne-er šu-mu-un-ne-mah-en (Išme-Dagan X 17 OB) kal-ga-me-en lugal-ĝu10 ga-ab-ús (Letter Collection B 1:9 OB Is there an error here?) níĝ-na-me á-bé la-ba-ra-è (Curse of Agade 160 OB) PN-šè ĝéštu-ga-ni ha-mu-šè-ĝál (VAT 4845 4:3-5 OS) ĝìr-pad-rá-zu bàd-da hé-eb-lá (Šulgi N 43 OB) lú-na-me níĝ-na-me ugu-na li-bí-in-tuku (Letter Collection B 12:4) A-tu-e "Á-ta má nu-ra-šúm" in-na-an-du11 (NSGU 62:9-10 Ur III . še dÉzinu-e nam kud-rá hé-a! (Curse of Agade 231-234 OB) saĝ-ur-saĝ-ĝu10-ne igi hu-mu-un-du8-uš (Šulgi A 77 OB) ĝá-ka-nam-hé-ti (VS 14.. im dEn-ki-ke4 nam kud-rá hé-a! še-zu ab-sín-ba hé-eb-gi4.1167 OB. Partly in Emesal dialect) 5 6 7 8 9 10 11 12 13 14 15 16 eden i-lu ĝar-ù! ambar inim ĝar-ù! (Dumuzi's Dream 6 OB) èš Nibruki Dur-an-ki-ka saĝ íl-la ĝen-né! (Ur-Ninurta E 42 OB) ninda gu7-ni-ib! (VS X 204 6:7 OB) Nanna nam-lugal-zu du10-ga-àm ki-za gi4-ni-ib! (Lamentation over Sumer and Ur 514 OB) lugal-ra igi-zi bar-mu-un-ši-ib! (Rīm-Sîn B 50 OB) e-ne-ra du11-mu-na-ab! (Enmerkar and the Lord of Aratta 135 OB) "uzu níĝ sìg-ga gišgag-ta lá-a šúm-me-eb!" du11-ga-na-ab-zé-en! (Inana's Descent 248 OB) tukum-bi lú-na-me "dumu-ĝu10 túm-ù-um!" ba-na-an-du11 (ZA 97. ninda šúm-ma-ab-zé-en! (Schooldays 13-14 OB) ù za-e ù-sà-ga nú-ni! (Šulgi N = Lullaby 92 Ur III) ù-sá ĝe26-nu ki du5-mu-ĝá-šè! (Šulgi N = Lullaby 14 Ur III.EXERCISE 14 THE IMPERATIVE 1 2 3 4 kù là-ma! (Ukg 4-5.) a naĝ-mu-ub-zé-en. 11:26-27 OS) "é-dub-ba-a-šè ĝen-ù" mu-e-du11 (Scribe and His Perverse Son 22 OB) "bára-kù-zu — húl-la-bé diri-bé — tuš-a!" hu-mu-ra-ab-bé (Eridu Lament C 48) {hé+mu+ra+b+e+Ø} PN1 nu-bànda-ar "túm-mu-un!" ba-na-ab-du11 PN1 "ì-túmu" bí-in-du11 PN2 nu-bànda-ar lú Naĝ-suki PN3-da in-da-ĝen-na "túm-mu-un!" in-na-an-du11 (NSGU 121:10-17 Ur III) a-šà gala-a Awīlum-ša-lim-ra érin-e "uru4-a!" in-na-ab-du11 (NSGU 215:44 Ur III. 4:9-10 OB legal) d 166 . The -a on gala must be a genitive. EXERCISE 15 IMPERFECTIVE FINITE VERBS 1 2 En-ki-da bára-kù-ga za-e ša-mu-un-dè-dúr-en (Ninurta G 15f. ù šu-kár-bi ki-gub-<ba>-bi-šè nu-ub-ši-gi4-gi4-a. r:34-36 OS) Ha-ìa lú šìr-ra-ke4 zà-mí-zu ka-bi-a mi-ni-ib-du10-ge-ne (Haya Hymn = Rim-Sin B 55 OB) šeš-a-ne-ne ku-li-ne-ne èn-tar-re im-mi-in-kúš-ù-ne (Lugalbanda and Enmerkar Epic 225-226 OB) d "10 gín kù-babbar šúm-ma-ab di ba-ra-a-da-ab-bé-en6!" in-na-an-du11 (NSGU 20:6-9 Ur III legal text) níĝ im-ma íb-sar-re-a (Letter Collection B 19:10 OB) énsi lú ĝèštu-daĝal-kam ĝèštu ì-ĝá-ĝá (Gudea Cyl A 1:12 Ur III) lú é a-ba-sumun ù-un-dù. muš dNanna hé-en-ĝar. igi dNanna-ka hé-en-sa6. lú mu-sar-ra-ba šu bí-íb-ùr-re-a. numun-na-ni dNanna hé-eb-til-le (AmarSin 12 32-49 Ur III) dub-sar-me-en na-rú-a ab-sar-re-en (Letter Collection B 1:14 OB) 15 167 . OB) d Dumu-zi-abzu nin Ki-nu-nirki-ke4 diĝir-ĝu10 dNin-ĝiš-zi-da-ke4 nam-tar-ra-ni hé-dab6-kúr(u)-ne (Gudea Statue B 9:2-5 Ur III) d 3 4 5 6 kíĝ nu-mu-ra-ab-ak-en (Winter and Summer 180 OB) d Gílgameš en Kul-abaki-ke4 ur-saĝ-bé-ne-er gù mu-ne-dé-e (Gilgameš and Agga 51-52 OB) šìr-kù-ĝá-ke4-eš ì-ug5-ge-dè-en (Exaltation of Inana 99 OB) iši Za-buki-a nir ba-ni-in-ĝál ama nu-mu-un-da-an-ti na nu-mu-un-de5-de5 a-a nu-mu-un-da-an-ti inim nu-mu-un-di-ni-ib-bé zu-a kal-la-ni nu-mu-un-da-an-ti (Lugalbanda and Enmerkar Epic 2-5 OB) níĝ di-ba en-na ĝál-la íb-su-su (Code of Urnamma IV 46 Ur III legal text) d 7 8 9 10 11 12 13 14 Nin-ki Ummaki muš ki-ta ĝìr-ba zú hé-mi-dù-dù-e! (Ean 1 rev. mu-sar-ra-bi ù giššu-kár-bi ki-gub-ba-bi nu-ub-da-ab-kúr-re-a. 150:1-5 Ur III) šu-níĝin 12 igi-nu-du8 Uru-inim-gi-na lugal Lagaski-ke4 é-gal-ta e-ta-è-dè. dumu Nibruki-me Lagaški-a ab-durunx(TUŠ. 72:6 Ur III) Na-ba-sa6-ra ù-na-a-du11: 5 ma-na siki Lú-dIškur-ra ha-na-ab-šúm-mu! (TCS 1. Bára-si-ga-ki-a ab-tuš. Ki-lugal-u5-aki-a ab-tuš. Sa6-sa6-ra mu-na-šúm-mu (DP 339 vi 1-vii 3 OS. PNN are a king and queen of Lagas) ĝeštin níĝ du10 i-im-na8-na8-e-ne kaš níĝ du10 i-im-du10-du10-ge-ne ĝeštin níĝ du10 ù-mu-un-naĝ-eš-a-ta kaš níĝ du10 ù-mu-un-du10-ge-eš-a-ta a-gàr a-gàr-ra du14 mu-ni-ib-mú-mú-ne (Sheep and Grain 65-69 OB) 22 168 .TUŠ)-né-eš: ha-mu-ra-ne-šúm-mu (ITT I 1100:1-16 Ur III) I I 17 18 19 20 21 ùĝ-bé a-še-er-ra u4 mi-ni-ib-zal-zal-e (Lamention over Sumer and Ur 481 OB) ki-kù ki nam-ti-la ĝìri-zu hé-ri-ib-gub-bu-ne (Rim-Sin D 33 OB) anše-ba šu hé-eb-bar-re! (TCS 1.16 Gú-TAR-lá dumu Saĝ-a-DU Diĝir-ĝu10-da an-da-ti. Lugal-nam-tág dumu Ur-ub Inim-ma nu-bànda an-da-ti. 161 OB) ĝissu-bi ki-šár-ra lá-a ùĝ-e ní te-en-te (Enki and the World Order 167 OB) i7-zu i7-kal-ga-àm i7 nam tar-ra-àm i7-mah ki utu-è igi nu-bar-re-dam (Ibbi-Suen B 24 OB) úr-kù nam-ti-la si-a-ĝu10 u4-zu sù-sù-dè šul dEn-líl-le é-kur-ta á-bi mu-da-an-áĝ (Ur-Ninurta A 83f. Hammurapi is speaking. Sales Documents 73 n. a-na ĝál-la. muš-huš kur-re eme è-dè-me-èn (Šulgi C Segment A 15-16 Ur III) har-ra-an lú du-bi nu-gi4-gi4-dè (Inanna's Descent 84 OB) PN ká dNin-urta-ka nam-érim kud-ru-dè ba-an-šúm-mu-uš (Steinkeller. OB) Hammurapi lugal-kal-ga lugal Babilaki lugal an-ub-da-límmu kalam dím-dím-me.EXERCISE 16 PARTICIPLES AND INFINITIVES Note that several of the following are phrases. not complete sentences. 235:1-3 Ur III) tukumbi dub Za-ra-ba-am 2-kam im-ma-de6 ze-re-dam (PDT 231:6-9 Ur III) dub Ús-mu ù-um-de6 dub Ab-ba ze-re-dam (Contenau Umma 51 Ur III) šu nu-luh-ha ka-e tùmu-da níĝ-gig-ga-àm (Proverbs 3. KVM 32. 209. 1 2 3 4 5 6 7 8 9 balaĝ-di šìr zu-ne (Nippur Lament 119 OB) Ba-ú-lú-ti (OS personal name) naĝ-ku5 da Ummaki-ka. lugal níĝ a5-a5-bi su dUtu dMarduk-ra ba-du10-ga-me-en (Hammurabi Sippar Cylinder.) balaĝ ki-áĝ-ni "Ušumgal-kalam-ma" (Gudea Cyl A 6:24-25 Ur III) giš d 10 11 12 13 14 15 16 17 gù-di mu-tuku níĝ ad gi4-gi4-ni šen-šen-na eme sù-sù-e-me-èn. Ér-diĝir-e igi kár-kár-dam (YOS 4. HSM 1384:20-22 Ur III) d Šu-ni-du10 ì ga-àr-ra du6-ul-du6-ul-e ì ga-àr-ra nu-du6-ul-du6-ul ((Lament over Destruction of Sumer and Ur 334 OB) ká še nu-kuru5-da še i-ni-in-ku5 (Curse of Agade 123 OB) itima é u4 nu-zu-ba ùĝ-e igi i-ni-in-bar (Curse of Agade 129 OB) 169 .1197 OB. 18 19 lú-tur gibil-bé é dù-ù-gin7. dumu-bàndada ama5 ĝá-ĝá-gin7 (Curse of Agade 11-12 OB) inana i-zi-gin7 an-ta ní gùr-ru-a-zu-dè nin-é-gal-la ki-a súr-dùmušen-gin7 še26 gi4-gi4-a-zu-dè (Inana as Ninegala [Inana Hymn D] 120-121 OB) d d 20 nam-šub dnu-dím-mud-da-kam e-ne-ra du11-mu-na-ab! "u4-ba muš nu-ĝál-àm ĝír nu-ĝál-àm kir4 nu-ĝál-àm ur-mah nu-ĝál-àm ur-gi7 ur-bar-ra nu-ĝál-àm ní te-ĝe26 su zi-zi nu-ĝál-àm lú-u18-lu gaba-šu-ĝar nu-tuku" (Enmerkar and the Lord of Aratta 135-140 OB) 170 .
https://www.scribd.com/doc/139661813/Grammar
CC-MAIN-2017-09
refinedweb
80,214
58.58
CGI::Compile is a utility to compile CGI scripts into a code reference that can run many times on its own namespace, as long as the script is ready to run on a persistent environment. NOTE: for best results, load CGI::Compile before any modules used ...RKITOVER/CGI-Compile-0.24 - 30 Jan 2020 14:01:09 UTC MARKOV/XML-Compile-SOAP-Daemon-3.14 - 11 May 2018 06:23:22 consume...ESM/CGI-Alert-2.09 - 02 Oct 2014 13:36:40 UTC UTC For small CGI scripts, it's common to get a parameter, untaint it, pass it to an object constructor and get the object back. This module would allow one to to build "Class::CGI" handler classes which take the parameter value, automatically perform th...OVID/Class-CGI-0.20 - 07 May 2006 21:41:36-4.48 - 06 Jun 2020 20:05 UTC This module is used to parse e-perl templates. "use CGI::Embedder" Loads the module core. No subroutines are exported. "Compile($content [,string \&filter_func(string $input)])" Converts all the <?...?> sequences in $content to "print" series. You ma...KOTEROV/CGI-Embedder-1.21 - 02 Dec 2004 14:08:38 UTC...HORROCKS/CGI-SpeedyCGI-2.22 - 12 Oct 2003 06:12:31 UTC This module is supposed to be a debugging tool for CGI programmers. If "use"'d in a program it will send nice looking fatal errors to the browser including a view of the offending source and an optional stacktrace. You can supply options to the modul...JDIEPEN/CGI-HTMLError-1.00 - 09 Feb 2005 10:59:59 UTC A Better Solution to the stateless problem. HTTP is by nature a stateless protocol; as soon as the requested object is delivered, HTTP severs the object's connection to the client. HTTP retains no memory of the request details and does not relate sub...BEHROOZI/CGI-SecureState-0.36 - 03 Jan 2003 05:38:57 UTC scrip...BINKLEY/CGI-PrintWrapper-0.8 - 30 Dec 1999 13:45:06 UTC Developer describes environment, output options, and database query; CGI::OptimalQuery provides user with a web interface to view, filter, sort, and export the data. Sounds simple, but CGI::OptimalQuery does not write the SQL for the developer. It is...LIKEHIKE/CGI-OptimalQuery-0.30 - 12 Jun 2018 20:23:56 UTC This module allows an application designed for the CGI environment to run in a PSGI environment, and thus on any of the backends that PSGI supports. It works by translating the environment provided by the PSGI specification to one expected by the CGI...TOKUHIROM/CGI-Emulate-PSGI-0.23 - 08 May 2017 04:45:57 is a small module accompanying the CGI module, providing the display of an error screen (somewhat resembling the classical red-on-black blinking *Guru Meditation* from the good-old AmigaOS before version 2.04) in case of abnormal termination of ...RSE/CGI-GuruMeditation-1.10 - 20 Sep 2006 13:10:23 UTC Supports to run CGI perl files on CGI methods under Dancer....KOCEASY/Dancer-Plugin-FakeCGI-0.63 - 03 Jan 2016 17:00:53 UTC
https://metacpan.org/search?q=module%3ACGI%3A%3ACompile
CC-MAIN-2020-34
refinedweb
518
56.76
Hi, last night I had a good idea for integrating a couple tools I developed into an XML Pipeline if the pipeline took posts to http output ports, this may be jumping the gun somewhat with a Working Draft specification but I guess I am an early adopter, anyway the spec says: "Within a compound step, the declared outputs of a compound step can be connected to: * The output port of some other contained step. * A fixed, inline document or sequence of documents. * A document read from a URI. " This document read from a URI give me my only hope I think, but it is a slim one because I am thinking what it might be supposed to mean is: a document read from an URI as an input, if the document is read from an HTTP URI the HTTP method used for reading is GET. But these parts of the spec seems to imply that my interpretation is incorrect: 1. <p:output port = NCName sequence? = yes|no default? = yes|no> (p:pipe | p:document | p:inline)* </p:output> 2. A p:document reads an XML document from a URI. <p:document href = URI /> The document identified by the URI in the href attribute is loaded and returned. It is a dynamic error if the document referenced by a p:document element does not exist, cannot be accessed, or is not a well-formed XML document. The parser which the p:document element employs must be conformant Namespaces in XML. It must not perform validation. It must not perform any other processing, such as expanding XIncludes. Use the load step if you need to perform DTD-based validation or if you wish to load documents that are not namespace well-formed. so if a p:document is allowed under a p:output, what value does it have to say it can be read from a URI, I suppose that as an ouput of a document I want to either PUT or POST. So I am not at all understanding why I should want to read, and what exactly the meaning of read is, read is not defined in the glossary at the end. Although readable ports are as follows: readable ports The readable ports are the step name/output port name pairs that are visible to the step. Note: defined but never referenced. At any rate I couldn't see an example in the spec of using an output with a p:document href under the output. I have cc'ed this question to the xml-processing-model-comments list because it may be useful in the next version of the specification. Cheers, Bryan Rasmussen Also as this is a working draft I have
http://www.oxygenxml.com/archives/xml-dev/200704/msg00019.html
crawl-002
refinedweb
454
67.59
Sanity and Testcases for pymake Testcases kept me sane writing (and rewriting) pymake. This shouldn’t be a surprise to experienced developers: most developers agree that that test-driven development is good. Often, however, beginning programmers don’t know how to start a project with adequate testing. This post attempts to describe the pymake test environment and give examples of pymake tests. I started pymake with fear and trepidation. I’ve been working extensively with makefiles for 6 years; makefile parsing and execution still occasionally surprises me. This fear was a great motivator: if I had thought this to be an easy job, I might have skipped writing tests until much later in the process. But the testsuite has been absolutely essential: I doubt I could have completed initial development in two weeks without it, and there is no way I could have refactored the code to support in-process recursion and parallel make this week without it. Start Small The most important hurdle in a new project is creating a framework to run tests. The requirements for a test framework are pretty simple: - make it easy to write new tests; - make it easy to run the tests; - don’t waste time writing fancy test apparatus. The specifics of your test framework will depend on your project. When possible, re-use existing frameworks, or at least borrow extensively from them. For pymake, I use two basic types of test: makefile tests and python unit tests. Makefile Tests Because the entire purpose of pymake is to parse and execute makefiles, pymake has a test harness for parsing and executing makefiles. This test harness runs make against a testcase makefile; parsing and executing the makefile should complete successfully (with a 0 exit code) and print TEST-PASS somewhere during execution. Typically, each makefile will test a single feature or a related set of features. This test harness is particularly important because pymake is supposed to be a mostly drop-in replacement for GNU make. This test harness can be used to test both GNU make and pymake. The harness was committed in revision 1 of the pymake repository, long before pymake could parse makefiles. The first tests were tests of GNU make behavior, in cases where that behavior was under-documented or confusing. Before I started implementing the meat of the parser, I already had discovered several interesting behaviors and written tests for them. tchaikovsky:/builds/pymake $ python tests/runtests.py # run the testsuite using GNU make tchaikovsky:/builds/pymake $ python tests/runtests.py -m /builds/pymake/make.py # run the testsuite using make.py As the project became basically functional, each new feature was committed with a test. See, for instance, a fix for parsing line continuations with conditional blocks. Initially, the makefile test harness only checked for success. But an important part of most test suites is to check for proper error handling. runtests.py grew additional features to allow a makefile to specify that it should return a failure error code, and also to specify a command line. It also ran each test in a clean directory, to avoid unexpected interactions between tests. Writing makefile testcases often required creativity. It’s often important to check that commands are executed in a specified order, or that a particular command is only executed once. One technique is to append output to a signal file while running commands, and then test the contents of the file (tests/diamond-deps.mk): # If the dependency graph includes a diamond dependency, we should only remake # once! all: depA depB cat testfile test `cat testfile` = "data"; @echo TEST-PASS depA: testfile depB: testfile testfile: printf "data" >>$@ This same technique is also useful to make sure that parallel execution is enabled or disabled appropriately: tests/parallel-toserial.mk. Python Unit Tests In the early stages of pymake, only some portions of the data model and parser were implemented: there were lots of low-level functions for location-tracking, line continuations, and tokenizing. It was important to me that these low-level functions were rock-solid before I started attempting to glue them together. The python standard library includes the unittest module, which is a simple framework for creating and running a test suite. import unittest class MyTest(unittest.TestCase): # any function named test* will be run as a single test case def test_arrayindex(self): self.assertEqual([1, 2, 3][0], 1) pymake uses the unittest module to test the data model and parser: tests/datatests.py and tests/parsertests.py. One annoying limitation of the unittest module is that is difficult to construct a set of test cases that run the same test code on different input data. To solve this problem, I wrote a multitest helper function. The developer writes a class with a testdata dictionary and a runSingle method, and multitest will create a test function for each element in the test data: def multitest(cls): for name in cls.testdata.iterkeys(): def m(self, name=name): return self.runSingle(*self.testdata[name]) setattr(cls, 'test_%s' % name, m) return cls class TokenTest(TestBase): testdata = { 'wsmatch': (' ifdef FOO', 2, ('ifdef', 'else'), True, 'ifdef', 8), 'wsnomatch': (' unexpected FOO', 2, ('ifdef', 'else'), True, None, 2), 'wsnows': (' ifdefFOO', 2, ('ifdef', 'else'), True, None, 2), 'paren': (' "hello"', 1, ('(', "'", '"'), False, '"', 2), } def runSingle(self, s, start, tlist, needws, etoken, eoffset): d = pymake.parser.Data.fromstring(s, None) tl = pymake.parser.TokenList.get(tlist) atoken, aoffset = d.findtoken(start, tl, needws) self.assertEqual(atoken, etoken) self.assertEqual(aoffset, eoffset) multitest(TokenTest) Tests Allow For Simple Refactoring Every project I’ve worked on has had to refactor code after it was first written. Sometimes you know you’ll have to refactor code in the future. Other times, you discover the need to refactor code well after you’ve started writing it. In either case, the test suite can allow you to perform large-scale refactoring tasks with confidence. Two examples will help explain how refactoring was important: Makefile Variable Value Representation VAR = $(OTHER) $(function arg1,arg2) Makefiles have two different “flavors” of variables, recursive and simple. When I first started pymake, I decided to parse recursive variable declarations “immediately” into an Expansion object. This worked well, and it made reporting the locations of parse errors easy. Unfortunately, there is a case where you cannot parse a variable value immediately: VAR = $(function VAR += arg1, VAR += arg2 VAR += ) In this case, VAR cannot be parsed until it has been fully constructed. Fixing this case involved changing the entire data model of variable storage: - Revision 64 (348f682e3943) - Adding a makefile test for the failing case. - Revision 67 (63531e755f52) - Refactoring variable storage to account for dynamically-composed variables. Independent Parsing Model Because parsing doesn’t perform very well, it’s good to optimize it away when possible. The original parsing code when through each makefile line by line and inserted rules, commands, and variables into the makefile data structure immediately. This makes it difficult or impossible to save the parsed structure and re-use it. On Friday I refactored the parser into two phases. The first phases creates a hierarchical parsing model independent of any particular makefile. The second phase executes the parsing model in the context of the variables of a particular Makefile. After first implementing this change, I found one serious error: I was associating commands with rules without considering conditionals such as ifdefs: all: command1 ifdef FOO command2 else command3 Fortunately, tests/ifdefs.mk was already in the testsuite, and detected this error. Fixing it required reworking the parsing model with an extra execution context to correctly associate commands with their parent rules. Secondly, after committing the parsing model, I found an additional regression when building Mozilla: the behavior of “ifndef” was reversed due to an early return statement. I was able to add an additional test and a simple fix, once I figured out what was going on. pymake status pymake features implemented since last week: - Implement $(eval): - 120:0d43efb31b37: preparatory work for passing the toplevel makefile to function evaluation - 121:ace16e634043: implement $(eval) - 122:1995f94b1c2f: Implement the vpath directive - 123:17169ca68e03: Implement automatic wildcard expansion in targets and prerequisites. I hate this, but NSS uses it, and I hate NSS more. - 135:fcb8d4ddd21b: Run submakes within the same process if possible - parallel-execution branch: Parallel execution of commands (-jN) - 156:3ae1e58c1a25: Cache parser models (avoid reparsing rules.mk) - win32-msys branch: Ted has pymake working on Windows. It doesn’t build Mozilla yet because we leak MSYS paths into makefiles, but that shouldn’t be hard to fix. February 24th, 2009 at 6:53 am Out of interest, are you still going to support gmake on MSYS and/or cygwin? February 27th, 2009 at 7:49 pm I couldn’t agree more about the value of good tests on a project like this. We have an extensive set of tests (nearly 2,000 individual tests!) for gmake compatibility, which allows us to make fixes with confidence that we haven’t caused a regression somewhere else. Unfortunately I can’t share that test suite with you, but you might want to try running gmake’s own test suite, which we have used in the past to improve our test coverage:. April 18th, 2011 at 9:15 am Pymake seems interesting to me if only because it’s non-GNU and MIT Licensed.
https://benjamin.smedbergs.us/blog/2009-02-23/sanity-and-testcases-for-pymake/
CC-MAIN-2022-33
refinedweb
1,560
53.92
Are All Types First-Class? In other words, can you have an object in Magpie that represents the type Int | Bool? Answer: Yes. Things like generics will need to internally store their type parameters. For example: class List[E] items E[] end That type parameter should be useful at the type level, for things like: def List[E] add(item E) // ... end But should also be directly available in the same way that you can do typeof(T) in C#: def List[E] displayItemType() print(E string) end This is fine if you only instantiate generics with class type arguments. But it's perfectly valid to also do: var optionalInts = List[Int | Nothing] new Which implies that Int | Nothing must itself resolve to a first-class object in Magpie. This is good because (as of 8/19) that's the current path the implementation is taking. It just makes some stuff harder because type checking has to bounce between Java and Magpie more than we'd like. This is also good in that it follows the goal of making everything the interpreter knows also available to Magpie.
http://magpie.stuffwithstuff.com/design-questions/are-all-types-first-class.html
CC-MAIN-2017-30
refinedweb
187
68.81
1) Use the appropriate tools for the job Many programmers seem to forget how important is logging an application’s behavior and its current activity. When somebody puts: log.info("Happy and carefree logging"); happily somewhere in the code, he probably doesn’t realize the importance of application logs during maintenance, tuning and failure identification. Underestimating the value of good logs is a terrible mistake. In my opinion, SLF4J is the best logging API available, mostly because of a great pattern substitution support: log.debug("Found {} records matching filter: '{}'", records, filter); In Log4j you would have to use: log.debug("Found " + records + " records matching filter: '" + filter + "'"); This is not only longer and less readable, but also inefficient because of extensive use of string concatenation. SLF4J adds a nice {} substitution feature. Also, because string concatenation is avoided and toString() is not called if the logging statement is filtered, there is no need for isDebugEnabled() anymore. BTW, have you noticed single quotes around filter string parameter? SLF4J is just a façade. As an implementation I would recommend the Logback framework, already advertised, instead of the well established Log4J. It has many interesting features and, in contrary to Log4J, is actively developed. The last tool to recommend is Perf4J. To quote their motto: Perf4J is to System.currentTimeMillis() as log4j is to System.out.println() I’ve added Perf4J to one existing application under heavy load and seen it in action in few other. Both administrators and business users were impressed by the nice graphs produced by this simple utility. Also we were able to discover performance flaws in no time. Perf4J itself deserves its own article, but for now just check their Developer Guide. Additionally, note that Ceki Gülcü (founder of the Log4J, SLF4J and Logback projects) suggested a simple approach to get rid of commons-logging dependency (see his comment). 2) Don’t forget, logging levels are there for you Every time you make a logging statement, you think hard which logging level is appropriate for this type of event, don’t you? Somehow 90% of programmers never pay attention to logging levels, simply logging everything on the same level, typically INFO or DEBUG. Why? Logging frameworks have two major benefits over System.out., i.e. categories and levels. Both allow you to selectively filter logging statements permanently or only for diagnostics time. If you really can’t see the difference, print this table and look at it every time you start typing “log.” in your IDE: ERROR – something terribly wrong had happened, that must be investigated immediately. No system can tolerate items logged on this level. Example: NPE, database unavailable, mission critical use case cannot be continued. WARN – the process might be continued, but take extra caution. Actually I always wanted to have two levels here: one for obvious problems where work-around exists (for example: “Current data unavailable, using cached values”) and second (name it: ATTENTION) for potential problems and suggestions. Example: “Application running in development mode” or “Administration console is not secured with a password”. The application can tolerate warning messages, but they should always be justified and examined. INFO – Important business process has finished. In ideal world, administrator or advanced user should be able to understand INFO messages and quickly find out what the application is doing. For example if an application is all about booking airplane tickets, there should be only one INFO statement per each ticket saying “[Who] booked ticket from [Where] to [Where]“. Other definition of INFO message: each action that changes the state of the application significantly (database update, external system request). DEBUG – Developers stuff. I will discuss later what sort of information deserves to be logged. TRACE – Very detailed information, intended only for development. You might keep trace messages for a short period of time after deployment on production environment, but treat these log statements as temporary, that should or might be turned-off eventually. The distinction between DEBUG and TRACE is the most difficult, but if you put logging statement and remove it after the feature has been developed and tested, it should probably be on TRACE level. The list above is just a suggestion, you can create your own set of instructions to follow, but it is important to have some. My experience is that always everything is logged without filtering (at least from the application code), but having the ability to quickly filter logs and extract the information with proper detail level, might be a life-saver. The last thing worth mentioning is the infamous is*Enabled() condition. Some put it before every logging statement: if(log.isDebugEnabled()) log.debug("Place for your commercial"); Personally, I find this idiom being just clutter that should be avoided. The performance improvement (especially when using SLF4J pattern substitution discussed previously) seems irrelevant and smells like a premature optimization. Also, can you spot the duplication? There are very rare cases when having explicit condition is justified – when we can prove that constructing logging message is expensive. In other situations, just do your job of logging and let logging framework do its job (filtering). 3) Do you know what you are logging? Every time you issue a logging statement, take a moment and have a look at what exactly will land in your log file. Read your logs afterwards and spot malformed sentences. First of all, avoid NPEs like this: log.debug("Processing request with id: {}", request.getId()); Are you absolutely sure that request is not null here? Another pitfall is logging collections. If you fetched collection of domain objects from the database using Hibernate and carelessly log them like here: log.debug("Returning users: {}", users); SLF4J will call toString() only when the statement is actually printed, which is quite nice. But if it does… Out of memory error, N+1 select problem, thread starvation (logging is synchronous!), lazy initialization exception, logs storage filled completely – each of these might occur. It is a much better idea to log, for example, only ids of domain objects (or even only size of the collection). But making a collection of ids when having a collection of objects having getId() method is unbelievably difficult and cumbersome in Java. Groovy has a great spread operator (users*.id), in Java we can emulate it using the Commons Beanutils library: log.debug("Returning user ids: {}", collect(users, "id")); Where collect() method can be implemented as follows: public static Collection collect(Collection collection, String propertyName) { return CollectionUtils.collect(collection, new BeanToPropertyValueTransformer(propertyName)); } The last thing to mention is the improper implementation or usage of toString(). First, create toString() for each class that appears anywhere in logging statements, preferably using ToStringBuilder (but not its reflective counterpart). Secondly, watch out for arrays and non-typical collections. Arrays and some strange collections might not have toString() implemented calling toString() of each item. Use Arrays #deepToString JDK utility method. And read your logs often to spot incorrectly formatted messages. 4) Avoid side effects Logging statements should have no or little impact on the application’s behavior. Recently a friend of mine gave an example of a system that threw Hibernates’ LazyInitializationException only when running on some particular environment. As you’ve probably guessed from the context, some logging statement caused lazy initialized collection to be loaded when session was attached. On this environment the logging levels were increased and collection was no longer initialized. Think how long would it take you to find a bug without knowing this context? Another side effect is slowing the application down. Quick answer: if you log too much or improperly use toString() and/or string concatenation, logging has a performance side effect. How big? Well, I have seen server restarting every 15 minutes because of a thread starvation caused by excessive logging. Now this is a side effect! From my experience, few hundreds of MiB is probably the upper limit of how much you can log onto disk per hour. Of course if logging statement itself fails and causes business process to terminate due to exception, this is also a huge side effect. I have seen such a construct to avoid this: try { log.trace("Id=" + request.getUser().getId() + " accesses " + manager.getPage().getUrl().toString()) } catch(NullPointerException e) {} This is a real code, but please make the world a bit better place and don’t do it, ever. 5) Be concise and descriptive Each logging statement should contain both data and description. Consider the following examples: log.debug("Message processed"); log.debug(message.getJMSMessageID()); log.debug("Message with id '{}' processed", message.getJMSMessageID()); Which log would you like to see while diagnosing failure in an unknown application? Believe me, all the examples above are almost equally common. Another anti-pattern: if(message instanceof TextMessage) //... else log.warn("Unknown message type"); Was it so hard to include thee actual message type, message id, etc. in the warning string? I know something went wrong, but what? What was the context? A third anti-pattern is the “magic-log”. Real life example: most programmers in the team knew that 3 ampersands followed by exclamation mark, followed by hash, followed by pseudorandom alphanumeric string log means “Message with XYZ id received”. Nobody bothered to change the log, simply someone hit the keyboard and chose some unique “&&&!#” string, so that it can be easily found by himself. As a consequence, the whole logs file looks like a random sequence of characters. Somebody might even consider that file to be a valid Perl program. Instead, a log file should be readable, clean and descriptive. Don’t use magic numbers, log values, numbers, ids and include their context. Show the data being processed and show its meaning. Show what the program is actually doing. Good logs can serve as a great documentation of the application code itself. Did I mention not to log passwords and any personal information? Don’t! 6) Tune your pattern Logging pattern is a wonderful tool, that transparently adds a meaningful context to every logging statement you make. But you must consider very carefully which information to include in your pattern. For example, logging date when your logs roll every hour is pointless as the date is already included in the log file name. On the contrary, without logging the thread name you would be unable to track any process using logs when two threads work concurrently – the logs will overlap. This might be fine in single-threaded applications – that are almost dead nowadays. From my experience, the ideal logging pattern should include (of course except the logged message itself): current time (without date, milliseconds precision), logging level,. A somewhat more advanced feature of a logging frameworks is the concept of Mapped Diagnostic Context. MDC is simply a map managed on a thread-local basis. You can put any key-value pair in this map and since then every logging statement issued from this thread is going to have this value attached as part of the pattern. 7) Log method arguments and return values When you find a bug during development, you typically run a debugger trying to track down the potential cause. Now imagine for a while that you can’t use a debugger. For example, because the bug manifested itself on a customer environment few days ago and everything you have is logs. Would you be able to find anything in them? If you follow the simple rule of logging each method input and output (arguments and return values), you don’t even need a debugger any more. Of course, you must be reasonable but every method that: accesses external system (including database), blocks, waits, etc. should be considered. Simply follow this pattern: public String printDocument(Document doc, Mode mode) { log.debug("Entering printDocument(doc={}, mode={})", doc, mode); String id = //Lengthy printing operation log.debug("Leaving printDocument(): {}", id); return id; } Because you are logging both the beginning and the end of method invocation, you can manually discover inefficient code and even detect possible causes of deadlocks and starvation – simply by looking after “entering” without corresponding “leaving”. If your methods have meaningful names, reading logs would be a pleasure. Also, analyzing what went wrong is much simpler, since on each step you know exactly what has been processed. You can even use a simple AOP aspect to log a wide range of methods in your code. This reduces code duplication, but be careful, since it may lead to enormous amount of huge logs. You should consider DEBUG or TRACE levels as best suited for these types of logs. And if you discover some method are called too often and logging might harm performance, simply decrease logging level for that class or remove the log completely (maybe leaving just one for the whole method invocation?) But it is always better to have too much rather than too few logging statements. Treat logging statements with the same respect as unit tests – your code should be covered with logging routines as it is with unit tests. No part of the system should stay with no logs at all. Remember, sometimes observing logs rolling by is the only way to tell whether your application is working properly or hangs forever. 8) Watch out for external systems This is the special case of the previous tip: if you communicate with an external system, consider logging every piece of data that comes out from your application and gets in. Period. Integration is a tough job and diagnosing problems between two applications (think two different vendors, environments, technology stacks and teams) is particularly hard. Recently, for example, we’ve discovered that logging full messages contents, including SOAP and HTTP headers in Apache CXF web services is extremely useful during integration and system testing. This is a big overhead and if performance is an issue, you can always disable logging. But what is the point of having a fast, but broken application, that no one can fix? Be extra careful when integrating with external systems and prepare to pay that cost. If you are lucky and all your integration is handled by an ESB, then the bus is probably the best place to log every incoming request and response. See for example Mules’ log-component. Sometimes the amount of information exchanged with external systems makes it unacceptable to log everything. On the other hand during testing and for a short period of time on production (for example when something wrong is happening), we would like to have everything saved in logs and are ready to pay performance cost. This can be achieved by carefully using logging levels. Just take a look at the following idiom: Collection<Integer> requestIds = //... if(log.isDebugEnabled()) log.debug("Processing ids: {}", requestIds); else log.info("Processing ids size: {}", requestIds.size()); If this particular logger is configured to log DEBUG messages, it will print the whole requestIds collection contents. But if it is configured to print INFO messages, only the size of collection will be outputted. If you are wondering why I forgot about isInfoEnabled() condition, go back to tip #2. One thing worth mentioning is that requestIds collection should not be null in this case. Although it will be logged correctly as null if DEBUG is enabled, but big fat NullPointerException will be thrown if logger is configured to INFO. Remember my lesson about side effects in tip #4? 9) Log exceptions properly First of all, avoid logging exceptions, let your framework or container (whatever it is) do it for you. There is one, ekhem, exception to this rule: if you throw exceptions from some remote service (RMI, EJB remote session bean, etc.), that is capable of serializing exceptions, make sure all of them are available to the client (are part of the API). Otherwise the client will receive NoClassDefFoundError: SomeFancyException instead of the “true” error. Logging exceptions is one of the most important roles of logging at all, but many programmers tend to treat logging as a way to handle the exception. They sometimes return default value (typically null, 0 or empty string) and pretend that nothing has happened. Other times they first log the exception and then wrap it and throw it back: log.error("IO exception", e); throw new MyCustomException(e); This construct will almost always print the same stack trace two times, because something will eventually catch MyCustomException and log its cause. Log, or wrap and throw back (which is preferable), never both, otherwise your logs will be confusing. But if we really do WANT to log the exception? For some reason (because we don’t read APIs and documentation?), about half of the logging statements I see are wrong. Quick quiz, which of the following log statements will log the NPE properly? try { Integer x = null; ++x; } catch (Exception e) { log.error(e); //A log.error(e, e); //B log.error("" + e); //C log.error(e.toString()); //D log.error(e.getMessage()); //E log.error(null, e); //F log.error("", e); //G log.error("{}", e); //H log.error("{}", e.getMessage()); //I log.error("Error reading configuration file: " + e); //J log.error("Error reading configuration file: " + e.getMessage()); //K log.error("Error reading configuration file", e); //L } Surprisingly, only G and preferably L are correct! A and B don’t even compile in SLF4J, others discard stack traces and/or print improper messages. For example, E will not print anything as NPE typically doesn’t provide any exception message and the stack trace won’t be printed as well. Remember, the first argument is always the text message, write something about the nature of the problem. Don’t include exception message, as it will be printed automatically after the log statement, preceding stack trace. But in order to do so, you must pass the exception itself as the second argument. 10) Logs easy to read, easy to parse There are two groups of receivers particularly interested in your application logs: human beings (you might disagree, but programmers belong to this group as well) and computers (typically shell scripts written by system administrators). Logs should be suitable for both of these groups. If someone looking from behind your back at your application logs sees (source Wikipedia): then you probably have not followed my tips. Logs should be readable and easy to understand just like the code should. On the other hand, if your application produces half GB of logs each hour, no man and no graphical text editor will ever manage to read them entirely. This is where old-school grep, sed and awk come in handy. If it is possible, try to write logging messages in such a way, that they could be understood both by humans and computers, e.g. avoid formatting of numbers, use patterns that can be easily recognized by regular expressions, etc. If it is not possible, print the data in two formats: log.debug("Request TTL set to: {} ({})", new Date(ttl), ttl); // Request TTL set to: Wed Apr 28 20:14:12 CEST 2010 (1272478452437) final String duration = DurationFormatUtils.formatDurationWords(durationMillis, true, true); log.info("Importing took: {}ms ({})", durationMillis, duration); //Importing took: 123456789ms (1 day 10 hours 17 minutes 36 seconds) Computers will appreciate “ms after 1970 epoch” time format, while people would be delighted seeing “1 day 10 hours 17 minutes 36 seconds” text. BTW take a look at DurationFormatUtils, nice tool. That’s all guys, a “logging tips extravaganza” from our JCP partner, Tomasz Nurkiewicz. Don’t forget to share! - Logging Antipatterns - Things Every Programmer Should Know - Laws of Software Design - Java Best Practices – Vector vs ArrayList vs HashSet - Java Best Practices – DateFormat in a Multithreading Environment - Java Best Practices – High performance Serialization - Java Best Practices – String performance and Exact String Matching How can we parse the exception generated in the log file. Why do projects use logging directly? Encapsulation states that you should be able to change any facet of your implementation in one place and one place only. So, why spread the logging implementation details all over your code base like by having a reference to org.apache.log4j.Logger? Listing slf4j as a solution to an error in proper encapsulation only INDIRECTS the problem further. Try debugging logging in a system that has commons logging, log4j, slf4j and logback. It is CRAZY! I wish everybody ran their code with a proper security manager so when a package like slf4j tries to usurp your namespace and take over for org.apache.log4j, it would “just say NO!” Namespace hacking is not a solution. Additionally, Tomcat can barely handle its own namespace and classloading with regards to webapps – I don’t want to think about all the logging indirections trying to run on top of it with slf4j whining about it how it can see itself! Nice tips! Logging SOAP messages is useful. But you need tool to read messages instead coping them to xmlxpy. I’m using OtrosLogViewer with SOAP formatting. Awesome. Nice article man! thanks a lot I am working on logs & this was helpful to me. Wonderful article You say log4j is not well developed. Would you mind revising with the log4j2 in place now? Also it has most of the new features of Lo8gBack (with pattern substitution etc..). After this i guess there is no need for slf4j facade! Do you really follow tip 7 pattern? (log method entry and exit) do you use any tool / library for that or do that manually? isn’t that cluttering your code? (if you really follow it..) thanks. Try using a logging plugin tool for an IDE. I’ve had great success with log4e with Eclipse. With a few mouse clicks, I can have an entire class logged that follows tip #7 and then some. I don’t find it clutters the code too, but if you do, you can use AOP instead and maybe filter out getters/setters. Nice article! Great tips! Loved the jokes! Well said, a lot of experience in this article. Do not miss it, must read! :)
http://www.javacodegeeks.com/2011/01/10-tips-proper-application-logging.html
CC-MAIN-2014-35
refinedweb
3,656
56.55
Hi! I want to show an image for a few miliseconds with a wait function without let the rest of the code wait. Is there any way to do that? Ich think a thread would be oversized for this… Hi! Since C++11 you could do this: #include <future> .... auto handle = std::async(std::launch::async, [&]() { { const MessageManagerLock mmLock(Thread::getCurrentThread()); if (!mmLock.lockWasGained()) return; // Show image } std::this_thread::sleep_for(std::chrono::milliseconds(100)); // Sleep for 100ms { const MessageManagerLock mmLock(Thread::getCurrentThread()); if (!mmLock.lockWasGained()) return; // Hide image } }); // Code that should not be blocked handle.wait(); // Wait for image to be hidden again. Actually, what you want is a different thread that will display your image, wait for 100ms and then hide it again. There are many ways to do that. Juce itself got a thread class from which you can inherit and C++11 got some fancy new toys (). Please don’t follow the above advice! In a case as trivial as this, two things NOT to do are: Use threads. When doing pure GUI work, threads are generally best avoided, and totally unnecessary in a case like this Block the message thread and “wait”. You mustn’t think about this in terms of “waiting”. What you actually want to happen is to create some GUI that displays your image, and to start a timer which will remove/delete the GUI after a given time has passed. Nothing in GUI code should ever spin or wait, or block. The only class you need to do this is Timer. Or maybe the SplashScreen class will already do what you need? Thanks very much! The Timer was what I searched for!
https://forum.juce.com/t/no-locking-wait-function/18772
CC-MAIN-2022-27
refinedweb
280
75.91
Your mortal enemy would like to ship a really great product in a week or two. Towards the goal of maximally delaying this product, you may inject a single C preprocessor definition into one of their header files. What is it? Keep in mind that anything which stops the project from compiling will be rapidly detected and therefore does not meet the goal. Here are a few examples to get started with (some my own, some from a Reddit thread today). #define FALSE 1 #define FALSE exit() #define while if #define goto #define struct union #define assert(x) #define volatile #define continue break #define double int #define long short #define unsigned signed Have fun. Update: Someone on hacker news posted a link to The Disgruntled Bomb, which is based on the same idea. Nice! #define malloc(s) malloc(s-1) It seems to me the prototypes are just similar enough that this might go unnoticed: #define crypt strcpy Some compilers famously would continue to compile correctly all functions that had a single return statement at the very end of the body if you did this, but of course return statements in the middle of the body would break: #define return Function rand() is in stdlib.h, so you can try your luck: #define TRUE (rand()) I appreciate the gist of the challenge/question, but to have a shot at answering something meaningful, you’d need to see the code you’re trying to damage. Changing “volatile” to whitespace when there is no use of volatile doesn’t do much damage. Go ahead & #define “goto” to whitespace in my code – won’t do a thing… Not trying to be a downer, just trying to make it more intellectual / challenging, that’s all. Maybe that’s pointless, since technically a program could be an empty main(), and thus virtually immune to any of these attacks. The goal should be for the injection to be undetected by compiler and runtime for a significant period, to work the changes through distribution channels. Optimize on that. #define NULL ((void*)1) This will be particularly bad if you can get *everything* including *some* of the dev’s kernels built using it. My favourite ones, evil enough to be used for real purposes (C++) #define class struct #define private public #define protected public I came up with this one a while ago: #define if(x) if(((x) != 0) ^ ((random() % 1000000 == 0)) In short, it makes every if statement in the program have about a one-in-a-million chance of flipping. A debugger won’t show any changes (other than the obvious one of the code flow going where it shouldn’t be), and stepping through the code a second time is unlikely to show the problem again. If you place this in a header which is included everywhere but which nobody pays attention to, I think this could survive for *years* without detection, causing continual low-level havoc. #define free(p) free(p) free(p) #define if(…) if((::time(NULL) % 100) && (__VA_ARGS__)) Bah, sorry, too much C++. s/::// #define fopen(f,m) fopen(f, m “b”) This can mess up Windows code, but has no effect at all on Unix, of course (which means, if my past jobs are any indication, that none of the devs will find it early). Sorry mikeash, didn’t see your comment before I posted. Yours is more elegant, and only requires stdlib.h. Nice. 🙂 Thanks folks, these are great. I think the ones that introduce non-deterministic, low-probability failures are probably the most evil. In response to JR: #define free(p) Secret memory leak is more stealthy than secret double free 🙂 The following one could probably be looked at directly by the adversary without him catching on: #define memcpy(dest, source, n) bcopy((void*)dest, (void*)source, n) Frustratingly deterministic take on the random if failures, with extra heisenbug power: #define if(x) if(((x) != 0) ^ ((__LINE__ % 100 == 0)) Related to Henry’s malloc trick: #define bzero(x,y) bzero((x)-1,y+1) These would be good for adding exploits that would likely go unnoticed until after shipping: #define strncpy(d,s,n) strcpy(d,s) #define random(x) 42 (think password hashes and authentication tokens with the second one… for extra hard to detect evil, replace with ‘random(x) % 100’ to make it appear to generate random numbers, while giving you a small space to brute force) How did you miss this, my fav. #define TRUE FALSE 🙂 I’m no C programmer, but my favourite in C++ is #define for new int; for I guess the C equivalent would be #define for malloc(sizeof(int)); for My god. I inadvertently, started this by thinking that “there isn’t a bool in c”. I’m an internet celebrity! Anything that only comes into play when the DEBUG macro is defined? Or if that isn’t available, put it in a system header that’s only included by a few files. Whatever is done, it should result in a small number of critical failures to give the least information about where it is. come on guys, gotta be truly sneaky and subtle here. if you’re using stuff like #define TRUE FALSE it won’t cause any appreciable delay. anyone who finds that statement in the header file will instantly see that its incoherent nonsense and remove it. thats no better than just inserting random compile time errors. what you need to do is introduce subtle bugs that look fine to a programmer reading the code without taking much time to examine it. the secret memory leak tricks are pretty good, but the preprocessor statement should be stealthy in its own right. if you #define free(p) then you’ll get your leak but you’ll also get it fixed kinda quickly because defining anything as whitespace is obviously weird and suspicious. i’d go with something that looks innocent but isn’t. it should look like a naive mistake, something a programmer did to save a few keystrokes without realizing how bad of an error it is. #define atoi(*char str) toInt(char str) or something of that nature. it looks totally passable, it really might have been an attempt by an experienced Java programmer to alias atoi to the function name he remembers more readily. its wrong though. the argument is a reference but the alias takes a value, it will never work correctly. #define main main(int argc, char *argv[], char *envp[]) { extern int time(int *), abort(), other_main(); return (time(0) % 10000000) ? other_main(argc, argv, envp) : abort(); } int other_main I reckon an experienced C/C++ programmer would track down anything quite quickly, especially if he’s been tipped off about the possibility of sabotage (or is the paranoid type! a.k.a. experienced). I also reckon we just have to assume the coding is done in a simple environment as simply hovering the mouse over anything that’s been #defined will be given away. The more evil examples above most probably won’t show up until the product is out there, but the aim of the exercise was to delay the release in the first place! Anyway, here’s my submission: #define stderr stdout A lot of fun submissions, but you guys are going about it all wrong. I’d use one of those dream-machine devices from “Inception” and plant the following idea into management’s subconscious mind: “Use C++” #define FALSE fork() #define 1 fork() let’s just try both options, right ?
https://blog.regehr.org/archives/574
CC-MAIN-2019-18
refinedweb
1,258
57.1
JScript .NET, Part VII: Consuming add from ASP.NET: A Final Word - Doc JavaScript JScript .NET, Part VII: Consuming add from ASP.NET A Final Word In this column, we showed you how to consume Web services from ASP.NET. We first explained ASP.NET's role in server interactions, and its similarities to HTML's role in client interactions. We guided you through the process of defining a default Web site and linking it to the directory where your files reside on your hard drive. We went through the flow of generating the proxy for the add Web service, its class, namespace, and .dll file. We taught you how to write the ASP.NET consumer, with its two ASP.NET controls, ASP:TEXTBOX and ASP:BUTTON. We showed the JScript .NET portion of the page, how to call the Web service from within the consumer, and what the page looks like in the browser. In this column you have learned: - How to use ASP.NET - How to define a virtual directory - How to create a proxy - How to create a .dll file - How to write ASP.NET controls - How to write JScript .NET for ASP.NET - How to consume the addWeb service The following files were zipped for you: simpleCalc.asmx (the add Web service) and simpleCalcConsumer.aspx (a consumer of the add Web service). Produced by Yehuda Shiran and Tomer Shiran Created: June 30, 2002 Revised: June 30, 2002 URL:
http://www.webreference.com/js/column113/9.html
CC-MAIN-2016-26
refinedweb
242
77.94
Introducing mod_parrot It’s been almost nine years since the first release of mod_perl, and it remains a very powerful tool for writing web applications and extending the capabilities of the Apache web server. However, lurking around the corner is Perl 6, which gives us not only a new version of Perl to embed in Apache but an entirely new runtime engine called Parrot. If there is ever going to be a Perl 6 version of mod_perl, Apache must first be able to run Parrot bytecode. This article introduces mod_parrot, an Apache module that allows the execution of Parrot bytecode from within the web server. Like mod_perl, it also gives your code direct access to the Apache API so you can write your own handlers. What is Parrot? Parrot is a virtual machine (VM) optimized for dynamic languages like Perl, Python, PHP, and Ruby. Source code written in each of these languages eventually compiles down to bytecode (after some optimizations), which subsequently runs in a virtual machine. Currently, each language runs bytecode with its own VM, but one of Parrot’s goals is to provide a single common VM for all dynamic languages. This makes implementing a new language much easier because there’s no need to worry about writing a new VM, and this also makes it possible for code in one language to call code or access data structures from another language. Parrot code comes in three distinct flavors: - Bytecode: This is the file format natively interpreted by Parrot. - PASM: Parrot assembler (PASM) is the low-level language that compiles down to bytecode. It has very simple operations to perform functions such as setting registers, adding numbers, and printing strings. PASM is very straightforward, but it operates at such a low level that it can be quite cumbersome. - PIR: Parrot Intermediate Representation (PIR) solves many of the problems encountered when programming in PASM. It provides more user-friendly and compiler-friendly constructs and optimizations and feels more like a traditional high-level programming language. Parrot eventually breaks down PIR into PASM before compiling to bytecode (you can even include PASM blocks in PIR). All of the examples in this article use PIR. For more information on Parrot, including PASM and PIR syntax, visit the Parrot website. It will provide a good background for understanding the code in this article. Why mod_parrot? Before discussing the details, you should know a little about mod_parrot’s history. Ask Björn Hansen and Robert Spier originally wrote mod_parrot in 2002, later turning it over to Kevin Falcone. This version of mod_parrot targeted Apache 1.3 and had very limited functionality due to Parrot’s immaturity at the time. In August 2004, with Parrot and its API much more mature, people suggested that the development on mod_parrot continue. This is where I picked up the project. However, instead of picking up where Ask, Robert, and Kevin left off, I started from scratch, coding for Apache 2 and focusing on access to the Apache API. The new mod_parrot project has three primary goals: - Provide access to the Apache API through Parrot objects - Provide a common Apache layer for Parrot-based languages - Support for new languages should require little or no C coding Let’s discuss each of these in more detail. Provide Access to the Apache API Through Parrot Much of mod_perl’s power comes from direct access to the Apache API. Rather than restrict your code to content generation, mod_perl provides hooks for things such as authentication handlers and output filters and gives you access to Apache’s internal structures, all in Perl. Once you have this functionality, it is easy to implement other useful features including script caching and persistent database connections. mod_parrot shares this approach, providing access to the Apache API from Parrot. It does this using Parrot objects, mimicking mod_perl’s use of $r. There will eventually be hooks for all phases of the Apache lifecycle, though the current version supports only content handlers and authentication handlers. Provide a Common Apache Layer for Parrot-based Languages There are several different languages that can run inside Apache today. The major players here are mod_perl and PHP, but Python, Ruby, and even LISP have modules embedding them into Apache. Each of these implementations comes with its own Apache module, which makes sense for languages with different runtime engines. This is where Parrot changes the landscape dramatically-all languages targeted to the Parrot VM now have a common runtime engine, so they need only one Apache module: mod_parrot. Support for New Languages Should Require Little or No C Coding mod_parrot will provide all of the infrastructure for accessing the Apache API. The actual Apache module will already be written. Hooks for calling Parrot code for each stage of the Apache lifecycle will exist. Parrot objects will provide access to the Apache API. With all of this already done, and assuming our language compiles down to Parrot bytecode, we should be able to write the “glue” between Apache and our language in the language itself. mod_perl could be written in Perl; mod_python could be written in Python, and so on. Very little C code, if any, would be necessary. Each language community could maintain its own language-specific code while sharing the mod_parrot module. Architecture mod_parrot is written for Apache 2, with no plans to back-port it to Apache 1.3. The reason behind this decision is to code for the future, not the past or present; after all, Perl 6 is still a few years down the road. It’s also much easier to write a module for Apache 2 than it is for 1.3! In addition to the Apache 2 decision, there are several other interesting aspects of the mod_parrot architecture. NCI The most significant design decision is the use of NCI (native call interface) to access the Apache API. mod_perl accesses most of the Apache API functions through individual XS wrappers (basically a bunch of C macros), themselves compiled into mod_perl itself or its supporting modules. This is a tried and true method, used for many Perl modules as well. Now, Parrot gives us NCI, which eliminates the need for these wrappers, letting you call arbitrary C functions without having to write any C code. Here’s an example of a Parrot program that calls the C function getpid(), which returns the current process ID: .sub _main # load libc.so, where getpid() is defined, and assign it to $P0 $P0 = loadlib '/lib/libc.so.6' # find the function in the library and assign it to $P1 # 'iv' means that getpid() returns an integer and takes no arguments $P1 = dlfunc $P0, 'getpid', 'iv' # call getpid() and place result in $I0 $I0 = $P1( ) # print the PID print $I0 print "\n" .end That’s it–there is no C code to write, no recompilation, and no relinking. However, the Apache API functions do not come from a loadable shared library; they’re in the Apache executable, httpd. Fortunately, NCI can run C functions contained in the running process image, solving that problem. For more information on NCI, see the Parrot NCI Documentation. The Apache::RequestRec Object All access to the Apache API goes through Parrot objects. Because mod_parrot borrows heavily from mod_perl, it made sense to base the primary object class in mod_parrot on Apache’s request_rec structure. Just as in mod_perl, the class is Apache::RequestRec. This name is subject to change, however, as Parrot’s namespace nomenclature becomes clearer. Every method is written in Parrot, with NCI calls to their corresponding Apache API functions. For example, here is the Parrot method for the ap_rputs function ( $r->puts in mod_perl): .sub puts method, prototyped .param string data .local pmc r .local pmc ap_rputs .local int offset classoffset offset, self, 'Apache::RequestRec' getattribute r, self, offset # find NCI object for ap_rputs find_global ap_rputs, 'Apache::NCI', 'ap_rputs' # use NCI to call out to Apache's ap_rputs ap_rputs( data, r ) .end Currently, Apache::RequestRec is the only class implemented in mod_parrot. Other classes to support the API will eventually appear, including classes to support Apache’s conn_rec and server_rec structures. Installing mod_parrot You can download mod_parrot from the mod_parrot home page. Additionally, you’ll need the following prerequisites (as of version 0.1): - Parrot 0.1.1 (Poicephalus) - Apache 2.0.50 or later - Perl 5.6.0 or later (for configuration only) - Apache::Test 1.13 or later (for the test suite) Once you have all the prerequisite software, run the Configure.pl script. The arguments to this script will most certainly change in future releases, but for now, there are only two arguments: --parrot-build-dir=path-to-parrot-source, the path to the top-level Parrot directory --apxs=path-to-apxs, the path to Apache’s apxsscript, usually found in the bin directory under the Apache installation directory $ perl Configure.pl --parrot-build-dir=../parrot \ --apxs=/usr/local/apache2/bin/apxs Generating Makefile...done. Creating testing infrastructure...done. Type 'make' to build mod_parrot. When configuration completes, type make to build mod_parrot, then make test to run the tests. To install, become root and type make install. This will install the mod_parrot module into your Apache installation and activate the module in httpd.conf. Writing a mod_parrot Handler While there are currently no languages targeted to Parrot that have the object support to use mod_parrot (though Parakeet in the Parrot source looks promising), we can still write Apache handlers. In what language? In Parrot, of course! Well, actually, PIR. Here’s a simple content handler that displays “Hello World,” or if you pass it an query string in the URL, “Hello name,” where name is the string you pass. # this namespace is used to identify the handler .namespace [ 'HelloWorld' ] # the actual handler .sub _handler # our Apache::RequestRec object .local pmc r # this will contain Apache constants .local pmc ap_constants # instantiate the Apache::RequestRec object find_type $I0, 'Apache::RequestRec' r = new $I0 # who should we say hello to? $S0 = r.'args'( ) $I0 = length $S0 if $I0 > 0 goto say_hello $S0 = 'world' say_hello: # call the puts method to send some output $S1 = 'Hello ' . $S0 r.'puts'( $S1 ) # tell Apache that we're finished with this phase find_global ap_constants, 'Apache::Constants', 'ap_constants' $I0 = ap_constants['OK'] .pcc_begin_return .return $I0 .pcc_end_return .end If you are at all familiar with mod_perl or the Apache API, this should look familiar to you, even if you don’t know any Parrot. Let’s go through the code to see how it works. Because this is not an article about Parrot itself, I’ll glaze over the syntax and concentrate on what the code actually does. The first line of code in the handler declares the namespace in which this handler exists. In this case, it is HelloWorld. This is important because namespaces differentiate one handler from another in httpd.conf. Next comes the actual handler subroutine, which should always be named _handler. The first thing the subroutine does is to declare some locally scoped “variables.” These are actually registers in Parrot, but PIR can abstract them with named variables as it were a higher level language. And ap_constants, a hash that will give access to Apache constants including OK and DECLINED, come next. Both are PMCs, or Parrot Magic Cookie, a special data type that implements the more complex data types of higher-level languages such as Perl or Python. The code now checks for a query string using the args method of the Apache::RequestRec object and, if one exists, assigns it to the temporary string register $S0. If there is no query string, $S0 will contain world. Next, the code creates the output string, instantiates the Apache::RequestRec object, and calls the puts method to output “Hello World” or “Hello name”. By default, the content type is text/html, so there’s no need to set it here. This is the end of the handler, so it’s time to tell Apache that we’re done and that it no longer needs to handle this phase of the request. This requires returning the Apache constant OK from the ap_constants hash in the Apache::Constants namespace. To compile the handler into Parrot bytecode, save it in a file with a .imc extension (IMC is short for Intermediate Compiler). Then, compile it into Parrot bytecode (PBC) as follows (this step will be automatic in a future release): $ parrot -o HelloWorld.pbc HelloWorld.imc Configuring Apache to Use A Handler Writing the handler was the hard part. Configuring Apache to use it is easy. The first thing to do is to initialize mod_parrot and load some bytecode libraries: # mod_parrot initialization ParrotInit /path/to/lib/ModParrot/init.pbc ParrotLoad /path/to/lib/Apache/RequestRec.pbc ParrotLoad /path/to/lib/Apache/Constants.pbc # our handler ParrotLoad /path/to/HelloWorld.pbc ParrotInit tells mod_parrot where to find its initialization bytecode. A future release will probably handle this automatically, but for now explicitly set the path in httpd.conf. ParrotLoad tells mod_parrot to load a bytecode file. In this case, it loads the code that implements the Apache::RequestRec object and the constants hash, as well as the bytecode for the new handler. Next, Apache needs a location for the handler to, well, handle. How about the location /hello: <Location /hello> SetHandler parrot-code ParrotHandler HelloWorld </Location> First, this sets the Apache handler for the location to parrot-code. This is the official name of the mod_parrot handler. Then it sets the actual Parrot handler, which, as discussed in the previous section, is the namespace of the handler subroutine, HelloWorld. That’s it. Save the configuration, restart Apache, point your browser to (replacing yourserver with the name of your server), and you should see the “Hello World” message. Add a query string to see the output change: should produce “Hello Joe.” Writing an Authentication Handler Apache handlers do more than just generate content, of course, and this applies to mod_parrot as well. Here’s an example of using an authentication handler to protect a private directory. It will use the HTTP basic authentication scheme, but instead of using a standard password file, it will accept any username as long as the password is “squawk.” Here’s the handler PIR code: # this namespace is used to identify the handler .namespace [ 'TestAuthHandler'] # the actual handler .sub _handler # our Apache::RequestRec object .local pmc r .local string pw .local int status # this will contain Apache constants .local pmc ap_constants find_global ap_constants, 'Apache::Constants', 'ap_constants' # instantiate the Apache::RequestRec object find_type $I0, 'Apache::RequestRec' r = new $I0 # check the password, ignoring the username (status, pw) = r.'get_basic_auth_pw'( ) if pw != 'squawk' goto auth_failure $I0 = ap_constants['OK'] goto auth_return_status # authentication failed auth_failure: $I0 = ap_constants['HTTP_UNAUTHORIZED'] goto auth_return_status # return our status code auth_return_status: .pcc_begin_return .return $I0 .pcc_end_return .end Here is the corresponding configuration in httpd.conf. Instead of using SetHandler and ParrotHandler here, set ParrotAuthenHandler to the namespace of the authentication handler: <Directory /usr/local/apache/htdocs/private> ParrotAuthenHandler TestAuthHandler AuthType Basic AuthName Private Require valid-user </Directory> Remembering Why We’re Here Note the low-level nature of the two handlers. There are no else clauses; goto statements appear throughout the subroutine; and return values must be assigned to registers before being used in another operation. You can plainly see that this is only one step above writing assembly here, but remember that you won’t have to worry about writing code at this level–you’ll write in a high-level language such as Perl 6, and it will eventually compile down to Parrot assembler. Looking forward, the corresponding Perl 6 code for the HelloWorld handler might look a lot like this (as with all things Perl 6, this is subject to change): use Apache::Constants ':common'; use Apache::RequestRec; sub handler(Apache::RequestRec $r) { my ($status, $pw) = $r.get_basic_auth_pw(); return ($pw eq 'squawk') ? OK : HTTP_UNAUTHORIZED; } Future Directions mod_parrot is still in its infancy. It’s quite functional, but there is still a lot of work to do before it can power any serious applications. At this point in development, the primary goal is to finish hooking into all phases of the Apache request lifecycle, including support for the relevant Apache API functions. Windows support will also become a priority as mod_parrot becomes more functional. You may also wonder about CGI scripts. As of this writing, there is no support for running CGI scripts in mod_parrot. mod_perl has Apache::Registry to help CGI scripts run in a persistent environment, and mod_parrot will need a similar infrastructure. However, the real fun will begin when we have a high level language that we can use to write handlers. If the timelines work out as I hope they will, mod_parrot will be fully functional before the formal release of Perl 6 or any other mainstream Parrot-based language. Because the Apache/Parrot layer will have already been written, this will save quite a bit of development time for mod_perl, PHP, and other similar projects. If you’d like to read more about mod_parrot, or would like to help with the project, visit the mod_parrot home page.
https://www.perl.com/pub/2004/12/22/mod_parrot.html/
CC-MAIN-2019-26
refinedweb
2,852
54.93
[++. 37 thoughts on “C++ Turns 30 – Looking Forward to the Future” Burn it with fire and go over to golang… :-) – but I’m not sure that I’m actually joking… I’ve never liked object oriented programming. Maybe that is because I started out with assembly and then moved on to C. B and BCPL, then C. Sorry BCPL, then B and then C followed. I stared out with C, and moved on to C++ shortly after that. Once the whole OOP thing clicks, it’s much easier to deal with. Of course the ability to link with Python (via python-config), Java (via JNI, pretty ugly), C (extern “C”), etc. is also nice. I think that the intentions of OO in C++ are quite different than what people thinks. I have seen people writing Java in C++, trying to fit everything in a class. But if you look at the stl, objects mostly encapsulate resources (vector, array, string, smart pointers…), which is something objects do well, and provides a clean way of ensuring you don’t leak anything. The other major use of classes/structs in stl is to take advantage of templates, which properly used are a great boost for the language. If your problem in question does not match OO principles you can write clean, scoped, modules of functions using separated files and namespaces, and your code will be clean, clear, reusable and beautifully written in C++. The thing I don’t like in C++ is that has too many stuff from the old C and the developing C++, and some of that stuff still cannot be removed without leaving a hole; includes are not the best thing, macros are still around, and ugly hacks are sometimes needed with templates. If a new language had the same principles I see in the design of stl but dropped all the ugliness remaining in C++ i’d switch to it and never go back. Seems like D may be fulfilling those criteria! C++ is the most expressive programming language out there, and thus the most complicated one to learn. It has everything; templates, classes, generics, functional programming, OOP e.t.c. This makes it excellent at modeling and abstraction but it can be quite hard to learn to program in C++ properly. I peronally enjoy programming in C++, especially when using it within the context of the Qt Framework. Golang on the other hand, while it is a great language in its own right, with great growth potential….it is not as flexible nor as expressive as C++ but it is really not meant to be…That’s the whole point…it’s supposed to be an easy language to learn and use and possess a minimum number of features required to make it a success. Golang’s major weakness is its lack of libraries (especially native libs) out there. But that should change quickly. Golang is still slightly older than 5 years. BTW golang does OOP. It just does it without classes OOP is like socialism – good intentions but broken by design and usually ends in a disaster. Any day I’ll pick assembly or C over any object oriented cancer. Guess you never made a program larger then a shoe-box. Cause every program I’ve seen larger then a man year of development is ether OO, or a spaghetti code mess. I’ve seen C programmers really express hate for C++, and then you look at their code and they are just replicating C++ classes with plain C code. Doing all the work themselves instead of letting the compiler do it. Your unfounded comment about socialism aside, OOP lends itself to express solutions to certain domains quite naturally. To name at least one example; interaction of stateful entities as you would find in game design. The comment about socialism is well founded, as an acquaintance with twentieth century history will show. Hackaday comments can’t fail, only *be* failed. Only if you have a funky definition of socialism. Socialism works well in a large part of the world and even in US there are socialistic tendencies that improves the lives of the majority. It will not be _called_ socialism there though… I read some comments on the net about how one needs to really learn how to program in c++, rather than just “C with classes.” By this, they seem to mean that you should use the features that are unlikely to work in deeply embedded environments, and cause program size bloat on other platforms. (“Use the STL and automatic dynamic memory allocation.”) (I particularly like the “really good example of actual C++” I found that compiled to about 60% bigger than the “bad, C with classes” style program.) Sigh. :-) Generally the use of standard library features should have a negligible impact on the compiled binary, especially when compiled with the correct compilation flags. I would be interested to see this example you speak of. A tangential caveat, you really should try an avoid allocating dynamic memory on embedded systems. There are two things I consider wrong in that comment. First, the features of the language won’t stop working because you are compiling for an embedded system (maybe threads if your environment don’t allow such a thing). The only thing that will make standard features nonfunctional is a nonstandard compiler. Second, performance isn’t always in the side of C, sometimes C++ compilers can do optimizations that C compilers do not. As an example, functors can more often be inlined by the compiler than function pointers. In general, if your compiler is a decent C++ compiler (gcc/clang), the code is properly written and compiler optimizations are enabled the performance loss should be minimal or even not a loss but a performance gain. The “features of the language” can include use of run-time libraries and features that don’t exist for a particular platform (ie STL, as I understand it, makes heavy use of dynamically-sized containers, requiring significant ram, dynamic allocation, and a fair amount of code. “String” and “New” aren’t even implemented on Arduino (or, not “correctly” anyway.) A good C++ programmer would probably look at avr-g++ and say “no! That is not C++!” The example was at Here’s their “good” C++ program. It sorts lines from stdin. You can tell it does that, right? (Hmph.) Actually, yes I can tell what it does. It might have taken me a few minutes longer if you hadn’t provided the hint that it is sorting the lines but I would have gotten it. I’m a little bit bothered by the use of a ‘set’ instead of a ‘multi-set’ since, off the top of my head here, the set is going to eliminate any duplicate lines. A multi-set wouldn’t. I am not knocking Java when I say the biggest problem I had with it was learning the libraries. By the time I worked with Java in the early 2000s I had absorbed the C++ libraries through use and study. Trying to get all the Java libraries at one time was trying to drink from a fire hose. I can see where learning the C++ to a newcomer would be a challenge. This is horribly coded. Not only that, it is old C++. You don’t need to create a functor and a set. Probably you may use a vector and a sort. I started with C++ in ’90s – reading the Borland manuals on vacation in Hawaii just as Iraq invaded Kuwait. Weird how that is associated… Anyway, over the next 5 years I went through 3 distinct changes in my understanding of using C++. I can no longer elaborate each step, unfortunately, but they were definitely there. The first was the comprehension of encapsulation but that was an extension of structured programming data hiding. Another was seeing classes as more than just data and operations welded together. They became more truly abstractions of an entity with behaviors. Cannot remember the third shift. As you point out you can go overboard. You do have to keep in mind your overall system requirements. @WestfW Your post reads like you’ve never worked outside of embedded systems–or maybe like you’re still in college–because you think executable size is the only parameter worth optimizing, or that it correlates reliably with efficiency or speed of execution. If you’d worked on a larger app with a team you’d know that sometimes it’s worth sacrificing executable size in favor of maintainability, scalability, modularity, any number of other qualities, or combinations thereof. Don’t get me wrong, C++’s features provide a stupendous amount of rope to hang oneself with, but no one’s making anyone use them. Not every project has to take advantage of the template system and preprocessor directives both being turing complete. Could be. The two-faced-ness bothers me. On the one hand, some C++ programmers are enticing embedded engineers: “use C++; it has features that will improve reliability and productivity without causing bloat!”, and on the other hand there is the “If you’re not using STL and other bloat-inducing features for everything, you’re not really programming in C++.” Wow, only 4.4 mil estimated users ? Not that this does not imply broad acceptance, but in the grand scheme of things, world population, etc. suddenly the ‘tech world’ starts to feel like a tiny island. Assuming that a major part of the human world has a life under the poverty line and under the fact that we have many human beings on earth that are younger than 15 years and many that are older than 60 years, and understanding that there are many constrcution worker, med. Dr., teachers and Accountants and also a lot of woman in the world that do not work in a profession at all but care for their family…. I find 4.4M rather high. Really? When the worldwide internet use is considered to be over a billion users? 4.4M seems pitifully tiny by comparison, and not even slightly realistic. What portion of internet users are actually using the internet, rather than using a device that relies on the internet? Of those, how many use sites other than facebook, reddit, etc? Of those, how many have the skills to actually write code? How many actually do on a regular basis? How many specifically write C++? Keep in mind that this basically excludes web devs, android/ios devs, huge swaths of the research world, and many other groups. Seriously, try plugging in numbers. Think of it as a demographics Drake Equation. A few million doesn’t seem too implausible to me. I just thought of something, perhaps they were referring to users of C++ rather than users of PCs? Yes, the reference is to C++, not PCs. I always viewed C++ as a needless weird variant of C, and a language that I could just skip learning. This approach has served me very well to the present day and I expect it to continue to do so. Same here. This OOP thing seems invented to confuse people, and convince them that they are somehow idiots if they aren’t on the hipster bandwagon. The typical C++ hater either hes never written any real program in C++, or has tried to use it as if it were C and thus got frustrated. Things gets worse if you add in the false assumption that a simple programming language leads to simpler programs. Also C++ is well usable for (especially 32bit) microcontrollers, if you don’t start coding with an already biased attitude that it won’t be efficient. OOP supporters really need to stop treating whatever the OOP special of the week as the one for all language. The OOP detractors need to stop acting like OOP is some sort of conspiracy. No one has just one utensil in their kitchen, no one should just use one language for everything. If I only have a handful of space in a microcontroller, go with ASM. If I want to add a little sophistication and got more space and power, I move up to C. If I’m working at modern PC levels, move up to the appropriate tool for the job. Do I need to chew up gigabytes of raw text? Perl or Python is good. I hate Java but I’ll use it when I’m targeting multiple OSes. C++ is easy to use. C# has its place. Visual Basic works OK RAD. Basic is a good starter for beginners but care should be taken not to trap them. I teach Scratch to very young kids and a six year old girl in my class discovered Alice (which I’m racing to learn to teach her). Not asking for the whole peace Earth thing but damn… let’s get back to the real goal here. Killing each other with giant fighting robots. C++ is a path to solid abstractions, or it is also a path off a cliff. What I like is the old concept that each design decision should be wrapped in a function. A class is a group of tightly-coupled design decisions wrapped in the class. Sorry, but I’m looking forward for it to have a cardiac arrest and die so someone will give me a language for small micros that’s not so cryptic. I’ve taken classes, experimented and worked my tail off and I just don’t get it. I’m sorry, but I like more English-like languages. When people are proud of their obfuscation, I just can’t use that language. A good working language should be clear, concise and simple for its users. End of my soapbox. Harley At least you’re younger than me, C++ ;) ITT: “It doesn’t work for me, so NOBODY should use it!” and “It works for me, so EVERYBODY should use it!” Both sides can piss off. Use the right tool for the job. Just because you CAN doesn’t mean it’s the best way. Exactly. Trying to force object orientation everywhere creates messes like Java, not using object orientation where the model fits creates inflexible code and/or spaghetti. But no model fits all kinds of code. Table driven programming can make some tasks compact, fast and easy to read/change. Functional programming works great for a problem suitable for it. Standard structured programming is assumed nowadays but shouldn’t be forgotten. For some problems multi-methods improves productivity greatly while making even complex stuff easy to read.
https://hackaday.com/2015/10/17/c-turns-30-looking-forward-to-the-future/
CC-MAIN-2018-26
refinedweb
2,448
72.26