64,152 Solved Topics
Remove Filter ![]() | |
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; … | |
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 … | |
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". | |
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 … | |
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 … | |
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.......... | |
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 | |
[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 … | |
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 … | |
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 … | |
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?? | |
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 | |
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 … | |
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 … | |
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. | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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? | |
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 : … | |
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 … | |
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; } } … | |
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 … | |
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, … | |
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; } | |
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. … | |
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?');" } } | |
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 … | |
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. | |
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 … | |
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> | |
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" … | |
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 … | |
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 … | |
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 … | |
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; … | |
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 … | |
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 … | |
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 … | |
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 : … | |
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 … | |
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 … | |
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. | |
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 … | |
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 += … | |
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 … |
The End.