Daily Archives

Articles indexed Sunday April 15 2012

Page 11/15 | < Previous Page | 7 8 9 10 11 12 13 14 15  | Next Page >

  • Java Program Compiles and Runs, but doesn't work

    - by Richard Long
    When I run this program I enter information in a text box, push the search button, but nothing happens. The program just sits there until I press Cntrl C to break it. It looks like it should work, but I can't figure out what is hanging the program up. Here is the code: First class: import java.io.*; import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.util.*; public class NameGameFrame extends JFrame { public static String name; static JTextField textfield = new JTextField(20); static JTextArea textarea = new JTextArea(30,30); public static String num; public static String [] fields; public static int [] yearRank; public static boolean match; public static int getInts, marker, year, max; public static void main( String[] args) { JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setTitle("Name Game"); frame.setLocation(500,400); frame.setSize(800,800); JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); JLabel label = new JLabel("Enter the Name or Partial Name to search:"); c.gridx = 0; c.gridy = 0; c.insets = new Insets(2,2,2,2); panel.add(label,c); c.gridx = 0; c.gridy = 1; panel.add(textarea,c); JButton button = new JButton("Search"); c.gridx = 1; c.gridy = 1; panel.add(button,c); c.gridx = 1; c.gridy = 0; panel.add(textfield,c); frame.getContentPane().add(panel, BorderLayout.NORTH); frame.pack(); frame.setVisible(true); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { name = textfield.getText(); java.io.File file = new java.io.File("namesdata.txt"); try { Scanner input = new Scanner(file); num = input.nextLine(); NameRecord nr = new NameRecord(name); while (input.hasNext()) { if(match = num.toLowerCase().contains(name.toLowerCase())) { nr.getRank(); nr.getBestYear(marker); } } } catch(FileNotFoundException e) { System.err.format("File does not exist\n"); } textarea.setText(fields[0]); } }); } } This is the second class: import java.io.*; import java.util.*; public class NameRecord { public NameRecord( String name) { } public static int getBestYear(int marker) { switch (marker) { case 1: year = 1900; break; case 2: year = 1910; break; case 3: year = 1920; break; case 4: year = 1930; break; case 5: year = 1940; break; case 6: year = 1950; break; case 7: year = 1960; break; case 8: year = 1970; break; case 9: year = 1980; break; case 10: year = 1990; break; case 11: year = 2000; break; } return year; } public static int getRank() { fields = num.split(" "); max = 0; for (int i = 1; i<12; i++) { getInts = Integer.parseInt(fields[i]); if(getInts>max) { max = getInts; marker = i; } } return max; } }

    Read the article

  • PHP / C++ space calculations for parcel packing

    - by Andrew Willis
    I am working on a shopping cart project which requires a 'postage calculator' based on items that the person has in their cart. Obviously I will be storing the item's dimensions incl. weight and padding in a database and will also store the parcel (box) size and weight that the items will go in to, incl. box padding. Figuring the weight of the parcels will be easy but I was wondering how to go about figuring how to pack the box via PHP, that is, I would like the code to 'play tetris' with the items to make sure they get the best possible fit, giving accurate postage costs. Does anybody have any ideas on how best to achieve this or does anybody know of a PHP Class or function that can do this? EDIT: When I said 'best possible fit' maybe I was being optimistic! Having the script try every possible combination of package distribution within the parcel would be over the top, however I could improve the speed by writing the algoritm in C++ and running the program in PHP when the user 'checks out', the return value being an array with the parcel size and weight (which are all that are needed to calculate postage costs)

    Read the article

  • PHP Count the lenght of each value in a array/string (tags)

    - by 2by
    Users writing an article have the option to write some tags, tags are written like this: tag1, tag2, tag3 So tags are stored like: $tags = "tag1, tag2, tag3"; I want to make sure, every tag has a minimum of 3 characters, so i need to validate the tags. I have tried this: $tagsstring = explode(",", $tags); $tagslength = array_map('strlen', $tagsstring); if (min($tagslength) < 3) { echo "Error... Each tag has to be at least 3 characters."; } It seems to work, sometimes... But of you write: tag1, df It wont give an error. Any suggestions?

    Read the article

  • Hadoop WordCount example stuck at map 100% reduce 0%

    - by Abhinav Sharma
    [hadoop-1.0.2] ? hadoop jar hadoop-examples-1.0.2.jar wordcount /user/abhinav/input /user/abhinav/output Warning: $HADOOP_HOME is deprecated. ****hdfs://localhost:54310/user/abhinav/input 12/04/15 15:52:31 INFO input.FileInputFormat: Total input paths to process : 1 12/04/15 15:52:31 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 12/04/15 15:52:31 WARN snappy.LoadSnappy: Snappy native library not loaded 12/04/15 15:52:31 INFO mapred.JobClient: Running job: job_201204151241_0010 12/04/15 15:52:32 INFO mapred.JobClient: map 0% reduce 0% 12/04/15 15:52:46 INFO mapred.JobClient: map 100% reduce 0% I've set up hadoop on a single node using this guide (http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/#run-the-mapreduce-job) and I'm trying to run a provided example but I'm getting stuck at map 100% reduce 0%. What could be causing this?

    Read the article

  • Structuremap Configuration with generics

    - by DarthVader
    I have IRepository interface with which i want to use NHibernateRepository. How do i configure it with structure map? protected void ConfigureDependencies() { ObjectFactory.Initialize( x => { x.For<ILogger>().Use<Logger>(); x.For<IRepository<T>>().Use<NHibernateRepository<T>>(); } ); } I m getting an error on T. Another question I have is if it s OK to make an ApplicationContext static class, configure it with structure map and provide instances with it? I have read that static classes are bad, but I dont want to initialize the ApplicationContext class that I have the injections everywhere. What s the best practice for this? Thanks.

    Read the article

  • Rails: RESTful Find, Initialize, or Create

    - by Andrew
    I have an app that has Cities in it. I'm looking for some suggestions on how to RESTfully structure a controller so that I can lookup, initialize, and create city records via AJAX requests. For instance: Given a text field city_name A user enters the name of a City, like "Paris, France" The app checks this location to see if there is such a city in the database already If there is, it returns the city object If there is not, it returns a new record initialized with the name "Paris" and the country "France", and prompts the user to confirm they want to add this city to the database If the user says "Yes" the record is saved. If not the record is discarded and the form is cleared. Now, my first approach was to change the Create action to use find_or_create, so that an AJAX post to cities_path would result in either returning the existing city or creating it and returning it. That works ok... However, it would be better to setup controller actions that would take a string input, find , or else initialize and return, then only create if the user confirms the generated record is correct. The ideal scenario would put this all in one action so AJAX request can go to that url, the server responds with JSON objects, and javascript can handle things from there. I'd like to keep all the user-interaction logic client side, and also minimize the number of requests it takes to achieve this. Any suggestions on the cleanest, most RESTful way to accomplish this?

    Read the article

  • PhoneGap 1.5 (Cordova) + ChildBrowser Whitelist Issue

    - by dSquared
    I am creating an app using PhoneGap 1.5 (Cordova) and the ChildBrowser Plugin (newest version with naming for PG 1.5 / Cordova.) I use the ChildBrowser plugin to display webpages, PDFs etc. in the app. In previous versions of PG the Whitelist wasn't as restrictive and would load external resources (css/js etc.) located on remote servers / CDNs called from webpages displayed in the ChildBrowser as long as the main URL was Whitelisted. This appears to have changed and I cannot find a way around it. Is there a way to allow all URLs to be whitelisted as long as they are loaded through an already whitelisted URL, or is whitelisting every single possible URL the only way? Any help would be greatly appreciated!

    Read the article

  • Weird Qt SSL issue -- error "No Error" shows up, nothing else, and if I ignore it, everything works

    - by houbysoft
    The issue is as follows : in my Qt app, I have a QWebView, which I use to load a HTTPS page. Everything worked fine on my development machine, so I'm now trying to get it to run on a test machine. I ran the app, but the page didn't load (the QWebView was blank). After much debugging, I found the problem is that an SSL error shows up, and the sslErrors() signal is fired. Here is my sslErrors() handling code: void blah::sslErrors(QNetworkReply *reply, const QList<QSslError> &errors) { foreach(QSslError error, errors) { qDebug() << error.errorString() << endl; } reply->ignoreSslErrors(); } The only thing the above code prints is: "No error" So there's no error, but unless I call reply->ignoreSslErrors(), the page doesn't load (on the test machine, on my developer computer no error is reported). Huh? Is this a bug? Is it safe to ignore the error, if I make sure it's of the type "No error"?

    Read the article

  • python / sets / dictionary / initialization

    - by Mario D
    Can someone explain help me understand how the this bit of code works? Particularly how the myHeap assignment works. I know the freq variable is assigned as a dictionary. But what about my myHeap? is it a Set? exe_Data = { 'e' : 0.124167, 't' : 0.0969225, 'a' : 0.0820011, 'i' : 0.0768052, } freq = exe_Data) myHeap = [[pct, [symbol, ""]] for symbol, pct in freq.items()]

    Read the article

  • Access DoCmd.OpenForm Not Working

    - by user961743
    Looking for a second set of eyes to figure out my problem with an Access form filter. I created a search form, when filled in, appends search criteria to a string variable (strQuery) that is put in place to the [WhereCondition] for opening a form. However, when the script is ran, nothing comes up except for a filtered form with no records. Here is the line that opens the form: DoCmd.OpenForm "ADD_NEW_NCMR", , , strQuery Before the line is ran, strQuery equals: 1=1 AND [NCMR].[NCMR_NUM] = '12-129' The form name, and table.column combination are all correct. In fact, using the DCount function returns the result of 1, which is correct for this query, and returns the correct number for other queries as well. This makes me think that there is nothing wrong with the where condition. DCount("[NCMR_NUM]", "NCMR", strQuery)

    Read the article

  • If statement within If statement's else

    - by maebe
    Still new to Java/android so trying to figure out the best way to code a multilevel if statement. What I'm trying to do is for a combat system that needs to check if player/npc is alive. If they are alive it then will check to see if they scored a critical hit. If they didn't critical hit then will see if they hit or missed. combat = mydbhelper.getCombat(); startManagingCursor(combat); if(playerCurHp == 0){ combat.moveToPosition(11); npcCombatStory = combat.getString(combat.getColumnIndex(dbhelper.KEY_COMBATDESC));} else{ if(playerCritFlag.equals("Critical")){ combat.moveToPosition(2); playerCombatStory = combat.getString(combat.getColumnIndex(dbhelper.KEY_COMBATDESC));} else{ if(playerHitFlag.equals("Hit")){ combat.moveToPosition(1); playerCombatStory = combat.getString(combat.getColumnIndex(dbhelper.KEY_COMBATDESC));} if(playerHitFlag.equals("Miss")){ combat.moveToPosition(3); playerCombatStory = combat.getString(combat.getColumnIndex(dbhelper.KEY_COMBATDESC));} }} if (npcCurHp == 0){ combat.moveToPosition(10); npcCombatStory = combat.getString(combat.getColumnIndex(dbhelper.KEY_COMBATDESC));} else{ if(npcCritFlag.equals("Critical")){ combat.moveToPosition(5); npcCombatStory = combat.getString(combat.getColumnIndex(dbhelper.KEY_COMBATDESC));} else{ if(npcHitFlag.equals("Hit")){ combat.moveToPosition(4); npcCombatStory = combat.getString(combat.getColumnIndex(dbhelper.KEY_COMBATDESC));} if(npcHitFlag.equals("Miss")){ combat.moveToPosition(6); npcCombatStory = combat.getString(combat.getColumnIndex(dbhelper.KEY_COMBATDESC));} }} } Is what I'm using. Was working when I had the if statements all separate. But it would check each one and do actions I don't need (If they hit, pull String, if crit pull another, then if dead pull again). Trying to make it stop when it finds the "Flag" that matches. When doing my rolls if the player hits it sets the flag to "Hit" like below code. Random attackRandom = new Random(); int attackRoll = attackRandom.nextInt(100); totalAtt = attackRoll + bonusAttack + weaponAtt + stanceAtt; Random defensiveRandom = new Random(); int defenseRoll = defensiveRandom.nextInt(100); npcDef = defenseRoll + npcDodge + npcBonusDodge; if (totalAtt > npcDef){ playerHitFlag = "Hit"; playerDamage();} else{playerHitFlag = "Miss"; npcAttack();} At the end it takes these playerCombatStory and npcCombatStory strings and uses them to setText to show the player what happened on that turn of combat.

    Read the article

  • How do I perform 'WHERE' on groups of rows?

    - by Drew
    I have a table, which looks like: +-----------+----------+ + person_id + group_id + +-----------+----------+ + 1 + 10 + + 1 + 20 + + 1 + 30 + + 2 + 10 + + 2 + 20 + + 3 + 10 + +-----------+----------+ I need a query such that only person_ids with groups 10 AND 20 AND 30 are returned (only person_id: 1). I am not sure how to do this, as from what I can see it would require me to group the rows by person_id and then select the rows which contain all group_ids. I'm looking for something which will preserve the use of keys without resorting to string operations on group_concat() or such.

    Read the article

  • How to create a dynamic number of possibly children objects using partial views?

    - by NullReference
    I have a parent object that contains a property that is a list of children objects. I'd like to have it so that when the form loads to create the parent object a partial view is used to create the list of child objects. The problem is I have to idea how to have the list of children object populated. I can do one object ok, but a dynamic list of possible children is difficult. Any ideas? @Html.RenderPartial("_CreateChild", Model.Children); public class Parent { private List<Child> _list; public Guid Id { get; set; } public List<Child> Children { get { return _list; } set { _list = value; } } public Parent() { _list = new List<Child>(); } }

    Read the article

  • Alternative to singleton for unique resources

    - by user1320881
    I keep reading over and over again that one should avoid using singletons for various reasons. I'm wondering how to correctly handle a situation where a class represents a unique system resource. For example, a AudioOutput class using SDL. Since SDL_OpenAudio can only be open once at a time it makes no sense having more then one object of this type and it seems to me preventing accidentally making more then one object would actually be good. Just wondering what experienced programmers think about this, am i missing another option ?

    Read the article

  • Can't load AMD 64-bit .dll on a IA 32-bit platform

    - by Guihua
    I download the Gurobi package for linear programming. I import the corresponding gurobi.jar package. Then run the example program. Then it appears the following errors: Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\gurobi460\win64\win64\bin\GurobiJni46.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform Then I downloaded the window 64 bit Jre, and use the "window--preference--Installed JRE" to install this new JRE. However, it still appeared this error. Could you help me? Thank you !

    Read the article

  • Tuple in C# 4.0

    - by Jalpesh P. Vadgama
    C# 4.0 language includes a new feature called Tuple. Tuple provides us a way of grouping elements of different data type. That enables us to use it a lots places at practical world like we can store a coordinates of graphs etc. In C# 4.0 we can create Tuple with Create method. This Create method offer 8 overload like following. So you can group maximum 8 data types with a Tuple. Followings are overloads of a data type. Create(T1)- Which represents a tuple of size 1 Create(T1,T2)- Which represents a tuple of size 2 Create(T1,T2,T3) – Which represents a tuple of size 3 Create(T1,T2,T3,T4) – Which represents a tuple of size 4 Create(T1,T2,T3,T4,T5) – Which represents a tuple of size 5 Create(T1,T2,T3,T4,T5,T6) – Which represents a tuple of size 6 Create(T1,T2,T3,T4,T5,T6,T7) – Which represents a tuple of size 7 Create(T1,T2,T3,T4,T5,T6,T7,T8) – Which represents a tuple of size 8 Following are some example code for tuple. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace TupleExample { class Program { static void Main(string[] args) { var tuple = System.Tuple.Create<string, string, string>("Jalpesh", "P", "Vadgama"); Console.WriteLine(tuple); var t = System.Tuple.Create<int, string>(1, "Jalpesh"); Console.WriteLine(t); } } } Following is a output of above as expected. You can also access values insides Tuple with ItemN property. Where N represents particular number of item in tuple. Following is an example of it. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace TupleExample { class Program { static void Main(string[] args) { var tuple = System.Tuple.Create<string, string, string>("Jalpesh", "P", "Vadgama"); Console.WriteLine(tuple.Item1); Console.WriteLine(tuple.Item2); Console.WriteLine(tuple.Item3); } } } Here you can see I have printed items with Item1,Item2 and Item3 . Following is the output of above code.   Even we can create a nested tuple also following is code for nested tuple. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace TupleExample { class Program { static void Main(string[] args) { var tuple = System.Tuple.Create(1,"Jalpesh",new Tuple<string,string>("P","Vadgama")); Console.WriteLine(tuple.Item1); Console.WriteLine(tuple.Item2); Console.WriteLine(tuple.Item3); } } } Following is a output above code as expected. As you can see there are unlimited possibilities we can do lots of things with Tuple. Hope you liked it. Stay tuned for more. Till then Happy Programming!!

    Read the article

  • Mono through FastCGI on nginx

    - by Stijn
    I'm going through http://www.mono-project.com/FastCGI_Nginx and can't get it to work. The FastCGI server seems to be running. The following is from the error log: upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 192.168.1.125, server: arch, request: "GET /Default.aspx HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "arch" Command used to start the server (I've tried server2 and server4, using a simple .NET 2.0 or .NET 4.0 project): fastcgi-mono-server2 /applications=arch:/:/var/www/test/public/ /socket=tcp:127.0.0.1:9000 /stopable=True nginx config: server { listen 80; server_name arch; access_log /var/www/test/log/access.log; error_log /var/www/test/log/error.log; location / { root /var/www/test/public; index index.html index.htm default.aspx Default.aspx; fastcgi_index Default.aspx; fastcgi_pass 127.0.0.1:9000; fastcgi_param PATH_INFO ""; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } Using xsp4 works fine, I can browse the site. I've enabled FastCGI logging, this is the output: [2012-04-15 23:51:18Z] Debug Accepting an incoming connection. [2012-04-15 23:51:18Z] Notice Beginning to receive records on connection. [2012-04-15 23:51:18Z] Debug Record received. (Type: BeginRequest, ID: 1, Length: 8) [2012-04-15 23:51:18Z] Debug Record received. (Type: Params, ID: 1, Length: 386) [2012-04-15 23:51:18Z] Debug Record received. (Type: Params, ID: 1, Length: 0) [2012-04-15 23:51:18Z] Debug Read parameter. (PATH_INFO = ) [2012-04-15 23:51:18Z] Debug Read parameter. (SCRIPT_FILENAME = /var/www/test/public/Home) [2012-04-15 23:51:18Z] Debug Read parameter. (HTTP_HOST = arch) [2012-04-15 23:51:18Z] Debug Read parameter. (HTTP_USER_AGENT = Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0) [2012-04-15 23:51:18Z] Debug Read parameter. (HTTP_ACCEPT = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8) [2012-04-15 23:51:18Z] Debug Read parameter. (HTTP_ACCEPT_LANGUAGE = en-gb,en;q=0.5) [2012-04-15 23:51:18Z] Debug Read parameter. (HTTP_ACCEPT_ENCODING = gzip, deflate) [2012-04-15 23:51:18Z] Debug Read parameter. (HTTP_CONNECTION = keep-alive) [2012-04-15 23:51:18Z] Debug Read parameter. (HTTP_COOKIE = ASP.NET_SessionId=2C3D702C9B0F23F69B80820B) [2012-04-15 23:51:18Z] Error Failed to process connection. Reason: Argument cannot be null. Parameter name: s [2012-04-15 23:51:18Z] Debug Record sent. (Type: EndRequest, ID: 1, Length: 8) [2012-04-15 23:51:18Z] Debug The FastCGI connection has been closed.

    Read the article

  • Unknown/unsupported storage engine: InnoDB | Mysql Ubuntu

    - by Kayle
    I recently upgraded from the previous LTS Ubuntu to Precise and now mysql refuses to start. It complains of the following when I attempt to start it: ?$ sudo service mysql restart stop: Unknown instance: start: Job failed to start And this shows in "/var/log/mysql/error.log": 120415 23:01:09 [Note] Plugin 'InnoDB' is disabled. 120415 23:01:09 [Note] Plugin 'FEDERATED' is disabled. 120415 23:01:09 [ERROR] Unknown/unsupported storage engine: InnoDB 120415 23:01:09 [ERROR] Aborting 120415 23:01:09 [Note] /usr/sbin/mysqld: Shutdown complete I've checked permissions on all the mysql directories to make sure it had ownership and I also renamed the previou ib_logs so that it could remake them. I'm just getting no where with this issue right now, after looking at google results for 2 hours.

    Read the article

  • How to configure fetchmail to send messages from remote smtp server to Gmail?

    - by ifesdjeen
    I've been trying to setup email forwarding through fetchmail from remote smtp server to Gmail account, although messages are constantly coming to my local address and accessible via "mail" command. SMTP connection works perfectly, but emails do not go anywhere. System: debian, fetchmail Config: poll smtp.server protocol imap username “user” password “pass” smtpname “[email protected]” ssl Thank you!

    Read the article

  • Conflicts with MS Office temporary files when using Offline Folders on Vista

    - by Tambet
    We are using Offline Folders feature of Windows Vista to make files on network shares available when out of office. Mostly it is working, but every time I do a sync I get a lot of such errors: D500E7B8.tmp - A file was deleted on this computer and changed on the server while this computer was offline. There are hundreds of them. I always select all of them and choose resolution "Delete from both locations". But what is causing this and how can I avoid it? I suspect the reason is that we are using Debian and Samba (3.4.7) on our file server. I've been looking for some Samba options that would cure this, but with no success. I learned that probably the cause is, that both Word and Excel are using specific pattern to change files - they never change the original file, but instead always write a new temporary file and rename it to original file, when you click Save. This is documented here: http://support.microsoft.com/kb/211632/?FR=1.

    Read the article

  • how to define service runlevel order position?

    - by DmitrySemenov
    I setup bind-dlz and need mysql start prior NAMED when system starts here is what I have [root@semenov]# ./test.sh mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off named 0:off 1:off 2:off 3:on 4:on 5:on 6:off lrwxrwxrwx. 1 root root 15 Apr 15 18:57 /etc/rc3.d/S93mysql -> ../init.d/mysql lrwxrwxrwx. 1 root root 15 Apr 15 18:57 /etc/rc3.d/S90named -> ../init.d/named here is what I have in mysql init script # Comments to support chkconfig on RedHat Linux # chkconfig: 2345 84 16 # description: A very fast and reliable SQL database engine. # Comments to support LSB init script conventions ### BEGIN INIT INFO # Provides: mysql # Required-Start: $local_fs $network $remote_fs # Should-Start: ypbind nscd ldap ntpd xntpd # Required-Stop: $local_fs $network $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start and stop MySQL # Description: MySQL is a very fast and reliable SQL database engine. ### END INIT INFO so when I remove named from chkconfig and have there just mysql, it starts with order number 84: /etc/rc3.d/S84mysql - ../init.d/mysql but when I add named inside chkconfig it's order changes to 93: /etc/rc3.d/S93mysql - ../init.d/mysql as a result mysql will be starting after named and named will fail (no sql available) any ideas what I'm doing wrong? here is what I have in named init script # chkconfig: 345 90 16 # description: named (BIND) is a Domain Name Server (DNS) \ # that is used to resolve host names to IP addresses. # probe: true ### BEGIN INIT INFO # Provides: $named # Required-Start: $local_fs $network $syslog # Required-Stop: $local_fs $network $syslog # Default-Start:2 3 4 # Default-Stop: 0 1 2 3 4 5 6 # Short-Description: start|stop|status|restart|try-restart|reload|force-reload DNS server # Description: control ISC BIND implementation of DNS server ### END INIT INFO thanks, Dmitry

    Read the article

  • Setup mod-rewrite

    - by Publiccert
    I'm trying to setup mod-rewrite for a few servers. The code lives in /home/jeff/www/upload/application/ However, this is what's happening. It appears to be a problem with mod-rewrite since it's appending code.py to the beginning of the directory: The requested URL /code.py/home/jeff/www/upload/application/ was not found on this server. Here are the rules. Which one is the culprit? WSGIScriptAlias / /home/jeff/www/upload/application Alias /static /home/jeff/www/upload/public_html <Directory /home/jeff/www/upload/application> SetHandler wsgi-script Options ExecCGI FollowSymLinks </Directory> AddType text/html .py <Location /> RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} !^/static RewriteCond %{REQUEST_URI} !^(/.*)+code.py/ RewriteRule ^(.*)$ code.py/$1 [PT] </Location> </VirtualHost>

    Read the article

  • OpenVPN Setup - Service Won't Start

    - by Lenwood
    I'm in the process of setting up OpenVPN on a VPS running Debian 6. I've walked step-by-step through this guide twice now, and I can't get the service to start. When I start the service, the error reported in the log file is: Cannot ioctl TUNSETIFF tun: Inappropriate ioctl for device (errno=25) I've searched the web a few times and I'm not finding anything helpful. I've tried: Changing file permissions: no change Deleting the file: get an error stating no file found (errno=2) Making a folder named "tun": get an error stating no file found (errno=2) I've wiped my installation and completed the steps verbatim twice now. I get no errors along the way, just the error above within my log file. The contents of my server.conf file are listed below, minus all the comments for brevity. Can anyone help? port 1194 proto udp dev tun ca ca.crt cert myserver.crt key myserver.key dh dh1024.pem server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt keepalive 10 120 comp-lzo persist-key persist-tun status openvpn-status.log log openvpn.log verb 3

    Read the article

  • Ubuntu 10.04 bind9 local zone include files and apparmor

    - by Gilgongo
    Rather than putting all my zones in one named.conf.local file, I'd like to have them in groups that I can manage as separate files. So, I've tried putting the following into named.conf.local: include "/home/zones/group1.conf"; include "/home/zones/group2.conf"; include "/home/zones/group3.conf"; However, when I restart named, I see "permission denied" errors in the logs. Ubuntu uses apparmor for bind, so I also added the following in /etc/apparmor.d/usr.sbin.named: /home/zones/group1.conf r, /home/zones/group1.conf r, /home/zones/group1.conf r, Now, when I re-start named, all appears to be well. Zones are loaded (I think). However, a day or two later, I see my secondary name server complaining that the primary is telling it that it's not authoritative for those domains. I then have to put all the domains back into the named.conf.local file again. How can I get bind9 to use include files in this way? I don't know much about apparmor, so that may or may not be the issue here, but I've used include files in this way on Debian OK.

    Read the article

  • Drupal install and permissions

    - by Richard
    So I'm really stuck on this issue. An install process is complaining about write permission on settings.php and sites/default/files/. However, I've moved these files temporarily to write/read (chmod 777) and changed the owner/group to "apache" as shown below. -bash-4.1$ ls -hal total 28K drwxrwxrwx. 3 richard richard 4.0K Aug 23 15:03 . drwxr-xr-x. 4 richard richard 4.0K Aug 18 14:20 .. -rwxrwxrwx. 1 apache apache 9.3K Mar 23 16:34 default.settings.php drwxrwxrwx. 2 apache apache 4.0K Aug 23 15:03 files -rwxrwxrwx. 1 apache apache 0 Aug 23 15:03 settings.php However, the install is still complaining about write permissions. I followed steps one and two of the INSTALL.txt but no luck. Update: To further explore the situation, I created sites/default/richard.php with the following code: <?php error_reporting(E_ALL); ini_set('display_errors', '1'); mkdir('files'); print("<hr> User is "); passthru("whoami"); passthru("pwd"); ?> Run from the command line (under user "richard"), no problem. The folder is created everything is a go. Run from the web, I get the following: Warning: mkdir(): Permission denied in /var/www/html/sites/default/richard.php on line 9 User is apache /var/www/html/sites/default Update 2: Safe mode appears to be off... -bash-4.1$ cat /etc/php.ini | grep safe | grep mode | grep -v \; safe_mode = Off safe_mode_gid = Off safe_mode_include_dir = safe_mode_exec_dir = safe_mode_allowed_env_vars = PHP_ safe_mode_protected_env_vars = LD_LIBRARY_PATH sql.safe_mode = Off

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15  | Next Page >