Daily Archives

Articles indexed Thursday April 8 2010

Page 19/125 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Boot from USB at booting time win Windows 7

    - by MA1
    Hello Everyone hope you will be fine and good. 1) I need a tool/software that i can run from USB at boot time 2) How to boot the USB at booting time 3) and...how to run that progam/tool/software Actually, what i want to do is to copy some files from hardisk to USB at boot. Can anyone help...or point me to some useful link/book etc... Thanks.

    Read the article

  • Do jQuery and JavaScript have different namespaces?

    - by Brett
    I have this code in jQuery.. $(document).ready(function(){ var fieldCounter = 0; ... I have a jQuery function that increments this value. This works, but I can't access this value on the page from a non-jQuery function? The reverse is also true, if I scope it in JavaScript e.g. <script type="text/javascript"> var fieldCounter = 0; I can access it from javascript but jQuery can't view it? I'm probably doing something really dumb?

    Read the article

  • Understanding top output in Linux

    - by Rayne
    Hi, I'm trying to determine the CPU usage of a program by looking at the output from Top in Linux. I understand that %us means userspace and %sy means system/kernel etc. But say I see 100%us. Does this mean that the CPU is really only doing useful work? What if a CPU is tied up waiting for resources that are not avaliable, or cache misses, would it also show up in the %us column, or any other column? Thank you.

    Read the article

  • How do I drag and drop between two listboxes in XUL?

    - by pc1oad1etter
    I am trying to implement drag and drop between two listboxes. I have a few problems 1) I am not detecting any drag events of any kind from the source list box/ I do not seem to be able to drag from it 2) I can drag from my desktop to the target listbox and I am able to detect 'dragenter' 'dragover' and 'dragexit' events. I am noticing that the event parameter is undefined in my 'dragenter' callback - is this a problem? 3) I cannot figure out how to complete the drag and drop operation. From https://developer.mozilla.org/En/DragDrop/Drag_Operations#Performing_... "If the mouse was released over an element that is a valid drop target, that is, one that cancelled the last dragenter or dragover event, then the drop will be successful, and a drop event will fire at the target. Otherwise, the drag operation is cancelled and no drop event is fired." This seems to be referring to a 'drop' event, though there is not one listed at https://developer.mozilla.org/en/XUL/Events . I can't seem to detect the end of the drag in order to call one of the example 'doDrop()' functions that I find on MDC. My example, so far: http://pastebin.mozilla.org/713676 <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/ there.is.only.xul" onload="initialize();"> <vbox> <hbox> <vbox> <description>List1</description> <listbox id="source" draggable="true"> <listitem label="1"/> <listitem label="3"/> <listitem label="4"/> <listitem label="5"/> </listbox> </vbox> <vbox> <description>List2</description> <listbox id="target" ondragenter="onDragEnter();"> <listitem label="2"/> </listbox> </vbox> </hbox> </vbox> <script type="application/x-javascript"> <![CDATA[ function initialize(){ jsdump('adding events'); var origin = document.getElementById("source"); origin.addEventListener("drag", onDrag, false); origin.addEventListener("dragdrop", onDragDrop, false); origin.addEventListener("dragend", onDragEnd, false); origin.addEventListener("dragstart", onDragStart, false); var target = document.getElementById("target"); target.addEventListener("dragenter", onDragEnter, false); target.addEventListener("dragover", onDragOver, false); target.addEventListener("dragexit", onDragExit, false); target.addEventListener("drop", onDrop, false); target.addEventListener("drag", onDrag, false); target.addEventListener("dragdrop", onDragDrop, false); } function onDrag(){ jsdump('onDrag'); } function onDragDrop(){ jsdump('onDragDrop'); } function onDragStart(){ jsdump('onDragStart'); } function onDragEnd(){ jsdump('onDragEnd'); } function onDragEnter(event){ //debugger; if(event){ jsdump('onDragEnter event.preventDefault()'); event.preventDefault(); }else{ jsdump("event undefined in onDragEnter"); } } function onDragExit(){ jsdump('onDragExit'); } function onDragOver(event){ //debugger; if(event){ //jsdump('onDragOver event.preventDefault()'); event.preventDefault(); }else{ jsdump("event undefined in onDragOver"); } } function onDrop(event){ jsdump('onDrop'); var data = event.dataTransfer.getData("text/plain"); event.target.textContent = data; event.preventDefault(); } function jsdump(str) { Components.classes['[email protected]/consoleservice;1'] .getService(Components.interfaces.nsIConsoleService) .logStringMessage(str); } ]]> </script> </window>

    Read the article

  • @"%@ in Objective C?

    - by doo
    I was following a tut and found a line of code like @"%@ button pressed.". I'm pretty sure the relevant part is the %@, but is the first @ an escape sequence or what? Anyways, searching symbols doesn't go well in any search engine so I thought I'd ask. I think the %@ is like {0} in C#?

    Read the article

  • Help with mysql sum and group query and managing results for jquery graph.

    - by Scarface
    I have a system I am trying to design that will retrieve information from a database, so that it can be plotted in a jquery graph. I need to retrieve the information and somehow put it in the necessary coordinates format (for example two coordinates var d = [[1269417600000, 10],[1269504000000, 15]];). My table that I am selecting from is a table that stores user votes with fields: points_id (1=vote up, 2=vote down), user_id, timestamp, topic_id What I need to do is select all the votes and somehow group them into respective days and then sum the difference between 1 votes and 2 votes for each day. I then need to somehow display the data in the appropriate plotting format shown earlier. For example April 1, 4 votes. The data needs to be separated by commas, except the last plot entry, so I am not sure how to approach that. I showed an example below of the kind of thing I need but it is not correct, echo "var d=["; $query=mysql_query( "SELECT *, SUM(IF(points_id = \"1\", 1,0))-SUM(IF([points_id = \"2\", 1,0)) AS 'total' FROM points LEFT JOIN topic ON topic.topic_id=points.topic_id WHERE topic.creator='$user' GROUP by timestamp HAVING certain time interval" ); while ($row=mysql_fetch_assoc($query)){ $timestamp=$row['timestamp']; $votes=$row['total']; echo "[$timestamp,$vote],"; } echo "];";

    Read the article

  • ntpd on Fedora Core 6 with high negative time rest values

    - by Mark White
    The basic problem is we have a FC6 server instance running on a virtual machine, and the system time seems to have been slowly varying until it is now causing a problem. The server runs 24/7 and has been up for 155 days. It has been changed to show GMT, and reports the time as (example) 00:15:15 GMT whereas the actual time is 00:00:00 GMT. This is an offset of 915 seconds. selinux has been changed to 'setenforce 0' for testing and I am running as root. I stop the ntpd service and change the time in System|Administration|Date & Time. The time still shows the same with 'date' in bash. There are no error logs. I change the date with 'date --set' in bash. The response confirms the changed date. I run 'date' and the incorrect date is shown. There are no error logs. I start the ntpd service and /var/log/messages shows success with 'time reset -915.720139s'. The date remains unchanged. ntpq -p shows three three time servers all have offsets of around -915 seconds. I stop ntpd service and try 'ntpd -gqx' and get the same result as above - success, but a large negative time reset. I've tried varying combinations of the above, and a few more settings in System|Administration|Date & Time - no change. I just need to reset the system time to GMT. No offset. But I can't wait for ntpd to slew the time over the next few weeks. Any advice is welcome, cheers! Sure this shouldn't be this difficult... Mark...

    Read the article

  • Dynamic editor upload into web page. Need advice

    - by Andrew Florko
    Hello everybody, I am writing intranet site for tracking employees science activities in organization. There lots of editable information on each personal page (science degree, publications & so on) so I upload editor per request (user clicks "edit" and modal dialog with html editor: set of textboxes/comboboxes/autocomplete features & validation logic appears). Editor is html layout that is wrapped with jquery dialog plugin + some logic, written as javascript functions that should be invoked from the callee page (onsubmit, validate, afterLoad editor events). There are also attributes (editor preferrable with and height) that are passed to callee page also. Currently I send these functions & attribute as ... function onsubmit() { }; function validate() { } var width = 640; var height = 800 ... code that is embedded into the request page. Function calls and editor markup wrap with jquery plugin completed in the callee page. It works, but I have some try { call editor event handler } catch { } stuff in callee page (because not every editor provides these functions) and some attributes (editor width & height for instance) that are loaded as variables declared in javascript. Please, suggest, is there a better approach to build & use custom editors for my situation. Thank you in advance!

    Read the article

  • associating a filetype with a batch script, and getting parameters passed to file of that type.

    - by Carson Myers
    Sorry for the cryptic title. I have associated python scripts with a batch file that looks like this: python %* I did this because on my machine, python is installed at C:\python26 and I prefer not to reinstall it (for some reason, it won't let me add a file association to the python interpreter. I can copy the executable to Program Files and it works -- but nothing out of Program Files seems to work). Anyways, I can do this, so far: C:\py django-admin C:\py python "C:\python26\Lib\site-packages\django\bin\django-admin.py" Type 'django-admin.py help' for usage. C:\py django-admin startproject myProj C:\py python "C:\python26\Lib\site-packages\django\bin\django-admin.py" Type 'django-admin.py help' for usage. but the additional parameters don't get passed along to the batch script. This is getting very annoying, all I want to do is run python scripts :) How can I grab the rest of the parameters in this situation?

    Read the article

  • Interview question

    - by rahul
    Recenty I was asked this interview question: There is a server which receives millions of requests every day. Design an API for finding out hits in the last one minute, in the last 10 minutes etc. What should be the algorithm and design to implement it efficienly. I want to know the ideas on this.

    Read the article

  • Strange behavior due to wx.Frame.SetTitle

    - by Anurag Uniyal
    In a wxPython application, which i am porting to Mac OSX, I set title of app frame every 500msec in update UI event, and due to that all the panels and windows are refreshed. That seems strange to me and almost halts my application which has many custom drawn controls and screens. I wanted to know what could be the reason behind it, is it normal for MAC? Here is a self-constrained script which replicates the scenario using timers. It keeps on printing "on paint" every 500ms because in timer I set title every 500ms. import wx app = wx.PySimpleApp() frame = wx.Frame(None, title="BasePainter Test") painter = wx.Panel(frame) def onPaint(event): dc = wx.PaintDC(painter) print "onPaint" painter.Bind(wx.EVT_PAINT, onPaint) def loop(): frame.SetTitle(frame.GetTitle()) wx.CallLater(500, loop) loop() frame.Show(True) app.SetTopWindow(frame) app.MainLoop() My system details: >>> sys.version '2.5 (r25:51918, Sep 19 2006, 08:49:13) \n[GCC 4.0.1 (Apple Computer, Inc. build 5341)]' >>> wx.VERSION (2, 8, 10, 1, '') >>> os.uname() ('Darwin', 'agyeys-mac-mini.local', '9.8.0', 'Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386', 'i386')

    Read the article

  • Django: Odd mark_safe behaviour?

    - by Mark
    I wrote this little function for writing out HTML tags: def html_tag(tag, content=None, close=True, attrs={}): lst = ['<',tag] for key, val in attrs.iteritems(): lst.append(' %s="%s"' % (key, escape_html(val))) if close: if content is None: lst.append(' />') else: lst.extend(['>', content, '</', tag, '>']) else: lst.append('>') return mark_safe(''.join(lst)) Which worked great, but then I read this article on efficient string concatenation (I know it doesn't really matter for this, but I wanted consistency) and decided to update my script: def html_tag(tag, body=None, close=True, attrs={}): s = StringIO() s.write('<%s'%tag) for key, val in attrs.iteritems(): s.write(' %s="%s"' % (key, escape_html(val))) if close: if body is None: s.write(' />') else: s.write('>%s</%s>' % (body, tag)) else: s.write('>') return mark_safe(s.getvalue()) But now my HTML get escaped when I try to render it from my template. Everything else is exactly the same. It works properly if I replace the last line with return mark_safe(unicode(s.getvalue())). I checked the return type of s.getvalue(). It should be a str, just like the first function, so why is this failing?? Also fails with SafeString(s.getvalue()) but succeeds with SafeUnicode(s.getvalue()). I'd also like to point out that I used return mark_safe(s.getvalue()) in a different function with no odd behavior. The "call stack" looks like this: class Input(Widget): def render(self): return html_tag('input', attrs={'type':self.itype, 'id':self.id, 'name':self.name, 'value':self.value, 'class':self.itype}) class Field: def __unicode__(self): return mark_safe(self.widget.render()) And then {{myfield}} is in the template. So it does get mark_safed'd twice, which I thought might have been the problem, but I tried removing that too..... I really have no idea what's causing this, but it's not too hard to work around, so I guess I won't fret about it.

    Read the article

  • Use htaccess to redirect all traffic from subdomain to domain without maintaining directory structur

    - by hal10001
    Most examples show how to redirect all subdomain traffic to a primary domain, maintaining the directory structure. I actually don't want this. I want to redirect all subdomain traffic (the site is going away) to the primary domain. This is not working: Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.newdomain.com/ [R=301,L] What happens, is if you go to this: http://sub.newdomain.com/some/path/ You get this: http://www.newdomain.com/some/path/ I want it all to go to the root.

    Read the article

  • PHP getting blank pages after submit a form + signal Segmentation fault (11)

    - by Ole Media
    I few days ago I update my macbook pro to snow leopard, and since then some php files are not showing. This is what happens: I created a php form, when going to 'http://localhost/webform.php' I can see the form just fine. Then, once I submit the form, I just get a blank page. I enable error and warnings reporting under php.ini to make sure I'm not missing something, but still I'm not getting anything, just the blank page. Then I checked under apache log files, and what I notice is that every time I submit the form I see the following line coming up under the apache logs: [Wed Apr 07 21:40:28 2010] [notice] child pid 70223 exit signal Segmentation fault (11) I'm clueless on this one. Any ideas on how to fix it?

    Read the article

  • Ruby number_to_currency displays a totally wrong number!

    - by SueP
    Greetings! I’m an old Delphi programmer making the leap to the Mac, Ruby, Rails, and web programming in general. I’m signed up for the Advanced Rails workshop at the end of the month. In the meantime, I’ve been working on porting a mission-critical (of course) app from Delphi to RAILS. It feels like I’ve spent most of the past year with my head buried in a book or podcast. Right now, I’ve hit a major issue and I’m tearing my hair out. I literally don’t know where to go with this, I desperately don’t want to deploy with this bug, and I’m feeling a bit frantic. (The company database is currently running on an ancient XP box that’s looking rustier by the day.) So, I set up a test database that shows the problem. I’m running: OS/X 10.6.3 Rails 2.3.5 ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0] MySQL 5.1.38-log via socket MySQL Client Version 5.1.8 ActiveRecord::Schema.define(:version => 20100406222528) do create_table “money”, :force => true do |t| t.decimal “amount_due”, :precision => 10, :scale => 2, :default => 0.0 t.decimal “balance”, :precision => 10, :scale => 2, :default => 0.0 t.text “memofield” t.datetime “created_at” t.datetime “updated_at” end The index view is right out of the generator, slightly modified to add the formatting that's breaking on me. Listing money <table> <tr> <th>Amount</th> <th>Amount to_s </th> <th>Balance to $</th> <th>Balance with_precision </th> <th>Memofield</th> </tr> <% @money.each do |money| %> <tr> <td><%=h money.amount_due %></td> <td><%=h money.amount_due.to_s(‘F’) %></td> <td><%=h number_to_currency(money.balance) %></td> <td><%=h number_with_precision(money.balance, :precision => 2) %></td> <td><%=h money.memofield %></td> <td><%= link_to ‘Show’, money %></td> <td><%= link_to ‘Edit’, edit_money_path(money) %></td> <td><%= link_to ‘Destroy’, money, :confirm => ‘Are you sure?’, :method => :delete %></td> </tr> *<% end %> *</table> <%= link_to ‘New money’, new_money_path %> This seemed to work pretty well. Then I started testing with production data and hit a major problem with number_to_currency. The number in the database is: 10542.28, I verified it with the MySQL Query Browser. RAILS will display this as 10542.28 unless I call number_to_currency, then that number is displayed as: $15422.80 The error seems to happen with any number between 10,000.00 and 10,999.99 So far, I haven’t seen it outside of that range, but I obviously haven’t tested everything. I guess my workaround is to remove number_to_currency, but that leaves the views looking really sloppy and unprofessional. The formatting is messed up, things don’t line up properly and I can’t force the display to 2 decimal places. I’m seriously hoping there is an easy fix for this. I can’t imagine this being a widespread problem. It would affect so many people that someone would have fixed it! But I don’t know where to go from here. I’d desperately like some help. (Later – number_with_precision fails the same way number_to_currency does.) Sue Petersen

    Read the article

  • Are you using Virtual Machine as your primary development enviroment?

    - by Click Ok
    Recently I have purchased a notebook that cames with Windows Home Basic (that don't have with ASP.Net/IIS. I thought in upgrade the Windows version to one with ASP.Net/IIS, but I thought in another possibility: I have an Hard Disk Case with a 360Gb HD. I thought in create a virtual machine with Windows Ultimate (installing too ASP.Net, IIS and Visual Studio 2008) in this HD Case, then I can access my "development enviroment" in any computer that I will work on (my desktop machine and my notebook). But I was worried about the performance. I don't have experience working in Virtual Machines (I use it just to quick compatibility tests)... Are you using Virtual Machine as your primary development enviroment? What your finds? ==================== Thanks for your answers! It really did help me! I would like to know too about portability ie.: the virtual machine that I created in my laptop will work in the desktop? I will need re-activate Windows?

    Read the article

  • Populating array of input fields as alternate fields using jQuery UI datepicker

    - by Micor
    I am using jquery ui datepicker in order to populate start and end dates for multiple events on the same page, the number of events is dynamic and I need to post day, month and year as separate fields, so I have something like this: <input type="text" name="event[0].startDate" class="date"/> <input type="hidden" name="event[0].startDate_day" class="startDate_day" /> <input type="hidden" name="event[0].startDate_month" class="startDate_month" /> <input type="hidden" name="event[0].startDate_year" class="startDate_year" /> <input type="text" name="event[0].endDate" class="date"/> <input type="hidden" name="event[0].endDate_day" class="endDate_day" /> <input type="hidden" name="event[0].endDate_month" class="endDate_month" /> <input type="hidden" name="event[0].endDate_year" class="startDate_year" /> event[1]... event[2]... I started working on jQuery functionality and this is what I have so far, which will populate alternate fields for startDate by class, of course it will not do what I need because I need to populate by field name rather then class: $(".date").datepicker({ onClose: function(dateText,picker) { $('.startDate_month').val( dateText.split(/\//)[0] ); $('.startDate_day').val( dateText.split(/\//)[1] ); $('.startDate_year').val( dateText.split(/\//)[2] ); }}); I need help figuring out how can I get the name of the input field within datepicker function so the alternate field assignment done by that field name + _day, month, year so this function can work for all the events on the page, making function above look more like: $(".date").datepicker({ onClose: function(dateText,picker) { $('input[' + $name + '_month' + ']').val( dateText.split(/\//)[0] ); $('input[' + $name + '_day' + ']').val( dateText.split(/\//)[1] ); $('input[' + $name + '_year' + ']').val( dateText.split(/\//)[2] ); }}); Hope that makes sense :) Thanks

    Read the article

  • ASP.NET MSSQL Select top N values but skip M results

    - by Mikey
    Im working on an ASP.Net project to display information on a website from a database. I want to select the top 10 items from a news table but skip the first Item and I'm having some problem with it. <asp:SqlDataSource ID="SqlDataSource1" runat="server" ProviderName="System.Data.SqlClient" ConnectionString="<%$ ConnectionStrings:ClubSiteDB %>" SelectCommand="SELECT top 5 [id], [itemdate], [title], [description], [photo] FROM [Announcements] order by itemdate desc"> </asp:SqlDataSource> This is what I have so far but i can't find any info online about how to skip a record

    Read the article

  • regarding setup (object file)

    - by asha
    i have made a firewall project in c language on linux operating system ,now i want to know how to make set of this project so that i can run this application on other system by installing it ?

    Read the article

  • Naming convention for non-virtual and abstract methods

    - by eagle
    I frequently find myself creating classes which use this form (A): abstract class Animal { public void Walk() { // TODO: do something before walking // custom logic implemented by each subclass WalkInternal(); // TODO: do something after walking } protected abstract void WalkInternal(); } class Dog : Animal { protected override void WalkInternal() { // TODO: walk with 4 legs } } class Bird : Animal { protected override void WalkInternal() { // TODO: walk with 2 legs } } Rather than this form (B): abstract class Animal { public abstract void Walk(); } class Dog : Animal { public override void Walk() { // TODO: do something before walking // custom logic implemented by each subclass // TODO: walk with 4 legs // TODO: do something after walking } } class Bird : Animal { public override void Walk() { // TODO: do something before walking // custom logic implemented by each subclass // TODO: walk with 2 legs // TODO: do something after walking } } As you can see, the nice thing about form A is that every time you implement a subclass, you don't need to remember to include the initialization and finalization logic. This is much less error prone than form B. What's a standard convention for naming these methods? I like naming the public method Walk since then I can call Dog.Walk() which looks better than something like Dog.WalkExternal(). However, I don't like my solution of adding the suffix "Internal" for the protected method. I'm looking for a more standardized name. Btw, is there a name for this design pattern?

    Read the article

  • convert string to datetime vb.net

    - by sinae
    i need to convert strings to date format. the requirement is if current month is selected, the date should be getdate. if any other month is selected then it should be first of that month. the data coming in is "January 2010", "February 2010" and so on. but it should be inserted into sql server database as 01/01/10 or 02/01/10

    Read the article

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