Daily Archives

Articles indexed Sunday December 26 2010

Page 6/23 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • 3n+1 problem at UVa

    - by ShahradR
    Hello, I am having trouble with the first question in the Programming Challenges book by Skiena and Revilla. I keep getting a "Wrong Answer" error message, and I don't know why. I've ran my code against the sample input, and I keep getting the right answer. Anyways, if anyone could help me, I would really appreciate it :) Here is the problem URL: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=29&page=show_problem&problem=36 And here is the code:` import java.util.Scanner; public class Main { static Scanner kb = new Scanner(System.in); public static void main(String[] args) { while (kb.hasNext()) { long[] numericalInput = {0, 0}; long i = kb.nextLong(); long j = kb.nextLong(); if (i > j) { numericalInput[0] = i; numericalInput[1] = j; } else { numericalInput[0] = j; numericalInput[1] = i; } long maxIterations = 0; for (long n = numericalInput[0]; n <= numericalInput[1]; n += 1) { if (maxIterations < returnIterations(n)) maxIterations = returnIterations(n); } System.out.println(i + " " + j + " " + maxIterations); } System.exit(0); } public static long returnIterations(long num) { long iterations = 0; while (num != 1) { if (num % 2 == 0) num = num / 2; else num = 3 * num + 1; iterations += 1; } iterations += 1; return iterations; } } ` EDIT: I think the problem is with the output. I tried to make it accept all the input first and then display all the answers at once, but I didn't know the terminating condition. I resorted to this method, but I'm not sure that's what the judge wants...

    Read the article

  • .NET Splash screen issues

    - by CODe
    I have a splash screen for my C# database application that is called via the Shown event. The splash screen contains some information that is preprocessed when the main form's constructor is called, hence why I'm using the Shown event, because that information should be available. However, when the splash screen is shown, the main form is whited out, and the menu bar, bottom menu bar, and even the gray background are all white and invisible. It looks like the program is hanging, but after the 5 second delay I have built in, the banner goes away and the program is shown normally. Also, on the banner, I have labels that are not shown when the splash screen displays... Here is my code, some reasoning behind why it isn't working would help greatly. SPLASH SCREEN CODE : public partial class StartupBanner : Form { public StartupBanner(int missingNum, int expiredNum) { InitializeComponent(); missingLabel.Text = missingNum.ToString() + " MISSING POLICIES"; expiredLabel.Text = expiredNum.ToString() + " EXPIRED POLICIES"; } } CALLING CODE : private void MainForm_Shown(object sender, EventArgs e) { StartupBanner startup = new StartupBanner(missingPoliciesNum, expiredPoliciesNum); startup.MdiParent = this; startup.Show(); Thread.Sleep(5000); startup.Close(); } Using startup.ShowDialog() shows the correct label information on the splash screen, but that locks up the application, and I need the splash to go away after about 5 seconds, which is why it's a splash. ;)

    Read the article

  • jQuery multiple selectors into dynamic attribute

    - by Jason Fletcher
    I am trying to attach an event to a separate onhover trigger. But I am having problems using multiple selectors since its dynamic. Need help ::: Upon hovering on the yellow box named 'Rings', this should trigger the animated slide event for the green box above it. http://home.jasonfletcher.info/all/alliteration/index.html $('.boxgrid1').hover(function(){ $(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300}); }, function() { $(".cover", this).stop().animate({top:'247px'},{queue:false,duration:300}); });

    Read the article

  • jquery ui popup a YouTube Video modally

    - by BahaiResearch.com
    Is there a way to use jQueryUI to popup a YouTube video modally? Here's the YouTube code I have: <object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/DIuXtsaUDmM?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/DIuXtsaUDmM?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>

    Read the article

  • Join unrelated tables through a second level connected table

    - by Andy M
    Hello! I have two tables of activities on a page: Views & Comments. Views id timestamp project_id user_id page_id Comments id timestamp project_id user_id page_id comment Pages id project_id title Now pages are related to projects: Projects id account_id title I am trying to create a summary page that combines views and comments ordered by time (so that the most recent views/comments are at the beginning, grouped by projects. Also, only projects for a specific account. So the result could potentially be: Project 1 View 5 (June 20th) View 4 (June 18th) Comment 5 (June 15th) Comment 4 (June 14th) Comment 3 (June 12th) Project 3 View 3 (June 10th) View 2 (June 8th) Comment 2 (June 7th) Project 2 View 1 (June 5th) Comment 1 (June 4th) If you could help with how to do this using SQL (or even doctrine) that would be awesome. Thank you.

    Read the article

  • DotNetOpenAuth occasionally throws a NotImplementedException

    - by Chris Moschini
    I have DotNetOpenAuth running on a background thread making calls to Google authorized with OAuth on a regular basis. About once a day, which is about one in 10,000 calls, I get the following Exception: An unhandled exception occurred and the process was terminated. Application ID: DefaultDomain Process ID: 3316 Exception: System.NotImplementedException Message: The method or operation is not implemented. StackTrace: at DotNetOpenAuth.Messaging.ProtocolException.GetObjectData(SerializationInfo info, StreamingContext context) in c:\Users\andarno\git\dotnetopenid\src\DotNetOpenAuth\Messaging\ProtocolException.cs:line 90 at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder) at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder) at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeObject(Object obj, MemoryStream stm) at System.AppDomain.Serialize(Object o) at System.AppDomain.MarshalObject(Object o) If it was thrown and caught once a day I'd be fine, but this is a big one - I'm getting this in the Application Error log on the server, and it's crashing the process entirely - the site goes down and restarts. Has anyone else run into this? Something I'm clearly doing wrong?

    Read the article

  • Slide navigation problem multiple div movement

    - by littleMan
    I have almost figured it out but still doesn't quite work the way i want it to. my problem is this part. It scrolls the first element to the left but the second element just appears and doesn't scroll does anyone know what todo here. var i = jQuery('.wikiform .wizard .view').size(); jQuery('.wikiform .navigation input[name^=Next]').click(function () { jQuery('.wikiform .wizard .view').each(function (j) { jQuery(this).animate({ marginLeft: -(current.next().width() * (i - j)) }, 750); /*line above Im having problems with ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ current = current.next(); j++; }); }); my complete code down below test it out and see what Im doing wrong (function ($) { $.fn.WikiForm = function (options) { this.Mode = options.mode || 'CancelOk' || 'Ok' || 'Wizard'; var current = jQuery('.wikiform .view:first'); function positionForm() { jQuery('body') .css('overflow-y', 'hidden'); jQuery('<div id="overlay"></div>') .insertBefore('.wikiform') .css('top', jQuery(document).scrollTop()) .animate({ 'opacity': '0.8' }, 'slow'); jQuery('.wikiform') .css('height', jQuery('.wikiform .wizard .view:first').height() + jQuery('.wikiform .navigation').height()) .css('top', window.screen.availHeight / 2 - jQuery('.wikiform').height() / 2) .css('width', jQuery('.wikiform .wizard .view:first').width()) .css('left', -jQuery('.wikiform').width()) .animate({ marginLeft: jQuery(document).width() / 2 + jQuery('.wikiform').width() / 2 }, 750); jQuery('.wikiform .wizard') .css('overflow', 'hidden') .css('height', jQuery('.wikiform .wizard .view:first').height()); } if (this.Mode == "Wizard") { return this.each(function () { positionForm(); //alert(current.next().width()); var i = jQuery('.wikiform .wizard .view').size(); jQuery('.wikiform .navigation input[name^=Next]').click(function () { jQuery('.wikiform .wizard .view').each(function (j) { jQuery(this).animate({ marginLeft: -(current.next().width() * (i - j)) }, 750); current = current.next(); j++; }); }); jQuery('.wikiform .navigation input[name^=Back]').click(function () { }); }); } else if (this.Mode == "CancelOk") { return this.each(function () { }); } else { return this.each(function () { }); } }; })(jQuery); $(document).ready(function () { jQuery(window).bind("load", function () { jQuery(".wikiform").WikiForm({ mode: 'Wizard', speed:750, ease:"expoinout" }); }); }); <style type="text/css"> body { margin:0px; } #overlay { background-color:Black; position:absolute; top:0; left:0; height:100%; width:100%; } .wikiform { background-color:Green; position:absolute; } .wikiform .wizard { clear: both; } .wizard { position: relative; left: 0; top: 0; width: 100%; list-style-type: none; } .wizard .view { float:left; } .view .form { } .navigation { float:right; clear:left } #view1 { background-color:Aqua; width:300px; height:300px; } #view2 { background-color:Fuchsia; width:300px; height:300px; } </style> <title></title></head><body><form action="" method=""><div id="layout"><div id="header"> Header </div> <div id="content" style="height:2000px"> Content </div> <div id="footer"> Footer </div> </div> <div id="formView1" class="wikiform"> <div class="wizard"> <div id="view1" class="view"> <div class="form"> Content 1 </div> </div> <div id="view2" class="view"> <div class="form"> Content 2 </div> </div> </div> <div class="navigation"> <input type="button" name="Back" value=" Back " /> <input type="button" name="Next " class="Next" value=" Next " /> <input type="button" name="Cancel" value="Cancel" /> </div> </div>

    Read the article

  • Why does the following Java Script fail to load XML?

    - by Pavitar
    I have taken an example taught to us in class,wherein a javascript is used to retrieve data from the XML,but it doesn't work.Please help I have also added the XML file below. <html> <head> <title>Customer Info</title> <script language="javascript"> var xmlDoc = 0; var xmlObj = 0; function loadCustomers(){ xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = "false"; xmlDoc.onreadystatechange = displayCustomers; xmlDoc.load("customers.xml"); } function displayCustomers(){ if(xmlDoc.readyState == 4){ xmlObj = xmlDoc.documentElement; var len = xmlObj.childNodes.length; for(i = 0; i < len; i++){ var nodeElement = xmlObj.childNodes[i]; document.write(nodeElement.attributes[0].value); for(j = 0; j < nodeElement.childNodes.length; j++){ document.write(" " + nodeElement.childNodes[j].firstChild.nodeValue); } document.write("<br/>"); } } } </script> </head> <body> <form> <input type="button" value="Load XML" onClick="loadCustomers()"> </form> </body> </html> XML(customers.xml) <?xml version="1.0" encoding="UTF-8"?> <customers> <customer custid="CU101"> <pwd>PW101</pwd> <email>[email protected]</email> </customer> <customer custid="CU102"> <pwd>PW102</pwd> <email>[email protected]</email> </customer> <customer custid="CU103"> <pwd>PW103</pwd> <email>[email protected]</email> </customer> <customer custid="CU104"> <pwd>PW104</pwd> <email>[email protected]</email> </customer> </customers>

    Read the article

  • How do I capture keystrokes on the web?

    - by Sean
    Using PHP, JS, or HTML (or something similar) how would I capture keystokes? Such as if the user presses ctrl+f or maybe even just f, a certain function will happen. ++++++++++++++++++++++++EDIT+++++++++++++++++++ Ok, so is this correct, because I can't get it to work. And I apologize for my n00bness is this is an easy question, new to jQuery and still learning more and more about JS. <script> var element = document.getElementById('capture'); element.onkeypress = function(e) { var ev = e || event; if(ev.keyCode == 70) { alert("hello"); } } </script> <div id="capture"> Hello, Testing 123 </div> ++++++++++++++++EDIT++++++++++++++++++ Here is everything, but I can't get it to work: <link rel="icon" href="favicon.ico" type="image/x-icon"> <style> * { margin: 0px } div { height: 250px; width: 630px; overflow: hidden; vertical-align: top; position: relative; background-color: #999; } iframe { position: absolute; left: -50px; top: -130px; } </style> <script> document.getElementsByTagName('body')[0].onkeyup = function(e) { var ev = e || event; if(ev.keyCode == 70 && ev.ctrlKey) { //control+f alert("hello"); } } </script> <div id="capture"> Hello, Testing 123<!--<iframe src="http://www.pandora.com/" scrolling="no" width="1000" height="515"frameborder="0"></iframe>--> </div>

    Read the article

  • How do you have grayed out text in a textfield that dissapears when the user clicks on it

    - by John Smith
    In HTML & JS, how do you make a textfield that has grayed out text telling the user what the field is for that goes away when the user clicks on the field? For example, in firefox the search field in the top right hand side says which search engine it uses when there's nothing entered, then once you click it's an empty textfield, but if you leave it blank and remove focus from the textfield then the grayed out text is back again. Is there a name for this behavior? Also, is it possible to do in pure css without the use of js to do the on focus / on blur events?

    Read the article

  • Will HTML5 replace silverlight?

    - by Nasser Hadjloo
    A while ago I read a news here, that Microsoft changed its strategy for silverlight and will replace it with HTML5. As it is a controversial discussion, some guys from Microsoft and other corporation wrote about it and some agreed and some don't? As it is important to be aware of near future of tools that you are using, what do you think, Will Microsoft replace Silverlight with HTML5 or not? I myself believe that it will happen in 2012, the time that HTML5 released completely, and Microsoft are releasing VS2012.

    Read the article

  • Updating DetailViewController from RootController

    - by Stefano Salmaso
    I'm trying to create an iPad application with a similar user interface to Apple's Mail application, i.e: RootView controller (table view) on the left hand side of the split view for navigation with a multiple view hierarchy. When a table cell is selected a new table view is pushed on the left hand side The new view on the left side can update the detail view. I can accomplish both tasks BUT NOT TOGETHER. I mean I can make a multi-level table view in the RootController.(HERE you can find the working source code). Or I can make a single-level table view in the RootController which can update the detailViewController (here there is the source code:http://www.megaupload.com/?d=D6L0463G). Can anyone tell me how to make a multi-level table in the RootController which can update a detailViewController? There is more source code at the link but below is the method in which I presume I have to declare a new detailViewController (which has to be put in the UISplitViewController): - (void)tableView:(UITableView *)TableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row]; //Get the children of the present item. NSArray *Children = [dictionary objectForKey:@"Children"]; // if([Children count] == 0) { /* Create and configure a new detail view controller appropriate for the selection. */ NSUInteger row = indexPath.row; UIViewController <SubstitutableDetailViewController> *detailViewController = nil; if (row == 0) { FirstDetailViewController *newDetailViewController = [[FirstDetailViewController alloc]initWithNibName:@"FirstDetailView" bundle:nil]; detailViewController = newDetailViewController; } if (row == 1) { SecondDetailViewController *newDetailViewController = [[SecondDetailViewController alloc]initWithNibName:@"SecondDetailView" bundle:nil]; detailViewController = newDetailViewController; } // Update the split view controller's view controllers array. NSArray *viewControllers = [[NSArray alloc] initWithObjects:self.navigationController, detailViewController, nil]; splitViewController.viewControllers = viewControllers//nothing happens..... [viewControllers release];// } else { //Prepare to tableview. RootViewController *rvController = [[RootViewController alloc]initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]]; //Increment the Current View rvController.current_level += 1; //Set the title; rvController.current_title = [dictionary objectForKey:@"Title"]; //Push the new table view on the stack [self.navigationController pushViewController:rvController animated:YES]; rvController.tableDataSource = Children; [rvController.tableView reloadData]; //without this instrucion,items won't be loaded inside the second level of the table [rvController release]; } }

    Read the article

  • Where to define exception classes, inside classes or on a higher level?

    - by rve
    Should exception classes be part of the class which may throw them or should they exist on a higher level? For example : class Test { public: class FooException: public ExceptionBase { }; void functionThrowingFooException(); }; or class FooException: public ExceptionBase { }; class Test { public: void functionThrowingFooException(); }; (functionThrowingFooException() is the only function to ever throw a FooException)

    Read the article

  • windows VPS running apache and mysql, php scripts running slow.. but cpu usage is 1-3%..

    - by Roeland
    So every night I run some cron jobs. It requires probably about 20 min to process all the records. I gather the script does something like 10,000 sql queries. I figure this task was just that intense and needs time to complete, but I looked at CPU and memory usage, and it is super low. Cpu usage is between 1-3% and once in a while will bounce to 50ish for 2-3 seconds. This VPS is running windows 2003 server with Apache and MySQL. Does this sound right?

    Read the article

  • Figuring out which PC part is faulty

    - by Davy8
    I have an odd scenario and I'm having trouble figuring out which is the faulty component. First of all, the video doesn't work, monitor says it's not getting a signal. Monitor's not faulty (works on other computer) so the first suspect was video card. However 2 things make me think it's not the video card. (Don't have another machine with PCIe around to test definitively) First, the GPU fan is spinning so it's getting power. Second, tried putting in an older PCI video card that is known to be working (pulled out of another working machine) and there's still no video. Normally if it's not the video card I'd suspect the motherboard, but everything's getting power on the mobo, so I'm not sure. The case apparently doesn't have system speakers, so can't hear any of the diagnostic beeps either. Also not sure whether a faulty CPU would cause no image at all either. The parts are brand new so something's going to get RMA'd but I'm not sure which component is to blame in this case. (Only slightly related, but I also accidentally put too much thermal paste on the CPU. The fan/heatsink instructions said to put the whole tube which seemed like a lot compared to previous experience, and as I started squeezing I knew it was definitely too much and stopped at about 1/3 but against my better judgement I didn't wipe any off. I'm not sure whether that would cause problems other than not cooling as effectively as it should)

    Read the article

  • How to play 24 fps video smoothly on a 60Hz display?

    - by netvope
    I use mpc-hc to play videos on Win7 x64. With the default settings (#1), video playback is great most of the time. But for panning shots, playback is not smooth. I stepped through the video frame by frame and found that the panning movement is smooth (e.g. each frame shifts horizontally by 10 pixels), so the problem is how the 23.976 fps video is interpolated to 60Hz. The judder looks like what would be caused by a "2:3 pulldown", where the frames are played unevenly like: frame 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, etc (#2) Using "optimal renderer settings" (#3) instead of the default disables the Aero theme and causes tearing. Setting my LCD display to 50Hz may have improved the judder slightly (but I can't really tell). My display does not support 24Hz or 48Hz, and forcing them in the Nvidia control panel gives blurry screen. I've tried other video players (VLC and KMPlayer), the ReClock Directshow Filter, video files from different sources (#4), turning on/off DXVA, and a computer with a different GPU, but the judder in the playback is similar. None of them solved the problem. So, how can I play 23.976 or 24 fps video smoothly on a 60Hz display? I think a video player could make the video smoother by doing linear interpolation, such as: 1. 100% frame 1 2. 60% frame 1 + 40% frame 2 3. 20% frame 1 + 80% frame 2 4. 80% frame 2 + 20% frame 3 5. 40% frame 2 + 60% frame 3 6. 100% frame 3 7. 60% frame 3 + 40% frame 4 .. etc Can any existing video player do this? Footnotes: (#1) Video renderer: EVR Custom Pres. (#2) This example converts a 24 fps video into 30 fps (#3) View Renderer settings Reset Reset to optimal renderer settings (#4) The files I have are all H.264 mkv files, but I don't think the file format/encoding matters.

    Read the article

  • Authenticated proxy in Windows command prompt

    - by tlvince
    My Internet access is delivered through an authenticated proxy. This is setup correctly in the "Internet Options" control panel applet and all browsing/GUI apps work fine. For cmd, proxy settings are typically set by exporting http_proxy. The applications I'm trying to use are git and Putty's pscp.exe. I've tried the following syntax to no avail: set http_proxy=http://username:[email protected]:port/ I've also experimented with Netsh.exe and ProxyCfg.exe with no luck. How does one configure an authenticated proxy in the Windows command prompt?

    Read the article

  • How to save array of integer numbers in a column in SQL Server 2005

    - by hamed
    I have a table in SQL Server 2005 with the following properties: Users (UserID, Username, Password) where UserID is primary key I want to save an array of integer numbers in the password attribute in the Users table. -------------------- 0 1 2 3 -------------------- 1543 6543 7658 8765 -------------------- I plan to save this into the password column. On the other hand I use pictures instead of texts for password and each picture has a code (4 digit) and a password include 4 picture that produce 16 digit. I want to save these 16 digits (array of Ints) into the Password column please help me. thanks

    Read the article

  • Custom onsynctopreference for XUL textbox

    - by Alexey Romanov
    I wanted to enable custom shortcuts in my Firefox extension. The idea is that the user just focuses on a textbox, presses key combination, and it's shown in the textbox and saved to a preference. However, I couldn't get it to work. With this XUL <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://mozapps/skin/pref/pref.css" type="text/css"?> <!DOCTYPE window SYSTEM "chrome://nextplease/locale/nextplease.dtd"> <prefwindow id="nextpleaseprefs" title="&options.title;" buttons="accept, cancel" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <prefpane id="nextplease.general" label="&options.general.title;" image="chrome://nextplease/skin/Sound Mixer.png"> <preferences> <preference id="nextkey" name="nextplease.nextkey" type="int"/> </preferences> <vbox flex="1"> <hbox align="center"> <label value="&options.general.nextKey;" /> <textbox id="nextkey" flex="1" editable="false" onkeyup="return nextplease.handleKeySelection(this, event);" preference-editable="true" preference="nextkey" onsynctopreference="alert('syncing'); return nextplease.syncKeySelector(this);"/> </hbox> </vbox> </prefpane> <script type="application/x-javascript" src="chrome://nextplease/content/nextpleaseCommon.js" /> <script type="application/x-javascript" src="chrome://nextplease/content/nextpleaseOptions.js" /> </prefwindow> the event in onkeyup works. But when I click the OK button, I don't see a "syncing" alert. Why isn't onsynctopreference working? Is it impossible to have custom onsynctopreference attribute for a textbox?

    Read the article

  • How does does ifstream eof() work?

    - by Chan
    Hello everyone, #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <ctime> #include <cctype> #include <fstream> using namespace std; int main() { fstream inf( "ex.txt", ios::in ); while( !inf.eof() ) { std::cout << inf.get() << "\n"; } inf.close(); inf.clear(); inf.open( "ex.txt", ios::in ); char c; while( inf >> c ) { std::cout << c << "\n"; } return 0; } I'm really confused about eof() function. Suppose my ex.txt's content is: abc It always reads an extra character and show -1. when reading using eof()? But the inf c gave the correct output which was 'abc'? Can anyone help me explain this? Best regards, Chan Nguyen

    Read the article

  • Get pointer to member function from within member function in C++

    - by Eli
    Currently in the program I am attempting to write I need to be able to get a pointer to a member function within a member function of the same class. The pointer needs to be passed to a function as a void (*)(). Example: //CallFunc takes a void (*)() argument class testClass { public: void aFunc2; void aFunc1; } void testClass:aFunc2(){ callFunc(this.*aFunc1); // How should this be done? } void testClass:aFunc1(){ int someVariable = 1; } I'm trying to do this in GCC 4.0.1. Also, the member function being called can't be static because it references non-static variables in the class that it is part of.

    Read the article

  • SQL replicaton - collecting data

    - by Cicik
    Hi, I have master SQL server with DB Central and a lot of satellite SQL servers with DB Client. I need to collect data from log tables(LogTable) on Client(each client has own ID in log table) to one big table on Central(LogTableCentral). Data must go only from Client to Central On each Client I want to have only data for this Client I need solution with minimal amount of work on client side because of count of clients Central is MS SQL server Enterprise, Clients are MS SQL server 2005, 2008 Thanks a lot EDIT: data can be collected periodically(for example: every day at 01:00)

    Read the article

  • WPF, animate over container boundaries

    - by ImIan
    Hi, I'm learning WPF and have a specific goal. Imagine you have a grid (3 rows by 3 columns), and a control, say a simple blue rectangle fills the middle cell. When I click on the cell I want the square to rotate smoothly through 180 degrees. The specific issue I have at the moment is; as the rectangle rotates, it won't change its dimensions, so it will extend beyond the boundary of the cell. I don't want it to clip, i want it to appear on top, partially obscuring surrounding cells. The second part of this is, if there is one cell that fills the entire window, and I click on the blue rectangle in that cell, can I make the rectangle rotate and extend beyond the sides of the form? If that doesn't make sense, please ask. I'm finding it hard to google because I don't know the exact terms I should be using. Thank you

    Read the article

  • Is it possible to synchronize with Microsoft Sync Framework through FTP-transfers?

    - by Christian80
    I'm looking at synchronize methods between two databases and found Microsoft Sync Framework recently. I've been trying to investigate if it suits my needs. My scenario is the following: Two SQL-databases located in different geographical parts. The remote database can go without internet connection for days at times and for some locations the only means of communicating is with ftp transfers to the main server. So my question is: Is it possible to sync between two servers and send the sync-information and data through a ftp-server?

    Read the article

  • RichTextBox text is not shown C#

    - by user271077
    using richtextbox control programatically i'm appending text to the richtextbox . richTextBox1.AppendText("hello"); somehow the text appears in the richTextBox1.Text but is not shown in the form. any idea of what might be the problem? (I checked the forecolor seems ok). Thanks in advance Edit: found the root cause (had by mistake the initializeComponent() twice. ) private void InitializeComponent() { this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.SuspendLayout(); // // richTextBox1 // this.richTextBox1.Location = new System.Drawing.Point(114, 104); this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Size = new System.Drawing.Size(100, 96); this.richTextBox1.TabIndex = 0; this.richTextBox1.Text = ""; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(284, 262); this.Controls.Add(this.richTextBox1); this.Name = "Form1"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); this.ResumeLayout(false); } public Form1() { InitializeComponent(); InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { richTextBox1.AppendText("hello world"); }` but still curious about why did this cause this weird behavior?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >