Daily Archives

Articles indexed Monday April 12 2010

Page 22/116 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Algorithm for dynamic combinations

    - by sOltan
    My code has a list called INPUTS, that contains a dynamic number of lists, let's call them A, B, C, .. N. These lists contain a dynamic number of Events I would like to call a function with each combination of Events. To illustrate with an example: INPUTS: A(0,1,2), B(0,1), C(0,1,2,3) I need to call my function this many times for each combination (the input count is dynamic, in this example it is three parameter, but it can be more or less) function(A[0],B[0],C[0]) function(A[0],B[1],C[0]) function(A[0],B[0],C[1]) function(A[0],B[1],C[1]) function(A[0],B[0],C[2]) function(A[0],B[1],C[2]) function(A[0],B[0],C[3]) function(A[0],B[1],C[3]) function(A[1],B[0],C[0]) function(A[1],B[1],C[0]) function(A[1],B[0],C[1]) function(A[1],B[1],C[1]) function(A[1],B[0],C[2]) function(A[1],B[1],C[2]) function(A[1],B[0],C[3]) function(A[1],B[1],C[3]) function(A[2],B[0],C[0]) function(A[2],B[1],C[0]) function(A[2],B[0],C[1]) function(A[2],B[1],C[1]) function(A[2],B[0],C[2]) function(A[2],B[1],C[2]) function(A[2],B[0],C[3]) function(A[2],B[1],C[3]) This is what I have thought of so far: My approach so far is to build a list of combinations. The element combination is itself a list of "index" to the input arrays A, B and C. For our example: my list iCOMBINATIONS contains the following iCOMBO lists (0,0,0) (0,1,0) (0,0,1) (0,1,1) (0,0,2) (0,1,2) (0,0,3) (0,1,3) (1,0,0) (1,1,0) (1,0,1) (1,1,1) (1,0,2) (1,1,2) (1,0,3) (1,1,3) (2,0,0) (2,1,0) (2,0,1) (2,1,1) (2,0,2) (2,1,2) (2,0,3) (2,1,3) Then I would do this: foreach( iCOMBO in iCOMBINATIONS) { foreach ( P in INPUTS ) { COMBO.Clear() foreach ( i in iCOMBO ) { COMBO.Add( P[ iCOMBO[i] ] ) } function( COMBO ) --- (instead of passing the events separately) } } But I need to find a way to build the list iCOMBINATIONS for any given number of INPUTS and their events. Any ideas? Is there actually a better algorithm than this? any pseudo code to help me with will be great. C# (or VB) Thank You

    Read the article

  • Oracle -Character Encoding

    - by user314250
    I am facing a peculiar problem where i need to update a particular value in database to say 'Hellò'. When i run normal update statement the values are updated fine. But when i put it i a .sql script file and then run the update statement the last character gets replaced by a junk value. Can some one enlighten me on this and how oracle processes script files?

    Read the article

  • In Debian, how can I route rtorrent to a certain network interface, say ppp0?

    - by Timo
    I have purchased a PPTP account from StrongVPN and configured the setup by these (http://pptpclient.sourceforge.net/howto-debian.phtml#configure_by_hand) instructions and now I want to have rtorrent do its communication to the Internet through this VPN tunnel. So I have a ppp0 interface, which has the VPN tunnel. What is the next step? I guess it has something to do with the routing tables? I am new to routing, so please be elementary and precise so that I understand! Thank you!

    Read the article

  • Keep Track of Your Tasks with toDoo

    - by Asian Angel
    A tasks list can be convenient but most times you can not include details for those tasks or have to have an online account to do so. If you want to keep your tasks list with you on your computer or laptop and be able to add plenty of details then you might want to look at toDoo. Note: Requires Adobe AIR (download link at bottom of article). toDoo in Action Once you have installed toDoo everything is rather straightforward for getting started. The first time that you start toDoo there will be a temporary “fill-in” for the “Subject & Details Areas”. Simply highlight over the temporary text and add your information. Notice that if desired you can easily set a custom date and time for your tasks right below the “Details Area”. Note: toDoo does not minimize to the “System Tray”. Once you have everything set all that you need to do is click on “add task”. Here was our first new task being viewed in the “toDoo Description Tab”. Time to add a second task…here you can see the drop-down calendar. You can scroll through and select a different month very easily…just click on the desired day and it will be automatically set. Adding our second task… If you need to edit any of the details for a particular task you can do so in the “Edit toDoo Tab”. This nice little app is convenient and easy to use. Conclusion ToDoo is a simple straightforward app that lets you keep track of your tasks list and relevant details without an online account (especially helpful if you are without a wireless connection at a given moment). If you are looking for more of a list approach that runs on your desktop, then check out our article on Doomi here. Links Download ToDoo at Softpedia Download ToDoo at Adobe Marketplace Download Adobe AIR Similar Articles Productive Geek Tips Turn Chrome’s New Tab Page into a Google Tasks PageMake To-Do Bar in Outlook 2007 Show Only Today’s TasksAdd a non-Google Tasks List to ChromeKeep Track of Homework Assignments with SoshikuTrack the Amount of Time You Spend Online in Firefox TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Download Videos from Hulu Pixels invade Manhattan Convert PDF files to ePub to read on your iPad Hide Your Confidential Files Inside Images Get Wildlife Photography Tips at BBC’s PhotoMasterClasses Mashpedia is a Real-time Encyclopedia

    Read the article

  • Need GDI programming Guideline

    - by Arman
    I want to change my window design rapidly. I have OnPaint function which I am calling when WM_PAINT message received. The design change only when the event occure. I want that design should automatically update doesn't depend on event kindly guide me how can I make it possible.

    Read the article

  • Error while Installing Android app on Android virtual device

    - by Priyank
    Hi. I have created a small and simple android app. I tried installing it on an actual android device. But because it won't install, I created an AVD resembling my phone. I tried copying and installing app on that AVD and it still says that error. "Application xxx could not be installed on this phone". Before I tried installing my app on the phone or AVD I following steps: 1. Exported an unsigned copy of application onto my hard-drive. 2. User jarsigner to sign the app 3. Verified with jarsigner that my app is signed properly. 4. Used zipalign to optimize the app resources. I do not have an icon assigned to myapp but mandatory properties like version etc. have been specified properly. I had initially developed app using 2.1 version but because of compatability issues with my phone I reverted code to compile on 1.5 and it still doesn't get installed either on AVD or my phone. My AVD is on 2.1 though and code is compiled with 1.5. Is there a place where I can see the logs as to why app is not getting installed. It would be really helpful. Cheers

    Read the article

  • What is better, a STL list or a STL Map for 20 entries, considering order of insertion is as importa

    - by Abhijeet
    I have the following scenario.The implementation is required for a real time application. 1)I need to store at max 20 entries in a container(STL Map, STL List etc). 2)If a new entry comes and 20 entries are already present i have to overwrite the oldest entry with the new entry. Considering point 2, i feel if the container is full (Max 20 entries) 'list' is the best bet as i can always remove the first entry in the list and add the new one at last (push_back). However, search won't be as efficient. For only 20 entries, does it really make a big difference in terms of searching efficiency if i use a list in place of a map? Also considering the cost of insertion in map i feel i should go for a list? Could you please tell what is a better bet for me ?

    Read the article

  • Eclipse CDT: Import source / header files into my new project, without duplicating them

    - by Tom
    Hi all, Im sure there is a very simple solution for this. I have a bunch of .cpp / .h files from a project, say in directory ~/files On the other hand, I want to create a c++ project using eclipse to work on those files, so I put my workspace on ~/wherever. Then I create a c++ project: ~/wherever/project, and include the source files (located in /~files). The problem i'm having is that files are now duplicated in ~/wherever/project, and I would like to avoid that, specially so I know which copy of the file to commit. Is this possible? Im sure it is, but cant get it. Thanks in advance.

    Read the article

  • linux kernel booting from my bootloader

    - by sp3tsnaz
    hi , i wish to load linux using my own bootloader .. preliminary research and google told me that i ll have to use start_kerne() function .. i want to ask how can i call start_kernel() from assembly .. i have already formatted my usb into ext3 and pasted the compiled kernel there .. now how can i start the linux kernel ? any help is welcome // Thankyou in advance Mohsin .

    Read the article

  • codingBat last2 using regex

    - by polygenelubricants
    Okay guys, this is similar to my repeatEnd and wordEnds efforts; I want to solve this codingBat Warmup-2 question using only regex-based techniques as a "brain gymnastics" exercise. This solution works for codingBat tests: public int last2(String str) { return str.isEmpty() ? 0 : str.split( str.replaceAll( ".*(.)(.)", "$1(?=$2)" //.replaceAll("(\\$.)", "\\\\\\\\Q$1\\\\\\\\E") ), -1 ).length - 1 - 1; } The monstrous octo-slashes aren't needed to pass codingBat, but is needed for a proper regex-based solution. That is, if I want this (and I do!): assert last2("..+++...++") == 2; I'd have to uncomment the second .replaceAll. I'm just wondering if others can come up with a simpler, more elegant regex solution for this problem. Preferably one that doesn't contain octo-slashes.

    Read the article

  • Compact Framework targeting

    - by En
    If a smart device project is set to target CF 2.0, Windows CE 5.0, should this same application run on Windows Mobile 6 with CF 3.5 installed? I was able to install it (the CF 2 app), but when running received an error stating that the assemblies could not be loaded and that CF might not be installed. This has led me to belive that smart device projects wil ONLY work on the framework they target, not any versions lower or greater. Any help would be greatly appreciated.

    Read the article

  • question about CGAffineTransformTranslate

    - by www.ruu.cc
    CGRect rect1 = backgroundImageView.frame; NSLog(@"%f,%f,%f,%f",rect1.origin.x,rect1.origin.y,rect1.size.width,rect1.size.height); angle = -90.0; moveX = 0; moveY = 0.0; CGFloat degreesToRadians = M_PI * angle / 180.0; CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation(degreesToRadians); landscapeTransform = CGAffineTransformTranslate( landscapeTransform, moveX, moveY ); [backgroundImageView setTransform:landscapeTransform]; rect1 = backgroundImageView.frame; NSLog(@"%f,%f,%f,%f",rect1.origin.x,rect1.origin.y,rect1.size.width,rect1.size.height); the debug message output: 0.000000,0.000000,320.000000,480.000000 -80.000000,80.000000,480.000000,320.000000 why does the (x,y) changes to (-80,80)?

    Read the article

  • How to set custom size for cursor in swing?

    - by swift
    I am using the below code to set a custom cursor for JPanel, but its enlarging the image which i set for cursor. Is there a way to set a customized cursor size ? Toolkit toolkit = Toolkit.getDefaultToolkit(); BufferedImage erasor=new BufferedImage(10,10, BufferedImage.TYPE_INT_RGB); Graphics2D g2d=(Graphics2D) erasor.createGraphics(); g2d.setPaint(Color.red); g2d.drawRect(e.getX(),e.getY() ,10, 10); toolkit.getBestCursorSize(10, 10); Cursor mcursor=toolkit.createCustomCursor(erasor, new Point(10,10), "Eraser"); setCursor(mcursor);

    Read the article

  • how to get mxml file in ActionScript class

    - by nemade-vipin
    hello friend I want to refer my mxml file into Actionscript class.My code is :- Mxml file is :- var User:Authentication; User = new Authentication(); User.authentication(); } ]] <mx:Panel width="100%" height="100%" layout="absolute"> <mx:TabNavigator width="100%" height="100%" id="viewstack2"> <mx:Form label="Login Form" id="loginform"> <mx:FormItem label="Mobile no:" creationPolicy="all"> <mx:TextInput id="mobileno"/> </mx:FormItem> <mx:FormItem label="Password:" creationPolicy="all"> <mx:TextInput displayAsPassword="true" id="password" /> </mx:FormItem> <mx:FormItem> <mx:Button label="Login" click="authentication()"/> </mx:FormItem> </mx:Form> <mx:Form label="Child List"> <mx:Label width="100%" color="blue" text="Select Child."/> </mx:Form> </mx:TabNavigator> </mx:Panel> Action script class is package SBTSBusineesObject { import generated.webservices.*; import mx.collections.ArrayCollection; import mx.controls.Alert; import mx.rpc.events.FaultEvent; public class Authentication { [Bindable] private var childName:ArrayCollection; [Bindable] private var childId:ArrayCollection; private var photoFeed:ArrayCollection; private var arrayOfchild:Array; private var newEntry:GetSBTSMobileAuthentication; public var user:SBTSWebService; public var mxmlobj:SBTS =null; public function authentication():void { user = new SBTSWebService(); mxmlobj = new SBTS(); if(user!=null) { user.addSBTSWebServiceFaultEventListener(handleFaults); user.addgetSBTSMobileAuthenticationEventListener(authenticationResult); newEntry = new GetSBTSMobileAuthentication(); if(newEntry!=null) { if(mxmlobj != null) { newEntry.mobile = mxmlobj.mobileno.text ; newEntry.password=mxmlobj.password.text; } user.getSBTSMobileAuthentication(newEntry); } } } public function handleFaults(event:FaultEvent):void { Alert.show("A fault occured contacting the server. Fault message is: " + event.fault.faultString); } public function authenticationResult(event:GetSBTSMobileAuthenticationResultEvent):void { if(event.result != null && event.result._return>0) { if(event.result._return > 0) { var UserId:int = event.result._return; if(mxmlobj != null) { mxmlobj.loginform.enabled = false; mxmlobj.viewstack2.selectedIndex=1; } } else { Alert.show("Authentication fail"); } } } } }

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >