proof writing – Discuss all rational side right triangle

There are ways to describe all possible rational-sided right triangles. Some basic examples are 3-4-5 triangles or 5-12-13, and those are integer-sided. Something like 3/5-4/5-1 is rational sided, as is 5/13-12/13-1. Given any rational-sided triangle, you can show that it’s similar to a triangle that has side lengths cos(theta), sin(theta), and hypotenuse 1, so now you can reduce the problem to studying right triangles inside the unit disk.. there are clever tricks like this that let you classify all such rational triangles.

I will write 1000+ SEO friendly & plagiarism free content for $3

I will write 1000+ SEO friendly & plagiarism free content

Blogging is one of the most effective ways to build brand awareness and convert traffic

into customers. But you need the quality content that propels your blog or site

to the top of the food chain.

As an experienced marketing expert, I understand the importance of enhancing inbound

traffic through blogging, to get more website visitors and more sales!

I can guarantee that my articles will be delivered well-structured and fully

optimized for search engines.

This gig includes:

  • 1000+words SEO optimized content
  • 100%unique, original, informative
  • NoSpelling & Grammar error
  • Deeply researched
  • 100%plagiarism free genuine content
  • Readability
  • Unlimited revision
  • Keyword focused

Why hire me:

  • Fluent in English
  • Well-optimized content
  • On-time delivery
  • 24/7hours service

It’s your time to rank on Google’s no 1 page. Now, Let’s create something different

together.

.

vba – How to manage concurrency while writing – DBMS on files

I’m trying to create a small DBMS with text files, but I’ve no experience with this stuff.

The code below is part of the Writer class of the Table class. Its concern is to gain access to the table and make the requested changes.

The hardest part is to gain unique access to the file that contains the table.

To achieve the goal, I create a busy temp file that is meant to be a signal for other processes to wait and retry because another process is already changing the table.

At that point, the code check for the updated version of the table and, if found, recalculate the name of the file-table (this is because the file name contains the ID of the transaction).

I would like to know how stupid is what I’m doing and if there is a way to say to the OS “hey! please lock that folder”.
The complete code is quite long and is not included, the revision that I’m asking for is on this part. Do you see any weak points in the flow of actions?

This DBMS is meant to run on business networks.

Public Enum TRANSACTION_RESULT
    t_Failed = 0
    t_Success = 1
End Enum

Public Enum OPENING_STATE
    os_TiredOfTrying = 0
    os_AlreadyBusy = 1
    os_KindaSmooth = 2
End Enum

Public Function WriteRecords(args As Variant) As TRANSACTION_RESULT
    
    Dim result              As TRANSACTION_RESULT
    
    Select Case OpenAndLockOld
        Case os_KindaSmooth
            PretendToBeBusy         ' create an empty "busy" file to signal that there is another transaction going on
            OpenTransaction         ' get a transaction ID
            ReadContent             ' read old table
            ManipulateContent       ' create a new array of bytes in accord to args
            OpenAndLockNew          ' create the updated file
            WriteContentOnNew
            CloseNew
            CloseOld
            RenameOld               ' move the old file for transaction reversal
            CreateTransaction       ' write on the registry of the transactions
            ChangeAttitude          ' delete the busy file
            result = t_Success
            
        Case os_AlreadyBusy
            CheckForStuckedBusy     ' check for the time of creation of the busy file and if it's too old, assume that is stuck and proceed to delete it
            result = t_Failed
            
        Case os_TiredOfTrying
            result = t_Failed
    End Select
    
    WriteRecords = result
    
End Function

Private Function OpenAndLockOld() As OPENING_STATE
    
    Dim result              As OPENING_STATE
    Dim countOfBusy         As Long
    Dim countOfDenied       As Long
    Dim countOfUnkownError  As Long
    
Start:
    ff = FreeFile
    If Dir$(BUSY_PATH) = vbNullString Then      ' check if another process has already gained access
        On Error Resume Next
        Open tablePath For Binary Access Read Write Lock Read Write As #ff
        Select Case Err.Number
            Case 0
                result = os_KindaSmooth
            Case 55, 70
                countOfDenied = countOfDenied + 1
                If countOfDenied < 11 Then
                    WaitSomeMilliseconds
                    FindUpdates                 ' findUpdates look for changes at the table by other processes
                    GoTo Start
                Else
                    result = os_TiredOfTrying
                End If
            Case Else
                ' no idea of what is going on here
        End Select
    Else
        countOfBusy = countOfBusy + 1
        If countOfBusy < 11 Then
            WaitSomeMilliseconds
            FindUpdates
            GoTo Start
        Else
            result = os_AlreadyBusy
        End If
    End If
    
    OpenAndLockOld = result
    
End Function

planning – Should I plan ahead, or figure out programs as I’m writing them?

I’ll chime in with my two cents as well.

Writing out a full program on paper before you start is a “CS 101” exercise that works for Hello World.
But spewing out code without taking the time to think about what you want to achieve is a waste of time as well.

Between these two extremes, you have the full range o software methodologies, from hard Waterfall (expansive set of specifications, pretty much one output at the end) to agile (“light” specs with very fast turnaround between releases and constant “customer” dialogue).

In any case, you need to know what you are building before you can start, whatever the methodology. This will help frame the program’s architecture. Waterfall will put an emphasis on having the whole system architectured before you start coding, so that you know what you will end up with.
Agile will put an emphasis on “spec the minimum functionnality to be achieved for the next iteration”, and will admonish you to be prepared to re-arcitecture constantly (by creating suitable test suites and the like so that you can actually carry out such work).

Note that NO methodology will tell you to just start coding without a thought, and indeed, you should have a pretty good idea of what you are trying to do (be it the whole thing with Waterfall, or a smaller area with Agile). You do improvise somewhat in “HOW” you do something, not in “WHAT” you are trying to do.

I can draw a parallel with what you learn when taking acting lessons. One big part is “improv”. When starting an improvisation, you need to come in with as little set in stone as you can, and be prepared to abandon your idea if someone takes the scene in another direction. You need great listening skills, and need to accept the others’ propositions. The main thing is to come on stage with a character a situation, maybe a feeling you want to convey, and potentially an ending towards which you want to take the scene. But the furthest away the idea is in the scene, the more likely it is that you will end up somewhere else. In the end, it’s a very “Agile” way of thinking, which might be what you are struggling with here.

Now, if you are talking at the “let’s write code” level (specs, stories or whatever are available), then it’s up to you. Some people do write pseudocode, some write comments before the actual code (in a “fill in the blank fashion) and some start by writing tests (see Test Driven Development). In any case, the goal is to frame your idea so that you achieve what you set out to do in your particular method.
At that level, most people do some thinking before they write the actual code. But going so far as to write down the code before hand on paper seems overkill to me…

Why does my Web Api PUT using Entity Framework 6 keep writing new duplicate records rather than updating them?

I created my database in Entity Framework, and I also created a Web Api that uses Entity Framework. When I perform a GET or a POST (ADD) everything works great, but When I do a PUT (Update) my record is not updated, it is added as if I performed a Post. I think that the following does not recognize that the Entity has been modified:

db.Entry(contact).State = EntityState.Modified;

So, here is my entire Entity Contact.cs created by Entity Framework:

  public partial class Contact
    {
        public int Contact_ID { get; set; }
        public int Dataset_ID { get; set; }
        public string Booth_UCID { get; set; }
        public string First_Name { get; set; }
        public string Last_Name { get; set; }
        public string Title_Role { get; set; }
        public int Contact_Type_ID { get; set; }
        public string Email { get; set; }
        public string Phone_Number { get; set; }
        public string Email_2 { get; set; }
        public string Phone_Number_2 { get; set; }
    
        public virtual Contact_Type Contact_Type { get; set; }
        public virtual Dataset Dataset { get; set; }
    }

Here is the Contact model from my application that is being sent to the Web Api:

public class Contact
    {
        public int Contact_ID { get; set; }
        public int Dataset_ID { get; set; }
        public string Booth_UCID { get; set; }
        public string First_Name { get; set; }
        public string Last_Name { get; set; }
        public string Title_Role { get; set; }
        public int Contact_Type_ID { get; set; }
        public string Email { get; set; }
        public string Phone_Number { get; set; }
        public string Email_2 { get; set; }
        public string Phone_Number_2 { get; set; }
    }

And here is my MVC Application to Edit Contact

 (HttpPost)
        public ActionResult EditContact(Contact contact)
        {
            using (var client = new HttpClient())
            {

                client.BaseAddress = new Uri("http://localhost:4251/");

                //HTTP POST
                // var postTask = client.PostAsJsonAsync<Dataset>("api/datasets/1", dataset);
                var postTask = client.PostAsJsonAsync("api/contacts/2", contact);
                postTask.Wait();

                var result = postTask.Result;
                if (result.IsSuccessStatusCode)
                {
                    return RedirectToAction("Index");
                }
            }

            ModelState.AddModelError(string.Empty, "Server Error. Please contact administrator.");

            return View(contact);
        }

and lastly, here is my Web Api with the Entity Framework scafolding: this is straight out of the box, when I created my Web Api

 // PUT: api/Contacts/5
        (ResponseType(typeof(void)))
        public async Task<IHttpActionResult> PutContact(int id, Contact contact)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != contact.Contact_ID)
            {
                return BadRequest();
            }

             
            

            db.Entry(contact).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ContactExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }

I am at a loss as to what I could possible do. I feel like I should just abandon the Web Api with Entity Framework and just go ahead build an Empty Web Api where I control the update. And if so, how will this be different?

Writing to file in Bash

I’m new to bash scripting, and I’m trying to output 2 columns of data. First column has # vs # : Second column has correlation coefficient. I’m trying to output 1 vs 2 : 0.214213, with the comma at the end to a file, but it outputs as 1 vs 2 : ,0.214213 with the comma in the middle. This is the line of bash commands that I’m using:

echo -e -n "$i vs $((i+1)) :t" >> ./EEG_DATA/conc_corr_$conc.csv | corr ./EEG_DATA/ERP/ERP$conc/ERP$conc.$i.txt ./EEG_DATA/ERP/ERP$conc/ERP$conc.$((i+=1)).txt >> ./EEG_DATA/conc_corr_$conc.csv | echo -n ',' >>./EEG_DATA/conc_corr_$conc.csv

I’m not sure why the comma is being written in the middle when the command to echo the comma is at the end of the line. Any help is greatly appreciated.

Manually 15 high authority guest posts Writing and publishing included ON High DA PA Website for $7

Manually 15 high authority guest posts Writing and publishing included ON High DA PA Website

Manually 15 high authority guest posts Writing and publishing included

Remember Only relevant and High traffic websites can help your website to rank on Google’s 1st page. I will write 15 articles 300+ words each and publish on HQ carefully curated 15 blogs, All are DA50+ TF 20+ Best quality Backlinks which is effective for improving your Domain authority and Google ranking. We use only real high authority sites. We will write meaningful, researched content first and then we will get you listed on some well-known great websites.

Why Take Me:

  • All High PR Actual Pages
  • Manual Work
  • Do follow + No follow Backlinks
  • Do Not Use Any Auto Software
  • 100% Penguin Panda safe
  • 100% Approval Rate
  • Satisfaction Guaranteed
  • 24/7 Customer Support
  • Completed Excel report provided


Note: We will give you a completely manual work report at the end of the delivery
Note: I do not post content related to Adult, Porn, Betting, Casino and Gambling websites

thank you!

.

I’m writing a probability and statistics paper on poker. Any ideas on probability theorems/ideas that i could incorporate into the paper?

Thanks for contributing an answer to Mathematics Stack Exchange!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.

To learn more, see our tips on writing great answers.

documentation – Tools to document code without writing in to the source files

I am searching for tools where I can explain, and write documentation on my code without altering the source files.

I try to write as obvious code as possible so that the code becomes it’s own documentation. But there are always these edge cases where it simply isn’t clear on what the code is doing. Or when we write obvious code, but the context is missing on why a decision was made.

I am searching for a tool, preferably that works with GitHub repositories. Where I can document code, write explanations, etc. Without writing complete stories in to the source files.

I don’t know if this even exists, probably does. So what is a great tool to do so with?


Examples

MyClass.cs

// DoSomething will do something with user, and id
// We decided to parse the AppUser in to the method instead of getting it from the context...
// ... ... this would be faster, bla bla
public void DoSomething(AppUser user, int id) {
}

Instead of writing a lot of not needed comments in my code. I’d like to somehow document that in the following way: MyClass.DoSomething(AppUser, int):

Here I write my complete text on why this or that for this particular method

samba writing permissions issue – Ask Ubuntu

I am wanting to run samba on Ubuntu:20.04, I am using local user accounts but the issue I am having is that users alpha, beta and omega cannot write to the folders that they are supposed to have write access to.

alpha user belongs in groups blue, purple and green
beta user belongs in groups purple and green
omega user belongs in group green

i have set ownership using chgrp command for each folder so it is:

chgrp -R green /var/pods/three
chgrp -R purple /var/pods/one
chgrp -R blue /var/pods/two

Here is what my smb.conf is:

min protocol = SMB2
security = user

[storage-pod1]
    path = /var/pods/one
    writeable = yes
    read only = no
    guest ok = no
    browseable = no
    create mask = 0777
    force create mode = 0777
    directory mask = 0777
    force directory mode = 0777
    ​valid users = @alpha, @beta
[storage-pod2]
    path = /var/pods/two
    browseable = no
    writeable = yes
    read only = no
    guest ok = no
    create mask = 0777
    directory mask = 0777
    ​valid users = @alpha

[storage-pod3]
    path = /var/pods/three
    browsable = no
    writeable = yes
    read only = no
    guest ok = no
    create mask = 0777
    directory mask = 0777
    browseable = no
    valid users = @alpha, @beta, @omega

but nonetheless accessing from Windows 10 I am getting a permission error message when trying to write files. What am I doing wrong?