Daily Archives

Articles indexed Thursday May 20 2010

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

  • Buttons with equal heights.

    - by Rpond
    Linear layout below. This layout is aligned parent bottom in a Relative Layout. Problem is I want all buttons to have the same height. I have tried layout_gravity="fill" but that doesn't seem to work. <LinearLayout android:id="@+id/button_layout" android:layout_height="wrap_content" android:layout_width="fill_parent" android:background="#FFFFFF" android:layout_alignParentBottom="true"> <Button android:text="Send" android:id="@+id/send_button" android:layout_weight="1" android:layout_gravity="fill" android:layout_width="0dip" android:layout_height="wrap_content"> </Button> <Button android:text="Report Missing Image" android:id="@+id/report_button" android:layout_weight="1" android:layout_width="0dip" android:layout_height="wrap_content"> </Button> <Button android:text="Close" android:id="@+id/close_button" android:layout_weight="1" android:layout_gravity="fill" android:layout_width="0dip" android:layout_height="wrap_content"> </Button> </LinearLayout>

    Read the article

  • Play sound in mobile browser?

    - by John
    I want to make myself a web based stop watch for training that I can use on my Blackberry mobile browser. The stopwatch should count 3 minutes, then ring a bell, wait 1 minute, then ring another bell and then repeat. My problem is I can't seem to get sound to work on my blackberry browser. I tried using <embed src="bell.wav"> which works fine in the browser of a normal computer, but it doesn't make a sound on my blackberry. Should I build this stopwatch with Javascript and HTML or should I build it with flash?

    Read the article

  • Can't get correct package from Nexus? error in "mvn help:effective-settings"

    - by larry cai
    I use nexus opensource version maven 2.2.1 When I type "mvn help:effective-settings", i got the error below [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'help'. [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error building POM (may not be this project's POM). Project ID: org.apache.maven.plugins:maven-help-plugin Reason: Error getting POM for 'org.apache.maven.plugins:maven-help-plugin' from the repository: Failed to resolve artifact, possibly due to a repository list that is not appropriately equipped for this artifact's metadata. org.apache.maven.plugins:maven-help-plugin:pom:2.2-SNAPSHOT from the specified remote repositories: Nexus (http://192.168.56.191:8081/nexus/content/groups/public) for project org.apache.maven.plugins:maven-help-plugin When I check the local repository under ~.m2\repository\org\apache\maven\plugins\maven-help-plugin It has a file maven-metadata-central.xml <?xml version="1.0" encoding="UTF-8"?> <metadata> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-help-plugin</artifactId> <versioning> <latest>2.2-SNAPSHOT</latest> <release>2.1.1</release> <versions> <version>2.0</version> <version>2.0.1</version> <version>2.0.2</version> <version>2.1</version> <version>2.1.1</version> <version>2.2-SNAPSHOT</version> </versions> <lastUpdated>20100519065440</lastUpdated> </versioning> </metadata> And I can't find any jar files under directory, what's wrong with nexus server ? I can't easily find support information from nexus. Any hints

    Read the article

  • What would be the wisest choice for a new .Net RESTful web service?

    - by Phil.Wheeler
    I want to write my first REST web service using the .Net framework. I've seen fairly passionate comments from various people about which is best and have even found some differing comments from Microsoft. My web service should be fairly simple: I want to expose bus timetable information. I figure the resources I will be concerned about are Fares Timetables (routes, stops) What would be the most appropriate (i.e. not necessarily the easiest, most fun or your personal preference) technology to use out of WCF, ADO.NET Data Services or ASP.Net MVC?

    Read the article

  • Performance Testing Versus Unit Testing

    - by Mystagogue
    I'm reading Osherove's "The Art of Unit Testing," and though I've not yet seen him say anything about performance testing, two thoughts still cross my mind: Performance tests generally can't be unit tests, because performance tests generally need to run for long periods of time. Performance tests generally can't be unit tests, because performance issues too often manifest at an integration or system level (or at least the logic of a single unit test needed to re-create the performance of the integration environment would be too involved to be a unit test). Particularly for the first reason stated above, I doubt it makes sense for performance tests to be handled by a unit testing framework (such as NUnit). My question is: do my findings / leanings correspond with the thoughts of the community?

    Read the article

  • Getting Unit Tests to work with Komodo IDE for Python

    - by devoured elysium
    I've tried to run the following code on Komodo IDE (for python): import unittest class MathLibraryTests(unittest.TestCase): def test1Plus1Equals2(self): self.assertEqual(1+1, 2) Then, I created a new test plan, pointing to this project(file) directory and tried to run it the test plan. It seems to run but it doesn't seem to find any tests. If I try to run the following code with the "regular" run command (F7) class MathLibraryTests(unittest.TestCase): def testPlus1Equals2(self): self.assertEqual(1+1, 2) if __name__ == "__main__": unittest.main() it works. I get the following output: ---------------------------------------------------------------------- Ran 1 test in 0.000s OK What might I be doing wrong?

    Read the article

  • How to create a custom render extension in SSRS 2008.

    - by bk
    Hi, Please let me know that how can I create a custom render extension in SSRS 2008. I have created it in SSRS 2005, but when I try using the same code in SQL Serever 2008, it does not work. The IRenderingExtension interface doesnot seem to be compatible with 2008. It gives the following compilation error: Class 'Renderer' must implement 'Function Render(report As Report, reportServerParameters As System.Collections.Specialized.NameValueCollection, deviceInfo As System.Collections.Specialized.NameValueCollection, clientCapabilities As System.Collections.Specialized.NameValueCollection, ByRef renderProperties As System.Collections.Hashtable, createAndRegisterStream As Interfaces.CreateAndRegisterStream) As Boolean' for interface 'Microsoft.ReportingServices.OnDemandReportRendering.IRenderingExtension'. Please help..........

    Read the article

  • XCode - Run Focussed Test

    - by Akshay
    In XCode - Is there a way of running just one test(one test case or preferably one test method). What I do today is to run the 'Test' task which runs all tests and takes up a lot of time. Thanks

    Read the article

  • Should we use server generated XAML to deliver our Silverlight/WPF UIs?

    - by brownj
    Back in January 2009, Dino Esposito published an article on MSDN titled "Managing Dynamic Content Delivery In Silverlight". We are considering using an approach like this for an upcoming project and were wondering if anyone had any advice on whether this is a good approach. Are there any traps or pitfalls we should look out for? We currently use Prism and would need to look at how the two would live happily together.

    Read the article

  • Rspec - Rails - How to follow a redirect

    - by Jonas Söderström
    Does anyone know how to make rspec follow a redirect (in a controller spec)? (e.g test/unit has follow_redirect!) I have tried "follow_redirect!" and "follow_redirect" but only get undefined method `follow_redirect!' for #<Spec::Rails::Example::ControllerExampleGroup::Subclass_1:0xb6df5294>

    Read the article

  • Push a bookmark to a user's home screen in Android

    - by JohnTheBarber
    Android 2.1 (not sure how much that matters) My test hardware is a Motorola Droid (not sure how much that matters either) I want to push a bookmark/internet-shortcut to a user's home screen as a result of them clicking on a link - via their browser of choice. I know they can usually set the bookmark themselves and then choose to put it on their home screen. But I'd like to provide a link like "Put a shortcut to this page on your home screen" that takes care of everything kind of in the background/underneath. Is this even possible? What parts of the framework would I need access to to make it happen?

    Read the article

  • How to rename everything matching a certain string in a folder

    - by lostiniceland
    Hello Everyone I am running Linux and I have some basic console knowledge but my current problem is quite difficult and I dont know how to achieve this. I want/need to rename everything within a folder that matches a given string. By everything I mean folders/files content within a file content in hidden files Basically I want to refactor a Java-project. Sure, I could use Eclipse to handle the replacing, but this leaves out the folders or resources outside of my workspace. I was thinking of a script that could do the job for me but this seems rather tricky. For instance when it comes to folder-/file-rename I want to replace only the part of the name that matches my string, the rest should remain untouched. Maybe someone already has something like this in his/her script-collection :-) Thanks in advance Marc

    Read the article

  • Des chinois réalisent le transfert de données par D.E.L., cette technologie a-t-elle un avenir ?

    Des chinois réalisent le transfert de données par D.E.L., cette technologie a-t-elle un avenir ? Des chercheurs de l'Académie Chinoise des Sciences ont réussi à utiliser des diodes électroluminescentes (D.E.L.) pour transférer sans fil des données vers un ordinateur portable à une vitesse de deux mégabits. Cette nouvelle technique d'envoi et de réception de données permettrait également d'éclairer le domicile de son utilisateur. Une utilisation pour seconde le système électrique d'un foyer est déjà étudiée pour une arrivée prochaine. Le prix élevé des D.E.L. pourrait cependant être un frein à l'adoption de cette technologie, qui est cependant déjà utilisée par Palm pour des transferts de données par IrDA (infrarouge)...

    Read the article

  • Are there programming languages taht rely on non-latin alphabets?

    - by Jaxsun
    Every programming language I have ever seen has been based on the Latin alphabet, this is not surprising considering I live in Canada... But it only really makes sense that there would be programming languages based on other alphabets, or else bright computer scientists across the world would have to learn a new alphabet to go on in the field. I know for a fact that people in countries dominated by other alphabets develop languages based off the Latin alphabet (eg. Ruby from Japan), but just how common is it for programming languages to be based off of other alphabets like Arabic, or Cyrillic, or even writing systems which are not alphabetic but rather logographic in nature such as Japanese Kanji? Also are any of these languages in active widespread use, or are they mainly used as teaching tools? This is something that has bugged me since I started programming, and I have never run across someone who could think of a real answer.

    Read the article

  • Alpha blending colors in .NET Compact Framwork 2.0

    - by Adam Haile
    In the Full .NET framework you can use the Color.FromArgb() method to create a new color with alpha blending, like this: Color blended = Color.FromArgb(alpha, color); or Color blended = Color.FromArgb(alpha, red, green , blue); However in the Compact Framework (2.0 specifically), neither of those prototypes are valid, you only get: Color.FromArgb(int red, int green, int blue); and Color.FromArgb(int val); The first one, obviously, doesn't even let you enter an alpha value, but the documentation for the latter shows that "val" is a 32bit ARGB value (as 0xAARRGGBB as opposed to the standard 24bit 0xRRGGBB), so it would make sense that you could just build the ARGB value and pass it to the function. I tried this with the following: private Color FromARGB(byte alpha, byte red, byte green, byte blue) { int val = (alpha << 24) | (red << 16) | (green << 8) | blue; return Color.FromArgb(val); } But no matter what I do, the alpha blending never works, the resulting color always as full opacity, even when setting the alpha value to 0. Has anyone gotten this to work on Compact Framework?

    Read the article

  • Jquery background overlay/alert without .onclick event - php responder?

    - by Philip
    Hi guys, I have no experience with jquery or javascript for that matter. I am trying to implement this technique to respond to users for errors or messages in general. lights-out-dimmingcovering-background-content-with-jquery This method uses the onclick event and that's not what im after, I have tried to replace .onclick with .load but that doesn't seem to work. I'm after a quick fix as I really don't have the time to learn jquery or its event handlers. The goal is to catch any errors or message's and once these are called the alert box is called without any further actions such as .onclick. How my code would look: {PHP} $forms = new forms(); if(count($forms->showErrors) > 0 // or == true) { foreach($forms->showErrors as $error) { print('<p class="alert">'.htmlspecialchars($error, ENT_QUOTES).'</p>'); } }

    Read the article

  • No flow definition found. Spring web flow

    - by user184794
    Hi, I am new to Spring webflow and now I am trying the example in Spring recipes book and I know this is a basic question. I am getting the error as follows, org.springframework.webflow.definition.registry.NoSuchFlowDefinitionException: No flow definition '${flowExecutionUrl}&_eventId=next' found at org.springframework.webflow.definition.registry.FlowDefinitionRegistryImpl.getFlowDefinitionHolder(FlowDefinitionRegistryImpl.java:126) at org.springframework.webflow.definition.registry.FlowDefinitionRegistryImpl.getFlowDefinition(FlowDefinitionRegistryImpl.java:61) at org.springframework.webflow.executor.FlowExecutorImpl.launchExecution(FlowExecutorImpl.java:138) at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:193).... Shown below is my configurations, <bean name="flowController" class="org.springframework.webflow.mvc.servlet.FlowController"> <property name="flowExecutor" ref="flowExecutor"></property> </bean> <webflow:flow-executor id="flowExecutor" /> <webflow:flow-registry id="flowRegistry" > <webflow:flow-location path="/WEB-INF/flows/welcome/welcome.xml"></webflow:flow-location> </webflow:flow-registry> /WEB-INF/flows/welcome/welcome.xml, <view-state id="welcome"> <transition on="next" to="introduction" /> <transition on="skip" to="menu" /> </view-state> <view-state id="introduction"> <on-render> <evaluate expression="libraryService.getHolidays()" result="requestScope.holidays" /> </on-render> <transition on="next" to="menu" /> </view-state> <view-state id="menu"></view-state> In welcome.jsp, <a href="${flowExecutionUrl}&_eventId=next">Next</a> <a href="${flowExecutionUrl}&_eventId=skip">Skip</a> Please let me know what is going wrong. I am using 2.0.9 Release. Thanks in advance, SD

    Read the article

  • UIView scaled to thumbprint, what about subviews?

    - by Parad0x13
    I have a UIImageView that I create progmatically right? Works like a charm when I initWithImage and set the parameters for scaling to UIViewContentModeScaleToFill. I can scale all day long and create many different smaller 'thumbprint' sized versions of the UIImageView at whim, HOWEVER when I add subviews to said UIImageView and then try to scale the happy new parent the child subview does not scale! I looked around and found that I should enable the setAutoresizingSubviews boolean of the parentView to true (Which I did) and then call: ChildView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; Which I also did... now when I scale the parent view the child also scales but crazy wacked out like and goes all over the place (Not a very good way of putting it) but my point is that I assumed the child would scale proportionally to the parent and stay in the same place (Which it doesn't) My question is how do I set up my code so that when I scale my parent view by 1/4 or w/e to make a thumbprint of the view the children subviews that the parent view owns will scale accordingly and allow the 1/4 sized thumbprint to look just like the full sized view (Just smaller).

    Read the article

  • Need simple advice for graph solving problem

    - by sap
    Hi there, a collegue of mine proposed to me an exercise from an online judge website, which is basically a graph solving problem of an evacuation plan on a small town. i dont need the answer (nor do i want it) i just need an advice on which is the best approach to solving it since im kinda new to these kind of problems. the problem consists of town buildings with workers and fallout shelters in case of a nuclear attack. i have to build an algorithm that will assign the workers of each building to one or more fallout shelters but in a way that some shelters wont became too overcrowded while others remain almost empty (else i would just make the workers go to the nearest one). the problem is this: http://acm.timus.ru/problem.aspx?space=1&num=1237 in case its offline heres the google cached version of it: http://webcache.googleusercontent.com/search?q=cache:t2EPCzezs7AJ:acm.timus.ru/problem.aspx%3Fspace%3D1%26num%3D1237+vladimir+kotov+evacuation+problem&cd=1&hl=pt-PT&ct=clnk&gl=pt what i've done so far is for each building get the nearest shelter and move the number of workers from that build equal to the shelter capacity. then move to the next building. but sometimes the number of workers is greater than the shelter capacity, in that case after i iterate through every building, ill just iterate then again apllying the same algorithm until every building has 0 workers in it, problem is this is hardly the best way to solve it. any tip is welcome, please dont feel like im asking for the answer, i just want an advice in the right direction of solving it. thanks in advance.

    Read the article

  • ASP.NET MVC 2: Custom client side validation rule for dropdowns

    - by Nigel
    I have some custom validation that I need to perform that involves checking the selected option of a dropdown and flagging it as invalid should the user select a specific option. I am using ASP.NET MVC 2 and have a custom Validator and custom server side and client side validation rules as described in this blog article. The server side validation is working fine, however, the client side validation is failing. Here is the javascript validation rule: Sys.Mvc.ValidatorRegistry.validators["badValue"] = function(rule) { var badValue = rule.ValidationParameters["badValue"]; return function(value, context) { if (value != badValue) { return true; } return rule.ErrorMessage; }; }; The rule is being applied to the dropdowns successfully, and placing a breakpoint within the returned function confirms that the validation is firing, and that the 'badValue' is being correctly set. However, 'value' is always null, and so the check always fails. What am I doing wrong?

    Read the article

  • C# Preprocessor Directives

    - by MarkPearl
    Going back to my old c++ days at university where we had all our code littered with preprocessor directives - I thought it made the code ugly and could never understand why it was useful. Today though I found a use in my C# application. The scenario – I had made various security levels in my application and tied my XAML to the levels by set by static accessors in code. An example of my XAML code for a Combobox to be enabled would be as follows… <ComboBox IsEnabled="{x:Static security:Security.SecurityCanEditDebtor}" />   And then I would have a static method like this… public static bool SecurityCanEditDebtorPostalAddress { get { if (SecurityCanEditDebtorPostalAddress) { return true; } else { return false; } } } My only problem was that my XAML did not like the if statement – which meant that while my code worked during runtime, during design time in VS2010 it gave some horrible error like… NullReferenceException was thrown on “StatiucExtension”: Exception has been thrown by the target of an invocation… If however my C# method was changed to something like this… public static bool SecurityCanEditDebtorPostalAddress { get { return true; } }   My XAML viewer would be happy. But of course this would bypass my security… <Drum Roll> Welcome preprocessor directives… what I wanted was during my design experience to totally remove the “if” code so that my accessor would return true and not have any if statements, but when I release my project to the big open world, I want the code to have the is statement. With a bit of searching I found the relevant MSDN sample and my code now looks like this… public static bool SecurityCanEditDebtorPostalAddress { get { #if DEBUG return true; #else if (Settings.GetInstance().CurrentUser.SecurityCanEditDebtorPostalAddress) { return true; } else { return false; } #endif } }   Not the prettiest beast, but it works. Basically what is being said here is that during my debug mode compile my code with just the code between the #if … #else block, but what I can now do is if I want to universally switch everything to the “if else” statement, I just go to my project properties –> Build and change the “Debug” flag as illustrated in the picture below. Also note that you can define your own conditional compilation symbols, and if you even wanted to you could skip the whole properties page and define them in code using the #define & #undef directives. So while I don’t like the way the code works and would like to look more into AOP and compare it to this method, it works for now.

    Read the article

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