Search Results

Search found 18677 results on 748 pages for 'current'.

Page 128/748 | < Previous Page | 124 125 126 127 128 129 130 131 132 133 134 135  | Next Page >

  • Android on TabHost little more depth of the problem, there is the hard return key on the treatment.

    - by user365723
    Hello everybody, I have a question on the Android Activity, for example I have a TabHost, and there are included four Activities, the first tab is a search Activity, enter a keyword in the current result of this Activity to return, and in the current Activity display. Is called to display the search results themselves. And after searching several times, and then return to key mobile phone keypad, the display is the result of the last search keyword, I want the press back key to return to the last call of the Activity or TabHost. Should I do? By the way, in a tab in the use of Intent calls a Activity, eg: host.addTab (host.newTabSpec ("friend"). setIndicator ("search") . SetContent (new Intent (this, Search.class))); In this Activity in the need to call another Activity, e.g: startActivity (new Intent (this, Other.class)); Also called another Activity displayed on this tab, but not yet jump out of the show. I ask how you can achieve this?

    Read the article

  • Best way to implement a List(Of) with a maximum number of items

    - by Ben
    I'm trying to figure out a good way of implementing a List(Of) that holds a maximum number of records. e.g. I have a List(Of Int32) - it's being populated every 2 seconds with a new Int32 item. I want to store only the most current 2000 items. How can I make the list hold a maximum of 2000 items, then when the 2001'th item is attempted to be added, the List drops the 2000'th item (resulting in the current total being 1999). Thing is, I need to make sure I'm dropping only the oldest item and adding a new item into the List. Ben

    Read the article

  • Implementing clone on a LinkedList

    - by devoured elysium
    I am trying to implement a clone() method on a DoubleLinkedList. Now, the problem is that implementing it by "the convention" is a lot more troublesome than just creating a new DoubleLinkedList and filling it with all the elements of my current DoubleLinkedList. Is there any inconvenient I am not seeing when doing that? Here is my current approach: @Override public DoubleLinkedList<T> clone() { DoubleLinkedList<T> dll = new DoubleLinkedList<T>(); for (T element : dll) { dll.add(element); } return dll; } Here is what it would be by the convention: @Override public DoubleLinkedList<T> clone() { try { DoubleLinkedList<T> dll = (DoubleLinkedList<T>)super.clone(); //kinda complex code to copy elements return dll; } catch (CloneNotSupportedException e) { throw new InternalError(e.toString()); } }

    Read the article

  • How to access data using VBSCRIPT from a stored procedure which contains values in Temp table ?

    - by Srivigneshwar
    Hi , for testing purpose I wrote a VBscript which will fetch values from Sybase by executing a stored procedure which contains values in temp table. When I run the script I get the following errors , "Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record." or "Item cannot be found in the collection corresponding to the requested name or ordinal." Somewhere when I was googling I found that , the above error message will be shown when we use temp table in stored procedure, if that is the reason , then how can I access data via VBscript by executing the stored procedure ??

    Read the article

  • using a Singleton to pass credentials in a multi-tenant application a code smell?

    - by Hans Gruber
    Currently working on a multi-tenant application that employs Shared DB/Shared Schema approach. IOW, we enforce tenant data segregation by defining a TenantID column on all tables. By convention, all SQL reads/writes must include a Where TenantID = '?' clause. Not an ideal solution, but hindsight is 20/20. Anyway, since virtually every page/workflow in our app must display tenant specific data, I made the (poor) decision at the project's outset to employ a Singleton to encapsulate the current user credentials (i.e. TenantID and UserID). My thinking at the time was that I didn't want to add a TenantID parameter to each and every method signature in my Data layer. Here's what the basic pseudo-code looks like: public class UserIdentity { public UserIdentity(int tenantID, int userID) { TenantID = tenantID; UserID = userID; } public int TenantID { get; private set; } public int UserID { get; private set; } } public class AuthenticationModule : IHttpModule { public void Init(HttpApplication context) { context.AuthenticateRequest += new EventHandler(context_AuthenticateRequest); } private void context_AuthenticateRequest(object sender, EventArgs e) { var userIdentity = _authenticationService.AuthenticateUser(sender); if (userIdentity == null) { //authentication failed, so redirect to login page, etc } else { //put the userIdentity into the HttpContext object so that //its only valid for the lifetime of a single request HttpContext.Current.Items["UserIdentity"] = userIdentity; } } } public static class CurrentUser { public static UserIdentity Instance { get { return HttpContext.Current.Items["UserIdentity"]; } } } public class WidgetRepository: IWidgetRepository{ public IEnumerable<Widget> ListWidgets(){ var tenantId = CurrentUser.Instance.TenantID; //call sproc with tenantId parameter } } As you can see, there are several code smells here. This is a singleton, so it's already not unit test friendly. On top of that you have a very tight-coupling between CurrentUser and the HttpContext object. By extension, this also means that I have a reference to System.Web in my Data layer (shudder). I want to pay down some technical debt this sprint by getting rid of this singleton for the reasons mentioned above. I have a few thoughts on what an better implementation might be, but if anyone has any guidance or lessons learned they could share, I would be much obliged.

    Read the article

  • Multiple Input From Keyboard C# WPF

    - by Alex
    I am writing a Tetris clone in WPF. If I hold down the right arrow key, the current piece shifts right. For playability, I want to allow the user to press another key (i.e. F-key) and rotate the moving piece without having to let go of the right arrow key first. Currently when I do this, the piece stops shifting. My first basic attempt at this was hooking into Window_PreviewKeyDown(object sender, KeyEventArgs e) and then sending a message to the controller layer. How do I structure my input-listening code to allow this? My current code Here

    Read the article

  • Circular database relationships. Good, Bad, Exceptions?

    - by jim
    I have been putting off developing this part of my app for sometime purely because I want to do this in a circular way but get the feeling its a bad idea from what I remember my lecturers telling me back in school. I have a design for an order system, ignoring the everything that doesn't pertain to this example I'm left with: CreditCard Customer Order I want it so that, Customers can have credit cards (0-n) Customers have orders (1-n) Orders have one customer(1-1) Orders have one credit card(1-1) Credit cards can have one customer(1-1) (unique ids so we can ignore uniqueness of cc number, husband/wife may share cc instances ect) Basically the last part is where the issue shows up, sometimes credit cards are declined and they wish to use a different one, this needs to update which their 'current' card is but this can only change the current card used for that order, not the other orders the customer may have on disk. Effectively this creates a circular design between the three tables. Possible solutions: Either Create the circular design, give references: cc ref to order, customer ref to cc customer ref to order or customer ref to cc customer ref to order create new table that references all three table ids and put unique on the order so that only one cc may be current to that order at any time Essentially both model the same design but translate differently, I am liking the latter option best at this point in time because it seems less circular and more central. (If that even makes sense) My questions are, What if any are the pros and cons of each? What is the pitfalls of circular relationships/dependancies? Is this a valid exception to the rule? Is there any reason I should pick the former over the latter? Thanks and let me know if there is anything you need clarified/explained. --Update/Edit-- I have noticed an error in the requirements I stated. Basically dropped the ball when trying to simplify things for SO. There is another table there for Payments which adds another layer. The catch, Orders can have multiple payments, with the possibility of using different credit cards. (if you really want to know even other forms of payment). Stating this here because I think the underlying issue is still the same and this only really adds another layer of complexity.

    Read the article

  • Using the StackTrace Class in a production environment to get calling method info

    - by andy
    hey guys We have a "log" class which uses Relection.MethodBase to send current class info to the log. The reflection.MethodBase stuff happens in the class itself. However, I'd like to move that stuff to a single external "log" singleton type class. In this scenario the external log class needs to get the CALLING info, not the current method info. I'm using stacktrace to do this, which isn't in the Reflection namespace. Can I guarantee that "that" specific information (calling method) will be there in a production environment? var stackTrace = new StackTrace(); return LogManager.GetLogger(stackTrace.GetFrame(1).GetMethod().DeclaringType); cheers!

    Read the article

  • MFC/WIN32: mouse hover highlight in listctrl

    - by Mordachai
    The ListView control of Windows Explorer gives a highlight to whatever item is under the mouse, without affecting the current selection. This helps enormously with relating what item a given tooltip applies to within a listview - especially in report mode. However, I am currently unable to find any APIs that would give my MFC application's CListCtrl that same behavior. Extended styles only have LVS_EX_TRACKSELECT, which actually alters the current selection (yuck!). Does anyone know how to provide a standard CListCtrl (or whatever that actually sits on top of) the mouse-hot-tracking capability? I found some articles on how to provide per cell and per row tooltip text, but its hard to tell what the tooltips relate to without something highlighting...

    Read the article

  • very weird problem concerning date and time in silverlight + ria services

    - by Patrick LHM
    Hello Friends i'm facing a very weird problem in sliverlight 4 + RIA Services, or maybe it's not weird and i'm just a newbie anyway i hope someone here can help, the problem is the following i've created a function on the server side inside the domain service this function is very simple and has a line in it that adds the server current date and time to the database (it's an HR application and employees should sign in and out thrue it each from it's own pc ) Emp.TimeOut = system.DateTime.now (C# syntax) the weird part is that for some users it always adds 3 hours to the current time(exp if he signes out at 5 it shows 8) and for others it works perfectly. the server and all the stations in the company have exactly the same time settings and the same time zone, and anyway my fucntion is on the server side so it should no be realted to the users time. any ideas why this is happening ? i've bin trying to find out why for days now but with no luck

    Read the article

  • Android: Constructing a triangle based on Geographical information

    - by Aidan
    Hi Guys, I'm constructing a geolocation based application and I'm trying to figure out a way to make my application realise when a user is facing the direction of the given location (a particular long / lat co-ord). I've got the math figured, I just have the triangle to construct. Here's a further clarification of what I want to do.. I just want to know is there a way to get java to construct 2 other co-ordinates based on my orientation in relation to true north and my current co-ordinate? I'd like to construct a tri-angle, 45 degrees out each way of my current location (one of the points) and 1 kilometer in that direction. The problem is I don't know how to make Android/Java recognise that I want to find that point in the direction I'm currently facing.. Anyone got any ideas?

    Read the article

  • How do you manage your sqlserver database projects for new builds and migrations?

    - by Rory
    How do you manage your sql server database build/deploy/migrate for visual studio projects? We have a product that includes a reasonable database part (~100 tables, ~500 procs/functions/views), so we need to be able to deploy new databases of the current version as well as upgrade older databases up to the current version. Currently we maintain separate scripts for creation of new databases and migration between versions. Clearly not ideal, but how is anyone else dealing with this? This is complicated for us by having many customers who each have their own db instance, rather than say just having dev/test/live instances on our own web servers, but the processes around managing dev/test/live for others must be similar.

    Read the article

  • Getting ready for learn html5

    - by vtortola
    Hi, I'm a desktop application developer, and I plan learning html5, but as it's not released, there is no (almost) published books and no too much infomation from beginners on the web... I fell I should start with html4 and the current web development skills. I think, I should start with html4, css and javascript... but there are so many technologies related that I get lost :D So, what current technologies will be sill used when html5 be released? I mean, what about "jquery" and "ajax"? I know they are javascript under the hood, but will they still make sense in the future? What would you recommend me considering that I have just a little bit of html knowlegde, almost null CSS and completely null in javascript? Thanks in advance.

    Read the article

  • file_operations Question, how do i know if a process that opened a file for writing has decided to c

    - by djTeller
    Hi Kernel Gurus, I'm currently writing a simple "multicaster" module. Only one process can open a proc filesystem file for writing, and the rest can open it for reading. To do so i use the inode_operation .permission callback, I check the operation and when i detect someone open a file for writing I set a flag ON. i need a way to detect if a process that opened a file for writing has decided to close the file so i can set the flag OFF, so someone else can open for writing. Currently in case someone is open for writing i save the current-pid of that process and when the .close callback is called I check if that process is the one I saved earlier. Is there a better way to do that? Without saving the pid, perhaps checking the files that the current process has opened and it's permission... Thanks!

    Read the article

  • Intercepting static and dynamic links using javascript

    - by soren.qvist
    Hi, I'm currently developing an ajax application and I'm looking for a feature that lets me intercept all static and dynamic links using javascript. The links look like these: <a href="link1/">link 1</a> <a href="link2/">link 2</a> etc. I then want the browser to redirect to: current.page/#link1/ rather than current.page/link1/. I'm using jQuery, so the live() function is an option, however using that as a solution just seems rather sluggish to me(am I hysterical?). If there is a way to intercept ALL links on a page, maybe through detecting a change in the address, that would greatly help. I've tried a few plugins for jQuery (jQuery address & SWFaddress) but they only seem to have event handlers that respond to changes in anchor tags in the address. Any ideas? thanks for your time

    Read the article

  • Implement Combobox/Option Menu funcionality on an iPhone interface?

    - by MikeN
    I want to give a list of choices on an iPhone GUI that works like a Combobox/Option menu. It needs to display the current selection, but on tapping it you should be able to change the current selection which will trigger a refresh of the screen. The option menu is letting the user choose which category a search is being performed under. So there is a default category and there are about 6 other choices. Idea 1: Use a label or button and when clicked on a new screen overlays that has all 6 options in a tableview, clicking on one closes the overlay screen and goes back to the main page with the updated value displayed. Idea 2: Should I use a totally different but native iPhone GUI widget like a Navbar at the bottom of the screen to reflect the different options?

    Read the article

  • Listbox that when you reach the end it goes back to the beginning

    - by Roy
    Hi, Is there a way to make a Listbox go back to the beginning of the list once a user scrolls all the way to the end of list? Current aspx code: <ListBox x:Name="listbox"> <ListBox.ItemTemplate> <DataTemplate> <Image Name="imgSource" Source="{Binding Path=Url}" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> Current code behind code: public class ImageScroller { public string Url { get; set; } } public MainPage() { InitializeComponent(); LoadImages(); } void LoadImages() { listbox.ItemsSource = new List<ImageScroller> { new ImageScroller { Url = "images/Chrysanthemum.jpg" }, new ImageScroller { Url = "images/Desert.jpg" }, new ImageScroller { Url = "images/Hydrangeas.jpg" }, }; } Thanks for your help!

    Read the article

  • Android how to create notification that resumes activity

    - by Adam Praiswater
    I a have a notification in a receiver that fires off fine, but it restarts the activity (thus clearing the edittexts and resetting the toggle button) How can i set it so that when its tapped on it resumes the activity rather that clearing and resetting everything? My current code doesnt work. Current Code String currentDateTimeString = DateFormat.getDateTimeInstance().format(new Date()); Intent intenti= new Intent(context, Locator.class); intenti.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intenti, 0); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context) .setSmallIcon(R.drawable.xxxxxxnotifyicon) .setContentTitle("xxxxxxx Link") .setContentText("Auto Check In Complete at " + currentDateTimeString); mBuilder.setContentIntent(contentIntent); mBuilder.setDefaults(Notification.DEFAULT_SOUND); mBuilder.setAutoCancel(true); NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); mNotificationManager.notify(1, mBuilder.build());

    Read the article

  • "Inline" function call: function is never hit

    - by Shimrod
    Hi everybody. I'm trying to make a tabbed menu for the asp.net website I'm working on. One of the pre-requisite is obviously to color the current tab differently, so the user can know on which tab is currently is. To do this, I made this method in my code-behind: Protected Function GetCssClass(ByVal ctrl As LinkButton) As String If ctrl.ID = currentLink Then Return "current" Else Return String.Empty End If End Function and I call the method like this in my aspx page: <asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="/Default.aspx" CssClass="<%#GetCssClass(LinkButton1) %>" >Home</asp:LinkButton> <asp:LinkButton ID="LinkButton2" runat="server" PostBackUrl="/Directory/page1.aspx" CssClass="<%#GetCssClass(LinkButton2) %>" >Page1</asp:LinkButton> But the method is never hit... As I understand, the method should be called each time the LinkButton is drawn... Does someone have an idea why? Thanks in advance !

    Read the article

  • How to determine the inner context node within an XSLT select

    - by Marcus Rickert
    Hi there! I'm trying to determine a subset of nodes stored in the variable objs by using a user defined function cube:is_active: <xsl:variable name="active_cubes" select="$objs[cube:is_active(XXX) = 'TRUE']"/ Since the function does not allow a local context I'm required to pass it as a parameter (denoted by XXX). However, the usual suspects "." or "current()" do not work since they refer to context node of the surrounding block and NOT to the current element of objs which is evaluated. The only solution so far which DOES work is: XXX=SOME_CHILD_TAG/.. But this is really ugly since it depends on the existence of the child tag for the parent node to work correctly. Is there any other way? Thanks!

    Read the article

  • Difference between Cloud and Virtualization

    - by Akash Kava
    Ops: This does not belong to ServerFault because it focuses on Programing Architecture. I have following questions regarding differences between Cloud and Virtualization.. How Cloud is different then Virtualization? Currently I tried to find out pricing of Rackspace, Amazone and all similar cloud providers, I found that our current 6 dedicated servers came cheaper then their pricing. So how one can claim cloud is cheaper? Is it cheaper only in comparison of normal hosting? We re organized our infrastructure in virtual environment to reduce or configuration overhead at time of failure, we did not have to rewrite any peice of code that is already written for earlier setup. So moving to virtualization does not require any re programming. But cloud is absoltely different and it will require entire reprogramming right? Is it really worth to recode when our current IT costs are 3-4 times lower then cloud hosting including raid backups and all sort of clustering for high availability? New programming architecture means new overheads of training staff, new methods of testing and new deployment schemes, does it justify over "on demand resource usage" words of cloud? We are having current development architecture with simple Server side ASP.NET WebServices with no local context and on client side Flex/Silverlight which offers pretty good REST architecture and its highly scalable. How does cloud differs from REST model of deployment? On storage, SQL Server or MySQL offers pretty good replication and high availibility then what is advantage in cloud? Data guarantee, one of our vendor hosting some other customer's app on cloud (one of most used), lost Entire Hard Disk (the virtual) and entire module in first 6 months. Second provider said its your duty to take backup, fine I agree, but no provider gives SLA for data guarantee, they give 99% uptime. However in most business apps, uptime is less important then data integrity. In our 10 years of dedicated hosting experience we had only one hard disk crash. This makes me little skeptical to go for cloud and loosing control over data. And I feel its just a big marketing buzz to sell virtulization in different form. Size of data, currently all providers charge very heavy for large data, if you are hosting only below 100GB cloud can be good alternative, but I think virtual servers and dedicated servers above 100GB to few TBs are still cheaper. Why would want to pay so high on cloud when there is no data guarentee as well as it doesnt say anything about redundancy. (I wish SO had something for spell check for Internet Explorer, sorry for wrong spellings in my post)

    Read the article

  • How do i tint an image with HTML5 Canvas ?

    - by djdolber
    My question is, what is the best way to tint an image that is drawn using the drawImage method. The target useage for this is advanced 2d particle-effects (game development) where particles change colors over time etc. I am not asking how to tint the whole canvas, only the current image i am about to draw. I have concluded that the globalAlpha parameter affects the current image that is drawn. //works with drawImage() canvas2d.globalAlpha = 0.5; But how do i tint each image with an arbitrary color value ? It would be awesome if there was some kind of globalFillStyle or globalColor or that kind of thing...

    Read the article

  • Custom Error mode in Web.Config File

    - by Zerotoinfinite
    Hi All, I have deployed my application on server and Now I am getting this error: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off". Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL. ~~~ I have defined custom error pages for my applicatio. Please help me, how to rectify this issue. Thanks in advance.

    Read the article

< Previous Page | 124 125 126 127 128 129 130 131 132 133 134 135  | Next Page >