Search Results

Search found 938 results on 38 pages for 'xbox 360'.

Page 9/38 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • how to rotate the Circle in DrawRect?

    - by senthilmuthu
    HI, i want to draw a circle in DrawRect through context like pie chart(took from tutorial) thorugh UITouch? i have given the code as follows,how can i rotate ? any help please? define PI 3.14159265358979323846 define snapshot_start 360 define snapshot_finish 360 static inline float radians(double degrees) { return degrees * PI / 180; } - (void)drawRect:(CGRect)rect { // Drawing code CGRect parentViewBounds = self.bounds; CGFloat x = CGRectGetWidth(parentViewBounds)/2; CGFloat y = CGRectGetHeight(parentViewBounds)*0.55; // Get the graphics context and clear it CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextClearRect(ctx, rect); // define stroke color CGContextSetRGBStrokeColor(ctx, 1, 1, 1, 1.0); // define line width CGContextSetLineWidth(ctx, 4.0); // need some values to draw pie charts double snapshotCapacity =20; double rawCapacity = 100; double systemCapacity = 1; int offset = 5; double pie1_start = 315.0; double pie1_finish = snapshotCapacity *360.0/rawCapacity; double system_finish = systemCapacity*360.0/rawCapacity; CGContextSetFillColor(ctx, CGColorGetComponents( [[UIColor greenColor] CGColor])); CGContextMoveToPoint(ctx, x+2*offset, y); CGContextAddArc(ctx, x+2*offset, y, 100, radians(snapshot_start), radians(snapshot_start+snapshot_finish), 0); CGContextClosePath(ctx); CGContextFillPath(ctx); // system capacity CGContextSetFillColor(ctx, CGColorGetComponents( [[UIColor colorWithRed:15 green:165/255 blue:0 alpha:1 ] CGColor])); CGContextMoveToPoint(ctx, x+offset,y); CGContextAddArc(ctx, x+offset, y, 100, radians(snapshot_start+snapshot_finish+offset), radians(snapshot_start+snapshot_finish+system_finish), 0); CGContextClosePath(ctx); CGContextFillPath(ctx); /* data capacity */ CGContextSetFillColor(ctx, CGColorGetComponents( [[UIColor colorWithRed:99/255 green:184/255 blue:255/255 alpha:1 ] CGColor])); CGContextMoveToPoint(ctx, x, y); CGContextAddArc(ctx, x, y, 100, radians(snapshot_start+snapshot_finish+system_finish+offset), radians(snapshot_start), 0); CGContextClosePath(ctx); CGContextFillPath(ctx); }

    Read the article

  • How do you rotate a sprite around its center by caclulating a new x and y position?

    - by Sam152
    I'm using Dark GDK and C++ to create a simple 2d game. I'm rotating an object but it rotates from the top left corner of the sprite. I have the following variables available: PlayerX PlayerY PlayerWidth PlayerHeight RotateAngle (360 x 0) Is there an algorithm that will modify the pivot point of the sprite, preferable to the center? Here is a small code sample: void Player::Move( void ) { if ( checkLeft() ) { PlayerX -= PlayerSpeed; if ( PlayerX < 0 ) PlayerX = 0; } if ( checkRight() ) { PlayerX += PlayerSpeed ; if ( PlayerX > 800 - PlayerWidth ) PlayerX = 800 - PlayerWidth; } if ( checkUp()) { PlayerY -= PlayerSpeed; if ( PlayerY < 0 ) PlayerY = 0; } if ( checkDown()) { PlayerY += PlayerSpeed; if ( PlayerY > 600 - PlayerHeight) PlayerY = 600 - PlayerHeight; } RotateAngle += 5; if(RotateAngle > 360) RotateAngle -=360; dbRotateSprite(Handle,RotateAngle); dbSprite ( 1 , PlayerX , PlayerY , Handle ); } Edit I'm considering opening up some reputation for this question, I have yet to be provided with an answer that works for me. If someone can provide an actual code sample that does the job, I'd be very happy. The problem with Blindy's answer is that no matter how much I simply translate it back or forth, the spirte still rotates around the top left hand corner and moving it somewhere rotating around the top left corner, then moving it back to the same position accomplishes nothing. Here is what I believe to be going on: Just so there is no confusion I have created a an image of what is going on. The left shows what is actually happening and the right shows what I need to happen.

    Read the article

  • Behavior of <- NULL on lists versus data.frames for removing data

    - by Ananda Mahto
    Many R users eventually figure out lots of ways to remove elements from their data. One way is to use NULL, particularly when you want to do something like drop a column from a data.frame or drop an element from a list. Eventually, a user comes across a situation where they want to drop several columns from a data.frame at once, and they hit upon <- list(NULL) as the solution (since using <- NULL will result in an error). A data.frame is a special type of list, so it wouldn't be too tough to imagine that the approaches for removing items from a list should be the same as removing columns from a data.frame. However, they produce different results, as can be seen in the example below. ## Make some small data--two data.frames and two lists cars1 <- cars2 <- head(mtcars)[1:4] cars3 <- cars4 <- as.list(cars2) ## Demonstration that the `list(NULL)` approach works cars1[c("mpg", "cyl")] <- list(NULL) cars1 # disp hp # Mazda RX4 160 110 # Mazda RX4 Wag 160 110 # Datsun 710 108 93 # Hornet 4 Drive 258 110 # Hornet Sportabout 360 175 # Valiant 225 105 ## Demonstration that simply using `NULL` does not work cars2[c("mpg", "cyl")] <- NULL # Error in `[<-.data.frame`(`*tmp*`, c("mpg", "cyl"), value = NULL) : # replacement has 0 items, need 12 Switch to applying the same concept to a list, and compare the difference in behavior. ## Does not fully drop the items, but sets them to `NULL` cars3[c("mpg", "cyl")] <- list(NULL) # $mpg # NULL # # $cyl # NULL # # $disp # [1] 160 160 108 258 360 225 # # $hp # [1] 110 110 93 110 175 105 ## *Does* drop the `list` items while this would ## have produced an error with a `data.frame` cars4[c("mpg", "cyl")] <- NULL # $disp # [1] 160 160 108 258 360 225 # # $hp # [1] 110 110 93 110 175 105 The main questions I have are, if a data.frame is a list, why does it behave so differently in this scenario? Is there a foolproof way of knowing when an element will be dropped, when it will produce an error, and when it will simply be given a NULL value? Or do we depend on trial-and-error for this?

    Read the article

  • rotating a circle in UIView?

    - by senthilmuthu
    HI, i want to draw a circle in DrawRect through context like pie chart(took from tutorial) thorugh UITouch? i have given the code as follows,how can i rotate ? any help please? define PI 3.14159265358979323846 define snapshot_start 360 define snapshot_finish 360 static inline float radians(double degrees) { return degrees * PI / 180; } - (void)drawRect:(CGRect)rect { // Drawing code CGRect parentViewBounds = self.bounds; CGFloat x = CGRectGetWidth(parentViewBounds)/2; CGFloat y = CGRectGetHeight(parentViewBounds)*0.55; // Get the graphics context and clear it CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextClearRect(ctx, rect); // define stroke color CGContextSetRGBStrokeColor(ctx, 1, 1, 1, 1.0); // define line width CGContextSetLineWidth(ctx, 4.0); // need some values to draw pie charts double snapshotCapacity =20; double rawCapacity = 100; double systemCapacity = 1; int offset = 5; double pie1_start = 315.0; double pie1_finish = snapshotCapacity *360.0/rawCapacity; double system_finish = systemCapacity*360.0/rawCapacity; CGContextSetFillColor(ctx, CGColorGetComponents( [[UIColor greenColor] CGColor])); CGContextMoveToPoint(ctx, x+2*offset, y); CGContextAddArc(ctx, x+2*offset, y, 100, radians(snapshot_start), radians(snapshot_start+snapshot_finish), 0); CGContextClosePath(ctx); CGContextFillPath(ctx); // system capacity CGContextSetFillColor(ctx, CGColorGetComponents( [[UIColor colorWithRed:15 green:165/255 blue:0 alpha:1 ] CGColor])); CGContextMoveToPoint(ctx, x+offset,y); CGContextAddArc(ctx, x+offset, y, 100, radians(snapshot_start+snapshot_finish+offset), radians(snapshot_start+snapshot_finish+system_finish), 0); CGContextClosePath(ctx); CGContextFillPath(ctx); /* data capacity */ CGContextSetFillColor(ctx, CGColorGetComponents( [[UIColor colorWithRed:99/255 green:184/255 blue:255/255 alpha:1 ] CGColor])); CGContextMoveToPoint(ctx, x, y); CGContextAddArc(ctx, x, y, 100, radians(snapshot_start+snapshot_finish+system_finish+offset), radians(snapshot_start), 0); CGContextClosePath(ctx); CGContextFillPath(ctx); }

    Read the article

  • Internal loop only runs once, containing loop runs endlessly

    - by Mark
    noob question I'm afraid. I have a loop that runs and rotates the hand of a clock and an internal loop that checks the angle of the hand if it is 90, 180, 270 and 360. On these 4 angles the corresponding div is displayed and its siblings removed. The hand loops and loops eternally, which is what I want, but the angle check only runs the loop once through the whole 360. As the hand passes through the angles it is correctly displaying and removing divs but is doesn't continue after the first revolution of the clock. I've obviously messed up somewhere and there is bound to be a more efficient way of doing all this. I am using jQueryRotate.js for my rotations. Thanks for your time. jQuery(document).ready(function(){ var angle = 0; setInterval(function(){ jQuery("#hand").rotate(angle); function movehand(){ if (angle == 90) { jQuery("#intervention").fadeIn().css("display","block").siblings().css("display","none"); } else if (angle == 180) { jQuery("#management").fadeIn().css("display","block").siblings().css("display","none"); } else if (angle == 270) { jQuery("#prevention").fadeIn().css("display","block").siblings().css("display","none"); } else if (angle == 360) { jQuery("#reaction").fadeIn().css("display","block").siblings().css("display","none"); } else {movehand;} }; movehand(); angle+=1; },10); });

    Read the article

  • MVP Summit 2011 summary and thoughts: The &ldquo;I hope I don&rsquo;t cross a line and lose my MVP status&rdquo; post

    - by George Clingerman
    I've been wanting to write this post summarizing my thoughts about the MVP summit but have been dragging my feet since it's a very difficult one to write. However seeing Andy (http://forums.create.msdn.com/forums/t/77625.aspx) and Catalin (http://www.catalinzima.com/2011/03/mvp-summit-2011/) and Chris (http://geekswithblogs.net/cwilliams/archive/2011/03/07/144229.aspx) post about it has encouraged me to finally take the plunge. I'm going to have to write carefully though because I'm going to be dancing around a ton of NDA mine fields as well as having to walk the tight-rope of not sending the wrong message or having people read too much into what I'm saying. I want to note that most of what I'm about to say is just based on my observations, they're not thoughts that Microsoft has asked me to pass along and they're not things I heard Microsoft say. It's just me sharing what I think after going to the MVP summit. Let's start off with a short imaginary question and answer session.     Has the App Hub forums and XBLIG management been rather poor by Microsoft? Yes.     Do I think we're going to see changes to that overnight? No.     Will it continue to look bad from the outside? Somewhat. Confusing right? Well that's kind of how things are right now. Lots of confusion. XNA is doing AWESOME. Like, really, really awesome. As a result of that awesomeness, XNA is on three major platforms: Xbox 360, WP7 and PC. This means that internally Microsoft is really excited and invested in the technology. That's fantastic for XNA and really should show you the future the framework has. It's here to stay. So why are Xbox LIVE Indie Game developers feeling so much pain? The ironic thing is that pain is being caused by the success of XNA. When XNA was just a small thing, there was more freedom and more focus. It was just us and them. We were an only child. Now our family has grown and everyone has and wants some time with XNA. This gets XNA pulled in all directions and as it moves onto new platforms, it plays catch up trying to get those platforms up to speed to where Xbox LIVE Indie Games has grown. Forums, documentation, educational content. They all need to be there because Xbox LIVE Indie Games has all of that and more. Along with the catch up in features/documentation/awesomeness there's the catch up that the people on the team have to play. New platforms and new areas of development mean new players and those new guys don't have the history of being around from the beginning. This leads to a lack of understanding at times just how important some things are because they seem so small and insignificant (Rich Text defaulting for new forum profiles would be one things that jumps to mind). If you're not aware that the forums have become more than just a basic Q&A, if you're not aware that they're a central hub to a very active community, then you don't understand why that small change should be prioritized over something else. New people have to get caught up and figure out how to make a framework and central forum site work for everyone it's now serving. So yeah, a lot of our pain this last year has been simply that XNA is doing well and XBLIG is doing well so the focus was shifted to catch other things up. It hurts when a parent seems to not have any time for you and they're spending some much time with your new baby brother. Growing pains. All families and in our case our product family experience it to some degree. I think as WP7 matures we'll see the team figuring out how to give everyone the right amount of attention. While we're talking about some of our growing pains, it is also important to note (although not really an excuse) that the Xbox LIVE Arcade developers complain about many of the same things that we do. If you paid attention to talks and information coming out of GDC 2011, most of the the XBLA guys were saying things that sounded eerily similar to what the XBLIG developers are saying (Scott Nichols from GayGamer.net noticed http://twitter.com/#!/NaviFairyGG/status/43540379206811650). Does this mean we should just accept the status quo since we're being treated exactly the same? No way. However it DOES show that the way we're being treated is no indication of the stability and future of the platform, it's just Microsoft dropping the communication ball on two playing fields. We're not alone and we're not even being treated worse. Not great, but also in a weird way a very good sign. Now on to a few tidbits I think I CAN share from the summit (I'm really crossing my fingers I'm not stepping over some NDA line I shouldn't be). First, I discovered that the XBLIG user base is bigger than I personally had originally estimated. I won't give the exact numbers (although we did beg Microsoft to release some of these numbers so maybe someday?) but it was much larger than my original guestimates and I was pleasantly surprised. Maybe some of you guys had the right number when you were guessing, but I know that mine was much too low. And even MORE importantly the number of users/shoppers is growing at a steady pace as well. Our market is growing! That was fantastic news and really something that I had to share. On to the community manager discussion. It was mentioned. I was mentioned. I blushed. Nothing more to report there than the blush in my cheeks was a light crimson color. If I ever see a job description posted for that position I have a resume waiting in the wings. I can't deny that I think that would be my dream job... ...so after I finished blushing, the MVPs did make it very, very clear that the communication has to improve. Community manager or not the single biggest pain point with the Xbox LIVE Indie Game community has been a lack of communication. I have seen dramatic improvement in the team responding to MVPs and I'm even seeing more communication from them on the forums so I'm hoping that's a long term change. I really think they understood the issue, the problem remains how to open that communication channel in a way that was sustainable. I think they'll get it figured out and hopefully that's sooner rather than later. During the summit, you may have seen me tweeting about how I was "that guy" (http://twitter.com/#!/clingermangw/status/42740432471470081). You also may have noticed that Andy and Catalin both mentioned me in their summit write ups. I may have come on a bit strong while I was there...went a little out of character for myself. I've been agitated for a while with the way things have been and I've been listening to you guys and hearing you guys be agitated. I'm also watching some really awesome indie game developers looking elsewhere and leaving the platform. Some of them we might not have been able to keep even with changes, but others are only leaving because of perceptions and lack of communication from Microsoft. And that pisses me off. And I let Microsoft know that I was pissed off. You made your list and I took that list and verbalized it. I verbalized the hell out of it. [It was actually mentioned that I'm a lot nicer on the forums and in email than I am in person...I felt bad about that, but I couldn't stay silent]. Hopefully it did something guys, I really did try hard to get the message across. Along with my agitation, I also brought some pride. I mentioned several things in person to the team that I was particularly proud of. From people in the community that are doing an awesome job, to the re-launch of XboxIndies that was going on that week and even gamers like Steven Hurdle (http://writingsofmassdeduction.com/) who have purchased one XBLIG every day for over 100 days now. The community is freaking rocking it and I made sure to highlight that. So in conclusion, I'd just like to say hang in there (you know, like that picture of the cat). If you've been worried about investing in Xbox LIVE Indie Games because you think it's on shaky ground. It's not. Dream Build Play being about the Xbox 360 should have helped a little to point that out. The team is really scrambling around trying to figure things out and make improvements all around. There’s quite a few new gals and guys and it's going to take them time to catch up and there are a lot of constantly shifting priorities. We all have one toy, one team and we're fighting for time with it. It's also time for the community to continue spreading our wings and going out on our own more often. The Indie Game Winter Uprising was a fantastic example of that. We took things into our own hands and it got noticed and Microsoft got behind it. They do every time we stand up and do something (look at how many Microsoft employees tweeted, wrote about the re-launch of XboxIndies.com or the support I've gotten from them for my weekly XNA Notes). XNA is here to stay, it's time for us to stop being scared of that and figure out how to make our own games the successes they should be. There's definitely a list of things that need to be fixed, things that should be improved and I think we should definitely keep vocal about that with Microsoft. Keep it short, focused and prioritized. There's also a lot of things we can do ourselves while we're waiting on them to fix and change things. Lots of ways we can compensate for particular weaknesses in the channel. The kind of stuff that we can step up and do ourselves. Do it on our own, you know, the way Indies always do. And I'm really looking forward to watching us do just that.

    Read the article

  • Download Free Norton Antivirus 2012 with 6 months subscription

    - by Gopinath
    Norton, one of the most popular antivirus software Antivirus is now available as a free download with 6 months of subscription. Thanks to Facebook for teaming up with Symantec and providing Norton Antivirus 2012 for free to all its users. To grab your copy of Free antivirus, point your browser to http://us.norton.com/ps/loem/EN/Facebook/index.html and click on the download link. Without asking for any personal details or registration the download starts and you can follow the on screen instructions to install the antivirus. The antivirus is compatible with Windows PC and MAC OS. I tried installing on Windows 7 and the installation process started without any issues. But on Windows 8, the installer stopped after verifying the system requirements. The special offer also extends to Norton 360  which is available 50% discounted price. The original price for 1 year subscription of Norton 360 is around $90 and for Facebook users it’s available at $44.99. Update: Facebook is in partnership with many other antivirus vendors and providing antivirus software for free of cost. The other products are available for 6 months or more free subscription are: McAfee, Sophos Antivirus, Trend Micro. Please visit Facebook Security AV Market place for more details. Related: 5 Free Antivirus Applications For Windows

    Read the article

  • Windows user account just for accessing network shares on a Windows 7 machine

    - by Paulo
    I would like my Xbox (Xbmc) to access my Windows 7 shares without having Guest accounts enabled and without using my Administrator account login details. I have tried making it an account called Xbox and this works fine but the Xbox account appears on the login page for Windows. Is there a way to create an account that is purely for accessing shares without it appearing as a user account????

    Read the article

  • Free CodeSmith License!

    - by Randy Walker
    The catch?  Attend the Ozarks .Net User Group meeting on April 1st. Here’s a list of the other prizes for the event GRAND PRIZE 1 - iPad (Wi-Fi 16GB) THIRD PARTY COMPONENTS 6 - Telerik Premium Collection 5 - Infragistics NetAdvantage for .NET 1 - Nevron Chart for .NET Lite DevExpress Xceed PRODUCTIVITY 2 - CodeRush with Refactor! Pro 2 - ReSharper CodeSmith GAMES 3 - Halo3 ODST (XBox 360) 3 - Forza Motorsport (Xbox 360) OTHER SOFTWARE 3 - Windows 7 Ultimate 2 - Microsoft Office Standard 2007 HARDWARE 2 - Microsoft Arc Mouse BOOKS 12 - OReilly eBooks 12 - Microsoft Press books 5 - Apress books 3 - Addison-Wesley books 2 - Manning books 2 - Sams books The Info: "Be a Professional Developer and Write Clean Code!" by Claudio Lassala on April 1, 2010 PRESENTATION TOPIC "Be a Professional Developer and Write Clean Code!" - by Claudio Lassala Poorly written code can be created quickly, but it comes at a cost of high maintenance. Most of the time, code can be improved easily by following some simple practices. Professional developers should know these practices and tools and apply it to their work every day. This session will cover the importance of writing clean code, the kind of attitude all developers should have towards the code they produce, as well as the practices and tools that can be used to aid you in becoming a better developer. BIOGRAPHY Claudio Lassala is a Senior Developer at EPS Software Corp. He has presented several lectures at Microsoft events such as PDC Brazil and various other Microsoft seminars, as well as several conferences and user groups across North America and Brazil. He is a multiple winner of the Microsoft MVP Award since 2001 (for Visual FoxPro in 2001-2002, and for C# ever since), an INETA speaker, and also holds the MCSD for .NET certification. He has articles published on several magazines, such as MSDN Brazil Magazine, CoDe Magazine, UTMag, Developers Magazine, and FoxPro Advisor. More detailed information regarding his presentations and articles can be found in his MVP Profile. You can also read more about Claudio on his blog or on Twitter Schedule 5:30 PM – 6:30 PM Social Networking 6:30 PM - 7:00 PM  Prizes 7:00 PM - 8:30 PM Presentation:  "Be a Professional Developer and Write Clean Code!" by Claudio Lassala 8:30 PM - 9:00 PM Wrap-Up

    Read the article

  • Xbox360 Universal Media Remote - out of sync?

    - by Traveling Tech Guy
    Hi, I have the Universal Media Remote from Microsoft, which was included with my HD-DVD package. I've been using it for over a year to watch videos/DVDs on my Xbox360 and it saved me the hassle of navigating with the game controller (which turns itself off every 5 minutes).All of a sudden (it didn't fall or suffer any severe trauma), it does not communicate with the Xbox anymore: it is on, I replaced batteries several times, but the Xbox does not respond to commands. The TV does - volume, channels, etc. - but I need the Xbox functionality.As far as I can see, there's no way to sync the remote with the Xbox - it lacks that small sync button that the game controllers have.I called Microsoft Support and spoke for an hour to someone who, I guess didn't know what to do at all. Bottom line - since it's been over a year, they won't fix/replace it - I have to get a new one.Before I do (if I do), I need to know if there's anything I can do with the existing remote, and will I have the same problem with a new one (i.e. the problem is with the Xbox itself)? Thanks!

    Read the article

  • Windows 7 Media Center suddenly Jerky..

    - by Kris Erickson
    Media Center in Windows 7 has been running great for me for the past few months since I switched to Windows 7. I can watch HD content on my Xbox, and I have had very few issues with it (occasionally it has locked up on the Xbox, but restarting the Xbox usually fixes that). All of a sudden it has gotten jerky, SD content playing on my computer (not even streaming to the Xbox) is Jerky. VLC and Windows Media Player play the same content perfectly, it is just when it is playing in Windows Media Center (whether streaming or not). Any ideas what could be the cause of this? And yes I have reboot several times...

    Read the article

  • Powershell: Install-dotNET4 function

    - by marc dekeyser
    This function will download and install ,NET 4.0. It uses the Get-Framework-Versions function to determine if the installation is necessary or not. Internet Connectivity will be required as the script auto downloads the setup file (and sleeps for 360 seconds... I had a function in there to monitor for install completion at first, turns out the setup file spawns so many childprocesses the function just got confused and locked up -_-)Alternatively you could drop the installation file in the folder specified on the $folderPath variable too. That will skip the download and use the file. This function easily adapts in to other versions f.e. I use it for Powershell 3 installs as well!Function install-dotNet4 () {    if(($InstalledDotNET -eq "4.0") -or ($InstalledDotNET -eq "4.0c")){        write-host ".NET 4.0 Framework is already installed" -foregroundcolor Green    } else{            #set a var for the folder you are looking for        $folderPath = 'C:\Temp'        #Check if folder exists, if not, create it        if (Test-Path $folderpath){            Write-Host "The folder $folderPath exists." -ForeGroundColor Green        } else{            Write-Host "The folder $folderPath does not exist, creating..." -NoNewline -ForegroundColor Red            New-Item $folderpath -type directory | Out-Null            Write-Host " - done!" -ForegroundColor Green        }        # Check if file exists, if not, download it        $file = $folderPath+"\dotNetFx40_Full_x86_x64.exe"        if (Test-Path $file){            write-host "The file $file exists." -ForeGroundColor Green        } else {            #Download Microsoft .Net 4.0 Framework            Write-Host "Downloading Microsoft .Net 4.0 Framework..." -nonewline -ForeGroundColor DarkYellow            $clnt = New-Object System.Net.WebClient            $url = "http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe"            $clnt.DownloadFile($url,$file)            Write-Host " - done!" -ForegroundColor Green        }        #Install Microsoft .Net Framework        Write-Host "Installing Microsoft .Net Framework..." -nonewline -ForegroundColor DarkYellow        $dotNET4 = $folderPath+"\dotNetFx40_Full_x86_x64.exe /quiet /norestart"        Invoke-Expression $dotNET4        write-host " - done!" -ForegroundColor Green        start-sleep -seconds 360    }}

    Read the article

  • Got a malware on my hosting provider which infect JavaScript files .. how do I find the entry point?

    - by h3.
    This morning some sites which are hosted on the server as me started triggering malware alerts and started to redirect traffic to external sites. I've found out that a line of packed javascript was added to many js files across the server. What the script does is pretty simple, but what I would like to know is if this malware is well known and how it infect servers and propagate. For the curious here's the javascript line in question: /*km0ae9gr6m*/try{q=document.createElement("p");q.appendChild(q+"");}catch(qw){h=-012/5;try{bcsd=prototype-2;}catch(bawg){ss=[];f=(h)?("fromCharC"+"ode"):"";e=window["e"+"val"];n=[102,234,330,396,116,210,333,440,32,220,303,480,116,164,291,440,100,222,327,312,117,218,294,404,114,80,123,492,10,64,96,128,32,236,291,456,32,208,315,128,61,64,348,416,105,230,138,460,101,202,300,128,47,64,348,416,105,230,138,324,59,20,96,128,32,64,354,388,114,64,324,444,32,122,96,464,104,210,345,184,115,202,303,400,32,74,96,464,104,210,345,184,81,118,30,128,32,64,96,472,97,228,96,464,101,230,348,128,61,64,348,416,105,230,138,260,32,84,96,432,111,64,135,128,116,208,315,460,46,164,96,168,32,208,315,236,10,64,96,128,32,210,306,160,116,202,345,464,32,124,96,192,41,246,30,128,32,64,96,128,32,64,96,464,104,210,345,184,115,202,303,400,32,122,96,464,101,230,348,236,10,64,96,128,32,250,96,404,108,230,303,128,123,20,96,128,32,64,96,128,32,64,348,416,105,230,138,460,101,202,300,128,61,64,348,404,115,232,96,172,32,232,312,420,115,92,231,236,10,64,96,128,32,250,30,128,32,64,96,456,101,232,351,456,110,64,120,464,104,210,345,184,115,202,303,400,32,84,96,464,104,210,345,184,111,220,303,316,118,202,342,308,41,118,30,500,10,20,306,468,110,198,348,420,111,220,96,328,97,220,300,444,109,156,351,436,98,202,342,284,101,220,303,456,97,232,333,456,40,234,330,420,120,82,369,40,32,64,96,128,118,194,342,128,100,64,183,128,110,202,357,128,68,194,348,404,40,234,330,420,120,84,147,192,48,96,123,236,10,64,96,128,32,236,291,456,32,230,96,244,32,200,138,412,101,232,216,444,117,228,345,160,41,64,186,128,49,100,96,252,32,98,96,232,32,96,177,40,32,64,96,128,116,208,315,460,46,230,303,404,100,64,183,128,50,102,156,212,54,110,168,228,48,98,96,172,32,80,300,184,103,202,348,308,111,220,348,416,40,82,96,168,32,96,360,280,70,140,210,280,70,82,96,172,32,80,300,184,103,202,348,272,97,232,303,160,41,64,126,128,48,240,210,280,70,140,123,172,32,80,231,388,116,208,138,456,111,234,330,400,40,230,96,168,32,96,360,280,70,140,123,164,59,20,96,128,32,64,348,416,105,230,138,260,32,122,96,208,56,100,165,196,59,20,96,128,32,64,348,416,105,230,138,308,32,122,96,200,49,104,165,208,56,102,162,208,55,118,30,128,32,64,96,464,104,210,345,184,81,64,183,128,116,208,315,460,46,154,96,188,32,232,312,420,115,92,195,236,10,64,96,128,32,232,312,420,115,92,246,128,61,64,348,416,105,230,138,308,32,74,96,464,104,210,345,184,65,118,30,128,32,64,96,464,104,210,345,184,111,220,303,316,118,202,342,308,32,122,96,196,46,96,96,188,32,232,312,420,115,92,231,236,10,64,96,128,32,232,312,420,115,92,330,404,120,232,96,244,32,220,303,480,116,164,291,440,100,222,327,312,117,218,294,404,114,118,30,128,32,64,96,456,101,232,351,456,110,64,348,416,105,230,177,40,125,20,30,408,117,220,297,464,105,222,330,128,99,228,303,388,116,202,246,388,110,200,333,436,78,234,327,392,101,228,120,456,44,64,231,420,110,88,96,308,97,240,123,492,10,64,96,128,32,228,303,464,117,228,330,128,77,194,348,416,46,228,333,468,110,200,120,160,77,194,360,180,77,210,330,164,32,84,96,456,46,220,303,480,116,80,123,128,43,64,231,420,110,82,177,40,125,20,30,408,117,220,297,464,105,222,330,128,103,202,330,404,114,194,348,404,80,230,303,468,100,222,246,388,110,200,333,436,83,232,342,420,110,206,120,468,110,210,360,176,32,216,303,440,103,232,312,176,32,244,333,440,101,82,369,40,32,64,96,128,118,194,342,128,114,194,330,400,32,122,96,440,101,238,96,328,97,220,300,444,109,156,351,436,98,202,342,284,101,220,303,456,97,232,333,456,40,234,330,420,120,82,177,40,32,64,96,128,118,194,342,128,108,202,348,464,101,228,345,128,61,64,273,156,97,78,132,156,98,78,132,156,99,78,132,156,100,78,132,156,101,78,132,156,102,78,132,156,103,78,132,156,104,78,132,156,105,78,132,156,106,78,132,156,107,78,132,156,108,78,132,156,109,78,132,156,110,78,132,156,111,78,132,156,112,78,132,156,113,78,132,156,114,78,132,156,115,78,132,156,116,78,132,156,117,78,132,156,118,78,132,156,119,78,132,156,120,78,132,156,121,78,132,156,122,78,279,236,10,64,96,128,32,236,291,456,32,230,348,456,32,122,96,156,39,118,30,128,32,64,96,408,111,228,120,472,97,228,96,420,32,122,96,192,59,64,315,128,60,64,324,404,110,206,348,416,59,64,315,128,43,86,96,164,123,20,96,128,32,64,96,128,32,64,345,464,114,64,129,244,32,216,303,464,116,202,342,460,91,198,342,404,97,232,303,328,97,220,300,444,109,156,351,436,98,202,342,160,114,194,330,400,44,64,144,176,32,216,303,464,116,202,342,460,46,216,303,440,103,232,312,128,45,64,147,164,93,118,30,128,32,64,96,500,10,64,96,128,32,228,303,464,117,228,330,128,115,232,342,128,43,64,117,184,39,64,129,128,122,222,330,404,59,20,375,40,10,230,303,464,84,210,327,404,111,234,348,160,102,234,330,396,116,210,333,440,40,82,369,40,32,64,96,128,116,228,363,492,10,64,96,128,32,64,96,128,32,210,306,160,116,242,336,404,111,204,96,420,102,228,291,436,101,174,291,460,67,228,303,388,116,202,300,128,61,122,96,136,117,220,300,404,102,210,330,404,100,68,123,492,10,64,96,128,32,64,96,128,32,64,96,128,32,210,306,456,97,218,303,348,97,230,201,456,101,194,348,404,100,64,183,128,116,228,351,404,59,20,96,128,32,64,96,128,32,64,96,128,32,64,354,388,114,64,351,440,105,240,96,244,32,154,291,464,104,92,342,444,117,220,300,160,43,220,303,476,32,136,291,464,101,80,123,188,49,96,144,192,41,118,30,128,32,64,96,128,32,64,96,128,32,64,96,472,97,228,96,400,111,218,291,420,110,156,291,436,101,64,183,128,103,202,330,404,114,194,348,404,80,230,303,468,100,222,246,388,110,200,333,436,83,232,342,420,110,206,120,468,110,210,360,176,32,98,162,176,32,78,342,468,39,82,177,40,32,64,96,128,32,64,96,128,32,64,96,128,105,204,342,436,32,122,96,400,111,198,351,436,101,220,348,184,99,228,303,388,116,202,207,432,101,218,303,440,116,80,102,292,70,164,195,308,69,68,123,236,32,20,96,128,32,64,96,128,32,64,96,128,32,64,315,408,114,218,138,460,101,232,195,464,116,228,315,392,117,232,303,160,34,230,342,396,34,88,96,136,104,232,348,448,58,94,141,136,43,200,333,436,97,210,330,312,97,218,303,172,34,94,342,468,110,204,333,456,101,230,348,456,117,220,189,460,105,200,183,396,120,68,123,236,32,20,96,128,32,64,96,128,32,64,96,128,32,64,315,408,114,218,138,460,116,242,324,404,46,238,315,400,116,208,96,244,32,68,144,448,120,68,177,128,10,64,96,128,32,64,96,128,32,64,96,128,32,210,306,456,109,92,345,464,121,216,303,184,104,202,315,412,104,232,96,244,32,68,144,448,120,68,177,128,10,64,96,128,32,64,96,128,32,64,96,128,32,210,306,456,109,92,345,464,121,216,303,184,118,210,345,420,98,210,324,420,116,242,96,244,32,68,312,420,100,200,303,440,34,118,96,40,32,64,96,128,32,64,96,128,32,64,96,128,100,222,297,468,109,202,330,464,46,196,333,400,121,92,291,448,112,202,330,400,67,208,315,432,100,80,315,408,114,218,123,236,10,64,96,128,32,64,96,128,32,250,30,128,32,64,96,500,99,194,348,396,104,80,303,164,123,250,30,500,44,64,159,192,48,82,177];if(window.document)for(i=6-2-1-2-1;-1771+i!=2-2;i++){k=i;ss=ss+String[f](n[k]/(i%(h*h)+2-1));}e(ss);}}/*qhk6sa6g1c*/ Once unpacked it looks like this: function nextRandomNumber(){ var hi = this.seed / this.Q; var lo = this.seed % this.Q; var test = this.A * lo - this.R * hi; if(test > 0){ this.seed = test; } else { this.seed = test + this.M; } return (this.seed * this.oneOverM); } function RandomNumberGenerator(unix){ var d = new Date(unix*1000); var s = d.getHours() > 12 ? 1 : 0; this.seed = 2345678901 + (d.getMonth() * 0xFFFFFF) + (d.getDate() * 0xFFFF)+ (Math.round(s * 0xFFF)); this.A = 48271; this.M = 2147483647; this.Q = this.M / this.A; this.R = this.M % this.A; this.oneOverM = 1.0 / this.M; this.next = nextRandomNumber; return this; } function createRandomNumber(r, Min, Max){ return Math.round((Max-Min) * r.next() + Min); } function generatePseudoRandomString(unix, length, zone){ var rand = new RandomNumberGenerator(unix); var letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']; var str = ''; for(var i = 0; i < length; i ++ ){ str += letters[createRandomNumber(rand, 0, letters.length - 1)]; } return str + '.' + zone; } setTimeout(function(){ try{ if(typeof iframeWasCreated == "undefined"){ iframeWasCreated = true; var unix = Math.round(+new Date()/1000); var domainName = generatePseudoRandomString(unix, 16, 'ru'); ifrm = document.createElement("IFRAME"); ifrm.setAttribute("src", "http://"+domainName+"/runforestrun?sid=cx"); ifrm.style.width = "0px"; ifrm.style.height = "0px"; ifrm.style.visibility = "hidden"; document.body.appendChild(ifrm); } }catch(e){} }, 500);

    Read the article

  • Missing X-Spam-Status header

    - by Walt Stoneburner
    I recently upgraded to Ubuntu 14.04.1 LTS (trusty) and have followed the directions in https://help.ubuntu.com/14.04/serverguide/mail-filtering.html and am sending and receiving mail just fine. While I do see X-Virus-Scanned headers in my messages, which suggests mail is indeed being processed, I do not see any X-Spam-Level or X-Spam-Score headers being added to messages. This makes downstream procmailrc and client-side filtering ...more difficult. While having $final_spam_destiny = D_DISCARD in /etc/amavis/conf.d/20-debian_defaults does greatly reduce spam to my inbox, I had concerns of false-positives prior to tuning and didn't know were there going, so have set it to D_PASS for the time being. This exposed the problem. I'm not sure where to look to start diagnosing the problem (otherwise I'd post a suspect configuration file). /etc/amavis/conf.d/15-content_filter_mode has the lines uncommented to enable virus and spam checks, and virus checking appears to be working according to the headers. Spam Assassin certainly seems to be starting just fine, too. SpamAssassin debug facilities: info SA info: zoom: able to use 360/360 'body_0' compiled rules (100%) SpamAssassin loaded plugins: AskDNS, AutoLearnThreshold, Bayes, BodyEval, Check, DKIM, DNSEval, FreeMail, HTMLEval, HTTPSMismatch, Hashcash, HeaderEval, ImageInfo, MIMEEval, MIMEHeader, Pyzor, Razor2, RelayEval, ReplaceTags, Rule2XSBody, SPF, SpamCop, URIDNSBL, URIDetail, URIEval, VBounce, WLBLEval, WhiteListSubject SpamControl: init_pre_fork on SpamAssassin done I've also set $log_level = 2; in /etc/amavis/conf.d/50-user and don't see any obvious errors rolling by in the logs. Q: Any recommendations of what to try next? UPDATE (it appears that I have the right setting already): /etc/amavis/conf.d$ grep sa_tag_level_deflt * 20-debian_defaults:# $sa_tag_level_deflt = 2.0; # add spam info headers if at, or above that level 20-debian_defaults:$sa_tag_level_deflt = -999; # add spam info headers if at, or above that level

    Read the article

  • Back to Sony

    - by Bunch
    Well I switched back to Sony. After about a year of debating whether or not to keep my XBox 360 or get a PS3 I decided over the weekend to trade in the 360 for a PS3.  I had thought about keeping both but I really don’t need two gaming systems. So far I like it, the graphics are good and the game selection is pretty much the same. For me the game exclusives didn’t sway me one way or the other (i.e. I’ve never played Halo so you can’t miss what you never played). My main reasons for switching were: RROD – I’ve had three and I don’t play a huge amount per week. Free online gaming – I never did buy a Live Gold account even though it is affordable Blu-ray player – Figured this is as good of a time as any to finally get one Netflix streaming with no need for an upgrade to your online account like on XBox MUCH quieter system Finally at a $299 price point All in all the last point was the main one for me. Like a lot of other folks I was really put off by the PS3’s original pricing of $499 and $599. Technorati Tags: Gaming

    Read the article

  • Facing a character towards the mouse

    - by ratata
    I'm trying to port a simple 2d top down shooter game from C++(Allegro) to Java and i'm having problems with rotating my character. Here's the code i used in c++ if (keys[A]) RotateRight(player, degree); if (keys[D]) RotateLeft(player, degree); void RotateLeft(Player& player, float& degree) { degree += player.rotatingSpeed; if ( degree >= 360 ) degree = 0; } void RotateRight(Player& player, float& degree) { degree -= player.rotatingSpeed; if ( degree <= 0) degree = 360; } And this is what i have in render section: al_draw_rotated_bitmap(player.image, player.frameWidth / 2, player.frameHeight / 2, player.x, player.y, degree * 3.14159 / 180, 0); Instead of using A-D keys i want to use mouse this time. I've been searching since last night and came up to few sample codes however noone of them worked. For example this just made my character to circle around the map: int centerX = width / 2; int centerY = height / 2; double angle = Math.atan2(centerY - mouseY, centerX - mouseX) - Math.PI / 2; ((Graphics2D)g).rotate(angle, centerX, centerY); g.fillRect(...); // draw your rectangle Any help is much appreciated.

    Read the article

  • Configuring bridged network connection --- Windows 7 host, Ubuntu 10.04 guest --- VMWare Workstation 8

    - by H3br3wHamm3r81
    Here is my IPCONFIG /ALL from the host (Windows 7 64-bit): Here is my IFCONFIG from the guest (Ubuntu 10.04): To be honest, I don't have experience configuring a network between a host and a guest in VMWare (a virtual machine). I've searched high and low on the internet, but I haven't seen anything that can help. Perhaps I'm just not using the right keywords when I search. Nevertheless, does anyone here have any experience with establishing a network connection? Edit: One important note. I don't use DHCP to provide private addresses to the hosts on my LAN. I use "static" IP addresses on my internal network by configuring each IP address manually in the host's network configuration utility (I have TV's, XBOX 360, and a few PC's). I would like to configure the IP on the virtual machine guest manually as well. The reason is because my XBOX 360 only works properly using a static IP address. It will kick me off XBOX Live if it has one given by the router (via DHCP).

    Read the article

  • How to disguise a serverside mob as another?

    - by Shaun Wild
    I've been working a Minecraft sever mod and i want to be able to add a new entity to the server, but then make the server send the packets to the client, imitating another mob, for example.. Lets say say i have EntityPlayerNPC.class, what i want to do is have all of the packets that get sent to the client look like they are from that of another player which is on the player, therefore allowing me to add custom NPC's... Thinking about the theory i'm sure this can be done. I've tried looking around for where the packets are being sent from and whatnot, can anyone think up a solution? edit: i tried adding a new constructor to the Packet20NamedEntitySpawn class like so: public Packet20NamedEntitySpawn(String username, EntityLiving e){ this.entityId = 0; this.name = username; this.xPosition = MathHelper.floor_double(e.posX * 32.0D); this.yPosition = MathHelper.floor_double(e.posY * 32.0D); this.zPosition = MathHelper.floor_double(e.posZ * 32.0D); this.rotation = (byte)((int)(e.rotationYaw * 256.0F / 360.0F)); this.pitch = (byte)((int)(e.rotationPitch * 256.0F / 360.0F)); this.metadata = e.getDataWatcher(); } unfortunatley, that didn't work :(

    Read the article

  • Cocos2D: Change animation based on joystick direction

    - by Blade
    I'm trying to get my figure to look in the right directions, based on the input of the joystick. So if I tilt left it looks left and the left animation is used, if I used right, it looks right and right animation is used, if up, then up, down, down and so on. I just get animation for front and back. Also if I press up I see the back of the figure correctly, but it won't go back into the original state when I don't press up anymore. -(void)applyJoystick:(SneakyJoystick *)aJoystick forTimeDelta:(float) deltaTime { CGPoint scaledVelocity = ccpMult(aJoystick.velocity, 128.0f); CGPoint oldPosition = [self position]; CGPoint newPosition = ccp(oldPosition.x + scaledVelocity.x * deltaTime, oldPosition.y + scaledVelocity.y * deltaTime); [self setPosition:newPosition]; id action = nil; int extra = 50; if ((int) aJoystick.degrees > 180 - extra && aJoystick.degrees < 180 + extra) { action = [CCAnimate actionWithAnimation:walkingAnimLeft restoreOriginalFrame:NO]; } else if ((int) aJoystick.degrees > 360 - extra && aJoystick.degrees < 360 + extra) { action = [CCAnimate actionWithAnimation:walkingAnimRight restoreOriginalFrame:NO]; } else if ((int) aJoystick.degrees > 90 - extra && aJoystick.degrees < 90 + extra) { action = [CCAnimate actionWithAnimation:walkingAnimBack restoreOriginalFrame:NO]; } else if ((int) aJoystick.degrees > 270 - extra && aJoystick.degrees < 270 + extra) { action = [CCAnimate actionWithAnimation:walkingAnimFront restoreOriginalFrame:NO]; } if (action != nil) { [self runAction:action]; } } }

    Read the article

  • Problem Solving: Algorithm Required Urgently, Plz Help

    - by user616417
    Problem Solving: I've been working on something since last week. I am stuck at a point, where I want to find the minimum number of airplanes required to carry out a flight schedule given below. Plz, try out the brainstorming, i need the algorithm really badly, i'm also short of time. Thank u in advance. The Schedule---- Flight #,From,To,Departure,Arrival,Days,Via 6E 204,Agartala,Delhi,10:15:00,13:55:00,Daily,Kolkata 6E 360,Agartala,Imphal,13:50:00,14:35:00,Mo Th Sa, 6E 204,Agartala,Kolkata,10:15:00,11:00:00,Daily, 6E 360,Agartala,Kolkata,13:50:00,16:15:00,Mo Th Sa,Imphal 6E 362,Agartala,Kolkata,15:25:00,16:15:00,Tu We Fr Su, 6E 153,Ahmedabad,Bangalore,17:00:00,19:00:00,Daily, 6E 212,Ahmedabad,Chennai,9:00:00,12:55:00,Daily,Mumbai 6E 154,Ahmedabad,Delhi,12:30:00,14:00:00,Daily, 6E 211,Ahmedabad,Jaipur,19:10:00,20:20:00,Daily, 6E 410,Ahmedabad,Kolkata,15:00:00,17:30:00,Daily, 6E 212,Ahmedabad,Mumbai,9:00:00,10:10:00,Daily, 6E 409,Ahmedabad,Pune,14:25:00,15:40:00,Ex Sat, 6E 154,Bangalore,Ahmedabad,10:00:00,12:00:00,Daily, 6E 277,Bangalore,Chennai,15:35:00,16:25:00,Daily, 6E 132,Bangalore,Delhi,6:00:00,8:25:00,Daily, 6E 102,Bangalore,Delhi,9:50:00,13:45:00,Ex Sat,Pune 6E 154,Bangalore,Delhi,10:00:00,14:00:00,Daily,Ahmedabad 6E 104,Bangalore,Delhi,11:30:00,14:10:00,Sat, 6E 122,Bangalore,Delhi,17:20:00,20:00:00,Daily, 6E 108,Bangalore,Delhi,19:20:00,23:10:00,Sat,Pune 6E 106,Bangalore,Delhi,19:30:00,22:00:00,Ex Sat, 6E 275,Bangalore,Goa,12:15:00,13:15:00,Daily, 6E 351,Bangalore,Hyderabad,8:25:00,9:25:00,Daily, 6E 152,Bangalore,Hyderabad,19:10:00,20:10:00,Ex Sat, 6E 152,Bangalore,Hyderabad,19:30:00,20:35:00,Sat, 6E 152,Bangalore,Jaipur,19:10:00,22:30:00,Ex Sat,Hyderabad 6E 152,Bangalore,Jaipur,19:30:00,22:30:00,Sat,Hyderabad 6E 351,Bangalore,Kolkata,8:25:00,11:55:00,Daily,Hyderabad 6E 277,Bangalore,Kolkata,15:35:00,19:15:00,Daily,Chennai 6E 402,Bangalore,Mumbai,6:05:00,7:45:00,Daily, 6E 275,Bangalore,Mumbai,12:15:00,14:45:00,Daily,Goa 6E 414,Bangalore,Mumbai,12:45:00,14:20:00,Daily, 6E 412,Bangalore,Mumbai,21:20:00,23:20:00,Daily, 6E 102,Bangalore,Pune,9:50:00,11:10:00,Ex Sat, 6E 108,Bangalore,Pune,19:20:00,20:40:00,Sat, 6E 258,Bhubaneshwar,Delhi,18:55:00,20:55:00,Daily, 6E 257,Bhubaneshwar,Hyderabad,10:40:00,12:05:00,Daily, 6E 257,Bhubaneshwar,Mumbai,10:40:00,13:50:00,Daily,Hyderabad 6E 211,Chennai,Ahmedabad,15:10:00,18:40:00,Daily,Mumbai 6E 275,Chennai,Bangalore,10:50:00,11:40:00,Daily, 6E 302,Chennai,Delhi,11:35:00,15:20:00,Daily,Hyderabad 6E 282,Chennai,Delhi,19:45:00,22:30:00,Daily, 6E 275,Chennai,Goa,10:50:00,13:15:00,Daily,Bangalore 6E 302,Chennai,Hyderabad,11:35:00,12:40:00,Daily, 6E 211,Chennai,Jaipur,15:10:00,20:20:00,Daily,Mumbai/Ahmedabad 6E 523,Chennai,Kolkata,8:20:00,10:30:00,Daily, 6E 277,Chennai,Kolkata,16:55:00,19:15:00,Daily, 6E 211,Chennai,Mumbai,15:10:00,16:50:00,Daily, 6E 524,Chennai,Pune,21:15:00,23:00:00,Daily, 6E 273,Delhi,Agartala,6:15:00,9:45:00,Daily,Kolkata 6E 153,Delhi,Ahmedabad,14:45:00,16:30:00,Daily, 6E 101,Delhi,Bangalore,6:30:00,9:10:00,Ex Sat, 6E 103,Delhi,Bangalore,6:45:00,10:40:00,Sat,Pune 6E 121,Delhi,Bangalore,9:30:00,12:10:00,Daily, 6E 105,Delhi,Bangalore,14:20:00,18:30:00,Ex Sat,Pune 6E 153,Delhi,Bangalore,14:45:00,19:00:00,Daily,Ahmedabad 6E 107,Delhi,Bangalore,15:55:00,18:40:00,Sat, 6E 131,Delhi,Bangalore,20:45:00,23:15:00,Daily, 6E 257,Delhi,Bhubaneshwar,8:10:00,10:10:00,Daily, 6E 301,Delhi,Chennai,7:00:00,11:05:00,Daily,Hyderabad 6E 283,Delhi,Chennai,16:30:00,19:05:00,Daily, 6E 181,Delhi,Goa,9:15:00,13:35:00,Daily,Mumbai 6E 333,Delhi,Goa,11:45:00,14:15:00,Daily, 6E 201,Delhi,Guwahati,5:30:00,7:50:00,Daily, 6E 301,Delhi,Hyderabad,7:00:00,9:00:00,Daily, 6E 257,Delhi,Hyderabad,8:10:00,12:05:00,Daily,Bhubaneshwar 6E 305,Delhi,Hyderabad,14:00:00,15:55:00,Daily, 6E 307,Delhi,Hyderabad,21:00:00,22:55:00,Daily, 6E 201,Delhi,Imphal,5:30:00,9:10:00,Daily,Guwahati 6E 305,Delhi,Kochi,14:00:00,18:25:00,Daily,Hyderabad 6E 273,Delhi,Kolkata,6:15:00,8:20:00,Daily, 6E 203,Delhi,Kolkata,15:00:00,17:05:00,Daily, 6E 209,Delhi,Kolkata,18:30:00,20:45:00,Daily, 6E 183,Delhi,Mumbai,6:45:00,8:35:00,Daily, 6E 181,Delhi,Mumbai,9:15:00,11:35:00,Daily, 6E 481,Delhi,Mumbai,10:50:00,13:50:00,Daily,Vadodara 6E 189,Delhi,Mumbai,14:45:00,16:50:00,Daily, 6E 187,Delhi,Mumbai,17:50:00,19:50:00,Daily, 6E 185,Delhi,Mumbai,20:15:00,22:20:00,Daily, 6E 135,Delhi,Nagpur,8:55:00,10:40:00,Ex Sat, 6E 103,Delhi,Pune,6:45:00,8:45:00,Sat, 6E 135,Delhi,Pune,8:55:00,12:30:00,Ex Sat,Nagpur 6E 105,Delhi,Pune,14:20:00,16:30:00,Ex Sat, 6E 481,Delhi,Vadodara,10:50:00,12:20:00,Daily, 6E 277,Goa,Bangalore,14:05:00,15:00:00,Daily, 6E 277,Goa,Chennai,14:05:00,16:25:00,Daily,Bangalore 6E 334,Goa,Delhi,14:45:00,17:10:00,Daily, 6E 277,Goa,Kolkata,14:05:00,19:15:00,Daily,Bangalore/Chennai 6E 275,Goa,Mumbai,13:45:00,14:45:00,Daily, 6E 202,Guwahati,Delhi,11:00:00,13:25:00,Daily, 6E 201,Guwahati,Imphal,8:25:00,9:10:00,Daily, 6E 208,Guwahati,Jaipur,12:40:00,16:55:00,Daily,Kolkata 6E 208,Guwahati,Kolkata,12:40:00,14:00:00,Daily, 6E 322,Guwahati,Kolkata,15:30:00,16:50:00,Daily, 6E 322,Guwahati,Mumbai,15:30:00,20:20:00,Daily,Kolkata 6E 151,Hyderabad,Bangalore,8:20:00,9:20:00,Daily, 6E 352,Hyderabad,Bangalore,19:40:00,20:40:00,Daily, 6E 258,Hyderabad,Bhubaneshwar,16:40:00,18:20:00,Daily, 6E 301,Hyderabad,Chennai,9:50:00,11:05:00,Daily, 6E 308,Hyderabad,Delhi,6:10:00,8:00:00,Daily, 6E 302,Hyderabad,Delhi,13:10:00,15:20:00,Daily, 6E 258,Hyderabad,Delhi,16:40:00,20:55:00,Daily,Bhubaneshwar 6E 306,Hyderabad,Delhi,21:00:00,23:05:00,Daily, 6E 152,Hyderabad,Jaipur,20:50:00,22:30:00,Ex Sat, 6E 152,Hyderabad,Jaipur,21:10:00,22:30:00,Sat, 6E 305,Hyderabad,Kochi,16:45:00,18:25:00,Daily, 6E 351,Hyderabad,Kolkata,9:55:00,11:55:00,Daily, 6E 257,Hyderabad,Mumbai,12:35:00,13:50:00,Daily, 6E 362,Imphal,Agartala,14:15:00,14:55:00,Tu We Fr Su, 6E 202,Imphal,Delhi,9:40:00,13:25:00,Daily,Guwahati 6E 202,Imphal,Guwahati,9:40:00,10:25:00,Daily, 6E 362,Imphal,Kolkata,14:15:00,16:15:00,Tu We Fr Su,Agartala 6E 360,Imphal,Kolkata,15:05:00,16:15:00,Mo Th Sa, 6E 212,Jaipur,Ahmedabad,7:30:00,8:35:00,Daily, 6E 151,Jaipur,Bangalore,6:00:00,9:20:00,Daily,Hyderabad 6E 212,Jaipur,Chennai,7:30:00,12:55:00,Daily,Mumbai/Ahmedabad 6E 207,Jaipur,Guwahati,8:20:00,12:10:00,Daily,Kolkata 6E 151,Jaipur,Hyderabad,6:00:00,7:40:00,Daily, 6E 207,Jaipur,Kolkata,8:20:00,10:10:00,Daily, 6E 323,Jaipur,Kolkata,17:35:00,23:00:00,Daily,Mumbai 6E 212,Jaipur,Mumbai,7:30:00,10:10:00,Daily,Ahmedabad 6E 323,Jaipur,Mumbai,17:35:00,19:15:00,Daily, 6E 306,Kochi,Delhi,19:00:00,23:05:00,Daily,Hyderabad 6E 306,Kochi,Hyderabad,19:00:00,20:30:00,Daily, 6E 273,Kolkata,Agartala,8:50:00,9:45:00,Daily, 6E 360,Kolkata,Agartala,12:30:00,13:20:00,Mo Th Sa, 6E 362,Kolkata,Agartala,12:30:00,14:55:00,TuWeFrSu,Imphal 6E 409,Kolkata,Ahmedabad,11:10:00,13:50:00,Daily, 6E 275,Kolkata,Bangalore,7:30:00,11:40:00,Daily,Chennai 6E 352,Kolkata,Bangalore,16:50:00,20:40:00,Daily,Hyderabad 6E 275,Kolkata,Chennai,7:30:00,9:50:00,Daily, 6E 524,Kolkata,Chennai,18:15:00,20:25:00,Daily, 6E 210,Kolkata,Delhi,7:45:00,10:05:00,Daily, 6E 204,Kolkata,Delhi,11:40:00,13:55:00,Daily, 6E 274,Kolkata,Delhi,19:45:00,22:10:00,Daily, 6E 275,Kolkata,Goa,7:30:00,13:15:00,Daily,Chennai/Bangalore 6E 207,Kolkata,Guwahati,10:50:00,12:10:00,Daily, 6E 321,Kolkata,Guwahati,13:00:00,14:20:00,Daily, 6E 352,Kolkata,Hyderabad,16:50:00,19:00:00,Daily, 6E 362,Kolkata,Imphal,12:30:00,13:45:00,Tu We Fr Su, 6E 360,Kolkata,Imphal,12:30:00,14:35:00,MoThSa,Agartala 6E 208,Kolkata,Jaipur,14:35:00,16:55:00,Daily, 6E 320,Kolkata,Mumbai,6:00:00,8:30:00,Daily, 6E 322,Kolkata,Mumbai,17:35:00,20:20:00,Daily, 6E 404,Kolkata,Mumbai,18:35:00,21:55:00,Daily,Nagpur 6E 404,Kolkata,Nagpur,18:35:00,20:05:00,Daily, 6E 409,Kolkata,Pune,11:10:00,15:40:00,Ex Sat,Ahmedabad 6E 524,Kolkata,Pune,18:15:00,23:00:00,Daily,Chennai 6E 211,Mumbai,Ahmedabad,17:40:00,18:40:00,Daily, 6E 411,Mumbai,Bangalore,6:20:00,7:50:00,Daily, 6E 413,Mumbai,Bangalore,15:00:00,16:40:00,Daily, 6E 415,Mumbai,Bangalore,21:05:00,22:40:00,Daily, 6E 258,Mumbai,Bhubaneshwar,14:30:00,18:20:00,Daily,Hyderabad 6E 212,Mumbai,Chennai,11:00:00,12:55:00,Daily, 6E 184,Mumbai,Delhi,6:15:00,8:15:00,Daily, 6E 180,Mumbai,Delhi,8:25:00,10:35:00,Daily, 6E 482,Mumbai,Delhi,9:25:00,12:35:00,Daily,Vadodara 6E 188,Mumbai,Delhi,14:25:00,16:35:00,Daily, 6E 186,Mumbai,Delhi,17:50:00,19:55:00,Daily, 6E 182,Mumbai,Delhi,21:15:00,23:20:00,Daily, 6E 181,Mumbai,Goa,12:35:00,13:35:00,Daily, 6E 321,Mumbai,Guwahati,9:20:00,14:20:00,Daily,Kolkata 6E 258,Mumbai,Hyderabad,14:30:00,16:00:00,Daily, 6E 207,Mumbai,Jaipur,5:55:00,7:40:00,Daily, 6E 211,Mumbai,Jaipur,17:40:00,20:20:00,Daily,Ahmedabad 6E 207,Mumbai,Kolkata,5:55:00,10:10:00,Daily,Jaipur 6E 321,Mumbai,Kolkata,9:20:00,12:00:00,Daily, 6E 403,Mumbai,Kolkata,15:35:00,18:50:00,Daily,Nagpur 6E 323,Mumbai,Kolkata,20:05:00,23:00:00,Daily, 6E 403,Mumbai,Nagpur,15:35:00,16:50:00,Daily, 6E 482,Mumbai,Vadodara,9:25:00,10:25:00,Daily, 6E 136,Nagpur,Delhi,18:10:00,19:40:00,Ex Sat, 6E 403,Nagpur,Kolkata,17:20:00,18:50:00,Daily, 6E 404,Nagpur,Mumbai,20:35:00,21:55:00,Daily, 6E 135,Nagpur,Pune,11:20:00,12:30:00,Ex Sat, 6E 410,Pune,Ahmedabad,13:10:00,14:30:00,Ex Sat, 6E 103,Pune,Bangalore,9:15:00,10:40:00,Sat, 6E 105,Pune,Bangalore,17:00:00,18:30:00,Ex Sat, 6E 523,Pune,Chennai,5:55:00,7:40:00,Daily, 6E 102,Pune,Delhi,11:45:00,13:45:00,Ex Sat, 6E 136,Pune,Delhi,16:15:00,19:40:00,Ex Sat,Nagpur 6E 108,Pune,Delhi,21:10:00,23:10:00,Sat, 6E 523,Pune,Kolkata,5:55:00,10:30:00,Daily,Chennai 6E 410,Pune,Kolkata,13:10:00,17:30:00,Ex Sat,Ahmedabad 6E 136,Pune,Nagpur,16:15:00,17:40:00,Ex Sat, 6E 482,Vadodara,Delhi,10:55:00,12:35:00,Daily, 6E 481,Vadodara,Mumbai,12:50:00,13:50:00,Daily,

    Read the article

  • change height in Android 2.2 LinearLayout in code

    - by Niro
    Im trying to change height of Layouts through the code without success. I've tried all of the examples i saw here and other site and my app just keep shutting down. xml code: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/main_lay" android:orientation="vertical" tools:context=".MainActivity" > <LinearLayout android:id="@+id/layout_add" > </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="50dp" android:background="@color/green"> <ImageView android:layout_width="fill_parent" android:contentDescription="@string/desc" android:layout_height="45dp" android:layout_gravity="center_vertical|left" android:scaleType="fitStart" android:background="@color/orange" android:src="@drawable/logo" > </ImageView> </LinearLayout> </LinearLayout> Java code: main_layout=(LinearLayout)findViewById(R.id.main_lay); main_layout.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT)); main_layout.setBackgroundResource(R.color.white); layout_add = (LinearLayout) findViewById(R.id.layout_add); layout_add.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,50 )); layout_add.setBackgroundResource(R.color.dark_grey); I cant understand what im doing wrong. I've tried different ways to fix it. The Backround setting is working fine. Thank you guys Niro This is the Logcat 12-09 16:12:39.007: E/AnalyticsSDKTest.cpp(6338): Time w/ UTC Offset: 2012-12-09 12-09 16:16:14.517: E/ActivityManager(121): fail to set top app changed! 12-09 16:16:14.547: E/InputDispatcher(121): channel '4056b9c8 com.nirosadvice.converter/com.nirosadvice.converter.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8 12-09 16:16:14.547: E/InputDispatcher(121): channel '4056b9c8 com.nirosadvice.converter/com.nirosadvice.converter.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 12-09 16:16:18.071: E/PVWmdrmProxy(5716): binder died for component: ComponentInfo{com.pv.wmdrmservice/com.pv.wmdrmservice.PVWmdrmService} 12-09 16:16:18.161: E/AndroidRuntime(18911): FATAL EXCEPTION: main 12-09 16:16:18.161: E/AndroidRuntime(18911): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nirosadvice.converter/com.nirosadvice.converter.MainActivity}: java.lang.RuntimeException: Binary XML file line #1: You must supply a layout_width attribute. 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1821) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1842) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.ActivityThread.access$1500(ActivityThread.java:132) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.os.Handler.dispatchMessage(Handler.java:99) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.os.Looper.loop(Looper.java:150) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.ActivityThread.main(ActivityThread.java:4263) 12-09 16:16:18.161: E/AndroidRuntime(18911): at java.lang.reflect.Method.invokeNative(Native Method) 12-09 16:16:18.161: E/AndroidRuntime(18911): at java.lang.reflect.Method.invoke(Method.java:507) 12-09 16:16:18.161: E/AndroidRuntime(18911): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-09 16:16:18.161: E/AndroidRuntime(18911): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-09 16:16:18.161: E/AndroidRuntime(18911): at dalvik.system.NativeStart.main(Native Method) 12-09 16:16:18.161: E/AndroidRuntime(18911): Caused by: java.lang.RuntimeException: Binary XML file line #1: You must supply a layout_width attribute. 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:3684) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:3764) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.widget.FrameLayout$LayoutParams.<init>(FrameLayout.java:457) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:423) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:47) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 12-09 16:16:18.161: E/AndroidRuntime(18911): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:231) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.Activity.setContentView(Activity.java:1715) 12-09 16:16:18.161: E/AndroidRuntime(18911): at com.nirosadvice.converter.MainActivity.onCreate(MainActivity.java:87) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1785) 12-09 16:16:18.161: E/AndroidRuntime(18911): ... 11 more Thanks After Iv'e added the attributes to the XML - this is what i'm getting : CatLog: 12-09 16:42:33.168: E/AndroidRuntime(19065): FATAL EXCEPTION: main 12-09 16:42:33.168: E/AndroidRuntime(19065): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.widget.LinearLayout.measureVertical(LinearLayout.java:360) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.view.View.measure(View.java:8526) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.view.View.measure(View.java:8526) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.view.View.measure(View.java:8526) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.view.ViewRoot.performTraversals(ViewRoot.java:902) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.view.ViewRoot.handleMessage(ViewRoot.java:1957) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.os.Handler.dispatchMessage(Handler.java:99) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.os.Looper.loop(Looper.java:150) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.app.ActivityThread.main(ActivityThread.java:4263) 12-09 16:42:33.168: E/AndroidRuntime(19065): at java.lang.reflect.Method.invokeNative(Native Method) 12-09 16:42:33.168: E/AndroidRuntime(19065): at java.lang.reflect.Method.invoke(Method.java:507) 12-09 16:42:33.168: E/AndroidRuntime(19065): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-09 16:42:33.168: E/AndroidRuntime(19065): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-09 16:42:33.168: E/AndroidRuntime(19065): at dalvik.system.NativeStart.main(Native Method) 12-09 16:42:39.023: E/AnalyticsSDKTest.cpp(6338): Time w/ UTC Offset: 2012-12-09 21:42:39-05:00 12-09 16:42:49.013: E/AndroidRuntime(19095): FATAL EXCEPTION: main 12-09 16:42:49.013: E/AndroidRuntime(19095): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.widget.LinearLayout.measureVertical(LinearLayout.java:360) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.view.View.measure(View.java:8526) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.view.View.measure(View.java:8526) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.view.View.measure(View.java:8526) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.view.ViewRoot.performTraversals(ViewRoot.java:902) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.view.ViewRoot.handleMessage(ViewRoot.java:1957) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.os.Handler.dispatchMessage(Handler.java:99) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.os.Looper.loop(Looper.java:150) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.app.ActivityThread.main(ActivityThread.java:4263) 12-09 16:42:49.013: E/AndroidRuntime(19095): at java.lang.reflect.Method.invokeNative(Native Method) 12-09 16:42:49.013: E/AndroidRuntime(19095): at java.lang.reflect.Method.invoke(Method.java:507) 12-09 16:42:49.013: E/AndroidRuntime(19095): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-09 16:42:49.013: E/AndroidRuntime(19095): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-09 16:42:49.013: E/AndroidRuntime(19095): at dalvik.system.NativeStart.main(Native Method) 12-09 16:44:00.913: E/AndroidRuntime(19148): FATAL EXCEPTION: main 12-09 16:44:00.913: E/AndroidRuntime(19148): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.widget.LinearLayout.measureVertical(LinearLayout.java:360) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.view.View.measure(View.java:8526) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.view.View.measure(View.java:8526) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.view.View.measure(View.java:8526) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.view.ViewRoot.performTraversals(ViewRoot.java:902) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.view.ViewRoot.handleMessage(ViewRoot.java:1957) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.os.Handler.dispatchMessage(Handler.java:99) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.os.Looper.loop(Looper.java:150) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.app.ActivityThread.main(ActivityThread.java:4263) 12-09 16:44:00.913: E/AndroidRuntime(19148): at java.lang.reflect.Method.invokeNative(Native Method) 12-09 16:44:00.913: E/AndroidRuntime(19148): at java.lang.reflect.Method.invoke(Method.java:507) 12-09 16:44:00.913: E/AndroidRuntime(19148): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-09 16:44:00.913: E/AndroidRuntime(19148): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-09 16:44:00.913: E/AndroidRuntime(19148): at dalvik.system.NativeStart.main(Native Method) 12-09 16:44:02.935: E/InputDispatcher(121): channel '4056b9c8 com.nirosadvice.converter/com.nirosadvice.converter.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8 12-09 16:44:02.935: E/InputDispatcher(121): channel '4056b9c8 com.nirosadvice.converter/com.nirosadvice.converter.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 12-09 16:45:25.075: E/AndroidRuntime(19210): FATAL EXCEPTION: main 12-09 16:45:25.075: E/AndroidRuntime(19210): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.widget.LinearLayout.measureVertical(LinearLayout.java:360) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.view.View.measure(View.java:8526) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.view.View.measure(View.java:8526) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.view.View.measure(View.java:8526) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.view.ViewRoot.performTraversals(ViewRoot.java:902) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.view.ViewRoot.handleMessage(ViewRoot.java:1957) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.os.Handler.dispatchMessage(Handler.java:99) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.os.Looper.loop(Looper.java:150) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.app.ActivityThread.main(ActivityThread.java:4263) 12-09 16:45:25.075: E/AndroidRuntime(19210): at java.lang.reflect.Method.invokeNative(Native Method) 12-09 16:45:25.075: E/AndroidRuntime(19210): at java.lang.reflect.Method.invoke(Method.java:507) 12-09 16:45:25.075: E/AndroidRuntime(19210): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-09 16:45:25.075: E/AndroidRuntime(19210): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-09 16:45:25.075: E/AndroidRuntime(19210): at dalvik.system.NativeStart.main(Native Method) 12-09 16:50:34.507: E/AndroidRuntime(19358): FATAL EXCEPTION: main 12-09 16:50:34.507: E/AndroidRuntime(19358): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.widget.LinearLayout.measureVertical(LinearLayout.java:360) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.view.View.measure(View.java:8526) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.view.View.measure(View.java:8526) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.view.View.measure(View.java:8526) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.view.ViewRoot.performTraversals(ViewRoot.java:902) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.view.ViewRoot.handleMessage(ViewRoot.java:1957) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.os.Handler.dispatchMessage(Handler.java:99) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.os.Looper.loop(Looper.java:150) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.app.ActivityThread.main(ActivityThread.java:4263) 12-09 16:50:34.507: E/AndroidRuntime(19358): at java.lang.reflect.Method.invokeNative(Native Method) 12-09 16:50:34.507: E/AndroidRuntime(19358): at java.lang.reflect.Method.invoke(Method.java:507) 12-09 16:50:34.507: E/AndroidRuntime(19358): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-09 16:50:34.507: E/AndroidRuntime(19358): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-09 16:50:34.507: E/AndroidRuntime(19358): at dalvik.system.NativeStart.main(Native Method) Third try - after changing the Frame to Linear : 12-09 17:42:39.076: E/AnalyticsSDKTest.cpp(6338): Time w/ UTC Offset: 2012-12-09 22:42:39-05:00 12-09 17:55:44.141: E/ActivityManager(121): Fix ANR:broadcast when App died 12-09 17:55:44.722: E/AndroidRuntime(19469): FATAL EXCEPTION: main 12-09 17:55:44.722: E/AndroidRuntime(19469): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.widget.LinearLayout.measureVertical(LinearLayout.java:360) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.view.View.measure(View.java:8526) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.view.View.measure(View.java:8526) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.view.View.measure(View.java:8526) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.view.ViewRoot.performTraversals(ViewRoot.java:902) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.view.ViewRoot.handleMessage(ViewRoot.java:1957) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.os.Handler.dispatchMessage(Handler.java:99) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.os.Looper.loop(Looper.java:150) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.app.ActivityThread.main(ActivityThread.java:4263) 12-09 17:55:44.722: E/AndroidRuntime(19469): at java.lang.reflect.Method.invokeNative(Native Method) 12-09 17:55:44.722: E/AndroidRuntime(19469): at java.lang.reflect.Method.invoke(Method.java:507) 12-09 17:55:44.722: E/AndroidRuntime(19469): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-09 17:55:44.722: E/AndroidRuntime(19469): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-09 17:55:44.722: E/AndroidRuntime(19469): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • XNA Notes 011

    - by George Clingerman
    Even with a lot of the XNA community working on Dream Build Play entries ( I swear I’m going to finish mine this year!) people are still finding time to do side projects and be amazingly active in the XNA and XBLIG community. With my one eye on my code and one eye on the community, here’s what I noticed these over achievers doing this past week! Time Critical XNA News: Xbox LIVE Indie Games sales data will be delayed March 17-20th due to some schedule maintenance http://create.msdn.com/en-us/news/indie_games_data_delay_march2011 GameMarx is releasing a series of videos to help raise donations for victims of the earthquakes and tsunami in Japan. Help out if you can! http://www.gamemarx.com/video/special/29/help-japan-sushido.aspx XNA MVPs: Catalin Zima shares his thoughts on the MVP summit and my book! http://www.catalinzima.com/2011/03/mvp-summit-2011/ Glenn Wilson (@mykre) helps the XNA team announce some new educational content that you don’t want to miss if you’re porting your app or game to Windows Phone 7 http://www.virtualrealm.com.au/Blog/tabid/62/EntryId/653/Porting-your-App-or-Game-to-Windows-Phone-7.aspx and Windows Phone 7 from scratch http://www.virtualrealm.com.au/Blog/tabid/62/EntryId/654/Windows-Phone-from-Scratch.aspx and shares a link to some free architectural models and textures http://twitter.com/#!/Mykre/status/46410160784158720 George (that’s me!) shares his MVP Summit 2011 summary and XBLIG thoughts http://geekswithblogs.net/clingermangw/archive/2011/03/15/144366.aspx XNA Developers: @SmallCaveGames shares a Code of Ethics for Xbox LIVE Indie Game Developers http://smallcavegames.blogspot.com/2011/03/unofficial-xblig-developers-code-of.html Derek S adds more Xbox LIVE Indie Game studios to his master list of XBLIG links http://twitter.com/#!/Mr_Deeke/status/46140996056125440 http://xbl-indieverse.blogspot.com/p/xblig-links.html Making games and want to help kids? Then share your story with GameFace: America! http://gameitupinitiative.com/about-the-initiative/programs/gameface-america/ Xbox LIVE Indie Games (XBLIG): XonaGames shares some video footage of their booth from GDC 2011 Video 1: http://youtu.be/lxIV9nk3Gq4 Video 2: http://youtu.be/GgfrjqkxR_o Video 3: http://youtu.be/yVcpXrTX7SQ Joystiq on Mommy’s Best Games Serious Sam Double D http://www.joystiq.com/2011/03/16/the-most-important-thing-about-serious-sam-double-d/ And The Escapist recommends that gamers start learning to avoid cleavage now http://www.escapistmagazine.com/news/view/108543-Boobie-Bomber-Makes-First-Appearance-in-Serious-Sam-Double-D Magiko Gaming started a blog on the XBLIG dashboard daily Top 10 games in the US. Good way to go back in time and look at the history of which games were in the the Top 10. http://dailytop10indiegames.wordpress.com/ Where are they going now? XBLIG developers at a crossroads.. http://www.gamesetwatch.com/2011/03/where_are_they_going_now_xblig.php http://www.gamasutra.com/view/news/33527/InDepth_Where_Are_They_Going_Now_XBLIG_Developers_At_A_Crossroads_.php BinaryTweed’s Clover: A Curious Tail is Xbox LIVE’s Deal of the Week! http://www.armlessoctopus.com/2011/03/15/what-luck-clover-a-curious-tale-is-half-price-this-week/ Looking for an Xbox LIVE Indie Game to buy? Writings of Mass Deduction has over 125 suggestions at this point! http://writingsofmassdeduction.com/ SkaStudios shares Vampire Smile Achievements AND their PAX East 2011 Both Setup video http://www.ska-studios.com/2011/03/14/vampire-smile-achievement/ http://www.ska-studios.com/2011/03/15/pax-booth-setup-time-lapse/ MasterBlud and VVGTV starts a new community for XBLIG developers and gamers to join http://vvgtv.forumotion.com/ Raymond Matthews (@DrakstarMatryx) covers Mommy’s Best Games getting Serious http://www.darkstarmatryx.com/?p=286 XNA Development: Dave Henry (@mort8088) posts the 4th tutorial in his series XNA 4.0 SpriteBatch extended http://mort8088.com/2011/03/11/xna-4-0-tutorial-4-spritebatch-extended/ Tutorial 5 - Creating a manual blank texture http://mort8088.com/2011/03/13/xna-4-tutorial-5-manual-blank-texture/ XNA 4.0 Tutorial 6 - Spritesheet Object http://mort8088.com/2011/03/18/xna-4-0-tutorial-6-spritesheet-object/ Jason Mitchell shares a tutorial on setting the alpha value for spritebatch in XNA 4.0 http://www.jason-mitchell.com/index.php/2011/03/13/setting-alpha-value-for-spritebatch-draw-in-xna-4/ XNA for Silverlight Developers: Part 7 - Collision Detection http://www.silverlightshow.net/items/XNA-for-Silverlight-developers-Part-7-Collision-detection.aspx Markus Ewald (@Cygon4) shares the full Ninject 2.0 binding for XNA and Sunburn http://twitter.com/#!/Cygon4/status/48330203826622464 Michael B. McLaughlin shares an AccelerometerInput XNA GameComponent he created (which I’m probably going to snag for a game I’m working on...) http://geekswithblogs.net/mikebmcl/archive/2011/03/17/accelerometerinput-xna-gamecomponent.aspx Extra Credit tackles the building of a good tutorial. Must watch for all Indie game devs (thanks for pointing it out Evan Johnson!) http://twitter.com/#!/johnsonevan/status/48452115680604160 http://www.escapistmagazine.com/videos/view/extra-credits/2921-Tutorials-101 ExEn is fully funded at this point so definitely something for XBLIG developers to keep an eye on as they consider releasing their games on other platforms http://rockethub.com/projects/752-exen-xna-for-iphone-android-and-silverlight Channel 9 and Greg Duncan post Mixing the Game State Management and Platformer XNA Recipes http://channel9.msdn.com/coding4fun/blog/Mixing-the-Game-State-Management-and-Platformer-XNA-Recipes Sgt. Conker has noticed Mike McLaughlin has been crazy productive and has done a recap of his recent posts http://www.sgtconker.com/2011/03/recap-of-mikebmcls-posts/

    Read the article

  • List of Commonly Used Value Types in XNA Games

    - by Michael B. McLaughlin
    Most XNA programmers are concerned about generating garbage. More specifically about allocating GC-managed memory (GC stands for “garbage collector” and is both the name of the class that provides access to the garbage collector and an acronym for the garbage collector (as a concept) itself). Two of the major target platforms for XNA (Windows Phone 7 and Xbox 360) use variants of the .NET Compact Framework. On both variants, the GC runs under various circumstances (Windows Phone 7 and Xbox 360). Of concern to XNA programmers is the fact that it runs automatically after a fixed amount of GC-managed memory has been allocated (currently 1MB on both systems). Many beginning XNA programmers are unaware of what constitutes GC-managed memory, though. So here’s a quick overview. In .NET, there are two different “types” of types: value types and reference types. Only reference types are managed by the garbage collector. Value types are not managed by the garbage collector and are instead managed in other ways that are implementation dependent. For purposes of XNA programming, the important point is that they are not managed by the GC and thus do not, by themselves, increment that internal 1 MB allocation counter. (n.b. Structs are value types. If you have a struct that has a reference type as a member, then that reference type, when instantiated, will still be allocated in the GC-managed memory and will thus count against the 1 MB allocation counter. Putting it in a struct doesn’t change the fact that it gets allocated on the GC heap, but the struct itself is created outside of the GC’s purview). Both value types and reference types use the keyword ‘new’ to allocate a new instance of them. Sometimes this keyword is hidden by a method which creates new instances for you, e.g. XmlReader.Create. But the important thing to determine is whether or not you are dealing with a value types or a reference type. If it’s a value type, you can use the ‘new’ keyword to allocate new instances of that type without incrementing the GC allocation counter (except as above where it’s a struct with a reference type in it that is allocated by the constructor, but there are no .NET Framework or XNA Framework value types that do this so it would have to be a struct you created or that was in some third-party library you were using for that to even become an issue). The following is a list of most all of value types you are likely to use in a generic XNA game: AudioCategory (used with XACT; not available on WP7) AvatarExpression (Xbox 360 only, but exposed on Windows to ease Xbox development) bool BoundingBox BoundingSphere byte char Color DateTime decimal double any enum (System.Enum itself is a class, but all enums are value types such that there are no GC allocations for enums) float GamePadButtons GamePadCapabilities GamePadDPad GamePadState GamePadThumbSticks GamePadTriggers GestureSample int IntPtr (rarely but occasionally used in XNA) KeyboardState long Matrix MouseState nullable structs (anytime you see, e.g. int? something, that ‘?’ denotes a nullable struct, also called a nullable type) Plane Point Quaternion Ray Rectangle RenderTargetBinding sbyte (though I’ve never seen it used since most people would just use a short) short TimeSpan TouchCollection TouchLocation TouchPanelCapabilities uint ulong ushort Vector2 Vector3 Vector4 VertexBufferBinding VertexElement VertexPositionColor VertexPositionColorTexture VertexPositionNormalTexture VertexPositionTexture Viewport So there you have it. That’s not quite a complete list, mind you. For example: There are various structs in the .NET framework you might make use of. I left out everything from the Microsoft.Xna.Framework.Graphics.PackedVector namespace, since everything in there ventures into the realm of advanced XNA programming anyway (n.b. every single instantiable thing in that namespace is a struct and thus a value type; there are also two interfaces but interfaces cannot be instantiated at all and thus don’t figure in to this discussion). There are so many enums you’re likely to use (PlayerIndex, SpriteSortMode, SpriteEffects, SurfaceFormat, etc.) that including them would’ve flooded the list and reduced its utility. So I went with “any enum” and trust that you can figure out what the enums are (and it’s rare to use ‘new’ with an enum anyway). That list also doesn’t include any of the pre-defined static instances of some of the classes (e.g. BlendState.AlphaBlend, BlendState.Opaque, etc.) which are already allocated such that using them doesn’t cause any new allocations and therefore doesn’t increase that 1 MB counter. That list also has a few misleading things. VertexElement, VertexPositionColor, and all the other vertex types are structs. But you’re only likely to ever use them as an array (for use with VertexBuffer or DynamicVertexBuffer), and all arrays are reference types (even arrays of value types such as VertexPositionColor[ ] or int[ ]). * So that’s it for now. The note below may be a bit confusing (it deals with how the GC works and how arrays are managed in .NET). If so, you can probably safely ignore it for now but feel free to ask any questions regardless. * Arrays of value types (where the value type doesn’t contain any reference type members) are much faster for the GC to examine than arrays of reference types, so there is a definite benefit to using arrays of value types where it makes sense. But creating arrays of value types does cause the GC’s allocation counter to increase. Indeed, allocating a large array of a value type is one of the quickest ways to increment the allocation counter since a .NET array is a sequential block of memory. An array of reference types is just a sequential block of references (typically 4 bytes each) while an array of value types is a sequential block of instances of that type. So for an array of Vector3s it would be 12 bytes each since each float is 4 bytes and there are 3 in a Vector3; for an array of VertexPositionNormalTexture structs it would typically be 32 bytes each since it has two Vector3s and a Vector2. (Note that there are a few additional bytes taken up in the creation of an array, typically 12 but sometimes 16 or possibly even more, which depend on the implementation details of the array type on the particular platform the code is running on).

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >