Daily Archives

Articles indexed Monday May 3 2010

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

  • How to stop computer waking up from sleep when LAN connected.

    - by jmatthias
    I have a Compaq desktop machine that wakes up from sleep only when the LAN cable is connected to it. The WOL feature is DISABLED in the BIOS, so why does it keep waking up? And why is it getting told to wake up? I was under the impression that an application or service has to specifically send a message to the machine in order to wake it up but I am not aware of any software on my network that would do this.

    Read the article

  • Is there any small linux distribution which comes with a complete C development environment

    - by hits_lucky
    Hi, I have installed "Damn Small Linux" on my home computer for doing C development in unix. But the distribution doesn't by default come with the C development environment and I am facing some issues when trying to install the gcc. Is there any other small Linux distribution which by default has the required packages for the C development. And also I don't want additional software which takes up lot of space but still would like to have the graphical environment. Thanks

    Read the article

  • Active Desktop cannot be restored on Win XP

    - by Phil.Wheeler
    This is more of a major annoyance than anything that's stopping me from doing my work, but I somehow seem to have had Active Desktop on my work XP machine get corrupted and now can't get it back working again. I've tried browsing to C:\Documents and Settings\%my-user-name%\Application Data\Microsoft\Internet Explorer and changing, deleting or replacing the Desktop.htt file, but it's not achieving anything. The error I was previously getting when trying to click the "Restore my active desktop" button was: Internet Explorer Script Error An error has occurred in the script on this page. Line: 65 Char: 1 Error: Object doesn't support this action Code: 0 URL: file://C:/Documents%20and%20Settings//Application %20Data/Microsoft/Internet%20Explorer/Desktop.htt Any ideas?

    Read the article

  • Probelm with String.split() in java

    - by Matt
    What I am trying to do is read a .java file, and pick out all of the identifiers and store them in a list. My problem is with the .split() method. If you run this code the way it is, you will get ArrayOutOfBounds, but if you change the delimiter from "." to anything else, the code works. But I need to lines parsed by "." so is there another way I could accomplish this? import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.*; public class MyHash { private static String[] reserved = new String[100]; private static List list = new LinkedList(); private static List list2 = new LinkedList(); public static void main (String args[]){ Hashtable hashtable = new Hashtable(997); makeReserved(); readFile(); String line; ListIterator itr = list.listIterator(); int listIndex = 0; while (listIndex < list.size()) { if (itr.hasNext()){ line = itr.next().toString(); //PROBLEM IS HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! String[] words = line.split("."); //CHANGE THIS AND IT WILL WORK System.out.println(words[0]); //TESTING TO SEE IF IT WORKED } listIndex++; } } public static void readFile() { String text; String[] words; BufferedReader in = null; try { in = new BufferedReader(new FileReader("MyHash.java")); //NAME OF INPUT FILE } catch (FileNotFoundException ex) { Logger.getLogger(MyHash.class.getName()).log(Level.SEVERE, null, ex); } try { while ((text = in.readLine()) != null){ text = text.trim(); words = text.split("\\s+"); for (int i = 0; i < words.length; i++){ list.add(words[i]); } for (int j = 0; j < reserved.length; j++){ if (list.contains(reserved[j])){ list.remove(reserved[j]); } } } } catch (IOException ex) { Logger.getLogger(MyHash.class.getName()).log(Level.SEVERE, null, ex); } try { in.close(); } catch (IOException ex) { Logger.getLogger(MyHash.class.getName()).log(Level.SEVERE, null, ex); } } public static int keyIt (int x) { int key = x % 997; return key; } public static int horner (String word){ int length = word.length(); char[] letters = new char[length]; for (int i = 0; i < length; i++){ letters[i]=word.charAt(i); } char[] alphabet = new char[26]; String abc = "abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i < 26; i++){ alphabet[i]=abc.charAt(i); } int[] numbers = new int[length]; int place = 0; for (int i = 0; i < length; i++){ for (int j = 0; j < 26; j++){ if (alphabet[j]==letters[i]){ numbers[place]=j+1; place++; } } } int hornered = numbers[0] * 32; for (int i = 1; i < numbers.length; i++){ hornered += numbers[i]; if (i == numbers.length -1){ return hornered; } hornered = hornered % 997; hornered *= 32; } return hornered; } public static String[] makeReserved (){ reserved[0] = "abstract"; reserved[1] = "assert"; reserved[2] = "boolean"; reserved[3] = "break"; reserved[4] = "byte"; reserved[5] = "case"; reserved[6] = "catch"; reserved[7] = "char"; reserved[8] = "class"; reserved[9] = "const"; reserved[10] = "continue"; reserved[11] = "default"; reserved[12] = "do"; reserved[13] = "double"; reserved[14] = "else"; reserved[15] = "enum"; reserved[16] = "extends"; reserved[17] = "false"; reserved[18] = "final"; reserved[19] = "finally"; reserved[20] = "float"; reserved[21] = "for"; reserved[22] = "goto"; reserved[23] = "if"; reserved[24] = "implements"; reserved[25] = "import"; reserved[26] = "instanceof"; reserved[27] = "int"; reserved[28] = "interface"; reserved[29] = "long"; reserved[30] = "native"; reserved[31] = "new"; reserved[32] = "null"; reserved[33] = "package"; reserved[34] = "private"; reserved[35] = "protected"; reserved[36] = "public"; reserved[37] = "return"; reserved[38] = "short"; reserved[39] = "static"; reserved[40] = "strictfp"; reserved[41] = "super"; reserved[42] = "switch"; reserved[43] = "synchronize"; reserved[44] = "this"; reserved[45] = "throw"; reserved[46] = "throws"; reserved[47] = "trasient"; reserved[48] = "true"; reserved[49] = "try"; reserved[50] = "void"; reserved[51] = "volatile"; reserved[52] = "while"; reserved[53] = "="; reserved[54] = "=="; reserved[55] = "!="; reserved[56] = "+"; reserved[57] = "-"; reserved[58] = "*"; reserved[59] = "/"; reserved[60] = "{"; reserved[61] = "}"; return reserved; } }

    Read the article

  • Terminate long running thread in thread pool that was created using QueueUserWorkItem(win 32/nt5).

    - by Jake
    I am programming in a win32 nt5 environment. I have a function that is going to be called many times. Each call is atomic. I would like to use QueueUserWorkItem to take advantage of multicore processors. The problem I am having is I only want to give the function 3 seconds to complete. If it has not completed in 3 seconds I want to terminate the thread. Currently I am doing something like this: HANDLE newThreadFuncCall= CreateThread(NULL,0,funcCall,&func_params,0,NULL); DWORD result = WaitForSingleObject(newThreadFuncCall, 3000); if(result == WAIT_TIMEOUT) { TerminateThread(newThreadFuncCall,WAIT_TIMEOUT); } I just spawn a single thread and wait for 3 seconds or it to complete. Is there anyway to do something similar to but using QueueUserWorkItem to queue up the work? Thanks!

    Read the article

  • Just curious, in NetBeans IDE 6.1 how can i get icons for my custom GUI components in the GUI editor

    - by Coder
    This is by no means really important, i was just wondering if the community knows how to put icons for my custom GUI components that show up in the NetBeans GUI designer. What i did was make several Swing components and then i use the menu options to add them to the GUI pallete, but they show up with "?" icons. It would be nice if they showed up with icons similar to swing components such as JButtons, especially for components which are subclassed for Swing components. Thanks!

    Read the article

  • Drupal auto change user role in module

    - by Marques
    I am trying to write a module that will change a user's permissions once a node form is inserted into the database. I already have a role assigned when a user registers, but i want that role to be changed once they create a 'company' profile in this case which is when they fill out a cck form of 'company_post' type. My code is below... switch ($op) { case 'insert': if ($node->type == 'company_post') { } ? im not sure what to put in the if statement because I don't really know how to reference the users roles or how to change them. ? So my question is what code can I use to change the users current role to a new role? (Both roles are already created in drupal and have seperate permissions)

    Read the article

  • Where can I find docs for PrestaShop?

    - by alex
    I have downloaded and am using PrestaShop - but can not seem to find any docs. The official ones are apparently 'coming soon'. I imagine there should be some 3rd party ones elsewhere.. but can not find with Google myself. Does anyone know of any? thanks

    Read the article

  • CSS window height problem with dynamic loaded css

    - by Michael Mao
    Hi all: Please go here and use username "admin" and password "endlesscomic" (without wrapper quotes) to see the web app demo. Basically what I am trying to do is to incrementally integrate my work to this web app, say, every nightly, for the client to check the progress. Also, he would like to see, at the very beginning, a mockup about the page layout. I am trying to use the 960 grid system to achieve this. So far, so good. Except one issue that when the "mockup.css" is loaded dynamically by jQuery, it "extends" the window to the bottom, something I do not wanna have... As an inexperienced web developer, I don't know which part is wrong. Below is my js: /* master.js */ $(document).ready(function() { $('#addDebugCss').click(function() { alertMessage('adding debug css...'); addCssToHead('./css/debug.css'); $('.grid-insider').css('opacity','0.5');//reset mockup background transparcy }); $('#addMockupCss').click(function() { alertMessage('adding mockup css...'); addCssToHead('./css/mockup.css'); $('.grid-insider').css('opacity','1');//set semi-background transparcy for mockup }); $('#resetCss').click(function() { alertMessage('rolling back to normal'); rollbackCss(new Array("./css/mockup.css", "./css/debug.css")); }); }); function alertMessage(msg) //TODO find a better modal prompt { alert(msg); } function addCssToHead(path_to_css) { $('<link rel="stylesheet" type="text/css" href="' + path_to_css + '" />').appendTo("head"); } function rollbackCss(set) { for(var i in set) { $('link[href="'+ set[i]+ '"]').remove(); } } Something should be added to the exteral mockup.css? Or something to change in my master.js? Thanks for any hints/suggestions in advance.

    Read the article

  • Recursive breadth first tree traversal

    - by dugogota
    I'm pulling my hair out trying to figure out how to implement breadth first tree traversal in scheme. I've done it in Java and C++. If I had code, I'd post it but I'm not sure how exactly to begin. Given the tree definition below, how to implement breadth first search using recursion? (define tree1 '( A ( B (C () ()) (D () ()) ) (E (F () ()) (G () ())) )) Any help, any, is greatly appreciated.

    Read the article

  • How to trace a raw (character) device stream on Unix ?

    - by Fabien
    I'm trying to trace what is transiting in a raw (character) device on an Unix system (ex: /dev/tty.baseband) for DEBUG purpose. I am thinking of creating a deamon that would: upon start rename /dev/tty.baseband to /dev/tty.baseband.old. create a raw node /dev/tty.baseband spawn two threads: Thread 1: reading /dev/tty.baseband.old writing into /dev/tty.baseband Thread 2: reading /dev/tty.baseband writing into /dev/tty.baseband.old This would work a little bit like a MITM process. I wonder if there is not a 'standard' way to do this.

    Read the article

  • How to confirm php enabled on ubuntu server

    - by Shishant
    Hello, I am not much into linux. I am trying to setup a server through ssh. I installed apache php and mysql through this command. sudo aptitude install apache2 php5-mysql libapache2-mod-php5 mysql-server but I think php is not enabled on the server. when I run command I receive response as below $ which apache2ctl /usr/sbin/apache2ctl but when i check $ which php i receive no response. $ locate php5 /etc/apparmor.d/abstractions/php5 /usr/share/ubuntu-serverguide/html/C/php5.html available apache2 modules aptitude package manager

    Read the article

  • Transitioning from Firefox to Chrome

    - by cool-RR
    I'm considering moving from using Firefox to using Chrome. (I'm on WinXP) Two questions: What is the best way to achieve adblockplus-like functionality on Chrome? Is it possible to save my session when I close the Chrome window so when I open it again I'll see the same tabs?

    Read the article

  • Is there a way to declare a variable that implements multiple interfaces in .Net?

    - by Bryan Anderson
    Similar to this Java question. I would like to specify that a variable implements multiple interfaces. For instance private {IFirstInterface, ISecondInterface} _foo; public void SetFoo({IFirstInterface, ISecondInterface} value) { _foo = value; } Requirements: I don't have the ability to add an interface to most type that would be passed in to Foo. So I can't create a third interface that inherits from IFirstInterface and ISecondInterface. I would like to avoid making the containing class generic if possible because the type of Foo doesn't have much to do with the class and the user isn't likely to know it at compile time. I need to use foo to access methods in both interfaces at a later time. I would like to do this in a compiler safe way, i.e. no trying to cast to the interface just before trying to use it. If foo does not implement both interfaces quite a bit of functionality won't work properly. Is this possible?

    Read the article

  • ExpressionEngine: {exp:query} producing error

    - by Josh Brown
    Hi. I have this code in place to pull some relation data from the database based on a ID of another weblog entry. The relationship custom field would not work for my situation. I have tested the SQL with MySQL and get no errors. But I get an error when I pull up the page. {exp:query sql="SELECT entry_id,field_id_16,field_id_19 FROM exp_weblog_data WHERE field_id_15='2' AND weblog_id='6'"} Also, I want to populate the “field_id_15” from the url. I have tried using the “segment_*” tag, but nothing. Maybe it is something else. Any help is greatly appreciated. Thanks, Josh

    Read the article

  • CSS background image ?

    - by BillyD
    I have a div that is 200px by 200px. If I want to place a 30x30px no-repeat background image at the top left corner position of 120px from the left and 50px from the top ... while also allowing the text inside that div to be displayed on top of the background image ... how would I do that? I tried the following, but it doesnt appear to work. background:url(http://example.com/background-image.png) no-repeat 120px 50px; Any ideas how to perform what I want to accomplish?

    Read the article

  • Draw a column graph with no space between columns

    - by Andrew Shepherd
    I am using the WPF toolkit, and am trying to render a graph that looks like a histogram. In particular, I want each column to be right up against each other column. There should be no gaps between columns. There are a number of components that you apply when creating a column graph. (See example XAML below). Does anybody know if there is a property you can set on one of the elements which refers to the width of the white space between columns? <charting:Chart Height="600" Width="Auto" HorizontalAlignment="Stretch" Name="MyChart" Title="Column Graph" LegendTitle="Legend"> <charting:ColumnSeries Name="theColumnSeries" Title="Series A" IndependentValueBinding="{Binding Path=Name}" DependentValueBinding="{Binding Path=Population}" Margin="0" > </charting:ColumnSeries> <charting:Chart.Axes> <charting:LinearAxis Orientation="Y" Minimum="200000" Maximum="2500000" ShowGridLines="True" /> <charting:CategoryAxis Name="chartCategoryAxis" /> </charting:Chart.Axes> </charting:Chart>

    Read the article

  • How to use regular expression in lxml xpath?

    - by Arty
    I'm using construction like this: doc = parse(url).getroot() links = doc.xpath("//a[text()='some text']") But I need to select all links which have text beginning with "some text", so I'm wondering is there any way to use regexp here? Didn't find anything in lxml documentation

    Read the article

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