Search Results

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

Page 78/748 | < Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >

  • Touching an object in a tweened animation?

    - by Michael
    I'm having trouble porting a simple game I developed for the iPhone over to Android. The game has an animated ball which moves from Point A to Point B. The user must touch the ball before it reaches point B or lose the game. This was easy to implement on the iPhone using Core Animation since I could locate the current position of the ball by accessing its animation layer. In Android, I attempted to recreate the game using tweened animation and represented the ball as a Drawable. My issue is that I can't determine if the user is touching the spot because the Drawable apparently bounds do not update as the ball visually moves - making the program think the ball is always in its original position. While searching these forums I saw an Android team dev. confirm that you can't get the current location in a tweened animation but offered no solution for a workaround. Can I accomplish this on the Android using my current approach? If not, what approach should I use? Best regards, Michael

    Read the article

  • I have Following code but rest of it how?

    - by Hakan
    I have following code which is putting value of text box to table but i can't manage how to delete record. Can someone help me about it? Dim meter As DataTable = Me.DataSet1.Tables.Item("tblmeter") Dim row As DataRow = meter.NewRow() row.Item("No") = Me.txtno.Text row.Item("Turnover") = Me.txtturnover.Text row.Item("Total Win") = Me.txttotalwin.Text row.Item("Games Played") = Me.txtgamesplayed.Text row.Item("Credit In") = Me.txtcreditin.Text row.Item("Bill In") = Me.txtbillin.Text row.Item("Hand Pay") = Me.txthandpay.Text row.Item("Date") = DateTime.Today.ToShortDateString meter.Rows.Add(row) Me.TblMeterTableAdapter.Update(Me.DataSet1.tblMeter) meter.AcceptChanges() Dim table As DataTable = Me.DataSet1.Tables.Item("tblmeter") Dim defaultView As DataView = table.DefaultView Dim cell As New DataGridCell((defaultView.Table.Rows.Count - 1), 1) Me.DataGrid1.CurrentCell = cell txtno.Text = "" txtturnover.Text = "" txttotalwin.Text = "" txtgamesplayed.Text = "" txtcreditin.Text = "" txtbillin.Text = "" txthandpay.Text = "" txtno.Focus() I am using following code but it's not update records. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim current As DataRowView = DirectCast(Me.BindingContext.Item(Me.DataSet1.Tables.Item("tblmeter")).Current, DataRowView) current.Delete() Me.DataSet1.tblMeter.AcceptChanges() Me.TblMeterTableAdapter.Update(Me.DataSet1.tblMeter) End Sub Code deletes records from datagrid but not updating. Any help

    Read the article

  • List Directories and get the name of the Directory

    - by chrissygormley
    Hello, I am trying to get the code to list all the directories in a folder, change directory into that folder and get the name of the current folder. The code I have so far is below and isn't working at the minute. I seem to be getting the parent folder name. import os for directories in os.listdir(os.getcwd()): dir = os.path.join('/home/user/workspace', directories) os.chdir(dir) current = os.path.dirname(dir) new = str(current).split("-")[0] print new I also have other files in the folder but I do not want to list them. I have tried the below code but I haven't got it working yet either. for directories in os.path.isdir(os.listdir(os.getcwd())): Can anyone see where I am going wrong? Thanks

    Read the article

  • Zend Dd Rowset getting parent row

    - by simple
    I am wondering about using the abstraction in Zend Db RowSet instead of joins, is it possible for instance I am able to get some info from parent table as in here /** * Get default photo info (path , description) */ public function getDefaultPhotoInfo($userdId){ $select = $this->select($this) ->where('id=?', $userdId); $rowset = $this->fetchAll($select); $current = $rowset->current(); $res = $current->findParentRow('UserPhotos', 'Avatar'); if(isset($res)){ return $res->toArray(); } } How can I use Rowset abstraction to get this logic working table( id, pic_path,) table_translation(id, table_id, lang_id, pic_title); the above is representation of two tables , the idea is to get the info from both table specifying the lang_id , it is easy with joins but can I do it with the abstraction of Db Rowset ?

    Read the article

  • Configuration file reading. Best practice

    - by Andrew Florko
    Application stores configuration data in custom section of configuration file. This information is used all over the application. Nowadays I use helper static class to to provide access like this (some code omitted or simplified): [XmlRoot("webSiteSection")] public class WebSiteConfig : IConfigurationSectionHandler { public static WebSiteConfig Current { get { if (_current == null) _current = (WebSiteConfig) ConfigurationManager.GetSection("webSiteSection"); return _current; } } [XmlElement("section1")] public Section1 Section1 { get; set; } [XmlElement("section2")] public Section2 Section2 { get; set; } ... public object Create(object parent, object configContext, XmlNode section) { var serializer = new XmlSerializer(typeof(WebSiteConfig)); return serializer.Deserialize(new XmlNodeReader(section)); } } Then I use it like this <%: WebSiteConfig.Current.Section1.Value1 %> <%: WebSiteConfig.Current.Section1.Value2 %> What do you think of it? I find it usable because it keeps code simple, but also confused as IConfigurationSectionHandler is deprecated since .NET Framework 2.0

    Read the article

  • SQL - Two foreign keys that have a dependency between them

    - by Brian
    The current structure is as follows: Table RowType: RowTypeID Table RowSubType: RowSubTypeID FK_RowTypeID Table ColumnDef: FK_RowTypeID FK_RowSubTypeID (nullable) In short, I'm mapping column definitions to rows. In some cases, those rows have subtype(s), which will have column definitions specific to them. Alternatively, I could hang those column definitions that are specific to subtypes off their own table, or I could combine the data in RowType and RowSubType into one table and work with a single ID, but I'm not sure either is a better solution (if anything, I'd lean towards the latter, as we mostly end up pulling ColumnDefs for a given RowType/RowSubType). Is the current design SQL Blasphemy? If I keep the current structuree, how do I maintain that if RowSubTypeID is specified in ColumnDef, that it must correspond to the RowType specified by RowTypeID? Should I try to enforce this with a trigger or am I missing a simple redesign that would solve the problem?

    Read the article

  • Windows CE vs Windows Mobile

    - by Vaccano
    I often see these terms: Windows CE Windows Mobile Pocket PC Windows Mobile Smart Phone I know the difference between the second 2, but I am confused on the first. I thought it was the name of the Mobile OS prior to Windows Mobile 5. But I am seeing it more often in current products. (Here is a current MS Form for developing on it. Here is a current product for creating them.) What is it and how does it relate to the Windows Mobile lines?

    Read the article

  • Caching roles in a cookie

    - by AspOnMyNet
    1) a) I assume roles are cached ( by setting Roles.CacheRolesInCookie ) only for current user? b) Besides Roles.GetRolesForUser(_currentUser), are there any other methods that will read role information for current user from role cookie and thus won’t have to connect to the data base? 2) a) I assume that normally role cookie gets updated only when current user is added or removed from the role(s) or when the cookie expires? b) Because role names can be cached apart from the data source, it is possible that changes to role management at the data source would not be reflected in the cached values. In this case, the user must close and re-open their browser to clear the cached cookie value. How exactly could role cookie get cached apart from the data source? 3) If the number of roles cached in a role cookie equals the value of Roles.MaxCachedResults, then I assume when Roles.GetRolesForUser (_currentuser) gets called, it will need to check the DB to see whether user is also a member of any additional roles? thanx

    Read the article

  • Reading HttpURLConnection InputStream - manual buffer or BufferedInputStream?

    - by stormin986
    When reading the InputStream of an HttpURLConnection, is there any reason to use one of the following over the other? I've seen both used in examples. Manual Buffer: while ((length = inputStream.read(buffer)) > 0) { os.write(buf, 0, ret); } BufferedInputStream is = http.getInputStream(); bis = new BufferedInputStream(is); ByteArrayBuffer baf = new ByteArrayBuffer(50); int current = 0; while ((current = bis.read()) != -1) { baf.append(current); } EDIT I'm still new to HTTP in general but one consideration that comes to mind is that if I am using a persistent HTTP connection, I can't just read until the input stream is empty right? In that case, wouldn't I need to read the message length and just read the input stream for that length? And similarly, if NOT using a persistent connection, is the code I included 100% good to go in terms of reading the stream properly?

    Read the article

  • onunload message needed but not when they click internal links

    - by tumtummetjes
    okay i have a question... i need an message script that only will come up when people are really leaving the current webpage so not the current website... so actualli when people are leaving the website entirelly the message will come up, they need to press the ok button to stay at the current page and cancel to leave the entire website.. the script may not run when people are actually stay on the website or when the click on internal links/pages.. does that make sence/? and can it be done? who know such code?

    Read the article

  • MDX - how to filter on children of nextmember

    - by Raj
    I have a user defined hierarchy in SSAS as follows: Calendar Year Month Of Year I want to create following named set in BIDS. Set1 should include "Month of Year" values of 1-9 for current Calendar Year Set2 should include "Month of Year" values of 10-12 for current Calendar Year Set3 shoud include "Month of Year" values of 1-3 for next Calendar Year Set4 shoud include "Month of Year" values of 4-6 for next Calendar Year The "current calendar year" will come through a join with another dimension though a fact table. I would appreciate help with MDX. And, can I use CurrentMember in the named sets?

    Read the article

  • Passing ASP.NET User by Dependency Injection

    - by UpTheCreek
    In my web application I have various components that need to access the currently authenticated user (HttpContext.User). There are two obvious ways a component can access this: 1) Accessing getting the User from HttpContext.Current 2) Passing the user around in constructors Is not ideal because it makes testing difficult and ties application components to web concerns, when they really shouldn't know about it. Is just messy and complicates everything. So I've been thinking about passing in the current user (or perhaps just the name/id) to any component that needs it using an IoC container (via dependency injection). Is anyone using this technique to supply the current ASP.NET user to parts of the application? Or, Does this sound like a sensible approach? I would like know how this has worked out for people. Thanks

    Read the article

  • Obtaining the server IP address in WCF?

    - by chris
    How can I obtain the server IP address that was used to connect to a service? The server has multiple IP addresses and I need to know which one the client is connected to. So far I only found that OperationContext.Current.EndpointDispatcher.EndpointAddress and OperationContext.Current.Channel.LocalAddress contain the address from .config (e.g. localhost) OperationContext.Current.IncomingMessageProperties.Via contains the Url that the client used to connect to the server (but this might just be a name from the clients hosts file). EDIT - Sorry, I wasn't being clear enough: The server needs to know which of its IP addresses were used by the client. E.g. the server has the addresses 10.0.0.1 and 10.0.0.2. when processing the request the server service needs to know if 10.0.0.1 or 10.0.0.2 was used by the client to connect to it.

    Read the article

  • resizing arrays when close to memory capacity

    - by user548928
    So I am implementing my own hashtable in java, since the built in hashtable has ridiculous memory overhead per entry. I'm making an open-addressed table with a variant of quadratic hashing, which is backed internally by two arrays, one for keys and one for values. I don't have the ability to resize though. The obvious way to do it is to create larger arrays and then hash all of the (key, value) pairs into the new arrays from the old ones. This falls apart though when my old arrays take up over 50% of my current memory, since I can't fit both the old and new arrays in memory at the same time. Is there any way to resize my hashtable in this situation Edit: the info I got for current hashtable memory overheads is from here How much memory does a Hashtable use? Also, for my current application, my values are ints, so rather than store references to Integers, I have an array of ints as my values.

    Read the article

  • How to export the matches only in a pattern search in vim?

    - by Mert Nuhoglu
    Is there a way to grab and export the match part only in a pattern search without changing the current file? For example, from a file containing: 57","0","37","","http://www.thisamericanlife.org/Radio_Episode.aspx?episode=175" 58","0","37","","http://www.thisamericanlife.org/Radio_Episode.aspx?episode=170" I want to export a new file containing: http://www.thisamericanlife.org/Radio_Episode.aspx?episode=175 http://www.thisamericanlife.org/Radio_Episode.aspx?episode=170 I can do this by using substitution like this: :s/.\{-}\(http:\/\/.\{-}\)".\{-}/\1/g :%w>>data But the substitution command changes the current file. Is there a way to do this without changing the current file?

    Read the article

  • how to access package explorer element in eclipse plugin

    - by Ankit Malik
    hi i am making an eclipse plugin which make a ui on right clicking a project in eclipse workspce . the ui contains text fields , package explorer for the current project and directory explorer for current project. i have successfully made a ui which appears on clicking a menu item on right clicking the project but it seems i can't make any jface or swt ui since they are not visible when we are using eclipse command hadlers .so in order to overcome it i made dialog pages but they have limited dialog like directorty dialog and file dialog and that too for entire window directory..... but i want package explorer and directory explorer for the project i just chose like it happens when u try making a new class in a project the browse buttons just show packages and directory struture w.r.t to current selection am i doin things wrong or is there a way out please suggest .....

    Read the article

  • Limit of 88 bytes on response.write?

    - by Chris
    I am trying to serve a csv file from a wcf service, as a string response. It looks like this: HttpContext.Current.Response.AddHeader("Content-disposition", "attachment; filename=ImportErrors.csv"); HttpContext.Current.Response.ContentType = "text/csv"; HttpContext.Current.Response.Write(myCsvContent); The response StatusCode is set to (int)HttpStatusCode.OK (200) It works, but I am only getting 88 bytes of my csv and the rest is cut off (not shown). Any suggestions on where to look? I don't see any custom entries in my web.config that are setting a limit.

    Read the article

  • Android: various questions about GPS

    - by wei
    I'm writing my first location based android app, but got confused about some of the GPS service api. Here are some questions I have: 1) To get my current location, I called requestLocationUpdates() with a listener in the onCreate() method of one activity. But what happens when another activity starts and the current activity goes invisible? Is the GPS location update going to stop? If so, how do I keep it on after the activity is switched? 2) how accurate is the Location.getSpeed()? How is it computed? Can it tell the difference between on bicycle and on foot? 3) not really a question about android. How to calculate the coordinates of a location, say, 100m away from my current location? 4) To stop the GPS, I only need to remove all the listeners that have been registered to locationmanager? Thanks a lot!

    Read the article

  • Problem doing SVN Vendor Branch - merge

    - by Gyan
    Hi, I am trying to use the svn vendor branch to upgrade the third party library. (We have modified the source code) I followed all the steps to create the vendor branch:: created the vendor branch for old version (3rd party library) created the vendor branch for latest version (3rd party library) copied the latest version to current folder using (usign svn_load_dirs.pl script) structure of vendor repository in svn URL/vendor/library/3.5.0 URL/vendor/library/3.7.0 URL/vendor/library/current I have the library-3.5.0 used/modified at URL/trunk/library/customized-library I have a problem when I try to merge the difference between URL/vendor/library/3.7.0 and URL/vendor/library/3.5.0 to URL/trunk/library/customized-library I am at the folder where URL/trunk/library/customized-library is checked out and I use following command to do the merge svn merge URL/vendor/library/3.5.0 URL/vendor/library/current . --accept PARAMETERS when I use theirs-conflict for accept parameter, It ignores all of my changes to the old version and copies files from 3.7.0 when I user mine-conflict, it ignores the files in 3.7.0 when I use postpone, it throws exception "tree conflict" Thanks Gyan

    Read the article

  • Does Microsoft hate firefox? ASP.Net gridview performance in firefox bug?

    - by Maxim Gershkovich
    Could someone please explain the significant difference in speed between a firefox updatepanel async postback and one performed in IE? Average Firefox Postback Time For 500 objects: 1.183 Second Average IE Postback Time For 500 objects: 0.295 Seconds Using firebug I can see that the majority of this time in FireFox is spent on the server side. A total of 1.04 seconds. Given this fact the only thing I can assume is causing this problem is the way that ASP.Net renders its controls between the two browsers. Has anyone run into this problem before? VB.Net Code Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click GridView1.DataBind() End Sub Public Function GetStockList() As StockList Dim res As New StockList For l = 0 To 500 Dim x As New Stock With {.Description = "test", .ID = Guid.NewGuid} res.Add(x) Next Return res End Function Public Class Stock Private m_ID As Guid Private m_Description As String Public Sub New() End Sub Public Property ID() As Guid Get Return Me.m_ID End Get Set(ByVal value As Guid) Me.m_ID = value End Set End Property Public Property Description() As String Get Return Me.m_Description End Get Set(ByVal value As String) Me.m_Description = value End Set End Property End Class Public Class StockList Inherits List(Of Stock) End Class Markup <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <script type="text/javascript" language="Javascript"> function timestamp_class(this_current_time, this_start_time, this_end_time, this_time_difference) { this.this_current_time = this_current_time; this.this_start_time = this_start_time; this.this_end_time = this_end_time; this.this_time_difference = this_time_difference; this.GetCurrentTime = GetCurrentTime; this.StartTiming = StartTiming; this.EndTiming = EndTiming; } //Get current time from date timestamp function GetCurrentTime() { var my_current_timestamp; my_current_timestamp = new Date(); //stamp current date & time return my_current_timestamp.getTime(); } //Stamp current time as start time and reset display textbox function StartTiming() { this.this_start_time = GetCurrentTime(); //stamp current time } //Stamp current time as stop time, compute elapsed time difference and display in textbox function EndTiming() { this.this_end_time = GetCurrentTime(); //stamp current time this.this_time_difference = (this.this_end_time - this.this_start_time) / 1000; //compute elapsed time return this.this_time_difference; } //--> </script> <script type="text/javascript" language="javascript"> var time_object = new timestamp_class(0, 0, 0, 0); //create new time object and initialize it Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); function BeginRequestHandler(sender, args) { var elem = args.get_postBackElement(); ActivateAlertDiv('visible', 'divAsyncRequestTimer', elem.value + ''); time_object.StartTiming(); } function EndRequestHandler(sender, args) { ActivateAlertDiv('visible', 'divAsyncRequestTimer', '(' + time_object.EndTiming() + ' Seconds)'); } function ActivateAlertDiv(visstring, elem, msg) { var adiv = $get(elem); adiv.style.visibility = visstring; adiv.innerHTML = msg; } </script> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <Triggers> <asp:AsyncPostBackTrigger ControlID="Button1" EventName="click" /> </Triggers> <ContentTemplate> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"> </asp:UpdateProgress> <asp:Button ID="Button1" runat="server" Text="Button" /> <div id="divAsyncRequestTimer" style="font-size:small;"> </div> <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False"> <Columns> <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" /> <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /> </Columns> </asp:GridView> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetStockList" TypeName="WebApplication1._Default"> </asp:ObjectDataSource> </ContentTemplate> </asp:UpdatePanel> </form>

    Read the article

  • Drop down value setting

    - by Harish
    Whenever a new window is opened and the drop value by default is 'yyyy'(For eg: yyyy for years), onclick of the drop down the value should automatically change to current year, which will be one of the values in the dropdown list (any place in the drop down). So now the value will be set to the current year. Again if the user clicks on the dropdown, the user can change the value to any(For eg: select 'yyyy'). So now the value set in drop down is 'yyyy'. condition 3, if the user clicks on the drop down since the value is 'yyyy' , focus should be the current year and also the value automatically. Please give the sloution for the mentioned requirement????

    Read the article

  • ASP.Net Architecture Specific to Shared/Static functions

    - by Maxim Gershkovich
    Hello All, Could someone please advise in the context of a ASP.Net application is a shared/static function common to all users? If for example you have a function Public shared function GetStockByID(StockID as Guid) as Stock Is that function common to all current users of your application? Or is the shared function only specific to the current user and shared in the context of ONLY that current user? So more specifically my question is this, besides database concurrency issues such as table locking do I need to concern myself with threading issues in shared functions in an ASP.Net application? In my head; let’s say my application namespace is MyTestApplicationNamespace. Everytime a new user connects to my site a new instance of the MyTestApplicationNamespace is created and therefore all shared functions are common to that instance and user but NOT common across multiple users. Is this correct?

    Read the article

  • Help needed with Linq To Sql Query

    - by fearofawhackplanet
    I have the concept of valid/ordered transitions. So for example, it's not possible to move to status In progress from status Complete. Current and Next in table StatusTransition are FK (StatusType.Id). The Linq generator has created the following relations: Child Property Name: StatusTransitions1 Parent Property Name: StatusType1 Participating Properties: StatusType.Id -> StatusTransition.Next Child Property Name: StatusTransitions Parent Property Name: StatusType Participating Properties: StatusType.Id -> StatusTransition.Current I'm normally ok with Linq but I'm having difficulty getting the list of valid Next StatusTypes from the Current status. public List<StatusType> GetValidStatusTransitions(int statusId) { // trying to write something like the following // (obviously not correct) return _statusRepository .Where(s => s.Id == statusId) .Next.StatusTypes; }

    Read the article

  • Efficiently display file status when using background thread

    - by schmoopy
    How can i efficiently display the status of a file when using a background thread? For instance, lets say i have a 100MB file: when i do the code below via a thread (just as an example) it runs in about 1 min: foreach(byte b in file.bytes) { WriteByte(b, xxx); } But... if i want to update the user i have to use a delegate to update the UI from the main thread, the code below takes - FOREVER - literally i don't know how long im still waiting, ive created this post and its not even 30% done. int total = file.length; int current = 0; foreach(byte b in file.bytes) { current++; UpdateCurrentFileStatus(current, total); WriteByte(b, xxx); } public delegate void UpdateCurrentFileStatus(int cur, int total); public void UpdateCurrentFileStatus(int cur, int total) { // Check if invoke required, if so create instance of delegate // the update the UI if(this.InvokeRequired) { } else { UpdateUI(...) } }

    Read the article

  • jQuery Custom Lightbox issue

    - by Neurofluxation
    I have been writing my own Lightbox script (to learn more about jQuery). My code for the captions are as follows (the problem is that the captions are the same on every image): close.click(function(c) { c.preventDefault(); if (hideScrollbars == "1") { $('body').css({'overflow' : 'auto'}); } overlay.add(container).fadeOut('normal'); $('#caption').animate({ opacity: 0.0 }, "5000", function() { $('div').remove('#caption'); }); }); $(prev.add(next)).click(function(c) { c.preventDefault(); $('div').remove('#caption') areThereAlts = ""; var current = parseInt(links.filter('.selected').attr('lb-position'),10); var to = $(this).is('.prev') ? links.eq(current - 1) : links.eq(current + 1); if(!to.size()) { to = $(this).is('.prev') ? links.eq(links.size() - 1) : links.eq(0); } if(to.size()) { to.click(); } });

    Read the article

< Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >