Daily Archives

Articles indexed Monday June 14 2010

Page 16/108 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • IPTables configuration help

    - by Sam
    I'm after some help with setting up IPTables. Mostly the configuration is working, but regardless of what I try I cannot allow localhost to access the local Apache only (i.e. localhost to access localhost:80 only). Here is my script: !/bin/bash Allow root to access external web and ftp iptables -t filter -A OUTPUT -p tcp --dport 21 --match owner --uid-owner 0 -j ACCEPT iptables -t filter -A OUTPUT -p tcp --dport 80 --match owner --uid-owner 0 -j ACCEPT Allow DNS queries iptables -A OUTPUT -p udp --dport 53 -j ACCEPT iptables -A OUTPUT -p tcp --dport 53 -j ACCEPT Allow in and outbound SSH to/from any server iptables -A INPUT -p tcp -s 0/0 --dport 22 -j ACCEPT iptables -A OUTPUT -p tcp -d 0/0 --sport 22 -j ACCEPT Accept ICMP requests iptables -A INPUT -p icmp -s 0/0 -j ACCEPT iptables -A OUTPUT -p icmp -d 0/0 -j ACCEPT Accept connections from any local machines but disallow localhost access to networked machines iptables -A INPUT -s 10.0.1.0/24 -j ACCEPT iptables -A OUTPUT -d 10.0.1.0/24 -j DROP Drop ALL other traffic iptables -A OUTPUT -p tcp -d 0/0 -j DROP iptables -A OUTPUT -p udp -d 0/0 -j DROP Now I have tried many permutations and I'm obviously missing everything. I place them above the in/out bound SSH to/from, so it's not the precedence order. If someone could give me the heads up on allowing only the local machine to access the local web server, that'd be great. Cheers guys.

    Read the article

  • Should I dive into ASP.NET MVC or start with ASP.NET Webforms?

    - by Sahat
    I plan to pick up Silverlight in the future. Possibility of going into Microsoft WPF. Currently learning Objective-C 2.0 w/ Cocoa. I already know Pros and Cons of ASP.NET MVC vs ASP.NET Webforms. What I want to know is what would be more "efficient" for me to learn given the circumstances above? By efficient I mean learning one design pattern once and then re-using it. Objective-C I believe uses MVC approach? What about Silverlight? WPF? So what do you think? Also as a side question is it true that ASP.NET Webforms is often used by freelancers/small companies and ASP.NET MVC in large enterprises?

    Read the article

  • Problem with mod rewrite for multi-lingual site

    - by Chris
    Hi everyone Currently developing a multi-lingual website, Users can access the front page using url with format below: http://mydomain.com/en/ http://mydomain.com/fr/ Problem is here. URL without last "/" (http://mydomain.com/fr) caused page not found problem Here is the rule RewriteRule ^/?([^./]+)/(.*)$ $2?lang=$1 [L,QSA] Can anybody help ? Thanks in advance

    Read the article

  • C++: use array of strings wrapped in namespace?

    - by John D.
    I got the following code, wishing to wrap a group of strings nicely in a namespace: namespace msgs { const int arr_sz = 3; const char *msg[arr_sz] = {"blank", "blank", "blank" }; msg[0] = "Welcome, lets start by getting a little info from you!\n"; msg[1] = "Alright, bla bla bla.."; msg[2] = "etc."; } The code inside works nicely inside a function, but I don't know how to return an array from it. The namespace idea LOOKS fine, but it returns on the last three lines: error: expected constructor, destructor, or type conversion before ‘=’ token Why can't I define the array inside a namespace, do I need to do something first? It's nice because I can call it like printf(msgs::msg[1]) etc. I want to do this I just can't wrap my head around what's wrong :(

    Read the article

  • handing data returned from jquery get request

    - by ian
    I have a simple jquery script as follows: $('a').click(function() { //get the id of the song we want to play var song_id = $(this).attr("id"); //do a get request to get the information about the song $.get("http://www.site.com/v4/ajax/get_song_info.php", { id: song_id, }, function(data) { alert("Data Loaded: " + data); }); //alert( song_id ); }); I have gotten it to work and it returns several bits of data 'artist' 'title' 'song duration' and so on. How do I process my 'data' so I can then update my page with each bit. In this case I want to set a series of '' to hold each of the values returned. Thanks.

    Read the article

  • how to structure code that uses std::rel_ops

    - by R Samuel Klatchko
    I was working on some code and wanted to make use of std::rel_ops. From what I can tell, you need to do using std::rel_ops to your source code to make use of them. But I'm not sure where the best place to put that is. Let's say I have a header file with a class that only defines the minimal operator== and operator<: // foo.h class foo { public: bool operator==(const foo &other) const; bool operator<(const foo &other) const; }; I'm not sure where to put using std::rel_ops. If I leave it out of the foo.h, then every user of foo.h needs to know the implementation detail that foo is not defining all the operators itself. But putting using std::rel_ops inside foo.h breaks the rule of thumb about not having a using in a header file. How do other people resolve this issue?

    Read the article

  • UITableView in a View controller by a UIViewController and not a UITableView

    - by dirrigc
    Hi all, I have a View with lots of things inside it including buttons, a scroll view and a tableView (ipad app). I am controller this view with a viewController subclass but I don't know how to manage my tableView. I don't know where put the methods : - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath should i add them to my ViewController or should i create a new subclass of UITableViewController (and get them "for free") and set the dataSource and delegate of my tableView to that class when I create it programmatically? I am storing the data I want to show in my appDelegate following the tutorial : http://www.iphonesdkarticles.com/2008/10/sqlite-tutorial-selecting-data.html I am new at developing and I fear I am spagetti coding. Thanks a lot

    Read the article

  • Self join to a table

    - by Mohit
    I have a table like Employee ================== name salary ================== a 10000 b 20000 c 5000 d 40000 i want to get all the employee whose salary is greater than A's salary. I don't want to use any nested or sub query. It has been asked in an interview and hint was to use self join. I really can't figure out how to achieve the same.

    Read the article

  • Radio Button text

    - by niya
    Trying to create a profile using content provider.I want to add the gender to the table when the radio button corresponding to the male or female is clicked. Any solution?

    Read the article

  • EXC_MEMORY_ACCESS when trying to delete from Core Data ($cash solution)

    - by llloydxmas
    I have an application that downloads an xml file, parses the file, and creates core data objects while doing so. In the parse code I have a function called 'emptydatacontext' that removes all items from Core Data before creating replacements items from the xml data. This method looks like this: -(void) emptyDataContext { NSFetchRequest * allCon = [[NSFetchRequest alloc] init]; [allCon setEntity:[NSEntityDescription entityForName:@"Condition" inManagedObjectContext:managedObjectContext]]; NSError * error = nil; NSArray * conditions = [managedObjectContext executeFetchRequest:allCon error:&error]; DebugLog(@"ERROR: %@",error); DebugLog(@"RETRIEVED: %@", conditions); [allCon release]; for (NSManagedObject * condition in conditions) { [managedObjectContext deleteObject:condition]; } // Update the data model effectivly removing the objects we removed above. //NSError *error; if (![managedObjectContext save:&error]) { DebugLog(@"%@", [error domain]); } } The first time this runs it deletes all objects and functions as it should - creating new objects from the xml file. I created a 'update' button that starts the exact same process of retrieving the file the proceeding with the parse & build. All is well until its time to delete the core data objects. This 'deleteObject' call creates a "EXC_BAD_ACCESS" error each time. This only happens on the second time through. Captured errors return null. If I log the 'conditions' array I get a list of NSManagedObjects on the first run. On the second this log request causes a crash exactly as the deleteObject call does. I have a feeling it is something very simple I'm missing or not doing correctly to cause this behavior. The data works great on my tableviews - its only when trying to update I get the crashes. I have spent days & days on this trying numerous alternative methods. Whats left of my hair is falling out. I'd be willing to ante up some cash for anyone willing to look at my code and see what I'm doing wrong. Just need to get past this hurdle. Thanks in advance for the help!

    Read the article

  • displaying the file data in correct format

    - by tazim
    hi, In views.py def showfiledata(request): with open("/home/tazim/webexample/tmp.txt") as f: read_data = f.read() f.closed return_dict = {'filedata':read_data} json = simplejson.dumps(return_dict) return HttpResponse(json,mimetype="application/json") In the template: < html < head < script type="text/javascript" src="/jquerycall/" < script type="text/javascript" $(document).ready(function() { $("button").click(function() { $.ajax({ type:"POST", url:"/showfiledata/", datatype:"json", success:function(data) { var s = data.filedata; $("#someid").html(s); } }); }); }); < /script < /head < body < form method="post" < button type="button"Click Me< /button < div id="someid"< /div < /form < /body < /html I am suppose to display file line by line . But, right now the lines get displayed withoout any linebreaks.

    Read the article

  • Probelem, executing commands in cmd using c#

    - by srk
    I need to execute the below command in command prompt. C:\MySQL\MySQL Server 5.0\bin>mysql -uroot -ppassword < d:/admindb/aar.sql When i do this manually in cmd, i am getting my results. Now i am trying to do this programatically, to execute it in cmd from c# code. I am using the below code to do it. I am not getting any errors and Result !!! When i debug, i get the value of string commandLine as below, "\"C:\\MySQL\\MySQL Server 5.0\\bin\\\" -uroot -ppassword > \"D:/admindb/AAR12.sql" I guess the problem is with this string, passed to cmd. How to solve this ??. public void Execute() { string commandLine = "\"" + MySqlCommandPath + "\"" + " -u" + DbUid + " -p" + DbPwd + " > " + "\"" + Path.Combine(Path_Backup, FileName_Backup + ExcID + ".sql"); System.Diagnostics.ProcessStartInfo PSI = new System.Diagnostics.ProcessStartInfo("cmd.exe"); PSI.RedirectStandardInput = true; PSI.RedirectStandardOutput = true; PSI.RedirectStandardError = true; PSI.UseShellExecute = false; System.Diagnostics.Process p = System.Diagnostics.Process.Start(PSI); System.IO.StreamWriter SW = p.StandardInput; System.IO.StreamReader SR = p.StandardOutput; SW.WriteLine(commandLine); SW.Close(); }

    Read the article

  • Failed to resolve include text for file:SQLServer.ttinclude

    - by bigred
    I updated to the version 3.0.0.3. Dragged the new ActiveRecord directory in VS08, and added the newer dll. I'm not sure whats going on yet. When I try to compile the project I get that error. My SVN server just lost my old version, so I'll have to download the older Subsonic version and see if that fixes the problem. I have no clue what I did wrong in the configuration as I updated to 3.0.0.3. (still a new users so I couldn't post a photo, but here a link to the error) link text

    Read the article

  • Are some DSL modems cheaper to operate than others? (power usage question)

    - by SetJmp
    I recently have started using a Motorola 2210 in conjunction with AT&T's DSL service in the Silicon Valley area. That gadget runs hot to the touch! Which means... I assume it is gobbling lots of electricity even when I am not using it. Has anyone studied this subject in a rigorous way? Which leads to the question... if the 2210 is very energy inefficient are some DSL modem models cheaper to operate than others? -SetJmp

    Read the article

  • Appropriate use of die()?

    - by letseatfood
    I create pages in my current PHP project by using the following template: <?php include 'bootstrap.php'; head(); ?> <!-- Page content here --> <?php foot(); ?> Is the following example an appropriate use of die()? Also, what sort of problems might this cause for me, if any? <?php include 'bootstrap.php'; head(); try { //Simulate throwing an exception from some class throw new Exception('Something went wrong!'); } catch(Exception $e) { ?> <p>Please fix the following errors:</p> <p><?php echo $e->getMessage(); ?></p> <?php foot(); die(); } //If no exception is thrown above, continue script doSomething(); doSomeOtherThing(); foot(); ?> ?> <?php foot(); ?> Basically, I have a script with multiple tasks on it and I am trying to set up a graceful way to notify the user of input errors while preventing the remaining portion of the script from executing. Thanks!

    Read the article

  • Application connection with database persist after sucessfull transaction also.

    - by anupam3m
    Hi , I am using Spring.Data.NHibernate12 on my database level.my application connection with database is not getting released. Underneath given is Dataconfiguration.xml < ?xml version="1.0" encoding="utf-8" ? < objects xmlns="http://www.springframework.net" xmlns:db="http://www.springframework.net/database" < object id="AuditLogger" type="Risco.Rsp.Ac.Audit.AuditLogger, Risco.Rsp.Ac.Audit" singleton="false" < property name="CacheSettings" ref="CacheSettings"/ < /object < object id="CacheSettings" type="Risco.Rsp.Ac.AMAC.CacheMgmt.Utilities.UpdateEntityCacheHelper, Risco.Rsp.Ac.AMAC.CacheMgmt.Utilities" singleton="false"/ < object type="Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core" < <property name="ConfigSections" value="databaseSettings"/> < < db:provider id="AMACDbProvider" provider="OracleClient-2.0" connectionString="Data Source=RISCODEVDB;User ID=amsbvt; Password=amsuser1234;"/ Risco.Rsp.Ac.AMAC.Mapping Risco.Rsp.Ac.Logging.Appenders Risco.Rsp.Ac.AMAC.CacheMappings --

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >