Daily Archives

Articles indexed Wednesday June 9 2010

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

  • How to use App.Xaml's ResourseDictionaries with own entry point

    - by Polaris
    Hello friends. I created some logic for singleInstance application and I must to use my own entry point (not App.xaml) for Application. I have some styles in App.xaml which now is not working. How can I use this ResourceDictionaries from my App.xaml for entire project in my situation? My class for manage Application Startup public class SingleInstanceManager : WindowsFormsApplicationBase { App app; public SingleInstanceManager() { this.IsSingleInstance = true; } protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { try { // First time app is launched app = new App(); App.Current.Properties["rcID"] = e.CommandLine; //IntroLibrary.OpenDocumentFromNotify(); app.Run(); return false; } catch (Exception ex) { MessageBox.Show(ex.Message); return false; } } protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) { // Subsequent launches base.OnStartupNextInstance(eventArgs); Intro win = (Intro)app.MainWindow; if (eventArgs != null) { App.Current.Properties["rcID"] = eventArgs.CommandLine[0]; } IntroLibrary.OpenDocumentFromNotify(); app.Activate(); } } and my own Entry Point: public class EntryPoint { [STAThread] public static void Main(string[] args) { SingleInstanceManager manager = new SingleInstanceManager(); manager.Run(args); } } And my App.Xaml code behind: public partial class App : Application { protected override void OnStartup(System.Windows.StartupEventArgs e) { base.OnStartup(e); // Create and show the application's main window Intro window = new Intro(); window.Show(); } public void Activate() { // Reactivate application's main window this.MainWindow.Activate(); } } And my App.xaml has some code which decribe ResourceDictionaries which doesnt work. Why?

    Read the article

  • Can I access elements/methods named "button1" "button2" "button3" etc. using "buttoni" inside a for-

    - by cksubs
    I have a bunch of buttons named: button1 button2 button3 etc. Is there a way to basically do this? pseudocode for(int i = 1, i < 15, i++) { button{i}.selected = YES; } This also goes for method calls, etc. I've often thought such a way of calling methods would be very convenient, but I don't think I've ever seen it done when using compiled languages. But I have done it using PHP. Is there any way to do this in Objective-C? (That's where my problem is now, but I'd also be interested in if you can do this in other languages.) Alternately, is there a reason why this is NOT a good way to go about accessing all the UI elements? Thanks!

    Read the article

  • testing In-app purchases iphone??

    - by hemant
    while testing my application i bought a product it had on my phone through the test account...now i deleted the application and reinstalled it but in my application it still shows that the product is already bought...when we buy through in-app purchase does the product i bought or its id gets stored on iphone filesystem?? i am just testing the application so i dont know much about what could be wrong in it??

    Read the article

  • How to export pdf page as a image using pdfsharp .net library ?

    - by vi.su.
    How to export a pdf page as an image using pdfsharp .net library, for pixel level manipulation ? for example, something like, System.Drawing.BitMap.GetPixel() I am trying to find out empty area (all white, or of any colour) inside a pdf document, to write some graphics / image. 09, June 2010: I have tried this, but it is not working. why the following code is not working as expected ? Bitmap.GetPixel always returns 0. // // PdfSharp.Pdf.PdfDocument // PdfSharp.Pdf.PdfPage // PdfSharp.Drawing.XGraphics // System.Drawing.Bitmap // string srcPDF = @"C:\hcr\test\tmp\file1.pdf"; PdfDocument pdfd = PdfReader.Open(srcPDF); XGraphics xgfx = XGraphics.FromPdfPage(pdfd.Pages[0]); Bitmap b = new Bitmap((int) pdfp.Width.Point, (int) pdfp.Height.Point, xgfx.Graphics); int rgb = b.GetPixel(0, 0).ToArgb();

    Read the article

  • nHibernate storage of an object with self referencing many children and many parents

    - by AdamC
    I have an object called MyItem that references children in the same item. How do I set up an nhibernate mapping file to store this item. public class MyItem { public virtual string Id {get;set;} public virtual string Name {get;set;} public virtual string Version {get;set;} public virtual IList<MyItem> Children {get;set;} } So roughly the hbm.xml would be: <class name="MyItem" table="tb_myitem"> <id name="Id" column="id" type="String" length="32"> <generator class="uuid.hex" /> </id> <property name="Name" column="name" /> <property name="Version" column="version" /> <bag name="Children" cascade="all-delete-orphan" lazy="false"> <key column="children_id" /> <one-to-many class="MyItem" not-found="ignore"/> </bag> </class> This wouldn't work I don't think. Perhaps I need to create another class, say MyItemChildren and use that as the Children member and then do the mapping in that class? This would mean having two tables. One table holds the MyItem and the other table holds references from my item. NOTE: A child item could have many parents.

    Read the article

  • Five unique, random numbers from a subset

    - by tau
    I know similar questions come up a lot and there's probably no definitive answer, but I want to generate five unique random numbers from a subset of numbers that is potentially infinite (maybe 0-20, or 0-1,000,000). The only catch is that I don't want to have to run while loops or fill an array. My current method is to simply generate five random numbers from a subset minus the last five numbers. If any of the numbers match each other, then they go to their respective place at the end of the subset. So if the fourth number matches any other number, it will bet set to the 4th from the last number. Does anyone have a method that is "random enough" and doesn't involve costly loops or arrays? Please keep in mind this a curiosity, not some mission-critical problem. I would appreciate it if everyone didn't post "why are you having this problem?" answers. I am just looking for ideas. Thanks a lot!

    Read the article

  • select query related problem

    - by user222585
    i have interest rate and amount in a table where interest rate are ranged in different values like 4.5,4.6,5.2,5.6 etc. i want to get sum of amounts classified by interest rate where interest rate will be separated by .25. for example all amount having interest rate 1.25,1.3,1.4 will be in one group and 1.5,1.67,1.9 will be in another group how can i write the query?

    Read the article

  • ASP.NET with C# or VB.NET + C#?

    - by Sahat
    I am currently reading Beginning ASP.NET 4: in C# and VB (Wrox Programmer to Programmer) and it comes with both C# and VB.NET source code. I am definitely planning to use C# in the future for most of my projects. But VB.NET - is it worth learning side-by-side with C#? Will there be a case when VB.NET is preferred over C#?

    Read the article

  • Design pattern to integrate Rails with a Comet server

    - by empire29
    I have a Ruby on Rails (2.3.5) application and an APE (Ajax Push Engine) server. When records are created within the Rails application, i need to push the new record out on applicable channels to the APE server. Records can be created in the rails app by the traditional path through the controller's create action, or it can be created by several event machines that are constantly monitoring various inputstream and creating records when they see data that meets a certain criteria. It seems to me that the best/right place to put the code that pushes the data out to the APE server (which in turn pushes it out to the clients) is in the Model's after_create hook (since not all record creations will flow through the controller's create action). The final caveat is I want to push a piece of formatted HTML out to the APE server (rather than a JSON representation of the data). The reason I want to do this is 1) I already have logic to produce the desired layout in existing partials 2) I don't want to create a javascript implementation of the partials (javascript that takes a JSON object and creates all the HTML around it for presentation). This would quickly become a maintenance nightmare. The problem with this is it would require "rendering" partials from within the Model (which im having trouble doing anyhow because they don't seem to have access to Helpers when they're rendered in this manner). Anyhow - Just wondering what the right way to go about organizing all of this is. Thanks

    Read the article

  • Mac OSX: Passing a link to file from user process to kernel module.

    - by Inso Reiges
    Hello, I need to pass a link to file from a user process to the OSX kernel driver. By link i mean anything that uniquely identifies a file on the local filesystem. I need that link to do I/O on that file in kernel. The most obvious solution seems to pass a file name and use a VFS vnode lookup. However i noticed, that Apple Disk Images helper process passes a raw data array for image-path property to driver when attaching a disk image file: <2f 56 6f 6c 75 6d 65 73 2f 73 74 6f 72 61 67 65 2f 74 65 73 74 32 2e 64 6d 67> What is that diskimages-helper passes to the kernel driver? Some serialized type perhaps? If yes, what type is it and how can i use it?

    Read the article

  • get_browser not working

    - by tazphoenix
    it's not working.i mean i have many scripts to get ip and os but anyway get_browser is internal function and should work but its not.when i try to get a print_r on the function i get. Array ( [browser_name_regex] => §^.*$§ [browser_name_pattern] => * [browser] => Default Browser [version] => 0 [majorver] => 0 [minorver] => 0 [platform] => unknown [alpha] => [beta] => [win16] => [win32] => [win64] => [frames] => 1 [iframes] => [tables] => 1 [cookies] => [backgroundsounds] => [cdf] => [vbscript] => [javaapplets] => [javascript] => [activexcontrols] => [isbanned] => [ismobiledevice] => [issyndicationreader] => [crawler] => [cssversion] => 0 [supportscss] => [aol] => [aolversion] => 0 ) I'm using win7 and firefox.

    Read the article

  • Does iOS 4 Have "Real" Multitasking?

    - by pkulak
    Ever since the first beta came out I've been trying to find out if "real" multitasking is possible. I.E., can you put a program in the background and have it hang on to a network connection indefinitely? I'm thinking about IM or IRC apps, for example. I've compiled an app myself on OS 4, and without changing a thing it appeared to stay running in the background, but for all I know it was just suspended to memory. The docs say the best you can do is request up to 10 minutes, but in the developer presentation they showed off Skype sitting in the background and then notifying the user that a call was coming in. Does anyone know for sure how this is all going to work?

    Read the article

  • Does replace into have a where clause?

    - by Lajos Arpad
    I'm writing an application and I'm using MySQL as DBMS, we are downloading property offers and there were some performance issues. The old architecture looked like this: A property is updated. If the number of affected rows is not 1, then the update is not considered successful, elseway the update query solves our problem. If the update was not successful, and the number of affected rows is more than 1, we have duplicates and we delete all of them. After we deleted duplicates if needed if the update was not successful, an insert happens. This architecture was working well, but there were some speed issues, because properties are deleted if they were not updated for 15 days. Theoretically the main problem is deleting properties, because some properties are alive for months and the indexes are very far from each other (we are talking about 500, 000+ properties). Our host told me to use replace into instead of deleting properties and all deprecated properties should be considered as DEAD. I've done this, but problems started to occur because of syntax error and I couldn't find anywhere an example of replace into with a where clause (I'd like to replace a DEAD property with the new property instead of deleting the old property and insert a new to assure optimization). My query looked like this: replace into table_name(column1, ..., columnn) values(value1, ..., valuen) where ID = idValue Of course, I've calculated idValue and handled everything but I had a syntax error. I would like to know if I'm wrong and there is a where clause for replace into. I've found an alternative solution, which is even better than replace into (using simply an update query) because deletes are happening behind the curtains if I use replace into, but I would like to know if I'm wrong when I say that replace into doesn't have a where clause. For more reference, see this link: http://dev.mysql.com/doc/refman/5.0/en/replace.html Thank you for your answers in advance, Lajos Árpád

    Read the article

  • need to changed markup with jquery

    - by user357034
    I have the following markup which I do not have direct access to... <a href="javascript:void(0);" onclick="window.open('/BulkDiscounts.asp?ProductID=318&ProductCode=' + escape('LB30X40ES') + '&Orig_Price=22.95', 'Discounts', 'scrollbars,status,resizable,width=330,height=300');"><iimg src="/v/vspfiles/templates/100/images/buttons/btn_quantitydiscounts.gif" border="0" align="absmiddle"></a> I need to "rewrite" the above as follows... A few things to point out is that the title is coming from a variable escape(global_Current_ProductCode) variable=productcode in the case above it is LB30X40ES The height and weight, price and product id used in the second markup must be from the first markup. Note that these change depending on the product loaded. These are not constants. I would guess the first thing to do was to add the thickbox class. Then I am lost as to what to do next. Basically I need to open up an thickbox iframe with the modified markup.

    Read the article

  • delegate method throws runtime "unrecognized selector" error when switching back from one UIViewCont

    - by chimgrrl
    Ok, I've spend like half day on this and it's killing me. So I've got 3 view controllers transitioning from one another, something like this: I call the UploadDecisionViewController after destroying the previous View Controller: [self dismissModalViewControllerAnimated:YES]; [self performSelector:@selector(showUDModalView) withObject:nil afterDelay:0.5]; In my showUDModalView method: - (void)showUDModalView { UploadDecisionViewController *udcontroller = [[UploadDecisionViewController alloc] initWithNibName:@"UploadDecisionViewController" bundle:nil]; udcontroller.delegate = self; [self presentModalViewController:udcontroller animated:YES]; [udcontroller release]; } The UploadDecisionViewController shows up no problem. The UploadDecisionViewController has a button, which when clicked I want it to transition to the FileUploadViewController. I setup a UploadDecisionDelegate, threw a method in there to handle the button clicking: Inside UploadDecisionDelegate protocol (UploadDecisionViewController.h): @protocol UploadDecisionDelegate //let UOnliveViewController know that a button was selected - (void)UploadDecisionViewController:(UploadDecisionViewController *)controller madeChoice:(NSString *)whichDirection; @end Then inside my IBAction method when the button is clicked, I have this: - (IBAction)decisionSelected:(id)sender { [delegate UploadDecisionViewController:self madeChoice:@"upload"];//crashing at this line } When I run this, at this line above it is throwing a runtime exception: 2010-06-09 12:48:59.561 UOnlive[4735:207] *** -[UIView UploadDecisionViewController:madeChoice:]: unrecognized selector sent to instance 0x3b65420 2010-06-09 12:48:59.562 UOnlive[4735:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIView UploadDecisionViewController:madeChoice:]: unrecognized selector sent to instance 0x3b65420' 2010-06-09 12:48:59.563 UOnlive[4735:207] Stack: ( 33502299, 2495698185, 33884219, 33453686, 33306306, 20618, 2982917, 3390286, 3399023, 3394235, 3087839, 2996168, 3022945, 40156505, 33287040, 33283144, 40150549, 40150746, 3026863, 11700, 11554 ) Let me throw in the delegate method implemented also: - (void)UploadDecisionViewController:(UploadDecisionViewController *)controller madeChoice:(NSString *)whichDirection { NSLog(@"it got to here 245"); [self dismissModalViewControllerAnimated:YES]; if (yesOrNo) { //open up the FileUploadViewController and proceed to upload [self performSelector:@selector(showFUModalView) withObject:nil afterDelay:0.5]; } } Can someone tell me what the heck is going on? Thanks a bunch for the help...

    Read the article

  • inline images in email using javamail

    - by manu1001
    I want to send an email with an inline image using javamail. I'm doing something like this. MimeMultipart content = new MimeMultipart("related"); BodyPart bodyPart = new MimeBodyPart(); bodyPart.setContent(message, "text/html; charset=ISO-8859-1"); content.addBodyPart(bodyPart); bodyPart = new MimeBodyPart(); DataSource ds = new ByteArrayDataSource(image, "image/jpeg"); bodyPart.setDataHandler(new DataHandler(ds)); bodyPart.setHeader("Content-Type", "image/jpeg; name=image.jpg"); bodyPart.setHeader("Content-ID", "<image>"); bodyPart.setHeader("Content-Disposition", "inline"); content.addBodyPart(bodyPart); msg.setContent(content); I've also tried bodyPart.setHeader("inline; filename=image.jpg"); and bodyPart.setDisposition("inline"); but no matter what, the image is being sent as an attachment and the Content-Dispostion is turning into "attachment". How do I send an image inline in the email using javamail?

    Read the article

  • html rending of a prtion of data

    - by pradeep
    Hi, I have a section like $myresult .= '<tbody>'; /*start printing the table wth feature and ratings */ for ($i = 1 ; $i < $numProperties; $i++){ if($master_rating_properties['rating'.$i.'_name']){ $myresult .= '<tr>'; $myresult .= '<td width=\'22%\'>'; $indfeature = 0; $indfeature = $row_product['property'.$i.'_avg']; $myresult .= $master_rating_properties['rating'.$i.'_name'].' ( '.$indfeature .')'; $myresult .= '</td>'; $myresult .= '<td colspan=\'0\' width=\'38%\' >'; $tocheck = $indfeature; for($k = 0.5; $k <= 10.0; $k+=0.5){ $tocheck = roundOff($tocheck); if(($tocheck) == $k) { $chk = "checked"; } else { $chk = ""; } $myresult .= '<input class=\'star {split:2}\' type=\'radio\' name=\'drating'.$i.'\' id=\'drating'.$i.''.$k.'\' value=\''. $k .'\' '.$chk.' title=\''. $k.' out of 10 \' disabled \'/>'; } /* for k loop end */ /* added later ,was missing */ $myresult .= '</td>'; $myresult .= '</tr>'; } /* end if loop */ } /* end i for loop */ $myresult .= '</tbody>'; /* end tbody */ it works fine like printing the 10 stars(radio buttons) horizontally . but many a time all the 10 stars turn vertical.and after few browser refreshes it comes back to horizontal position. any idea .y this is causing problem? does tbody tag cause some problem.

    Read the article

  • How can I get class, property, and method data from files without executing their code, similar to R

    - by Chris
    I have a bunch of PHP files with classes, in them (although I can't be 100% sure that they won't have code outside of classes in them too), and I need to parse these files to get information about the classes, such as the names of the classes, the methods, the properties, whether they are private/public/static, etc. I looked at PHP's reflection classes and this is very close to what I want but the reflection doesn't seem to use external files and it appears to need to define the classes first. I need to make sure that none of the code is executed and I will be editing the files so I can't guarantee that they will even be error-free. Any suggestions? Thanks.

    Read the article

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