Daily Archives

Articles indexed Saturday March 13 2010

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

  • Tomcat to Glassfish url

    - by Argiropoulos Stavros
    Let's say I have a Tomcat and a web application on it with index.html is in catalina_home\webapps\ROOT\index1.html and this web application runs successfully to the internet. Also I have a glassfish with another application deployed on it with let's say an index2.jsp. Can I have a link in index1 that can open index2?

    Read the article

  • pyqt QTreeWidget setItemWidget dissapears after drag/drop

    - by mleep
    I'm trying to keep a widget put into a QTreeWidgetItem after a reparent (drag and drop) using QTreeWidget.setItemWidget() But the result, if you compile the following code - is that the widget inside the QTreeWidgetItem disappears. Any idea why? What code would fix this (repopulate the QTreeWidgetItem with the widget I guess?) from PyQt4.QtCore import * from PyQt4.QtGui import * class InlineEditor (QWidget): _MUTE = 'MUTE' def __init__ (self, parent): QWidget.__init__ (self, parent) self.setAutoFillBackground (True) lo = QHBoxLayout() lo.setSpacing(4) self._cbFoo = QComboBox() for x in ["ABC", "DEF", "GHI", "JKL"]: self._cbFoo.addItem(x) self._leBar = QLineEdit('', self) lo.addWidget (self._cbFoo, 3) lo.addSpacing (5) lo.addWidget (QLabel ( 'Bar:')) lo.addWidget (self._leBar, 3) lo.addStretch (5) self.setLayout (lo) class Form (QDialog): def __init__(self,parent=None): QDialog.__init__(self, parent) grid = QGridLayout () tree = QTreeWidget () # Here is the issue? tree.setDragDropMode(QAbstractItemView.InternalMove) tree.setColumnCount(3) for n in range (2): i = QTreeWidgetItem (tree) # create QTreeWidget the sub i i.setText (0, "first" + str (n)) # set the text of the first 0 i.setText (1, "second") for m in range (2): j = QTreeWidgetItem(i) j.setText (0, "child first" + str (m)) #b1 = QCheckBox("push me 0", tree) # this wont work w/ drag by itself either #tree.setItemWidget (tree.topLevelItem(0).child(1), 1, b1) item = InlineEditor(tree) # deal with a combination of multiple controls tree.setItemWidget(tree.topLevelItem(0).child(1), 1, item) grid.addWidget (tree) self.setLayout (grid) app = QApplication ([]) form = Form () form.show () app.exec_ ()

    Read the article

  • Example website login/registration code?

    - by Phil Wright
    I am looking at building the login/registration part of a website (ASP.NET) and would like to see some example code or instructions on how to do this properly. For example, how to correctly use cookies and how to encrypt what is stored in the cookie to ensure the session persists until they logout/timeout. I do not want to use the builtin ASP.NET Membership/Provider stuff as it looks painful to use and not very flexible. Please do not answer with 'This is how easy the ASP.NET Membership/Providre stuff is to use, just check this out and you will use it!' as I don't want to use it!

    Read the article

  • Making Latex typeset given text on two facing pages

    - by Charles Stewart
    How do I encourage/make Latex typeset some portion of text so that it will all appear on a consecutive even-page, odd-page pair of pages? With trial and error, \nopagebreak can be coaxed into doing this, but is there a strategy that Just Works? Something like a samepage environment would be ideal, but one that: Will force a pagebreak on odd pages if that is needed to get all the text on facing pages; Allows up to one page break anywhere in the environment body, and fails noisily if that can't be ensured.

    Read the article

  • jQuery / jqGrids / Submitting form data troubles...

    - by Kelso
    Ive been messing with jqgrids alot of the last couple days, and I have nearly everything the way I want it from the display, tabs with different grids, etc. Im wanting to make use of Modal for adding and editing elements on my grid. My problem that Im running into is this. I have my editurl:"editsu.php" set, if that file is renamed, on edit, i get a 404 in the modal.. great! However, with that file in place, nothing at all seems to happen. I even put a die("testing"); line at the top, so it sees the file, it just doesnt do anything with it. Below is the content. ........ the index page jQuery("#landings").jqGrid({ url:'server.php?tid=1', datatype: "json", colNames:['ID','Tower','Sector', 'Client', 'VLAN','IP','DLink','ULink','Service','Lines','Freq','Radio','Serial','Mac'], colModel:[ {name:'id', index:'id', width : 50, align: 'center', sortable:true,editable:true,editoptions:{size:10}}, {name:'tower', index:'tower', width : 85, align: 'center', sortable:true,editable:false,editoptions:{readonly:true,size:30}}, {name:'sector', index:'sector', width : 50, align: 'center',sortable:true,editable:true,editoptions:{readonly:true,size:20}}, {name:'customer',index:'customer', width : 175, align: 'left', editable:true,editoptions:{readonly:true,size:35}}, {name:'vlan', index:'vlan', width : 35, align: 'left',editable:true,editoptions:{size:10}}, {name:'suip', index:'suip', width : 65, align: 'left',editable:true,editoptions:{size:20}}, {name:'datadl',index:'datadl', width:55, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from datatypes"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}}, {name:'dataul', index:'dataul', width : 55, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from datatypes"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}}, {name:'servicetype', index:'servicetype', width : 85, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from servicetype"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}}, {name:'voicelines', index:'voicelines', width : 35, align: 'center',editable:true,editoptions:{size:30}}, {name:'freqname', index:'freqname', width : 35, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from freqband"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}}, {name:'radioname', index:'radioname', width : 120, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from radiotype"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}}, {name:'serial', index:'serial', width : 100, align: 'right',editable:true,editoptions:{size:20}}, {name:'mac', index:'mac', width : 120, align: 'right',editable:true,editoptions:{size:20}} ], rowNum:20, rowList:[30,50,70], pager: '#pagerl', sortname: 'sid', mtype: "GET", viewrecords: true, sortorder: "asc", altRows: true, caption:"Landings", editurl:"editsu.php", height:420 }); jQuery("#landings").jqGrid('navGrid','#pagerl',{edit:true,add:true,del:false,search:false},{height:400,reloadAfterSubmit:false},{height:400,reloadAfterSubmit:false},{reloadAfterSubmit:false},{}); now for the editsu.php file.. $operation = $_REQUEST['oper']; if ($operation == "edit") { qquery("UPDATE customers SET vlan = '".$_POST['vlan']."', datadl = '".$_POST['datadl']."', dataul = '".$_POST['dataul']."', servicetype = '".$_POST['servicetype']."', voicelines = '".$_POST['voicelines']."', freqname = '".$_POST['freqname']."', radioname = '".$_POST['radioname']."', serial = '".$_POST['serial']."', mac = '".$_POST['mac']."' WHERE id = '".$_POST['id']."'") or die(mysql_error()); } Im just having a hard time troubleshooting this to figure out where its getting hung up at. My next question after this would be to see if its possible to make it so when you click "add", that it auto inserts a row into the db with a couple variable predtermined and then bring up the modal window, but ill work on the first problem first. thanks!

    Read the article

  • What should a PHP generate to give back to a jQuery AJAX request?

    - by Alex Mcp
    Perhaps it's a syntax error, but I never assume that. I have a -dead- simple AJAX test set up: http://www.mcphersonindustries.com/bucket/api.php is a file with simply: <?php echo "test"; ?> And I have Apache as localhost with this jQuery bit running: $(document).ready(function() { function doAjaxPost() { $.ajax({ type: "POST", url: "http://www.mcphersonindustries.com/bucket/api.php", data: "null", success: function(resp){ console.log("Response: '" + resp + "'"); }, error: function(e){ console.log('Error: ' + e); } }); } doAjaxPost(); }); So Firebug spits out Response: '' each time, but nothing's coming through the request. Do I need to declare a header in PHP? Am I making a boneheaded mistake somewhere? Thanks for the insights, as always.

    Read the article

  • How come jQuery can't remove this element?

    - by George Edison
    I have a table like this: <table id='inventory_table'> <tr id='no_items_avail'> <td> There are no items in the database. </td> </tr> </table> And I want to get rid of it with jQuery like this: $('#inventory_table tbody tr#no_items_avail').remove(); However it doesn't seem to be working at all. What am I doing wrong? Edit: Also, the row above was originally inserted into the DOM with another jQuery call: $('#inventory_table tbody').append("<tr id='no_items_avail'....... If that helps. And, running: alert($('#no_items_avail').text()); yields "There are no items in the database." as expected.

    Read the article

  • Does Java have an equivalent to .NET resource (.resx) files for localization?

    - by frankadelic
    Does Java have an equivalent to .NET resource (.resx) files for localization? In .NET, you can define resources as key-value pairs within a standard XML document. The resource files are named according to the culture. For example: myresources.resx myresources.en-us.resx myresources.fr-fr.resx myresources.de-de.resx Is there an equivalent in Java? Are the similar naming conventions used for files?

    Read the article

  • What are logical and path queries

    - by NomeN
    I'm reading a paper which mentions that a language for refactoring has three specific requirements. functional features (like ML) logical queries (like Datalog) path queries (like Datalog) I know what they mean by functional features, but I'm not totally clear on the latter two and can't find a clear explanation either. Although I have a good idea after what I could find on the subjects, I need to be sure so here goes: Could the SO-community please clearly explain to me what logical queries and path queries are? Or at the very least what the people from the paper meant?

    Read the article

  • python blocking sockets, send returns immediately

    - by Mark
    Hi, I am writing a multithreaded socket application in Python using the socket module. the server listens for connections and when it gets one it spawns a thread for that socket. the server thread sends some data to the client. but the client is not yet ready to receive it. I thought this would have caused the server to wait until the client starts recv but instead returns immediately the client then calls recv which is blocking and no data is ever received. client socket constructor self.__clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.__clientSocket.connect((server, port)) server socket constructor self.servSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.servSock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) #self.servSock.settimeout(None) self.servSock.setblocking(1) self.servSock.bind((self.addr,self.port)) self.servSock.listen(5) listening accept thread try: (cs, address) = self.servSock.accept() except socket.timeout: return threadName = '\r\nClient %s:%s\r\n' % (cs, address) print threadName clientSocketHandler = ClientSocket() clientSocketHandler.setClientSocket(cs) self.clients.newThread(self.clientFunc, {clientSocketHandler : "1"}, threadName).start() server and clients send/rec methods from inside ClientSocket receivedData = self.__clientSocket.recv(1024*1024) self.__clientSocket.send(s) any ideas why send() is returning straight away?

    Read the article

  • How can I work around "Xcode could not locate source file"

    - by Septih
    Hello, I'm working with the ID3 framework in Xcode (which has since disappeared off the face of the web - including google cache!). I'm testing out an import mp3 feature which allows them to edit the tags as they import them. One of the test cases is a corrupt or invalid mp3 with no proper id3 header. The problem I'm having is that when updating the tags of the invalid mp3 (updateFile:), the ID3 framework attempts to use id3V1Tag.m (I assume it falls back to this if it can't find the v2 tag) and this is where I get the Xcode error (whilst running the program, not building): Xcode could not locate source file: id3V1Tag.m (line: 299) Even in a release build this crashes the program, so it's not something I can really ignore. I've tried putting a try/catch block around it but it's not treated as an exception so doesn't get caught. The function to load the tag data for the file returns a BOOL but it appears this only returns false if the given file doesn't exist, so this doesn't help either. Current code: [tagData release]; tagData = [[TagAPI alloc] initWithGenreList:nil]; tagsLoaded = [tagData examineFile:exportPath]; if(tagsLoaded) { [tagData setTitle:title]; [tagData setArtist:artist]; [tagData setComments:comments]; @try { [tagData updateFile]; } @catch (id e){ NSLog(@"h"); } }

    Read the article

  • Locate modules by stack address

    - by PaulH
    I have a Winodws Mobile 6.1 application running on an ARMV4I processor. Given a stack address (from unwinding an exception), I like to determine what module owns that address. Using the ToolHelpAPI, I'm able to determine most modules using the following method: HANDLE snapshot = ::CreateToolhelp32Snapshot( TH32CS_SNAPMODULE | TH32CS_GETALLMODS, 0 ); if( INVALID_HANDLE_VALUE != snapshot ) { MODULEENTRY32 mod = { 0 }; mod.dwSize = sizeof( mod ); if( ::Module32First( snapshot, &mod ) ) { do { if( stack_address > (DWORD)mod.modBaseAddr && stack_address < (DWORD)( mod.modBaseAddr + mod.modBaseSize ) ) { // Found the module! // offset = stack_address - mod.modBaseAddr break; } } while( ::Module32Next( snapshot, &mod ) ); } ::CloseToolhelp32Snapshot( snapshot ); } But, I don't always seem to be able to find a module that matches an address. For example: stack address module offset 0x03f65bd8 coredll.dll + 0x0001bbd8 0x785cab1c mylib.dll + 0x0002ab1c 0x785ca9e8 mylib.dll + 0x0002a9e8 0x785ca0a0 mylib.dll + 0x0002a0a0 0x785c8144 mylib.dll + 0x00028144 0x3001d95c ??? 0x3001dd44 ??? 0x3001db90 ??? 0x03f88030 coredll.dll + 0x0003e030 0x03f8e46c coredll.dll + 0x0004446c 0x801087c4 ??? 0x801367b4 ??? 0x8010ce78 ??? 0x801086dc ??? 0x03f8e588 coredll.dll + 0x00044588 0x785a56a4 mylib.dll + 0x000056a4 0x785bdd60 mylib.dll + 0x0001dd60 0x785bbd0c mylib.dll + 0x0001bd0c 0x785bdb38 mylib.dll + 0x0001db38 0x3001db20 ??? 0x3001dc40 ??? 0x3001a8a4 ??? 0x3001a79c ??? 0x03f67348 coredll.dll + 0x0001d348 Where do I find those stack addresses that are missing? Any suggestions? Thanks, PaulH

    Read the article

  • thread local stroage macosx

    - by anon
    http://developer.apple.com/mac/library/documentation/DeveloperTools/gcc-4.0.1/gcc/Thread_002dLocal.html Documents __thread yet my g++ compalins that __thread is not suppoted on my arch (Leopard on Macbookpro). Why is this? And how do I get around it?

    Read the article

  • Silverlight - Get the ItemsControl of a DataTemplate

    - by user208662
    Hello, I have a Silverlight application that is using a DataGrid. Inside of that DataGrid I have a DataTemplate that is defined like the following: <Grid x:Name="myGrid" Tag="{Binding}" Loaded="myGrid_Loaded"> <ItemsControl ItemsSource="{Binding MyItems}" Tag="{Binding}"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal" Width="138"> <TextBlock Text="{Binding Type}" /> <TextBox x:Name="myTextBox" TextChanged="myTextBox_TextChanged" /> </StackPanel> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </Grid> When a user enters text into the TextBox, I have an event (myTextBox_TextChanged) that must be fired at this point. When that event gets fired, I would like to get the ItemsControl element that is the container for this TextBox. How do I get that ItemsControl from my event handler? Please note: Because the ItemsControl is in the DataTemplate of DataGrid, I don't believe I can just add an x:Name and reference it from my code-behind. Or is there a way to do that? Thank you!

    Read the article

  • Covering Earth with Hexagonal Map Tiles

    - by carrier
    Many strategy games use hexagonal tiles. One of the main advantages is that the distance between the center of any tile and all its neighboring tiles is the same. I was wondering if anyone has any thoughts on marrying a hexagonal tile system with the traditional geographic system (longitude/latitude). I think it would be interesting to cover a globe with hexagonal tiles and be able to map a geographic coordinate to a tile. Has anyone seen anything remotely close to this before? UPDATE I'm looking for a way to subdivide the surface of a sphere so that each division has the same surface area. Ideally, the centers of adjacent sub-divisions would be equidistant.

    Read the article

  • two domains two servers one dynamic ip address

    - by giantman
    as i said i have 2 domain hi.org and bye.net and one dynamic ip address and two servers. i want to attach one domain bye.net to server1 and hi.org to server2. using apache wamp 2.0i. i hope someone will be able to answer. ` httpd.conf file additions ProxyRequests Off Order deny,allow Allow from all vhost file additions NameVirtualHost *:80 default DocumentRoot "c:/wamp/www/fallback" Server 1 DocumentRoot "c:/wamp/www" ServerName h**p://bye.net ServerAlias bye.net Server 2 ProxyPreserveHost On ProxyPass / h*p://192.168.1.119/ DocumentRoot "g:/wamp/www" ServerName h*p://hi.org ServerAlias hi.org ` after doing all this i fallback to server1 only i don't get the page hi.org i only get the page bye.net, i don't even get the default fallback page which gets executed when a person enters ip address but not the domain name. i use windows 7 (server2) and windows xp (server 1)

    Read the article

  • Unity framework - creating & disposing Entity Framework datacontexts at the appropriate time

    - by TobyEvans
    Hi there, With some kindly help from StackOverflow, I've got Unity Framework to create my chained dependencies, including an Entity Framework datacontext object: using (IUnityContainer container = new UnityContainer()) { container.RegisterType<IMeterView, Meter>(); container.RegisterType<IUnitOfWork, CommunergySQLiteEntities>(new ContainerControlledLifetimeManager()); container.RegisterType<IRepositoryFactory, SQLiteRepositoryFactory>(); container.RegisterType<IRepositoryFactory, WCFRepositoryFactory>("Uploader"); container.Configure<InjectedMembers>() .ConfigureInjectionFor<CommunergySQLiteEntities>( new InjectionConstructor(connectionString)); MeterPresenter meterPresenter = container.Resolve<MeterPresenter>(); this works really well in creating my Presenter object and displaying the related view, I'm really pleased. However, the problem I'm running into now is over the timing of the creation and disposal of the Entity Framework object (and I suspect this will go for any IDisposable object). Using Unity like this, the SQL EF object "CommunergySQLiteEntities" is created straight away, as I've added it to the constructor of the MeterPresenter public MeterPresenter(IMeterView view, IUnitOfWork unitOfWork, IRepositoryFactory cacheRepository) { this.mView = view; this.unitOfWork = unitOfWork; this.cacheRepository = cacheRepository; this.Initialize(); } I felt a bit uneasy about this at the time, as I don't want to be holding open a database connection, but I couldn't see any other way using the Unity dependency injection. Sure enough, when I actually try to use the datacontext, I get this error: ((System.Data.Objects.ObjectContext)(unitOfWork)).Connection '((System.Data.Objects.ObjectContext)(unitOfWork)).Connection' threw an exception of type 'System.ObjectDisposedException' System.Data.Common.DbConnection {System.ObjectDisposedException} My understanding of the principle of IoC is that you set up all your dependencies at the top, resolve your object and away you go. However, in this case, some of the child objects, eg the datacontext, don't need to be initialised at the time the parent Presenter object is created (as you would by passing them in the constructor), but the Presenter does need to know about what type to use for IUnitOfWork when it wants to talk to the database. Ideally, I want something like this inside my resolved Presenter: using(IUnitOfWork unitOfWork = new NewInstanceInjectedUnitOfWorkType()) { //do unitOfWork stuff } so the Presenter knows what IUnitOfWork implementation to use to create and dispose of straight away, preferably from the original RegisterType call. Do I have to put another Unity container inside my Presenter, at the risk of creating a new dependency? This is probably really obvious to a IoC guru, but I'd really appreciate a pointer in the right direction thanks Toby

    Read the article

  • Compiling a C program with a specific architecture

    - by Marplesoft
    I was recently fighting some problems trying to compile an open source library on my Mac that depended on another library and got some errors about incompatible library architectures. Can somebody explain the concept behind compiling a C program for a specific architecture? I have seen the -arch compiler flag before and have seen values passed to it such as ppc, i386 and x86_64 which I assume maps to the CPU "language", but my understanding stops there. If one program uses a particular architecture, do all libraries that it loads need to be on the same architecture as well? How can I tell what architecture a given program/process is running under?

    Read the article

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