Saturday, February 22, 2020

Simple past, Present perfect Past perfect


Can you tell me which form of the following sentences is the correct one please?


Imagine two friends discussing the gym...



I was in a good shape before



I assume that it's not correct because simple past is used for a finished action in the past, at a specific time. And being in a good shape it's not an action..




I have been in a good shape before



This sounds ok to me, because it's "change over time".



I had been in a good shape before (I broke my leg)



If it would have had a simple past at the end I believe this would have been the correct form.


I think this is what the theory says, but I've seen for many times people using past perfect without specifying a simple past and I don't understand whether it is correct or not.




word choice - I'm born or I was born, which one to use


Should I say I'm born in or I was born in?



Can I say I'm born in Paris in 1900, or should I say I was born in Paris in 1990?



Answer



"I was born in Paris in 1990" is the correct statement to use.


"I'm" is a condensed form of "I am" which is present tense, as you are talking about a past event "I was" is used.


xbox360 - XNA: How does threading work?



I would like to implement threading in my XNA game but I'm not sure how things work when compiling for the XBOX 360. Could someone elaborate on this?


For example, how many threads does XBOX support? I realize that XNA uses a special version of the Compact Framework. How does this affect the code during development? Do I implement things differently when developing for XBOX than Windows?


Thank you.




terminology - What is data-driven design?



I've been reading up on a lot of articles covering data driven design for games. It seems to come down to:




  • No hard coding

  • No game-specific code in the engine

  • Scripting for AI, cutscenes, et cetera.

  • Generalizing code for reusability

  • Component design

  • Modularity

  • Low coupling

  • Editors (for data, maps, scripts)

  • External data retrieval


  • Constants kept in text files (.ini or otherwise)

  • Expose data through editors for scripting and manipulation by designers


Now, my question is, is this understanding correct?



Answer



I'd say this is not correct. I believe the most important idea in data driven design is separating your data from what modifies (or updates) the data.


So going from a standard OO deep hierarchy like this:


class MyCreature{
vector position;
void update(){ position += 1; }

}

to a separate state and system


class CreatureState{
vector postion;
}

class MovementSystem{
list states;
void update() {

for each CreatureState state in states {
state.position += 1;
}
}

On of the most influential DDD paradigms at this moment are Entity Systems. Some nice resources to look up are:


http://gamedevrubberduck.wordpress.com/2012/12/26/a-hybrid-entity-system-component-architecture/


http://entity-systems.wikidot.com/


Of course as with all paradigms/ideas there isn't an exact definition and not everybody understands the same idea when talking DDD but this is what I believe the most important thing.


procedural generation - How to devise an algorithm for a person being on a walk?



The game is an isometric RPG. The map is tile based.


I'm creating a town for this game. And I want one of the characters to roam the town randomly, because she is on a walk with her children.


I tagged the tiles she can go on. And I created a simplistic algorithm that I, in my naiveness, thought would be enough. Here it is:


If the character is blocked out and can't move in any direction she waits 1s before checking this again. If she can move in only one of the 4 directions, she moves that direction. If there is more than one possibility: If she can go forward, she always has 50% chance of going forward; if she can go both to her left and to her right there is an equal chance she chooses either of those two directions; and finally, if she can turn back, that chance is 2x smaller than turning to her left and 2x smaller than turning to her right. So, if she can choose from all 4 directions, she will have 50% chance to go forward, 20% chance to go to her left, 20% chance to go to her right, and 10% chance to go back. Repeat the above every step.


This algorithm fails beautifully. The character mostly moves randomly in one place. If she gets on a square she almost can't leave it.


I thought the solution would be to increase the chance of her moving forward. So I made the chance to go forward 5 times bigger than doing anything else. But this proved to hardly improve things.


COuld you give me some hints, point me to the correct direction? Or at least tell me that this is not worth it and I should instead resort to giving her a predefined path? (Are there no algorithms to make a character roam a given set of walkable tiles?)




meaning - right hand to God - what does this mean?


From the science fiction movie Dreamcatcher (2003):



— Nine miles to Hole in the Wall.

— I think I can manage it.
— I'll bring the snowmobile back and get you both. Now, Pete, you listen to me. Don't go back to the car for beer. Stay with her. Keep her warm.
Right hand to God, Dr. D.



What exactly does this expression mean?



Answer



"I swear/promise."


It's common practice in the US to place one's hand on a Bible and/or raise one's right hand when making an oath, such as being sworn into office (like the president) or when testifying in court.


You may also hear "God as my witness" or "May God smite me."


Friday, February 21, 2020

game design - Factors to consider when building an algorithm for gun recoil


What would be a good algorithm for calculating the recoil of a shooting guns cross-hairs?


What I've got now, is something like this:



  1. Define min/max recoil based on weapon size

  2. Generate random number of "delta" movement

  3. Apply random value to X, Y, or both of cross-hairs (only "up" on the Y axis)

  4. Multiply new delta based on time from the previous shot (more recoil for full-auto)


What I'm worried about is that this feels rather predicable, what other factors should one take into account when building recoil? While I'd like it to be somewhat predictable, I'd also like to keep players on their toes. I'm thinking about increasing the min/max recoil values by a large amount (relatively) and adding a weighting, so large recoils will be more rare -- it seems like a lot of effort to go into something I felt would be simple.



Maybe this is just something that needs to be fine-tuned with additional playtesting, and more playtesters? I think that it's important to note, that the recoil will be a large part of the game, and is a key factor in the game being fun/challenging or not.



Answer



Guns tend to recoil vertically far more than they recoil to the left or right (at least the few I've fired -- pistols and a shotgun -- have done so to the best of my recollection). I have a feeling the random variance in X would just feel unusual.


I would start with an implementation that kicks the gun/view upwards only, probably based on the power of the gun. When fired, a cooldown timer starts. If the gun is fired again while the cooldown timer is still counting down, the vertical kick is applied again, with intensity proportional to how much time is left on the timer. After a certain threshold it might be appropriate to add X axis variance to indicate that the player is really losing control of the (probably automatic) weapon. I've never fired such a thing so I don't know what that is supposed to feel like, but I imagine "chaotic" would fit nicely. The cooldown should probably scale a bit -- but nonlinearly -- as you continue to fire and the intensity of the kicks should probably be similarly damped or smoothed. Pure linear measures might feel too harsh.


Whatever you do, it sounds like your initial plans called for a fair bit of randomization and I don't think that would be appropriate -- a small bit, certainly, but sudden large recoils amidst smaller ones seem like they'd be unusual.


difference - You look good vs You are looking good


I have been told that 'you look good' is the perfect compliment to give. Because 'you are looking good' is not colloquial. How correct is it?


For example, if I have to ask others about myself:



  1. How do I look?

  2. How am I looking? (This would be incorrect I guess)


Having said that, I've come across 'you're looking good / nice' kind of dialogues in English movies.


How to differentiate the uses of both?




present perfect - Using "recently" with past simple



Is it fine to use recently with the past simple tense in the following sentence?



Did you read any books recently?



Is it grammatically correct?


Or do I have to use:



Have you read any books recently?





Thursday, February 20, 2020

grammar - How to explain repeating words for different subjects


Suppose I have numbers, letters and names. Suppose further that I would like to store them in matrices, a matrix for each. Then, how could I explain this in a correct English sentence?



The numbers, the letters and the names are stored in their own matrices, a matrix for each.



Is this correct?



Answer



The numbers, letters and names are each stored in their own separate matrix.


or



The numbers, letters, and names are each stored in a separate matrix.


word usage - Is it possible to use 'shall' for intentions? is PEU wrong here?


M.swan PEU (3rd edition-unit:217) says,



" Topic: announcing decisions: will

We often use will when we tell people about a decision as we make it.for instant if we're agreeing to do something.
               e.g:1. OK. we'll buy the tickets.
                      2.The phone's ringing. I'll answer it.

Shall is not used in this way.
               e.g:You can have it for $50. -OK.I'll buy it. (NOT: I shall buy it) "





According to this, we can't use shall (with first persons) for intentions or decisions which made at the time of speaking.but the book 'Cambridge Grammar Of English' and these web seits( 1 , 2 ) say that shall can be used to announce intentions or decisions. for example,



  • I don't want anyone with me.I shall do this on my own. (reference:CGE)

  • I shall contact you again when I have further information.


So my questions is, is it possible to use shall for intentions or decisions as we make them(with I&we)? [if the answer is Yes ,Why do PEU say "shall is not used for decisions "]


I searched on the internet and read lot of grammar book but I could not find a clear answer to this confusion.so any answer is appreciated.




Wednesday, February 19, 2020

graphics - How can I easily create cloud texture maps?


I am making 3d planets in my game; these will be viewed as "globes". Some of them will need cloud layers. I looked at various Blender tutorials for creating "earth", and for their cloud layers they use earth cloud maps from NASA.


However I will be creating a fictional universe with many procedurally-generated planets. So I would like to use many variations.


I'm hoping there's a way to procedurally generate cloud maps such as the NASA link. I will also need to create gas giants, so I will also need other kinds of cloud texture maps.


If that is too difficult, I could fall back to creating several variations of cloud maps. For example, 3 for earth-like, 3 for gas giants, etc.



So how do I statically create or programmatically generate such cloud maps?



Answer



Cloud generation is fun! I'll cover both offline and runtime methods.


Pre-rendered clouds


If you want to pre-render your cloud textures offline, look no further than Photoshop (or Gimp, if you prefer). Both programs can easily generate cloud patterns. Menu items tend to move around between releases, but as of Gimp 2.8.2 the core command you're looking for is Filters -> Render -> Clouds -> Solid Noise. You'll need to create a new blank image before the command is enabled. I encourage you to experiment with the noise parameters, but just as one example, here's what happens if you set "Random Seed" to 1, "Detail" to 4, "X Size" to 4.0, "Y Size" to 8.0, disable "Randomize" and "Turbulent", and enable "Tilable": Raw output of Gimp


One further step I definitely recommend is editing the image's levels (Colors -> Levels... in Gimp). By dragging the endpoints around, you can effectively change the level of cloud cover from "fully overcast" to "not a cloud in the sky". Thresholded clouds


Other interesting possibilities:



  • Use the "Dodge" and "Burn" tools to manually brighten/darken portions of the image.

  • Warp the cloud image to suggest wind patterns. Try Gimp's Filters -> Distorts -> Whirl and Pinch... command, or for more control use Filters -> Distorts -> IWarp... with the Deform Mode set to "Swirl". Keep it subtle, though -- too much warping tends to blur the high-frequency detail out of the image.


  • Add multiple independent cloud layers to simulate different types of clouds, from thin and wispy to big & chunky (I'm sure they have proper scientific names, but damnit Jim, I'm a programmer, not a meteorologist!). In this case, you'd probably want to save each layer as a separate image so you can animate them independently at runtime.


It really depends on your artistic vision. Go nuts! When you're finished, remember to export the texture as a single-channel grayscale image, so you can use the same cloud data for your color and alpha channel at runtime.


Runtime cloud generation


Generating unlimited cloud patterns at runtime is a bit more involved, but still totally feasible. It's a huge topic, and this will only cover the broad strokes.


Basically you're going to replicate Gimp's "Solid Noise" command in your shader code, using a noise function like the canonical Perlin Noise to generate infinite, smooth, deterministic, (optionally) periodic noise volumes. Your question didn't specify which rendering API you're targeting, so I can't get too specific here; chapter 26 of "GPU Gems 2" covers a variant of Perlin noise in (somewhat dated) HLSL and CgFX, or you can use this drop-in GLSL noise function. By sampling a 2D slice of a 3D noise volume, you get something like the Gimp "Solid Noise" command with Detail=0. The lower the distance between your noise volume samples, the lower-frequency ("smoother") your noise will be. To increase the level of high-frequency detail, start with a base low-frequency noise pattern and add additional higher-frequency "octaves" of noise, where each "octave" is a different slice of the 3D noise volume with a larger sampling distance and lower amplitude. A visual example of this process (which I found by Googling "multi-octave Perlin noise") can be found here.


As a huge added bonus, cloud textures generated in this fashion can very easily be animated! Add a time-based offset to your 3D noise function sample coordinates, and you'll get extremely convincing cloud motion (as seen in this video, for example). This is because the noise function is smooth in all three dimensions; scrolling the texture in the U/V direction causes the clouds to move around the planet, while scrolling in the W (perpendicular) direction has the effect of slowly "evolving" the clouds.


Warping clouds at runtime is possible as well, for hurricane-like effects. Results can actually be much higher quality than the naïve Gimp warp filters, which (as mentioned earlier) can lead to an overly blurry texture. One technique you definitely want to look into is "flow maps", as described by Alex Vlachos of Valve (SIGGRAPH 2010 slides) or Carlos Gonzalez of Naughty Dog (GDC 2012 slides). The basic idea is that you paint a vector field (the "flow map") and use it to distort and scroll the cloud texture at runtime, while periodically cross-fading between two different cloud textures when the distortion distance gets too high.


Which method to use?


Pre-rendering cloud textures in Gimp/Photoshop is extremely easy; you can generate a new texture in a few seconds once you get the hang of it. The runtime code is trivial, and very fast. However, more unique cloud textures means higher disk space requirements (also, a larger/slower download) and more VRAM usage at runtime.



Runtime cloud generation is much more difficult at first, but once you get it working it has several clear advantages over pre-rendered cloud textures. You can generate an infinite variety of realistic animated cloud patterns without using any additional disk space or VRAM. However, the runtime cost of evaluating multiple 3D noise functions per-pixel can be steep; your cloud pixel shaders will be much slower than they in the pre-rendered case.


TL;DR: definitely start by using pre-rendered clouds, and switch to runtime procedural clouds if you need the extra variety (or want an extra programming challenge).


plural forms - Should I write "all the data is correct" or "all the data are correct"?


Which sentence is correct:



In this section you can make a payment: verify carefully that all the data submitted is correct and confirm by clicking the Proceed button.



or



In this section you can make a payment: verify carefully that all the data submitted are correct and confirm by clicking the Proceed button.




Answer




Answer: either form is fine.


Data is typically treated in contemporary English as a "mass noun", an undifferentiated collection (like "sand") that takes the singular "is".


This is the most common usage today.


But it CAN also be treated as a plural of "datum" and take "are" with equal ease and correctness.


If we recast the sentence with an explicit plural noun: "In this section you can make a payment: verify carefully that all the answers submitted ARE correct and confirm by clicking the Proceed button." then you must use "are".


If there was prior discussion of "data items" or the like, then the established context may cause the plural treatment to be preferred for continuity.


c# - What designs are there for a component based entity system that are user friendly but still flexible?


I've been interested in the component based entity system for a while, and read countless articles on it (The Insomiac games, the pretty standard Evolve Your Hierarchy, the T-Machine, Chronoclast ... just to name a few).


They all seem to have a structure on the outside of something like:


Entity e = Entity.Create();
e.AddComponent(RenderComponent, ...);
//do lots of stuff
e.GetComponent(...).SetPos(4, 5, 6);


And if you bring in the idea of shared data (this is the best design I've seen so far, in terms of not duplicating data everywhere)


e.GetProperty("Name").Value = "blah";

Yes, this is very efficient. However, it isn't exactly the easiest to read or write; it feels very clunky and working-against-you.


I personally would like to do something like:


e.SetPosition(4, 5, 6);
e.Name = "Blah";

Though of course the only way to get to that kind of design is back in the Entity->NPC->Enemy->FlyingEnemy->FlyingEnemyWithAHatOn kind of hierarchy this design tries to avoid.


Has anyone seen a design for this kind of component system which is still flexible, yet maintains a level of user friendliness? And for that matter, manages to get around the (probably the hardest problem) data storage in a good way?



What designs are there for a component based entity system that are user friendly but still flexible?



Answer



One of the things that Unity does is provide some helper accessors on the parent game object to provide a more user friendly access to common components.


For example, you might have your position stored in a Transform component. Using your example you would have to write something like


e.GetComponent().position = new Vector3( whatever );

But in Unity, that gets simplified to


e.transform.position = ....;

Where transform is literally just a simple helper method in the base GameObject class (Entity class in your case) that does



Transform transform
{
get { return this.GetComponent(); }
}

Unity also does a few other things, like setting a "Name" property on the game object itself instead of in its child components.


Personally I don't like the idea of your shared-data-by-name design. Accessing properties by name instead of by a variable and having the user also have to know what type it is just seems really error prone to me. What Unity does is that they use similar methods as the GameObject transform property within the Component classes to access sibling components. So any arbitrary component you write can simply do this:


var myPos = this.transform.position;

To access the position. Where that transform property does something like this



Transform transform
{
get { return this.gameObject.GetComponent(); }
}

Sure, it's a little more verbose than just saying e.position = whatever, but you get used to it, and it doesn't look as nasty as the generic properties. And yes, you would have to do it the roundabout way for your client components, but the idea is that all your common "engine" components (renderers, colliders, audio sources, transforms, etc) have the easy accessors.


unity - How to access UI elements in a canvas in UnityUI


I am looking for elements on a canvas (a textfield and a slider); so I can retrieve values and pass them to a function.


But so far I can't figure out how to access them; I can see the methods of the canvas itself, but I can't see the name of the elements that I did add on the canvas.


I have the canvas saved in a variable which is public; then I did place a slider and textfield, connected to text labels; but I can't seem to access neither the label nor the slider or textfield.



Canvas --
|___ Text
| |_____ InputField
|
|___ Text
|_____ Slider

I did plan to access to the text value in the input field doing something like canvas.text.inputfield.text, but this does not work, since I can't see the name of the text field when using dot notation. Same goes for the slider.


public Canvas mainmenu;


void Start() {
mainmenu = mainmenu.Getomponent();
}

public RetrieveData(){
// dot notation does not find sub elements of mainmenu canvas
// only the properties and methods of the canvas itself.
}

How do you actually access elements on a UI canvas, if you can't see them directly, even if they are parented to other elements?





negation - How to answer a negative question in English?



Q: "Don't you know?"




If I really don't know, how should I respond to this question? Yes or No?


There's a similar question on EL&U, but the answer isn't clear how it works:



Also here on ELU too:



These answers are confusing. I want to know what one word answer I can use. In other words I want to know:




  • What will native speakers understand if I reply No to this question?





  • What will native speakers understand if I reply Yes to this question?






tower defense - What is grid in Unity and how can I implement it?



I'm a beginner. I need to place a grid on my map in Unity and would like to access it to place a simple object on mouse click. How can I achieve this ?


I am unable to understand the grid functionality, should I have to write code for a 2D array or is there something in Unity that I can access, and what is basically the grid like something when I click my background image ?



Answer



This could be achieved in many ways. Unity has a pretty advanced positioning system as it is.


For just regular positioning look here https://docs.unity3d.com/Manual/PositioningGameObjects.html


But without prior knowledge of whether you are looking to do this in code, it's hard to give a good answer. Try asking more specific, precise questions that you feel others could benefit from that can't be found out with a little bit of research


EDIT: ADDITION This shows how to place a tower, the towers positions are checked against in an arraylist is C#. Hopefully this should give you an idea of how to start.


public GameObject tower;
public GameObject tower2;
private ArrayList towerList = new ArrayList();

void Start()
{
Vector3 towerPosition = new Vector3(1.0F, .75F, 1.0F);
foreach (GameObject towerObject in towerList)
{
if (towerObject.transform.position == towerPosition)
{
// there is already a tower in that position
return;
}

}

tower = (GameObject)Instantiate(tower, new Vector3(1.0F, .75F, 1.0F), this.transform.rotation);
towerList.Add(tower);

// for proof of concept you we're going to try to place the tower
// in the same position as the other one
Vector3 towerPosition2 = new Vector3(1.0F, .75F, 1.0F);
foreach (GameObject towerObject in towerList)
{

if (towerObject.transform.position == towerPosition2)
{
// there is already a tower in that position
return;
}
}
tower2 = (GameObject)Instantiate(tower2, new Vector3(1.0F, .75F, 1.0F), this.transform.rotation);
towerList.Add(tower2);
}

pronouns - "Without his telling me" vs. "Without him telling me"?


I was reading a book and encountered this sentence (emphasis added by me):




  1. I know it without his telling me.



Despite being grammatically correct, it seemed a little strange to me. What came to my mind was this sentence instead:





  1. I know it without him telling me.



Another case was this:




  1. I can’t control the fact of temptation, but there’s no chance of my giving in to it.




QUESTION: Is using "me" here in #3 (or "him" as done in the previous one) correct? If so, what's the difference between the two?



Answer




The OP clarified that he/she wanted to know the semantic difference between these two phrases. I will maintain that, for the general reader, both sentences are generally considered acceptable, and the semantics are identical for practically all purposes. There are some subtle variations in style or meaning in which one form might be better than another.


My position is supported by an absolutely outstanding work, with an unassuming name, General properties of Gerunds, Participles and Verbal Nouns (PDF). Based on this work, the phrase "his telling me" seems to be more traditionally (perhaps prescriptively) correct. Also, "him telling me" has more of a feel of an independent clause (aka IP), "subject verb object", while "his telling me" is more like a dependent clause (aka DP). The author also indicates there is ambiguity in how to parse these. Don't hesitate to search the General properties of Gerunds, Participles and Verbal Nouns for semantics to find additional relevant information.


I want to highlight this work (and the author) and encourage an interested linguistics reader to investigate further. It's a very interesting (advanced yet sometimes very readable) exposition on many facets of this complex issue, including this exact issue of semantics. The above chapter seems to contain (directly or indirectly via reference) the best research on the theory to this question through the publication date.


For reference, the above text is part of a book (also with an unassuming name), Complementation in English: A Minimalist Approach (Cornilescu 2003, Google Ref) I must say Alexandra Cornilescu has many outstanding and intriguing papers/books that I'll be reading. Here's the Wikipedia Page (translated) about him.
General searches to find these works, see:



I haven't the time to dig further into this at this point. Anyone else is free to use the source I've provided to create/enhance their own answer.





The following is my entire answer before the above note was created, and I still stand by it's value.



For the grammar involved, this question has a very good answer in https://english.stackexchange.com/a/2628/61171 (Credit @CopperKettle for reference.) I'll attempt to convey my native AmEng intuition with examples so we can avoid some of the heavier grammar lingo.


Second, let's simplify by giving him a name, "John". Now we can talk about John directly. This is simply a teaching aid.


Semantics


In isolation, there's no significant semantic difference between the two sentences. They are saying exactly the same thing in slightly different ways.


But in some contexts, the differences could have some differing semantic pull. The issue of semantic differences might be rephrased: If you polled 100 people, what meanings would be interpreted, and what would be the percentage of each meaning?


Grammar Basics


Let's review some basic grammar.





  • he and him are pronouns that can be replaced with "John".



    • I saw John.

    • I saw him.

    • John saw me.

    • He saw me.





  • his is a possessive pronoun and can be replaced with John's:



    • John's bike is green.

    • His bike is green.

    • I saw John's bike.

    • I saw his bike.





Now consider some gerunds in which their function is more clear than the OP's sentences:



  • I saw John dancing.

  • I saw him dancing. (I saw him doing something. This conveys a sense of action.)

  • John's dancing is beautiful.

  • His dancing is beautiful. ("His dancing" is the subject. I'm talking about his act of dancing, as if it were a static thing.)


Note in the last example, "His dancing" is the subject of the sentence and functions like a noun.




FIRST SENTENCE



For the first sentence, his is a possessive pronoun, and "his telling me" functions as a noun. The following sentences all have a similar feel to them (relative to the "him" sentence):



  • I know it without his telling me.

  • I know it without John's act of telling me.

  • I know it without John's advice.

  • I know it without advice.


Here's a tree showing a traditional grammar layout of the sentence:1


enter image description here


Here's a more modern syntax tree:2

enter image description here


SECOND SENTENCE


In the second sentence, the word "him" is the same as "John". Note the following:



  • John told Paul a secret.

  • He told him a secret.


Now consider the following:



  • It's funny to see John dancing.



"John dancing" has an active meaning. John is hypothetically doing something. Here's a modern syntax tree:3


enter image description here




Footnotes on Syntax Trees


This section demonstrates how to easily create the images contained within this answer. As such, this section is only ancillary technical information and is separate from the answer proper.


Below, I show how to generate Labeled Bracket Notation and how to render that notation into an image of a tree.


For the modern grammar syntax trees, I went to the the Stanford Parser and entered the first sentence. I substituted [ for ( and ] for ) and plugged that into http://yohasebe.com/rsyntaxtree. That gave a pretty picture. I usually resize these in something like pixlr to make them smaller. These trees use artificial intelligence natural language processing (NLP), and as such, may give less-than-ideal or incorrect results.


1. Sentence 1 - Traditional Grammar


The first sentence I changed to typify a traditional grammar.




[S_Traditional-Grammar
[Subject I]
[Predicate
[Verb-"know"
[Object it]
[PP
[PRP without]
[NP
[N-POS his]

[NP
[GER-PH^ telling me]
]
]
]
]
]
]

2. Sentence 1 - Modern Syntax Tree



The Stanford Parser results for the modern syntax tree didn't express what I wanted, so I modified it slightly.



[S
[NP [PRP I]]
[VP [VBP know]
[NP [PRP it]]
[PP [IN without]
[NP his telling me]
]
]

]

3. Sentence 2 - Modern Syntax Tree


For the second sentence, I liked the Stanford Parser result. It's still slightly simplified.



[ROOT
[S
[NP [PRP I]]
[VP [VBP know]
[NP [PRP it]]

[PP [IN without]
[S
[NP [PRP him]]
[VP [VBG telling]
[NP [PRP me]]]]]]
]]

contractions - Why don't we contract "it is" in "If it is, then..."


I wrote some instructions for a friend today, asking them to check something, and then act differently depending on the result:



It should be spinning when it's on. If it isn't then check the batteries. If it is then replace the frobulator.




I used the contraction "it's" for the first sentence to replace "it is".


I didn't use the contraction for the second because I chose to contract "is not" to "isn't". However I could have chosen the opposite: "If it's not check the batteries" would have been fine.


However, the third sentence doesn't sound right if I contract "it is". "If it's then replace the frobulator" seems incorrect.


Is there a rule that explains why "it is" shouldn't be contracted in this case, or am I wrong, and that contraction would be fine in that last sentence?



Answer



From The Cambridge Grammar of the English Language, p.1614:



Prepositions, auxiliaries, and infinitival to are stressed when they are the sole or final element in a phrase-level constituent, a PP or VP [preposition phrase or verb phrase].



Note that be is always an auxiliary verb. In your example, is is an auxiliary at the end of a verb phrase:




1a. If it is ___ then replace the frobulator.
1b. *If it's ___ then replace the frobulator.   ← ungrammatical



If we added the ellipted word spinning back in, it would no longer be at the end of the phrase, and it would be possible to contract it:



2a. If it is spinning then replace the frobulator.
2b. If it's spinning then replace the frobulator.



This is the same reason you can't reduce it is to it's at the end of a sentence. Is needs to bear stress, so it can't be reduced to clitic form (can't be contracted).





In this answer, the * symbol means that a sentence is ungrammatical.


gerunds - Why so many –ing nouns (present participles) do not take the definite article “the”?


For example we do not say:



I look forward to the seeing you, or in the doing so.




But sometimes we say:



In the beginning, in the fighting, the ruling, etc.



As such, is there any different rule concerning the –ing nouns or they should follow the same rules as the common nouns do?



Answer



'seeing' is not a noun there. It's a verb. And due to 'look forward...' pattern, it takes the verb in the form of '-ing'.



I look forward to see seeing you.




Does the question still stand?


Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...