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

I have a data access layer for my business objects.  In particular I have a service data layer that has a method that accepts a service id as an argument, opens a connection to my database, runs a stored procedure to re-factor the service id and returns the number of rows affected.  That part is fine and works great, however, it has been requested that we run this procedure on a range of service Id's.  That is fine, I can simply run a loop for each service Id and call the method.  My concern is that the method opens and closes a connection to my data store each time.   If we call this method 1K times, I am concerned about the performance impact.  What is the best way to approach this?  I know it would be better to open a connection and keep it open until I am finished with all the service Ids.  Should I then create a method that opens the connection and one that closes the connection?  Then use those method in my other methods?  

Thank you, any guidance would be greatly appreciated.  

I need to find matrix Y from the equation.

Please help me.
[embed=doc 267990]
I am looking for some ideas on nice grey color for shading 2nd row where the first row is yellow, i use F0F0E0 but that seems to be light color that hardly shows up on some monitors. i cant get it a little darker too. any ideas.

FFFFE0 - yellow

F0F0E0 - grey
F0F0E4 - grey
In the sample at
, I want to know what modifications I should make to enable toggle functionality for enabling mutl-selecting. I understand that right now I can achieve that by telling the user to press the cntrl key, however I don't want to force the user to utilize the ctrl key.

Please help me what code I should use over and above the one suggested in the link I have supplied.
Hello experts.
I have a solution ( with two select sliders.
The problem i have is when  select1 has not exactly the same values with select2.
In my example below select1 starts with:
<option value="">All</option>
<option value="0" >0</option> ...and ends
<option value="300000" >300000</option>

The second select starts:
<option value="">All</option>
<option value="5000" >5000</option> and ends
<option value="9999999">More than 300000 Km</option>

When i move to the right the second slider (on page load the two sliders are one below the other and both values are "All") the first value i see is 0 and not 500.On the right the slider is getting the max value 300000 and not "More than 300000 Km".It seems that it gets the values from the first select.
But if i let the second slider on the right and reload the page ,it is getting the right value "More than 300000 Km".

Any help?
Notice that i need the values in the selects exactly like they are.
files to the example below can be downloaded from here:
[code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7" />
<title>Untitled Document</title>
I'm looking for a JS that can display on top of a map background: dots (or other symbols) (from data in a db) based on GPS coordinates(normalized to pixel offsets).
Thus the map segment/quadrant would have an origin and each dot would be offset (in pixels) relative to that.
A bonus would be (or I can add ) hover text and a clickable link for each dot.
do you know of a script close to that that i could customize?

thus: given a set of pixel offset coordinates from PHP (i assume top left is 0,0), display a dot (.gif ?  with an anchor)

I have built a custom aspx-page in Sharepoint designer, on which I have put a multiview and some image buttons. Now I want to have a button or an image button that creates a new document from a custom content type when clicked. The content type is placed at root level in my site collection.

Can this be achieved using a button or image button, or is there another way, for example by using a Hypertext?

For security reasons we have not opened for custom code blocks, and I don't have access to use Visual Studio in this case.
Hello experts.
I have a styling problem with jquery ui dialog.
I'm using the lightness theme.Because i'm using in my main css document hover styles for input and select tags like:
input:hover,select:hover {background-color:#FFC;border:1px solid #1c94c4;}
input,select {background-color: #F5F5F5;}
select {border: 1px solid #c5c5c5;color: #043454;width:100%;font-size:12px;height:22px;display: block;padding-top: 1px;padding-right: 4px;padding-bottom: 1px;padding-left: 4px;border-radius: 5px;-moz-border-radius: 5px;-webkit-border-radius:5px;}

this makes a conflict with the css of ui style.
That what i want is no hover effect in that form.
(screen two:hover effect on email textfield)
(I tried also to remove the shadow effect on top and left but i did not get it too.)

Files can be downloaded from (lightness theme)
[embed=doc 266134]
[embed=doc 266137]
I have a code I compile per client basis and each client has its own parameters such as behavior that I use #define to custome, company name, file names, etc.

I have a shared .h file with all the settings and each time I want to compile a new version I just get the latest version from the source control and compile (the settings file is not being updated so it uses the client's settings)

I now have to add FileVersion to all my compilation, is there an easy way to do something similar to what I'm doing or do I have to change the resource file per client?
I trying to work out how to do long division without knowing anything beyond the 10 times tables

The solution offered on websites such as ....  &

... are fine for small divisors, however if you try to calculate 1,230,646 / 458
you still wind up having to divide 2748 by 458 mentally (at step 3 of mathsonline)

So is it possible without doing loads of multiplication guesses ?

(If it is impossible I'll still be awarding points for the best answer(s))
I need to design a database containing call logs to customers and am looking for general help on how to best design it.

First of all 2 things, I need to keep track all previous calls made to customers, and also keep track of future calls that are due to be made to the customer.

There are 3 types of call:

1) maintenance call : each client has a call frequency given their priority, eg. once a month. a general service call needs to be made within the month based starting from date on which last call was made to client (any call type counts as last call)
2) follow up call: any call type can generate a new call to be made. the follow up call will thus be linked to a previous call
3) task call: a task can involve one or more clients. each client needs to be called regarding that task.

incomplete call feature
Call type (regular, follow up, or task)
Entry Date (date call was entered into schedule)
Due Date (date by which call needs to be completed by)
Description (description of call purpose)

additional features after call completed:
Call summary (summary of conversation)
Completion Date (date on which call was actually completed)

Additional points to take into account:
1) A maintenance call is a recurring outstanding call for each customer. Any call types counts towards a last call. When a call is completed, a maintenance call due date is scheduled, as the last call date has been updated.
2) A task call may involve several customers. Eg a task could be to…
What style atributes do  i use if i want to get a squared button with grey background similar to the default HTL submit button.

also, i want the button to changebe highlighted when user points to it to distinguish it from other buttons,

I have a web page with HTML table.
I mark up every second row with some color to make it easier to read.

The main webpage background color is yellow or FFFFE0. This is a standard i cant change,
I am using light grey for the 2nd row F2F2E4.

The grey looks fine on my pc but when i use a laptop home or another destop with dell ultascan i hardly see it.

Does the color display depend on the kind on monitor used or PC settings?

How can i pick a color that will look good and the same on most users PCs.

I'm using the jquery ui slider to scroll some content in a div.
How do I programmatically move the slider at page load to a specific point in the div.  i.e. someone clicks a menu option in the scrolled div, then when the page loads I want the div to scroll across to this menu item so it shows first?

why we have witnessed a decline in virus and worm attacks for the past few years when compared to earlier years?
Hello experts.
I'm using the jquery ui and the open dialog function to show -submit a form and after the succesfull action return a OK message.
Now i need to validate the form.On the jquery home page ( is allready a validation example.
Can someone change my code to validate the form?
address required (message:address is required)
name required (message:Name is required)
myemail required,email (message:Name is required,message:please enter valid email)
telefon number (message:Please enter a valid phonen number)
message required (message:Enter your message)

I have in my test page the jquery.validate.js file so that it can work.
If you will use the validation method of the link above that will be not neccesary.
[code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7" />
<title>Untitled Document</title>
<script language="javascript" type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="js/ui/development-bundle/ui/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="js/ui/development-bundle/ui/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="js/ui/development-bundle/ui/effects.core.js"></script>
<script [/code]…
Does anyone have anyy suggestions or articles or pictures for using buttons on a web applications.

The ergular html submit button is small and default color/font may not be appealing.

i am looking for nice ideas on size, background color, shape, font.

the page background we use is light yellow.
Hi Folks.
 I am having trouble with an error indicating cross threading. I have checked numerous examples but cannot seem to get the invoke / delegate stuff right. Not sure if I can in my case?

using - Visual Studio 2008

Here is the situation I have

  Code in one module  does following:

   Imports Zipcontrol      '// third party control that raises events
   Private with events H_Zip As New Zipcontrol
   Private MyDisp as New MyFormDisplay  '// on form is a listview control

   Public Sub Process
        '// code sets up for ziping a file and does

    End sub
    Private Sub H_Zip_Progress(ByVal sender As Object, ByVal e As ZipControl.ProgressEventArgs) Handles H_Zip.Progress

     '// It is here that I attempt to call a public sub in the form code to update the list view control
     '// this results in the corss threading exception

      MyDisp.filenameprop = "abcd"      '// seems to be no problem to set property in form

end sub

In the code for the form I have tried the following:

    Private Delegate sub UpdateMyListview_Delegate()
    Public sub UpdateList()
        IF invokerequired then
            Dim x as new UpdateMyListView_Delegate(addressof Updatelist)
               '// do normal update of listview
       end if

    end sub
      There are various other combinations I have tried but it either throws cross threading exeception…
I am looking for a software tool that will help me build web based entry screens for a SQL database back end. I know some about SQL and can build databases, I need interface design tools
I am new to statisics, but as the only MS access programmer in our startup company; have been asked to calculate the sample size for a study. Since VC funding dried up there is no money to retain a statistician. Any help would be greatly appreciated.

== Background ==
1) We have a Testing-device (T) designed to evaluate if an individual fallopian tube in a Rabbit; is Open or Closed. We are comparing the same tube to the Gold Standard test (G), to confirm if the same tube is actually Open or Closed.

2) From one past study we have observed that of <10> fallopian tubes evaluated, <9 times when we said the tube was Open, the gold standard confirmed it was Open. There was 1 time when the Testing device said the tube was Open, the gold standard said it was Closed>

== Question ==
1) How many rabbits do we need so that we can say: <Every time our testing device says a tube is Open, it is really Open>. That way Vets will only need to do the Gold Standard test, when our device says a tube is <Closed>.

2) How would the number of rabbits change if wanted to make this statement with 90%, 95%, 98% confidence.

3) Could you please let me how you go about calculating this, what would be the appropriate statistical test to use, and how would you phrase the statement?

Thanks so much.
I want to do the following, say I have a 32 bit number:

1010 0000 1011 1111 0100 1000 1010 1001

and another 32 bit number:

0000 0000 0000 0000 0000 0000 0000 0001

and I want the final result to be:

1010 0000 1011 1111 0000 0000 0000 0001

how can I do this in a single step?
How do you create a Drupal design using a PSD file?
I am an application developer with seven years experience. I want to extend my knowledge into the architectural design of applications and would like to learn how to effectively develop a plugin architecture with a web application target. (high level, language and technologies are not important)

Could someone provide me with links to information regarding best practices or general information that can get me headed in the right direction. Any information would be appreciated.
I am working with a database that models entities in the real world. There are two entity types that are similar; schools, and clusters (which are collections of schools), in that a lot of the other entities relate to either schools or clusters, but one instance cannot relate to both. An example might be an annual report, which is almost identical in terms of the structure and information fields required for both, except that it relates to either a school or a cluster (but can't relate to a school AND a cluster at the same time).

We have a school table (primary key = school_id) and a cluster table (primary key = cluster_id).

The way the folks here have dealt with the other entities (e.g. annual report) is to have ONE entity, i.e. ONE table - Annual Return, which has columns for the school and cluster. If the annual return is for schools, the cluster column is empty/NULL/0, and vice versa.

Now it occurs to me that using proper design principles there is probably a cleaner way to do this, albeit involving more tables I suspect?

For a start the cluster and school columns in the Annual Return table can't be foreign keys, as they need to be able to hold a value that DOES NOT reference a row in the cluster or school table (respectively).

How would one do this properly ?

If its not too complex, I may make a suggestion that we go the "right" way :-)

i am looking for ideas on the best way to design this.

I have a web page that lists 500-1000 books and user only enter a quantity for selected rows and "Submit".

Now the page is getting bigger with 5000 books and getting slow.

What would the best way to to reduce this: add a filter or split the pages.

Splitting the pages might be cumbersome because user may update 100 rows and hit "NEXT". i have to pass all the parameters to the next page and so on until he hits final save.

Is it also possible to post the ROWS tht user updates in HTML or not so i can avoid passing thousand of parameters to the database.


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.