Search Results

Search found 1214 results on 49 pages for 'jack sparrow'.

Page 19/49 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • How to secure a WCF service using NetNamedPipesBinding so that it can only be called by the current

    - by Samuel Jack
    I'm using a WCF service with the NetNamedPipesBinding to communicate between two AppDomains in my process. How do I secure the service so that it is not accessible to other users on the same machine? I have already taken the precaution of using a GUID in the Endpoint Address, so there's a little security through obscurity, but I'm looking for a way of locking the service down using ACL or something similar.

    Read the article

  • PHP/Java bridge problem

    - by Jack
    I am using tomcat 6 on windows. Here is the code I am testing. import java.io.ByteArrayOutputStream; import java.io.Closeable; import java.io.StringReader; import javax.script.Invocable; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; /** * Create and run THREAD_COUNT PHP threads, concurrently accessing a * shared resource. * * Create 5 script engines, passing each a shared resource allocated * from Java. Each script engine has to implement Runnable. * * Java accesses the Runnable script engine using * scriptEngine.getInterface() and calls thread.start() to invoke each * PHP Runnable implementations concurrently. */ class PhpThreads { public static final String runnable = new String("<?php\n" + "function run() {\n" + " $out = java_context()->getAttribute('sharedResource', 100);\n" + " $nr = (string)java_context()->getAttribute('nr', 100);\n" + " echo \"started thread: $nr\n\";\n" + " for($i=0; $i<100; $i++) {\n" + " $out->write(ord($nr));\n" + " java('java.lang.Thread')->sleep(1);\n" + " }\n" + "}\n" + "?>\n"); static final int THREAD_COUNT = 5; public static void main(String[] args) throws Exception { ScriptEngineManager manager = new ScriptEngineManager(); Thread threads[] = new Thread[THREAD_COUNT]; ScriptEngine engines[] = new ScriptEngine[THREAD_COUNT]; ByteArrayOutputStream sharedResource = new ByteArrayOutputStream(); StringReader runnableReader = new StringReader(runnable); // create THREAD_COUNT PHP threads for (int i=0; i<THREAD_COUNT; i++) { engines[i] = manager.getEngineByName("php-invocable"); if (engines[i] == null) throw new NullPointerException ("php script engine not found"); engines[i].put("nr", new Integer(i+1)); engines[i].put("sharedResource", sharedResource); engines[i].eval(runnableReader); runnableReader.reset(); // cast the whole script to Runnable; note also getInterface(specificClosure, type) Runnable r = (Runnable) ((Invocable)engines[i]).getInterface(Runnable.class); threads[i] = new Thread(r); } // run the THREAD_COUNT PHP threads for (int i=0; i<THREAD_COUNT; i++) { threads[i].start(); } // wait for the THREAD_COUNT PHP threads to finish for (int i=0; i<THREAD_COUNT; i++) { threads[i].join(); ((Closeable)engines[i]).close(); } // print the output generated by the THREAD_COUNT concurrent threads String result = sharedResource.toString(); System.out.println(result); // Check result Object res=manager.getEngineByName("php").eval( "<?php " + "exit((int)('10011002100310041005'!=" + "@system(\"echo -n "+result+"|sed 's/./&\\\n/g'|sort|uniq -c|tr -d ' \\\n'\")));" + "?>"); System.exit(((Number)res).intValue()); } } I have added all the libraries. When I run the file I get the following error - run: Exception in thread "main" javax.script.ScriptException: java.io.IOException: Cannot run program "php-cgi": CreateProcess error=2, The system cannot find the file specified at php.java.script.InvocablePhpScriptEngine.eval(InvocablePhpScriptEngine.java:209) at php.java.script.SimplePhpScriptEngine.eval(SimplePhpScriptEngine.java:178) at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:232) at PhpThreads.main(NewClass.java:53) Caused by: java.io.IOException: Cannot run program "php-cgi": CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(ProcessBuilder.java:459) at java.lang.Runtime.exec(Runtime.java:593) at php.java.bridge.Util$Process.start(Util.java:1064) at php.java.bridge.Util$ProcessWithErrorHandler.start(Util.java:1166) at php.java.bridge.Util$ProcessWithErrorHandler.start(Util.java:1217) at php.java.script.CGIRunner.doRun(CGIRunner.java:126) at php.java.script.HttpProxy.doRun(HttpProxy.java:63) at php.java.script.CGIRunner.run(CGIRunner.java:111) at php.java.bridge.ThreadPool$Delegate.run(ThreadPool.java:60) Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(ProcessImpl.java:81) at java.lang.ProcessImpl.start(ProcessImpl.java:30) at java.lang.ProcessBuilder.start(ProcessBuilder.java:452) ... 8 more What am I missing?

    Read the article

  • Make CSRF middleware work in Django's 404 error pages

    - by jack
    I put a login box alone with a keyword search box in 404.html in a Django project so in case a 404 error is raised, visitors get more options to jump to other parts. But the CSRF middleware doesn't work in 404 error page with no csrf token rendered. I tried move 'django.middleware.csrf.CsrfViewMiddleware' to first of MIDDLEWARE_CLASSES in settings.py but did not work either. Anyone knows a solution?

    Read the article

  • Maven grails plugin issue

    - by Jack
    I'm trying to create the pom for an existing grails project via: mvn grails:create-pom -Dourcompany.com Now, we have our maven repository available in a local nexus repo: http://ourcompany.com/nexus But when i run the above, i get the below error Downloading: http://ourcompany.com/nexus/content/groups/public/ourcompany/com/hibernate-core/3.3.1.GA/hibernate-core-3.3.1.GA.jar [INFO] Unable to find resource 'ourcompany.com:hibernate-core:jar:3.3.1.GA' in repository central (http://repo1.maven.org/maven2) [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR But it is in there at simply: http://ourcompany.com/nexus/content/groups/public/hibernate-core/3.3.1.GA/hibernate-core-3.3.1.GA.jar Ie, w/o the "ourcompany.com" path. From my perspective, it should just try to pull down hibernate w/o inserting the groupId, but maybe i'm not understanding how i'm supposed to run this command?

    Read the article

  • Trying to INstall PHP on windows 7 ultimate with IIS6

    - by Jack
    I am trying to install php on my windows 7 machine. I have installed IIS 6.x and I have also installed php. I used this tutorial http://blogs.iis.net/bills/archive/2006/09/19/How-to-install-PHP-on-IIS7-_2800_RC1_2900_.aspx The only thing I didnt understand is this part: 4) Install IIS7, making sure you install the ISAPI Extension component (for PHP-ISAPI - which is what I use) or the CGI component (if you prefer CGI) during IIS installation (ISAPI and CGI are not installed by default) Now when i go to localhost I get an error. HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. 4: <handlers> 5: <add name="PHP" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\web\php5\php-cgi.exe" resourceType="Unspecified" /> 6: </handlers> Also php pages do not work in IE, please help

    Read the article

  • Please suggest me the ( Interaction model of view model) MVVM design in the simple scenario discusse

    - by Jack
    Data Layer I have an Order class as an entity. This Order entity is my model object. Order can be different types, let it be A B C D Also Order class may have common properties like Name, Time of creation, etc. Also based on the order type there are different fields that are not common. View Layer The view contains the following Main Menu ListView The Main Menu contains the drop down menu button which is used to create the order based on the type selected from the drop down. The drop down contains the Order types ( A ,B , C and D). There are different user control based on the order type. Like for example if user chooses to create an order of type A then different view with different inputs field is popped up. Hence, there are four user control for each order type. If user selects A option from the drop down then Order of type A is created and vica versa. Now below is the List View that contains the List of orders so far created by the user. To Edit any particular order user may double click the list view row. Based on the order type clicked by the user in the listview, the view of that order type opens in edit mode. For example if user selects an order type A from the list view then view for order type A open in edit mode. Please suggest me interaction model for view model's in the scenario discussed above. Please excume me if the query is very basic, since I am new new to MVVM and WPF ,

    Read the article

  • Algorithm for performing decentralized search in social networks

    - by Jack
    I want to find out all the existing decentralized algorithms that exploit the structural properties of social networks. So far I know the following algorithms - 1) Best connected search - Adamic et al 2) Random Walk (does not exploit any structural property but still it is decentralized) 3) Hamming distance search 4) Weak/Strong tie search Any help would be appreciated

    Read the article

  • Apps not showing in Django admin site

    - by jack
    I have a Django project with about 10 apps in it. But the admin interface only shows Auth and Site models which are part of Django distribution. Yes, the admin interface is up and working but none of my self-written apps shows there. INSTALLED_APPS INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.sites', 'django.contrib.contenttypes', 'django.contrib.humanize', 'django.contrib.sessions', 'django.contrib.admin', 'django.contrib.admindocs', 'project.app1', ... app1/admin.py from django.contrib import admin from project.app1.models import * admin.site.register(model1) admin.site.register(model2) admin.site.register(model3) What could be wrong in this case? Looks like everything is configured as what document says. Thank you in advance.

    Read the article

  • UIWebView Page Control

    - by Jack
    Hi, I would like to use a UIWebView to display some files (PDF, PPT, DOC) and would like to have the ability to scroll using external controls (ie a couple of buttons that, when pressed skip back and forward a page) and display the current page in a UITextView. Is this possible? I have no experience with javascript, but a friend of mine has suggested that this might be a useful approach. Is his suggestion valid? JP

    Read the article

  • Dj Mixes Downloads

    - by jack
    Where can i download Dj Mixes Songs. from one user i came to know about http://mydjdemo.com, but in this site its hard to search my favorite songs , there is a problem in search database, please can any one suggest me for the best DJ mixes Downloads

    Read the article

  • Winforms Controlling Forms

    - by jack london
    How can i control all my forms from main () static void Main() { Form1 frm1 = new Form1(); Form1 frm2 = new Form1(); Form1 frm3 = new Form1(); frm1.Show(); while (frm1.Button.Clicked) { frm2.Show(); frm3.Show(); } } form.ShowDialog () helps much but the execution stack can overflow. Form.Show and Form.Hide methods runs when an application class has been set. In Application.Run (Form) way there's always a main form. and i dont want this one. Any other approach you use in this problem

    Read the article

  • LXML E builder for java?

    - by directedition
    There is one thing I really love about LXML, and that the E builder. I love that I can throw XML together like this: message = E.Person( E.Name( E.First("jack") E.Last("Ripper") ) E.PhoneNumber("555-555-5555") ) To make: <Person> <Name> <First>Jack</First> <Last>Ripper</Last> </Name> <PhoneNumber>555-555-5555</PhoneNumber> </Person> As opposed to the painstaking way DOM works. I am going to be moving a bunch of my software to Java soon and it is very very heavy on its usage of E. Does Java have anything near equivalent to that usage?

    Read the article

  • Windsor dependency

    - by jack
    I have a class with constructor like this: public UserRepository(IBlockRepository blockRepos) { } and again, I have another class with the constructor like this: public BlockRepository(IUserRepository userRepo) { } this causes the Windsor error: Castle.MicroKernel.Handlers.HandlerException: Can't create component 'UserRepository' as it has dependencies to be satisfied. UserRepository is waiting for the following dependencies How do I fix this?

    Read the article

  • java TrayIcon using image with transparent background

    - by Jack
    I am using the following code to set a tray icon in Windows and Linux. It works wonderful in Windows and works okay in Linux. In Linux (Ubuntu) I have my panel set to be (somewhat) transparent and when I add a GIF (with a transparent background) the background of the icon shows up all grey and ugly (see image, green diamond "!")....Any ideas on how to make the GIF image I am adding "keep" its transparent background? and the image I am using, if you'd like to test: import java.awt.*; import java.awt.event.*; public class TrayFun { static class ShowMessageListener implements ActionListener { TrayIcon trayIcon; String title; String message; TrayIcon.MessageType messageType; ShowMessageListener( TrayIcon trayIcon, String title, String message, TrayIcon.MessageType messageType) { this.trayIcon = trayIcon; this.title = title; this.message = message; this.messageType = messageType; } public void actionPerformed(ActionEvent e) { trayIcon.displayMessage(title, message, messageType); } } public static void main(String args[]) { Runnable runner = new Runnable() { public void run() { if (SystemTray.isSupported()) { final SystemTray tray = SystemTray.getSystemTray(); Image image = Toolkit.getDefaultToolkit().getImage("green_info.png"); PopupMenu popup = new PopupMenu(); final TrayIcon trayIcon = new TrayIcon(image, "The Tip Text", popup); trayIcon.setImageAutoSize(true); MenuItem item = new MenuItem("Close"); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { tray.remove(trayIcon); } }); popup.add(item); try { tray.add(trayIcon); } catch (AWTException e) { System.err.println("Can't add to tray"); } } else { System.err.println("Tray unavailable"); } } }; EventQueue.invokeLater(runner); } }

    Read the article

  • C command line password

    - by Jack Jacobsen
    So I'm trying to create a C program where you must input the password on the command line, like ./login password1 And if the password is password1, it'll say something. If not, it prints another message. This is the code I have now: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { if (argc < 2) { printf("usage: %s <password>\n", argv[0]); } char pass = "password"; if (argc == pass) { printf("Right\n"); } else { printf("Wrong\n"); } } But it wont work.

    Read the article

  • Trouble retrieving inner text from XML node using JavaScript

    - by Jack Roscoe
    I'm reading an XML document using JavaScript & jQuery, and need to extract some text from inside a node to save into an array. The structure of the XML is as such: <C> <I> <TEXTFORMAT> <P> <FONT>Here's the text I want</FONT> </P> </TEXTFORMAT> </I> </C> Everything I've tried so far returns nothing so I must be incorrectly referencing the contents of the FONT tag. What XML path should I be using?

    Read the article

  • Javascript: Collision detection

    - by jack moore
    Hello, could someone please help me to understand how collision detection works in JS? I can't use jQuery or gameQuery - already using prototype - so, I'm looking for something very simple. Not asking for complete solution, just point me to the right direction. Let's say there's: <div id="ball"></div> and <div id="someobject0"></div> Now the ball is moving (any direction). "Someobject"(0-X) is already pre-defined and there's 20-60 of them randomly positioned like this: #someobject {position: absolute; top: RNDpx; left: RNDpx;} I can create an array with "someobject(X)" positions and test collision while the "ball" is moving... Something like: for(var c=0; c<objposArray.length; c++){ ........ and code to check ball's current position vs all objects one by one.... } But I guess this would be a "noob" solution and it looks pretty slow. Is there anything better?

    Read the article

  • Two GeoIP databases on one server?

    - by jack
    I have been using GeoIP Lite for visitor ip address to country mapping for a while. The binary data file is at /usr/share/GeoIP/GeoIP.dat Now I just bought a GeoIP Organization license which comes with another binary file with same name of "GeoIP.dat" Where can I put this new "GeoIP.dat" and how can I make both databases accessible to python-geoip library on one server?

    Read the article

  • Django site on Nginx+FastCGI goes (504 gateway timeout)

    - by jack
    Sometimes my whole Django based site goes into 504 gateway timeout errors so none page can be displayed. Is it possible to write a shell program and cronjob it run every 5 minutes to detect such errors and restart FastCGI process if needed? I'm currently using command below to restart FastCGI in case it's crashed but it doesn't work for above situation because when 504 gateway errors occur, the processes are still running. ps ax | grep -v grep | grep port=8001 > /dev/null || restart_fcgi.sh

    Read the article

  • List of social networks which allow developers to find out friend of friends info

    - by Jack
    I have been working on social application development for some time now. I now need to build an application which makes use of friend of friends data. Any info like friend count, interest, location etc. would be helpful. Here's the list I have till now 1) Networks where you can find info about your friend of friends Twitter,Digg 2) Complement Facebook, MySpace, Orkut I am more interested in the latter category. Any help will be appreciated.

    Read the article

  • How to set up an insert to a grails created file with next sequence number?

    - by Jack BeNimble
    I'm using a JMS queue to read from and insert data into a postgres table created by grails. The problem is obtaining the next sequence value. I thought I had found the solution with the following statement (by putting "DEFAULT" where the ID should go), but it's no longer working. I must have changed something, because I needed to recreate the table. What's the best way to get around this problem? ps = c.prepareStatement("INSERT INTO xml_test (id, version, xml_text) VALUES (DEFAULT, 0, ?)"); UPDATE: In response to the suggested solution, I did the following: Added this to the the domain: class XmlTest { String xmlText static constraints = { id generator:'sequence', params:[name:'xmltest_sequence'] } } And changed the insert statement to the following: ps = c.prepareStatement("INSERT INTO xml_test (id, version, xml_text) VALUES (nextval('xmltest_sequence'), 0, ?)"); However, when I run the statement, I get the following error: [java] 1 org.postgresql.util.PSQLException: ERROR: relation "xmltest_sequence" does not exist Any thoughts?

    Read the article

  • What is missing from the Java API?

    - by Jack
    I started using Java years ago and I've always found almost everything I need inside the standard API provided with JDK SE, with the exception of specific things that don't fit well inside a generic API, like GUI elements (graphs or so on) or advanced mathematical API.. So I was wondering: Which are the most important things that the Java API is missing? When I say "important", I mean either things that you have often needed, but have had to rely on custom libraries, or things that are usually are included in APIs, but not in Java's.

    Read the article

  • Problem with running php script using mysql on tomcat

    - by Jack
    I am using tomcat 6 with JavaBridge. I have stored my php script in the following location. C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\project\test.php In test.php I am using curl and mysql. The php.ini in JavaBridge is stored in the following location C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\cgi\php.ini and its contents are - extension_dir="C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\cgi\x86-windows\ext" include_path="C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\pear;." there is also a config file called mysql.ini whose contents are - extension = php_mysql.dll I had also installed wamp earlier so I copied all the dll's from C:\wamp\bin\php\php5.3.0\ext to C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\cgi\x86-windows\ext When I start tomcat and run my script I get the following error - Fatal error: Call to undefined function mysqli_connect() in C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\project\test.php on line 534 Please help.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >