Search Results

Search found 1557 results on 63 pages for 'daniel gollas'.

Page 51/63 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • How do I fix the alpha value after calling GDI text functions?

    - by Daniel Stutzbach
    I have a application that uses the Aero glass effect, so each pixel has an alpha value in addition to red, green, and blue values. I have one custom-draw control that has a solid white background (alpha = 255). I would like to draw solid text on the control using the GDI text functions. However, these functions set the alpha value to an arbitrary value, causing the text to translucently show whatever window is beneath my application's. After calling rendering the text, I would like to go through all of the pixels in the control and set their alpha value back to 255. What's the best way to do that? I haven't had any luck with the BitBlt, GetPixel, and SetPixel functions. They appear to be oblivious to the alpha value. Here are other solutions that I have considered and rejected: Draw to a bitmap, then copy the bitmap to the device: With this approach, the text rendering does not make use of the characteristics of the monitor (e.g., ClearText). Use GDI+ for text rendering: This application originally used GDI+ for text rendering (before I started working on Aero support). I switched to GDI because of difficulties I encountered trying to accurately measure strings with GDI+. I'd rather not switch back. Set the Aero region to avoid the control in question: My application's window is actually a child window of a different application running in a different process. I don't have direct control over the Aero settings on the top-level window. The application is written in C# using Windows Forms, though I'm not above using Interop to call Win32 API functions.

    Read the article

  • Is there a design pattern to cut down on code duplication when subclassing Activities in Android?

    - by Daniel Lew
    I've got a common task that I do with some Activities - downloading data then displaying it. I've got the downloading part down pat; it is, of course, a little tricky due to the possibility of the user changing the orientation or cancelling the Activity before the download is complete, but the code is there. There is enough code handling these cases such that I don't want to have to copy/paste it to each Activity I have, so I thought to create an abstract subclass Activity itself such that it handles a single background download which then launches a method which fills the page with data. This all works. The issue is that, due to single inheritance, I am forced to recreate the exact same class for any other type of Activity - for example, I use Activity, ListActivity and MapActivity. To use the same technique for all three requires three duplicate classes, except each extends a different Activity. Is there a design pattern that can cut down on the code duplication? As it stands, I have saved much duplication already, but it pains me to see the exact same code in three classes just so that they each subclass a different type of Activity.

    Read the article

  • What is Java Message Service (JMS) for?

    - by Daniel
    I am currently evaluating JMS and I don't get what I could use it for. Currently, I believe this would be a Usecase: I want to create a SalesInvoice PDF and print it when an SalesOrder leaves the Warehouse, so during the Delivery transaction I could send a transactional print request which just begins when the SalesOrder transaction completes successfully. Now I found out most JMS products are standalone server. Why would a need a Standalone Server for Message Processing, vs. e.g. some simple inproc processing with Quartz scheduler? How does it interact with my application? Isn't it much too slow? What are Usecases you already implemented successfully?

    Read the article

  • Two forms are being called from one view.One encodes the russian text the doesn't.

    - by Daniel
    The menu I want to show to the users changes depending on their rights After user authentication I redirect to my menu action which calls its view access/menu.html.erb <% if admin? %> <%form_for(:user, :url => {:controller => 'admin_users',:name => session[:username]}) do |admin|%> <ul><h2>Administrator: <%=session[:username]%></h2></ul> <%= render(:partial =>'admin_form',:locals => {:admin => admin})%> <%end%> <%else%> <%form_for(:user, :url => {:controller => 'students',:name => session[:username]}) do |student|%> <ul><h2>???????: <%=session[:surname].to_s + " " + session[:name].to_s%></h2></ul> <%= render(:partial =>'student_form',:locals => {:student => student})%> <%end%> <%end%> And the forms look: _student_form: <table> <ul> <li><%=link_to '?????',{:controller => 'students'}%></li> </ul> <ul> <li><%=link_to '?????? ?????????',{:controller => 'students'}%></li> </ul> <ul> <li><%=link_to '???????? ?????? ????',{:controller => 'students'}%></li> </ul> <ul> <li><%=link_to '???????? ??????',{:controller => 'students'}%></li> </ul> <ul> <td>&nbsp;</td> </ul> </table> _admin_form: <table> <ul> <li><%=link_to '?????????? ????????????????',{:controller => 'AdminUsers',:role_id => 1}%></li> </ul> <ul> <li><%=link_to '?????????? ????????',{:controller => 'AdminUsers',:role_id => 2}%></li> </ul> <ul> <li><%=link_to '?????????? ??????????',{:controller => 'AdminUsers',:role_id => 3}%></li> </ul> <ul> <li><%=link_to '?????????? ???????????',:controller => 'subjects'%></li> </ul> <ul> <td>&nbsp;</td> </ul> </table> If a log in as a student I get: But if I log in as an administrator I get How can this be posible??

    Read the article

  • What kind of work benifits from OpenCL

    - by Daniel
    Hey All First of all: I am well aware that OpenCL does not magically make everything faster I am well aware that OpenCL has limitations So now to my question, i am used to do different scientific calculations using programming. Some of the things i work with is pretty intense in regards to the complexity and number of calculations. SO i was wondering, maybe i could speed things up bu using OpenCL. So, what i would love to hear from you all is answers to some of the following [bonus for links]: *What kind of calculations/algorithms/general problems is suitable for OpenCL *What is the general guidelines for determining if some particular code would benefit by migration to OpenCL? Regards

    Read the article

  • Android: How to close a cursor that returns from Class to Activity

    - by Daniel
    I have: Accounts.java public class Accounts{ private SQLiteDatabase dbConfig; public Cursor list(Context context, String db, String where, String order) { DBHelper dbHelper = new DBHelper(context, db); dbConfig = dbHelper.getReadableDatabase(); Cursor c = dbConfig.query("accounts", new String[]{ "iId","sName"}, where, null, null, null, order); return c; } } and: MainActivity.java Accounts account = new Accounts(); Cursor cursor = account.list(getApplicationContext(), globalDB, null, null); while (cursor.moveToNext()) { int id = cursor.getInt(0); String name = cursor.getString(1); } cursor.close(); Running my application I get some logcat messages like: close() was never explicitly called on database... What is the best way to prevent it? How can I close a Cursor that returns from other class? Thanks

    Read the article

  • Mimic what is in the Textbox - impossible?

    - by Daniel
    I have four sheets in a spreadsheet. On each sheet there is a textbox. When I type in the textbox on sheet1, I want the textboxes on sheet2, sheet3, and sheet4 to populate with the same value. I've only gotten stupid answers, so someone with real knowledge would be helpful.

    Read the article

  • DIV inside TD to make it appear correctly

    - by Daniel Svensson
    Hi, I have a <table> generated from code-behind and now facing a problem. In one of the TD i need to have a DIV that is setup with JQuery so that when i click a link the DIV slideToggles. Now i need the TD belonging to that TR not to expand the TR. To solve this i have used an old trick that is to place the JQuery DIV inside another surrounding DIV with height 1px and make the TR not expanding with the heigth of the DIV that slides out. In IE the sliding DIV is partially under the table and in Firefox the DIV appears over the table but it's trasparent, the text from the data in the table shows thru. I have tried to alter the Z-index in various ways but it's no good. Anyone that has an idea or alternatively solution that has worked for them. HtmlGenericControl containerDiv = new HtmlGenericControl("div"); containerDiv.ID = "containerDiv"; containerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.Width, "100%"); containerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.Height, "1px"); containerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.ZIndex, "999"); HtmlGenericControl innerDiv = new HtmlGenericControl("div"); innerDiv.ID = System.Guid.NewGuid().ToString() + "_annualDiv"; inner.Style.Add(System.Web.UI.HtmlTextWriterStyle.Width, "100%"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.Height, "300px"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.ZIndex, "1000"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.BorderStyle, "solid"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.BorderColor, "Black"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.BorderWidth, "1px"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.BackgroundColor, "white"); innerDiv.InnerHtml = "Here is a list of links coming later"; conDiv.Controls.Add(innerDiv);

    Read the article

  • VB.NET SqlException Was Unhandled

    - by Daniel
    I am trying some SQL code but I get an error when I try this code. Main.database.ExecuteCommand("UPDATE Contacts SET first_name='" + c.first_name + _ "', middle='" + c.middle + _ "', last_name='" + c.last_name + _ "', age='" + c.age + _ "', mobile_phone='" + c.mobile_phone + _ "', home_phone='" + c.home_phone + _ "', work_phone='" + c.work_phone + _ "', home_street='" + c.home_street + _ "', home_city='" + c.home_city + _ "', home_state='" + c.home_state + _ "', home_zip='" + c.home_zip + _ "', work_street='" + c.work_street + _ "', work_city='" + c.work_city + _ "', work_state='" + c.work_state + _ "', work_zip='" + c.work_zip + _ "', home_www='" + c.home_www + _ "', work_www='" + c.work_www + _ "', home_email='" + c.home_email + _ "', work_email='" + c.work_email + _ "' WHERE first_name='" + c.first_name + _ "' AND last_name='" + c.last_name + "'") I get the following error Sql Exception was unhandled The data types text and varchar are incompatible in the equal to operator.

    Read the article

  • Ensure User has entered string in correct format?

    - by Daniel Granger
    Hi, Whats the best way to ensure the user has entered a valid time string such as: 5:24 5.4 102:30 102.5 It will be entered into a UITextField therefore will be in a NSString. I want to allow the user to enter the time in either hours and minutes (hh:mm) or hours and decimal minutes (hh.m). In the hours minutes example they should be able to enter as many hours as the like but only between 0 - 59 minutes. With the hours decimal minutes I want them to only be able to enter again as many hours as the like but decimal minutes can only be 0 - 9. Many Thanks

    Read the article

  • WebClient - The remote server returned an error: (403) Forbidden.

    - by daniel
    Opening a public page from browser works fine. Downloading same page using WebClient throws - (403) Forbidden. What is going on here ? Here is quick copy/paste example (used on console app) to specific page on web: try { WebClient webClient = new WebClient(); string ss = webClient.DownloadString("http://he.wikisource.org/wiki/%D7%A9%D7%95%D7%9C%D7%97%D7%9F_%D7%A2%D7%A8%D7%95%D7%9A_%D7%90%D7%95%D7%A8%D7%97_%D7%97%D7%99%D7%99%D7%9D_%D7%90_%D7%90"); } catch (Exception ex) { throw; }

    Read the article

  • How to skip certain tests with Test::Unit

    - by Daniel Abrahamsson
    In one of my projects I need to collaborate with several backend systems. Some of them somewhat lacks in documentation, and partly therefore I have some test code that interact with some test servers just to see everything works as expected. However, accessing these servers is quite slow, and therefore I do not want to run these tests every time I run my test suite. My question is how to deal with a situation where you want to skip certain tests. Currently I use an environment variable 'BACKEND_TEST' and a conditional statement which checks if the variable is set for each test I would like to skip. But sometimes I would like to skip all tests in a test file without having to add an extra row to the beginning of each test. The tests which have to interact with the test servers are not many, as I use flexmock in other situations. However, you can't mock yourself away from reality. As you can see from this question's title, I'm using Test::Unit. Additionally, if it makes any difference, the project is a Rails project.

    Read the article

  • Using nsIZipWriter or other to compress a string as a string?

    - by Daniel
    I need to be able to take a javascript string, compress it using any fast and available means and get back a binary string/blob. Background: The extension I'm developing needs to send various large content to my server. It does this conveniently by dynamically creating a form, adding fields to the form and posting it. Some of these fields are just too big bandwidth wise for multiple use. I'd like to be able to compress them before adding them and then maybe base64'ing them if the characters cause a problem in the message. Any ideas? I could use nsiZipWriter with temporary files on disk but that is quite ugly and probably sluggish.

    Read the article

  • Display web page from another site in asp page.

    - by Daniel
    hi all, Our customer has a requirement to extend the functionality of their existing large government project. It is an ASP.NET 3.5 (recently upgraded from 2.0) project. The existing solution is quite a behemoth that is almost unmaintainable so they have decided that they want to provide the new functionality by hosting it on another website that is shown within the existing website. As to how this is best to be done I'm not quite sure right now and if there is any security issues preventing it or that need to be considered. Essentially the user would log on to the existing web site as normal and when cliicking on a certain link the page would load as normal with some kind of frame or control that has within it the contents of the page from the other site. IE. They do not want to simply redirect to the other site they want to show it embedded within the current one such that the existing menus etc are still available. I believe if information needed to be passed to the embedded page it would be done using query strings as I'm not sure if there is even another way to accomplish this. Can anyone give me some pointers on where to start at looking to implement this or any potential pitfalls I should be aware of. Thanks

    Read the article

  • Sound sample recognition library/code

    - by Daniel Mošmondor
    I don't want sound-to-text software. What I need is the following: I'll record multiple (say 50+) audio streams (recordings of radio stations) from that recordings, I'll mark interesting audio clips - their length ranges from 2 to 60 seconds - there will be few thousands of such audio clips library should be able to find other instances of same audio clips from recorded sound streams confidence factor should be reported to used and additional input provided so the recognition could perform better next time Do you know of such software library? LGPL would be most valuable to me, but I can go for commercial license as well.

    Read the article

  • get metadata from jpg, dng and arw raw files

    - by Daniel
    I was wondering if anyone new how to get access the metadata (the date in particular) from jpg, arw and dng files. I've recently lost the folder structure after a merge operation gone-bad and would like to rename the recovered files according to the metadata. I'm planning on creating a little C++ app to dig into each file and get the metadata. any input is appreciated. ( alternatively, if you know of an app that already does this I'd like to know :)

    Read the article

  • Big time Leaking in Objective-C Category

    - by Daniel Amitay
    I created a custom NSString Category which lets me find all strings between two other strings. I'm now running into the problem of finding that there are a lot of kBs leaking from my script. Please see code below: #import "MyStringBetween.h" @implementation NSString (MyStringBetween) -(NSArray *)mystringBetween:(NSString *)aString and:(NSString *)bString; { NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; NSArray *firstlist = [self componentsSeparatedByString:bString]; NSMutableArray *finalArray = [[NSMutableArray alloc] init]; for (int y = 0; y < firstlist.count - 1 ; y++) { NSString *firstObject = [firstlist objectAtIndex:y]; NSMutableArray *secondlist = [firstObject componentsSeparatedByString:aString]; if(secondlist.count > 1){ [finalArray addObject:[secondlist objectAtIndex:secondlist.count - 1]]; } } [autoreleasepool release]; return finalArray; } @end I admit that I'm not super good at releasing objects, but I had believed that the NSAutoreleasePool handled things for me. The line that is leaking: NSMutableArray *secondlist = [firstObject componentsSeparatedByString:aString]; Manually releasing secondlist raises an exception. Thanks in advance!

    Read the article

  • HTML table manipulation using jQuery

    - by Daniel
    I'm building a site using CakePHP and am currently working on adding data to two separate tables at the same time.. not a problem. The problem I have is that I'm looking to dynamically alter the form that accepts the input values, allowing the click of a button/link to add an additional row of form fields. At the moment I have a table that looks something like this: <table> <thead> <tr> <th>Campus</th> <th>Code</th> </tr> </thead> <tbody> <tr> <td> <select id="FulltimeCourseCampusCode0CampusId" name="data[FulltimeCourseCampusCode][0][campus_id]"> <option value=""></option> <option value="1">Evesham</option> <option value="2">Malvern</option> </select> </td> <td> <input type="text" id="FulltimeCourseCampusCode0CourseCode" name="data[FulltimeCourseCampusCode][0][course_code]"> </td> </tr> </tbody> What I need is for the row within the tbody tag to be replicated, with the minor change of having all the zeros (i.e. such as here FulltimeCourseCampusCode0CampusId and here data[FulltimeCourseCampusCode][0][campus_id]) incremented. I'm very new to jQuery, having done a few minor bits, but nothing this advanced (mostly just copy/paste stuff). Can anyone help? Thank you.

    Read the article

  • Git 1.7.10 asks me for github username and password

    - by Daniel Ruf
    Since I have the new version it doesnt ask me anymore for the password I set in my ssh key file. It asks now directly for a github username and password when I push every time. Is this a new feature of git or changed it in the past or is there something what changed on github? I tried to authenticate using ssh and the email and password from my ssh ke file and it worked. Github changed to smartftp and also changed the instructions for setting up repos https://github.com/blog/1104-credential-caching-for-wrist-friendly-git-usage https://help.github.com/articles/create-a-repo Saw it later, they use now https instead of the git protocol

    Read the article

  • How to run tests in plugins?

    - by Daniel Engmann
    We have splitted our grails application into several inplace-plugins. Now we want to have the tests in the same plugin like the classes which they test. Is it possible to configure our application (e.g. in BuildConfig.groovy) so that the tests in the plugins are executed too when we run "test-app"?

    Read the article

  • Why do I have to explicitly cast sometimes for varargs?

    - by Daniel Lew
    I've got a Class that uses reflection a lot, so I wrote a method to help out: private <T> T callMethod(String methodName, Class[] parameterTypes, Object[] args) { try { Class c = mVar.getClass(); Method m = c.getMethod(methodName, (Class[]) parameterTypes); return (T) m.invoke(mVar, args); } // Insert exception catching here [...] } This worked well for any method that had parameters, however I had to explicitly cast parameterTypes to Class[] in order for this to work for methods with no parameters (e.g., callMethod('funName', null, null);). I've been trying to figure out why this is the case. It seems to me that if parameterTypes, when null, had no concept of what type it is (Class[]), then I'd need to cast it for getMethod(). But if that's the case, why is getMethod() able to tell the difference between null, and (Class[]) null when the method is invoked?

    Read the article

  • Automatically generating Guids in Sybase

    - by Daniel Dyson
    I have a table with 42 million records. 32 million have a null value and I would like to generate a new guid for each one. Should I do this in batches? Also, going forward, I would like a new guid added to the field on the insert of a new record. What is the best way to do this? The field is not the primary key, which is an auto-incrementing integer.

    Read the article

  • Key logger wont record key strokes without console

    - by Daniel Gopar
    I created a small basic key logger in C++. For some reason when I compile and run the program with the console displayed, it will record every key stroke I make in whatever program I am using such as a browser and store it in a text file. However when I make it so that it WON'T display a console window, it will not record anything and it's just a process in the background doing nothing. Here is the link to my code: http://pastebin.com/4wqQyLJ9 The function that is giving me trouble with hiding the console, is the Stealth() function. Any suggestions, tips or hints will be helpful. Thanks.

    Read the article

  • A better name for INeedSomething... ?

    - by Daniel Severin
    I was trying pick a name for an interface through which I can pass something into an object like: If the object is INeedX then SetX(some x) method will be called; If the object is INeedY then SetY(some y) method will be called; and so on. (funny as hell, I know :) ) I try to find a different name for this kind of interfaces but I can't figure this out. Does anybody have an idea how to name the INeedSomething interface ?

    Read the article

  • Is O_LARGEFILE needed just to write a large file?

    - by Daniel Trebbien
    Is the O_LARGEFILE flag needed if all that I want to do is write a large file (O_WRONLY) or append to a large file (O_APPEND | O_WRONLY)? From a thread that I read titled "Cannot write 2gb index file" on the CLucene-dev mailing list, it appears that O_LARGEFILE might be needed to write large files, but participants in that discussion are using O_RDWR, not O_WRONLY, so I am not sure.

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >