Daily Archives

Articles indexed Tuesday April 27 2010

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

  • a multi-component truth table for assembly

    - by Malfist
    Can someone help me convert this C if statement into something assembly can understand? if((plain>='a' && plain<='x') || (plain>='A' && plain <='X')){ code = plain+2; } plain is a char, which for assembly is stored in the al register. Any help would be appreciated.

    Read the article

  • Google Street View logs WiFi networks, Mac addresses

    <b>The Register:</b> "Google's roving Street View spycam may blur your face, but it's got your number. The Street View service is under fire in Germany for scanning private WLAN networks, and recording users' unique Mac (Media Access Control) addresses, as the car trundles along."

    Read the article

  • Box Selection and Multi-Line Editing with VS 2010

    - by ScottGu
    This is the twenty-second in a series of blog posts I’m doing on the VS 2010 and .NET 4 release. I’ve already covered some of the code editor improvements in the VS 2010 release.  In particular, I’ve blogged about the Code Intellisense Improvements, new Code Searching and Navigating Features, HTML, ASP.NET and JavaScript Snippet Support, and improved JavaScript Intellisense.  Today’s blog post covers a small, but nice, editor improvement with VS 2010 – the ability to use “Box Selection” when performing multi-line editing.  This can eliminate keystrokes and enables some slick editing scenarios. [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu] Box Selection Box selection is a feature that has been in Visual Studio for awhile (although not many people knew about it).  It allows you to select a rectangular region of text within the code editor by holding down the Alt key while selecting the text region with the mouse.  With VS 2008 you could then copy or delete the selected text. VS 2010 now enables several more capabilities with box selection including: Text Insertion: Typing with box selection now allows you to insert new text into every selected line Paste/Replace: You can now paste the contents of one box selection into another and have the content flow correctly Zero-Length Boxes: You can now make a vertical selection zero characters wide to create a multi-line insert point for new or copied text These capabilities can be very useful in a variety of scenarios.  Some example scenarios: change access modifiers (private->public), adding comments to multiple lines, setting fields, or grouping multiple statements together. Great 3 Minute Box-Selection Video Demo Brittany Behrens from the Visual Studio Editor Team has an excellent 3 minute video that shows off a few cool VS 2010 multi-line code editing scenarios with box selection:   Watch it to learn a few ways you can use this new box selection capability to optimize your typing in VS 2010 even further: Hope this helps, Scott P.S. You can learn more about the VS Editor by following the Visual Studio Team Blog or by following @VSEditor on Twitter.

    Read the article

  • How can I get VirtualBox Guest Additions installed in an Ubuntu 9.10 server?

    - by sutch
    I have a freshly installed Ubuntu 9.10 server installed within a VirtualBox VM instance. From the VirtualBox menu bar, I selected Devices: Install Guest Additions... Then performed the following commands: > sudo apt-get install -y build-essential linux-headers-$(uname -r) > sudo mount /dev/cdrom /mnt/ > sudo /mnt/VBoxLinuxAdditions-amd64.run After some successful looking results, the following error is displayed: Installing the Window System drivers ...fail! (Could not find the X.Org or XFree86 Window System.) After restarting, I was looking forward to some UI integration with my host desktop (resize window, not needing to press right-Ctrl to escape the client window, and having copy and paste functionality. Is it possible to install the Guest Additions without the X Window overhead (I plan to only use for shell commands)? If additional packages are required, which ones?

    Read the article

  • Replacing all disks in a non-OS RAID 5 volume

    - by molecule
    Hi all, We currently have a server with 8 x HDD slots. It is a HP DL380G5 with a P400 controller. 2 x HDD are in a RAID 1+0 config and this hosts the OS. 6 x HDD are in a RAID 5 config and holds an Oracle DB. Basically the RAID 5 volume is running out of space and we would like to swap all 6 with higher capacity disks. Excuse my ignorance as I am pretty new to this... I believe we will need to backup the data, delete the RAID volume, insert the new disks, recreate the volume, and restore the data. 2 questions: Do we need to worry about the OS partition or is it completely independent so we can simply take out the 6 and insert 6 new disks and get the controller to recognize the 6 new disks and form a new RAID 5 volume? We should not need to reinstall OS or Oracle correct? Since we are going to restore the data on the volume from another source (our vendor will take care of this) but we would like to keep the existing data on the 6 disks just in case we run into issues and want to fall back, is this possible? Thanks in advance.

    Read the article

  • sorting using recursion

    - by user310587
    I have the following function to sort an array with even numbers in the front and odd numbers in the back. Is there a way to get it done without using any loops? //front is 0, back =array.length-1; arrangeArray (front, back); public static void arrangeArray (int front, int back) { if (front != back || front<back) { while (numbers [front]%2 == 0) front++; while (numbers[back]%2!=0) back--; if (front < back) { int oddnum = numbers [front]; numbers[front]= numbers[back]; numbers[back]=oddnum; arrangeArray (front+1, back-1); } } }

    Read the article

  • Delete duplicate records from a SQL table without a primary key

    - by Shyju
    I have the below table with the below records in it create table employee ( EmpId number, EmpName varchar2(10), EmpSSN varchar2(11) ); insert into employee values(1, 'Jack', '555-55-5555'); insert into employee values (2, 'Joe', '555-56-5555'); insert into employee values (3, 'Fred', '555-57-5555'); insert into employee values (4, 'Mike', '555-58-5555'); insert into employee values (5, 'Cathy', '555-59-5555'); insert into employee values (6, 'Lisa', '555-70-5555'); insert into employee values (1, 'Jack', '555-55-5555'); insert into employee values (4, 'Mike', '555-58-5555'); insert into employee values (5, 'Cathy', '555-59-5555'); insert into employee values (6 ,'Lisa', '555-70-5555'); insert into employee values (5, 'Cathy', '555-59-5555'); insert into employee values (6, 'Lisa', '555-70-5555'); I dont have any primary key in this table .But i have the above records in my table already. I want to remove the duplicate records which has the same value in EmpId and EmpSSN fields. Ex : Emp id 5 Can any one help me to frame a query to delete those duplicate records Thanks in advance

    Read the article

  • Attempting to convert an if statement to assembly

    - by Malfist
    What am I doing wrong? This is the assmebly I've written: char encode(char plain){ __asm{ mov al, plain ;check for y or z status cmp al, 'y' je YorZ cmp al, 'z' je YorZ cmp al, 'Y' je YorZ cmp al, 'Z' je YorZ ;check to make sure it is in the alphabet now mov cl, al sub cl, 'A' cmp cl, 24 jl Other sub cl, '6' ;there are six characters between 'Z' and 'a' cmp cl, 24 jl Other jmp done ;means it is not in the alphabet YorZ: sub al, 24 jmp done Other: add al, 2 jmp done done: leave ret } } and this is the C code it's supposed to replace, but doesn't char encode(char plain){ char code; if((plain>='a' && plain<='x') || (plain>='A' && plain <='X')){ code = plain+2; }else if(plain == 'y' || plain=='z' || plain=='Y' || plain == 'y'){ code = plain - 24; }else{ code = plain; } return code; } It seems to convert every character that isn't an y,z,Y,Z into a plus 2 equivalent instead of just A-Xa-x. Any ideas why?

    Read the article

  • What is the general process of web hosting?

    - by ggfan
    I want to upload my site public so people can use it. I am currently using a free PHP webhosting company that supports up to a certian amount. When sites that say they offer unlimited upload, data, etc for like $10/month, is that all you need to run a big site? Or how do I host a big site, if it gets popular?

    Read the article

  • How can I create an email newsletter by taking objects from a database?

    - by jimmy
    Well, I'm trying to create a newsletter, that will send emails to users in a database. The newsletter itself would draw "events" and other activities from a database. Whats the best way to take that list, and put them in an email? I was thinking about putting them into an html page, then sending an html email, but not all emails support html(like school email). What would your guys recommend? Could you point me to some good resources? Also, this is for a school project, so I cant use any open source type stuff, unfortunately :(

    Read the article

  • Calculate Percentage help

    - by DAVID
    Hi this code gives me employee salaries and manager salaries. SELECT E.EMP_FNAME AS MANAGER, E.EMP_SALARY, D.DEPT_NO, A.EMP_FNAME AS EMPLOYEE, A.EMP_SALARY FROM EMPLOYEE E, EMPLOYEE A, DEPARTMENT D WHERE E.EMP_NIN = A.EMP_MANAGER AND A.EMP_MANAGER = D.EMP_MANAGER; How can i only show the employees that have a salary within 10% of their manager salary?

    Read the article

  • Galleria jQuery plugin briefly shows all images in IE 7 & 8

    - by hollyb
    I'm using the galleria jQuery plugin on a site. When the gallery first loads, all of the images appear briefly & vertically in ie 7 & 8. This doesn't happen when i isolate the gallery, only when i put it on a somewhat heavy page. This leads me to believe that it happens when the page is a little slow to load. Does anybody know a way to fix this? I feel like an overflow: hidden should fix this, but I've applied it along with a height in every container I could think of. Anybody have any ideas? Here is my css: .galleria{list-style:none;width:350px; overflow:hidden; height: 70px;} .galleria li{display:block;width:50px;height:50px;overflow:hidden;float:left;margin:4px 10px 20px 0;} .galleria li a{display:none;} .galleria li div{position:absolute;display:none;top:0;left:180px;} .galleria li div img{cursor:pointer;} .galleria li.active div img,.galleria li.active div{display:block;} .galleria li img.thumb{cursor:pointer;top:auto;left:auto;display:block;width:auto;height:auto} .galleria li .caption{display: inline;padding-top:.5em; width: 300px; } * html .galleria li div span{width:350px;} /* MSIE bug */ html: <ul class="gallery"> <li class="active"><img src="1.jpg" cap="A great veiw by so and so. This is a long block of info.<br /><span style=color:#666;>Photo by: Billy D. Williams</span>" alt="Image01"></li> <li><img src="2.jpg" cap="A mountain <span style=color:#666;>Photo by: Billy D. Williams</span>" alt="Image01"></li> <li><img src="3.jpg" cap="Another witty caption <span style=color:#666;>Photo by: Billy D. Williams</span>" alt="Image01"></li> <li><img src="4.jpg" cap="<span style=color:#666;>Photo by: Billy D. Williams</span>" alt="Image01"></li> </ul>

    Read the article

  • pointer reference type

    - by Codenotguru
    I am trying to write a function that takes a pointer argument, modifies what the pointer points to, and then returns the destination of the pointer as a reference. I am gettin the following error: cannot convert int***' toint*' in return| Code: #include <iostream> using namespace std; int* increment(int** i) { i++; return &i;} int main() { int a=24; int *p=&a; int *p2; p2=increment(&p); cout<<p2; } Thanks for helping!

    Read the article

  • Jsp static import

    - by folone
    I've created a Spring Roo project. Everything looks fine. Now I want to add a form with a text input and a button to my index.jspx. This form will change a static field currentUser in my ToDo class. So I'm adding: <form> <%@ page import="static com.mypack.domain.ToDo.*" %> <label for="_username_id">My name is:</label> <% currentUser = request.getParameter("username"); %> <input type="text" id="username" name="username" maxlength="30" path="username" size="0" value="<%= currentUser %>"/> <input type="submit"/> </form> somewhere in the middle of it. And now it won't work: This page contains the following errors: error on line 6 at column 20: StartTag: invalid element name Below is a rendering of the page up to the first error. function readCookie(name) { var nameEQ = name + '='; var ca = document.cookie.split(';'); for(var i=0;i If I comment the lines above, it works just fine. What is wrong? Is there a way to write a value to a static field of a class from a jsp page? How do I work around this?

    Read the article

  • Nested resources in namespace form_for

    - by Nelson LaQuet
    Problem The form_for helper incorrectly determines the path to my nested resource inside of a namespace. The models in question are: Forum::Thread and Forum::Reply respectively, located in a subfolder called "forum" under my models directory. This is in Rails 3 BETA 3. routes.rb namespace :forum do root :to => 'threads#index' resources :threads do resources :replies end end app/views/forum/replies/_form.html.haml ... - form_for [@thread, @reply] do |f| ... app/controllers/forum/replies_controller.rb ... def new @reply = Forum::Reply.new end ... Error undefined method `forum_thread_forum_replies_path' In reference to the line outlined above in _form.html.haml

    Read the article

  • How to download file into string with progress callback?

    - by Kaminari
    I would like to use the WebClient (or there is another better option?) but there is a problem. I understand that opening up the stream takes some time and this can not be avoided. However, reading it takes a strangely much more amount of time compared to read it entirely immediately. Is there a best way to do this? I mean two ways, to string and to file. Progress is my own delegate and it's working good. FIFTH UPDATE: Finally, I managed to do it. In the meantime I checked out some solutions what made me realize that the problem lies elsewhere. I've tested custom WebResponse and WebRequest objects, library libCURL.NET and even Sockets. The difference in time was gzip compression. Compressed stream lenght was simply half the normal stream lenght and thus download time was less than 3 seconds with the browser. I put some code if someone will want to know how i solved this: (some headers are not needed) public static string DownloadString(string URL) { WebClient client = new WebClient(); client.Headers["User-Agent"] = "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1045 Safari/532.5"; client.Headers["Accept"] = "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; client.Headers["Accept-Encoding"] = "gzip,deflate,sdch"; client.Headers["Accept-Charset"] = "ISO-8859-2,utf-8;q=0.7,*;q=0.3"; Stream inputStream = client.OpenRead(new Uri(URL)); MemoryStream memoryStream = new MemoryStream(); const int size = 32 * 4096; byte[] buffer = new byte[size]; if (client.ResponseHeaders["Content-Encoding"] == "gzip") { inputStream = new GZipStream(inputStream, CompressionMode.Decompress); } int count = 0; do { count = inputStream.Read(buffer, 0, size); if (count > 0) { memoryStream.Write(buffer, 0, count); } } while (count > 0); string result = Encoding.Default.GetString(memoryStream.ToArray()); memoryStream.Close(); inputStream.Close(); return result; } I think that asyncro functions will be almost the same. But i will simply use another thread to fire this function. I dont need percise progress indication.

    Read the article

  • log4j category

    - by Nuno Furtado
    I have the following on my log4j.properties log4j.rootLogger = debug, stdout, fileLog log4j.appender.stdout = org.apache.log4j.ConsoleAppender log4j.appender.fileLog = org.apache.log4j.RollingFileAppender log4j.appender.fileLog.File = C:/logs/services.log log4j.appender.fileLog.MaxFileSize = 256MB log4j.appender.fileLog.MaxBackupIndex = 32 #Category: ConsultaDados log4j.category.ConsultaDados=ConsultaDados log4j.appender.ConsultaDados=org.apache.log4j.DailyRollingFileAppender log4j.appender.ConsultaDados.layout=org.apache.log4j.PatternLayout log4j.appender.ConsultaDados.layout.ConversionPattern={%t} %d - [%p] %c: %m %n log4j.appender.ConsultaDados.file=C:/logs/consulta.log log4j.appender.ConsultaDados.DatePattern='.' yyyy-MM-dd-HH-mm And im creating my logger with : myLogger = Logger.getLogger("ConsultaDados"); But this doesnt log my calls to the file. they get thrown into the rootLogger Any ideas?

    Read the article

  • Collision detection, visual C++

    - by hidden
    Hi, i am trying to do collision detection in visual C++ for a racing game. I found this site http://www.gamedev.net/reference/articles/article735.asp which seems like the thing i need. However i have no idea how to implement this in my code. The idea is that the players race around the course trying to find a tent with a red flag on it. When the collide witht this tent the game displays "player 1 wins" or whoever wins and then quits the game after 3 seconds. If you can help me please let me know as i am running out of time to get this to work. If you need me to send you the code then let me know that as well.

    Read the article

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