132,725 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for cambalinho

template <typename a, typename ... b> class events { public: typedef std::function<void( a arg, b ... argx)> OnSomethingHandler; events(OnSomethingHandler Handler) { handlers_.push_back(Handler); } void operator ()() { for(auto i = handlers_.begin(); i != handlers_.end(); ++i) (*i)(); } private: std::vector<OnSomethingHandler> handlers_; void AddHandler(OnSomethingHandler Handler) { handlers_.push_back(Handler); } void TriggerEvents() { for(auto …

Software Development c c# c++
Member Avatar for cambalinho
0
794
Member Avatar for mavtcr

I want to format today's date like this dd/mm/yyyy Please help me

Software Development vb.net
Member Avatar for G_Waddell
0
969
Member Avatar for Biff2013

You will use the P10Class here: public class P10Class public class P10Class { public static int SEQ_NUM; public static int BIN_NUM; public static int seq_search(int[] data, int key) { boolean found = false; int i = 0; SEQ_NUM = 0; while ( !found && (i < data.length) ) { if …

Software Development java
Member Avatar for Biff2013
0
286
Member Avatar for Benjamin_4

Honestly am writing an application and am stuck at this point. problem is am writing an asset derpreciation application and i am calculating for Monthly Depreciation,End-of-year value ,Accumulated depreciatio.I want get the results of the values in this form in my jTable when the calculation is done. for example when …

Software Development java mysql
Member Avatar for mKorbel
0
208
Member Avatar for Darkicon

I have a slightly malfunctioning mouse. My problem is that when my computer wakes up, often my mouse stops working. The light remains on and all buttons work but I cannot move my mouse until I unplug it and plug it back in. I've written programs to fix strange issues …

Software Development vb.net
Member Avatar for Darkicon
0
226
Member Avatar for JohnOSull4021

Hey guys trying to make this OO but no luck..can anyone help? import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; public class Main implements ActionListener { public static void main(String[] args) { new Main();// Calling the class construtor. }//end main //Setting up ALL the variables JFrame window = …

Software Development java java-swing
Member Avatar for JamesCherrill
0
163
Member Avatar for daino

The below code simply reads the string **"This is a test"** from a text file and displayes it on the console. I've deliberately placed an endline at the end of each time the string is loaded to show that the string is all that is passed to '**mystring**' from '**myfile**'. …

Software Development c++
Member Avatar for daino
0
220
Member Avatar for you207

Hi ! I have arrray A[n][n] and i can input numbers in the interval -100 and 100 . I need to copy array A to array C[n*n] , and copy the number who are in a user iputed interval [k;l] and sort array C. I need help . I out …

Software Development c++
Member Avatar for vmanes
0
418
Member Avatar for joester007

I'm getting a warning at the end of my code that says, Warning 1 Function 'Result' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. The code works fine, but can someone explain why I'm getting this …

Software Development vb.net
Member Avatar for joester007
0
158
Member Avatar for Mafiamanandre

Hi all. I would like to know how can I code form1 to open form2 immediately when form1 loaded in Visual Basic? eg. Form1 opens and immediately form2 opens. This is almost like website redirection. Thanks.

Software Development vb.net visual-basic
Member Avatar for DM Galaxy
0
502
Member Avatar for apohbakuteh

Hi guys i am a total beginner on VB.As mention on the tittle i would love a help on my problem.Here is my code Imports System Imports System.Data Imports System.Data.OleDb Imports System.Data.SqlClient Public Class Form1 Dim conn As New System.Data.OleDb.OleDbConnection() Private Sub btnSignUp_Click(sender As Object, e As EventArgs) Handles btnSignUp.Click …

Software Development open-source vb.net
Member Avatar for apohbakuteh
0
385
Member Avatar for VUEKID

ok, NEED HELP HERE TO GET ALL THE CHARACTERS IN THE TEXT FILE AS A FULL LENGTH AND DO SOMETHING WITH IT... Line 31 #include "stdafx.h" #include<stdio.h> #include<stdlib.h> #include<string.h> #include <iostream> #include <iomanip> #include <string> #include <sstream> #include <fstream> #ifndef _DEPRECATION_DISABLE /* One time only */ #define _DEPRECATION_DISABLE /* Disable …

Software Development c++
Member Avatar for tinstaafl
0
195
Member Avatar for beastie805

I am having a problem with readin input data, my program is reading the last name in my .txt document twice and inserting it into each one of my functions an extra time. here is the out put Enter the name of the .txt file that you want to open …

Software Development c++
Member Avatar for beastie805
0
194
Member Avatar for uswer

1. Write a C++ program that simulates the throw of a dice. The program allows the user to enter the number of throws he/she would like to do. The program then, will calculate the statistics of the number of faces appears in these throws. The program should satisfies the following: …

Software Development c++
Member Avatar for Jamblaster
0
163
Member Avatar for DeanMSands3

Hey Daniweb! What's a good site, or maybe someone could write up a quick-and-dirty example of a desktop app showing how to use the Model View Controller pattern? I'm no slouch at google-fu and found this lovely example through Wikipedia: http://www.songho.ca/opengl/gl_mvc.html which I'll look at after class tonight. I'd still …

Software Development opengl software-architecture
Member Avatar for hulkishungry
0
301
Member Avatar for schroaus

I have looked around on the internet a little bit, but I am unable to find a function or equation for inverse/arcsine. I was able to find Inverse Cosine, but inverse sin doesn't seem to exist. Does anyone know how to use inverse sine in delphi?

Software Development delphi mathematics pascal
Member Avatar for pritaeas
0
377
Member Avatar for smdjilani

i have assigned a value directly to a pointer like *ptr=12; and i have used it,no error came.if we assign like this where the pointer points to?explain me?

Software Development c
Member Avatar for Ancient Dragon
0
171
Member Avatar for jalal hashmi

#include <iostream> #include <conio.h> using namespace std; void showSeats (void); char firstClass[2][6]; char busClass [5][6]; char ecoClass [6][6]; int main() { char seatType; int seatNum; char seatChar; // make all the seats available for(int i =0; i<6; i++) { for(int j =0;j<6;j++) { if(i<2) firstClass[i][j]='*'; if(i<5) busClass[i][j] = '*'; ecoClass …

Software Development c++
Member Avatar for Ancient Dragon
0
207
Member Avatar for laura301019

I have the following web crawler code and would like to add a limit as to the depth of the search but unsure how to implement this. import urllib2 def getAllNewLinksOnPage(page,prevLinks): response = urllib2.urlopen(page) html = response.read() links,pos,allFound=[],0,False while not allFound: aTag=html.find("<a href=",pos) if aTag>-1: href=html.find('"',aTag+1) endHref=html.find('"',href+1) url=html[href+1:endHref] if url[:7]=="http://": …

Software Development python
Member Avatar for Gribouillis
0
450
Member Avatar for frlg

# include <iostream> # include <fstream> # include <string> using namespace std; struct primera # include <iostream> # include <fstream> # include <string> using namespace std; struct primera { int ID; char nombre [50]; char fecha_de_alta [10]; char fecha_de_caducidad [10]; int cantidad_en_existencia; char marca_presentacion [50]; float costo_para_mi; float bonificacion; float …

Software Development c++ ios
Member Avatar for tinstaafl
0
122
Member Avatar for JohnOSull4021

Hey guys, so I'm making a board game in java similar to X's and O's on a 4x4 grid but there's different types of pieces etc., but what must be done is you must pick a piece to give to your opponant for them to place on the board and …

Software Development java
Member Avatar for JohnOSull4021
0
144
Member Avatar for kerek2

Hi All's, Really need your help, i'm trying to update existing data in MDB database by date.today but cannot update . Here my coding Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim con As New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source= PTGDB.mdb") Dim cmd As OleDbCommand = New OleDbCommand("SELECT …

Software Development open-source vb.net
Member Avatar for kerek2
0
386
Member Avatar for krystosan

Why is this stacking ontop of each other, as far as the index should get each of them to next row. data1 = {'PHOTOSHOP': '6.5', 'NUKE': '7.0v9', 'MAYA': '2014', 'TESTING': '1.28', 'KATANA': '1.7', 'MARI': '4.0'} data2 = {'PHOTOSHOP': '10.5', 'NUKE': '6.3v6', 'MAYA': '2012', 'TESTING': '1.28', 'KATANA': '1.0', 'MARI': '1.0'} class …

Software Development python
Member Avatar for krystosan
0
193
Member Avatar for cambalinho

the csbi.wAttributes are combinations of '|' operators,... DWORD textcolor = csbi.wAttributes & 0xff0f; DWORD backcolor = (csbi.wAttributes & 0xfff0) >> 4; i understand the 0xff0f is a hexadecimal value(i don't know in decimal), but why these number and not other? can anyone explain to me these 2 calculations? (they are …

Software Development c++
Member Avatar for cambalinho
0
176
Member Avatar for prettyboy

dear all, i'm doing a project which involve shape (arc, circles and rectangles) i'm a newbie on VB6, done the easy shapes but problem on drawing the arc on the form to form a half-moon shape. any help or link on this will be great and appreciated. thnx in advance

Software Development visual-basic
Member Avatar for Bruce52
0
1K
Member Avatar for ysaburou

Good morning! I have these VideoChatRTP class I got [here](Good morning! I have these VideoChatRTP class I got here (I just added the main) and an EncodingUtilClass class from here.) (I just added the main) and an EncodingUtilClass class from [here](http://www.java2s.com/Open-Source/Java/6.0-JDK-Modules/java-3d/com/db/media/rtp/EncodingUtil.java.htm). VideoChatRTP.java import javax.media.rtp.*; import javax.media.*; import javax.media.protocol.*; import java.awt.Image; …

0
207
Member Avatar for ysaburou

Good morning! I have these VideoChatRTP class I got [here](http://www.java2s.com/Open-Source/Java/6.0-JDK-Modules/java-3d/com/db/media/rtp/VideoChatRTP.java.htm) (I just added the main and made player static) and an EncodingUtilClass class from [here](http://www.java2s.com/Open-Source/Java/6.0-JDK-Modules/java-3d/com/db/media/rtp/EncodingUtil.java.htm). VideoChatRTP.java import javax.media.rtp.*; import javax.media.*; import javax.media.protocol.*; import java.awt.Image; import java.io.*; import java.net.*; import com.sun.media.ui.*; /** * A RTP over UDP player which will receive …

0
148
Member Avatar for cambalinho

i have these code for clear the screen: //clear the Console void Clear(int BackColor=0) { // home for the cursor COORD coordScreen = {0, 0}; DWORD cCharsWritten; CONSOLE_SCREEN_BUFFER_INFO csbi; DWORD dwConSize; // Get the number of character cells in the current buffer if(!GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) return; dwConSize = csbi.dwSize.X * csbi.dwSize.Y; …

Software Development c++
Member Avatar for cambalinho
0
220
Member Avatar for cambalinho

the prototype function is: BOOL WINAPI WriteConsoleOutputAttribute( _In_ HANDLE hConsoleOutput, _In_ const WORD *lpAttribute, _In_ DWORD nLength, _In_ COORD dwWriteCoord, _Out_ LPDWORD lpNumberOfAttrsWritten ); i'm trying use it for the 1st time... what means: "lpNumberOfAttrsWritten [out] A pointer to a variable that receives the number of attributes actually written to …

Software Development c++
Member Avatar for cambalinho
0
2K
Member Avatar for santakdalai90

I am trying to search for a shell script if it is running and then assigning the count to a variable. Let the script be ScriptXYZ.sh. I wrote: proc_count=$(/bin/ps -ef | grep ScriptXYZ.sh | grep -v grep | wc -l) The problem that I am facing is that even when …

Software Development shell-scripting
Member Avatar for santakdalai90
0
456
Member Avatar for PulsarScript

Thats the code i have so far: int _tmain(int argc, _TCHAR* argv[]) { for ( int i = 1; i <= 9; i++) { for ( int j = 1; j <= 15; j++) { cout << "*"; } cout << endl; } return 0; } but can't figure out …

Software Development c++
Member Avatar for darkfire3133
0
193
Member Avatar for ddnpresident

import java.util.Scanner; import java.util.Arrays; public class project { private static Scanner keyboard = new Scanner(System.in); public static void main() { double row [][]; int positionInRow, numberInRow, rowSize, index, numberOfRows,weight; int maxWeight = 100; System.out.println("Welcome to the Band of the Hour"); System.out.println("-------------------------------"); System.out.print("Please enter number of rows : "); numberOfRows = …

Software Development java
Member Avatar for kal_crazy
0
326
Member Avatar for aboubakarsalim.khamis

Write an algorithm and draw a flowchart to print the square of all numbers from LOW to HIGH. Test with LOW=1 and HIGH=10.

Software Development algorithm python
Member Avatar for CodingCabbage
0
208
Member Avatar for HelpWanted2115

Ok, hi guys.... I have some IT homework due tomorrow and I honestly don't know what to do. I've made multiple attempts and it's just not working out for me. So I'm asking for help ASAP PLEASE. The questions states: Write a program to read in the names of a …

Software Development pascal
Member Avatar for CodingCabbage
0
171
Member Avatar for kbear23

I'm trying to convert int x and y arrays to string using a sample code found online. string Square::int2string (int x[]) { string returnstring = ""; for (int i=0; i < 4; i++) { returnstring += itoa(x[i]); return returnstring; } } but hit with the following error. Square.cpp:30:8: error: prototype …

Software Development c++
Member Avatar for kiran.ghodke.395
0
4K
Member Avatar for Yani18

lright, I have a combobox with a list of Food names, and the user can also add food names. How would I make this print or go to a print preview page

Software Development vb.net visual-basic
Member Avatar for Mr.M
0
89
Member Avatar for imperator

Hi. I have created a VB.net youtube video uploader app using Google API, which works fine. However, if I want use a proxy to upload the video, I get an error: "Invalid credentials". The proxy I am using is a public one and doesn't require any authentication, so I don't …

Software Development api google-api vb.net
Member Avatar for Mr.M
0
314
Member Avatar for BE_Aus

I do apologise for the simplicity of this post, but I am seeking help in something I have not encountered before. While I have my splash screen and program humming perfectly, I am trying to run a date check while starting and exit the program if it is too old. …

Software Development vb.net
Member Avatar for DM Galaxy
0
178
Member Avatar for skyyadav

#include <string> #include <iostream> #ifndef NAME_H #define NAME_H class Name { private: std::string first_,last_ ; public: explicit Name(const std::string & first = "john", const std::string & last = "doc"):first_(first),last_(last) { if(!isvalidlast(last_) || isvalidfirst(first_)) throw "Name :: Name(const string &,const string &):invalid Name"; } static bool isvalidlast(const std::string & last){} static …

Software Development c++
Member Avatar for skyyadav
0
182
Member Avatar for boher

In my project, at some point I tend to load all rows in my DataSet and add them to my FlowLayoutPanel in order of their "Time" Item. This is what I'm trying to do but I need the controls to be added first if their "Time" value are the oldest …

Software Development dataset vb.net
Member Avatar for chuchaykaw18
0
270
Member Avatar for saintrenz

I have query that updates the database but the problem was the datagrid is not updating.. i have to restart the program in order for the datagridview to take effect Imports System.Data.OleDb Public Class frmUsers Dim cnn3 = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Renz\Documents\Visual Studio 2012\FINAL\Database\AuditDB.mdb;") Dim sql2 As String Dim ds1 As …

Software Development dataset open-source vb.net visual-studio
Member Avatar for chuchaykaw18
0
151
Member Avatar for antonio.neal.39

not working. I am using python 3.3.2. please and thank you. import urllib u = urllib.request('http://www.ctabustracker.com/bustime/map/getBusesForRoute.jsp?route=22') info = u.read() f = open('rt22.xml', 'wb') f.write(info) f.close()

Software Development python
Member Avatar for HiHe
0
222
Member Avatar for eric_arambula

I am new programming in Python. I am trying to create a function that simply takes the lowest payment (which starts at 10) and it simply returns the remaining balance (after 12 months of payments). 2. Outside the function I am using a loop that calls the function and checks …

Software Development python
Member Avatar for phoenix.enero
0
302
Member Avatar for decade

Hi everyone, I'm new in vb.Net programming and i just want to ask how to validate a "Double" data type. for example. Dim number as Double number = textbox1.text If the value of "number" variable is in "Double" data type like 1.23 or 0.12 it returns a correct value and …

Software Development vb.net
Member Avatar for decade
0
3K
Member Avatar for jared.geli

I was wondering if I can fill up an edited row based on the value in my Label. Here's the scenario: An employee will add and edit rows in the DataGridView1. All rows involved in adding and editing will fill up the last row with the Employee ID of the …

Software Development vb.net
Member Avatar for jared.geli
0
4K
Member Avatar for Zain_2

This is just a function in my program. I am getting error in this function. I know it is something to do with the structs. The error points to 'struct BOOK book;' I am trying to print all books for user to see. Library_Management.c: In function ‘viewbooks’: Library_Management.c:217:14: error: storage …

Software Development c storage
Member Avatar for Ancient Dragon
0
376
Member Avatar for eldiablo1121

Hello, I'm trying to write a program that takes an input file name and lists the folders in a heirarchy ex.Folder subfolder etc I have most of my code, but I'm getting 2 errors that are connected and I have no idea how to fix it. Here is my code: …

Software Development data-structure java
Member Avatar for eldiablo1121
0
271
Member Avatar for Ng

How To Determine The Best Score? I am doing a lab regarding 'guess number game' Actually,the answer should be the random number,but I set the exact number to 88,because it is easy for me to test other requirement. I need to printf("Best Score so far [X]") How to make comparison …

Software Development c++ programming-construct
Member Avatar for Jamblaster
0
228
Member Avatar for CodingCabbage

I'm starting my Computing project and am using Python linked via sqlite3 to a database. As part of my project I shall be searching for maths books in the database via name or module etc. I wish to display the results on a GUI in python so need to set …

Software Development python sql sqlite
Member Avatar for Gribouillis
0
359
Member Avatar for Heather_1

cant figure out how to get the floors and occupancy rate to show Public Class Form1 Private Property occupancy As Integer Private Property occupancysum As Integer Private Sub GroupBox1_Enter(sender As System.Object, e As System.EventArgs) Handles GroupBox1.Enter End Sub Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim intOccupancy(8) …

Software Development vb.net
Member Avatar for Jamblaster
0
431

The End.