Daily Archives

Articles indexed Tuesday April 20 2010

Page 17/121 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Recommended textbook for machine-level programming?

    - by Norman Ramsey
    I'm looking at textbooks for an undergraduate course in machine-level programming. If the perfect book existed, this is what it would look like: Uses examples written in C or assembly language, or both. Covers machine-level operations such as two's-complement integer arithmetic, bitwise operations, and floating-point arithmetic. Explains how caches work and how they affect performance. Explains machine instructions or assembly instructions. Bonus if the example assembly language includes x86; triple bonus if it includes x86-64 (aka AMD64). Explains how C values and data structures are represented using hardware registers and memory. Explains how C control structures are translated into assembly language using conditional and unconditional branch instructions. Explains something about procedure calling conventions and how procedure calls are implemented at the machine level. Books I might be interested in would probably have the words "machine organization" or "computer architecture" in the title. Here are some books I'm considering but am not quite happy with: Computer Systems: A Programmer's Perspective by Randy Bryant and Dave O'Hallaron. This is quite a nice book, but it's a book for a broad, shallow course in systems programming, and it contains a great deal of material my students don't need. Also, it is just out in a second edition, which will make it expensive. Computer Organization and Design: The Hardware/Software Interface by Dave Patterson and John Hennessy. This is also a very nice book, but it contains way more information about how the hardware works than my students need. Also, the exercises look boring. Finally, it has a show-stopping bug: it is based very heavily on MIPS hardware and the use of a MIPS simulator. My students need to learn how to use DDD, and I can't see getting this to work on a simulator. Not to mention that I can't see them cross-compiling their code for the simulator, and so on and so forth. Another flaw is that the book mentions the x86 architecture only to sneer at it. I am entirely sympathetic to this point of view, but news flash! You guys lost! Write Great Code Vol I: Understanding the Machine by Randall Hyde. I haven't evaluated this book as thoroughly as the other two. It has a lot of what I need, but the translation from high-level language to assembler is deferred to Volume Two, which has mixed reviews. My students will be annoyed if I make them buy a two-volume series, even if the price of those two volumes is smaller than the price of other books. I would really welcome other suggestions of books that would help students in a class where they are to learn how C-language data structures and code are translated to machine-level data structures and code and where they learn how to think about performance, with an emphasis on the cache.

    Read the article

  • Access form elements

    - by shiv09
    Hello Friends......I'm creating a multiform application in c#. I'm storing the values from the user in a List in form 1 and I want to access the same stored values of the same list in form 2...I m not able to access the stored values...The error I'm getting indicates that there are no values in the list which I'm accessing from form 2...Please help me out...

    Read the article

  • jquery select element inside a class

    - by Erwin
    Hi fellow programmer I want to select an anchor inside a div like this <div class="response content"> Disapproved Bank Mandiri<br><br> <p> <a class="showlist" href="#">Back to list?</a> </p> </div> What is the jquery to do this ?

    Read the article

  • reading unicode

    - by user121196
    I'm using java io to retrieve text from a server that might output character such as é. then output it using System.err, they turn out to be '?'. I am using UTF8 encoding. what's wrong? int len=0; char[]buffer=new char[1024]; OutputStream os = sock.getOutputStream(); InputStream is = sock.getInputStream(); os.write(query.getBytes("UTF8"));//iso8859_1")); Reader reader = new InputStreamReader(is, Charset.forName("UTF-8")); do{ len = reader.read(buffer); if (len0) { if(outstring==null)outstring=new StringBuffer(); outstring.append(buffer,0,len); } }while(len0); System.err.println(outstring);

    Read the article

  • how to make a program like fraps.

    - by blood
    i want to make a program that will capture video. what if the best way to captrue the video, i know c++ and im learning assembly and i found in my assembly book i can get data from the video card i think? would that be the best way? i know fraps hooks into programs but i want my program to take the full screen? so i want something fast low memory useage if i can and something i can use on other computers with them having the same hardware.

    Read the article

  • Setting Icon for wpf application (VS 08)

    - by baron
    Hi everyone, Before going much further i'll mention I have tried solutions in following: http://stackoverflow.com/questions/320677/how-do-i-set-the-icon-for-my-application-in-visual-studio-2008 http://stackoverflow.com/questions/198848/set-application-icon-from-resources-in-vs-05 I am trying to set an icon for my application. AFAIK, I need potentially 3 images? 1 image is the actual image in explorer when clicking on the .exe (thumbnail for the exe) 1 image (tiny) in the top left corner (16 x 16? Not entirely sure) 1 image in the start menu dock, to the left of the app (maybe 32x32? again not sure) So thats fine. Now I have selected an Icon. How do I use it in one of above situations? I have tried adding it in resources, nothing seems to happen. Following that first SO solution, "First go to Resource View (from menu: View -- Other Window -- Resource View). Then in Resource View navigate through resources, if any. If there is already a resource of Icon type, added by Visual Studio, then open and edit it. Otherwise right-click and select Add Resource, and then add a new icon." The resource view is empty, and I cannot right click in this view. If I right click on the solution properties resources I can add the icon image, but it doesn't show in either of the locations listed above. (or anywhere that I can see) What am I doing wrong?

    Read the article

  • Specializing a class template constructor

    - by SilverSun
    I'm messing around with template specialization and I ran into a problem with trying to specialize the constructor based on what policy is used. Here is the code I am trying to get to work. #include <cstdlib> #include <ctime> class DiePolicies { public: class RollOnConstruction { }; class CallMethod { }; }; #include <boost/static_assert.hpp> #include <boost/type_traits/is_same.hpp> template<unsigned sides = 6, typename RollPolicy = DiePolicies::RollOnConstruction> class Die { // policy type check BOOST_STATIC_ASSERT(( boost::is_same<RollPolicy, DiePolicies::RollOnConstruction>::value || boost::is_same<RollPolicy, DiePolicies::CallMethod>::value )); unsigned m_die; unsigned random() { return rand() % sides; } public: Die(); void roll() { m_die = random(); } operator unsigned () { return m_die + 1; } }; template<unsigned sides> Die<sides, DiePolicies::RollOnConstruction>::Die() : m_die(random()) { } template<unsigned sides> Die<sides, DiePolicies::CallMethod>::Die() : m_die(0) { } ...\main.cpp(29): error C3860: template argument list following class template name must list parameters in the order used in template parameter list ...\main.cpp(29): error C2976: 'Die' : too few template arguments ...\main.cpp(31): error C3860: template argument list following class template name must list parameters in the order used in template parameter list Those are the errors I get in Microsoft Visual Studio 2010. I'm thinking either I can't figure out the right syntax for the specialization, or maybe it isn't possible to do it this way.

    Read the article

  • simple web parts in asp.net show as blank page

    - by Javaman59
    I am trying to develop web parts in VS 2008/WinXP I created a Web Site project, and added a couple of web parts within the default form in default.aspx <form id="form1" runat="server"> <div> <asp:WebPartManager ID="WebPartManager1" runat="server"> </asp:WebPartManager> <asp:WebPartZone ID="WebPartZone1" runat="server"> </asp:WebPartZone> </div> </form> When I first ran it (in the debugger), a popup told to me enable Windows authentication in IIS (so something is working!). I enabled the Windows authentication, and now when I run it I get a blank screen. Same result if I open it in IE via the url (rather than debugger). Following is the the source view. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title> </title><style type="text/css"> .WebPartZone1_0 { border-color:Black;border-width:1px;border-style:Solid; } </style></head> <body> <form name="form1" method="post" action="Default.aspx" id="form1"> <div> <input type="hidden" name="__WPPS" id="__WPPS" value="s" /> <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEzNTQyOTkwNDZkZEAVY0VcQaHLv3uaF3svWgCOfsmb" /> </div> <script type="text/javascript"> //<![CDATA[ var theForm = document.forms['form1']; if (!theForm) { theForm = document.form1; } function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } //]]> </script> <script src="/WebPartsSite/WebResource.axd?d=4lwrtwXryJ3Ri-GXAxZR4g2&amp;t=634003643420884071" type="text/javascript"></script> <div> <table cellspacing="0" cellpadding="0" border="0" id="WebPartZone1"> <tr> <td style="height:100%;"><table cellspacing="0" cellpadding="2" border="0" style="width:100%;height:100%;"> <tr> <td style="height:100%;"></td> </tr> </table></td> </tr> </table> </div> <script type="text/javascript"> //<![CDATA[ var __wpmExportWarning='This Web Part Page has been personalized. As a result, one or more Web Part properties may contain confidential information. Make sure the properties contain information that is safe for others to read. After exporting this Web Part, view properties in the Web Part description file (.WebPart) by using a text editor such as Microsoft Notepad.';var __wpmCloseProviderWarning='You are about to close this Web Part. It is currently providing data to other Web Parts, and these connections will be deleted if this Web Part is closed. To close this Web Part, click OK. To keep this Web Part, click Cancel.';var __wpmDeleteWarning='You are about to permanently delete this Web Part. Are you sure you want to do this? To delete this Web Part, click OK. To keep this Web Part, click Cancel.';//]]> </script> <script type="text/javascript"> __wpm = new WebPartManager(); __wpm.overlayContainerElement = null; __wpm.personalizationScopeShared = true; var zoneElement; var zoneObject; zoneElement = document.getElementById('WebPartZone1'); if (zoneElement != null) { zoneObject = __wpm.AddZone(zoneElement, 'WebPartZone1', true, false, 'black'); } </script> </form> </body> </html>

    Read the article

  • What's an easy way to set up object communication in Obj-C?

    - by seaworthy
    I am trying to send a slider value from a controller object to a method of a model object. The later is implemented in the separate file and I have appropriate headers. I think the problem is that I am not sure how to instantiate the receiver in order to produce a working method for the controller. Here is the controller's method. -(IBAction)setValue:(id)slider {[Model setValue:[slider floatValue]];} @implementation Model -(void)setValue:(float)n{ printf("%f",n); } @end What I get is 'Model' may not respond to '+setValue' warning and no output in my console. Any insight is appreciated.

    Read the article

  • Multiple Rails versions for multiple projects

    - by mathee
    I'd like to use Rails 2.2.2 for one project and Rails 2.3.2 for another. Both are installed. What is rails _2.2.2_ --version supposed to do? I've read that it makes 2.2.2 the working version -- that is, the version that will be used from that point on. But when I check rails --version, I get Rails 2.3.2. So, I also want to know what rails --version tells me; is it just the latest version of Rails that I have or is it the version that will be used for rakes? I know about RVM. Is that the best way to use different versions of Rails on different projects?

    Read the article

  • Hi i am creating a php calendar i have a Problem in that

    - by udaya
    Hi i am creating a calendar i which i filled the year and date like this <<<<< Year <<<<< month by clicking on the arrow marks the year and month can be increased and decreased now i have to fill the dates for the year and month selected I calculated the first day of month and last date of the month The dates must be start filling from the first day Say if the first day is thursday the date 1 must be on thursday and the next days must follow that till the last date These are my functions in my controller " function phpcal() { $month=04; $day=01; $year=2010; echo date("D", mktime(0,0,0,$month,$day,$year)); //here i am calculating the first day of the month echo '<br>lastdate'.date("t", strtotime($year . "-" . $month . "-01"));'' here i am calculating the lasdt date of the month //echo '<br>'.$date_end = $this->lastOfMonth(); $this->load->view('phpcal'); } function firstOfMonth($m1,$y1) { return date("m/d/Y", strtotime($m1.'/01/'.$y1.' 00:00:00')); } function lastOfMonth() { return date("m/d/Y", strtotime('-1 second',strtotime('+1 month',strtotime(date('m').'/01/'.date('Y').' 00:00:00')))); } function phpcalview() { $year = $this->input->post('yearvv'); $data['year'] = $this->adminmodel->selectyear(); $data['date'] = $this->adminmodel->selectmonth(); //print_r($data['date'] ); $this->load->view('phpcal',$data); } This is my view page <table cellpadding="2" cellspacing="0" border="1" bgcolor="#CCFFCC" align="center" class="table_Style_Border"> <? if(isset($date)) { foreach($date as $row) {?> <tr> <td><?= $row['dbDate1'];?></td> <td><?= $row['dbDate2'];?></td> <td><?= $row['dbDate3'];?></td> <td><?= $row['dbDate4'];?></td> <td><?= $row['dbDate5'];?></td> <td><?= $row['dbDate6'];?></td> <td><?= $row['dbDate7'];?></td> </tr> <tr bgcolor="#FFFFFF"> <td><?= $row['dbDate8'];?></td> <td><?= $row['dbDate9'];?></td> <td><?= $row['dbDate10'];?></td> <td><?= $row['dbDate11'];?></td> <td><?= $row['dbDate12'];?></td> <td><?= $row['dbDate13'];?></td> <td><?= $row['dbDate14'];?></td> </tr> <tr> <td><?= $row['dbDate15'];?></td> <td><?= $row['dbDate16'];?></td> <td><?= $row['dbDate17'];?></td> <td><?= $row['dbDate18'];?></td> <td><?= $row['dbDate19'];?></td> <td><?= $row['dbDate20'];?></td> <td><?= $row['dbDate21'];?></td> </tr> <tr bgcolor="#FFFFFF"> <td><?= $row['dbDate22'];?></td> <td><?= $row['dbDate23'];?></td> <td><?= $row['dbDate24'];?></td> <td><?= $row['dbDate25'];?></td> <td><?= $row['dbDate26'];?></td> <td><?= $row['dbDate27'];?></td> <td><?= $row['dbDate28'];?></td> </tr> <tr> <td><?= $row['dbDate29'];?></td> <td><?= $row['dbDate30'];?></td> <td><?= $row['dbDate31'];?></td> <td><?= $row['dbDate1'];?></td> <td><?= $row['dbDate1'];?></td> <td><?= $row['dbDate1'];?></td> <td><?= $row['dbDate1'];?></td> </tr> </tr> <? }} ?> </table> How can i insert the dates starting from the day i have calculated in the function phpcal

    Read the article

  • Question about mail merge in DesignPro 1.0.1 for mac

    - by Tim F.
    I'm using Avery DesignPro v. 1.0.1 for mac to print out address labels using a mail merge. There are two columns for addresses (Address1 and Address2), but for most of the entries on the list, Address2 is blank. When I do the mail merge, I get several address labels with a blank line between Address1 and the City, State line because there's no Address2 for those entries. Does anyone know of a way to get DesignPro to ignore Address2 completely if there's no value there, or will I have to go through and manually edit each label to delete the extra blank line?

    Read the article

  • ASP.NET MVC - Localization route

    - by ropstah
    Hi, i'd like to create localized URL's for my site. They should obviously point to the same controller actions, but I want the first routevalues to -always- be the location/language specification. Is this possible? http://www.website.com/en/us/controller/action http://www.website.com/en/gb/controller/action I understand it can be done by defining {language} and {location} in every route, but i'm looking for a slick, non-hacky solution.

    Read the article

  • maven assemblies. Putting each dependency with transitive dependencies in own directory?

    - by jr
    I have a maven project which consists of a few modules. This is to be deployed on a client machine and will involve installing Tomcat and will make use of NSIS for installer. There is a separate application which monitors tomcat and can restart it, perform updates, etc. So, I have the modules setup as follows: project +-- client (all code, handlers, for the war) +-- client-common - (shared code, shared between monitor and client) +-- client-web - (the war, basically just uses war has applicationcontext, web.xml,etc) +-- monitor - (the monitor application jar. Uses wrapper to run) So, I need to create an installer. I was planning on creating another module which would be the installer. This is where I would have tomcat directory and I'd like maven to "assemble" everything and then run NSIS so I can create the final installer. However, I need to have the monitor jar file in a directory and then have all monitors dependencies in a lib/ directory. The final directory structure should be: project-installer-directory/monitor/monitor-version.jar project-installer-directory/monitor/lib/monitor-dep-1.jar project-installer-directory/monitor/lib/monitor-dep-2.jar project-installer-directory/monitor/lib/monitor-dep-3.jar project-installer-directory/webapps/client-web.war Where in the client-web\WEB-INF\lib directory we will have all client-web's dependencies after it is exploded. That works, I have the .war file. What I am having problems with is getting the monitor module dependencies independent of the dependencies of the client-web module. I tried to just create the installer module and make the monitor and client-web dependencies, but when I use dependencies-copy it gives me everything. Not what I want. I'm leaning towards creating a new module called monitor-assembly or something to give me a zip file which contains the directory format I need, but that is yet another module. Can someone please help me with the correct way to accomplish this? thanks!

    Read the article

  • Yet another Rails routing question

    - by danhere
    I can't seem to grasp the Rails routing just yet. I want to be able to link the site to, for example, ...com/store/xbox360/Mass Effect 2 (which is /store(my controller)/:system/:title). I have the database entries that include the :system and :title variables (?). How would I route these to show up and filter these entries? Or is this something I need to set up in the controller? I'm lost. Thanks so much for your help.

    Read the article

  • Reverse proxy for mailserver (SMTP + HTTP for web client)

    - by ba
    I'm looking at doing some reverse proxy work for a mail server with corresponding web client. Both servers are running on the same machine, this is not a server with a high load. :) The solution I've discussed with friends is having the mail server/web client on our internal network. Then to put a reverse proxy on the DMZ to service both SMTP and web client HTTP-traffic to the mail server on the internal network. From what I understand this is the recommended secure solution? So far I've thought for the SMTP-proxy part of using postfix which will receive mail, do some spamhause and similar anti-spam measures and if it all checks out, send the mail to the mail server on the inside. The mail server on the inside will send all outgoing mail to the proxy which will then send it out on the Internet. For the web client I'm not sure exactly which software I should be running on the proxy machine, I've been thinking about using Squid -- but that's basically based on the fact that I know squid is a http proxy. The web client data will be sent out over SSL. Reading around some here on Serverfault I've seen other people using Apache with mod_proxy+mod_security for similar situations. Am I thinking correctly for this solution? What software would you guys use and with which modules? Thanks in advance for the help! :)

    Read the article

  • Easy way to check if item is in list?

    - by befall
    Hey guys, I'm writing a search algorithm in C++, and one of the things I need to do is have a few if statements that check cells above, below, left of, and right of. Each time a cell is found to be open and added to the stack, I want it added to a list of cells already checked. I want to be able to say in the if loop if(thisCell is not in checkedCells). Any simple ideas? Thanks!

    Read the article

  • C# .NET : Is using the .NET Image Conversion enough?

    - by contactmatt
    I've seen a lot of people try to code their own image conversion techniques. It often seems to be very complicated, and ends up using GDI+ funciton calls, and manipulating bits of the image. This has got me wondering if I am missing something in the simplicity of .NET's image conversion call when saving an image. Here's the code I have Bitmap tempBmp = new Bitmap("c:\temp\img.jpg"); Bitmap bmp = new Bitmap(tempBmp, 800, 600); bmp.Save(c:\temp\img.bmp, //extension depends on format ImageFormat.Bmp) //These are all the ImageFormats I allow conversion to within the program. Ignore the syntax for a second ;) ImageFormat.Gif) //or ImageFormat.Jpeg) //or ImageFormat.Png) //or ImageFormat.Tiff) //or ImageFormat.Wmf) //or ImageFormat.Bmp)//or ); This is all I'm doing in my image conversion. Just setting the location of where the image should be saved, and passing it an ImageFormat type. I've tested it the best I can, but I'm wondering if I am missing anything in this simple format conversion, or if this is suffice?

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >