Daily Archives

Articles indexed Friday February 18 2011

Page 8/13 | < Previous Page | 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Security of keyctl

    - by ftiaronsem
    Hello alltogether Today I set up an ecryptfs directory, which is automatically mounted at login via pam. To do so i followed the guide in the ecryptfs readme ecryptfs-readme To sum up, I now have a key stored in the usser session keyring. The first thing I do not understand is why this key is only showing up via keyctl show and not with the gnome-gui "Passwords and encryption keys". The second thing I am curious about is the security. I assume that my passphrase is somehow stored on the harddisk. But how exactly and how secure is this? Thanks in advance

    Read the article

  • Disqus integration in website.. what is wrong??

    - by Thieme Hennis
    hi, I try to embed a disqus forum in a website I created. I used the exact code and instructions they give on the installation instructions. I just don't get it. Not much on Google either. Is something wrong in the code? Should I change anything? <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="shortcut icon" href="../favicon.ico"> <title>Little Louie | Hennis &amp; Blaisse Lovers Productions</title> <META NAME="keywords" CONTENT="some,tags"> <link href="../style2.css" rel="stylesheet" type="text/css"> </head> <body> <p><b>Some text</p> <p> <div id="disqus_thread"></div> <script type="text/javascript"> (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://littelouie.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript=littelouie">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> </p> <p> <script type="text/javascript"> var disqus_shortname = 'littelouie'; (function () { var s = document.createElement('script'); s.async = true; s.src = 'http://disqus.com/forums/littelouie/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); </script> </p> </body> </html>

    Read the article

  • Moving large website to new CMS - URL changes

    - by herrherr
    Hi, I was wondering if you have any tipps on the following situation. I'm going to move a large website to a new Content Management System, here are some details on the site: online news magazine with roughly 3,000 articles domain age: 10 years online in the current form since May 2010 indexed pages: ~10.000 percent of search engine traffic: under 10% Unfortunately a custom-tailored CMS was used for the site. The performance, reliability and SEO capabilites have been really bad, so we are moving to a new and proven open source CMS. All the articles will be kept as they are, but the URL structure as well as the structure of the HTML templates will be changed. What I wanted to do now is to actually create 301 redirects for all articles from the old to the new schema, i.e: Old: www.example.com/en/html/news/detail/title-of-the-article/ New: www.example.com/category/title-of-article.html Is this a proven way to do something like this? If not, can you recommend a way that has worked for you? Thanks :)

    Read the article

  • can anyone reccommend a Google SERP tracker?

    - by Haroldo
    I want to track my website's position in Google's search results for around 50 keywords/phrases and am looking to a nice webapp/windows app to automate this process? Ideally i want to see pretty javscript or flash line graphs for my keyword/position. I'm currently free-trialing: Raven Tools and Sheer SEO but am not particularly impressed with either... I guess my budget is up to £25-30/$30-40 per month for a decent bit of software ps. i've tried asking this on SuperUser but it seems a bit webdeveloper-y...

    Read the article

  • Which image sharing websites supports file uploading dynamically via api

    - by KoolKabin
    Hi, I have been searching for image hosting website that displays images of a user in a nice and managed way. I want to upload the files to that image hosting website in my account of that website from a page in my website. i.e if i have a website abc.com then user browse my website abc.com. Uploads the file to my website. Now I want to transfer the uploaded file to the image hosting website so that it can be viewed by other users of that hosting website and get better visibility to world

    Read the article

  • How to Remove Extensions From, and Force the Trailing Slash at the End of URLs?

    - by Kronbernkzion
    Example of current file structure: example.com/foo.php example.com/bar.html example.com/directory/ example.com/directory/foo.php example.com/directory/bar.html example.com/cgi-bin/directory/foo.cgi I would like to remove HTML, PHP and CGI extensions from, and then force the trailing slash at the end of URLs. So, it could look like this: example.com/foo/ example.com/bar/ example.com/directory/ example.com/directory/foo/ example.com/directory/bar/ example.com/cgi-bin/directory/foo/ I am very frustrated because I've searched for 17 hours straight for solution and visited more than a few hundred pages on various blogs and forums. I'm not joking. So I think I've done my research. Here is the code that sits in my .htaccess file right now: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^(([^/]+/)*[^./]+)/$ $1.html RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]|/)$ RewriteRule (.*)$ /$1/ [R=301,L] As you can see, this code only removes .html (and I'm not very happy with it because I think it could be done a lot simpler). I can remove the extension from PHP files when I rename them to .html through .htaccess, but that's not what I want. I want to remove it straight. This is the first thing I don't know how to do. The second thing is actually very annoying. My .htaccess file with code above, adds .html/ to every string entered after example.com/directory/foo/. So if I enter example.com/directory/foo/bar (obviously /bar doesn't exist since foo is a file), instead of just displaying message that page is not found, it converts it to example.com/directory/foo/bar.html/, then searches for a file for a few seconds and then displays the not found message. This, of course, is bad behavior. So, once again, I need the code in .htaccess to do the following things: Remove .html extension Remove .php extension Remove .cgi extension Force the trailing slash at the end of URLs Requests should behave correctly (no adding trailing slashes or extensions to strings if file or directory doesn't exist on server) Code should be as simple as possible I would very much appreciate any help. And to first person that gives me the solution, I'll send two $50 iTunes Store gift cards for US store. If this offends anyone, I am truly sorry and I apologize. Thanks in advance.

    Read the article

  • Best practices for implementing collectible virtual item "packs"?

    - by Glenn Barnett
    I'm in the process of building a game in which virtual items can be obtained either by in-game play (defeating enemies, gaining levels), or by purchasing "packs" via microtransactions. Looking at an existing example like Duels.com's item packs, it looks like a lot of thought went into their implementation, including: Setting clear player expectations as to what can be obtained in the pack Limiting pack supply to increase demand and control inflation Are there other considerations that should be taken into account? For example, should the contents of the packs be pre-generated to guarantee the advertised drop rates, or is each drop rate just a random chance, and you could end up with higher or lower supply?

    Read the article

  • Good GUI for OpenGL

    - by Cristina
    I am starting to learn OpenGL with FreeGLUT using the Superbible and the knowledge i have from my elementary graphics to brush up on my skills. To get more from this experience i want to integrate a GUI to overwrite the one FreeGLUT uses, now my question is this: is this thing possible and what library should i use? Some characteristics for the library: Open source Multi-platform (Linux and Windows) C/C++ If you have any other recommendations please feel free to post them along with your answers for my problem.

    Read the article

  • How can I improve the "smoothness" of a 2D side-scrolling iPhone game?

    - by MrDatabase
    I'm working on a relatively simple 2D side-scrolling iPhone game. The controls are tilt-based. I use OpenGL ES 1.1 for the graphics. The game state is updated at a rate of 30 Hz... And the drawing is updated at a rate of 30 fps (via NSTimer). The smoothness of the drawing is ok... But not quite as smooth as a game like iFighter. What can I do to improve the smoothness of the game? Here are the potential issues I've briefly considered: I'm varying the opacity of up to 15 "small" (20x20 pixels) textures at a time... Apparently varying the opacity in this manner can degrade drawing performance I'm rendering at only 30 fps (via NSTimer)... Perhaps 2D games like iFighter are rendered at a higher frame rate? Perhaps the game state could be updated at a faster rate? Note the acceleration vales are updated at 100 Hz... So I could potentially update part of the game state at 100 hz All of my textures are PNG24... Perhaps PNG8 would help (due to smaller size etc)

    Read the article

  • PHP getting Twitter API JSON file contents without OAuth (Almost have it)

    - by DexCurl
    Hey guys, I have this script working fine with OAuth, but I accidentally nuked my 350 API hits with a stupid while statement :( I'm trying to get data from the Twitter API without OAuth, I can't figure it out (still pretty new), heres what I have <html> <body> <center> <hr /> <br /> <table border="1"> <tr><td>ScreenName</td><td>Followed back?</td></tr> <?php //twitter oauth deets $consumerKey = 'x'; $consumerSecret = 'x'; $oAuthToken = 'x'; $oAuthSecret = 'x'; // Create Twitter API objsect require_once("twitteroauth.php"); $oauth = new TwitterOAuth($consumerKey, $consumerSecret, $oAuthToken, $oAuthSecret); //get home timeline tweets and it is stored as an array $youfollow = $oauth->get('http://api.twitter.com/1/friends/ids.json?screen_name=lccountdown'); $i = 0; //start loop to print our results cutely in a table while ($i <= 20){ $youfollowid = $youfollow[$i]; $resolve = "http://api.twitter.com/1/friendships/exists.json?user_a=".$youfollow[$i]."&user_b=jwhelton"; $followbacktest = $oauth->get($resolve); //$homedate= $hometimeline[$i]->created_at; //$homescreenname = $hometimeline[$i]->user->screen_name; echo "<tr><td>".$youfollowid."</td><td>".$followbacktest."</td></tr>"; $i++; } ?> </table> </center> </body> </html> Neither of the two Twitter functions require authentication, so how can I get the same results? Thanks guys, Dex

    Read the article

  • ArrayList.Sort should be a stable sort with an IComparer but is not?

    - by Kaleb Pederson
    A stable sort is a sort that maintains the relative ordering of elements with the same value. The docs on ArrayList.Sort say that when an IComparer is provided the sort is stable: If comparer is set to null, this method performs a comparison sort (also called an unstable sort); that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. To perform a stable sort, you must implement a custom IComparer interface. Unless I'm missing something, the following testcase shows that ArrayList.Sort is not using a stable sort: internal class DisplayOrdered { public int ID { get; set; } public int DisplayOrder { get; set; } public override string ToString() { return string.Format("ID: {0}, DisplayOrder: {1}", ID, DisplayOrder); } } internal class DisplayOrderedComparer : IComparer { public int Compare(object x, object y) { return ((DisplayOrdered)x).DisplayOrder - ((DisplayOrdered)y).DisplayOrder; } } [TestFixture] public class ArrayListStableSortTest { [Test] public void TestWeblinkCallArrayListIsSortedUsingStableSort() { var call1 = new DisplayOrdered {ID = 1, DisplayOrder = 0}; var call2 = new DisplayOrdered {ID = 2, DisplayOrder = 0}; var call3 = new DisplayOrdered {ID = 3, DisplayOrder = 2}; var list = new ArrayList {call1, call2, call3}; list.Sort(new DisplayOrderedComparer()); // expected order (by ID): 1, 2, 3 (because the DisplayOrder // is equal for ID's 1 and 2, their ordering should be // maintained for a stable sort.) Assert.AreEqual(call1, list[0]); // Actual: ID=2 ** FAILS Assert.AreEqual(call2, list[1]); // Actual: ID=1 Assert.AreEqual(call3, list[2]); // Actual: ID=3 } } Am I missing something? If not, would this be a documentation bug or a library bug? Apparently using an OrderBy in Linq gives a stable sort.

    Read the article

  • General workflow to allow multiple OpenIDs to be associated with one app account

    - by BobTodd
    I have a (typical?) scenario: that my app's users can use multiple openids mapped to one app account (like stackoverflow). For me the unique thing on the account is the email address, so this binds openids to the profile. Question is, how to allow a user to start using a second openid once one is setup. I am asking as I have read that it is a security hole to allow automatic account openid syncing simply based on the provider-supplied email address as someone could easily spoof someone's email address to create a spoof openid and falsely access the account (how I am not sure) - although this seems to be exactly how stack operates. See options a. and b. below. Problem for me with a. is what happens if the original openid no longer works for whatever reason - how would you set-up a new openid? Would b. be more acceptable if we used email verification? Does anyone have an article detailing a "standard" way (set of user stories) for this - it seems to be an increasingly popular way to authenticate. I have tried to detail this in a rough decision tree... 1. My Site > authentication landing page - user chooses an openid (facebook, google, myopenid etc), redirection > 2. Provider site returns with token (includes user registering a new openid, logging in or is already logged in to Provider site) 3. My Site > use token id to lookup user 3.1 Profile exists? Yes > authenticate. ends. No > 3.1.1 was email address supplied by provider? Yes > lookup user by email address 3.1.1.1 Profile exists? Yes > a. error message - please login with existing openid and associate this openid (from special page) Yes > b. or associate this openid with existing profile automatically. authenticate. ends. No > Register profile. With registration email address follow 3.1.1, except this time where email is unique, we will associate openid. ends

    Read the article

  • CSS style submit like href tag

    - by seth.vargo
    Hi all, I have a button class that I wrote in CSS. It essentially displays block, adds some styles, etc. Whenever I add the class to a tags, it works fine - the a tag spans the entire width of its container like display:block should do... However, when I add the button class to an input button, Chrome, Safari, and Firefox all add a margin-right: 3px... I've used the DOM inspector in both Chrome and Safari and NO WHERE should it be adding a extra 3px padding. I tried adding margin: 0 !important; and/or margin-right: 0 !important to my button class in my CSS, but the browser STILL renders a 3px right margin! Is this a known issue, and is there a CSS-based solution (i.e. not jQuery/javascript) CODE FOLLOWS: .button { position: relative; display: block; margin: 0; border: 1px solid #369; color: #fff; font-weight: bold; padding: 11px 20px; line-height: 18px; text-align: center; text-transform: uppercase; cursor: hand; cursor: pointer; }

    Read the article

  • Get standard application for txt files (.NET)

    - by iDog
    Possible Duplicate: Finding the default application for opening a particular file type on Windows Hello, in my application I want to open a text file, which has no .txt extension. Is there any way to get the standard application for .txt files in .NET (C#)? Sure I could use "notepad", but there might be some people (like me), who prefer another (their standard) editor. Thank you very much. Edit: The registry key "[HKEY_CLASSES_ROOT]\txtfile\shell\open\command" references notepad, but that's not my standard app for txt files. How do I get the my current standard app for .txt?

    Read the article

  • Why does Visual Studio's "Unused References..." button not flag System.Xml and System.Xml.Linq?

    - by mcjabberz
    I was trying to finish up a VB.NET class library project when I tried to remove all unused references. I know for a fact that I'm not explicitly using any thing from the System.Xml and System.Xml.Linq assemblies yet the "Unused References..." button never flags them for removal. In fact I even tried "Unused References..." on a blank project and it still never flagged them. The only reason I could think of is that either mscorlib.dll or System.dll is using System.Xml.dll or System.Xml.Linq.dll. Are they safe to remove?

    Read the article

  • __FILE__ In .h what does it resolve to

    - by Pablitorun
    Is there a specification on how the FILE macro will be expanded if it is in a .h? So if I #define MYFILE __FILE__ in foo.h and foo.c #includes "foo.h" void main(){ printf("%s",MYFILE); .... does this output foo.h or foo.c? (Yes I realize this is a stupid example) Sorry for what should be a simple question. The documentation on the web seems conflicting. For what it is worth VS2008 comes back as foo.c which is what I would expect....I think. I am just trying to confirm if this is defined behavior.

    Read the article

  • sql boolean truth test: zero OR null

    - by AK
    Is there way to test for both 0 and NULL with one equality operator? I realize I could do this: WHERE field = 0 OR field IS NULL But my life would be a hundred times easier if this would work: WHERE field IN (0, NULL) (btw, why doesn't that work?) I've also read about converting NULL to 0 in the SELECT statement (with COALESCE). The framework I'm using would also make this unpleasant. Realize this is oddly specific, but is there any way to test for 0 and NULL with one WHERE predicate?

    Read the article

  • Launch external application from C++ program and attach it to visual 2008 debugger while debugging host in WinAPI

    - by PiotrK
    Basically I have Host and Child program. I do not have sources for Child so I can't change anything in it. I want to launch Host from debugger, which at some point should launch Child program. I want to attach Child automatically for debugging session as well (so any breakpoints set in DLL sources loaded under Child process will hit). How to do this in Visual Studio 2008 C++ with standard WinAPI? I tried this: SHELLEXECUTEINFO sei = {0}; sei.cbSize = sizeof (SHELLEXECUTEINFO); sei.fMask = SEE_MASK_NOCLOSEPROCESS; sei.lpVerb = "open"; sei.lpFile = "Child.exe"; sei.lpParameters = "/Param"; sei.nShow = SW_SHOWNORMAL; if (ShellExecuteEx (&sei)) { WaitForSingleObject (sei.hProcess, INFINITE); } But this does not attach debugger for Child.exe

    Read the article

  • Drag N Drop utilizing simple cursor

    - by Cameron
    I'm using CommonsGuy's drag n drop example and I am basically trying to integrate it with the Android notepad example. Drag N Drop Out of the 2 different drag n drop examples i've seen they have all used a static string array where as i'm getting a list from a database and using simple cursor adapter. So my question is how to get the results from simple cursor adapter into a string array, but still have it return the row id when the list item is clicked so I can pass it to the new activity that edits the note. Here is my code: Cursor notesCursor = mDbHelper.fetchAllNotes(); startManagingCursor(notesCursor); // Create an array to specify the fields we want to display in the list (only NAME) String[] from = new String[]{WeightsDatabase.KEY_NAME}; // and an array of the fields we want to bind those fields to (in this case just text1) int[] to = new int[]{R.id.weightrows}; // Now create a simple cursor adapter and set it to display SimpleCursorAdapter notes = new SimpleCursorAdapter(this, R.layout.weights_row, notesCursor, from, to); setListAdapter(notes); And here is the code i'm trying to work that into. public class TouchListViewDemo extends ListActivity { private static String[] items={"lorem", "ipsum", "dolor", "sit", "amet", "consectetuer", "adipiscing", "elit", "morbi", "vel", "ligula", "vitae", "arcu", "aliquet", "mollis", "etiam", "vel", "erat", "placerat", "ante", "porttitor", "sodales", "pellentesque", "augue", "purus"}; private IconicAdapter adapter=null; private ArrayList<String> array=new ArrayList<String>(Arrays.asList(items)); @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); adapter=new IconicAdapter(); setListAdapter(adapter); TouchListView tlv=(TouchListView)getListView(); tlv.setDropListener(onDrop); tlv.setRemoveListener(onRemove); } private TouchListView.DropListener onDrop=new TouchListView.DropListener() { @Override public void drop(int from, int to) { String item=adapter.getItem(from); adapter.remove(item); adapter.insert(item, to); } }; private TouchListView.RemoveListener onRemove=new TouchListView.RemoveListener() { @Override public void remove(int which) { adapter.remove(adapter.getItem(which)); } }; class IconicAdapter extends ArrayAdapter<String> { IconicAdapter() { super(TouchListViewDemo.this, R.layout.row2, array); } public View getView(int position, View convertView, ViewGroup parent) { View row=convertView; if (row==null) { LayoutInflater inflater=getLayoutInflater(); row=inflater.inflate(R.layout.row2, parent, false); } TextView label=(TextView)row.findViewById(R.id.label); label.setText(array.get(position)); return(row); } } } I know i'm asking for a lot, but a point in the right direction would help quite a bit! Thanks

    Read the article

  • VSTO Word ContentControls, Y U No have Name property?

    - by System.Cats.Lol
    When you add a VSTO (not Word native) content control, you specify the name: controls.AddContentControl(wordRange, "foo", wdType); Where controls is the VSTO (extended) Document.Controls collection. You can later look up the control by name: ContentControl myContentControl = controls["foo"]; So why in the world is there no Name property for ContentControl? (or ContentControlBase, or any of the other derivatives). I'm implementing a wrapper class for the Document.Controls property that lets you add or iterate the content controls. When iterating the underlying Document.Controls, there's no way to look up the name of each control. (We need it to return an instance of our ContentControl wrapper). So currently I'm doing this in our ContentControls wrapper class: public IEnumerator<IContentControl> GetEnumerator() { System.Collections.IEnumerator en = this.wordControls.GetEnumerator(); while (en.MoveNext()) { // VSTO Document.Controls includes all managed controls, not just // VSTO ContentControls; return only those. if (en.Current is Microsoft.Office.Tools.Word.ContentControl) { // The control's name isn't stored with the control, only when it was added, // so use a placeholder name for the wrapper. yield return new ContentControl("Unknown", (Microsoft.Office.Tools.Word.ContentControl)en.Current); } } } I'd prefer to not have to resort to keeping a map of names-to-wrapper-objects in our ContentControls object. Can anyone tell me how to get the control's name (the name parameter that was passed to Controls.Add()?

    Read the article

  • Magento Design Patterns

    - by JonB
    Magento, IMHO, represents a PHP system that is built on well thought-out coding principles - reuseable design patterns being one of them. In terms of an example of a PHP system, I think it can be considered pretty cutting edge and therefore worth considering from an architectural point of view. As I understand it, there are many design patterns that are available to the OOP developer. Seeing such patterns being put to use in an open-source system such as Magento allows a developer to view examples of such patterns in real use and in situ, rather than in examples that can sometimes be rather achedemic, and even a little misleading. As such, I am wondering what patterns, other than the ones I have listed below, Magento programmers have used when developing for Magento. As a note, I understand that some of these patterns are in place as a consequence of being built on the Zend Framework, MVC / Front Controller being a couple of them, The obvious ones are: Factory: $product = Mage::getModel('catalog/product'); Singleton: $category = Mage::getSingleton('catalog/session'); Registry: $currentCategory = Mage::registry('current_category');

    Read the article

  • Autoselect, focus and highlight a new NSOutlineView row

    - by coneybeare
    This is probably just lack of experience with the NSOutlineView but I can't see a way to do this. I have a NSOutlineView (implemented with the excellent PXSourceList) with an add button that is totally functional in the aspect that I save/write/insert/delete rows correctly. I do not use a NSTreeController, and I don't use bindings. I add the entity using the following code: - (void)addEntity:(NSNotification *)notification { // Create the core data representation, and add it as a child to the parent node UABaseNode *node = [[UAModelController defaultModelController] createBaseNode]; [sourceList reloadData]; for (int i = 0; i < [sourceList numberOfRows]; i++) { if (node == [sourceList itemAtRow:i]) { [sourceList selectRowIndexes:[NSIndexSet indexSetWithIndex:i] byExtendingSelection:NO]; [sourceList editColumn:0 row:i withEvent:nil select:NO]; break; } } } When the add button is pressed, a new row is inserted like this: If I click away, then select the row and press enter to edit it, it now looks like this: My question is: How can I programmatically get the same state (focus, selected, highlighted) the first time, to make the user experience better?

    Read the article

  • How do I build a python string from a raw (binary) ctype buffer?

    - by fcrazy
    I'm playing with Python and ctypes and I can't figure out how to resolve this problem. I call to a C function which fills a raw binary data. My code looks like this: class Client(): def __init__(self): self.__BUFSIZE = 1024*1024 self.__buf = ctypes.create_string_buffer(self.__BUFSIZE) self.client = ctypes.cdll.LoadLibrary(r"I:\bin\client.dll") def do_something(self): len_written = self.client.fill_raw_buffer(self.__buf, self.__BUFSIZE) my_string = repr(self.__buf.value) print my_string The problem is that I'm receiving binary data (with 0x00) and it's truncated when I tried to build my_string. How can I build my_string if self._buf contains null bytes 0x00? Any idea is welcome. Thanks

    Read the article

  • PHP equivalent to JavaScript's string split method

    - by m4k00
    I'm working with this on JavaScript: <script type="text/javascript"> var sURL = "http://itunes.apple.com/us/app/accenture-application-for/id415321306?uo=2&mt=8&uo=2"; splitURL = sURL.split('/'); var appID = splitURL[splitURL.length - 1].match(/[0-9]*[0-9]/)[0]; document.write('<br /><strong>Link Lookup:</strong> <a href="http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/wa/wsLookup?id=' + appID + '&country=es" >Lookup</a><br />'); </script> This script takes the numeric ID and gives me 415321306. So my question is how can I do the same thing but using PHP. Best regards.

    Read the article

  • Rails Model inheritance in forms

    - by Tiago
    I'm doing a reporting system for my app. I created a model ReportKind for example, but as I can report a lot of stuff, I wanted to make different groups of report kinds. Since they share a lot of behavior, I'm trying to use inheritance. So I have the main model: model ReportKind << ActiveRecord::Base end and created for example: model UserReportKind << ReportKind end In my table report_kinds I've the type column, and until here its all working. My problem is in the forms/controllers. When I do a ReportKind.new, my form is build with the '*report_kind*' prefix. If a get a UserReportKind, even through a ReportKind.find, the form will build the 'user_report_kind' prefix. This mess everything in the controllers, since sometimes I'll have params[:report_kind], sometimes params[:user_report_kind], and so on for every other inheritance I made. Is there anyway to force it to aways use the 'report_kind' prefix? Also I had to force the attribute 'type' in the controller, because it didn't get the value direct from the form, is there a pretty way to do this? Routing was another problem, since it was trying to build routes based in the inherited models names. I overcome that by adding the other models in routes pointing to the same controller.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13  | Next Page >