Daily Archives

Articles indexed Friday April 23 2010

Page 24/115 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • Problem accessing variable in a nested form partial

    - by brad
    I have a nested form in a rails view that is called like this <% f.fields_for :invoice_item_numbers do |item_no_form| %> <%= render 'invoice_item_number', :f => item_no_form %> <% end %> and the partial (_invoice_item_number.html.erb) looks like this <div class='invoice_item_numbers'> <% if f.object.new_record? %> <li><%= f.label :item_number %><%= f.text_field :item_number %> <%= link_to_function "remove", "$(this).parent().remove()", :class => 'remove_link' %></li> <% else %> <li class="inline"><%= f.label :item_number %><%= f.text_field :item_number %> </li><li class="inline"><%= f.label :description %><%= invoice_item_number.description %></li><li><%= f.label :amount %><%= f.text_field :amount %> <%= f.check_box '_destroy', :class => 'remove_checkbox' %> <%= f.label '_destroy', 'remove', :class => 'remove_label' %></li> <% end %> </div> This fails with the error message undefined method `description' for nil:NilClass Why does invoice_item_number return a nil object in this partial? It is obviously being defined somehow because if I change it to something else (e.g. item_number.description then the error message becomes undefined local variable or methoditem_number' for #instead. The invoice_item_number object that is being displayed by this partial is being used perfectly well by the form helpers as<%= f.text_field :item_number %and<% f.text_field :amount %both work perfectly well. I have tried a number of solutions such as using@invoice_item_number` and explicitly defining an object in the render method but these have not worked. Presumably there is a very simple answer to this.

    Read the article

  • c# HTTPListener encoding issue

    - by Rob Griffin
    I have a Java application sending HTTP requests to a C# application. The C# app uses HTTPListener to listen for requests and respond. On the Java side I'm encoding the URL using UTF-8. When I send a \ character it gets encoded as %5C as expected but on the C# side it becomes a / character. The encoding for the request object is Windows-1252 which I think may be causing the problem. How do I set the default encoding to UTF-8? Currently I'm doing this to convert the encoding: foreach (string key in request.QueryString.Keys) { if (key != null) { byte[] sourceBytes =request.ContentEncoding.GetBytes(request.QueryString[key]); string value = Encoding.UTF8.GetString(sourceBytes)); } } This handles the non ASCII characters I'm also sending but doesn't fix the slash problem. Examining request.QueryString[key] in the debugger shows that the / is already there.

    Read the article

  • What's a good video upload storage solution?

    - by Nikko
    What's a good video upload storage solution? I'm trying to find a way to offload bandwidth to another storage solution (something like S3), but at the same time, also trying to find a solution which is geared for video storage. Are there any solutions out there for this? Or should I just use S3? Thanks!

    Read the article

  • sort items based on their appears count

    - by ANIL MANE
    Hello Experts, I have data like this d b c a d c b a b c a c a d c if you analyse, you will find the appearance of each element as follows a: 4 b: 3 c: 5 d: 2 According to appearance my sorted elements would be c,a,b,d and final output should be c b d a d c b a b c a c a d c Any clue, how we can achieve this using sql query ?

    Read the article

  • Global Temporary Table "On commit delete rows" functionality discrepancy.

    - by TomatoSandwich
    I have a global temporary table. I called my GTT, for that was it's initials. My GTT never hurt anyone, and did everything I bade of it. I asked my GTT to delete rows on commit. This is a valid function in the creation script of my GTT in oracle. I wanted to be able to have different users see GTT with their own data, and not the data of other people's sessions. 'Delete rows on commit' worked perfectly in our test environment. GTT and I were happy. But then, I deployed GTT as part of an update to functionality to a client's database. The database doesn't like to play well with GTT. GTT called me up all upset and worried, because it wasn't holding any data any more, and didn't know why. GTT told me that if someone did: insert into my_GTT (description) values ('Happy happy joy joy') he would sing-song back: 1 row inserted. However, if the same person tried select * from my_GTT; GTT didn't know what to do, and he replied 0 rows returned. GTT was upset that he didn't know what his playmate had inserted. Please, Stackoverflow, why would GTT forget what was placed into him? He can remember perfectly well at home, but out in the cold harsh world, he just gets so scared. :(

    Read the article

  • MonoTouch & C# VS Objective C for iphone app

    - by Eyla
    Greeting, I'm a C# programmer guy. I'm planning to start developing app for iphone but I'm not sure if I should use C# under MonoTouch or just use the native language for iphone OS Objective C. Is there a different to program for iphone app using C# or Objective C? Is there limitation using C# to program app for iphone or it can do as much as Objective C can do to develop iphone app?

    Read the article

  • ssh permission denied

    - by Gitmo
    I am trying to ssh into a remote machine and I get the following debug messages: debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to xxx.xxx.x.xx [xxx.xxx.xx.x] port 22. debug1: Connection established. debug3: Not a RSA1 key file /home/hadoop/.ssh/id_rsa. debug2: key_type_from_name: unknown key type '-----BEGIN' debug3: key_read: missing keytype debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug2: key_type_from_name: unknown key type '-----END' debug3: key_read: missing keytype debug1: identity file /home/hadoop/.ssh/id_rsa type 1 debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048 debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-6ubuntu2 debug1: match: OpenSSH_5.1p1 Debian-6ubuntu2 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.1p1 Debian-6ubuntu2 debug2: fd 3 setting O_NONBLOCK debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,[email protected],zlib debug2: kex_parse_kexinit: none,[email protected],zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,[email protected] debug2: kex_parse_kexinit: none,[email protected] debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_setup: found hmac-md5 debug1: kex: server->client aes128-cbc hmac-md5 none debug2: mac_setup: found hmac-md5 debug1: kex: client->server aes128-cbc hmac-md5 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug2: dh_gen_key: priv key bits set: 128/256 debug2: bits set: 511/1024 debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug3: check_host_in_hostfile: filename /home/hadoop/.ssh/known_hosts debug3: check_host_in_hostfile: match line 20 debug1: Host '192.168.1.63' is known and matches the RSA host key. debug1: Found key in /home/hadoop/.ssh/known_hosts:20 debug2: bits set: 511/1024 debug1: ssh_rsa_verify: signature correct debug2: kex_derive_keys debug2: set_newkeys: mode 1 debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: /home/hadoop/.ssh/id_rsa (0x241c110) debug1: Authentications that can continue: publickey,password debug3: start over, passed a different list publickey,password debug3: preferred gssapi-keyex,gssapi-with-mic,gssapi,publickey,keyboard-interactive debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering public key: /home/hadoop/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey,password debug2: we did not send a packet, disable method debug1: No more authentication methods to try. Permission denied (publickey,password). What seems to be the problem?? I have tried everything, this is driving me nuts.

    Read the article

  • [PHP-GD] Background transperancy in imagerotate()

    - by KPL
    Hello people, Since last 2 days, I was trying to add transperancy to the background after rotating an image using imagerotate() PHP-GD function. But, to my great disappointment, it's not working at all. It's just giving out a black background behind it. Here's my code - $patchImageS = 'image.png'; // the image to be patched over the final bg $patchImage = imagecreatefrompng($patchImageS); // resource of image to be patched $patchImage = imagerotate($patchImage, 23, 0, 0); imagepng($patchImage,'tt.png'); I tried to change the parameters being passed in function to imagerotate($patchImage, 23, 5, 0); imagerotate($patchImage, 23, 0, 5); Any help would be highly appreciated.

    Read the article

  • How do I use Ruby metaprogramming to refactor this common code?

    - by James Wenton
    I inherited a project with a lot of badly-written Rake tasks that I need to clean up a bit. Because the Rakefiles are enormous and often prone to bizarre nonsensical dependencies, I'm simplifying and isolating things a bit by refactoring everything to classes. Specifically, that pattern is the following: namespace :foobar do desc "Frozz the foobar." task :frozzify do unless Rake.application.lookup('_frozzify') require 'tasks/foobar' Foobar.new.frozzify end Rake.application['_frozzify'].invoke end # Above pattern repeats many times. end # Several namespaces, each with tasks that follow this pattern. In tasks/foobar.rb, I have something that looks like this: class Foobar def frozzify() # The real work happens here. end # ... Other tasks also in the :foobar namespace. end For me, this is great, because it allows me to separate the task dependencies from each other and to move them to another location entirely, and I've been able to drastically simplify things and isolate the dependencies. The Rakefile doesn't hit a require until you actually try to run a task. Previously this was causing serious issues because you couldn't even list the tasks without it blowing up. My problem is that I'm repeating this idiom very frequently. Notice the following patterns: For every namespace :xyz_abc, there is a corresponding class in tasks/... in the file tasks/[namespace].rb, with a class name that looks like XyzAbc. For every task in a particular namespace, there is an identically named method in the associated namespace class. For example, if namespace :foo_bar has a task :apples, you would expect to see def apples() ... inside the FooBar class, which itself is in tasks/foo_bar.rb. Every task :t defines a "meta-task" _t (that is, the task name prefixed with an underscore) which is used to do the actual work. I still want to be able to specify a desc-description for the tasks I define, and that will be different for each task. And, of course, I have a small number of tasks that don't follow the above pattern at all, so I'll be specifying those manually in my Rakefile. I'm sure that this can be refactored in some way so that I don't have to keep repeating the same idiom over and over, but I lack the experience to see how it could be done. Can someone give me an assist?

    Read the article

  • Change imported Dll name ?

    - by Rajakumar
    hi to all , In a Portable-Executable ,we can change the imported dll name ,by editing PE file , here , i had changed in one imported dll name of application exe,that time it changed normally ....e.g advapi32.dll to ^dvapi32.dll ,so here system32 or any other PATH location doesnt have ^dvapi32.dll ..this time simply i changed the real advapi32.dll into ^dvapi32.dll and put in the application directory ,this time its work fine ....but when i am trying with ntdll & gdi32.dll ,it doesnt supported ,i cant resolve the problem ,pls help me towards the problem ..thanks.

    Read the article

  • deleting records from multiple tables at a time with a single query in sqlserver2005

    - by sudhavamsikiran
    Hi I wanna delete records from child tables as well as parent table with in a single query. please find the query given below. here response header is the primary table and responseid is the primary key. DELETE FROM responseheader FROM responseheader INNER JOIN responsepromotion ON responseheader.responseid = responsepromotion.ResponseID INNER JOIN responseext ON responsepromotion.ResponseID=responseext.ResponseID WHERE responseheader.responseid In ('67D8B9E8-BAD2-42E6-BAEA-000025D56253') but its throwing error . can any one help me to find out the correct query

    Read the article

  • Where can I learn about JNDI strings?

    - by ferrari fan
    How do you know how to form a JNDI string? I know there must be a format and that the divisions must mean something but I haven't been able to find a good resource that explains them. For example: java:comp/env/wm/default. This is supposed to connect to a WorkManager in Websphere with the name of default. But what does the "java", "comp", "env" mean? I know what the wm/default mean because that's the JNDI name put in the WorkManager, but what does the rest mean? Thanks

    Read the article

  • How to download file from particular url???

    - by greshi gupta
    NSURL * url = @"http://192.168.100.161/UploadWhiteB/wh.txt"; NSData * data = [NSData dataWithContentsOfURL:url]; if (data != nil) { NSLog(@"\nis not nil"); NSString *readdata = [[NSString alloc] initWithContentsOfURL:(NSData *)data ]; I write this code to download a file from given url... but i get an error on line NSData * data = [NSData dataWithContentsOfURL:url]; uncaught exception....so please help me out..

    Read the article

  • Extract item in a list if Contains returns true

    - by Matt
    I have two lists A and B, at the beginning of my program, they are both filled with information from a database (List A = List B). My program runs, List A is used and modified, List B is left alone. After a while I reload List B with new information from the database, and then do a check with that against List A. foreach (CPlayer player in ListA) if (ListB.Contains(player)) ----- Firstly, the object player is created from a class, its main identifier is player.Name. If the Name is the same, but the other variables are different, would the .Contains still return true? Class CPlayer( public CPlayer (string name) _Name = name At the ---- I need to use the item from ListB that causes the .Contains to return true, how do I do that?

    Read the article

  • jquery post and get request different on local intranet and live server

    - by nccsbim071
    Hi, I have been developing an asp.net mvc application where i need to make large amounts of jquery post and get request to call controller methods and get back json result. Everything is working fine. The problem is i had to write different jquery post and get request url on local intranet(deployed by making virtual directory) and live server. the current jquery request url is given as below: $.post("/ProjectsChat/GetMessages", { roomId: 24 },.......... now this format of url for jquery request works fine for live server but not for local intranet. Since on local intranet i have made a virtual directory. It only works when i append the name of the virtual directory like this "$.post("MyProjectVirutalDirName/ProjectsChat..................." I am sure most of you must have come across same problem. now i have made a full project, there are large number of jquery requests made, i want to test the application by deploying on local intranet and fix the bugs. Changing all the jquery requests for local intranet doesn't seem feasible solution to me, i am really in a big problem, i can't deploy the same project on live server just like that and test it there, client will kill me. I need some expert advice. Please help Thanks

    Read the article

  • Sending POST variables through a PHP proxy for AJAX?

    - by b. e. hollenbeck
    I've decided that using a PHP proxy for AJAX calls for a project is the best way to go - but I have a question regarding passing POST data through the proxy. As in - how to do it. Should I need to create a single variable in the javascript using alternate characters, then have the PHP proxy parse and modify the variable to reassemble a valid HTTP request? Or is there some means of passing along the $_POST array in new request to the external server by pulling the data out of the headers and re-sending it?

    Read the article

  • Ajax Autocompleteextender not showing the autocompletelist to choose

    - by subash
    i was working ajax auto completeextender witha text box in asp.net and c#.net. i am not able to get list to choose ,i have the appropriate web service method called..can anyone guide me to get the automo complete done. <form id="form1" runat="server"> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager> <div> <asp:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="TextBox1" ServiceMethod="GetCompletionList" ServicePath="AutoComplete.asmx" MinimumPrefixLength="0" CompletionInterval="50" EnableCaching="true" CompletionSetCount="1" DelimiterCharacters=";, :" ShowOnlyCurrentWordInCompletionListItem="true"> </asp:AutoCompleteExtender> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </div> </form> and the web service method contains the following code [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] [ScriptService] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService] public class AutoComplete : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { return "Hello World"; } [WebMethod] public string[] GetCompletionList(string prefixText, int count) { List<string> responses = new List<string>(); for (int i = 0; i < count; i++) responses.Add(prefixText + (char)(i + 65)); return responses.ToArray(); } }

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >