64,152 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Jennifer84

I might wonder if I have an int vector like this and I want to achieve the averagevalue for Element 0-8 wich is ((1+2+3+4+5+6+7+8+9) / 9) = 5 What method could be used for this ? std::vector<int> Number(10); Number[0] = 1; Number[1] = 2; Number[2] = 3; Number[3] = 4; …

Member Avatar for Jennifer84
0
194
Member Avatar for miss.A

i have to create application that ask user to input Lower bound and upper bound (both intger) greater than 1 and determins all of the prime numbers within the specified bounds, inclusive. and write function procedure prime that returns True if a number is prime. False otherwise. i also should …

Member Avatar for Jx_Man
0
162
Member Avatar for serkan sendur

function SplitText(text,count) { if(text.length > count) { var _temps = text.substring(0,count); return _temps + "..."; } else { return text; } } Example : var s = SplitText("serkansendur",5); s will be "serka".

Member Avatar for DangerDev
0
64
Member Avatar for c++noobie

I have been doing c++ for somewhere between 1 1/2 and 3 months (I'm awful keeping up with time). I have a program (one of my first) that I have taken and added pieces to since I made it and it has come to be the piece of work it …

Member Avatar for c++noobie
0
2K
Member Avatar for Thirusha

I have looked around this site but have not found anything to help me. I have a jsp page which takes user input, the page is then posted to a servlet using ajax, the servlet then sets a bean value. My problem is that when i go back to the …

Member Avatar for Thirusha
0
113
Member Avatar for shahriar2403

I need to get a total of a specific column of a table of access db in a text box in my visual basic application. What should be the code? I am using adodc to connect with the database. Help urgent please..........

Member Avatar for choudhuryshouvi
0
1K
Member Avatar for aravindkishore

Hi every one, Why I am getting wrong time when I am using date('H:i:s').I am working on localhost. Please help how to get correct time. Thanks and Regards, Aravind Kishore.P

Member Avatar for aravindkishore
0
85
Member Avatar for kings

[CODE]<html> <head> <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- function view(ss) { if(ss.options[ss.selectedIndex].value!="none") { window.location="http://jesus.freehyperspace2.com/desc.php"; } } --> </script> </head> <body> <form method="get" target="frameright" action="http://jesus.freehyperspace2.com/desc.php"> <?php $hostname="localhost"; $username="jesus_jesus"; $password="jesus"; $dbid="jesus_jesus"; $link=mysql_connect($hostname,$username,$password); mysql_select_db($dbid) or die("unable to connect"); $result=mysql_query("select * from career"); if($result) { print "<select name='IndustryType' language='javascript' onChange='view(this);' size='15' tyle='width:250px'>"; print "<option value='none' selected>Choose Industry …

Member Avatar for silviuks
0
74
Member Avatar for sbv

Here is data EnqSrNo 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 11 11 11 11 11 11 11 11 11 11 …

Member Avatar for sbv
0
113
Member Avatar for waterfall

hi, im using VS.net 2005 for developing a web application.im using stored procedure for inserting records into database.i want to insert time and task for a selcetd employee but its not working. kindly help me.her's my stored procedure: [CODE] create PROCEDURE [dbo].[AssignAndStore] -- Add the parameters for the stored procedure …

Member Avatar for waterfall
0
157
Member Avatar for hjjayakrishnan

hey i just created a game of hangman in c++ with multiplayer facilities and stuff...but i wanted to add some music to it...could anyone help me??

Member Avatar for vmanes
0
104
Member Avatar for asrekdal

Hi, I am working with a wx.Python ListCtrl attempting to edit data in the second column. Is there a way of detecting which column,row has been clicked? thanks -- andrew

Member Avatar for asrekdal
0
92
Member Avatar for jrcagle

I'm having an opaque moment. +5 brownie points to anyone who can enlighten. The plan is to write a unit-testing module for the wxCanvas widget (good progress there :) ) So I wanted a row of different objects (similar to MS Paint) on buttons; the behavior of the different buttons …

Member Avatar for jrcagle
0
117
Member Avatar for aminit

Hello all: I create a simple source file in VC++ , I tried something simple,there is two strings: string1:MICROSOFTCPP string2:HELLO I want to write a code to make string2 is equal with string1,so it must be string1:MICROSOFTCPP string2:[COLOR="Green"]HELLO[/COLOR][COLOR="Red"]HELLO[/COLOR]HEL so it seem the string2 its repeat itself until it's length is …

Member Avatar for amitahlawat20
0
120
Member Avatar for Run.[it]

When Im browsing with either internet explorer or firefox and I recieve an error I get a window popping up asking If I want to debug in visual basic. Im guessing there is a setting in visual studio to turn this off? debugging? Could someone advise, thanks kindly.

Member Avatar for Run.[it]
0
131
Member Avatar for ae1

This has become a horror, a horror I tell you. I am not a techie. I am not a developer. I do not want to be a developer. I am trying to set up a pro bono program for a non-profit law office that serves the poor. Every time I …

Member Avatar for cliffwells
0
256
Member Avatar for CBarr

Hi, I am trying to understand why this bit of code is performing the way that it is. I am a novice at C++ and missed this on my test. The teacher will not discuss anything from an exam so that leaves me to try and hash it out myself. …

Member Avatar for CBarr
0
94
Member Avatar for TobbeK

Anyone having experience in MySQL and REGEXP ? I have 1 input field, "what" Now, the value from the "what" field can contain several substrings and I like each of them to be searched. Can this be done by using REGEXP or do I need to split the "what" input …

Member Avatar for TobbeK
0
409
Member Avatar for toomuchfreetime

Hey Seem to be having a problem updating a JLabel updateScore() and don't seem to know why. this is effecting my keeping score. I know it something small but for life of me can't figure it out. Other JLabels have been up dated (see attachment for full programe) [code=java] import …

Member Avatar for Ezzaral
0
3K
Member Avatar for MasterDucky

Here's this program i write to uppercase proper nouns in a file. It opens three files: 1. is the file to uppercase. 2. is a list of proper nouns to uppercase. 3. is a list for proper nouns preceeding words that excludes proper nouns to be uppercased. I rechecked it …

Member Avatar for MasterDucky
0
150
Member Avatar for serkan sendur

Right click on your solution, select add new project. Expand other project types from the pop up window. Click Setup and Deployment tab, click Setup project, click ok after naming the project. It will start with opening file system window. Right click on application folder and select add > project …

Member Avatar for happygeek
0
704
Member Avatar for skatamatic

I'm having some problems dynamically changing the size of stucts. I know there must be a way to do it...but I guess it must be a bit different than with standard variables. I'll put up some code, maybe I'm just being dumb ;) [code=c++] struct SScore { char m_szFirstName[15]; char …

Member Avatar for skatamatic
0
115
Member Avatar for jeffige

I was browsing around the web looking for C++ tutorials and I found The Game Institute. I have been thinking about taking their course- C++ Programming for Game Developers - Module I - Introduction to C++ Programming Basics. Has anyone heard any info about this course?

Member Avatar for lAmoebal
0
121
Member Avatar for serkan sendur

I have searched for a tab menu script for a long time but none of them was flexible enough,then i created one for me. The algorithm is nice so the script is not too long although being flexible. your tab menu is in an html table row as follows : …

0
64
Member Avatar for serkan sendur

In Turkey we use "." as thousand seperator and "," as decimal seperator. If you are working with currencies in sqlserver, and if the money columns is of type "money" then the problem occurs beause of the seperator issue since in its default mode sql server accepts "," as thousand …

0
61
Member Avatar for serkan sendur

Menu is about three things : 1) Position 2) Show-hide 3) Content the Positining function is this : function elementPosition(obj) { var curleft = 0, curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft; curtop = obj.offsetTop; while (obj = obj.offsetParent) { curleft += obj.offsetLeft; curtop += obj.offsetTop; } } …

0
70
Member Avatar for serkan sendur

When you assign a source to an image via javascript, it will take sometime to load the image. To get around this problem you can preload the images creating virtual images via javascript as follows : if(document.images) { // create a virtual image var img1 = new Image(); // preload …

0
81
Member Avatar for serkan sendur

How to insert big html markup with white spaces(i.e. line breaks) and single and double quotation marks to sql server : To insert that big html markup to ms sql server, i tried to copy the markup and paste it to the sql server table cell first. It didnt work, …

0
63
Member Avatar for serkan sendur

private DataTable CategoryNames(DataTable myTable) { DataTable dt = new DataTable(); dt.Columns.Add("ColumnName"); foreach (DataRow row in myTable.Rows) { string s = row["ColumnName"].ToString(); DataRow[] drx = dt.Select("ColumnName= '" + s + "'"); if (drx.Length == 0) { dt.Rows.Add(new object[] { s }); } } return dt; }

0
64
Member Avatar for serkan sendur

Create Ajax Enabled WebSite. Set EnablePageMethods property of the ScriptManager to true : <asp: ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" /> In the CodeBehind of the page, register System.Web.Services namespace. Create a Method as follows : [WebMethod] public static void DoSome() { } the method must be static and tagged as WebMethod. …

0
163
Member Avatar for serkan sendur

protected void gridview1_RowDataBound(object sender, GridViewRowEventArgs e) { if(e.Row.RowType == DataControlRowType.DataRow) { LinkButton db = (LinkButton)e.Row.Cells[0].Controls[0]; db.OnClientClick = "return confirm('Are you certain you want to delete the item?');" } }

0
45
Member Avatar for serkan sendur

I created 5 .aspx pages with Response.Write(DateTime.Now.ToString()); in the Page_Load event handler, and with <%@ OutputCache Duration="300" Location="Any" VaryByParam="none" %> added after the @ page directive with different versions of location. When i refreshed the page, client and downstream locationed ones refreshed the time as well, this proves that output …

0
55
Member Avatar for serkan sendur

I havent tried the EnableSortingAndPagingCallbacks property of the GridView before. Appearantly it doesnt do anything different than the updatepanel. It only reduces the mark up used to create the updatepanel, in other words, it encapsulates the functionality.

0
54
Member Avatar for serkan sendur

Markup : <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Server Info</title> </head> <body> <form id="form1" runat="server"> <div> <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" Caption="Environment Variables"> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <RowStyle BackColor="#EFF3FB" /> <EditRowStyle BackColor="#2461BF" /> <SelectedRowStyle …

0
68
Member Avatar for serkan sendur

Modify the web.config as follows : <configuration> <system.web> <authentication mode="Forms" /> </system.web> <location path="myRestrictedPage.aspx"> <system.web> <authorization> <deny users="?"/> <allow users="*" /> </authorization> </system.web> </location> </configuration>

0
95
Member Avatar for serkan sendur

Create a Web form : <%@ Page Language="C#" AutoEventWireup="true" CodeFile="WorkerProcessInfo.aspx.cs" Inherits="WorkerProcessInfo" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>WorkerProcessInfo</title> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager runat="server" ID="scrpt"></asp:ScriptManager> <asp:UpdateProgress runat="server" ID="uptPrg" AssociatedUpdatePanelID="upt"> <ProgressTemplate> Loading... </ProgressTemplate> </asp:UpdateProgress> <asp:UpdatePanel runat="server" ID="upt"> <ContentTemplate> <asp:GridView AutoGenerateColumns="false" ID="GridView1" …

0
70
Member Avatar for Jennifer84

This code should be complete but I cant get it what the problem is. It is a very strange thing that happening. I might need a professional eye to see if the problem could be found :) The problem is this: The mainthing is that I am using a for …

Member Avatar for Jennifer84
0
120
Member Avatar for serkan sendur

In c# there is a built-in split method with which you can create a substring array seperated by one character from a string as follows : // string seperated by colons ';' string info = "mark;smith;123 csharp drive;toronto;canada"; string[] arInfo = new string[4]; // define which character is seperating fields …

0
264
Member Avatar for serkan sendur

When working with reference types, sometimes you want to add some items to one list which has been assigned another list by reference. When you add new items to your new list, the previous list also gets added the new items since they refer to the same object collection in …

0
58
Member Avatar for serkan sendur

in the Page_Load event of the content pages remove the attached eventHandler if there is any, register new eventHandler to the specified event of the controls. in the content page : protected void Page_Load(object sender, EventArgs e) { WebControlType myControl = (WebControlType) Master.FindControl("WebControlID"); // Removes the Handler myControl.SpecifiedEvent -= theDefaultEventHandler; …

0
49
Member Avatar for serkan sendur

I have an updatepanel control in the middle of a page, and i have a link at the top of the same page. I refresh the updatepanel by clicking the link ;however, i want the updatepanel to scroll intoview as well. My javascript scrollintoview method didnt work because updatepanel tries …

0
69
Member Avatar for serkan sendur

When you use datalist setting its repeatColumn property to a constant number, its height depends on its datasource. Sometimes we want to display 10 item in one column and start a new column next to it. For these occasions i created a function as follows : // in my case …

0
67
Member Avatar for serkan sendur

For small applications it is proper to use AccessDataSource object in order to access the database directly from asp.net page. When i first used it for inserting data with formview, it generated the following error : "You tried to assign the Null value to a variable that is not a …

0
94
Member Avatar for serkan sendur

sql cache dependency allows for cached data to be evicted and refreshed when it becomes stale. Basically ASP.NET checks for the changes in the datatable in sql server, if it finds one, it refreshes the cached data. Polling based sql cache dependency is very easy to configure as follows : …

0
75
Member Avatar for serkan sendur

Today I came across to one thread asking for a help to scroll the page so that it displays error Panel. then i decided to create two generic methods in the utility class of my project as follows : if the button is a postback button : public static void …

0
307
Member Avatar for serkan sendur

Today i learned an amazing facility of asp.net 2.0 dropdownlist's. In the past( last year actually ) when i wanted to insert a static item having a text "please select something" i used to follow two ways : either insert an item to dropdownlist's datasource or directly insert an item …

0
73
Member Avatar for serkan sendur

How to create watermark image at runtime in c#? I dont want any unnecessary codes, i want easy, clear and short block of code if possible. Thanks in advance.

Member Avatar for SheSaidImaPregy
0
589
Member Avatar for DarkDot

Hey I'm using MIPS and created a Fibonacci program and am not sure that its working correctly. When I enter 1 it returns 1 like it should and when I enter 0 it returns 0 like it should. However when I enter a number that takes it into the Fibonacci …

Member Avatar for deco05ie
0
684
Member Avatar for serkan sendur

i search for a ready script for smooth scrolling but i couldnt find any. So i did it myself as follows, it works perfectly function elementPosition(obj) { var curleft = 0, curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft; curtop = obj.offsetTop; while (obj = obj.offsetParent) { curleft += …

0
259
Member Avatar for majestic0110

Hi all, just two quick questions to tax your brains with! I am preparing for a job interview and would like to get these two things clear! Firstly, how can one find the upper limit of an array? Second, how can one change that upper limit? Thank you for your …

Member Avatar for majestic0110
0
237

The End.