Daily Archives

Articles indexed Monday January 17 2011

Page 2/36 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • WriteableBitmap failing badly, pixel array very inaccurate

    - by dawmail333
    I have tried, literally for hours, and I have not been able to budge this problem. I have a UserControl, that is 800x369, and it contains, simply, a path that forms a worldmap. I put this on a landscape page, then I render it into a WriteableBitmap. I then run a conversion to turn the 1d Pixels array into a 2d array of integers. Then, to check the conversion, I wire up the custom control's click command to use the Point.X and Point.Y relative to the custom control in the newly created array. My logic is thus: wb = new WriteableBitmap(worldMap, new TranslateTransform()); wb.Invalidate(); intTest = wb.Pixels.To2DArray(wb.PixelWidth); My conversion logic is as such: public static int[,] To2DArray(this int[] arr,int rowLength) { int[,] output = new int[rowLength, arr.Length / rowLength]; if (arr.Length % rowLength != 0) throw new IndexOutOfRangeException(); for (int i = 0; i < arr.Length; i++) { output[i % rowLength, i / rowLength] = arr[i]; } return output; } Now, when I do the checking, I get completely and utterly strange results: apparently all pixels are either at values of -1 or 0, and these values are completely independent of the original colours. Just for posterity: here's my checking code: private void Check(object sender, MouseButtonEventArgs e) { Point click = e.GetPosition(worldMap); ChangeNotification(intTest[(int)click.X,(int)click.Y].ToString()); } The result show absolutely no correlation to the path that the WriteableBitmap has rendered into it. The path has a fill of solid white. What the heck is going on? I've tried for hours with no luck. Please, this is the major problem stopping me from submitting my first WP7 app. Any guidance?

    Read the article

  • Bruce Lee Software development.

    - by DesigningCode
    "Styles tend to not only separate men - because they have their own doctrines and then the doctrine became the gospel truth that you cannot change. But if you do not have a style, if you just say: Well, here I am as a human being, how can I express myself totally and completely? Now, that way you won't create a style, because style is a crystallization. That way, it's a process of continuing growth."- Bruce Lee This is kind of how I see software development. What I enjoyed in the the early days of Agile, things seemed very dynamic, people were working out all manner of ways of doing things. It was technique oriented, it was very fluid and people were finding all kinds of good ways of doing things.  Now when I look at the world of “Agile” it seems more crystalized.  In fact that seemed to be a goal, to crystalize the goodness so everyone can share.   I think mainly because it seems a heck of a lot easier to market.  People are more willing to accept a well defined doctrine and drink the Kool Aid.   Its more “corporate” or “professional”. But the process of crystalizing the goodness actually makes it bad.   But luckily in the world of software development there are still many people who are more focused on “how can I express myself totally and completely”.   We are seeing expressive languages, expressive frameworks, tooling that helps you to better express yourself, design techniques that allow you to better express your intent.    I love that stuff! So beware, be very cautious of anyone offering you new age wisdom based on crystals!

    Read the article

  • Could 1 GB of RAM work better than 1.25?

    - by user67082
    This is for a server running Ubuntu Server 10.10. The server is an old desktop PC. It had 2 sticks of 256 MB of 182-pin DDR 400 MHz RAM in it (total 512 MB of RAM). I just ordered a 1 GB stick of compatible RAM for the machine (now would have a total of 1.25 GB of RAM). A friend told me that it might run better if I removed both sticks of 256 MB RAM and used just the 1 GB stick I will be receiving. This seems counterintuitive since then there would only be 1 GB of RAM instead of 1.25; is it possible that it would be better to run with 1 GB or is he totally wrong? Thanks for the help.

    Read the article

  • ubuntu server refusing connections via port forwarding

    - by Matt
    Getting some really weird behavior from our Ubuntu server... it's behind a Verizon router firewall with port forwarding (port 8080 to port 80 on the server), and we've been having issues accessing it via this external IP. From within the network, it appears to respond normally (I can access it via web browser and SSH), but refuses connections through port forwarding (using our static external IP). The strangest thing is that it actually responds to external port-forwarded connections right after being restarted, but quickly lapses back into this pattern of refusing external connections. I'm a bit of a server newbie (I'm actually a programmer in a small startup that just lost their server ops guy, urgh) so this is all trial by fire for me. Does anyone have any advice on what could be going wrong here? Any help would be appreciated, thanks.

    Read the article

  • Does anyone have a valid and working example of OpenLDAP meta backend?

    - by QXT
    I have been Google'ing my fingers off and simply can not find a working example of how to merge/proxy a OpenLDAP server and windows AD server. Have anyone worked with this before? Any suggestions would be appreciated. The idea is simple: openldap.mydomain.local ---- Linux LDAP Server winad.mydomain.local ---- Windows AD Server Some users are one Linux and some on WinAD. OpenLDAP should search both on login. A working example would be appreciated.

    Read the article

  • How to create a new public AMI for windows?

    - by user67081
    I am trying to make a windows 2008 AMI that is a nice clean 64bit starter pack (IIS, SQL express, ASP.NET MVC, etc...) I would like to make it a public AMI when its done. There in lies the problem. I can make an AMI from my image no problem. But I can't seen to get new instances to generate their own passwords.. The results are that I have a new instance that works great with my password. So what is the process of making my EBS backed Instances convert into an AMI that will auto-generate its password and do all the other setup steps that amazon wants to go thru when a new instance starts up? Thanks in advance.

    Read the article

  • Eclipse Helios on OS X Snow Leopard crashes frequently when editing certain PHP files

    - by William
    I use Eclipse Helios (Eclipse Platform: 3.6.0.I20100608-0911, Eclipse IDE for PHP Developers: 1.3.0.20100617-0520) all the time on OS X (Snow Leopard), and it seems I only run into trouble whenever I'm editing a PHP file that's part of the WordPress blogging framework. When I move my cursor to a variable or function name, that often triggers the beach ball of death. I suspect Eclipse is trying to look up that variable/function and for some reason that causes an endless loop. Sometimes it's not just variables or functions. Just today I was trying to replace all occurrences of a quoted string. Every time I clicked "Replace All", the program would freeze immediately after the string was replaced and the text cursor was moved to the replaced position. I think the moving of the text cursor is important, because I got the same result when I searched for the string (thus moving the cursor), but NOT when I searched for a nonexistent string. I tried disabling everything in my preferences related to marked occurrences, hovering, code assistance, etc. Nothing helps. I use Eclipse for all my projects, and I find that it's only WordPress projects where this happens. Here's my eclipse.ini file: -startup ../../../plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar --launcher.library ../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx_1.1.0.v20100503 -product org.eclipse.epp.package.php.product --launcher.defaultAction openFile -showsplash org.eclipse.platform --launcher.XXMaxPermSize 512m --launcher.defaultAction openFile -vmargs -Dosgi.requiredJavaVersion=1.5 -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -XX:PermSize=128m -XX:MaxPermSize=128m -XX:MaxGCPauseMillis=10 -XX:MaxHeapFreeRatio=70 -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CompileThreshold=5 -Xms128m -Xmx512m -Xss2m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -framework ../../../plugins/org.eclipse.osgi.services_3.2.100.v20100503.jar I have 4GB of RAM, so I don't know if the problem is I'm underutilizing my resources. Here's what I see over and over in the error log: !ENTRY org.eclipse.jface 2 0 2011-01-16 16:26:21.533 !MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. !SUBENTRY 1 org.eclipse.jface 2 0 2011-01-16 16:26:21.533 !MESSAGE A conflict occurred for ALT+COMMAND+Q P: Binding(ALT+COMMAND+Q P, ParameterizedCommand(Command(org.eclipse.ui.views.showView,Show View, Shows a particular view, Category(org.eclipse.ui.category.views,Views,Commands for opening views,true), org.eclipse.ui.handlers.ShowViewHandler@2a46d1, [Lorg.eclipse.ui.internal.commands.Parameter;@18f50c2,,true), [Lorg.eclipse.core.commands.Parameterization;@1ff1855), org.eclipse.ui.defaultAcceleratorConfiguration, org.eclipse.ui.contexts.window,,cocoa,system) Binding(ALT+COMMAND+Q P, ParameterizedCommand(Command(org.eclipse.ui.views.showView,Show View, Shows a particular view, Category(org.eclipse.ui.category.views,Views,Commands for opening views,true), org.eclipse.ui.handlers.ShowViewHandler@2a46d1, [Lorg.eclipse.ui.internal.commands.Parameter;@18f50c2,,true), [Lorg.eclipse.core.commands.Parameterization;@96b40c), org.eclipse.ui.defaultAcceleratorConfiguration, org.eclipse.ui.contexts.window,,cocoa,system) !ENTRY org.eclipse.core.net 1 0 2011-01-16 16:26:22.217 !MESSAGE System property http.proxyHost has been set to 127.0.0.1 by an external source. This value will be overwritten using the values from the preferences !ENTRY org.eclipse.core.net 1 0 2011-01-16 16:26:22.217 !MESSAGE System property http.proxyPort has been set to 8888 by an external source. This value will be overwritten using the values from the preferences !ENTRY org.eclipse.core.net 1 0 2011-01-16 16:26:22.218 !MESSAGE System property https.proxyHost has been set to 127.0.0.1 by an external source. This value will be overwritten using the values from the preferences !ENTRY org.eclipse.core.net 1 0 2011-01-16 16:26:22.219 !MESSAGE System property https.proxyPort has been set to 8888 by an external source. This value will be overwritten using the values from the preferences I did some experimenting with the particular script that's giving me trouble. It's a hybrid of HTML and PHP, so Eclipse has to do both HTML and PHP validation. I wondered if the HTML validation had something to do with it, so I created a new file, copied the contents over, and messed with the doctype element. I found that if I replaced the well-formed XHTML 1.0 Strict doctype element with a generic doctype (as such: <!DOCTYPE html>), then I did not crash the program just by moving the cursor around. I set all HTML validation rules to "Ignore", but it still didn't solve my problems. For now, I'm just going to echo the doctype using PHP instead of entering it literally. That seems to prevent crashes. I notice that when I move the cursor around the document, Eclipse displays the "xpath" to my current location at the bottom of the screen. Sometimes there's a delay while it figures out my current path. Perhaps when it's validating against the Strict doctype, it has problems quickly calculating the xpath as I move the cursor around? Maybe it has a stack overflow that causes it to crash.

    Read the article

  • How to change fonts in Kod?

    - by the_great_monkey
    I started using this new text editor called Kod (runs on Mac OS 10.6): http://kodapp.com/ It's very very fast, I'm a poor programmer and I don't have money to pay for TextMate, this might be the closest to TextMate that I've used. (TextMate cost around $50). The problem is.... Where is the preferences window? Where can I set the font size? I need to make it bigger, that's it... Does anyone know how to do that? EDIT: I think they haven't implement them yet... From their discussion in google group.

    Read the article

  • Problems login ubuntu 10.10

    - by siobhan
    I recently change my compiz settings for my cube and upon restarting my pc it first black screened, where it got stuck, on this screen the last command stated that it was checking the battery status, it was like this for hours i finally got thru to the Login screen but it will not accept the password (with i know is correct). I am a novice with Ubuntu but have read and tried everything the forums have told me to do but to no avail.... Please, please, please any help would be greatly appreciated. Many thanks.

    Read the article

  • VirtualBox guest not recognizing daylight savings transition

    - by user41421
    I want to test an app's behaviour during transitions in and out of daylight savings time. I therefore want to be able to set the date and time of a VirtualBox VM, (preferably from the Control Panel applet, but from a batch file is fine) and not have it "corrected" to the host's time for me. I have turned of Internet sync in the guest and that seems to have achieved this, so I wrote a couple of batch files to set the date to a value just prior to the time of transition in and out of daylight savings time. The VirtualBox guest doesn't seem to recognize the daylight savings changeover date - it just marches on past with no change of time, no message (yes - "Adjust clock for daylight savings" is enabled). Any ideas?

    Read the article

  • Notification if SyncToy fails

    - by Joel Coehoorn
    I support a number of laptop users. In the past (before there were many laptops), each user's computer was set up so that their My Documents folder was mapped to a shared folder on the server. This worked very well for desktops, but has several obvious downsides for laptops (no files when you're off-site, etc). I'm exploring several alternatives for laptops to better map the shared drives, and SyncToy seems the best so far. I have a couple trial users set up so that it syncs automatically whenever they log in, along with a desktop icon they can click if they know they'll need something saved before the next login. My problem is that I'm concerned how I, as the maintainer of this system, can spot failures. I don't want my first indication of a problem to come after a user drops their laptop in a lake and it turns out nothing was synced for the last year. Any ideas?

    Read the article

  • Page File - Why set one for each drive?

    - by Magic
    Hello, I have Windows Vista Business Edition running on my laptop (brand is HCL). I have 4 HDD which are as follows - C - 29.2 GB (of which only 3.68 GB is free) D - 39 GB (of which 37.8 GB is free) E - 39 GB (of which 37.3 GB is free) F - 41.6 (of which 41.4 GB is free) However, my page file settings are as below. Automatically manage paging file for all drives. Question - Why should I set one for each drive? Should I set my page file on the OS Root Drive. I happen to talk to a System Administrator in an IT company and he advised that we should never set the page file on the OS drive but on an alternate drive wherever possible. It would be really helpful, if you can guide me here or at least point me to the right resources so that I can read about paging and best practices of paging. Cheers,

    Read the article

  • Ubuntu Cannot change permissions on files I own and have RW to.

    - by madmaze
    Hello there, I have a harddrive full of backups which for me is mounted at /media/chronus_ I have been trying to give another user rw permission to this drive. The problem is that I cannot change any permissions on this drive, even if i make a new file it puts sets everything to -rw------- here is an excerpt of what i have tried: madmaze@the-gibson:~$ touch testfile madmaze@the-gibson:~$ ls -l testfile -rw-r--r-- 1 madmaze madmaze 0 2011-01-16 20:11 testfile madmaze@the-gibson:~$ chmod 777 testfile madmaze@the-gibson:~$ ls -l testfile -rwxrwxrwx 1 madmaze madmaze 0 2011-01-16 20:11 testfile madmaze@the-gibson:~$ cd /media/chronos_/Pix/ madmaze@the-gibson:/media/chronos_/Pix$ ls -l total 4100 -rw------- 1 madmaze madmaze 28226 2011-01-16 20:18 avp.jpg -rw------- 1 madmaze madmaze 5764 2011-01-16 20:18 avpsmall.jpg -rw------- 1 madmaze madmaze 98414 2011-01-16 20:18 john.jpg -rw------- 1 madmaze madmaze 98785 2011-01-16 20:18 lisa.jpg -rw------- 1 madmaze madmaze 3954281 2011-01-16 20:18 peter.jpg madmaze@the-gibson:/media/chronos_/Pix$ chmod 777 *.jpg madmaze@the-gibson:/media/chronos_/Pix$ ls -l total 4100 -rw------- 1 madmaze madmaze 28226 2011-01-16 20:18 avp.jpg -rw------- 1 madmaze madmaze 5764 2011-01-16 20:18 avpsmall.jpg -rw------- 1 madmaze madmaze 98414 2011-01-16 20:18 john.jpg -rw------- 1 madmaze madmaze 98785 2011-01-16 20:18 lisa.jpg -rw------- 1 madmaze madmaze 3954281 2011-01-16 20:18 peter.jpg madmaze@the-gibson:/media/chronos_/Pix$ sudo chmod 777 *.jpg madmaze@the-gibson:/media/chronos_/Pix$ ls -l total 4100 -rw------- 1 madmaze madmaze 28226 2011-01-16 20:18 avp.jpg -rw------- 1 madmaze madmaze 5764 2011-01-16 20:18 avpsmall.jpg -rw------- 1 madmaze madmaze 98414 2011-01-16 20:18 john.jpg -rw------- 1 madmaze madmaze 98785 2011-01-16 20:18 lisa.jpg -rw------- 1 madmaze madmaze 3954281 2011-01-16 20:18 peter.jpg madmaze@the-gibson:/media/chronos_/Pix$ touch testfile madmaze@the-gibson:/media/chronos_/Pix$ ls -l testfile -rw------- 1 madmaze madmaze 0 2011-01-16 20:25 testfile madmaze@the-gibson:/media/chronos_/Pix$ chmod 777 testfile madmaze@the-gibson:/media/chronos_/Pix$ ls -l testfile -rw------- 1 madmaze madmaze 0 2011-01-16 20:25 testfile madmaze@the-gibson:/media/chronos_/Pix$ Any Ideas what I could be doing wrongly?

    Read the article

  • How can fix HDMI HDTV overscan when I my TV has no aspect ratio setting?

    - by Colin Dean
    I have a 32" Vizio HDTV. It's a few years old, but running well. I just connected a new nettop to it using HDMI out. It's the Intel 3x00 graphics chipset. I'm seeing overscan, where the resolution in Ubuntu is set to 1280x720, but the TV itself is 1366x768. When I go into the Monitors control applet, I cannot change the resolution to anything other than the current or 640x480. A user had a similar overscan problem, but fixed the overscan by adjusting his TV's aspect ratio settings. I do not have that luxury. Is there a way I can do this without having to delve into xorg.conf or other command-line craziness? I'm more than comfortable doing so, but there must be a cleaner way. I'm running Ubuntu Natty, keeping up with updates and such. Here's the output of lspci: colin@bricktop:~$ lspci 00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 12) 00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 12) 00:04.0 Signal processing controller: Intel Corporation Core Processor Thermal Management Controller (rev 12) 00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06) 00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06) 00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06) 00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06) 00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 (rev 06) 00:1c.2 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 3 (rev 06) 00:1d.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a6) 00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 06) 00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 4 port SATA AHCI Controller (rev 06) 00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 06) 00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 06) 01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06) 02:00.0 USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 03) 03:00.0 Network controller: Atheros Communications Inc. AR9287 Wireless Network Adapter (PCI-Express) (rev 01)

    Read the article

  • Use tab bar inconjuction with navigation bar?

    - by bipolarpants
    Hello, I'm brand new to Objective C programing for the Iphone. I was wondering if it is possible to use a tab bar, and in one of the tabs have a navigation bar so that I could drill down? I tried to look for tutorials and found this one http://www.devx.com/wireless/Article/45161/1954, I got it to work as written but I couldn't figure out to display the data I wanted. Does anyone know how? or does anyone know a tutorial for complete beginners?

    Read the article

  • MVC Implementation PHP Zend PDF generation

    - by zod
    Am using Zend framework and PHP Am going to generate a PDF using Zend . So the View is PDF.There is no PHTML. But if i dont use PHTML in view , is it a perfect MVC? if i want to be a perfect MVC shall i do the db retrieval and variable declaration and assigning in controller and use view and use all pdf functions in view phtml file will it make a perfect MVC? What is the advantage of MVC in this case? :-) can i do the include of zend pdf in phtml file or controller php file? what is the difference ?

    Read the article

  • Slideshow positioning problem

    - by James
    I have a javascript slideshow that works perfectly on Windows 7, Firefox, Chrome, IE 8+ (I don't have the resources to check 6 or 7) and Opera. But I've been told that when on xp with IE 7 the slidshow gets thrown off screen to the right. What could my issue be? Here is my css: #page { width:940px; margin: auto; } gallery { position:relative; padding:0px; margin:5px 0px; width:940px; height:320px; } gallery li { display: block; width:940px; height:320 list-style:none; } And here is my javascript: var galleryId = 'gallery'; var gallery; var galleryImages; var currentImage; var previousImage; var preInitTimer; preInit(); function preInit() { if ((document.getElementById)&&(gallery=document.getElementById(galleryId))) { gallery.style.visibility = "hidden"; if (typeof preInitTimer != 'undefined') clearTimeout(preInitTimer); } else { preInitTimer = setTimeout("preInit()",2); } } function fader(imageNumber,opacity) { var obj=galleryImages[imageNumber]; if (obj.style) { if (obj.style.MozOpacity!=null) { obj.style.MozOpacity = (opacity/100) - .001; } else if (obj.style.opacity!=null) { obj.style.opacity = (opacity/100) - .001; } else if (obj.style.filter!=null) { obj.style.filter = "alpha(opacity="+opacity+")"; } } } function fadeInit() { if (document.getElementById) { preInit(); galleryImages = new Array; var node = gallery.firstChild; while (node) { if (node.nodeType==1) { galleryImages.push(node); } node = node.nextSibling; } for(i=0;i galleryImages[i].style.position='absolute'; galleryImages[i].style.top=0; galleryImages[i].style.zIndex=0; fader(i,0); } gallery.style.visibility = 'visible'; currentImage=0; previousImage=galleryImages.length-1; opacity=100; fader(currentImage,100); window.setTimeout("crossfade(100)", 1000); } } function crossfade(opacity) { if (opacity < 100) { fader(currentImage,opacity); opacity += 9; window.setTimeout("crossfade("+opacity+")", 50); } else { fader(previousImage,0); previousImage=currentImage; currentImage+=1; if (currentImage=galleryImages.length) { currentImage=0; } galleryImages[previousImage].style.zIndex = 0; galleryImages[currentImage].style.zIndex = 100; opacity=0; window.setTimeout("crossfade("+opacity+")", 5000); } } addEvent(window,'load',fadeInit) function addEvent(elm, evType, fn, useCapture) { if (elm.addEventListener){ elm.addEventListener(evType, fn, useCapture); return true; } else if (elm.attachEvent){ var r = elm.attachEvent("on"+evType, fn); return r; } } And ideas?

    Read the article

  • Form Security (discussion)

    - by Eray Alakese
    I'm asking for brain storming and sharing experience. Which method you are using for form submiting security ? For example , for block automatically sended POST or GET datas, i'm using this method : // Generating random string <?php $hidden = substr(md5(microtime()) ,"-5"); ?> <form action="post.php" .... // assing this random string to a hidden input <input type="hidden" value="<?php echo $hidden;" name="secCode> // and then put this random string to a session variable $_SESSION["secCode"] = $hidden; **post.php** if ($_POST["secCode"] != $_SESSION["secCode"]) { die("You have to send this form, on our web site"); }

    Read the article

  • [Java] Safe way of exposing keySet().

    - by Jake
    This must be a fairly common occurrence where I have a map and wish to thread-safely expose its key set: public MyClass { Map<String,String> map = // ... public final Set<String> keys() { // returns key set } } Now, if my "map" is not thread-safe, this is not safe: public final Set<String> keys() { return map.keySet(); } And neither is: public final Set<String> keys() { return Collections.unmodifiableSet(map.keySet()); } So I need to create a copy, such as: public final Set<String> keys() { return new HashSet(map.keySet()); } However, this doesn't seem safe either because that constructor traverses the elements of the parameter and add()s them. So while this copying is going on, a ConcurrentModificationException can happen. So then: public final Set<String> keys() { synchronized(map) { return new HashSet(map.keySet()); } } seems like the solution. Does this look right?

    Read the article

  • How to reference var from frame on timeline in an object class

    - by brybam
    I'm using Flash Professional cs5/AS3 I'll try and describe this the best I can. I'm new to ActionScript. So, in my timeline I have a var on a frame that represents "lives" and i have some code in the timeline that takes down the number of lives depending on certain events, which all works great. so, now i wanted to make a constructor class that I could reuse for a bunch of movie clip objects and I only want these objects to be able to move if the lives variable is greater than certain number. So now, building my constructor class for these objects i just wanted put an if statement that is looking to see if the lives are greater than a certain number, which if it is then should make these objects do what i want...But, when i run the project I get "1120: Access of undefined property lives." lives is the var I made obviously like I said, and it works fine being referenced everyone else except when I make a new .as file for these objects then try and reference it. I get the same error when I try and establish "lives" in the main project class too. I'm not sure where I should put this var or how I can make it so i can reference it from an object class. I'm not really sure how to word or describe my issue which has made it hard to search for a tutorial. Any suggestions i'm sure this has to be a simple task.

    Read the article

  • Deserialize json with json.net c#

    - by 76mel
    Hi, am new to Json so a little green. I have a Rest Based Service that returns a json string; {"treeNode":[{"id":"U-2905","pid":"R","userId":"2905"}, {"id":"U-2905","pid":"R","userId":"2905"}]} I have been playing with the Json.net and trying to Deserialize the string into Objects etc. I wrote an extention method to help. public static T DeserializeFromJSON<T>(this Stream jsonStream, Type objectType) { T result; using (StreamReader reader = new StreamReader(jsonStream)) { JsonSerializer serializer = new JsonSerializer(); try { result = (T)serializer.Deserialize(reader, objectType); } catch (Exception e) { throw; } } return result; } I was expecting an array of treeNode[] objects. But its seems that I can only deserialize correctly if treeNode[] property of another object. public class treeNode { public string id { get; set; } public string pid { get; set; } public string userId { get; set; } } I there a way to to just get an straight array from the deserialization ? Cheers

    Read the article

  • In Android GUI flickers when reading the properties file

    - by ManojValiveti
    Hi, I am getting the GUI flicker when reading a file properties and accordingly enabling/disabling checkbox and List value in listbox. when i remove this file reading code the GUI doesnt have flicker. I am reading the properties before creating the Preferences in OnCreate(). Attached the file write code below for reference.Please let us know is there any other way to read and update the preference staus. private void SetExtendConf(String key, String strValue) { mProperties = new Properties(); try { File file = new File(FILE_EXT); if(!file.exists()) file.createNewFile(); file.setWritable(true,false); FileInputStream fis = new FileInputStream(file); mProperties.load(fis); fis.close(); FileOutputStream stream = new FileOutputStream(file); Log.d(TAG, "Setting Values " + key + ":"+ strValue); mProperties.setProperty(key, strValue); mProperties.store(stream,"ext.conf"); stream.close(); } catch (IOException e) { Log.d(TAG, "Could not open properties file: " + GPS_FILE_EXT); } } -Manoj

    Read the article

  • Shaping EF LINQ Query Results Using Multi-Table Includes

    - by sisdog
    I have a simple LINQ EF query below using the method syntax. I'm using my Include statement to join four tables: Event and Doc are the two main tables, EventDoc is a many-to-many link table, and DocUsage is a lookup table. My challenge is that I'd like to shape my results by only selecting specific columns from each of the four tables. But, the compiler is giving a compiler is giving me the following error: 'System.Data.Objects.DataClasses.EntityCollection does not contain a definition for "Doc' and no extension method 'Doc' accepting a first argument of type 'System.Data.Objects.DataClasses.EntityCollection' could be found. I'm sure this is something easy but I'm not figuring it out. I haven't been able to find an example of someone using the multi-table include but also shaping the projection. Thx,Mark var qry= context.Event .Include("EventDoc.Doc.DocUsage") .Select(n => new { n.EventDate, n.EventDoc.Doc.Filename, //<=COMPILER ERROR HERE n.EventDoc.Doc.DocUsage.Usage }) .ToList(); EventDoc ed; Doc d = ed.Doc; //<=NO COMPILER ERROR SO I KNOW MY MODEL'S CORRECT DocUsage du = d.DocUsage;

    Read the article

  • jsp in javascript

    - by Pavalesh
    hi I've created a jsp page. In that when i select 1 check-box or both check-box or none, the corresponding text-boxes and list-box must be displayed in the same page. For that i tried of calling a javascipt function when i click the checkbox. The javascript function contain code to display the textboxes. But it didn't work. Since I'm doing this project in struts, I don't know how to get check-box value. And calling of JavaScript function works. But didn't enter into jsp code in JavaScript function.

    Read the article

  • Creating a User Registration Page using MongoEngine

    - by Drew Watkins
    I am currently working an a webapp, using mongoengine and django, which will require users to create an account from a registration page. I know MongoEngine has an authentication backend, but does it also include a registration form, etc..., like django itself does? If not, are there any example projects which show how to implement this? The only open-source mongoengine project I've found is django-mumblr, but I can't find the examples I want in it. I'm not interested in alternative options, such as MongoKit or mango for handling authentication. I am just getting started with django and mongoDB, so please excuse my lack of knowledge. Thanks in advance for the help!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >