Programming Theory

3K

Solutions

24

Articles & Videos

4K

Contributors

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

Hi all,
Does anyone plan before they code?

I usually just dive straight in, I know what I want a certain script to do, but the actual structure, functions, queries etc, I discover and code on the go.

Does anyone write a simplified version of their code before they start (in Word or something)? If so, do you use any specialised tools?
0
Free Tool: Path Explorer
LVL 9
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

A slightly theoretical question.

A company is developing a cloud service based on PHP/mySQL etc. They have the source code on their own servers.

However, they want to start using external developers to create particular features.

How can they share part of the source code with those developers, without giving them access to the whole thing?

I was thinking that something like GitHub might support that, but it doesnt appear that it does.

Any ideas, or products you know of?
It would essentially be giving a certain developer access to a certain file, and then revoking that access when they had completed their work. I guess it would also need some sort of version control.
1
I am trying to sort a multi-dimensional array.  In my code, I capture data (item 'ID' and 'Priority' value) from my SharePoint list and dump it into an array as objects.  For some odd reason, it does not get inserted in the order I expected so I am trying to sort the array by the 'ID'.
Here's my code that created the array of objects.
/*Array will contain two values, item id and new priority value. Global so it can be used in multiple functions.*/
var items = [];
var itemsID = [];
var projItemArray = new Array();
var i = 0;	

/*-------------------------------------------------------------------------------------------------------*/
//Success on data retrieval from 'retrieveListItems()'. Transforms HTML table to datatable and creates
//range functionality.
/*-------------------------------------------------------------------------------------------------------*/		
function onQuerySucceeded(sender, args) {
    var listItemInfo = '';
    var listItemEnumerator = collListItem.getEnumerator();

    //Will be used to build object array of ID and priorityNumber
    //var projItemArray = new Array();    	

    //1st call to retrieve the level. 2nd call below while loop
    var levels = determineGroup();
    // alert("onQuery: "+levels);

    var i = 0;
    while (listItemEnumerator.moveNext()) {
        var oListItem = listItemEnumerator.get_current();

        var itemUid = oListItem.get_item('ID');
        var colVal;
        var valSelect = " ";
        if 

Open in new window

0
Does anyone know of a good tutorial on building a survey system using PHP.

I'm having trouble wrapping my head around how branching on a survey works (where some questions are hidden unless the answer to another equals something), in particular how the concept would work in terms of storing that data in a table and then using it at run time.
0
I have been using VBA for some years and have many, increasingly complex applications. I am at a point now where I am spending large amounts of time trying to debug my applications. Procedures which have worked successfully in the past are not working now. I suspect it is to do with the use of events and turning events on and off. But I also use a lot of code tracking procedures and I protect my worksheets. I think that my solution requires me to choose a method of showing my programme flow more visually and to use a diagramming methodology for doing this. I wonder whether I should invest my time in converting my applications to object-based methodologies using classes, and move to UML diagramming. I would greatly value advice on this matter. I attach an application that is confounding me at present. Many thanks for any assistance you can provide.
2017-03-24_SEBIS-Cash-Book_Developm.xlsm
0
Hi All,
Would you recommend a website(s) where it will show me the condensed basics of college level statistics in laymen’s terms – so that quickly I can understand the core and key concepts? and apply those conceptas in real life  
Thank you
0
Hi,
what are differences, advantages, disadvantages between

dao vs facade design patterns used i java and j2ee applications?
please advise
0
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
Free Tool: Site Down Detector
LVL 9
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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
Free Tool: ZipGrep
LVL 9
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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

Programming Theory

3K

Solutions

24

Articles & Videos

4K

Contributors

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.