Search Results

Search found 9011 results on 361 pages for 'common'.

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

  • Least common multiple for 3 or more numbers

    - by paan
    How do you calculate the least common multiple of multiple numbers? So far I've only been able to calculate it between two numbers. But have no idea how to expand it to calculate 3 or more numbers. So far this is how I did it LCM = num1 * num2 / gcd ( num1 , num2 ) With gcd is the function to calculate the greatest common divisor for the numbers. Using euclidean algorithm But I can't figure out how to calculate it for 3 or more numbers.

    Read the article

  • Get the common prefix substring through Regex

    - by Dreampuf
    like this text = " \t hello there\n \t how are you?\n \t HHHH" hello there how are you? HHHH Could I get the common prefix substring through regex? I try to In [36]: re.findall(r"(?m)(?:(^[ \t]+).+[\n\r]+\1)", " \t hello there\n \t how are you?\n \t HHHH") Out[36]: [' \t '] But apparently that common prefix substring is ' \t ' I want use for dedent function like python textwrap module.

    Read the article

  • Is it the most common case?

    - by Knowing me knowing you
    Why when I click on the x button to close the window in a Java application only the window dissapears and the applicaton is still running. I've read so many times that java designers tried to cater Java behaviour for the most common needs of programmers and save they precious time and so on and so on. What's more common case than closing app when I click on a X button?

    Read the article

  • Wine PPA dependency problems after upgrading to 12.04

    - by Pablo
    I recently upgraded my Ubuntu up to 12.04. Untill that, i can't use synaptic at all. After trying to repair the issue through synaptics, it returns me: installArchives() failed: dpkg: dependency problems prevent configuration of wine1.4-i386:i386: wine1.4-i386:i386 depends on wine1.4-common (= 1.4.1-0ubuntu1~precise1~ppa3); however: Version of wine1.4-common on system is 1.4-0ubuntu4. dpkg: error processing wine1.4-i386:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of wine1.4: wine1.4 depends on wine1.4-amd64 (= 1.4-0ubuntu4); however: Version of wine1.4-amd64 on system is 1.4.1-0ubuntu1~precise1~ppa3. wine1.4 depends on wine1.4-i386 (= 1.4-0ubuntu4); however:No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already Package wine1.4-i386 is not installed. Version of wine1.4-i386:i386 on system is 1.4.1-0ubuntu1~precise1~ppa3. dpkg: error processing wine1.4 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of wine1.4-common: wine1.4-common depends on wine1.4 (= 1.4-0ubuntu4); however: Package wine1.4 is not configured yet. dpkg: error processing wine1.4-common (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of wine1.4-amd64: wine1.4-amd64 depends on wine1.4-common (= 1.4.1-0ubuntu1~precise1~ppa3); however: Version of wine1.4-common on system is 1.4-0ubuntu4. dpkg: error processing wine1.4-amd64 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of wine: wine depends on wine1.4; however: Package wine1.4 is not configured yet. dpkg: error processing wine (--configure): dependency problems - leaving unconfigured dpkg: depeNo apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already ndency problems prevent configuration of playonlinux: playonlinux depends on wine | wine-unstable; however: Package wine is not configured yet. Package wine1.4 which provides wine is not configured yet. Package wine-unstable is not installed. dpkg: error processing playonlinux (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: wine1.4-i386:i386 wine1.4 wine1.4-common wine1.4-amd64 wine playonlinux Error in function: SystemError: E:Sub-process /usr/bin/dpkg returned an error code (1) dpkg: dependency problems prevent configuration of wine1.4: wine1.4 depends on wine1.4-amd64 (= 1.4-0ubuntu4); however: Version of wine1.4-amd64 on system is 1.4.1-0ubuntu1~precise1~ppa3. wine1.4 depends on wine1.4-i386 (= 1.4-0ubuntu4); however: Package wine1.4-i386 is not installed. Version of wine1.4-i386:i386 on system is 1.4.1-0ubuntu1~precise1~ppa3. dpkg: error processing wine1.4 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of wine: wine depends on wine1.4; however: Package wine1.4 is not configured yet. dpkg: error processing wine (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of wine1.4-common: wine1.4-common depends on wine1.4 (= 1.4-0ubuntu4); however: Package wine1.4 is not configured yet. dpkg: error processing wine1.4-common (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of wine1.4-amd64: wine1.4-amd64 depends on wine1.4-common (= 1.4.1-0ubuntu1~precise1~ppa3); however: Version of wine1.4-common on system is 1.4-0ubuntu4. dpkg: error processing wine1.4-amd64 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of wine1.4-i386:i386: wine1.4-i386:i386 depends on wine1.4-common (= 1.4.1-0ubuntu1~precise1~ppa3); however: Version of wine1.4-common on system is 1.4-0ubuntu4. dpkg: error processing wine1.4-i386:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of playonlinux: playonlinux depends on wine | wine-unstable; however: Package wine is not configured yet. Package wine1.4 which provides wine is not configured yet. Package wine-unstable is not installed. dpkg: error processing playonlinux (--configure): dependency problems - leaving unconfigured I tried the following: sudo apt-get clean sudo apt-get autoclean sudo apt-get install -f And returnsme: Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following extra packages will be installed: wine1.4 wine1.4-common Suggested packages: dosbox The following packages will be upgraded: wine1.4 wine1.4-common 2 upgraded, 0 newly installed, 0 to remove and 110 not upgraded. 6 not fully installed or removed. Need to get 0 B/1,126 kB of archives. After this operation, 9,216 B of additional disk space will be used. Do you want to continue [Y/n]? y dpkg: dependency problems prevent configuration of wine1.4-i386:i386: wine1.4-i386:i386 depends on wine1.4-common (= 1.4.1-0ubuntu1~precise1~ppa3); however: Version of wine1.4-common on system is 1.4-0ubuntu4. dpkg: error processing wine1.4-i386:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of wine1.4: wine1.4 depends on wine1.4-amd64 (= 1.4-0ubuntu4); however: Version of wine1.4-amd64 on system is 1.4.1-0ubuntu1~precise1~ppa3. wine1.4 depends on wine1.4-i386 (= 1.4-0ubuntu4); however: Package wine1.4-i386 is not installed. Version of wine1.4-i386:i386 on system is 1.4.1-0ubuntu1~precise1~ppa3. No apport report written because the error message indicates its a followup error from a previous failure. dpkg: error processing wine1.4 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of wine1.4-common: wine1.4-common depends on wine1.4 (= 1.4-0ubuntu4); however: Package wine1.4 is not configured yet. dpkg: error processing wine1.4-common (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of wine1.4-amd64: wine1.4-amd64 depends on wine1.4-common (= 1.4.1-0ubuntu1~precise1~ppa3); however: Version of wine1.4-common on system is 1.4-0ubuntu4. dpkg: error processing wine1.4-amd64 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of wine: wine depends on wine1.4; however: Package wine1.4 is not configured yet. dpkg: error processing wine (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of playonlinux: playonlinux depends on wine | wine-unstable; however: PackagNo apport report written because the error message indicates its a followup error from a previous failure. No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already e wine is not configured yet. Package wine1.4 which provides wine is not configured yet. Package wine-unstable is not installed. dpkg: error processing playonlinux (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: wine1.4-i386:i386 wine1.4 wine1.4-common wine1.4-amd64 wine playonlinux E: Sub-process /usr/bin/dpkg returned an error code (1) Cna anyone helpme? I've been searching for a sollution for days and still can't solve it. Thanks! Pablo

    Read the article

  • TFS Solution build cascading to several other builds even when common components were not modified

    - by Bob Palmer
    Hey all, here is the issue I am currently trying to work through. We are using Team Foundation Server 2008, and utilizing the automated build support out of the box. We have one very large project that encompasses a number of interrelated components and web sites, each of which is set up as a Visual Studio solution file. Many of these solutions are highly interrelated since they may contain applications, or contain common libraries or shared components. We have roughly 20 or so applications, three large web sites, and about 20 components. Each solution may include projects from other solutions. For example, a solution for a console app would also include the project files for all of the components it utilizes, since we need to ensure that when someone changes a component and rebuilds it, it is reflected in all of the projects that consume that component, and we can make sure nothing was broken. We have build projects for each solution, whether that's an application, component, or web site. For this example, we will call them solutions 01, 02, and 03. These reference multiple projects (both their own core project and test projects, plus the projects relating to various components). Solution 01 has projects A, B, and C. Solution 02 has projects C, D, and E. Solution 03 has projects E, F, and G. Now, for the problem. If I modify project A, the system will end up rebuilding all three solutions. Worse, all thirty solutions reference common projects used for data access (let's call it project H). Because they all share one project in common, if I modify any solution in my stack, even if it does not touch project H, I still end up kicking off every single build script. Any thoughts on how to address this? Ideally I would only want to kick off builds where their constituant projects were directly modified - i.e in the example below, if I modified project C, I would only rebuild solutions 01 and 02. Thanks!

    Read the article

  • Codeigniter common templates

    - by Darthg8r
    Let's say that I have a website that has 100 different pages. Each page uses a common header and footer. Inside the header is some dynamic content that comes from a database. I'd like to avoid having to have code in every single controller and action that passes this common code into the view. function index() { // It sucks to have to include this on every controller action. data['title'] = "This is the index page"; data['currentUserName'] = "John Smith"; $this->load->view("main_view", data); } function comments() { // It sucks to have to include this on every controller action. data['title'] = "Comment list"; data['currentUserName'] = "John Smith"; $this->load->view("comment_view", data); } I realize that I could refactor the code so that the common parts are in a single function and the function is called by the action. Doing so would reduce SOME of the pain, but it still doesn't feel right since I'd still have to make a call to that function every time. What's the correct way to handle this?

    Read the article

  • Common "truisms" needing correction the most

    - by Charles Bretana
    In addition to "I never met a man I didn't like", Will Rogers had another great little ditty I've always remembered. It went: "It's not what you don't know that'll hurt you, it's what you do know that ain't so." We all know or subscribe to many IT "truisms" that mostly have a strong basis in fact, in something in our professional careers, something we learned from others, lessons learned the hard way by ourselves, or by others who came before us. Unfortuntely, as these truisms spread throughout the community, the details—why they came about and the caveats that affect when they apply—tend to not spread along with them. We all have a tendency to look for, and latch on to, small "rules" or principles that we can use to avoid doing a complete exhaustive analysis for every decision. But even though they are correct much of the time, when we sometimes misapply them, we pay a penalty that could be avoided by understooding the details behind them. For example, when user-defined functions were first introduced in SQL Server it became "common knowledge" within a year or so that they had extremely bad performance (because it required a re-compilation for each use) and should be avoided. This "trusim" still increases many database developers' aversion to using UDFs, even though Microsoft's introduction of InLine UDFs, which do not suffer from this issue at all, mitigates this issue substantially. In recent years I have run into numerous DBAs who still believe you should "never" use UDFs, because of this. What other common not-so-"trusims" do you know, which many developers believe, that are not quite as universally true as is commonly understood, and which the developer community would benefit from being better educated about? Please include why it was "true" to start off with, and under what circumstances it's not true. Limit responses to issues that are technical, where the "common" application of a "rule or principle" is in fact correct most of the time, or was correct back when it was first elucidated, but—in the edge cases, or because of not understanding the principle thoroughly, because technology has changed since it first spread, or applying the rule today without understanding the details behind the rule—can easily backfire or cause the opposite of the intended effect.

    Read the article

  • Optimization in Common Decalaration

    - by Pratik
    Its a 3-tier ASP.NET Website Project In Data Layer there is class "Common Decalaration" in which lot of common things are mentioned. Something this way : public class CommonDeclartion { #region Common Messages public const string RECORD_INSERT_MSG = "Record Inserted Successfully "; public const string RECORD_UPDATE_MSG = "Record Updated Successfully"; public const string RECORD_DELETE_MSG = "Record Deleted Successfully"; public const string ERROR_MSG = "Error Ocuured while Perfoming This Action."; public const string UserID_Incorrect = "Please Enter The Correct User ID."; public const string RECORD_ALREADY_EXIT = "Record Already Exit"; public const string NO_RECORD = "No Record found."; #endregion } Can this be more optimized in terms of : 1.Perfomance 2.Security(if any) 3.Code Readablity or Reusablity I thought of using enum but can't figure that out : enum CommonMessages { RECORD_INSERT_MSG "Record Inserted Successfully.", RECORD_UPDATE_MSG "Record Updated Successfully.", RECORD_DELETE_MSG "Record Deleted Successfully.", ERROR_MSG "Error Ocuured while Perfoming This Action.", UserID_Incorrect "Please Enter The Correct User ID.", RECORD_ALREADY_EXIT "Record Already Exit.", NO_RECORD "No Record found.", } or else should keep them in some collections like dictionary/NameValueCollection or so or i have to keep them in XML in form of key/value pair and reterive from it ? What can be better way keeping in mind 1.Perfomance 2.Security(if any) 3.Code Readablity or Reusablity

    Read the article

  • Error: Can't find common super class of ...

    - by PatlaDJ
    I am trying to process with Proguard a MS Windows desktop application (Java 6 SE using the SWT lib provided by Eclipse). And I get the following critical error: Unexpected error while performing partial evaluation: Class = [org/eclipse/swt/widgets/DateTime] Method = [<init>(Lorg/eclipse/swt/widgets/Composite;I)V] Exception = [java.lang.IllegalArgumentException] (Can't find common super class of [java/lang/StringBuffer] and [org/eclipse/swt/internal/win32/TCHAR]) Error: Can't find common super class of [java/lang/StringBuffer] and [org/eclipse/swt/internal/win32/TCHAR] ---------------------------- When I tried to Google the error, it came out only on two spots on the entire web, that astonished me greatly. I am newbie using Proguard and Java code optimization tools at all. Any thoughts and suggestions how to fix this, will be appreciated. Thanks in advance.

    Read the article

  • Why is IoC / DI not common in Python?

    - by tux21b
    In Java IoC / DI is a very common practice which is extensively used in web applications, nearly all available frameworks and Java EE. On the other hand, there are also lots of big Python web applications, but beside of Zope (which I've heard should be really horrible to code) IoC doesn't seem to be very common in the Python world. (Please name some examples if you think that I'm wrong). There are of course several clones of popular Java IoC frameworks available for Python, springpython for example. But none of them seems to get used practically. At least, I've never stumpled upon a Django or sqlalchemy+<insert your favorite wsgi toolkit here> based web application which uses something like that. In my opinion IoC has reasonable advantages and would make it easy to replace the django-default-user-model for example, but extensive usage of interface classes and IoC in Python looks a bit odd and not »pythonic«. But maybe someone has a better explanation, why IoC isn't widely used in Python.

    Read the article

  • Common and useful Graph functions?

    - by Nazgulled
    Hi, I'm implementing a simple Graph library for my uni project and since this is the first time I'm dealing with graphs, I would like to know which functions you guys consider to be most common and useful for Graph implementations... So far, I have this: graphInitialize() graphInsertVertex() graphRemoveVertex() graphGetVertex() graphGetVertexValue() (not implemented yet, not sure if I'll need it) graphInsertEdge() graphRemoveEdge() graphLinkVertices() (this calls graphInsertEdge twice for bidirectional graph) graphUnlinkVertices() (this calls graphRemoveEdge twice for bidirectional graph) graphDestroy() I know I'm missing a function do determine the shortest path, but I'm leaving that for last... Do you think I'm missing any common/useful function?

    Read the article

  • SLF4J, Common Logging, console output

    - by Mauricio Scheffer
    I have this 3rd party library that has: slf4j-api-1.5.5.jar slf4j-jdk14-1.5.5.jar jcl-over-slf4j-1.5.5.jar I want to write some tests against this library and see its log output, and I don't want to add any more logging libraries (no log4j or anything else). I understand that SLF4J and Common Logging are both logging abstractions so I probably need to write my own simple concrete logger (or maybe not, since jcl-over-slf4j includes org.apache.commons.logging.impl.SimpleLog?). If so, what interfaces should I implement, and more importantly, how do I set up SL4J/Common Logging to use my logger in my test? I read in the SLF4J docs that I have to modify the StaticLoggerBinder class... does that really mean that I actually have to download SLF4J sources, modify the class and recompile it?

    Read the article

  • Dynamically setting a log4net property using common.logging

    - by Kyle LeNeau
    Does anyone know if there is an equivalent in Common.Logging (for .Net) to set properties for the log4net factory adapter? I have had great success when just using log4net by doing: <appender name="FileAppender" type="log4net.Appender.RollingFileAppender"> <file type="log4net.Util.PatternString" value="logs\Log_%property{BrokerID}.txt"/> <appendToFile value="false"/> <rollingStyle value="Size"/> <maxSizeRollBackups value="-1"/> <maximumFileSize value="50GB"/> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date %-5level %logger - %message%newline"/> </layout> </appender> and setting the property like:log4net.GlobalContext.Properties["BrokerID"] = 10 The file I end up with the looks like this: Log_(null).txt when using the common.logging to wire up log4net on the fly.

    Read the article

  • Rails: common approach for handling exceptions in restful actions on objects that have been destroye

    - by Greg
    It is very common in Rails for an objects_controller controller to have RESTful edit and destroy actions like so: def edit @object = Object.find(params[:id]) end def destroy @object = Object.find(params[:id]) @object.destroy redirect_to :back end With an associated view that provides edit and destroy links like so: <%= link_to "Edit the Object", edit_object_path(object) %> <%= link_to "Delete", object, :confirm => 'Are you sure?', :method => :delete %> And it is easy to blow this up. If I open two browser windows, A and B, destroy an object with the "Delete" link in browser A and then press the "Edit" link in browser B, the find() in the edit action throws an exception. Obviously there are several ways to deal with this in the edit action: catch the exception and recover gracefully use @object = find(:first, "conditions... etc. and test the @object before going further But seeing as this is such a common pattern, I would love to know how other folks deal with this situation.

    Read the article

  • Common views in viewControllers - Code re-usability

    - by Nitish
    I have few common views in most of my viewControllers. What I noticed is that I can reuse single code for all viewControllers which is absolutely wise. For this I decided to create a class Utils which has static methods like +(void)createCommonViews:(float)yAxis:(NSString*)text; In my case common views are three labels and two images. Problem : I am not able to add these views from Utils. I am wondering how can I send self as a parameter so that I may add the views from Utils. It may be wrong to add views outside the viewController. In that case what can be the solution? Taking all these views in a UIView, setting return type of Utils method as UIView and then adding UIView to viewController(after calling method from viewController) might solve my problem. But what I am looking for is some other solution. Thanks, Nitish

    Read the article

  • I want to create a common unit test function to check all functions based on parameter

    - by Nilesh Rathod
    I want to create a common unit test function to check all functions based on parameter for e.g commonmethod(string methodname,string paramter1,....) { .... } what logic should i write inside this method so that by passing a actual function in parameter methodname and then the common method should execute that function and should return the output. i am using entity framework for all functions which has been created in my project and now i dont want to create a separate unit test function for each function.just one function should do the job based on different parameters... is that possible.. ?, if so then please provide me an code for same.. Thanks in advance..!!!

    Read the article

  • Whats the most common waste of computing power in javascipt

    - by qwertymk
    We've all seen people who do this jQuery('a').each(function(){ jQuery(this)[0].innerHTML += ' proccessed'; }); function letsPoluteNS() { polute = ''; for (morePolution = 0; morePolution < arguments.length; morePolution++) polute.join(arguments[morePolution]); return polute; } and so on. I was wondering what people have seen the most common javascript/jQuery technique that is slowing down the page and/or wasting time for the javascript engine. PS I know that this question may not seem to fit into whats an accepted question, yet I'm asking for what the most common accepted waste is

    Read the article

  • iPad UISPlitViewController Common View

    - by saikamesh
    is it possible to have a common view for both master and detail view controllers. What if I need to add a header image(at top, the very first view) common for both the master and detail view controllers. When the device is in the portrait mode the width of the header image view has to shrink to fit to the detail view controller's view and when the orientation changes to landscape the width of the same header image view has to be expanded that is the width of it has to be 1024. Please tell me whether doing this is possible. or any workaround for this?

    Read the article

  • UISplitViewController Common View

    - by saikamesh
    is it possible to have a common view for both master and detail view controllers. What if I need to add a header image(at top, the very first view) common for both the master and detail view controllers. When the device is in the portrait mode the width of the header image view has to shrink to fit to the detail view controller's view and when the orientation changes to landscape the width of the same header image view has to be expanded that is the width of it has to be 1024. Please tell me whether doing this is possible. or any workaround for this?

    Read the article

  • Distributed development staff needing a common IP range

    - by bakasan
    I work on a development staff that is geographically distributed, mostly all throughout the state of CA, but several key members also must travel frequently. We rely quite heavily on a 3rd party provider API for a great deal of our subsystems (can't get into who it is or what they do). The 3rd party however is quite stringent on network access and have no notion of a development sandbox. Access is restricted to 2, 3 IP numbers and that's about it. Once we account for our production servers, that leaves us with an IP or two to spare for our dev team--which is still problematic as people's home IP changes, people travel, we have more than 2 devs, etc. Wide IP blocks are not permitted by the 3rd party. Nor will they allow dynamic DNS type services. There is no simple console to swap IPs on the fly either (e.g. if a dev's IP at home changes or they are on the road). As none of us are deep network experts, I'm wondering what our viable options are? Are there such things as 3rd party hosts to VPNs? Generally I think of a VPN as a mechanism to gain access to a home office, but the notion would be a 3rd party VPN that we'd all connect to and we'd register this as an IP origin w/ our 3rd party. We've considered using Amazon EC2 to effectively host a dev environment for each dev and using that to connect. Amazon only gives you so many static IPs however (I believe 5?) so this would only be a stop gap solution until our team size out strips our IP count at Amazon. Those were the only viable thoughts that I had, but again, I'm far from a networking guy. Tried searching for similar threads, but I'm not even sure I know the right vernacular to look around for.

    Read the article

  • Most common account names used in ssh brute force attacks

    - by Charles Stewart
    Does anyone maintain lists of the most frequently guessed account names that are used by attackers brute-forcing ssh? For your amusement, from my main server's logs over the last month (43 313 failed ssh attempts), with root not getting as far as sshd: cas@txtproof:~$ grep -e sshd /var/log/auth* | awk ' { print $8 }' | sort | uniq -c | sort | tail -n 13 32 administrator 32 stephen 34 administration 34 sales 34 user 35 matt 35 postgres 38 mysql 42 oracle 44 guest 86 test 90 admin 16513 checking

    Read the article

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