Programming Languages-Other

19K

Solutions

19K

Contributors

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Thousands of different programming languages have been created, mainly in the computer field, and many more still are being created every year. The description of a programming language is usually split into the two components of syntax (form) and semantics (meaning). Some languages are defined by a specification document (for example, the C programming language is specified by an ISO Standard), while other languages (such as Perl) have a dominant implementation that is treated as a reference. Some languages have both, with the basic language defined by a standard and extensions taken from the dominant implementation being common.

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

Sign up to Post

Hi,

I was reading as below



 defines the pre, post conditions of system
Code to interface as opposed to implementation.

I was not clear on explanation. What is design by contract and code to interface and implementation. Which one to use in which case. please advise
0
Hi,

I am currently using IBM RSA(rational software architect tool IDE 8.04 similar to eclipse). How do i practice different UML diagrams using RSA. I would like to learn to  draw different  high level conceptual and UML diagrams, Know the various architectural styles, J2EE layered multi tier architecture,  integration styles.  How to design the existing current application i am working and new application i may work in the future. Please advise
0
Hi,

I would like to know
1. how to contribute to open source projects
2. how to opensource my self taught project.

Where can i see ope source projects and read code by others a lot. Please advise
0
Can a class object be passed as parameter in c#?

Thanks,
D.
0
I would like to add a character count down to my text area in a php form. My database has a limit of 300 characters for this column.
0
hi

When i am trying below
http://codingbat.com/prob/p136041

as

public boolean array123(int[] nums) {
for(int num : nums){
if (num==1 || num==2|| num ==3){
return true;
}
}
  
}

Open in new window

getting error


Compile problems:


Error:      public boolean array123(int[] nums) {
                     ^^^^^^^^^^^^^^^^^^^^
This method must return a result of type boolean

Possible problem: the if-statement structure may theoretically
allow a run to reach the end of the method without calling return.
Consider adding a last line in the method return some_value;
so a value is always returned.


How to fix and improve. please advise
0
Below is a program that simulates rolling a pair of dice 100 times.

   class Program
   {
      static void Main(string[] args)
      {
         int[] Scores = new int[13];
         int dice = 0;
         System.Random rnd = new System.Random();
         for (int j = 0; j < 100; j++)
         {
            dice = rnd.Next(1, 7) + rnd.Next(1, 7);
            Scores[dice]++;
         }
         for (int j = 0; j < 13; j++)
            Console.WriteLine(Scores[j]);

         Console.Read();
      }
   }

The output is different each time. The last time I ran the program I got this to print in the console window:
0
0
2
6
7
12
10
6
15
15
7
2

My question is how did the Scores array get populated with these numbers? In the first for loop, there isn't an assignment operator that's storing values in the array. For example, I'm used to seeing a for loop like this:

         for (int j = 0; j < Scores.Length; j++)
         {
            dice = rnd.Next(1, 7) + rnd.Next(1, 7);
            Scores[j] = dice;
         }

The Scores[j] = dice is assigning the random values of dice to the array. But I don't understand this loop:

         for (int j = 0; j < 100; j++)
         {
            dice = rnd.Next(1, 7) + rnd.Next(1, 7);
            Scores[dice]++;
         }

How is Scored[dice]++ assigning values to the array?
0
Need to parse 2 values (tn and id) from a response String similar to this:

tn='447795584165' ptr {id=0}
0
Hi there,

I have a class and I am initializing the values in the constructor as
  public DBHelper(sstring logopath )
        {
            this.PackagePath = plogopath;
}

Open in new window


Is there any way I can use this value out of class?
I am drawing the file in another class.
Thanks.
0
if 3 dimentional array how to get length of z axis(elements in z axis).

Any of below three works right.
data[][0].length
data[][1].length
data[][2].length
0
Visual Basic 6.5
Sql Server 2008
Windows Server 2000
Input: Pipe delimited text file
Output: SQL Server Table

Can you please provide a code snippet or example (or a reference to these) demonstrating how to check for a null value in a text column and/or how to populate a sql server 2008 datetime column (defined to allow nulls) with null?  I assume I may not need the latter if I have the former...

My application reads from a text file, and uses a value in the text file as an index to specific rows in the database table.  On a match, it rewrites (or inserts or deletes) the row depending on a status value.  The last column in each row of the text file contains a valid date time format OR nulls (both the source db from where the text file values are derived, and the target database being written to, have this column defined as a datetime that allows nulls).  The application works fine as long as it has a valid value in the last column, but if the value is null, it generates an error. VB is not my forte, but I believe the solution involves checking for a null in this column, and only moving the null value to the column when it isn't null (if it is null, simply don't populate the column).  Does this sound right?  

My apology that I don't have the exact error message.  I didn't trap it because I thought I'd be able to figure this out, and recreating it takes some time, so I hope it's not necessary since I am asking for an example of code and not necessarily a solution - …
0
Hi,

I am going through below example

http://www.tutorialspoint.com/javaexamples/arrays_upperbound.htm

I wonder how they got output 2, 5
How
data.length) resulted 2
data[0].length) resulted 5
what is significance of 0. can i give 1 instead of 0?
Please advise.
0
I use a fixed fonttype/size,  in a richtextbox,   namely:  
   Lucida Console,  8 points
  how can I calculate based on  richtextbox .width  the max number off characters per line
  richtextbox.multiline=true
0
From a routine a get figures between 1000 to  9000,   like  1110,   1344, 1701, 1783
i need to round them in steps of 100,   where   1248  will be 1200,   1254 will be 1300
0
I have a RICHTTEXTBOX  as start as sample WITDH  8000,  enter some lines of tekst
writing the string to file , it will contain offcourse the then existing chr$(10)
Reread file in box  will breakoff lines on the existing chr$(10)
sofar ok

Now if i change e.g. WITDH  to 4000
On screen box looks ok.
I can delete the ""old""  chr$(10) markers

thus doing:
wr$ = rtfDeclaratie.Text
wr$ = Replace(wr$, Chr$(10), "")
rtfDeclaratie.width = Val(txtnewwitdh.Text)
rtfDeclaratie.text=wr$

problem is now before saving I must manualy press enter on each line to get a new chr$(10) in the
rtfDeclaratie.text   string
not doing that,   will not return after saving,   the new format in any size off rtfDeclaratie.box
0
Hi ,

I am trying below array example containing 9s
http://codingbat.com/prob/p184031


I wrote as below but could not proceed further. Please advise on how to proceed and complete this.

public class Test22 {

      /**
       * @param args
       */
      public static void main(String[] args) {
            // TODO Auto-generated method stub

      }
      public int arrayCount9(int[] nums) {
              int[] arrayCount9= {1, 2, 9};
             
              System.out.println("9s are"+arrayCount9.
             
             
            }
}
0
Hi,

I am going through below challenge solution

http://codingbat.com/prob/p140449

I have not understood below return statement.

  return (talking && (hour < 7 || hour > 20));

Please advise.
public boolean parrotTrouble(boolean talking, int hour) {
  return (talking && (hour < 7 || hour > 20));
  // Need extra parenthesis around the || clause
  // since && binds more tightly than ||
  // && is like arithmetic *, || is like arithmetic +
}
0
Hi,
I see for loop like this

for(LineOfBusiness bus: getDomain().getPart().getLines()){
if (AB.equals(bus.getCd().getOherCode())){
}

What is meaning of above for loop. I do not see initialization , condition, increment .

I see code like above quite often where they have of chain of getter methods and lose track of what object they are going against and which one they are finally getting. Is it is a good idea to draw a diagram using pen and pencil or write hierarchy with some arrows to identify super and sub classes, interfaces etc to see what finally coming out as return esp when you are looking code for the first time to fix some defects without much documentation. Are there any kind of real time practical 'has-a, is-a' kind of examples dealing with interfaces and classes preferably with chain of getters like 5, 10 of them. please advise
0
Will using a commonly available api call to play a wav file from Access VBA, pause processing to stop, until it completes?

I wanted to play 30 seconds of Jeopardy while a program is running unavoidable pre-processing....  found a PlaySound() function call, but it's unlcear if it stops processing while it plays.

Not critical, as it's only a prank and will be removed shortly after the first few times it runs.... just wondered if anyone had experience doing such a thing.

-Bill-
0
I need to show /edit  a kind of text box in VB wich must contain
different font-type
how to create such a way
please see attached sample how it must look
sample.bmp
0
Upgraded from windows-xp to windows-7 with VB6 develop
van add in components  the richt32.ocx , will show inn list
but when i drag to  form to create a richtextbox get attached error
also programs wich where running under XP now give error during edit
error.bmp
0
Experts, I am having trouble getting a column from my datatable using a linq query. I fill the datatable from an SQL query. The column is an integer type. I can use the linq queries just fine with string columns but cannot get it to work on integers.

Please Help...

Column Name is "rWidth".
Dim query as iEnumerable(Of Integer)
Dim iList as New List(Of Integer)

query = From w in ds.tables("dtRibbon")
               Select w.Field(Of Integer)("rWidth")
               Distinct

iList = query.ToList

Open in new window

0
I need an ASP VB (Not VBA) for this complex Excel formula

=CEILING(((PMT(0.00020845,D5,D3))*(D5)+(D3))*(125)*-1,100)
0
I have a simple three step Powershell that runs two commands then concatenates them to one array.
When I run it without the Export-CSV it looks fine, but when I add the Export-CSV I get.

#TYPE System.Object[]
"Count","Length","LongLength","Rank","SyncRoot","IsReadOnly","IsFixedSize","IsSynchronized"
"26","26","26","1","System.Object[]","False","True","False"
"313","313","313","1","System.Object[]","False","True","False"

I can run each command individually and successfully export-csv against each step.

$A = @()
$b = @()
$A = @(Get-BEJob |Where {$_.Name -like '*full'} | Select Name,NextStartDate)
$b =  @(Get-BEJob |Where {$_.Name -like '*full'}| Get-BEJobHistory |  Select Name,Jobstatus,Starttime,endtime)

$c = $a,$b 
$C |Export-csv  C:\c.txt

Open in new window

0
As an example lets use the following tables with the data indicated.  I am using Sybase ASE 15.5.

Create table PERSON(
	PERSON_ID	int not null,
	FIRST_NAME	varchar(50) not null,
	LAST_NAME	varchar(50) not null
)
INSERT INTO PERSON VALUES (1, CHRIS, DAUGHTRY)
INSERT INTO PERSON VALUES (2, BEYONCE, KNOWLES)
INSERT INTO PERSON VALUES (3, KELLY, CLARKSON)
INSERT INTO PERSON VALUES (4, MICHAEL, JACKSON)

Open in new window



Create table SHOE_COLOR (
	SHOE_COLOR_ID int not null,
	COLOR varchar(50)
)
INSERT INTO SHOE_COLOR VALUES (1, WHITE)
INSERT INTO SHOE_COLOR VALUES (2, BLACK)
INSERT INTO SHOE_COLOR VALUES (3, BROWN)
INSERT INTO SHOE_COLOR VALUES (4, RED)
INSERT INTO SHOE_COLOR VALUES (5, BLUE)

Open in new window


Create table IMAGE(
	PERSON_ID	int not null,
	SHOE_COLOR_ID	int not null,
	FILENAME	varchar(50) not null
)
INSERT INTO IMAGE VALUES (1, 3, CHRIS_IN_BROWN_SHOES.JPG)
INSERT INTO IMAGE VALUES (1, 1, CHRIS_IN_WHITE_SHOES.JPG)
INSERT INTO IMAGE VALUES (2, 4, BEYONCE_IN_RED_SHOES.JPG)
INSERT INTO IMAGE VALUES (2, 5, BEYONCE_IN_BLUE_SHOES.JPG)
INSERT INTO IMAGE VALUES( 2, 1, BEYONCE_IN_WHITE_SHOES.JPG)
INSERT INTO IMAGE VALUES (3, 2, KELLY_IN_BLACK_SHOES.JPG)

Open in new window



SELECT P.FIRST_NAME, P.LAST_NAME, I.FILENAME
FROM (PERSON P
	INNER JOIN IMAGE I ON I.PERSON_ID = P.PERSON_ID
		LEFT JOIN SHOE_COLOR S ON S.SHOE_COLOR_ID = I.SHOE_COLOR_ID)
WHERE P.PERSON_ID = 4

Open in new window


^^^ That query will give me (MICHEAL JACKSON NULL)


SELECT P.FIRST_NAME, P.LAST_NAME, I.FILENAME
FROM (PERSON P
	INNER JOIN IMAGE I ON I.PERSON_ID = P.PERSON_ID
		LEFT JOIN SHOE_COLOR S ON S.SHOE_COLOR_ID = I.SHOE_COLOR_ID)
WHERE P.PERSON_ID = 4
AND I.SHOE_COLOR_ID = 1

Open in new window


^^^ That query gives me nothing even though I am doing a left join.

Now... I know you are thinking.  Crazy woman, that is what it is supposed to do and I understand that but my query is dynamic and I will not know the PERSON_ID until runtime.  The shoe color will forever and always be 1(white). I need it to return the first and last name even if there is no entry in the IMAGE table for that person. My users can only see people in white shoes.

My question is.  How do I formulate a where clause to do that?  Give me the first and last names of the person even when there is no entry in the IMAGE table for said person WITHOUT removing I.SHOE_COLOR_ID = 1?
0

Programming Languages-Other

19K

Solutions

19K

Contributors

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Thousands of different programming languages have been created, mainly in the computer field, and many more still are being created every year. The description of a programming language is usually split into the two components of syntax (form) and semantics (meaning). Some languages are defined by a specification document (for example, the C programming language is specified by an ISO Standard), while other languages (such as Perl) have a dominant implementation that is treated as a reference. Some languages have both, with the basic language defined by a standard and extensions taken from the dominant implementation being common.