0

I have most of the infrastructure installed. Now it's a matter of configuring everything so that I can compile/run the sample code. Not having much luck with that. For one thing, I can no longer modify the IDE paths to add the ArrayFire include and lib folders. It seems I have to add the new include and lib to every new project I create. This is extremely annoying.

Also, I decided to bite the bullet and install Visual Studio 2017 Community Edition (I was using VS 2012). I was led to believe that this was the "free" version but VS says my trial period will expire on May 22 and I can log in to my account to extend the trial period. What gives? Is the community edition free or isn't it? If it is free, I don't see why I should have to keep extending the trial period.

0

@Jim: You are correct.
But adapterDelete has no use in the procedure and all objects like connectionstring, mysqlcommand are declared before use them except that one. IDE can poit out the fault in codes by the exception object reference not set to an instance of an objectat the time of debugging and bulding the solution if you do not declare the object in your project publicly/privately before use it.

This codes is copied by the OP from YouTube which he/she already declared and may be made some changes however he knows but has no conception how much he can copy it and which portion he has to delete/use.

0

Because float values are stored in binary, just 1s and 0s, and the fractional part is made up from the values 1/2, 1/4, 1/8. 1/16, 1/32 etc
But there's no way to represent the value 1/3 exactly with any finite number of those fractions. So the last digit will always be slightly wrong. It's the same for 1/5, 1/7 etc They cannot be exactly represented in a binary floating point number.

0

Hello Members,

I have a basic java question about non-terminating float values:

public class FloatandDouble
{
    public static void main(String args[]){
        float a =  1.0f/3.0f;
        System.out.println (a); 
        System.out.println (b); 
    }
}

The output of the program is 0.33333334. Why is it not 0.33333333?

Thank you

0

ive been develop a project known as ordering system
i need to delete data from db by clicking the button

ive follow a tutorial from utube and to the exact same code he been used

error
"object reference not set to an instance of an object"

ive double check my db dan the code in vb, there nothing wrong

i hope some could help me

code used for db :

Private Sub Delete(id As String)

        Dim str As String = "server = localhost; userid = root; password = 1234 ; database = kedaikopimamba_db"
        Dim MysqlConnection As New MySqlConnection(str)
        MysqlConnection.Open()

        Dim sql As String
        Dim cmdDeleteDrink As MySqlCommand

        sql = "DELETE FROM foodtable,drinktable,desserttable WHERE ID = '" + id + "'"
        cmdDeleteDrink = New MySqlCommand(sql, MysqlConnection)

        'open connection and insert 
        Try
            adapterDelete.DeleteCommand = MysqlConnection.CreateCommand()
            adapterDelete.DeleteCommand.CommandText = sql

            'prompt confirmation 
            If MessageBox.Show("Are sure to delete this item ?", "DELETE", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
                If cmdDeleteDrink.ExecuteNonQuery() > 0 Then
                    MessageBox.Show("Item Successful deleted. ")
                End If
            End If

            MysqlConnection.Close()
        Catch ex As Exception
            MysqlConnection.Clone()
            MessageBox.Show(ex.Message)
        End Try

    End Sub

the button code :

Private Sub btnDeleteItem_Click(sender As Object, e As EventArgs) Handles btnDeleteItem.Click
        Dim id As String = dgDisplayItem.SelectedRows(0).Cells(0).Value
        Delete(id)
    End Sub
0

I got a reply from someone on an AMD forum. Even though my hardware is not included in the "list of supported" I have been told it will worl with OpenCL. I have the files downloaded and will try them later today after my daily differential system image is taken. The instructions for setup are nowhere near as detailed and complete as for CUDA. There's catching up to be done there as well.

0

On the surface the code is reading the contents of seminar.txt file, although we don't know what is in that file other than possibly an integer per month that represents a student tally? While we don't know the contents and format of the input file, I suspect the parsing could be coded a little cleaner and easier to read. The purpose of if(flag) is a bit puzzling!

0

I would say this is not a dead issue at all.

CUDA coding is the future and Open CL is a hog if anything for the complex nature of having to reinvent the wheel over and over.I looked at using Open CL for some time but found it far to complex and complicated to implement in existing code for my purposes using it mostly for mathematics and statistics.

Without any Bias I can say Open CL seems perfect for gamers and those developing towards a wide audience of users.
GeForce and other NVidia cards support Open CL to great extent but I would not count on any support beyond Open CL 2.0 as NVIDIA is moving away from it.

Even so, CUDA has many later improvements and variations with the addition of other specialized APIs in later GPU models.

CUDA is widely becoming an industry standard and it is far simpler to work with.
Especially since the onset of CUDA computing level 5.0 and upwards allowing for "dyanmic parallelism" which means you do not have to double the storage in both host (CPU) and device (GPU) as well as being able to call functions (called Kernels) directly from another loaded kernel. This simply enlarges the parallelism of the system.

Modern applications such as Adobe, Autodesk, Mozilla/Firefox and others have enabled drawing upon the powers of CUDA.
Just look for example on Mozilla Firefox 58.0.2 (Quantum) also using CUDA for speeding up browsing and UX features.

CUDA is far from dead, ...

0

APL with CUDA support

Well, of course. It only makes sense. APL was designed to operate on sets of data. It's only natural to actually do the operations in parallel. If anyone is interested in trying APL (with the real syntax as opposed to the "fake" syntax that uses the standard keyboard, I suggest you have a look at narsAPL. It's a robust implementation that also happens to be free. It's much more complete than the APL360 I used in University os the vsAPL I used a few years later.

Also found cu2cl and this emulator.

0

#1 Son just started a research position in Cambridge, UK and the group is interested in getting into GPU programming. Since my son's PhD was in computational biophysics, he is going to be their go to guy and they are looking to him to take the first steps into setting up a development system. Fortunately, since he is starting from scratch, he is able to pick a system for himself that was a perfect fit for the most common development environment. Because the group wants to stay on a Windows-based system, he will be getting a system with an Nvidia graphics processor. This will allow him to run the Nvidia/CUDA software under Visual Studio. I already run Visual Studio but my system has AMD Radeon R5 graphics hardware. I was hoping to be able to run something here that was compatible with what he will be doing as I expect I will be asked questions from time to time.

0

There are a number of very old threads on CUDA so I'm starting a new one rather than resurrecting an old one.

Does anyone here have any experience setting up and developing in CUDA on a Windows platform? I know that there is a system that can be set up with Visual Studio/CUDA that uses the nvidia hardware but I am hoping to find something for AMD/Radeon. I have found something called ocelot that supposedly works with AMD/Radeon (which I have on my laptop) but there are issues:

  1. It has the smell of abandonment (hasn't been updated since 2013)
  2. It requires a linux-like framework (mingw)
  3. by their own admission "Ocelot currently is lacking good documentation for installation and common usage"

If anyone is aware of an implementation of CUDA that uses AMD/Radeon (and as a bonus, works with Visual C++) I'd appreciate it if you could post here. If I come across anything I'll do likewise.

0

Passing data between forms has been asked many times. The easiest way is to use a custom property to pass data or a reference to control to hold the data.

public partial class Form3 : Form // This is your Form1
{
    public Form3()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        Form2 oForm; // This is your Open & Load Excel form

        oForm = new Form2();
        oForm.ExcelView = this.dataGridView1; // Pass this form's DGV to be filled
        oForm.ShowDialog();
        oForm = null; // Dispose Excel form
    }
}

// This is your Form2

    public partial class Form2 : Form
{
    public DataGridView ExcelView { get; set; }

    public Form2()
    {
        InitializeComponent();
    }

    // Add code to open Excel file and load data to ExcelView

    private void button1_Click(object sender, EventArgs e)
    {
        this.Close(); // Return to calling form
    }
}

I hope this helps.

Teme @ windevblog.blogspot.com

1

Hi ALHANOUF

Even though you've obviously searched for and found a relevant thread to which you have attached your question, you may have failed to notice that this particular discussion has been dead for NINE years. Resurrecting long dead threads is frowned upon in forums such as ours, and does you no favours in getting the help you seek.

May I suggest that you ask your question again, but as a new post and with as much background information as is required to help our experts answer it for you in a timely fashion? That way you are much more likely to get the help you want, thanks...

Votes + Comments
"Someday, and that day may never come, I will call upon you to do a service for me. But until that day, accept this justice as a gift..."
1

My first suggestion - stop using a, b, c, and i as variable names. Give them meaning, they will help.

My second suggestion is to consider using a placeholder as a loop helper - just because you are looping though "i" doesn't mean you have to use it for anything other than how many iterations you have gone through.

eg:

int iLup = 0;
int iStep = 1;
int iMax = 200;
int iVal = 1;
for (; iLup < iMax; iLup++)
  {
     if (iStep == 1) //(this can be step "a")
        //concatenate stuff
     else if (iStep == 2) //(this can be step "b")
       //do some math and concat...
     else if (...) //(etc....)

     iStep++;
     if (iStep > 6)
        //do something special here ;)
  }

using std::cout is fine as a buffer... but if you use the method I suggested you are going to have do either do an additional if check to see if iLup == 199 to not append the final comma, or get some magical buffery (yay char arrays!) and build your string into memory before outputting the string. If you do that, rememeber that all "strings" in c/c++ must be null terminated :)

You will probably need to learn about itoa() and strcat_s() and either learn about pointers (to point to the last comma and convert it to null (0)).

Alternatively, you can learn more about the std::string (#include <string>) object and use that instead. Either one should be acceptable for academic work.

0

Good Morning everyone,

My intention is not to get someone to do the whole code to help me but I'm currently learning c++ and I'm working on a homework project to create 10 small programs inside of 1 code and I'm having a hard time doing the last one. It seems this is related to a non Fibonaci numerical series .

The program needs to print the first 200 elements following a conditional numerical series 1-1-3-6-8-8-10-20 where:

a) first 2 digits are 1
b) 3 rd digit is the result of the 2nd +2
c) 4rd digit is the result of the 3rd digit x2
d) 5th digit is the result of the 4th + 2
e) 6th digit is the same as the 5th

Once the above process is over the cycle will be restarted starting on letter b , I've managed to acomplish the letter a by using if condition inside the for loop but I've exhausted all of my knowledge to do points b,c,d and e without suceeding. Below is my code:

int main()
    {
        int Num1 = 200, a = 0, b= 0, c=0;

        for (int i = 1; i <= Num1; i++)
        {
            if (i == 1)
            {
                cout << "  1, ";
                continue;
            }
            if (i == 2)
            {
                cout <<"1, ";
                continue;
            }

             // This are comments of operations I've tried and I get the results I need but 200* 4 = 800 results
            //next = a + b
            //z = y + ...