473,881 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Jython inherit from Java class

I wrote a Jython class that inherits from a Java class and (thats the
plan) overrides one method. Everything should stay the same.

If I run this nothing happens whereas if I run the Java class it says:
usage: java fit.FitServer [-v] host port socketTicket
-v verbose

I think this is because I do not understand the jython mechanism for
inheritance (yet).

JyFitServer.py:
===========
import fit.FitServer
import fitnesse.compon ents.FitProtoco l
from fit.Parse import Parse
from fit.Fixture import Fixture

# Inherit from original Java FitServer Implementation by Robert C.
Martin and Micah D. Martin
class FitServer(fit.F itServer):
# call constructor of superclass
def __init__(self, host, port, verbose):
FitServer.__ini t__(self, host, port, verbose)

# override process method
def process(self):
self.fixture.li stener = self.fixtureLis tener
print "hello, I am JyFitServer!"
try:
size = FitProtocol.rea dSize(self.sock etReader)
if size > 0:
try:
document =
FitProtocol.rea dDocument(self. socketReader, size)
tables = Parse(document)
fixture = Fixture()
fixture.listene r = self.fixtureLis tener;
fixture.doTable s(tables)
self.counts.tal ly(self.fixture .counts)
except FitParseExcepti on, e:
self.exception( e)
except Exception, e:
self.exception( e)

Please help,
Mark Fink

Feb 7 '06 #1
12 5936
[Mark Fink]
I wrote a Jython class that inherits from a Java class and (thats the
plan) overrides one method. Everything should stay the same.

If I run this nothing happens whereas if I run the Java class it says:
usage: java fit.FitServer [-v] host port socketTicket
-v verbose

I think this is because I do not understand the jython mechanism for
inheritance (yet).
1. Are you running jythonc?

If yes, I think your class and file should have the same name, i.e.
Class FitServer should be in a file called "FitServer. py". I recommend
calling your class something different from the base class, e.g.
MyJythonFitServ er, to prevent namespace clashes.

2. If your main function in jython? If yes, please post the code so we
can see how you're instantiating your objects?

3. How are you running this? I.e. show us a command line session which
uses your class.
JyFitServer.py:
=========== class FitServer(fit.F itServer):
# call constructor of superclass
def __init__(self, host, port, verbose):
FitServer.__ini t__(self, host, port, verbose) ^^^^^^^^^
Shouldn't this be:
fit.FitServer._ _init__(self, host, port, verbose)


I'm not sure the latter is cause of your problems, but it might be.

HTH,

--
alan kennedy
------------------------------------------------------
email alan: http://xhaus.com/contact/alan

Feb 8 '06 #2
Mark Fink wrote:
I wrote a Jython class that inherits from a Java class and (thats the
plan) overrides one method. Everything should stay the same.

If I run this nothing happens whereas if I run the Java class it says:
usage: java fit.FitServer [-v] host port socketTicket
-v verbose
It sounds like the Java class has a main() function. When you run it as
an application, the Java runtime looks for the main() function in the
class you tell it to run.

Even in Java, this behaviour is not preserved by inheritance, a subclass
has to have its own main() to be executable.

Jython (and Python) works a little differently, your module is executed
from start to finish when you run it. Any statements that are not inside
a class or function definition will be executed. (Actually the class and
function definitions are executed to, but not in the same way...)

You might get the behaviour you want if you put the line
import sys
fit.FitServer.m ain(sys.argv)

at the end of your file. This will run the main() function of the Java
class.

Kent

I think this is because I do not understand the jython mechanism for
inheritance (yet).

JyFitServer.py:
===========
import fit.FitServer
import fitnesse.compon ents.FitProtoco l
from fit.Parse import Parse
from fit.Fixture import Fixture

# Inherit from original Java FitServer Implementation by Robert C.
Martin and Micah D. Martin
class FitServer(fit.F itServer):
# call constructor of superclass
def __init__(self, host, port, verbose):
FitServer.__ini t__(self, host, port, verbose)

# override process method
def process(self):
self.fixture.li stener = self.fixtureLis tener
print "hello, I am JyFitServer!"
try:
size = FitProtocol.rea dSize(self.sock etReader)
if size > 0:
try:
document =
FitProtocol.rea dDocument(self. socketReader, size)
tables = Parse(document)
fixture = Fixture()
fixture.listene r = self.fixtureLis tener;
fixture.doTable s(tables)
self.counts.tal ly(self.fixture .counts)
except FitParseExcepti on, e:
self.exception( e)
except Exception, e:
self.exception( e)

Please help,
Mark Fink

Feb 9 '06 #3
Alan, Kent, many thanks this really helped!
But there is still a problem I guess with inheritance. I use the java
testsuit supplied with the original to test the server. If I use the
Java FitServer the testsuite can be completed. I commented everything
out from my class and it does not work??
Thats the trace when I run the JUnit testsuit:
java.io.IOExcep tion: CreateProcess: jython
D:\AUT_TEST\wor kspace\JyFIT\fi t\JyFitServer.p y
-Dpython.path='D :\AUT_TEST\work space\JyFIT'
D:\AUT_TEST\fit nesse\fitnesse. jar localhost 1234 23 error=2
at java.lang.Proce ssImpl.create(N ative Method)
at java.lang.Proce ssImpl.<init>(U nknown Source)
at java.lang.Proce ssImpl.start(Un known Source)
at java.lang.Proce ssBuilder.start (Unknown Source)
at java.lang.Runti me.exec(Unknown Source)
at java.lang.Runti me.exec(Unknown Source)
at java.lang.Runti me.exec(Unknown Source)
at
FitServerTest.F itServerTest.pr epareSessionPro cess(FitServerT est.java:163)
at
FitServerTest.F itServerTest.te stSimpleStartUp (FitServerTest. java:36)
at sun.reflect.Nat iveMethodAccess orImpl.invoke0( Native Method)
at sun.reflect.Nat iveMethodAccess orImpl.invoke(U nknown Source)
at sun.reflect.Del egatingMethodAc cessorImpl.invo ke(Unknown Source)
at java.lang.refle ct.Method.invok e(Unknown Source)
at junit.framework .TestCase.runTe st(TestCase.jav a:154)
at junit.framework .TestCase.runBa re(TestCase.jav a:127)
at junit.framework .TestResult$1.p rotect(TestResu lt.java:106)
at junit.framework .TestResult.run Protected(TestR esult.java:124)
at junit.framework .TestResult.run (TestResult.jav a:109)
at junit.framework .TestCase.run(T estCase.java:11 8)
at junit.framework .TestSuite.runT est(TestSuite.j ava:208)
at junit.framework .TestSuite.run( TestSuite.java: 203)
at
org.eclipse.jdt .internal.junit .runner.RemoteT estRunner.runTe sts(RemoteTestR unner.java:478)
at
org.eclipse.jdt .internal.junit .runner.RemoteT estRunner.run(R emoteTestRunner .java:344)
at
org.eclipse.jdt .internal.junit .runner.RemoteT estRunner.main( RemoteTestRunne r.java:196)

Unfortunately I do not get much information at the prompt because both
Java FitServer and JyFitServer behave the same there.
D:\AUT_TEST>jyt hon D:\\AUT_TEST\\w orkspace\\JyFIT \\fit\\JyFitSer ver.py
-Dpython.path='D :\\AUT_TEST\\wo rkspace\\JyFIT'
D:\\AUT_TEST\\f itnesse\\fitnes se.jar localhost 1234 23
Traceback (innermost last):
File "D:\\AUT_TEST\\ workspace\\JyFI T\\fit\\JyFitSe rver.py", line 42,
in ?
java.net.Connec tException: Connection refused: connect
at java.net.PlainS ocketImpl.socke tConnect(Native Method)
at java.net.PlainS ocketImpl.doCon nect(PlainSocke tImpl.java:333)
at
java.net.PlainS ocketImpl.conne ctToAddress(Pla inSocketImpl.ja va:195)
at java.net.PlainS ocketImpl.conne ct(PlainSocketI mpl.java:182)
at java.net.SocksS ocketImpl.conne ct(SocksSocketI mpl.java:366)
at java.net.Socket .connect(Socket .java:507)
at java.net.Socket .connect(Socket .java:457)
at java.net.Socket .<init>(Socket. java:365)
at java.net.Socket .<init>(Socket. java:178)
at fit.FitServer.e stablishConnect ion(Unknown Source)
at fit.FitServer.e stablishConnect ion(Unknown Source)
at fit.FitServer.r un(Unknown Source)
at sun.reflect.Nat iveMethodAccess orImpl.invoke0( Native Method)
at
sun.reflect.Nat iveMethodAccess orImpl.invoke(N ativeMethodAcce ssorImpl.java:3 9)
at
sun.reflect.Del egatingMethodAc cessorImpl.invo ke(DelegatingMe thodAccessorImp l.java:25)
at java.lang.refle ct.Method.invok e(Method.java:5 85)
at
org.python.core .PyReflectedFun ction.__call__( PyReflectedFunc tion.java)
at org.python.core .PyMethod.__cal l__(PyMethod.ja va)
at org.python.core .PyObject.__cal l__(PyObject.ja va)
at org.python.core .PyInstance.inv oke(PyInstance. java)
at
org.python.pyco de._pyx0.f$0(D: \\AUT_TEST\\wor kspace\\JyFIT\\ fit\\JyFitServe r.py:42)
at
org.python.pyco de._pyx0.call_f unction(D:\\AUT _TEST\\workspac e\\JyFIT\\fit\\ JyFitServer.py)
at org.python.core .PyTableCode.ca ll(PyTableCode. java)
at org.python.core .PyCode.call(Py Code.java)
at org.python.core .Py.runCode(Py. java)
at org.python.core .__builtin__.ex ecfile_flags(__ builtin__.java)
at
org.python.util .PythonInterpre ter.execfile(Py thonInterpreter .java)
at org.python.util .jython.main(jy thon.java)

java.net.Connec tException: java.net.Connec tException: Connection
refused: connect

###### And the Java FitServer:
D:\AUT_TEST>jav a -cp D:\\AUT_TEST\\f itnesse\\fitnes se.jar fit.FitServer
localhost 1234 23
Exception in thread "main" java.net.Connec tException: Connection
refused: connect
at java.net.PlainS ocketImpl.socke tConnect(Native Method)
at java.net.PlainS ocketImpl.doCon nect(Unknown Source)
at java.net.PlainS ocketImpl.conne ctToAddress(Unk nown Source)
at java.net.PlainS ocketImpl.conne ct(Unknown Source)
at java.net.SocksS ocketImpl.conne ct(Unknown Source)
at java.net.Socket .connect(Unknow n Source)
at java.net.Socket .connect(Unknow n Source)
at java.net.Socket .<init>(Unknow n Source)
at java.net.Socket .<init>(Unknow n Source)
at fit.FitServer.e stablishConnect ion(Unknown Source)
at fit.FitServer.e stablishConnect ion(Unknown Source)
at fit.FitServer.r un(Unknown Source)
at fit.FitServer.m ain(Unknown Source)

.... not to bad.
That is the code with everything commented out:
import sys
import fit.FitServer
import fitnesse.compon ents.FitProtoco l
from fit.Parse import Parse
from fit.Fixture import Fixture

# Inherit from original Java FitServer Implementation by Robert C.
Martin and Micah D. Martin
class JyFitServer(fit .FitServer):
"""
# call constructor of superclass
def __init__(self, host, port, verbose):
fit.FitServer._ _init__(self, host, port, verbose)

# override process method
def process(self):
self.fixture.li stener = self.fixtureLis tener
print "hello, I am JyFitServer!"
try:
size = FitProtocol.rea dSize(self.sock etReader)
if size > 0:
try:
document =
FitProtocol.rea dDocument(self. socketReader, size)
tables = Parse(document)
fixture = Fixture()
fixture.listene r = self.fixtureLis tener;
fixture.doTable s(tables)
self.counts.tal ly(self.fixture .counts)
except FitParseExcepti on, e:
self.exception( e)
except Exception, e:
self.exception( e)
"""

# this is main
jyFitServer = JyFitServer()
sys.argv.pop(0) # remove first parameter
sys.argv.pop(0) # remove first parameter
sys.argv.pop(0) # remove first parameter
sys.argv.pop(0) # remove first parameter
#print sys.argv
jyFitServer.run (sys.argv)
#return jyFitServer.exi tCode()

I have the feeling that I am almost there. Yust something small
missing.

Feb 10 '06 #4
I observed something strange when I tried to compile the jython class:
D:\AUT_TEST\wor kspace\JyFIT\fi t>jythonc JyFitServer.py
processing JyFitServer

Required packages:
fitnesse.util
java.io
java.net
fitnesse.compon ents*

Creating adapters:

Creating .java files:
JyFitServer module
JyFitServer extends fit.FitServer

Compiling .java to .class...
Compiling with args: ['C:\\Programme\ \Java\\jdk1.5.0 _06\\bin\\javac ',
'-classpath',
'D:/AUT_TEST/JyFIT_port/fit;D:\\AUT_TES T\\Jython21\\jy thon.jar;C:\\Pr ogramme\\Java\\ jdk1.5.0_06\\li b\\tools.jar;C: \\
Java\\jboss-4.0.0\\server\\ default\\lib\\m ysql-connector-java-2.0.14-bin.jar;C:\\Jav a\\jboss-4.0.0\\client\\ jboss-j2ee.jar;C:\\Ja va\\jboss-4.0.0\\client\\ jboss-client.jar;C:\\ Java\\jboss-4.0.0\\client
\\jbosssx-client.jar;C:\\ Java\\jboss-4.0.0\\client\\ jnp-client.jar;C:\\ Java\\jboss-4.0.0\\client\\ jnet.jar;C:\\Ja va\\jboss-4.0.0\\client\\ jboss-common-client.jar;C:\\ Java\\jboss-4.0.0\\tomcat-4.1.x\\c
ommon\\lib\\ser vlet.jar;D:\\AU T_TEST\\Jython2 1\\jython.jar;D :\\AUT_TEST\\fi tnesse\\fitness e.jar;D:\\AUT_T EST\\JyFIT_port ;%CLASSPATH%;.\ \jpywork;;D:\\A UT_TEST\\Jython 21\\Tools\\jyth onc;D:\\AUT_TES T\\wo
rkspace\\JyFIT\ \fit\\.;D:\\AUT _TEST\\Jython21 \\Lib;D:\\AUT_T EST\\workspace\ \JyFIT;D:\\AUT_ TEST\\fitnesse\ \fitnesse.jar;D :\\AUT_TEST\\Jy thon21',
'.\\jpywork\\Jy FitServer.java']
1 D:\AUT_TEST\Jyt hon21\org\pytho n\core\Py.java: 989: as of release 1.4,
'assert' is a keyword, and may not be used as an identifier
(try -source 1.3 or lower to use 'assert' as an identifier)
public static void assert(PyObject test, PyObject message) {
^
D:\AUT_TEST\Jyt hon21\org\pytho n\core\Py.java: 995: as of release 1.4,
'assert' is a keyword, and may not be used as an identifier
(try -source 1.3 or lower to use 'assert' as an identifier)
public static void assert(PyObject test) {
^
D:\AUT_TEST\Jyt hon21\org\pytho n\core\Py.java: 996: ')' expected
assert(test, Py.None);
^
D:\AUT_TEST\Jyt hon21\org\pytho n\parser\Python Grammar.java:67 39: as of
release 1.5, 'enum' is a keyword, and may not be used as an identifier
(try -source 1.4 or lower to use 'enum' as an identifier)
for (java.util.Enum eration enum = jj_expentries.e lements();
enum.hasMoreEle ments();) {
^
D:\AUT_TEST\Jyt hon21\org\pytho n\parser\Python Grammar.java:67 39: as of
release 1.5, 'enum' is a keyword, and may not be used as an identifier
(try -source 1.4 or lower to use 'enum' as an identifier)
for (java.util.Enum eration enum = jj_expentries.e lements();
enum.hasMoreEle ments();) {
^
D:\AUT_TEST\Jyt hon21\org\pytho n\parser\Python Grammar.java:67 40: as of
release 1.5, 'enum' is a keyword, and may not be used as an identifier
(try -source 1.4 or lower to use 'enum' as an identifier)
int[] oldentry = (int[])(enum.nextElem ent());
^
D:\AUT_TEST\Jyt hon21\org\pytho n\core\Py.java: 996: incompatible types
found : org.python.core .PyObject
required: boolean
assert(test, Py.None);
^
D:\AUT_TEST\Jyt hon21\org\pytho n\core\PyBeanPr operty.java:36: warning:
non-varargs call of varargs method with inexact argument type for last
parameter;
cast to java.lang.Objec t for a varargs call
cast to java.lang.Objec t[] for a non-varargs call and to suppress this
warning
Object value = getMethod.invok e(iself, Py.EmptyObjects );
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecati on for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
7 errors
1 warning

ERROR DURING JAVA COMPILATION... EXITING

D:\AUT_TEST\wor kspace\JyFIT\fi t>
Looks like something in the Jython core causes the problem
(org\python\cor e\Py.java) any Ideas what I can do?

Feb 10 '06 #5
Mark Fink wrote:
I observed something strange when I tried to compile the jython class:
'assert' is a keyword, and may not be used as an identifier
(try -source 1.3 or lower to use 'assert' as an identifier)
public static void assert(PyObject test, PyObject message) { Looks like something in the Jython core causes the problem
(org\python\cor e\Py.java) any Ideas what I can do?


I think jythonc is not compatible with Java 1.5, try compiling with 1.4.

Kent
Feb 10 '06 #6
Jython 2.2 Alpha 1 supports Java 1.5

Frank.

Kent Johnson wrote:
Mark Fink wrote:
I observed something strange when I tried to compile the jython class:
'assert' is a keyword, and may not be used as an identifier
(try -source 1.3 or lower to use 'assert' as an identifier)
public static void assert(PyObject test, PyObject message) {


Looks like something in the Jython core causes the problem
(org\python\cor e\Py.java) any Ideas what I can do?

I think jythonc is not compatible with Java 1.5, try compiling with 1.4.

Kent

Feb 11 '06 #7
Please enlighten me. This seemed so easy yust inherit from a Java class
overwrite one method - done. At the moment I do not know how to proceed
:-((
Jython or jythonc?
=============== ===
In general is it better to run programms with the jython interpreter or
is it better to compile them first? I had the impression that the
inheritance does not work with the interpreter. Is that right?

2.1 or 2.2a
===========
The programm did not compile with the 2.1 version and Java 1.5. But
with 2.2a it compiled but 2.2a is an alpha version. Assuming the
programm would compile with the Java 1.4 version would it be better
(saver, more stable, performance) to use 2.1 or 2.2a?

Inherit from java baseclass or reimplement the whole thing in jython?
=============== =============== =============== =============== =========
All the problems with Jython stated when I wanted to inherit from a
Java baseclass. I wounder if I would have more success when
implementing it in pure Jython. Regarding the inheritance I had an
empty wrapper arround the Java baseclass and 70% of the unit test
passed. But the performance was ~ factor 10 slower than using the base
class directly. Does this mean that there is overhead with the
inheritanc construct and that this implementation path would always be
so slow. On the other hand would a 100% Jython solution be faster?

Mark

Feb 11 '06 #8
Frank LaFond wrote:
Jython 2.2 Alpha 1 supports Java 1.5


It is also buggy and IIRC has a broken jythonc which is what the OP is
trying to use.

Kent
Feb 11 '06 #9
Mark Fink wrote:
Please enlighten me. This seemed so easy yust inherit from a Java class
overwrite one method - done. At the moment I do not know how to proceed
:-((
It should be easy.
Jython or jythonc?
=============== ===
In general is it better to run programms with the jython interpreter or
is it better to compile them first? I had the impression that the
inheritance does not work with the interpreter. Is that right?
I personally avoid jythonc, I have not had success with it. Others
apparently have and use it.

Inheritance works fine without jythonc. The limitation in non-compiled
Jython is in the methods that are visible to Java code. Java code will
only see methods of a Jython class that are declared in a Java class or
interface that the Jython class extends or implements.

For example:

Java:

public class Foo {
public int value() { return 3; }
}

public interface Bar {
public int anotherValue();
}

Jython:
class Baz(Foo, Bar):
def value(self): return 5
def anotherValue(se lf): return 7
def somethingComple telyDifferent(s elf): return 42

Now, a Java client that has an instance of Baz will be able to call
baz.value()
baz.anotherValu e()
but
baz.somethingCo mpletelyDiffere nt()
will not be possible even using Java introspection.

OTOH a Jython client will be able to access all three methods of baz.

2.1 or 2.2a
===========
The programm did not compile with the 2.1 version and Java 1.5. But
with 2.2a it compiled but 2.2a is an alpha version. Assuming the
programm would compile with the Java 1.4 version would it be better
(saver, more stable, performance) to use 2.1 or 2.2a?
IMO Jython 2.2a1 is not near ready for production use. Jython 2.1 is
very stable and usable.
Inherit from java baseclass or reimplement the whole thing in jython?
=============== =============== =============== =============== =========
All the problems with Jython stated when I wanted to inherit from a
Java baseclass. I wounder if I would have more success when
implementing it in pure Jython. Regarding the inheritance I had an
empty wrapper arround the Java baseclass and 70% of the unit test
passed. But the performance was ~ factor 10 slower than using the base
class directly. Does this mean that there is overhead with the
inheritanc construct and that this implementation path would always be
so slow. On the other hand would a 100% Jython solution be faster?


Inheritance from Java works well and I have never seen performance
problems like this.

Java JUnit uses introspection to find test methods so it won't find
methods of a Jython class.

HTH,
Kent
Feb 11 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4584
by: Michael Chermside | last post by:
Ype writes: > For the namespaces in Jython this 'Python internal thread safety' > is handled by the Java class: > > http://www.jython.org/docs/javadoc/org/python/core/PyStringMap.html > > which has almost all of it public methods Java synchronized: > > http://cvs.sourceforge.net/viewcvs.py/jython/jython/org/python/core/PyStringMap.
6
2119
by: Dave Benjamin | last post by:
Hey good people, I've been doing a lot of simultaneous Jython and CPython programming lately, and just wanted to say, with no intended ill will toward any of the individuals who have been generous enough to make the two languages possible, that, well, they're kinda different. I guess it was inevitable, but with Jython stuck at Python 2.1, it's not really the same language as CPython is today. You still have to type "from __future__...
4
3431
by: angel | last post by:
A java runtime environment includes jvm and java class (for example classes.zip in sun jre). Of course jython need jvm,but does it need java class. Thanx
7
12768
by: Jan Gregor | last post by:
Hello I found that jython catches exact java exceptions, not their subclasses. Is there some way to get around this limitation (or error) ? My program has class representing database source and specialed classes for particulars databases. Now there are two options - to include exception (subclasses of SQLException) for every db in except (so all drivers has to be present) or to move methods to subclasses.
5
3690
by: Maurice Ling | last post by:
Hi, I have read that this had been asked before but there's no satisfactory replies then. I have a module (pA) written in python, which originally is called by another python module (pB), and passes a python object (pO) to pB. Now I require pA to be called in a java class (jC) and pass pO into jC. As pA uses non-python modules, I am not able to use Jython on this.
1
4666
by: ivansh | last post by:
Hello, For one java class (Hello) i use another (HelloPrinter) to build the string representation of the first one. When i've tried to use this from within jython, HelloPrinter.toString(hello) call gives results like Object.toString() of hello has being called. The example below shows this behaviour. Could somebody explain this?
3
4156
by: donkeyboy | last post by:
All, I'm having issues installing Jython on Windows XP. I've looked on the web and this newsgroup but to no avail. Any suggestions? The shell listing is below: NB I've got Cygwin installed, hence the Unix 'ls' on a Windows box C:\>cd Jython
2
2479
by: donkeyboy | last post by:
All, I've tried the jythonc compiler to try and create an applet to see how it works, but I get a number of Java compile errors that are way above my knowledge. Does anyone know what any of the following means? I'm using JDK 1.5.0_09, under Win XP SP2. Runnnig the file " jython FILENAME" works, so I don't know what's happening. Any thoughts?
1
1500
by: kramer31 | last post by:
Hi. First, I'm not sure if this is the correct group, but becuase I couldn't find a jython newsgroup, I'll post here. I'm new to jython and am just trying to get it to work. Interpreted jython works just fine, but I still can't get my compiled jython to work. When I do this: jythonc fac.py (where fac.py is a jython program), it creates a
0
11103
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10720
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10819
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9555
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7953
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5781
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5978
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4196
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3225
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.