Search Results

Search found 23 results on 1 pages for 'dolph mathews'.

Page 1/1 | 1 

  • Show/Hide RichFaces component onclick client-side? (without AJAX)

    - by Dolph Mathews
    I'm looking for a way to show/hide an arbitrary RichFaces component. In this case, I have a <rich:dataTable> that contains several rows. Each row needs to have it's own, independent Show/Hide link, such that when you click "Show details", two things happen: The "Show details" link is re-rendered as "Hide details" The associated detailsColumn is displayed. Furthermore, detailsColumns should be hidden by default (effectively rendered="true" to the client but hidden with style="display: none;"). I don't want to write my own JavaScript functions if it's not absolutely necessary. I also don't want to have a server-side bean keep track of which detailColumns are being displayed, and subsequently re-render everything over AJAX: this should be purely client-side behavior. I'm not sure how to accomplish that. The following pseudo-code (hopefully) illustrates my goal: <rich:column> <a href="#" onclick="#{thisRow.detailsColumn}.show();" rendered="">Show details</a> <a href="#" onclick="#{thisRow.detailsColumn}.hide();" rendered="">Hide details</a> </rich:column> <rich:column> <h:outputText value="#{thisRow.someData}" /> </rich:column> <rich:column id="detailsColumn" colspan="2" breakBefore="true"> <h:outputText value="#{thisRow.someMoreData}" /> </rich:column>

    Read the article

  • Replace diacritic characters with "equivalent" ASCII in PHP?

    - by Dolph Mathews
    Related questions: http://stackoverflow.com/questions/2653739/how-to-replace-characters-in-a-java-string http://stackoverflow.com/questions/2393887/how-to-replace-special-characters-with-their-equivalent-such-as-a-for-a As in the questions above, I'm looking for a reliable, robust way to reduce any unicode character to near-equivalent ASCII using PHP. I really want to avoid rolling my own look up table. For example (stolen from 1st referenced question): Gracišce becomes Gracisce

    Read the article

  • What headaches should I expect from using Trac?

    - by Dolph Mathews
    No tool is perfect, and I'm about to start several long-term projects using Trac, and wanted a heads up of the kinds of problems I may or may not experience with it. In other words, Trac meets my needs in the short term, and I've already made the decision to use it, but I want to know what to expect down the road. I am not looking for: "Use product X instead of Trac because..." answers. "Trac is great because..." answers. A comparison to any other specific system. "Trac doesn't support Feature X" answers. I can read the feature list too, thank you very much. I am looking for: "Feature X does not behave as expected..." "Trac behaves oddly when..." "Trac doesn't fully support..." "Trac itself has a known bug that will likely never be fixed..." And especially "Trac can't handle..." etc So, what Trac-induced headaches do I have to look forward to? For future reference, this question was asked while Trac v0.11 was the latest stable release.

    Read the article

  • How to remove the file suffix/extension (.jsp and .action) using the Stripes Framework?

    - by Dolph Mathews
    I'm looking to use pretty / clean URL's in my web app. I would like the following URL: http://mydomain.com/myapp/calculator .. to resolve to: com.mydomain.myapp.action.CalculatorActionBean I tried overwriting the NameBasedActionResolver with: public class CustomActionResolver extends NameBasedActionResolver { public static final String DEFAULT_BINDING_SUFFIX = "."; @Override protected String getBindingSuffix() { return DEFAULT_BINDING_SUFFIX; } @Override protected List<String> getActionBeanSuffixes() { List<String> suffixes = new ArrayList<String>(super.getActionBeanSuffixes()); suffixes.add(DEFAULT_BINDING_SUFFIX); return suffixes; } } And adding this to web.xml: <servlet-mapping> <servlet-name>StripesDispatcher</servlet-name> <url-pattern>*.</url-pattern> </servlet-mapping> Which gets me to: http://mydomain.com/myapp/Calculator. But: A stray "." is still neither pretty nor clean. The class name is still capitalized in the URL..? That still leaves me with *.jsp..? Is it even possible to get rid of both .action and .jsp?

    Read the article

  • Assign a unique client ID to each <rich:dataTable /> row?

    - by Dolph Mathews
    I'm relatively new to working with the UI in Seam, so I'm hoping there is something simple I can replace the three instances of UNIQUE_ID with in the following example (such as #{object.uniqueId}). The goal is to have a <rich:dataTable /> wherein each row has the ability to show/hide a <rich:modalPanel /> with more details about the particular object instance. <rich:dataTable var="object" value="#{bean.myObject}"> <rich:column> <h:outputText value="#{object.summary}" /> </rich:column> <rich:column> <a onclick="Richfaces.showModalPanel('UNIQUE_ID');" href="#">Show Details in ModalPanel</a> <a4j:form> <rich:modalPanel id="UNIQUE_ID" > <a onclick="Richfaces.hideModalPanel('UNIQUE_ID');" href="#">Hide This ModalPanel</a> <h:outputText value="#{object.details}" /> </rich:modalPanel> </a4j:form> </rich:column> </rich:dataTable> If I only had one link/modalPanel pair, this would obviously be trivial, but I don't know what to do within the scope of the <rich:dataTable />'s iteration. Also, in case it complicates things further, the page will also contain many <rich:dataTable />'s, each implementing this behavior.

    Read the article

  • Does style="color: #FFF;" render as #F0F0F0 or #FFFFFF?

    - by Dolph Mathews
    When defining colors using "shorthand hexidecimal" (style="color: #FFF;"), is there a defined method for expanding the shorthand? (style="color: #F0F0F0;" or style="color: #FFFFFF;") Do all browsers use the same expansion method? Is this behavior by specification (if so, where is it defined)? Does the expansion method perhaps vary between CSS 1/2/3? I've observed that "most browsers" expand to #FFFFFF. Are there any other places where this shorthand notation is allowed, but the expansion method is different? I've always avoided using shorthand hex, because I've never known the answers to these questions...

    Read the article

  • Playground for Artificial Intelligence?

    - by Dolph Mathews
    In school, one of my professors had created a 3D game (not just an engine), where all the players were entirely AI-controlled, and it was our assignment to program the AI of a single player. We were basically provided an API to interact with the game world. Our AI implementations were then dropped into the game together, and we watched as our programs went to battle against each other. It was like robot soccer, but virtual, and with lots of big guns. I'm now looking for anything similar (and open source) to play with. (Preferably in Java, but I'm open to any language.) I'm not looking for a game engine, or a framework... I'm looking for a complete game that simply lacks AI code... preferably set up for this kind of exercise. Suggestions?

    Read the article

  • PostgreSQL - Why are some queries on large datasets so incredibly slow

    - by Brad Mathews
    Hello, I have two types of queries I run often on two large datasets. They run much slower than I would expect them to. The first type is a sequential scan updating all records: Update rcra_sites Set street = regexp_replace(street,'/','','i') rcra_sites has 700,000 records. It takes 22 minutes from pgAdmin! I wrote a vb.net function that loops through each record and sends an update query for each record (yes, 700,000 update queries!) and it runs in less than half the time. Hmmm.... The second type is a simple update with a relation and then a sequential scan: Update rcra_sites as sites Set violations='No' From narcra_monitoring as v Where sites.agencyid=v.agencyid and v.found_violation_flag='N' narcra_monitoring has 1,700,000 records. This takes 8 minutes. The query planner refuses to use my indexes. The query runs much faster if I start with a set enable_seqscan = false;. I would prefer if the query planner would do its job. I have appropriate indexes, I have vacuumed and analyzed. I optimized my shared_buffers and effective_cache_size best I know to use more memory since I have 4GB. My hardware is pretty darn good. I am running v8.4 on Windows 7. Is PostgreSQL just this slow? Or am I still missing something? Thanks! Brad

    Read the article

  • Replicating SQL's 'Join' in Python

    - by Daniel Mathews
    I'm in the process of trying to switch from R to Python (mainly issues around general flexibility). With Numpy, matplotlib and ipython, I've am able to cover all my use cases save for merging 'datasets'. I would like to simulate SQL's join by clause (inner, outer, full) purely in python. R handles this with the 'merge' function. I've tried the numpy.lib.recfunctions join_by, but it critical issues with duplicates along the 'key': join_by(key, r1, r2, jointype='inner', r1postfix='1', r2postfix='2', defaults=None, usemask=True, asrecarray=False) Join arrays r1 and r2 on key key. The key should be either a string or a sequence of string corresponding to the fields used to join the array. An exception is raised if the key field cannot be found in the two input arrays. Neither r1 nor r2 should have any duplicates along key: the presence of duplicates will make the output quite unreliable. Note that duplicates are not looked for by the algorithm. source: http://presbrey.mit.edu:1234/numpy.lib.recfunctions.html Any pointers or help will be most appreciated!

    Read the article

  • How do I lock the workstation from a windows service?

    - by Brad Mathews
    Hello, I need to lock the workstation from a windows service written in VB.Net. I am writing the app on Windows 7 but it needs to work under Vista and XP as well. User32 API LockWorkStation does not work as it requires an interactive desktop and I get return value of 0. I tried calling %windir%\System32\rundll32.exe user32.dll,LockWorkStation from both a Process and from Shell, but still nothing happens. Setting the service to interact with the desktop is a no-go as I am running the service under the admin account so it can do some other stuff that requires admin rights - like disabling the network, and you can only select the interact with desktop option if running under Local System Account. That would be secondary question - how to run another app with admin rights from a service running under Local System Account without bugging the user. I am writing an app to control my kids computer/internet access (which I plan to open source when done) so I need everything to happen as stealthily as possible. I have a UI that handles settings and status notifications in the taskbar, but that is easy to kill and thus defeat the locking. I could make another hidden Windows Forms app to handle the locking, but that just seems a rather inelegant solution. Better ideas anyone? Thanks! Brad

    Read the article

  • Create new etherpad using PHP and CURL

    - by Kyle Mathews
    I'm trying to write a simple PHP script which automatically sets up new etherpads (see http://etherpad.com/). They don't have an API (yet) for creating new pads so I'm trying to figure if I can do things another way. After playing around some, I found that if you append a random string to etherpad.com to a not-yet-created pad, it'll come back with a form asking if you want to create a new etherpad at that address. If you submit that form, a new pad will be created at that URL. My thought then was I could just create a PHP script using CURL that would duplicate that form and trick etherpad into creating a new pad at whatever URL I give it. I wrote the script but so far I can't get it working. Can someone tell me what I'm doing wrong? First, here's the HTML form on the etherpad creation page: ` <p><tt id="padurl">http://etherpad.com/lsdjfsljfa-fdj-lsdf</tt></p> <br/> <p>There is no EtherPad document here. Would you like to create one?</p> <input type="hidden" value="lsdjfsljfa-fdj-lsdf" name="padId"/> <input type="submit" value="Create Pad" id="createPad"/> ` Then here's my code which tries to submit the form using CURL $ch = curl_init(); //set POST variables $url = "http://etherpad.com/ep/pad/create?padId=ldjfal-djfa-ldkfjal"; $fields = array( 'padId'=>urlencode("ldjfal-djfa-ldkfjal"), ); $useragent="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)"; // set user agent curl_setopt($ch, CURLOPT_USERAGENT, $useragent); //url-ify the data for the POST foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value; } print_r($fields_string); //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_POST,count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string); //execute post $result = curl_exec($ch); print_r($result); //close connection curl_close($ch); When I run the script, PHP reports back that everything executed correctly but etherpad doesn't create my pad. Any clues what's going on?

    Read the article

  • .Net friendly, local, key-value pair, replicatable datastore

    - by Brad Mathews
    I am looking for a key/value type datastore with very specific requirements. Anyone know anything that will work? Needs to be a component of some sort. No additional installation needed. The datastore needs to be on the local hard drive. I am using VB.Net for a desktop app running Windows XP through 7 so it needs to callable by that environment. It needs to replicatable. If I have four copies of my app running on the network, each local copy of the datastore needs to replicate with the others. As close to real time as possible. The first three are easy, I can do that with ADO.Net out of the box. The last one, replication, is the one I do not have answer to. Does such an animal exist? Thanks, Brad

    Read the article

  • BlackBerry - video player - FramePositioningControl is null

    - by sinu-mathews
    I'm developing a blackberry application that plays video from the server. I've used Player.start() and Player.stop() for playing and pausing a video. But I also need rewind, forward and seek bar controls in my application. I tried using FramePositioningControl for these controls. But the following code is returning null. FramePositioningControl framePositioningControl = (FramePositioningControl) player.getControl("FramePositioningControl"); I searched several forums and they say many players do not support FramePositioningControl. What players support FramePositioningControl? And what else should I do to add these controls in my application?

    Read the article

  • Launching my deployed my app gets "has stopped working" error. How do I debug this?

    - by Brad Mathews
    I deployed a VB.Net app and ran it and I get 'AppName has stopped working" "Windows is checking for a solution to the problem" along with a Cancel button under Windows 7. Under XP I am only getting the option to Send the error report to Microsoft or not. There is no apparent way to hook into a debugger. I am not getting any exception data. I have put msgboxes at the very start of my code and they are not hit so it is failing before any of my code is even executing. I have checked all dependencies that I can think of. I developed the app on VS2008 Windows 7 and deploying to Windows 7 and WinXP. I need some advice - how do I debug this? Thanks, Brad

    Read the article

  • How do I disable the network connection from .Net without needing admin priveledges?

    - by Brad Mathews
    I may be SOL on this but I thought I would give throw it out for possible solutions. I am writing a computer access control service to help me control my kids' computer use. Plan on open sourcing it when I have it working. It is written in VB.Net and needs to work on XP through 7. I am running into all sorts of security and desktop access issues on Windows 7. The service needs to run as admin to execute the NetSh command to disable the network. But I cannot interact with the desktop from the service so I IPC to a UI to handle other stuff, but I still cannot detect from the service if the desktop is locked. Argghh! I could get it all working from a hidden windows form app if I could just lick the one piece that needs admin permissions: disabling the network. It does no good if a kid logs on and denies the popup asking if the program should run as administrator and he says no. Also windows 7 will not start a program set to run as admin using HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run Anyone know how to get this working? Or have an outside the box solution? Thanks! Brad

    Read the article

  • Basic CHMOD restriction

    - by Marshall Mathews
    i have an uploads folder on my website. What i want to do is restrict users from accessing like i dont want them to go to www.mysite.com/uploads/ and see the files in there and it should show forbidden, but they should be able to download via my website, for example www.mysite.com/downloads.php?id=1 If thats not possible, how can i atleast not show them the directory index on /uploads How is it that file sharing websites does this? An htaccess with deny from all stops php from accessing the file as well Please tell me a solution if you would know, i googled and asked on irc a few days ago about this issue, its pretty confusing to me.

    Read the article

  • "Snap an image" in MATLAB

    - by Megan Mathews
    I am a beginner and for lack of a better way to put this, does MATLAB have a function that will "snap an image" or move an image to some predefined location if within a certain area? I have checked out some forums with no luck so far. Thank you so much for your assistance.

    Read the article

  • Sound plays multiple times at once

    - by Jr. Mathews
    I'm having trouble with sound in Flash. I may have went about coding the wrong way, because most of my codes are on frames. So, I have these two variables var outsideDay:Sound = new daysong(); var outsideNight:Sound = new nightsong(); And I want to play these songs on a specific frame. However, the sounds play sporadically, like 50 times at once. I think it's because I have other codes that link to the frames with a Enter_Frame function. How can I get the sounds to loop and not play multiple times at once?

    Read the article

  • How do I fix VMware “Unidentified Networks” in Windows 7 Professional 64-bit SP1?

    - by Francis
    I have recently installed VMware Workstation 7 onto Windows 7 Professional 64-bit SP1 and both VMnet1 and VMnet8 appeared as "Unidentified Networks". I have tried editing HKLM\SYSTEM\CurrentControlSet\Control\Class{4D36E972-E325-11CE-BFC1-08002BE10318}, a tip provided by Mathews (Jul 23, 2009) but both virtual NICs still appeared as "Unidentified Networks". I will need both NICs to be listed as "Work" or "Private" and with Internet Access. What other solutions/workarounds? Thanks!

    Read the article

  • Create PDF document using iTextSharp in ASP.Net 4.0 and MemoryMappedFile

    - by sreejukg
    In this article I am going to demonstrate how ASP.Net developers can programmatically create PDF documents using iTextSharp. iTextSharp is a software component, that allows developers to programmatically create or manipulate PDF documents. Also this article discusses the process of creating in-memory file, read/write data from/to the in-memory file utilizing the new feature MemoryMappedFile. I have a database of users, where I need to send a notice to all my users as a PDF document. The sending mail part of it is not covered in this article. The PDF document will contain the company letter head, to make it more official. I have a list of users stored in a database table named “tblusers”. For each user I need to send customized message addressed to them personally. The database structure for the users is give below. id Title Full Name 1 Mr. Sreeju Nair K. G. 2 Dr. Alberto Mathews 3 Prof. Venketachalam Now I am going to generate the pdf document that contains some message to the user, in the following format. Dear <Title> <FullName>, The message for the user. Regards, Administrator Also I have an image, bg.jpg that contains the background for the document generated. I have created .Net 4.0 empty web application project named “iTextSharpSample”. First thing I need to do is to download the iTextSharp dll from the source forge. You can find the url for the download here. http://sourceforge.net/projects/itextsharp/files/ I have extracted the Zip file and added the itextsharp.dll as a reference to my project. Also I have added a web form named default.aspx to my project. After doing all this, the solution explorer have the following view. In the default.aspx page, I inserted one grid view and associated it with a SQL Data source control that bind data from tblusers. I have added a button column in the grid view with text “generate pdf”. The output of the page in the browser is as follows. Now I am going to create a pdf document when the user clicking on the Generate PDF button. As I mentioned before, I am going to work with the file in memory, I am not going to create a file in the disk. I added an event handler for button by specifying onrowcommand event handler. My gridview source looks like <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Width="481px" CellPadding="4" ForeColor="#333333" GridLines="None" onrowcommand="Generate_PDF" > ………………………………………………………………………….. ………………………………………………………………………….. </asp:GridView> In the code behind, I wrote the corresponding event handler. protected void Generate_PDF(object sender, GridViewCommandEventArgs e) { // The button click event handler code. // I am going to explain the code for this section in the remaining part of the article } The Generate_PDF method is straight forward, It get the title, fullname and message to some variables, then create the pdf using these variables. The code for getting data from the grid view is as follows // get the row index stored in the CommandArgument property int index = Convert.ToInt32(e.CommandArgument); // get the GridViewRow where the command is raised GridViewRow selectedRow = ((GridView)e.CommandSource).Rows[index]; string title = selectedRow.Cells[1].Text; string fullname = selectedRow.Cells[2].Text; string msg = @"There are some changes in the company policy, due to this matter you need to submit your latest address to us. Please update your contact details / personnal details by visiting the member area of the website. ................................... "; since I don’t want to save the file in the disk, I am going the new feature introduced in .Net framework 4, called Memory-Mapped Files. Using Memory-Mapped mapped file, you can created non-persisted memory mapped files, that are not associated with a file in a disk. So I am going to create a temporary file in memory, add the pdf content to it, then write it to the output stream. To read more about MemoryMappedFile, read this msdn article http://msdn.microsoft.com/en-us/library/dd997372.aspx The below portion of the code using MemoryMappedFile object to create a test pdf document in memory and perform read/write operation on file. The CreateViewStream() object will give you a stream that can be used to read or write data to/from file. The code is very straight forward and I included comment so that you can understand the code. using (MemoryMappedFile mmf = MemoryMappedFile.CreateNew("test1.pdf", 1000000)) { // Create a new pdf document object using the constructor. The parameters passed are document size, left margin, right margin, top margin and bottom margin. iTextSharp.text.Document d = new iTextSharp.text.Document(PageSize.A4, 72,72,172,72); //get an instance of the memory mapped file to stream object so that user can write to this using (MemoryMappedViewStream stream = mmf.CreateViewStream()) { // associate the document to the stream. PdfWriter.GetInstance(d, stream); /* add an image as bg*/ iTextSharp.text.Image jpg = iTextSharp.text.Image.GetInstance(Server.MapPath("Image/bg.png")); jpg.Alignment = iTextSharp.text.Image.UNDERLYING; jpg.SetAbsolutePosition(0, 0); //this is the size of my background letter head image. the size is in points. this will fit to A4 size document. jpg.ScaleToFit(595, 842); d.Open(); d.Add(jpg); d.Add(new Paragraph(String.Format("Dear {0} {1},", title, fullname))); d.Add(new Paragraph("\n")); d.Add(new Paragraph(msg)); d.Add(new Paragraph("\n")); d.Add(new Paragraph(String.Format("Administrator"))); d.Close(); } //read the file data byte[] b; using (MemoryMappedViewStream stream = mmf.CreateViewStream()) { BinaryReader rdr = new BinaryReader(stream); b = new byte[mmf.CreateViewStream().Length]; rdr.Read(b, 0, (int)mmf.CreateViewStream().Length); } Response.Clear(); Response.ContentType = "Application/pdf"; Response.BinaryWrite(b); Response.End(); } Press ctrl + f5 to run the application. First I got the user list. Click on the generate pdf icon. The created looks as follows. Summary: Creating pdf document using iTextSharp is easy. You will get lot of information while surfing the www. Some useful resources and references are mentioned below http://itextsharp.com/ http://www.mikesdotnetting.com/Article/82/iTextSharp-Adding-Text-with-Chunks-Phrases-and-Paragraphs http://somewebguy.wordpress.com/2009/05/08/itextsharp-simplify-your-html-to-pdf-creation/ Hope you enjoyed the article.

    Read the article

1