Daily Archives

Articles indexed Wednesday April 11 2012

Page 7/17 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • If-else statement comments [closed]

    - by Jin35
    Possible Duplicate: What is a good way to comment if-else-clauses? What is the best way to write comments for if-else statement? There is possible ways: A. //first comment if (condition) { ... } //second comment else { ... } B. if (condition) { //first comment ... } else { //second comment ... } C. if (condition) { //first comment ... } else { //second comment ... } Which one is the best, or there is some better possibilities?

    Read the article

  • How do I start VNC Server on boot?

    - by broiyan
    How do I create a system-wide autostart file? This would be on a cloud server running the desktop version of Maverick. I logged in as root and created an autostart file using System/Preferences/StartupApplications but it ended up in /root/.config/autostart and did not execute (as far as I can tell) upon rebooting. The autostart file is to invoke a bash script that invokes the VNC server. I copied the .desktop autostart file from /root/.config/autostart to /etc/xdg/autostart and rebooted. This did not seem to make a difference.

    Read the article

  • How do you completely reset monitor configuration (e.g. what used to be dpkg-reconfigure xserver-xorg)?

    - by John
    Using unity 11.04. I have a secondary monitor (actually two, one at home, one at work). The home twin monitor set up works perfect (Viewsonic monitor). At work, I get very buggy behaviour, such as full screen applications 'ghosting' when maximized, and other strange effects. I would like to try and completely reset the monitor configurations (not unity or compiz), before doing anything else. In 10.10 this would be accomplished: dpkg-reconfigure xserver-xorg

    Read the article

  • Placing newly opened windows while having a window maximized?

    - by Wauzl
    I'm often working in a maximized window from which I'm opening new windows, that do not appear maximized. They are placed at the very top at the desktop in the way that I can not see the upper window decoration. The upper dock of the maximized window is in front of it. This is very unhandy, because I can not easily close or move the newly opened window. Is there a way to fix this behaviour? I played around with the Place Windows plugin in compiz but it didn't work at all. Greetings, Wauzl

    Read the article

  • Use Network-Manager to Connect to a wifi Access Point on the command-line

    - by Stefano Palazzo
    I'd like to connect to a wireless access point from the command-line. ideally, I'd only need the name of the AP. But the hardware-address would work as well. I know I can use nmcli to connect to a managed network connection, but in my case, the access point may not be configured for Network-Manager yet (See the difference between the output of nm-tool and nmcli con). Example output of nmcli: Auto pwln 3a3d62b1-bbdf-4f76-b4d2-c211fd5cfb03 802-11-wireless [...] Wired Network aa586921-accf-4932-98c4-c873c310f08e 802-3-ethernet [...] Cisco-UDP Uni 7f94847b-04dc-40b7-9955-5246fb77cc65 vpn [...] T-mobile (D1) 867f345a-cbbf-4bd4-b883-a5e5ae0932f0 gsm [...] Example output of nm-tool: State: connected - Device: eth1 [Auto pwln] ---------------------------------------------------- [...] Wireless Access Points (* = current AP) *pwln: Infra, [...], Freq 2472 MHz, Rate 54 Mb/s, Strength 80 WPA WPA2 WLAN: Infra, [...], Freq 2422 MHz, Rate 54 Mb/s, Strength 20 WPA WPA2 [...] How do I connect to an access point that may or may not be known to NM? Extra: Finding out if the connection needs a pass-phrase, and submitting it on the command-line as well would be great too (that is to say It'd be nice if network-manager wouldn't pop open any keyring dialogues or errors on the gui)

    Read the article

  • Dual nVidia GPUs (3 monitors) not working in 11.10

    - by jasonmclose
    after searching I have not found a solution. I have 2 nvidia quadro 295 cards with 3 monitors but I can not extend twinview across multiple GPUs. I have the most recent nvidia proprietary drivers installed, and they work fine for the single GPU / dual monitors. I tried using xinerama, but without success. I don't mind switching to the nouveau drivers if that would handle my multiple monitors, although I would like to continue to use unity and compiz if i can).

    Read the article

  • How do I get wireless and video working on a Sony Vaio vpc-z21x9r

    - by Alex
    OS: Ubuntu 11.10 Kernel: 2.6.37.6 Laptop: sony vaio vpc-z21x9r The problem: I can't change level of screen backlight; also can't enable wi-fi. While using 3.0 kernel everything is ok, but the laptop discharges too quickly. Results for lspci 02:00.0 Network controller: Intel Corporation Centrino Wireless-N + WiMAX 6150 (rev 5f) VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) there is no wlan0 in ifconfig -a too. I've fount that kernel should already have drivers for this graphics controller, but when i load up in restore mode, it writes "fall" while trying to load up some video drivers. To change the level of backlight i've alrady tried: xbacklight -set XX , smartdimmer -s XX and got this init_ nvclock() failed! also sudo setpci -s 00:02.0 F4.B=XX with no results. As for wi-fi, i've found driver but i don't understand how to install it. Here it is How can I fix these problems? Thank you for your help and time! Also tried to fix problems with backlight writing GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset acpi_backlight=vendor Still no results. Is there any sense in recompiling kernel, I mean 2.6.37.6. Can it make any improvements in the situation?

    Read the article

  • Inconsistency between date-time in terminal and clock

    - by Franck
    I can't figure out why I have 5 hours difference between GUI clock and date command in terminal. My bios clock is set to GMT... Any ideas ? franck@franck-ThinkPad-T61:~$ date mercredi 11 avril 2012, 02:48:47 (UTC-0500) franck@franck-ThinkPad-T61:~$ sudo dpkg-reconfigure tzdata Current default time zone: 'Europe/Paris' Local time is now: Wed Apr 11 09:49:02 CEST 2012. Universal Time is now: Wed Apr 11 07:49:02 UTC 2012. franck@franck-ThinkPad-T61:~$ tail /etc/timezone Europe/Paris franck@franck-ThinkPad-T61:~$ date mercredi 11 avril 2012, 02:49:21 (UTC-0500) franck@franck-ThinkPad-T61:~$ sudo dpkg-reconfigure --frontend noninteractive tzdata Current default time zone: 'Europe/Paris' Local time is now: Wed Apr 11 09:49:27 CEST 2012. Universal Time is now: Wed Apr 11 07:49:27 UTC 2012. franck@franck-ThinkPad-T61:~$ date mercredi 11 avril 2012, 02:49:30 (UTC-0500) franck@franck-ThinkPad-T61:~$ sudo cat /etc/default/rcS # # /etc/default/rcS # # Default settings for the scripts in /etc/rcS.d/ # # For information about these variables see the rcS(5) manual page. # # This file belongs to the "initscripts" package. TMPTIME=0 SULOGIN=no DELAYLOGIN=no UTC=yes VERBOSE=no FSCKFIX=no franck@franck-ThinkPad-T61:~$ sudo hwclock --show mer. 11 avril 2012 07:49:48 CDT -0.555705 secondes

    Read the article

  • Help with ubuntu 11 mis-displays

    - by Alfa9Dev
    So, I sea This tutorial, and I exectued this line in my terminal : sudo add-apt-repository ppa:lubuntu-desktop/ppa & sudo apt-get install lubuntu-desktop and my left-side panel changed abit, while the Dash Home changed to become like so : http://i43.tinypic.com/2vuc0lj.png ! help ! How can I change to the ubuntu default style or ppa ! because whene I run this : sudo add-apt-repository ppa:ubuntu-desktop/ppa it gives me the follwing notice : gpg: requesting key A1231595 from hkp server keyserver.ubuntu.com gpg: key A1231595: "Launchpad PPA for Ubuntu Desktop" not changed gpg: Total number processed: 1 gpg: unchanged: 1 does this mean that the ubuntu ppa isn't changed or what ?? Please, help any help would very appreciated :)

    Read the article

  • gnome-file-share-properties doesn't work

    - by Riccardo Magrini
    I've configured gnome-file-share-properties on all my Ubuntu's PC for sharing the directory Public to each other. I following some guide found on Internet for the configuration of it, all explain the same procedure but in my case I don't see any Public directory shared with the PC. Following this link http://library.gnome.org/users/gnome-user-share/stable/gnome-user-share-getting-started.html.en I'd see the directory Public plus the name of PC that shares its directory on Nautilus Places. In my case I don't see anything, therefore on the Network place see all the machines 'n if I try to click on one receive this: "DBus error org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus)" note: I don't want to use Samba because I've all Ubuntu PC, and the firewall is disabled on all PC.

    Read the article

  • Multiple country-specific domains or one global domain [closed]

    - by CJM
    Possible Duplicate: How should I structure my urls for both SEO and localization? My company currently has its main (English) site on a .com domain with a .co.uk alias. In addition, we have separate sites for certain other countries - these are also hosted in the UK but are distinct sites with a country-specific domain names (.de, .fr, .se, .es), and the sites have differing amounts of distinct but overlapping content, For example, the .es site is entirely in Spanish and has a page for every section of the UK site but little else. Whereas the .de site has much more content (but still less than the UK site), in German, and geared towards our business focus in that country. The main point is that the content in the additional sites is a subset of the UK, is translated into the local language, and although sometimes is simply only a translated version of UK content, it is usually 'tweaked' for the local market, and in certain areas, contains unique content. The other sites get a fraction of the traffic of the UK site. This is perfectly understandable since the biggest chunk of work comes from the UK, and we've been established here for over 30 years. However, we are wanting to build up our overseas business and part of that is building up our websites to support this. The Question: I posed a suggestion to the business that we might consider consolidating all our websites onto the .com domain but with /en/de/fr/se/etc sections, as plenty of other companies seem to do. The theory was that the non-english sites would benefit from the greater reputation of the parent .com domain, and that all the content would be mutually supporting - my fear is that the child domains on their own are too small to compete on their own compared to competitors who are established in these countries. Speaking to an SEO consultant from my hosting company, he feels that this move would have some benefit (for the reasons mentioned), but they would likely be significantly outweighed by the loss of the benefits of localised domains. Specifically, he said that since the Panda update, and particularly the two sets of changes this year, that we would lose more than we would gain. Having done some Panda research since, I've had my eyes opened on many issues, but curiously I haven't come across much that mentions localised domain names, though I do question whether Google would see it as duplicated content. It's not that I disagree with the consultant, I just want to know more before I make recommendations to my company. What is the prevailing opinion in this case? Would I gain anything from consolidating country-specific content onto one domain? Would Google see this as duplicate content? Would there be an even greater penalty from the loss of country-specific domains? And is there anything else I can do to help support the smaller, country-specific domains?

    Read the article

  • How to prevent access to website without SSL connection?

    - by CraigJ
    I have a website that has an SSL certificate installed, so that if I access the website using https instead of http I will be able to connect using a secure connection. However, I have noticed that I can still access the website non-securely, ie. by using http instead of https. How can I prevent people using the website in a non-secure manner? If I have a directory on the website, eg. samples/, can I prevent non-secure connections to just this directory?

    Read the article

  • Dynamic content realoding

    - by Kikaimaru
    Is there a relatively simple way to dynamicaly reload content files? (ie: effect files) I know i can do following: Detect change of file Run content pipeline to rebuild that specific file Unload ALL content that was loaded Load All content And use double references to reference content files. Problem is with step 3 (and step 2 isn't that nice too). But i need to unload everything because if i have model Hero.x which references Model.fx effect, and i change Model.fx file, i need to reload Hero.x file which will then call LoadExternalReference on Model.fx. So I guess question is, did someone mange to make this work without rewriting whole ContentManager (and every ContentReader) and tracking calls to LoadExternalReference?

    Read the article

  • Which opcodes are faster at the CPU level?

    - by Geotarget
    In every programming language there are sets of opcodes that are recommended over others. I've tried to list them here, in order of speed. Bitwise Integer Addition / Subtraction Integer Multiplication / Division Comparison Control flow Float Addition / Subtraction Float Multiplication / Division Where you need high-performance code, C++ can be hand optimized in assembly, to use SIMD instructions or more efficient control flow, data types, etc. So I'm trying to understand if the data type (int32 / float32 / float64) or the operation used (*, +, &) affects performance at the CPU level. Is a single multiply slower on the CPU than an addition? In MCU theory you learn that speed of opcodes is determined by the number of CPU cycles it takes to execute. So does it mean that multiply takes 4 cycles and add takes 2? Exactly what are the speed characteristics of the basic math and control flow opcodes? If two opcodes take the same number of cycles to execute, then both can be used interchangeably without any performance gain / loss? Any other technical details you can share regarding x86 CPU performance is appreciated

    Read the article

  • How are buttons made to be clicked?

    - by Johnny
    I just want to ask a general question. According to that answer, Ill continue thinking. You know in games there are lots of clickable items. Play button, exit, comboboxes maybe etc. My question is are those buttons drawn in same canvas with background and all other things, or for every different thing there is another canvas object? My question is about for general. Im not asking about a specific game, im asking how they are made generally. Im planning to start a game on Android, and Im confused actually how to design buttons, and other object. Probably Im going to use View/SurfaceView for now. I don't have much experience with OpenGL yet. Thanks in advance.

    Read the article

  • Are there some methodologies to define a game's rules?

    - by bAN
    I would like to write some rules for a game I have in head but I don't know how to do that. So are there some methodologies or modeling tools (like UML) to do that? I'm thinking about a kind of tree of competencies or some kind of map to be sure that the game is well balanced. I always wonder how the team who imagines some powers in magic the gathering for example does it. Do they have some diagrams to be sure the powers or creatures they imagine are well balanced for the entire game? I'm pretty noob in the game creation so I'll be happy with some directions to seek.. Technical terms or basic principles to learn. Thanks for help.

    Read the article

  • Tower defence game poison tower in fieldrunners dynamics

    - by Syed Ali Haider Abidi
    I had made a 2d tower defence game in unity3d.done all the pathfinder tower upgrading cash stuff.now the dynamics. can one help me in making the dynamics of the paint tower..please remember as its a 2d game so i am working on spritesheets. This tower is more likely poison tower in fieldrunners.fow now i have only one image which follows the enemy but it remains the same but in fieldrunners its more realistic.it changes its direction when the enemies are on different angles.

    Read the article

  • How can I make this method more Scalalicious

    - by Neil Chambers
    I have a function that calculates the left and right node values for some collection of treeNodes given a simple node.id, node.parentId association. It's very simple and works well enough...but, well, I am wondering if there is a more idiomatic approach. Specifically is there a way to track the left/right values without using some externally tracked value but still keep the tasty recursion. /* * A tree node */ case class TreeNode(val id:String, val parentId: String){ var left: Int = 0 var right: Int = 0 } /* * a method to compute the left/right node values */ def walktree(node: TreeNode) = { /* * increment state for the inner function */ var c = 0 /* * A method to set the increment state */ def increment = { c+=1; c } // poo /* * the tasty inner method * treeNodes is a List[TreeNode] */ def walk(node: TreeNode): Unit = { node.left = increment /* * recurse on all direct descendants */ treeNodes filter( _.parentId == node.id) foreach (walk(_)) node.right = increment } walk(node) } walktree(someRootNode) Edit - The list of nodes is taken from a database. Pulling the nodes into a proper tree would take too much time. I am pulling a flat list into memory and all I have is an association via node id's as pertains to parents and children. Adding left/right node values allows me to get a snapshop of all children (and childrens children) with a single SQL query. The calculation needs to run very quickly in order to maintain data integrity should parent-child associations change (which they do very frequently). In addition to using the awesome Scala collections I've also boosted speed by using parallel processing for some pre/post filtering on the tree nodes. I wanted to find a more idiomatic way of tracking the left/right node values. After looking at the answers listed I have settled on this synthesised version: def walktree(node: TreeNode) = { def walk(node: TreeNode, counter: Int): Int = { node.left = counter node.right = treeNodes .filter( _.parentId == node.id) .foldLeft(counter+1) { (counter, curnode) => walk(curnode, counter) + 1 } node.right } walk(node,1) }

    Read the article

  • c# list<int> how to insert a new value in between two values

    - by gdubs
    so i have a list where i need to add new values constantly but when i do i need to increment it and insert it in between two values. List<int> initializers = new List <int>(); initializers.Add(1); initializers.Add(3); so initializers would have 1, 3 values. i would then process a new set of numbers. the initializers will need to have the values. 1, 5, 3, 7 and if i process another set of numbers it should become 1, 9, 5, 13, 3, 11, 7, 15 i know how to properly generate the new values inserted, i just need some help on inserting it in between the existing values of the initializers without having to add 2 or 3 more loops to move the values' positions.

    Read the article

  • Get the value of an attribute Jquery

    - by Abu Hamzah
    i am trying to get EmployeeId withitn the DOM something like this: var o = obj[$(this).attr("EmployeeId")]; but getting undefined when i debug i see the following: $(this)[0].data data "{EmployeeId: 'A42345'}" here is my source code: $.ajax({ type: "POST", url: url, data: "{EmployeeId: '" + id + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) { var obj = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d; var o = obj[$(this).attr("EmployeeId")]; //<<<<undefined

    Read the article

  • Scrum: What if the Product Owner has tasks?

    - by Lauren J
    I have just started working with a team that has picked up some aspects of Scrum (two week timeboxing) but not others (the team does not currently agree to all estimates or to the number of points in a sprint, but I'll change this soon.) The product owner is also a technical resource (scientist) with some development background. Is it appropriate to have the product owner's tasks (which mostly involve research) mixed in with the team's tasks (some of which are research and some development). I have looked at a lot of resources and not found an answer. Thanks!

    Read the article

  • Highstock Chrome/Firefox/Opera

    - by Matthias
    Is there any particular reason that this HighStock chart: var chart; $(function() { chart = new Highcharts.StockChart({ chart: { renderTo: 'container' }, title: { text: 'Total balance over time' }, xAxis: { type: 'datetime', maxZoom: 7 * 24 * 3600000, // one week title: { text: null } }, yAxis: { title: { text: 'Balance' }, startOnTick: false, showFirstLabel: false }, tooltip: { shared: true }, series: [{ type: 'area', name: 'Account balance', pointInterval: 14 * 3600 * 1000, pointStart: Date.UTC(2012, 3, 11), data: [ 0.7809, 0.7827, 0.7848, 0.785, 0.7873, 0.7894, 0.7907, 0.7909, 0.7947, 0.7987, 0.799, 0.7927, 0.79, 0.7878, 0.7878, 0.7907, 0.7922, 0.7937, 0.786, 0.787, 0.7838, 0.7838, 0.7837, 0.7836, 0.7806, 0.7825, 0.7798, 0.777, 0.777, 0.7772, 0.7793, 0.7788, 0.7785, 0.7832, 0.7865, 0.7865, 0.7853, 0.7847, 0.7809, 0.778, 0.7799, 0.78, 0.7801, 0.7765, 0.7785, 0.7811, 0.782, 0.7835, 0.7845, 0.7844, 0.782, 0.7811, 0.7795, 0.7794, 0.7806, 0.7794, 0.7794, 0.7778, 0.7793, 0.7808, 0.7824, 0.787, 0.7894, 0.7893, 0.7882, 0.7871, 0.7882, 0.7871, 0.7878, 0.79, 0.7901, 0.7898, 0.7879, 0.7886, 0.7858, 0.7814, 0.7825, 0.7826, 0.7826, 0.786, 0.7878, 0.7868, 0.7883, 0.7893, 0.7892, 0.7876, 0.785, 0.787, 0.7873, 0.7901, 0.7936, 0.7939, 0.7938, 0.7956, 0.7975, 0.7978, 0.7972, 0.7995, 0.7995 ] }] }); }); is rendered without any problems in Opera, but not working in Chrome or Firefox? I'm also using some HighChart pie charts. Those are rendered without any issues on all browsers. All of the demos on the HighStock Demo Gallery are working without problems.

    Read the article

  • How can I limit the cache used by copying so there is still memory available for other cache?

    - by Peter
    Basic situation: I am copying some NTFS disks in openSuSE. Each one is 2TB. When I do this, the system runs slow. My guesses: I believe it is likely due to caching. Linux decides to discard useful cache (eg. kde4 bloat, virtual machine disks, LibreOffice binaries, Thunderbird binaries, etc.) and instead fill all available memory (24 GB total) with stuff from the copying disks, which will be read only once, then written and never used again. So then any time I use these apps (or kde4), the disk needs to be read again, and reading the bloat off the disk again makes things freeze/hiccup. Due to the cache being gone and the fact that these bloated applications need lots of cache, this makes the system horribly slow. Since it is USB,the disk and disk controller are not the bottleneck, so using ionice does not make it faster. I believe it is the cache rather than just the motherboard going too slow, because if I stop everything copying, it still runs choppy for a while until it recaches everything. And if I restart the copying, it takes a minute before it is choppy again. But also, I can limit it to around 40 MB/s, and it runs faster again (not because it has the right things cached, but because the motherboard busses have lots of extra bandwidth for the system disks). I can fully accept a performance loss from my motherboard's IO capability being completely consumed (which is 100% used, meaning 0% wasted power which makes me happy), but I can't accept that this caching mechanism performs so terribly in this specific use case. # free total used free shared buffers cached Mem: 24731556 24531876 199680 0 8834056 12998916 -/+ buffers/cache: 2698904 22032652 Swap: 4194300 24764 4169536 I also tried the same thing on Ubuntu, which causes a total system hang instead. ;) And to clarify, I am not asking how to leave memory free for the "system", but for "cache". I know that cache memory is automatically given back to the system when needed, but my problem is that it is not reserved for caching of specific things. Question: Is there some way to tell these copy operations to limit memory usage so some important things remain cached, and therefore any slowdowns are a result of normal disk usage and not rereading the same commonly used files? For example, is there a setting of max memory per process/user/file system allowed to be used as cache/buffers?

    Read the article

  • Check to see if CallResponder is processing

    - by Travesty3
    I'm using Flash Builder 4.6. As a simple example, say I have the following application: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:sdk="services.sdk.*"> <fx:Script> <![CDATA[ private function btnGetValue_clickHandler():void { getValueResult.token = sdk.getValue(); } private function getValueResultHandler():void { // ... } ]]> </fx:Script> <fx:Declarations> <sdk:SDK id="sdk" fault="{Alert.show(event.fault.faultString +'\n\n'+ event.fault.faultDetail, 'SDK ERROR');}" showBusyCursor="false"/> <s:CallResponder id="getValueResult" result="getValueResultHandler()"/> </fx:Declarations> <s:Button id="btnGetValue" click="btnGetValue_clickHandler()" label="Get Value" /> </s:Application> So when you click on the button, it calls a PHP file and when it gets a result, it calls getValueResultHandler(). Easy enough. But what if the response from the PHP file takes a second or two and the user clicks the button rapidly? Then the result handler function may not get called every time, since the call responder gets a new token before it received the last response. Is there a standard way of resolving this issue? I came up with the following workaround, and it works fine, but it seems like this issue would be common enough to have a more built-in solution. My workaround is: var getValueResultProcessing:Boolean = false; private function btnGetValue_clickHandler():void { var interval:uint = setInterval(function():void { if (!getValueResultProcessing) { getValueResultProcessing = true; getValueResult.token = sdk.getValue(); clearInterval(interval); } }, 100); getValueResult.token = sdk.getValue(); } private function getValueResultHandler():void { getValueResultProcessing = false; // ... } Any better way of resolving this issue?

    Read the article

  • Implement a calender with Ruby and Javascript in Rails

    - by samuel02
    I'm trying to implement a calendar with Ruby and Javascript in Rails. I'm using a calendar helper that creates a calendar with given year and month and events as parameters (<%= calendar(:year => 2012, :month => 4, :events => @events %>). I also have three buttons next, today and previous with which the user should be able to navigate the calendar with. I am also going to implement some js that makes it possible to select dates in the calendar. So what I would like to do is to insert the calendar in the DOM with javascript in order to generate a new calendar when the user clicks one of the buttons. That way I will be able to control the behavior of the buttons and add the select functionality. The problem is that I can't just insert my erb code in a javascript plus I'm not even sure it's the right way to go? Any suggestions are appreciated!

    Read the article

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