Daily Archives

Articles indexed Thursday June 17 2010

Page 14/121 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • In a Virtual Machine, is the Virtual Processor using RAM or part of the Processor?

    - by Jason H
    I am running a 15" MacBook Pro (2.66GHz) and 4GB of RAM. I am considering downgrading to a 13 MacBook Pro (2.4GHz) with 8GB of RAM. Most of what I do at work is through Windows and I need to run it virtually. So my real question is when running a virtual machine will the virtual processor be utilizing RAM or part of the hosts processor? My assumption is that it will utilize the allocated RAM but I have seen zero documentation to support that.

    Read the article

  • How to port real time video service by FMS from PC to mobile phone(symbian,android,iphone)?

    - by wamp
    Now I've set up the flash application to work in to stage: the uploading stage: uploading the stream from pc A's camera to FMS play stage: watch the real time stream from PC B's browser I want to make stage 2 work on mobile phones too. But currently it's using flash(actionscript) to connect and play the stream, which is not supported out of the box. How to port this kind of application to mobile phones?

    Read the article

  • xcode compile console application - c programming

    - by Alan
    Is it possible to use Xcode using iPhone 3.1.3 SDK to compile a standard C program that will work on the iphone? I'm trying to use xcode to compile a basic 'hello world' but to no avail. Do I need to obtain an additional application template or am I just missing something?

    Read the article

  • How to handle array element between int and Integer

    - by masato-san
    First, it is long post so if you need clarification please let me know. I'm new to Java and having difficulty deciding whether I should use int[] or Integer[]. I wrote a function that find odd_number from int[] array. public int[] find_odd(int[] arr) { int[] result = new int[arr.length]; for(int i=0; i<arr.length; i++) { if(arr[i] % 2 != 0) { //System.out.println(arr[i]); result[i] = arr[i]; } } return result; } Then, when I pass the int[] array consisting of some integer like below: int[] myArray = {-1, 0, 1, 2, 3}; int[] result = find_odd(myArray); The array "result" contains: 0, -1, 0, 1, 0, 3 Because in Java you have to define the size of array first, and empty int[] array element is 0 not null. So when I want to test the find_odd() function and expect the array to have odd numbers (which it does) only, it throws the error because the array also includes 0s representing "empty cell" as shown above. My test code: public void testFindOddPassValidIntArray() { int[] arr = {-2, -1, 0, 1, 3}; int[] result = findOddObj.find_odd(arr); //check if return array only contain odd number for(int i=0; i<result.length; i++) { if(result[i] != null) { assert is_odd(result[i]) : result[i]; } } } So, my question is should I use int[] array and add check for 0 element in my test like: if(result[i] != 0) { assert is_odd(result[i] : result[i] } But in this case, if find_odd() function is broken and returning 0 by miscalculation, I can't catch it because my test code would only assume that 0 is empty cell. OR should I use Integer[] array whose default is null? How do people deal with this kind of situation?

    Read the article

  • How to create a rails staging environment in engineyard?

    - by siulamvictor
    I have a production instance in engineyard up and running well. I would like to create a new staging instance for internal testing. I cloned the existing production instance, changed Framework Environment to staging. I can deploy all the code to staging instance from Github. Engineyard reported the server is fully configured and ready. I have subdomain-fu in my Rails app, as I have some subdomain handling in my app. I set the subdomain initializer like this.... SubdomainFu.tld_sizes = {:development => 1, :test => 0, :production => 1, :staging => 2} As the production instance is using the domain xxxxx.com, I would like my staging instance use the domain staging.xxxxx.com. But I got an error when open this domain. Seems the app use xxxxx.com as domain but not the staging.xxxxx.com. I checked the engineyard database.yml. It use xxxxx_production database, I supposed it should be xxxxx_staging. Seems the engineyard instance is not set to staging environment, but just clone all the setting from production server. Does anyone have experience with this and can show me the way on how to fix it? Thanks. :)

    Read the article

  • I have a generic implementation of mcrypt and its not working.

    - by Ken Mitchner
    class Crypt_Data { protected $_mcrypt=null; protected $_iv=null; protected $_key=null; public function __construct() { $this->_mcrypt = mcrypt_module_open('rijndael_256', '', 'cbc', ''); $key_size = mcrypt_enc_get_key_size($this->_mcrypt); for($i=0;$i<$key_size;$i++) $test_key .= "0"; $this->_iv = $test_key; $this->_key = $test_key; mcrypt_generic_init($this->_mcrypt,$this->_key,$this->_iv); } public function dataEncrypt($data) { return base64_encode(mcrypt_generic($this->_mcrypt, $data)); } public function dataDecrypt($data) { return mdecrypt_generic($this->_mcrypt, base64_decode($data)); } } $crypt = new Crypt_Data(); $string = "encrypt me"; $encrypted = $crypt->dataEncrypt($string); echo $encrypted."<BR>"; $decrypted = $crypt->dataDecrypt($encrypted); echo $decrypted."<BR>"; output: JJKfKxZckkqwfZ5QWeyVR+3PkMQAsP0Gr1hWaygV20I= qÌÌi_ÖZí(®`iÜ¥wÝÿ ô0€Í6Ÿhf[%ër No idea why this isn't working, everything seems to be find on my end.. i tried decrypting it with mcrypt_cbc(); and it decrypted it properly.. so it has something to do with my mdecrypt_generic.. any ideas?

    Read the article

  • JQuery fadeIn fadeOut loop issue

    - by Tarun
    I am trying to create a jQuery fadeIn fadeout effect for my page content using the code below. $(document).ready(function (){ $("#main").click(function(){ $("#content").fadeOut(800, function(){ $("#content").load("main.html", function(){ $("#content").fadeIn(800); }); }); }); $("#gallery").click(function(){ $("#content").fadeOut(800, function(){ $("#content").load("gallery.html", function(){ $("#content").fadeIn(800); }); }); }); }); So whenever a user clicks on either the main link or gallery link, the old content fades out and new content fades in. The problem I am facing is that for every link I have to repeat the same code again and again. So I tried to use a loop to simplify this but it doesn't work. Here is my code: var p = ["#main","#gallery", "#contact"]; var q = ["main.html", "gallery.html", "contact.html"]; for (i=0;i<=(p.length-1);i++){ $(p[i]).click(function(){ $("#content").fadeOut(500, function(){ $("#content").load(q[i], function(){ $("#content").fadeIn(500); }); }); }); } It works fine when I write repeat the scripts for each link but it doesn't work when I combine them in a loop. I only get the FadeOut effect and nothing happens after that. This might be a very simple issue or may be something deep into jQuery. Any hint or help is greatly appreciated. TK

    Read the article

  • Drupal path alias not found

    - by Eric M
    Got a Drupal6 install, and I'm using a webform to collect some data. The webform has a path alias set on the edit page as 'contact_us'. The issue that I can't figure out (and hard to reproduce) is from time to time, some users end up on the page 'node/'. Seems like that is a possible failure trying to find the alias or system path. Any one seen this before? Any suggestions on some places to look or to why this is happening? Regards

    Read the article

  • Java SOAP - Need help on Body and ChildElement manipulation

    - by techventure
    Hi guys I'm trying to write some code in java to learn more about coding with WSDL and SOAP. I've been able to build up a BodyElement for a given namespace. But when i come to adding the childElements I'm runnig intp problems. For example given :'<'to:checkAccount xmlns:to="http://foo" '<'to:id test' <'/to:id '<'to:password test '<'/to:password '<'to:checkAccount " I'm able to set the bodyElement(to:checkAccount), but when i try to add the childElements (to:id, to:password) , the childElement needs to have the "to" prefix otherwise it won't work. ie. sf = SOAPFactory.newInstance(); Name childName = sf.createName("id"); SOAPElement symbol = bodyElement.addChildElement(childName); this doesn't work since it doesn't have the "to" prefix to id and password. I cannot do Name childName = sf.createName("id","to",null); as it gives me an error saying wrong namespace... can someone tell me how i can add to:id and to:password to to:checkAccount ?

    Read the article

  • validations in XML

    - by charan
    hi all.. i have a address.java file with a textField as PostCode. in that only number should accepted. if i try to enter characters in that it sould popup a message. these validation must be done in address.xml file only i tried by giving the validation as <testcase> <messageType>error</messageType> <validationType>isDigit</validationType> <validationRule>5</validationRule> </testcase> but its not working. plz anybody can help me in solving this

    Read the article

  • Verify an event was raised by mocked object

    - by joblot
    In my unit test how can I verify that an event is raised by the mocked object. I have a View(UI) -- ViewModel -- DataProvider -- ServiceProxy. ServiceProxy makes async call to serivce operation. When async operation is complete a method on DataProvider is called (callback method is passed as a method parameter). The callback method then raise and event which ViewModel is listening to. For ViewModel test I mock DataProvider and verify that handler exists for event raised by DataProvider. When testing DataProvider I mock ServiceProxy, but how can I test that callback method is called and event is raised. I am using RhinoMock 3.5 and AAA syntax Thanks -- DataProvider -- public partial class DataProvider { public event EventHandler<EntityEventArgs<ProductDefinition>> GetProductDefinitionCompleted; public void GetProductDefinition() { var service = IoC.Resolve<IServiceProxy>(); service.GetProductDefinitionAsync(GetProductDefinitionAsyncCallback); } private void GetProductDefinitionAsyncCallback(ProductDefinition productDefinition, ServiceError error) { OnGetProductDefinitionCompleted(this, new EntityEventArgs<ProductDefinition>(productDefinition, error)); } protected void OnGetProductDefinitionCompleted(object sender, EntityEventArgs<ProductDefinition> e) { if (GetProductDefinitionCompleted != null) GetProductDefinitionCompleted(sender, e); } } -- ServiceProxy -- public class ServiceProxy : ClientBase<IService>, IServiceProxy { public void GetProductDefinitionAsync(Action<ProductDefinition, ServiceError> callback) { Channel.BeginGetProductDefinition(EndGetProductDefinition, callback); } private void EndGetProductDefinition(IAsyncResult result) { Action<ProductDefinition, ServiceError> callback = result.AsyncState as Action<ProductDefinition, ServiceError>; ServiceError error; ProductDefinition results = Channel.EndGetProductDefinition(out error, result); if (callback != null) callback(results, error); } }

    Read the article

  • Weird constants

    - by Quassnoi
    I've seen these in real code: #define SCREEN_DIMENSIONS 2 #define THREE_THOUSAND_FIVE_HUNDRED_TWENTY_TWO 3522 What is the weirdest constant you've ever seen? P. S. And of course my favorite in JScript: bool b; switch (b.ToString().length) { case 4: // true ... break; case 5: // false ... break; )

    Read the article

  • Visual Studio 2010 error: Type universe cannot resolve assembly

    - by dthrasher
    I've loaded a WPF project initially created in Visual Studio 2008 into Visual Studio 2010. The conversion process goes smoothly, but on certain XAML files the VS2010 designer throws several errors related to project references, including this one: System.Reflection.Adds.UnresolvedAssemblyException Type universe cannot resolve assembly: GalaSoft.MvvmLight, Version=3.0.0.31869, Culture=neutral, PublicKeyToken=3e875cdb3903c512. This assembly reference works just fine in the Expression Blend 4 designer, but not in VS2010. I can build and run the solution successfully. My solution targets the .Net Framework 3.5 SP1.

    Read the article

  • Format date in hql query

    - by user115520
    hi all, i want to format date to string in hql select, for example i have purchasing data with transaction date in it: class Purchase { private Date datePurchase } and i want to select date in a certain format, for example yyyyMMdd, can i do that in hql? actually i can iterate through all purchase data returned by query, and start to format the date using SimpleDateFormat, but i don't want do that, i want to do it in hql, is it posible? fyi, i just want to return the id and date string only, not all Purchase field. thak you all for any help.

    Read the article

  • reCaptcha accepts wrong answers sometimes

    - by frankadelic
    We are using recaptcha ASP.NET control: http://recaptcha.net/plugins/aspnet/ However, we find that in some situations, recaptcha accepts answers which are clearly wrong. For example, recaptcha provided these words: of purser The tester typed in the following: o purser ..but Page.IsValid returned true! Is this a known issue with recaptcha?

    Read the article

  • Finding databases for use in applications

    - by JonF
    Does anyone have some recommendations on how I can find databases for random things that I might want to use in my application. For example, a database of zip code locations, area code cities, car engines, IP address locations, or whatever. I'm just asking generally when you decide you need a bunch of data where are some good places to start looking other than google?

    Read the article

  • Jquery UI Dialog Weird Behavior in Firefox - Whole screen becomes non-clickable on second overlay

    - by Dondon Vizcayno
    I have two links that show up two modal dialogs. These dialogs are static divs in the html of the page with their own ids. When I click the first link, the first dialog shows up and behaves correctly. But when I click the second link, the whole screen grays out and everything becomes unclickable, including the second dialog. It happens also the other way around, clicking the second link, and then the first link. This problems occurs only in Firefox but not in IE. Any ideas why this is happening in Firefox?

    Read the article

  • export to csv using fastercsv and CSV::Writer (Ruby on Rails)

    - by Venkat
    What am I trying to do: export data to csv. I have a form which allows user to select the format (from a drop down menu). So based on the selection of the format the ouput is displayed using a ajax call. Works fine for html but when I select the format as csv I don't see any pop up on the screen (asking to save or open the file) and neither any file gets downloaded directly. I tried using Fastercsv (but the problem is that I don't see any pop up asking me whether I want to save or open the file) and CSV::Writer where I get this error message on the console. NoMethodError (You have a nil object when you didn't expect it! The error occurred while evaluating nil.bytesize): actionpack (2.3.4) lib/action_controller/streaming.rb:142:in `send_data' Code using Fastercsv: def export_to_csv csv_string = FasterCSV.generate(:col_sep => ",") do |csv| members = ["Versions / Project Members"] members_selected.each {|member| members << Stat.member_name(member)} Stat.project_members(project).each {|user| members << user.name} csv << ["some text", "text 2", "text 3"] end return csv_string end and this is how I am sending the data: send_data(export_to_csv,:type => 'text/csv; charset=iso-8859-1; header=present', :disposition => "attachment", :filename => "filename.csv") I see the response as "some text, text 2, text 3" in the firebug console but no pop up asking whether I want to save or open the file. This is what I am doing using CSV::Writer: def export_to_csv report = StringIO.new CSV::Writer.generate(report, ',') do |csv| csv << ['c1', 'c2'] end end and call it as: send_data(export_to_csv,:type => 'text/csv; charset=iso-8859-1; header=present', :disposition => "attachment", :filename => "filename.csv") This is the error which is thrown on the console: NoMethodError (You have a nil object when you didn't expect it! The error occurred while evaluating nil.bytesize): actionpack (2.3.4) lib/action_controller/streaming.rb:142:in `send_data'

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >