Programming Theory

Programming theory deals with the design, implementation, analysis, characterization, and classification of programming languages and their individual features, along with introductory programming concepts like program structure, variable declaration and conditional and looping constructs. Sub-disciplines include the formal semantics of programming languages, type theory, program analysis and transformation, comparative programming language analysis, metaprogramming, domain-specific languages, compiler construction and run-time systems.

Share tech news, updates, or what's on your mind.

Sign up to Post

When an application is started, what are the steps it goes through until data is saved and the application is closed? What are the interactions with the registry and .ini files etc.

Ex. - 1. Executable is left mouse clicked. 2. The application takes the credentials and authenticate. 3. Assigns privileges etc.

Where does the security token fit in this sequence?
Where does the registry/ini files fit is this sequence?

I want to put the answer in a diagram to assist with troubleshooting
0
Hi All,

I'm looking for some best practices and lessons learned real world experience.  This is more of a high-level programming architecture for how our programming patterns are going to be laid out.

The one thing I'm sure of is that I want everything to go thru our classes.  I don't want multiple definitions of the same code on multiple pages where we're trying to find out everywhere we need to update them.  The page (we're currently still using webforms) calls the class, the class calls EF, and all custom logic is done inside the class.

The issues we're coming across are when dealing with joins, anonymous types, and the like.  Our developers are worried about select all columns every time for all queries as we've seen that can hamper performance.  If we do dynamic types then we lose intellisense and open ourselves up to runtime errors.  

We've seen a bunch of other sites recommend using custom classes for each result set, but I can picture that getting messy with the amount of tables / joins / applications we have that cross reference each other.  

We can return IQuerables, select the columns with intellisense, but then we're limited to a single object and aren't sure if that'll work if we need to update the data we're retrieving.  

So I'm asking the community what patterns they use and what they wish they knew when designing the way they were going to use EF from the ground up.  Any and all help greatly appreciated.
0
My teacher told me to write a digest paper. What is a digest paper?
0
How would you construct Excel formulas to accomplish the following?

I received a call from my son yesterday who informed me that he and his siblings (including spouses) would like to do a holiday gift exchange and asked if I would randomly come up with a name for each person using the following rules:

• each person is to give one and only one gift
• each person must receive one and only one gift
• no one can be assigned their own name
• no one can be assigned the name of their spouse (if applicable)

I have four children and all but one are married. So if each person is represented by a letter, it would appear as follows (with my biological children in the left column and their spouses on the right):

A — B
C — D
E
G — H

Thanks
0
public class TestRecurse {

	

	private static void recurse(int count) {
		// TODO Auto-generated method stub
		System.out.println("recs");
		if(count<=0){
			System.out.println("finsiheds");
		}else {
			//count--;
			recurse(count--);
		}
		
	}
	
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int count=1;
		recurse(count);
	}

}

Open in new window


i am running above example and got stackoutofbound exception. please advise why i got below error and what it means by stack and why it became out of bound?

recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs

...

recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs

...

recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs

...

recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs

...

recs
recs
recs
recs
recs
recs
recs
recs

...

recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs

...

recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
recs
Exception in thread "main" java.lang.StackOverflowError
	at 

Open in new window

0
Hi,

I am looking for
given out Input: 43790
i need below pyramid of output
Output:
    0
   33
  444
7777
99999

i wrote as below
import java.util.Scanner;
 
public class TestClass
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
 
      
 
        System.out.println("rows");
 
        int noOfRows = sc.nextInt();
 
        
 
        int rowCount = 1;
 
        System.out.println("output");
 
        
 
        for (int i = noOfRows; i > 0; i--)
        {
            
 
            for (int j = 1; j <= i; j++)
            {
                System.out.print(" ");
            }
 
          
            for (int j = 1; j <= rowCount; j++)
            {
                System.out.print(rowCount+" ");
            }
 
            System.out.println(); 
           
 
            rowCount++;
        }
    }
}

Open in new window

i got below output

rows
10
output
          1
         2 2
        3 3 3
       4 4 4 4
      5 5 5 5 5
     6 6 6 6 6 6
    7 7 7 7 7 7 7
   8 8 8 8 8 8 8 8
  9 9 9 9 9 9 9 9 9
 10 10 10 10 10 10 10 10 10 10


i need for given number not passing rows?
please advise
0
Hi,

I was going through below link

http://www.cis.upenn.edu/~matuszek/cit594-2012/Pages/backtracking.html

what is difference between
Non-recursive backtracking, using a stack and
Non-recursive backtracking without using a stack

what is difference between
Non-recursive backtracking and recursive backtracking
please advise
0
A clinic offers you a free test for a very rare, but hideous disease. The test they offer is very reliable. If you have the disease it has a 98% chance of giving a positive result, and if you don’t have the disease, it has only a 1% chance of giving a positive result. You decide to take the test, and find that you test positive. What is the probability that you have the disease?
0
Can you explain it in a different way. I copied it in the class but don't understand it how exactly the calculations are performed.

screenshot2.PNG
0
Can you please tell me in question 6 how it calculate the values of 33 and -5
screenshot2.PNG
0
Hi,

I am going through below site.
https://www.base64decode.org/

when we encode and decode. What are advantages and disadvantages of base64 and what are other alternatives for this? please advise
0
Homework Question:
I am not sure if I did it right. If its wrong can you tell me which direction I should be going to?

q7.PNG
a) p=310/1000 =0.31
odds for 31/100
b) p=600/1000 =0.6
odds for 3/5
0
How to solve this equation?

c(8, 3) * c(8, 2) / c(16, 5) = 14/39 ≈ 0.36
0
I had an interview Friday and was asked that question and was told this firm uses this same method for near-instant response against millions of patient records. I was told to "think about it" before my next interview.

So I am curious how search results can be grouped when you have various elements inputted, such as:

First Name
Age
Sex

The Google example involved multiple search words.

I am curious to hear a few different ideas on this.

Thanks
0
I am trying to determine what is the maximum number of 10 character word string combinations that can be created using 36 unique characters. For example, let's say that you use the English alphabet, all lowercase letters, a-z, and all the Arabic numerals, 0-9. You would end up with 36 unique characters to work with:

abcdefghijklmnopqrstuvwxyz0123456789

With these 36 characters, how many unique 10 character strings can be created?  What would be the math formula that would be used to determine the answer to this question?

You could start at:

aaaaaaaaaa

then iterate to.... aaaaaaaaa1, then aaaaaaaaa2, etc...

eventually, the last possible 10 character string would be... 9999999999

If you tallied up all the possible combinations, how many would there be?

Would it 10 to the 36th power?
0
can i do master of science after completing my graduation but i am from commerce background
0
If the file system is the input tree, what I would like to do is to start from one folder, and scan each file within this folder and use the file name to search another place in the file system using some conditions like: filename = foldername, for each foldetname returned in this search, add this foldetname as a child to the output tree and search again until not more match.


So the input is a tree and output is also a tree. Recursion is what I think is required to solved the problem and hopefully someone can share ideas or examples or links , really appreciate!
0
This is the best that I can do:
I =1      J=1      K=1
I =1      J=2      K=2 (so when I=1 it has a count of 2)
I =2      J=1      K=1
I =2      J=2      K=2 (so I has a count of 2 here)
I =3      J=1      K=1
I =3      J=2      K=2 (so I has a count of 2 here)
I =4      J=1      K=1 (so I has a count of 1 here)
I =5      J=1      K=1 (so I has a count of 1 here).... total count of 8

But I need this:
I =1      J=1      K=1
I =1      J=2      K=2
I =2      J=1      K=3
I =2      J=2      K=4
I =3      J=1      K=5
I =3      J=2      K=6
I =4      J=1      K=7
I =5      J=1      K=8

I need to get the output of K to increment by 1 and it is not as simple as a counter for each use.  Please help me with a formula for this...
0
Web form, OOP approach.

A basic checkout form, inputs: fullname, email, shipto, shiptozip, cardnumber, monthyear, cvc, a checkbox when clicked displays an alternate billto and billtozip option, and, of course, a submit button.

Professional client-side input validation coding is required.

My main objective is to see how OOP is used in javascript, and it must be usable for a typical live website and something that can be upsized for larger forms. I would like to see just pure javascript, so no libraries and frameworks, please.

Must provide a working example so I can see it work!
0
Hi

I have installed visual studio community onWin 7 PCs on our network. When users log into the visual studio application,
by default the application has taken path of the students home directory to save projects , that is located on the windows 2003 file server
\\File server-a\students\16\11jsmith\visual studio 2015\Projects.

Now when students open the Visual studio –Click New project
Select Visual Basic under templates, and Windows Forms Application and click ok
They get an error which says, unable to copy the file ‘Application.Designer.vb’ from the project template to the project. Access is denied.

Please see the attached snapshot of the process of opening the application and the error message.

Please help, what needs to be done to allow access and this application to work
Any help much appreciated
Thanks in advance.
Visual-error-snap-studio.pdf
0
Hi,

http://codingbat.com/prob/p163932

I am working on above challenge
Given a non-negative int n, return the sum of its digits recursively (no loops). Note that mod (%) by 10 yields the rightmost digit (126 % 10 is 6), while divide (/) by 10 removes the rightmost digit (126 / 10 is 12).

sumDigits(126) → 9
sumDigits(49) → 13
sumDigits(12) → 3

i was not sure how to find the sum of digits recursively without loop which i worked earlier. please advise
0
factorial



Hi,

I am working on below challenge
http://codingbat.com/prob/p154669

Psedo code:
1. return the n multiplied by same method call with n-1
I wrote my code as below

public int factorial(int n) {
  return n * factorial(n-1);
}

Open in new window




I am failing below tests

Expected      Run            
factorial(1) → 1      Exception:java.lang.StackOverflowError (line number:2)      X      
factorial(2) → 2      Exception:java.lang.StackOverflowError (line number:2)      X      
factorial(3) → 6      Exception:java.lang.StackOverflowError (line number:2)      X      
factorial(4) → 24      Exception:java.lang.StackOverflowError (line number:2)      X      
factorial(5) → 120      Exception:java.lang.StackOverflowError (line number:2)      X      
factorial(6) → 720      Exception:java.lang.StackOverflowError (line number:2)      X      
factorial(7) → 5040      Exception:java.lang.StackOverflowError (line number:2)      X      
factorial(8) → 40320      Exception:java.lang.StackOverflowError (line number:2)      X      
factorial(12) → 479001600      Exception:java.lang.StackOverflowError (line number:2)      X      
other tests
X      

How to improve/modify my design, code and any other alternate approaches. please advise
0
Hi

I had installed visual studio community on 30 PCs. Now when students open the application , it says: Licence 30 days trial( evaluation purpose only) your evaluation period has ended.
Please sign in to unlock the product.
Please see the attached screen, we have many students who will be using this program and I think asking every student to create Microsoft account will not be ideal .
Do I need to really create Microsoft account for ever student\Is there any other way to sort this \do I need to buy a licenced version

Any help much appreciated.
Thanks
Visual-studio.jpg
0
Hi,

I am working on below challeng



I have not undersood the description.



We'll say that a positive int divides itself if every digit in the number divides into the number evenly. So for example 128 divides itself since 1, 2, and 8 all divide into 128 evenly. We'll say that 0 does not divide into anything evenly, so no number with a 0 digit divides itself. Note: use % to get the rightmost digit, and / to discard the rightmost digit.

dividesSelf(128) → true
dividesSelf(12) → true
dividesSelf(120) → false

why if 0 then doe not devide and false?

please advise
0
Hi,

I am working on below challenge
http://codingbat.com/prob/p191212

Psedo code:
1. for given number % with 10
2. if 1 return true
3. else return false

I wrote my code as below

public boolean hasOne(int n) {
  if(n%10==1){
  
 // if(n/10==1){
  return true;
 // }
  }
  return false;
  
}

Open in new window




I am not passing all tests
Expected      Run            
hasOne(10) → true      false      X      
hasOne(22) → false      false      OK      
hasOne(220) → false      false      OK      
hasOne(212) → true      false      X      
hasOne(1) → true      true      OK      
hasOne(9) → false      false      OK      
hasOne(211112) → true      false      X      
hasOne(121121) → true      true      OK      
hasOne(222222) → false      false      OK      
hasOne(56156) → true      false      X      
hasOne(56556) → false      false      OK      
other tests
X      

How to improve/modify my design, code and any other alternate approaches. please advise
0

Programming Theory

Programming theory deals with the design, implementation, analysis, characterization, and classification of programming languages and their individual features, along with introductory programming concepts like program structure, variable declaration and conditional and looping constructs. Sub-disciplines include the formal semantics of programming languages, type theory, program analysis and transformation, comparative programming language analysis, metaprogramming, domain-specific languages, compiler construction and run-time systems.