Member Avatar
Reusable Code Snippet Python Break Factor Function

As a result of my research in number theory I find that I often need to break a number down into its numerical parts while stepping through one divisor to another. I call this process "break factoring," as I am just breaking a number down into parts, and not necessarily factoring it. A "break factor" result has three columns of numbers: A multiplier (M), the quotient (Q), and the remainder (R). For each level of the results: (M * Q) + R = Number This function returns the printed table. Also not earth shattering, but hey, someone might want to …

Member Avatar
+1 forum 2
Member Avatar

I do a lot of work in number theory, especially with factors. I often need just the two middle factors from a very long factor list/result, so I created a function that takes a factor list and returns just the middle two, or one, factors. Nothing earth shattering, but I use it a lot, and thought that I would share it. And those with better ways to offer, offer away. I am always interested.

Member Avatar
+0 forum 2
Member Avatar

Hi, i'm trying to build a display screen headphone similar in shape to "vizio's LCD headphones" shown at CES 2010, but different in function. The display screens on the headphones i want to make have only one function: to show what music the user is listening to. For example if i am listening to a Michael Jackson song, the display screen will be able to show: the name of the song, name of the artists or the album art of the song i'm listening to. My question is about the design of the motherboard. It will need to house a …

+0 forum 0
Member Avatar

Hello guys. I need an idea. How can I calculate GCF of many numbers? I thought I could calculate two by two numbers, but it not seems to be a very effective idea. There is my function: int gcf (unsigned int x, unsigned int y) { return (y == 0) ? x : gcf (y, x % y); } Help? Please?

Member Avatar
+0 forum 4
Member Avatar

I have been trying to fix this since two eeks and I have no clue what I am doing wrong. I have gotten the program to work so that it can tell if a number is prime or not, but the problem I am having is showing at the end how many prime numbers there are for the two numbers, calculating the average and lastly asking the user again to input numbers. Can anyone help please! Here is the my code [CODE] #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { int x; int y; int i; int c; int primecount; …

Member Avatar
+0 forum 6
Member Avatar

I need help with this http://codepad.org/FNUci22s I am posting the ling of code pad because it has a way to execute it, so long story short. I use two different functions seno, sen (both for sin). When using the printf and adressing both to compare results I get from the seno function the correct result(sin(45)=0.70710) but the moment I remove the other function from the printf i get "nan". Funcitons dont depend from each other.

Member Avatar
+0 forum 2
Member Avatar

i create small application in struts but it give me following error : SEVERE: Servlet.service() for servlet jsp threw exception java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491) at org.apache.struts.util.MessageResources.<clinit>(MessageResources.java:57) at org.apache.struts.taglib.html.FormTag.<clinit>(FormTag.java:93) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:126) at org.apache.jsp.Index_jsp._jspx_meth_html_005fform_005f0(Index_jsp.java:109) at org.apache.jsp.Index_jsp._jspService(Index_jsp.java:87) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) //////////////////////// I include commans-logging.jar but still it gives me error pls anyone can help me! …

+0 forum 0
Member Avatar
Reusable Code Snippet Finding the biggest factor

Again "pseudo-code" for [URL="http://www.daniweb.com/software-development/cpp/threads/379255/1632559#post1632559"]C++ program[/URL]. Quite primitive and simple, but I post it anyway. Generalized to take even even number as parameter.

+0 forum 0
Member Avatar

AS we al know, there are millions of online communities and presence, yet only a few actually were able to penetrate and influence people to join and engage, like Facebook and Myspace. so my question is: How did these online communities set themselves apart to make them so widespread? Why others prosper while other fail and fade away? What do you think?

Member Avatar
+0 forum 1

The End.