Search Results

Search found 1346 results on 54 pages for 'ray casting'.

Page 35/54 | < Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >

  • Java HashSet<Integer> to int array

    - by jackweeden
    I've got a HashSet with a bunch of (you guessed it) integers in it. I want to turn it into an array, but calling hashset.toArray(); returns an array of Object type. This is fine, but is there a better way to cast it to an array of int, other than iterating through every element manually? A method I want to pass it to void doSomething(int[] arr) Won't accept the Object[] array, even if I try casting it like doSomething((int[]) hashSet.toArray());

    Read the article

  • Why does Android's onItemClick want a long for row Id?

    - by HenryAdamsJr
    For a listView, when you register an OnItemClickListener, the method you specify looks like this: public abstract void onItemClick (AdapterView parent, View view, int position, long id) The id corresponds to the row that the user clicked on. My question is simply why is it a long and not an int? When would you use it as a long? I've been casting it to an int when I use it, so it makes me think that maybe I'm using it wrong.

    Read the article

  • libpcap packet size

    - by silverbandit91
    I'm working with libpcap in C on linux (centos) and I'm following this guide I want to simply print out the entire packet in ascii and i'v managed to get it working by casting it a u_char* in the "my_callback" function. But I can't figure out how to get the length of the data. strstr didn't work. the header has a len member that you can access to get the size but I can't find anything similar for the *packet being passed. Any help is appreciated.

    Read the article

  • Distinct with Count and SQl Server 2005

    - by chopps
    Hey everyone, Trying to work on a query that will return the top 3 selling products with the three having a distinct artist. Im getting stuck on getting the unique artist. Simplified Table schema Product ProductID Product Name Artist Name OrderItem ProductID Qty So results would look like this... PID artist qty 34432, 'Jimi Hendrix', 6543 54833, 'stevie ray vaughan' 2344 12344, 'carrie underwood', 1

    Read the article

  • How do you get the selected value of a spinner -- Android

    - by Matthew Hall
    Hi everyone, I'm trying to get the selected items string out of a spinner. So far I've got this: bundle.putString(ListDbAdapter.DB_PRI, v.getText().toString()); This doesn'y work and gives a casting exception (I thought you could cast a view to a widget that inherits it... obviously not!). So how do you get the selected value of a spinner

    Read the article

  • Distinct with Count and SQl Server

    - by chopps
    Hey everyone, Trying to work on a query that will return the top 3 selling products with the three having a distinct artist. Im getting stuck on getting the unique artist. Simplified Table schema Product ProductID Product Name Artist Name OrderItem ProductID Qty So results would look like this... PID artist qty 34432, 'Jimi Hendrix', 6543 54833, 'stevie ray vaughan' 2344 12344, 'carrie underwood', 1

    Read the article

  • C# Image HttpHandler: Disable cookies in handler (YSlow / Google PageSpeed)

    - by user319111
    Hi. I have a HttpHandler for resizing images, round corners, reflection etc etc. This i working OK. The problem i have is, that some data is stored in cookies, and the cookies are send to images, when they are shown. Is there any way to disable this globally (cookie-free requests) in web.config, or even in the HttpHandler itself? Example page: http://test.roob.dk/dk/product/ray-ban-rb3359-polarized-16/ Thanks in advance CP // Denmark

    Read the article

  • What is wrong with this Anonymous Object Initializate Syntax?

    - by Ramiz Uddin
    What is wrong with this Anonymous Object Initialize syntax? If (Not row Is Nothing) Then Dim info As New CultureInfo(Conversions.ToString(row.Item("cultureId"))) With { _ .NumberFormat = New With {.CurrencySymbol = Conversions.ToString(row.Item("symbol")), .CurrencyGroupSeparator = Conversions.ToString(row.Item("thousSep")), .CurrencyDecimalSeparator = Conversions.ToString(row.Item("thousSep")), .CurrencyDecimalDigits = Conversions.ToInteger(row.Item("decimals")), .NumberGroupSeparator = Conversions.ToString(row.Item("thousSep")), .NumberDecimalSeparator = Conversions.ToString(row.Item("thousSep")), .NumberDecimalDigits = Conversions.ToInteger(row.Item("decimals"))}} } hashtable.Add(key, info) End If It is a syntax error or object initialization type casting issue. Thanks.

    Read the article

  • Further explanation of IntentService

    - by rayman
    Hi all, I was trying to get the purpose of the IntentService, and when should I use it? I tried to understand from the API, but not enough details on that one. Is there any analogy between this and running long-task on a working thread? Any further explanation and samples on why I would use IntentService would be very welcome. Thanks, ray.

    Read the article

  • Infinite service

    - by rayman
    Hello, I have some proccess that i would like to run in the background the whole time. so i made it "service". my question is: is there anyway to prevent from the user to kill this service? (even if he uses third party app) thanks, ray.

    Read the article

  • ASP.NET GridView Sort?

    - by Curtis White
    I'm performing a query with a sort in the Selecting event of the LinqDataSource. I'm then casting my query to a list and assigning it to the result. I'm using this data source in an ASP.NET gridview. I can see the list is sorted but when the ASP.NET gridview does not seem to be respecting the sort order. How can I get the gridview to respect my default sort order?

    Read the article

  • Efficiency questions

    - by rayman
    Hi, I have to manage XML documents and Strings in my app. In terms of efficiency and memory usage, will a collection like ArrayList be much more expensive than String[]? Also, I could store the content as a regular String or XML. Is working with XML also more expensive? (When I say expensive, I am referring to the use of system resources.) If there are differences, are they significant? Thanks, Ray.

    Read the article

  • XNA - 2D Tile Lighting

    - by Cyral
    Im adding lighting to my 2D Tile based game. I found the link http://blog.josack.com/2011/07/xna-2d-dynamic-lighting.html useful, but the way its done it dosent support collision. What Id like is some help or links as I want one that can have -always lit up light points -collision (If the light ray hits a block, then dim the next block by whatever amount until its dark) Im a noob at this stuff, but ive been searching around for quite a while but no luck (I did find Catalin's tutorial, but it seemed abit advanced for me)

    Read the article

  • NAN mixing float and GLFloat?

    - by carrots
    This often returns NAN ("Not A Number") depending on input: #define PI 3.1415f GLfloat sineEaseIn(GLfloat ratio) { return 1.0f-cosf(ratio * (PI / 2.0f)); } I tried making PI a few digits smaller to see if that would help. No dice. Then I thought it might be a datatype mismatch, but float and glfloat seem to be equivalent: gl.h typedef float GLfloat; math.h extern float cosf( float ); Is this a casting issue?

    Read the article

  • What makes the availability of both primitive and object-wrapped values in JavaScript useful?

    - by Delan Azabani
    I wrote a blog post a while ago detailing how the availability of both primitive and object-wrapped value types in JavaScript (for things such as Number, String and Boolean) causes trouble, including but not limited to type-casting to a boolean (e.g. object-wrapped NaN, "" and false actually type-cast to true). My question is, with all this confusion and problems, is there any benefit to JavaScript having both types of values for the built-in classes?

    Read the article

  • applicaion and local service lifetime

    - by rayman
    As i understoond, if we have local service of some application, as soon as the application goes down, the service goes down as well - is that true? and if it is, how can we make an application to run all the time without go down? (without using Alarm manager). i though that the purpose of local service is to answer this situation: " to make the application everlasting" please, if some1 could explain me this better, thanks, ray.

    Read the article

  • Is it possible in .NET 3.5 to specify an enum type?

    - by RoboShop
    I have a enumerator which map to a bunch of int example enum MyEnum { Open = 1, Closed = 2, Exit = 4 } I find though that when I want to assign this to an integer, I have to cast it first. int myEnumNumber = **(int)** MyEnum.Open; Is it possible to specify the type of an enum so that it is implicit that there is a integer assigned to any value within the enum? That way, I do not need to keep casting it to an int if I want to use it thanks

    Read the article

  • Shallow copying a list with downcasting

    - by Mohit
    I have the class herichary as follows CEntity----CNode---CElement I have a class Nodes : List<Cnode> and Class Elements : List<Element> Node class contain common item common across different project Element class has item specific to a project. I have to shallow copy the element list into the node list (basically down casting the elements to nodes)

    Read the article

  • Convert Subclass to Inherited Class

    - by Dave
    I have a C# .NET 2.0 project A that has a form (TreeForm) that uses Tree objects. I have a project B that has a class Oak that inherits Tree. When I try to reference and use the TreeForm in project B with my Oak objects, it's looking for objects of type Tree. I've tried casting the Oak objects to Tree, but I get the error "Cannot convert type Oak to Tree". How can I use my Oak objects in the TreeForm from project A?

    Read the article

< Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >