Daily Archives

Articles indexed Thursday January 13 2011

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

  • External URL re direction issue IN Rails 2

    - by Rcoder
    I have a requirement where in I want to redirect to an external Url Here is my code in routes.rb map.connect "/myapp/:someparam" , :controller = "foocontroller" , :action = "redirect_to_external_url" In my foo controller i have this action def redirect_to_external_url redirect_to "http://externalurl.com/#{params[:someparam]}.html" end which will redirect to the external url The problem That I am facing is After redirecting, The browser shows "http://externalurl.com/bar.html whereas I want the browser to show "/myapp/bar" url (ex http://mydomain.com/myapp/bar) for seo purpose. Any idea on how this can be achieved in rails ? The Rails version that I am using is 2.3.4

    Read the article

  • How to search for a string including spaces in Objective C?

    - by AlexCu
    I have a real basic command-line program, in Objective-C, that searches for user inputed information. Unfourtunately, the code will only read the first word in series of words that the user enters. For example, if the user enters in "Apples are great", only "Apples" is kept (and hence searched later on), excluding the "are great" part of the sentence. Here's what I have so far: char enteredQuery [128]; // array 'name' to hold the scanf string NSString *searchQuery; // ending NSString to hold and compare the user inputed data NSLog(@"Enter search query:"); scanf("%s", enteredQuery); //will read the next line searchQuery = [NSString stringWithCString: enteredQuery encoding: NSASCIIStringEncoding]; //converts scanf data into a NSString type I know it's got to do with me using scanf or the character-encoder conversion, but I can't seem to figure it out. Any help in solving the problem is very appreciated! Thanks.

    Read the article

  • Sort string based upon the count of characters Options

    - by prp
    Sample Data : input : "abcdacdc" Output : "cadb" here we have to sort strings in order of count of characters. If the count is same for characters. maintain the original order of the characters from input string. my approach: i have used array of 26 for maintaining occurrence of all characters and sort it then print it.But while doing so i am not able to maintain order in case if two characters have same count. please suggest any improvement or any other algo.

    Read the article

  • Is it Possible to Query Multiple Databases with WCF Data Services?

    - by Mas
    I have data being inserted into multiple databases with the same schema. The multiple databases exist for performance reasons. I need to create a WCF service that a client can use to query the databases. However from the client's point of view, there is only 1 database. By this I mean when a client performs a query, it should query all databases and return the combined results. I also need to provide the flexibility for the client to define its own queries. Therefore I am looking into WCF Data Services, which provides the very nice functionality for client specified queries. So far, it seems that a DataService can only make a query to a single database. I found no override that would allow me to dispatch queries to multiple databases. Does anyone know if it is possible for a WCF Data Service to query against multiple databases with the same schema?

    Read the article

  • facebook connect error

    - by coure06
    I am getting error but empty statusText, here is my code var ajaxUrl = 'https://graph.facebook.com/me?access_token=' + accessToken $.ajax({ url: ajaxUrl, dataType: 'json', success: function(user){ alert('h'); }, error: function(xhr, ajaxOptions, thrownError){ alert(xhr.statusText); } });

    Read the article

  • Ubuntu VM Guest - Samba Service Not Accessible from VM Host via Hostname

    - by phalacee
    I have a Windows 7 Workstation with a Ubuntu 10.10 VM running in Virtual Box 3.2.12 r68302. I recently updated Samba and winbind, and since the update, I am unable to access the machine via it's hostname (\mystique) from the VM Host. I can access it by the "Host-only" IP (\192.168.56.101) and the DHCP Assigned IP address (\10.1.1.20) and I can connect to the webserver on the machine via it's hostname (http://mystique/). As stated, accessing this machine via it's hostname worked fine prior to the update, but has since stopped working. I have added the hostname to the smb.conf for the netbios name, to no avail. My smb.conf [global] section looks like this: workgroup = NETWORK netbios name = Mystique server string = %h server (Samba, Ubuntu) dns proxy = no log file = /var/log/samba/log.%m max log size = 1000 syslog = 0 panic action = /usr/share/samba/panic-action %d encrypt passwords = true passdb backend = tdbsam obey pam restrictions = yes unix password sync = yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . pam password change = yes map to guest = bad user usershare allow guests = yes

    Read the article

  • windows 7 update freeze - what to do?

    - by Tom Tom
    Hi, yesterday I shuted down my notebook and windows 7 Ultimate started to install the automatic update. After one hour I noticed that the update is still running. I thought ok, I go to sleep and let it run. In the morning it was still running. Thus I thought it is crashed. Forced a shut-down of the notebook, and restarted it. With the same effect that the notebook is "freezing" at "Install Update 1 of 5". It does not look like whether it is chrased. The progress wheel is still moving. But it does not make any progres.. Thus somehow like crashed. Would appreciate any help! Edit: Ok was able to log-in in "save" (german: abgesicherter) mode. This way I passed to install update screen. I do not want to generally disable updates. What can I do to not install the last update, which is creating troube. Or how can I find out whats the problem with the last update? Edit2: Ok starting in save mode and finally installing the updates manually solved the problem.

    Read the article

  • Restore monitor detection to one only or restore start menu to bottom

    - by Mark
    I have a co-worker that is no longer able to see his start menu. He used to have it pinned to the left edge of his screen. I tried to troubleshoot it a bit and discovered if we do Windows + R then "cmd" [enter] the command prompt opens (but we don't see the start menu or run box), meaning the start menu is somewhere, just off screen. Restarting doesn't help. Is there some way to force Windows to think it only has a single monitor? It seems to "think" it has two but there's only one and we can get the Start menu back. Or, is there a way to restore the start menu to the bottom? Additional info We are able to right-click the desktop for display settings, etc. We can also get into Windows Explorer (via Ctrl + E) so if we need any of that to restore settings we can do it.

    Read the article

  • Apprentissage de PySide, le binding Qt de Nokia pour Python, un article de Charles-Elie Gentil

    Bonjour, Vous trouverez ci-dessous le lien vers un tutoriel destiné à aider le programmeur Python à l'apprentissage de PySide, le binding Qt de Nokia pour Python. Il part de la présentations des widgets de bases jusqu'à la conception d'un programme minimaliste. Bonne lecture à tous et n'hésitez pas à poster vos commentaires. Apprentissage de PySide, le binding Qt de Nokia pour Python et création d'une première application...

    Read the article

  • Latest DSTv15 Timezone Patches Available for E-Business Suite

    - by Steven Chan
    If your E-Business Suite Release 11i or 12 environment is configured to support Daylight Saving Time (DST) or international time zones, it's important to keep your timezone definition files up-to-date. They were last changed in July 2010 and released as DSTv14. DSTv15 is now available and certified with Oracle E-Business Suite Release 11i and 12. Is Your Apps Environment Affected?When a country or region changes DST rules or their time zone definitions, your Oracle E-Business Suite environment will require patching if:Your Oracle E-Business Suite environment is located in the affected country or region ORYour Oracle E-Business Suite environment is located outside the affected country or region but you conduct business or have customers or suppliers in the affected country or region We last discussed the DSTv14 patches on this blog. The latest "DSTv15" timezone definition file is cumulative and includes all DST changes released in earlier time zone definition files. DSTv15 includes changes to the following timezones since the DSTv14 release:Africa/Cairo 2010 2010Egypt 2010 2010America/Bahia_Banderas 2010 2010Asia/Amman 2002Asia/Gaza 2010 2010Europe/Helsinki 1981 1982Pacific/Fiji 2011Pacific/Apia 2011Hongkong 1977 1977Asia/Hong_Kong 1977 1977Europe/Mariehamn 1981 1982

    Read the article

  • Can I toggle word-wrapping on/off quickly in Gedit?

    - by Ivan
    Depending on nature of the text, some times line wrapping is convenient, some times it is just confusing. And every time I need to switch this (pretty frequently) I have to do to View - Preferences - Enable text wrapping - Close - 4 clicks, not mentioning all the hand, eye and thought motion. Can this be done a quicker way? Most of text editors have this 2 clicks away (in a menu) at maximum, some have it on a toolbar or a hot key, but I couldn;t find any quick way in Gedit :-( Maybe there is a hot key I don't know?

    Read the article

  • PHP get all function arguments as $key => $value array?

    - by web lover
    <?php function register_template(){ print_r(func_get_args()); # the result was an array ( [0] => my template [1] => screenshot.png [2] => nice template .. ) } register_template( # unkown number of arguments $name = "my template", $screenshot = "screenshot.png", $description = "nice template .. " ) ?> BUT , I want the result array as $key = $value form , $key represents the parameter name.

    Read the article

  • JSLINT error: Move all 'var' declarations to the top of the function.

    - by Oleg Yaroshevych
    JSLINT site updated, and I cannot check JS scripts anymore. For me, this warning is not critical, and I don't want to go through thousands of lines to fix this, I want to find more critical problems. Does anybody know how to turn off this error, or use legacy JSLINT? UPDATE Example: function doSomethingWithNodes(nodes){ this.doSomething(); for (var i = 0; i < nodes.length; ++i){ this.doSomethingElse(nodes[i]); } doSomething(); // want to find this problem } jslint.com output: Error: Problem at line 4 character 8: Move all 'var' declarations to the top of the function. for (var i = 0; i < nodes.length; ++i){ Problem at line 4 character 8: Stopping, unable to continue. (44% scanned). Problem: Having variables on top of the functions is new requirement. I cannot use JSLINT to test code, because it stops scanning script on this error. I have a lot of code, and do not want to threat this warning as critical error.

    Read the article

  • Publish to Current user's wall using FBJS in FBML application

    - by Damodaran
    Hi I need to publish some message to the current user's wall using FBJS in FBML application. When I use window.fbAsyncInit = function() { FB.init({appId: 'MY_APP_ID', status: true, cookie: true, xfbml: false}); }; i am getting an error :- FB is not defined. and window is not defined. For publishing i am using this code function graphStreamPublish(){ var body = document.getElementById("txtTextToPublish").value; FB.api('/me/feed', 'post', { message: body }, function(response) { if (!response || response.error) { // alert('Error occured'); } else { // alert('Post ID: ' + response.id); } }); } (I cannot use alert in facebook..) Thanks in advance..

    Read the article

  • iPad search bar bad memory access?

    - by Geoff Baum
    Hello all, So I am trying to implement a search bar in my app and am very close but can't seem to figure out where this memory error is occurring. This is what part of my search method looks like: filters = [[NSMutableArray alloc] init]; NSString *searchText = detailSearch.text; NSMutableArray *searchArray = [[NSMutableArray alloc] init]; // Normally holds the object (ex: 70 locations) searchArray = self.copyOfFilters ; //This is the line that is breaking after ~2-3 letters are entered in the search for (NSString *sTemp in searchArray) { NSRange titleResultsRange = [sTemp rangeOfString:searchText options:NSCaseInsensitiveSearch]; if (titleResultsRange.length > 0) [filters addObject:sTemp]; } displayedFilters = filters; copyOfFilters is a deep copy of the displayed filters that appear when the view first loads via: self.copyOfFilters = [[NSMutableArray alloc] initWithArray:displayedFilters copyItems:YES]; I have traced through the entry of letters and it is accurate after 2 letters, but once you try and enter a letter after a space in the search bar, it crashes. The value of copyOfFilters = {(int)[$VAR count]} objects. Does anyone know what may be causing this? Thanks!

    Read the article

  • Saving file to phone in stead of SD-card

    - by Galip
    Hi guys, In my app I save an XML file to the users SD-card by doing File newxmlfile = new File(Environment.getExternalStorageDirectory() + "/Message.xml"); But not all users have SD-cards in their phone and therefore my app is likely to crash. How must I change my File creating method in order to save the file to the phone's memory instead of the SD-card? Also, how must I change the loading of the file? (currently: new InputSource(new FileInputStream(Environment.getExternalStorageDirectory() + "/Message.xml")))

    Read the article

  • multiple C++ deletion of a memory pointed by multiple objects

    - by elgcom
    Another c++ pointer deletion question is in the following example: class Foo { public: int *p; ~Foo() { delete p; p = NULL; } }; Foo *f1 = new Foo(); Foo *f2 = new Foo(); f1->p = new int(1); f2->p = f1->p; delete f2; // ok delete f1; // no error? Why I did not get error when calling "delete f1"? didn't I delete the same address (*p) twice? If I directly delete the pointers in the last 2 lines of code, I will get error. delete f2->p; // ok delete f1->p; // error!! *** glibc detected *** double free or corruption (fasttop) ***

    Read the article

  • What's a good way to throw and handle events in PHP?

    - by techexpert
    Hi everyone, I am just trying to get a general idea about the event prcessing mechanism in PHP5 in as neat way as possible. First of all I understand that a PHP application is not exactly a persistent type, so the events may not make a lot of sense, but from the OO perspective it might be a very elegant way to "communicate" between the objects. So I am thinking that it would make sense to separate the events on the external events, such as $_POST & $_GET and the internal ones, i.e. function callbacks. As far as the external ones, is it a good idea to process the $_GETs and $_POSTs directly, or is it better to wrap them into an event of some sort? Also, in order to process the internal events, do you have to pass the reference to the event handler/dispatcher to each class so they know how to throw them? I was thinking to use the PEAR EventDispatcher to do the work, but I am open to other suggestions. Thank you!

    Read the article

  • Android: duplicate items in ListVew. Maybe getView() called too many times?

    - by gonzobrains
    Hi, I am trying to create a simple program which displays a "shopping cart" list of items, along with a few buttons below it to manage the cart. The biggest problem is that items are getting duplicate entries in the list view. That is, for every item I want to enter I see it appear two times in the list view. What's the problem? Also, the scrollable area of my cart is not big enough. How do I set it so that it is bigger but I can still see my buttons? Perhaps I should put the buttons above the cart? Here is my shopping cart's layout XML: Here is the layout for individual row items: <LinearLayout android:orientation="vertical" android:layout_width="0dip" android:layout_weight="1" android:layout_height="fill_parent"> <TextView android:id="@+id/BookTitle" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:singleLine="true" android:gravity="center_vertical" / <TextView android:id="@+id/BookPrice" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:singleLine="true" android:ellipsize="marquee" / Thanks, gb

    Read the article

  • How to setup/calculate texturebuffer in glTexCoordPointer when importing from OBJ-file

    - by JohnMurdoch
    Hi all, I'm parsing an OBJ-file in Android and my goal is to render & display the object. Everything works fine except the correct texture mapping (importing the resource/image into opengl etc works fine). I don't know how to populate the texture related data from the obj-file into an texturebuffer-object. In the OBJ-file I've vt-lines: vt 0.495011 0.389417 vt 0.500686 0.561346 and face-lines: f 127/73/62 98/72/62 125/75/62 My draw-routine looks like (only relevant parts): gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glEnableClientState(GL10.GL_NORMAL_ARRAY); gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY); gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer); gl.glNormalPointer(GL10.GL_FLOAT, 0, normalsBuffer); gl.glTexCoordPointer(2, GL10.GL_SHORT, 0, t.getvtBuffer()); gl.glDrawElements(GL10.GL_TRIANGLES, t.getFacesCount(), GL10.GL_UNSIGNED_SHORT, t.getFaceBuffer()); Output of the counts of the OBJ-file: Vertex-count: 1023 Vns-count: 1752 Vts-count: 524 ///////////////////////// Part 0 Material name:default Number of faces:2037 Number of vnPointers:2037 Number of vtPointers:2037 Any advise is welcome.

    Read the article

  • How come (a_method || :other) returns :other only when assigning to a var called a_method?

    - by Paul Annesley
    Given the following method: def some_method :value end The following statements work as I would expect: some_method || :other # => :value x = some_method || :other # => :value But the behaviour of the following statement perplexes me: some_method = some_method || :other # => :other It creates a local variable called some_method as expected, and subsequent calls to some_method return the value of that local variable. But why does it assign :other rather than :value? I understand that it's probably not a smart thing to do, and can see how it might be ambiguous, but I thought the right-hand-side of the assignment should be evaluated prior to the assignment being considered... I've tested this in Ruby 1.8.7 and Ruby 1.9.2 with identical results. Cheers! Paul

    Read the article

  • Wavefront obj loader iphone materials problem

    - by Magda
    Hi! I use Bill Duney wavefront obj loader. I'm new in opengles and it was really helpful. unfortunately... I exported a revit file to dwg and then open it with blender/google sketchUp and then to wavefront obj. Next, add my files to your loader and got strange results. The project load correctly vertex and normals but does a strange results with materials (I use only material, without textures). The one file is loaded with some materials on different faces the other, doesn't load materials but after a click makes the model green. If you have a minute and could help me out, please. I uploaded the project here. http://www.sendspace.pl/file/ecd348a3674ed1fe6eb10e5 Thanks for answering, Magda

    Read the article

  • ModalPopupExtender OnShow Event

    - by Thomas
    When clicking a button, I have a ModalPopupExtender (Panel) that gets displayed. I can't seem to trigger any event during that process. Adding an event to the button that opens the ModalPopupExtender doesnt work, as it never triggers. Adding the button as a trigger in my UpdatePanel also doesnt work. Scenario: I have a gridview with a button outside of the gridview. Clicking the button opens up a ModalPopupExtender which needs to display the checkboxes clicked on the gridview. I have the code to get the checkboxes clicked on the Gridview, however I cant seem to use an event during the process of opening the ModalPopupExtender.

    Read the article

  • Binary serialization/de-serialization in C++ and C#

    - by 6pack kid
    Hello. I am working on a distributed application which has two components. One is written in standard C++ (not managed C++) and the other one is written in C#. Both are communicating via a message bus. I have a situation in which I need to pass objects from C++ to C# application and for this I need to serialize those objects in C++ and de-serialize them in C# (something like marshaling/un-marshaling in .NET). I need to perform this serialization in binary and not in XML (due to performance reasons). I have used Boost.Serialization to do this when both ends were implemented in C++ but now that I have a .NET application on one end, Boost.Serialization is not a viable solution. I am looking for a solution that allows me to perform (de)serialization across C++ and .NET boundary i.e., cross platform binary serialization. I know I can implement the (de)serialization code in a C++ dll and use P/Invoke in the .NET application, but I want to keep that as a last resort. Also, I want to know if I use some standard like gzip, will that be efficient? Are there any other alternatives to gzip? What are the pros/cons of them? Thanks

    Read the article

  • Textures in Opengl ES 2 not working properly

    - by Adl
    Hi! I'm working with Opengl ES 2 on iphone and right now I am trying to get my textures working on my objects. I'm using .obj files and all the data in them are correct. I have written a parser myself to retrieve all data, I convert it to static arrays in C. I discard the material properties for now, only getting the image path from the .mtl files manually. I have an object with 336 triangles, making this non-trivial to observe, with appertaining vertices, vertex faces and texture coordinates (u,v). Passing all data into the shaders, the resulting image is this: http://img530.imageshack.us/img530/9637/pic1io.png http://img404.imageshack.us/img404/7358/pic2pg.png But it should look like this (Displaying it in an object viewer). Please ignore the material properties. http://img16.imageshack.us/img16/1401/pic3cq.png Using this image as a texture: http://img217.imageshack.us/img217/1300/shirtdiffuse.png I'm thinking it might have to do with texture coordinate faces ? It is defined in my .obj file, and I'm not using them at all. In books and tutorials I have not found anything concerning this. Regards Niclas

    Read the article

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