Search Results

Search found 3788 results on 152 pages for 'pure equal'.

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

  • LINQ - more than or equal to

    - by trnTash
    Part of the code: ...where se.DateFrom >= pDateFrom && se.DateTo <= pDateTo select se... Does not work. There is no any error but the To and From days do not get returned. How do I query "more than or equal to" and "less than or equal to"? Thanks :)

    Read the article

  • check if two subsets of integers are equal using equals method

    - by MAS
    I have this java method in class called IntArray. The class has methods to add integers to a set or remove integers from a set,check size of a set, and check if 2 sets are equal. the 2 sets are created using 2 different objects of type IntArray in main, lets say object A and B. equals method supposed to check if two sets of integers are equal. for example set A = {1,2,3} and B = {1,2,3,4}. The method still return true even though one set is a subset of the other set. What exactly I am doing wrong? Thanks. //part of the code in main IntArray A = new IntArray(); IntArray B = new IntArray(); if(A.equals(B)) System.out.println("A and B are equal"); //equals method in IntArray class public boolean equals(Object b) { if (b instanceof IntArray) { IntArray A = (IntArray) b; for (int i = 0; i < data.length; i++) if (countOccurrences(data[i]) != A.countOccurrences(data[i])) return false; return true; } else return false; }

    Read the article

  • How to create Python module distribution to gracefully fall-back to pure Python code

    - by Craig McQueen
    I have written a Python module, and I have two versions: a pure Python implementation and a C extension. I've written the __init__.py file so that it tries to import the C extension, and if that fails, it imports the pure Python code (is that reasonable?). Now, I'd like to know what is the best way to distribute this module (e.g. write setup.py) so it can be easily used by people with or without the facility to build, or use, the C extension, just by running: python setup.py install My experience is limited, but I see two possible cases: User does not have MS Visual Studio, or the GCC compiler suite, installed on their machine, to build the C extension User is running IronPython, Jython, or anything other than CPython. I only have used CPython. So I'm not sure how I could distribute this module so that it would work smoothly and be easy to install on those platforms, if they're unable to use the C extension.

    Read the article

  • How to create Python module distribution to gracefully fall-back to pure Python code

    - by Craig McQueen
    I have written a Python module, and I have two versions: a pure Python implementation and a C extension. I've written the __init__.py file so that it tries to import the C extension, and if that fails, it imports the pure Python code (is that reasonable?). Now, I'd like to know what is the best way to distribute this module (e.g. write setup.py) so it can be easily used by people with or without the facility to build, or use, the C extension. My experience is limited but I see two possible cases: User does not have MS Visual Studio, or the GCC compiler suite, installed on their machine, to build the C extension User is running IronPython, Jython, or anything other than CPython. I only have used CPython. So I'm not sure how I could distribute this module so that it would work smoothly and be easy to install on those platforms, if they're unable to use the C extension.

    Read the article

  • QML 5.3 iOS compilation of pure QML app

    - by Nathaniel Johnson
    I have an application written in QML. Initially, I used the standard C++ bootstrap for the app. int main(int argc, char *argv[]) { QApplication app(argc, argv); // A bunch of components and data models written in C++ QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); return app.exec(); } The bulk of the app is in QML and the more I work with QML, the happier I am with it and the more I feel comfortable converting the C++ pieces to QML. So, it comes to one risk that I wanted to ask about. If I convert the app to a pure QML application like the kind generated by the Qt Quick UI application wizard with no C++ and designed to be run with qmlscene will I be able to compile it for iOS when the time to port it comes or will I end up just converting it back to the C++ loader form? TL;DR Can pure QML (no C++) apps be compiled and run on iOS devices?

    Read the article

  • How useful is a 'pure' MVC implementation?

    - by Matt1776
    I work at a company that provides custom made 'CRM'-like software. We are currently redesigning/redeveloping the software with the hopes that it will look more modern and be easier to develop and customize for future clients. Currently it takes a long time to customize each new application. There is a presumption that the reason it takes so long is because of the amount of business logic that is present in the 'view' layer. To some extent I can vouch for this being true, but symptoms don't always reliably point out a cause. There was a suggestion that if we just move the business logic to the controller layer and use pure view (we use java J2EE and struts) as in implementing struts tags instead of calling the bean layer and iterating objects right on the jsp - etc etc. Before I start advocating we go forward with this, I wanted to get a feeling for what other people thought. Does a "pure" implementation of the MVC (especially emphasis on decoupling the controller and the view) provide a cleaner, easier to develop and change code base?

    Read the article

  • Pure sine wave inverter

    - by Nick
    Not exactly programming (sorry) but I think it's pretty close and can be of interest to other programmers. I'm trying to setup a battery power station so that I can work from anywhere. I go surfing a lot and my idea is to be able to work from wherever I can park my car (given there's coverage). So, I'm getting a deep cycle battery, a 240V charger (I'm in Australia), and an inverter. At the back of my laptop it says 19V and 4.62A. From the people I've spoken to that means it consumes about 90W at most. So my inverter needs to be able to output about 100W. Most of them seem to be 200W and up so this shouldn't be a problem. I want to be able run my laptop for 10 hours (plus the 2 hours I get from the laptop battery) straight. According to the people I've spoken to and from what I gather online I need a battery that has the amp hours for my "amp draw". I have no idea how to calculate this but I've been guesstimating. Most deep cycle batteries seem to be classified using amp hours (Ah)... 35Ah, 50Ah, 75Ah, 100Ah, and so on. However the amp hours on those batteries is for a 240V and I seem to be using 19V. According to an expert I spoke to you'd need a 100Ah battery to power a 5A appliance at 240V for 10 hours (you only get about 50% useful power). That to me is 5A * 240V = 100Ah battery. So, naive as I might be I take 240V and divide that by my 19V and reach the conclusion that I can get away with a battery that's about 12 times smaller than that 100Ah. The expert told me I needed a 50Ah battery so that's probably what I'll be getting, but it would be interesting to know what I theoretically would need to power my laptop for 10 hours. As for charging the battery the expert I spoke to said I needed a 3-5A charger to be able to charge that 50Ah battery from flat to full in about 10 hours (I will just leave it plugged in over night). Now to my question. The expert said it's not a matter of "if" more like a guaranteed "when" my computer will stuff up if I don't use a "pure sine wave inverter". From what I gather the power that comes out of that battery is not as clean as the power we get in the socket at home. Apparently it's "square" and the one in the socket is nice and smooth. I've already got an inverter, but it's not "pure". Do I really need to buy the $200-300 pure sine wave inverter or can I get away with something else? Perhaps the laptop adapter that sits in the middle of my laptop power cable already fixes that wave to be nice and smooth? Thanks!

    Read the article

  • Does Qt support virtual pure slots ?

    - by ereOn
    Hi, My GUI project in Qt has a lot of "configuration pages" classes which all inherit directly from QWidget. Recently, I realized that all these classes share 2 commons slots (loadSettings() and saveSettings()). Regarding this, I have two questions: Does it make sense to write a intermediate base abstract class (lets name it BaseConfigurationPage) with these two slots as virtual pure methods ? (Every possible configuration page will always have these two methods, so I would say "yes") Before I do the heavy change in my code (if I have to) : does Qt support virtual pure slots ? Is there anything I should be aware of ? Here is a code example describing everything: class BaseConfigurationPage : public QWidget { // Some constructor and other methods, irrelevant here. public slots: virtual void loadSettings() = 0; virtual void saveSettings() = 0; }; class GeneralConfigurationPage : public BaseConfigurationPage { // Some constructor and other methods, irrelevant here. public slots: void loadSettings(); void saveSettings(); };

    Read the article

  • PHP Get variable to equal value of switch

    - by user342391
    I am trying to get a variable on my page to equal the result of a switch I have. This is the code: $payment_method = switch ($cardtype) { case "visa" : echo "VSA"; break; case "mastercard" : echo "MSC"; break; case "maestro" : echo "MAE"; break; case "amex" : echo "AMX" ; break; default : echo "Please specify a payment method!"; break; }; How can I get $payment_method to equal the result of this???? So far I recieve an error: Parse error: syntax error, unexpected T_SWITCH in /var/www/account/credits/moneybookers/process.php on line 65

    Read the article

  • numpy.equal with string values

    - by Morgoth
    The numpy.equal function does not work if a list or array contains strings: >>> import numpy >>> index = numpy.equal([1,2,'a'],None) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: function not supported for these types, and can't coerce safely to supported types What is the easiest way to workaround this without looping through each element? In the end, I need index to contain a boolean array indicating which elements are None.

    Read the article

  • Equal height divs with footer always at bottom of tallest div

    - by nukegara
    I was wondering if this were possible, and if it is the best way to go about this: example image (since I'm not allowed to post pics yet ^^) So, not only does each column have to be of equal height, but each column also has its own individual footer. I saw this post httx://stackoverflow.com/questions/1347366/div-at-bottom-of-window-and-adaptable-height-div (I also can't post more than one link....) - how could I rework this technique to apply to the bottom of the divs and not the bottom of the window? *edit - each column will have content that will constantly change and be of variable height. I'm thinking I could just figure out the equal height columns first, then just absolute position a footer div within those columns. Does its parent div then have to be position: relative?

    Read the article

  • Finding whether a value is equal to the value of any array element in MATLAB

    - by James
    Hi, Can anyone tell me if there is a way (in MATLAB) to check whether a certain value is equal to any of the values stored within another array? The way I intend to use it is to check whether an element index in one matrix is equal to the values stored in another array (where the stored values are the indexes of the elements which meet a certain criteria). So, if the indices of the elements which meet the criteria are stored in the matrix below: criteriacheck = [3 5 6 8 20]; Going through the main array (called array) & checking if the index matches: for i = 1:numel(array) if i == 'Any value stored in criteriacheck' ... "Do this" end Does anyone have an idea of how I might go about this? Thanks in advance

    Read the article

  • Pure JSP without mixing HTML, by writing html as Java-like code

    - by ADTC
    Please read before answering. This is a fantasy programming technique I'm dreaming up. I want to know if there's anything close in real life. The following JSP page: <% html { head { title {"Pure fantasy";} } body { h1 {"A heading with double quote (\") character";} p {"a paragraph";} String s = "a paragraph in string. the date is "; p { s; new Date().toString(); } table (Border.ZERO, new Padding(27)) { tr { for (int i = 0; i < 10; i++) { td {i;} } } } } } %> could generate the following HTML page: <html> <head> <title>Pure fantasy</title> </head> <body> <h1>A heading with double quote (") character</h1> <p>a paragraph</p> <p>a paragraph in string. the date is 11 December 2012</p> <table border="0" padding="27"> <tr> <td>0</td> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> <td>8</td> <td>9</td> </tr> </table> </body> </html> The thing about this fantasy is it reuses the same old Java programming language technique that enable customized keywords used in a way similar to if-else-then, while, try-catch etc to represent html tags in a non-html way that can easily be checked for syntactic correctness, and most importantly can easily be mixed up with regular Java code without being lost in a sea of <%, %>, <%=, out.write(), etc. An added feature is that strings can directly be placed as commands to print out into generated HTML, something Java doesn't support (where pure strings have to be assigned to variables before use). Is there anything in real life that comes close? If not, is it possible to define customized keywords in Java or JSP? Or do I have to create an entirely new programming language for that? What problems do you see with this kind of setup? PS: I know you can use HTML libraries to construct HTML using Java code, but the problem with such libraries is, the source code itself doesn't have a readable HTML representation like the code above does - if you get what I mean.

    Read the article

  • Abstract classes in shared library

    - by JTom
    Hi, I have an ordinary abstract class that has couple of pure virtual methods. The class itself is a part of the shared library. The compilation of the shared library itself is OK. But when the library is linked to another program that has another class deriving from the abstract one in the shared library and defining the pure virtual methods, I get the following linker error: I compile like this..: g++ -I../path/to/the/library main.cpp derived.cpp -L../path/to/the/library -lsomename -o shared ...and the linker error is: libsomename.so: undefined reference to `AbstractClass::method()' It's like the abstract class cannot access its pure virtual methods but I do not try to make any instance of the abstract class anywhere in the library. What could be the problem?

    Read the article

  • Suggestions for entering mobile development -- pure iPhone SDK, Android SDK, Mono Touch or Titanium

    - by Tom Cabanski
    I am entering mobile development. I have been working primarily in .NET since 1.0 came out in beta. Before that, I was mostly a C++ and Delphi guy and still dabble in C++ from time to time. I do web apps quite a bit so I am reasonably proficient with Javascript, JQuery and CSS. I have also done a few Java applications. I started web programming with CGI and live mostly in the ASP.NET MVC world these days. I am trying to decide on which platform/OS and tool to select. I am concerned with the size of the market available for my applications as well as the marketibility of the skills I will pick up. The apps I have in mind would work on both phones and pads. Some aspects of what I have in mind will play better on the bigger screens that will be available on pads. Here are the options I am considering: Apple iPhone/iPad using pure Apple SDK (Objective-C) Apple iPhone/iPad using Mono Touch (C#) Android using pure Android SDK (Java) Multiple platforms using something like Titanium to generate native apps from web technologies (HTML, CSS and Javascript) Multiple platforms using HTML5 web applications that run in the browser (HTML, CSS and Javascript). Which option would you choose? Do you have a different suggestion? What are the pros and cons?

    Read the article

  • www do not equal no www

    - by marc-andre menard
    I have a website with dns pointing to my own server. the website WITH www.mysite.com lead to the right site, but the address mysite.com lead to a publicity site that I DONT CONTROL I like to make www.mysite.com and the mysite.com lead to the same DNS Can i make it with .htaccess or with google analitic, but since i dont know the resolver that lead me to the bizzare page i dont have control on that As request : http://www.demolition-st-chrysostome.org/ (ok) http://demolition-st-chrysostome.org/ (no)

    Read the article

  • ActiveMQ Pure Master / Slave - Out of sync

    - by pico
    What i have : 1 master broker and 1 slave broker both in ActiveMQ 5.4.0 What i use : waitForSlave on master side and failover uri on slave side (in the master connector URI) What i want to do : I want to wait some delay (like 5 seconds) in case of a tiny network failures between master and slave before starting slave transpôrt connectors So i put this in slave config : <broker xmlns="http://activemq.apache.org/schema/core" brokerName="slave" dataDirectory="${activemq.base}/data" useJmx="true" persistent="true" populateJMSXUserID="true" masterConnectorURI="failover://(tcp://master:61616)?initialReconnectDelay=1000&amp;maxReconnectDelay=30000" shutdownOnMasterFailure="false" advisorySupport="false"> It seems to work but after a network hang between master and slave, the slave reconnect successfully and then the master logs a lot of : 2010-10-18 17:08:44,421 | ERROR | Slave Failed | org.apache.activemq.broker.ft.MasterBroker | ActiveMQ Task java.lang.IllegalStateException: Cannot lookup a connection that had not been registered: ID:master-1040-634226732611718750-0:0 at org.apache.activemq.broker.MapTransportConnectionStateRegister.lookupConnectionState(MapTransportConnectionStateRegister.java:93) at org.apache.activemq.broker.TransportConnection.lookupConnectionState(TransportConnection.java:1412) at org.apache.activemq.broker.TransportConnection.processRemoveConsumer(TransportConnection.java:561) at org.apache.activemq.command.RemoveInfo.visit(RemoveInfo.java:76) at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:309) at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:185) at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116) at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:69) at org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:218) at org.apache.activemq.thread.DedicatedTaskRunner.runTask(DedicatedTaskRunner.java:98) at org.apache.activemq.thread.DedicatedTaskRunner$1.run(DedicatedTaskRunner.java:36) On the slave side everything is fine. So after that, i've tried to stop the master to see if the slave is capable of turning master after these "network hangs". The master took long time to shutdown (10 seconds) and then some error message appears in slave logs : 2010-10-18 17:09:32,915 | WARN | Async error occurred: java.lang.IllegalStateException: Cannot lookup a connection that had not been registered: ID:master-1049-634226732657812500-0:3 | org.apache.activemq.broker.TransportConnection.Service | VMTransport: vm://slave#5 java.lang.IllegalStateException: Cannot lookup a connection that had not been registered: ID:master-1049-634226732657812500-0:3 at org.apache.activemq.broker.MapTransportConnectionStateRegister.lookupConnectionState(MapTransportConnectionStateRegister.java:93) at org.apache.activemq.broker.TransportConnection.lookupConnectionState(TransportConnection.java:1412) at org.apache.activemq.broker.TransportConnection.processRemoveSession(TransportConnection.java:600) at org.apache.activemq.command.RemoveInfo.visit(RemoveInfo.java:74) at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:309) at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:185) at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116) at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:69) at org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:218) at org.apache.activemq.thread.DedicatedTaskRunner.runTask(DedicatedTaskRunner.java:98) at org.apache.activemq.thread.DedicatedTaskRunner$1.run(DedicatedTaskRunner.java:36) Are they any ways to keep my kaha stores (they are individual stores) synchronised? The main problem is that the slave never turn master after a master failure, it stay block on this message : 2010-10-18 17:09:33,681 | WARN | Transport (master/172.21.60.61:61616) failed to tcp://master:61616 , attempting to automatically reconnect due to: java.net.SocketException: Software caused connection abort: socket write error | org.apache.activemq.transport.failover.FailoverTransport | ActiveMQ Transport: tcp://master/172.21.60.61:61616 I'm totally stuck with these syncs problems, any help welcome! Regards

    Read the article

  • Directory listing through FTPS (TLS) is not working

    - by Aron Rotteveel
    We recently switched our server to require TLS for every connection. This is working flawlessly so far, but one of our clients is having problems. Some facts: Server uses Pure-FTPD Server has a passive port range configured Server has no firewall limitations regarding the FTP Client uses WS FTP Client is behind a router Client connects to the same IP as every other, using PASSIVE mode All other clients have no trouble connecting Because of the TLS requirement, connecting using ACTIVE mode is almost not possible, but PASSIVE is working fine for everyone except this specific client. It seems that he is able to connect, but once a LIST command is performed, things go wrong. Log: Finding Host <clienthost> ... Connecting to <serverip:21> Connected to <serverip:21> in 0.020000 seconds, Waiting for Server Response Initializing SSL Session ... 220---------- Welcome to Pure-FTPd [privsep] [TLS] ---------- 220-You are user number 5 of 50 allowed. 220-Local time is now 22:14. Server port: 21. 220-This is a private system - No anonymous login 220-IPv6 connections are also welcome on this server. 220 You will be disconnected after 15 minutes of inactivity. AUTH TLS 234 AUTH TLS OK. SSL session NOT set for reuse SSL Session Started. Host type (1): Automatic Detect USER <user> 331 User <user> OK. Password required PASS (hidden) 230-User <user> has group access to: <user> 230 OK. Current restricted directory is / SYST 215 UNIX Type: L8 Host type (2): Unix (Standard) PBSZ 0 200 PBSZ=0 PROT P 200 Data protection level set to "private" PWD 257 "/" is your current location CWD /public_html 250 OK. Current directory is /public_html PWD257 "/public_html" is your current location TYPE A 200 TYPE is now ASCII PASV 227 Entering Passive Mode (<serverip>,132,100) connecting data channel to <serverip>:132,100(33892) Substituting connection address <serverip> for private address <serverip> from PASV Using external address <customer ext. ip> instead of local address <customer int. ip> for PORT command PORT 82,161,56,225,195,181 200 PORT command successful LIST Error reading response from server. It appears that the connection is dead. Attempting reconnect... Any help is appreciated.

    Read the article

  • find files where group permissions equal user permissions

    - by Jayen
    Is it possible to do something like find -perm g=u? I say "like" because -perm mode requires mode to specify all the bits, not just g, and because I can't put u on the right side of the =, like I can with the chmod command: you can specify exactly one of the letters ugo: the permissions granted to the user who owns the file (u), the permissions granted to other users who are members of the file's group (g), and the permissions granted to users that are in neither of the two preceding categories (o). At the moment, I'm doing find | xargs -d \\n ls -lartd | egrep '^.(...)\1 which is just ugly. Thanks.

    Read the article

  • Pure-FTPd linux upload problems - 500 Unknown command

    - by user1801273
    I'm running Centos with Kloxo CP and PureFTPd on VPS based on HyperVM. The problem - during the day, there are periods when FTP wors fine for hours, but sometimes it dies with "500 Unknown command" code. for files larger than 2Kb. This is really weird - with files less than 2472-2484 bytes everything would work fine, but with bigger files ftp would start writing file, would drop on 2Kb and would return "500 Unknown command" . This happens on Passive AND/OR Active connections for any filetypes. Logs are showing like the file was uploaded successfully , but the speed nearby the action would be 0.3 -0.5 Kb , when normal operation would report 70-150Kb/s speeds. I do have some Iptables firewalls on both HyperVM host,and VPS , however these are static, and most of the time it works just fine. Any suggestions on where to look for a solution would be appreciated :)

    Read the article

  • Pure Terminal Server 2003 system hangs

    - by Donovan
    System Profile: IBM Server hardware Windows Ent Server 2003 running terminal services. No Citrix. Max user load: 30 Symptoms: While in the course of normal operation our terminal server will hang up. As far as I can tell there isn't any trigger that's plainly visible yet. The way in witch it hangs may give a clue though. The hang presents its self by users not being able to initiate any new processes. All processes currently loaded into memory work just fine. Example: outlook 2007. You may continue to read email, operate the client and such. Some people don't even realize the hang has occurred for a bit of time. My attempts to troubleshoot have been futile. Reacting to the hang does no good because I can't start any new processes to investigate. After I reboot the server my next instinct would be to begin logging to catch the hang occurring but I'm not sure what to log. Right now I'm attempting to keep process explorer running in case the issue occurs again. Sometimes it happens twice a day, other times, once a week. Anyone have any ideas on how I could set myself up for better success in tracking this problem down? Thanks, Donovan

    Read the article

  • Pandoc: Output two sumation signs in equal height in Word 2010

    - by Andy
    I need to output some complex equations in Word 2010 (docx). To do so I write most of the equations in tex and use pandoc to translate them as Word formulas. However I have a problem with the following tex equation: \sum_{m=1}^\infty\sum_{n=1}^\infty In Word the resulting two summation signs are not of the same size but the latter is smaler than the first one. Is there any workaround to solve this? I would deeply appreciate any help. Thank you Andy

    Read the article

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