Daily Archives

Articles indexed Monday March 8 2010

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

  • Windows 7 - cancel mirror synchronisation

    - by Chris W
    I've got basic disk OS managed disk mirroring setup in Windows 7 for a couple of volumes. After a power failure the mirrors are currently resynching. These are only small volumes of data but the sync has not completed after more than 24 hours. Is there any way to stop this as it's driving me nuts? I need to get the machine back to a usable state to get some work done but it's a bit of a dog whilst this synch is going on. I've tried removing the mirrors but it won't let me do that whilst the re-sync is in progress.

    Read the article

  • How is conversion of float/double to int handled in printf?

    - by Sandip
    Consider this program int main() { float f = 11.22; double d = 44.55; int i,j; i = f; //cast float to int j = d; //cast double to int printf("i = %d, j = %d, f = %d, d = %d", i,j,f,d); //This prints the following: // i = 11, j = 44, f = -536870912, d = 1076261027 return 0; } Can someone explain why the casting from double/float to int works correctly in the first case, and does not work when done in printf? This program was compiled on gcc-4.1.2 on 32-bit linux machine.

    Read the article

  • How to display image within cell boundary

    - by Jessy
    How can I place an image within the cell boundary? I mean without taking the space of other cell? In the code below, random cells were selected to display images. One image in one cell. The problem is that, the image seems to take other cells as well. ... setPreferredSize(new Dimension(600,600)); final int ROWS = 6; final int COLS = 6; final int IMAGES = 10; setLayout(new GridBagLayout()); GridBagConstraints gc = new GridBagConstraints(); gc.weightx = 1d; gc.weighty = 1d; gc.insets = new Insets(0, 0, 0, 0);//top, left, bottom, and right gc.fill = GridBagConstraints.NONE; JLabel[][] label = new JLabel[ROWS][COLS]; Random rand = new Random(); // fill the panel with labels for (int i=0;i<IMAGES;i++){ ImageIcon icon = createImageIcon("myImage.jpg"); int r, c; do{ //pick random cell which is empty to avoid overlap image in the same cell r = (int)Math.floor(Math.random() * ROWS); c = (int)Math.floor(Math.random() * COLS); } while (label[r][c]!=null); //scale the image int x = rand.nextInt(20)+30; int y = rand.nextInt(20)+30; Image image = icon.getImage().getScaledInstance(x,y, Image.SCALE_SMOOTH); icon.setImage(image); JLabel lbl = new JLabel(icon); gc.gridx = r; gc.gridy = c; add(lbl, gc); //add image to the cell label[r][c] = lbl; }

    Read the article

  • How do you hyperlink to Word 2007 help pages?

    - by Jeremy Rudd
    I want to hyperlink to a page within the Word 2007 Object Model Reference documentation, that ships with Word 2007. These are webpages that use the ms-help:// protocol that Firefox cannot understand. So I wanted to specify the ms-help:// path of the help page as a command line argument to the viewer, CLVIEW.EXE. C:\Program Files\Microsoft Office\Office12\CLVIEW.EXE Anybody know the command line syntax for this?

    Read the article

  • What's the next big thing after LINQ?

    - by Leniel Macaferi
    I started using LINQ (Language Integrated Query) when it was still in beta, more specifically Microsoft .NET LINQ Preview (May 2006). Almost 4 years have passed and here we are using LINQ in a lot of projects for the most diverse tasks. I even wrote my final college project based on LINQ. You see how I like it. LINQ and more recently PLINQ (Parallel LINQ) give our jobs a great boost when it comes to more programming power and less lines of code leading us to more expressive and readable code. I keep thinking what could be the next big language improvement for C# after LINQ. I know there are some promissing language features coming as Code Contracts, etc, but nothing having the impact that LINQ had. What do you think could be the next big thing?

    Read the article

  • Am I under risk of CSRF attacks in a POST form that doesn't require the user to be logged in?

    - by Monika Sulik
    I'm probably being a total noob here, but I'm still uncertain about what a CSRF (Cross-Site Request Forgery) attack is exactly. So lets look at three situations... 1) I have a POST form that I use to edit data on my site. I want this data to be edited only by users that are logged in. 2) I have a site, which can be used by both users who are logged in as well as guests. Parts of the site are for logged in users only, but there are also POST forms that can be used by all users - anonymous and not (for example a standard contact form). Should the contact form be safeguarded against CSRF attacks? 3) I have a site which doesn't have an authentication system at all (well, perhaps that's unrealistic, so lets say it has an admin site which is separate from the rest of it and the admin part is properly safeguarded). The main part of the site is only used by anonymous users. Do the POST forms on it need to be safeguarded? In the case of 1) the answer is clearly yes. But in the case of 2 and 3 I don't know (and is the difference between 2 and 3 even significant?).

    Read the article

  • Voice Recognition Connection problem

    - by user244190
    I,m trying to work through and test a Voice Recognition example based on the VoiceRecognition.java example at http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.html but when click on the button to create the activity, I get a dialog that says Connection problem. My Manifest file is using the Internet Permission, and I understand it passes the to the Google Servers. Do I need to do anything else to use this. Code below UPDATE: Ok, I was able to replace my emulator image with one from HTC that appears to come with Google Voice Search, however now when I run from the emulator, i'm getting an Audio Problem message with Speak Again or Cancel buttons. It appears to make it back to the onActivityResult(), but the resultCode is 0. Here is the LogCat output: 03-07 20:21:25.396: INFO/ActivityManager(578): Starting activity: Intent { action=android.speech.action.RECOGNIZE_SPEECH comp={com.google.android.voicesearch/com.google.android.voicesearch.RecognitionActivity} (has extras) } 03-07 20:21:25.406: WARN/ActivityManager(578): Activity is launching as a new task, so cancelling activity result. 03-07 20:21:25.968: WARN/ActivityManager(578): Activity pause timeout for HistoryRecord{434f7850 {com.ikonicsoft.mileagegenie/com.ikonicsoft.mileagegenie.MileageGenie}} 03-07 20:21:26.206: WARN/AudioHardwareInterface(554): getInputBufferSize bad sampling rate: 16000 03-07 20:21:26.256: ERROR/AudioRecord(819): Recording parameters are not supported: sampleRate 16000, channelCount 1, format 1 03-07 20:21:26.696: INFO/ActivityManager(578): Displayed activity com.google.android.voicesearch/.RecognitionActivity: 1295 ms 03-07 20:21:29.890: DEBUG/dalvikvm(806): threadid=3: still suspended after undo (s=1 d=1) 03-07 20:21:29.896: INFO/dalvikvm(806): Uncaught exception thrown by finalizer (will be discarded): 03-07 20:21:29.896: INFO/dalvikvm(806): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@435d3c50 on ml_trackdata that has not been deactivated or closed 03-07 20:21:29.896: INFO/dalvikvm(806): at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596) 03-07 20:21:29.896: INFO/dalvikvm(806): at dalvik.system.NativeStart.run(Native Method) 03-07 20:21:31.468: DEBUG/dalvikvm(806): threadid=5: still suspended after undo (s=1 d=1) 03-07 20:21:32.436: WARN/IInputConnectionWrapper(806): showStatusIcon on inactive InputConnection I,m still not sure why I,m getting the Connect problem on the Droid. I can use Voice Search ok. I also tried clearing the cache, and data as described in some posts, butstill not working?? /** * Fire an intent to start the speech recognition activity. */ private void startVoiceRecognitionActivity() { Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speech recognition demo"); startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE); } /** * Handle the results from the recognition activity. */ @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) { // Fill the list view with the strings the recognizer thought it could have heard ArrayList<String> matches = data.getStringArrayListExtra( RecognizerIntent.EXTRA_RESULTS); mList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, matches)); } super.onActivityResult(requestCode, resultCode, data); }

    Read the article

  • Calling handwritten CUDA kernel with thrust

    - by macs
    Hi, since i needed to sort large arrays of numbers with CUDA, i came along with using thrust. So far, so good...but what when i want to call a "handwritten" kernel, having a thrust::host_vector containing the data? My approach was (backcopy is missing): int CUDA_CountAndAdd_Kernel(thrust::host_vector<float> *samples, thrust::host_vector<int> *counts, int n) { thrust::device_ptr<float> dSamples = thrust::device_malloc<float>(n); thrust::copy(samples->begin(), samples->end(), dSamples); thrust::device_ptr<int> dCounts = thrust::device_malloc<int>(n); thrust::copy(counts->begin(), counts->end(), dCounts); float *dSamples_raw = thrust::raw_pointer_cast(dSamples); int *dCounts_raw = thrust::raw_pointer_cast(dCounts); CUDA_CountAndAdd_Kernel<<<1, n>>>(dSamples_raw, dCounts_raw); thrust::device_free(dCounts); thrust::device_free(dSamples); } The kernel looks like: __global__ void CUDA_CountAndAdd_Kernel_Device(float *samples, int *counts) But compilation fails with: error: argument of type "float **" is incompatible with parameter of type "thrust::host_vector *" Huh?! I thought i was giving float and int raw-pointers? Or am i missing something?

    Read the article

  • How to sort a list so that managers are always ahead of their subordinates

    - by James Black
    I am working on a project using Groovy, and I would like to take an array of employees, so that no manager follows their subordinates in the array. The reason being that I need to add people to a database and I would prefer not to do it in two passes. So, I basically have: <employees> <employee> <employeeid>12</employeeid> <manager>3</manager> </employee> <employee> <employeeid>1</employeeid> <manager></manager> </employee> <employee> <employeeid>3</employeeid> <manager>1</manager> </employee> </employees> So, it should be sorted as such: employeeid = 1 employeeid = 3 employeeid = 12 The first person should have a null for managers. I am thinking about a binary tree representation, but I expect it will be very unbalanced, and I am not certain the best way to do this using Groovy properly. Is there a way to do this that isn't going to involve using nested loops?

    Read the article

  • OS X firewall popup about growlnotify keeps popping up

    - by Vitaly Kushner
    I have autotest setup with growlnotify using growl_glue (version 1.0.7): require 'growl_glue' GrowlGlue::Autotest.initialize do |config| config.notification :use_network_notifications => true end growl version is 1.2 each time autotest runs and displays the notification growl popup I also get an OS X firewall popup asking Do you want the application "growlnotify" to accept incoming network connections? I tried answering deny and allow but it still keeps popping up. the deny/allow choice is properly reflected in System Preferences - Security - Firewall - 'application access list', but it still asks every time. update I ended up using autotest-growl gem instead of the growl_glue. it fixed the problem, it was probably related to how growl_glue was calling growlnotify.

    Read the article

  • Succinct introduction to C++/CLI for C#/Haskell/F#/JS/C++/... programmer

    - by Henrik
    Hello everybody, I'm trying to write integrations with the operating system and with things like active directory and Ocropus. I know a bunch of programming languages, including those listed in the title. I'm trying to learn exactly how C++/CLI works, but can't find succinct, exact and accurate descriptions online from the searching that I have done. So I ask here. Could you tell me the pitfalls and features of C++/CLI? Assume I know all of C# and start from there. I'm not an expert in C++, so some of my questions' answers might be "just like C++", but could say that I am at C#. I would like to know things like: Converting C++ pointers to CLI pointers, Any differences in passing by value/doubly indirect pointers/CLI pointers from C#/C++ and what is 'recommended'. How do gcnew, __gc, __nogc work with Polymorphism Structs Inner classes Interfaces The "fixed" keyword; does that exist? Compiling DLLs loaded into the kernel with C++/CLI possible? Loaded as device drivers? Invoked by the kernel? What does this mean anyway (i.e. to load something into the kernel exactly; how do I know if it is?)? L"my string" versus "my string"? wchar_t? How many types of chars are there? Are we safe in treating chars as uint32s or what should one treat them as to guarantee language indifference in code? Finalizers (~ClassName() {}) are discouraged in C# because there are no garantuees they will run deterministically, but since in C++ I have to use "delete" or use copy-c'tors as to stack allocate memory, what are the recommendations between C#/C++ interactions? What are the pitfalls when using reflection in C++/CLI? How well does C++/CLI work with the IDisposable pattern and with SafeHandle, SafeHandleZeroOrMinusOneIsInvalid? I've read briefly about asynchronous exceptions when doing DMA-operations, what are these? Are there limitations you impose upon yourself when using C++ with CLI integration rather than just doing plain C++? Attributes in C++ similar to Attributes in C#? Can I use the full meta-programming patterns available in C++ through templates now and still have it compile like ordinary C++? Have you tried writing C++/CLI with boost? What are the optimal ways of interfacing the boost library with C++/CLI; can you give me an example of passing a lambda expression to an iterator/foldr function? What is the preferred way of exception handling? Can C++/CLI catch managed exceptions now? How well does dynamic IL generation work with C++/CLI? Does it run on Mono? Any other things I ought to know about?

    Read the article

  • How to check if datetime is older than 20 seconds.

    - by Jelle
    Hello! This is my first time here so I hope I post this question at the right place. :) I need to build flood control for my script but I'm not good at all this datetime to time conversions with UTC and stuff. I hope you can help me out. I'm using the Google App Engine with Python. I've got a datetimeproperty at the DataStore database which should be checked if it's older than 20 seconds, then proceed. Could anybody help me out? So in semi-psuedo: q = db.GqlQuery("SELECT * FROM Kudo WHERE fromuser = :1", user) lastplus = q.get() if lastplus.date is older than 20 seconds: print"Go!"

    Read the article

  • Why does IE prompt a security warning when viewing an XML file?

    - by Tav
    Opening an XML file in Internet explorer gives a security warning. IE has a nice collapsible tree view for viewing XML, but it's disabled by default and you get this scary error message about a potential security hole. http://www.leonmeijer.nl/archive/2008/04/27/106.aspx But why? How can simply viewing an XML file (not running any embedded macros in it or anything) possibly be a security hole? Sure, I get that running XSLT could potentially do some bad stuff, but we're not talking about executing anything. We're talking about viewing. Why can't IE simply display the XML file as text (plus with the collapsible tree viewer)? So why did they label this as a security hole? Can someone describe how simply viewing an XML document could be used as an attack document?

    Read the article

  • Python 3.1.1 Class Question

    - by Protean
    I'm a new Python programmer who is having a little trouble using 'self' in classes. For example: class data: def __init__(self): self.table = [] def add(self, file): self.table.append(file) data.add('yes') In this function I want to have table be a variable stored in the class data and use add to modify it. However, when I run this script it gives me the error: Traceback (most recent call last): File "/Projects/Python/sfdfs.py", line 7, in <module> data.add('yes') TypeError: add() takes exactly 2 positional arguments (1 given) I assume that I am trying to call the function the wrong way in this instance, as this syntax is very similar to an example in the python documentation: http://docs.python.org/3.1/tutorial/classes.html

    Read the article

  • Virtualmin install failing on Rackspace Debian 5.0

    - by Rob
    Hi - Running the install.sh script as-is from Virtualmin (GPL version), I get a dovecot error after about 5.5mins of installation. I have tried this on several versions of the server - same error whether or not I run apt-get update +/- apt-get upgrade .... and whether or not I have the FQDN set. Here's the end of the installation: http://screencast.com/t/ZDkxMmY1NDQ Any hints/suggestions, etc. would be much appreciated... Thanks, Rob

    Read the article

  • HP ML350G6 running hyper-V 2008 r2 resets itself every 2 hours

    - by GT
    The system started resetting itself exactly every 2 hours. These are the messages in the iLO2 log: Informational iLO 2 03/07/2010 20:40 03/07/2010 20:40 1 Server power restored. Caution iLO 2 03/07/2010 20:40 03/07/2010 20:40 1 Server reset. It's not an ASR reset (that would show in the log) Redundant power supplies, swapped but no change. Turned off all virtual machines (i.e. now only running hypervisor) but not OK Boot HP smartstart diagnostics disk, ALL OK Diagnostic disk reports no errors Went back to booting Hypervisor and the problem is back. Seems the hyper-V system disk has got a time based program (virus) causing the reset. I thought the hypervisor had a small attack surface and should be OK. All virtual machines (SBS2008, Win7 and Win XP) and network computers are protected with TrendMicro WFBS. I am about to rebuild the disk (I have backups) but wondered if there were any suggestions to try first???

    Read the article

  • Troubleshooting PC

    - by srand
    After playing PC games after a few hours I decided to take a break. When I opened up My Computer in Windows 7 I noticed I one of my drives had disappeared. Thinking it was just a glitch, I tried to restart. Upon restart, the BIOS took forever to get through (I didn't notice my disappeared hard drive in the listed drives) and the computer seemed stuck at the "Start Windows" screen. I hard shut down everything. Opened up the case, used canned air to clear the dust out and made sure all devices were snugly in place. I hooked everything up and powered on. This time, after a few seconds the computer restarted (nothing showed up on screen either). After its restart, the computer didn't do anything. The hard drive indicator light was on the whole time. What happened? :( PC Specs: Windows 7, 3GB RAM, Core 2 Duo, 3 Hard drives

    Read the article

  • tweak windows 7 virtual memory and cache / caching settings

    - by bortao
    im on windows 7 64 bit, with 4gb of memory whenever i copy or deal with a big ammount of data, windows swaps out everything from memory to the virtual memory swapfile, to make room to data cache. the problem is: i dont really need caching of this data im copying, its being copied only once, cacheing this data won't help me. on the other hand, swapping out the programs will give me a big lag time whenever i want to use those open programs again. what i want: restrict data cache to a certain ammount, lets say 1gb, or reserve a certain ammount of memory, lets say 2gb, exclusively for running programs memory. my swap file is on a separate partition, but i still have problems with swapping time.

    Read the article

  • How to reset video/display drivers in Vista without restarting OS?

    - by jdk
    Currently I have to reboot my system if an external monitor is hooked up for it to be correctly detected and used. I think it would be faster to restart/reset the video or display drivers instead. How do I do this under Vista? I seem to remember from an old laptop using a Windows command-line command that would restart the wireless networking card device when it crashed. Is there something like that for video drivers? Background/Reason Because people rightfully ask why? - This is part of a larger problem which I'm waiting for resolution on from the manufacturer. In the meantime I'm looking for the above quick fix. Actually my video card often crashes my laptop when attaching an external monitor and trying to detect or use it. No solution from vendor yet and latest drivers do the same irksome behaviour. Windows says: A problem with your video hardware caused Windows to stop working correctly.

    Read the article

  • Python web server

    - by Ben
    Hi I'd like to get suggestions on the best way to serve python scripts up as web pages. Typically I'd like a way for me and my colleagues to write simple web pages with minimal effort ie we focus on the business logic eg creating simple forms etc. Possibly with some way to manage sessions but this is a nice-to-have. It doesn't have to be WYSIWYG as they are developers but we are busy and don't want to spend long turning an idea into reality. It's for internal use so appearances are not paramount. The software required to enable this should be easy to setup and configure. eg adding new directories and python lib dirs should be easy. My first instinct is apache or tomcat with mod_python. Any comments / suggestions welcome. Thanks in advance.

    Read the article

  • Why are my "tel:" links not working

    - by Griffo
    I have a tableView which has cells with phone numbers. The app is not dialing the numbers though. See the code below - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 2) { UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath]; NSString *numberToDial = [NSString stringWithFormat:@"tel:%@", selectedCell.detailTextLabel.text]; NSLog(@"%@",numberToDial); [[UIApplication sharedApplication] openURL:[NSURL URLWithString:numberToDial]]; } } Console ouput: 2010-03-08 01:32:30.830 AIB[1217:207] tel:01 8350098 As you can see, the number goes to the console, but doesn't get dialled. The weird thing is, if I change the last statement to this: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:171"]]; the phone dials the number 171 without any issue

    Read the article

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