Daily Archives

Articles indexed Tuesday March 16 2010

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

  • modifying a cloned element and reinserting in dom - jquery

    - by Praveen Prasad
    //dom <div id='toBeCloned'><span>Some name</span></div> <div id='targetElm'></div> //js $(function () { //creating a clone var _clone = $('#toBeCloned').clone(true); // target element var _target = $('#targetElm'); //now target element is to be filled with cloned element with data of span changed var _someData = [1, 2, 3, 4]; //loop through data $.each(_someData, function (i, data) { var _newElm = {}; $.extend(_newElm, _clone);//copy cloned to new Elm _newElm.find('span').html(data); //edit content of span alert('p'); // alert added to show that append in next line inspite of adding new element to dom just updating the previous one _target.append(_newElm);//update target }); }); expected Result: 1 2 3 4 resut iam getting is 4

    Read the article

  • login problem with ajax

    - by Amit
    i have created login page which sends ajax request to a php page for login verification. On that php page i m creating session, and sending response as per login verification. if user is authenticated i m redirecting it to home page from java script from where i send ajax. but on that homepage i cant get that session object... why? can u tell me solution to retrieve that session on home page

    Read the article

  • charts loading problem

    - by mary
    hello when we create charts in asp.net mvc is it necessary to use chart control? and if yes then at the time of deployment is it necessary to install chart control? Thank You

    Read the article

  • round off and displaying the values

    - by S.PRATHIBA
    Hi all, I have the following code: import java.io.; import java.sql.; import java.math.; import java.lang.; public class Testd1{ public static void main(String[] args) { System.out.println("Sum of the specific column!"); Connection con = null; int m=1; double sum,sum1,sum2; int e[]; e=new int[100]; int p; int decimalPlaces = 5; for( int i=0;i< e.length;i++) { e[i]=0; } double b2,c2,d2,u2,v2; int i,j,k,x,y; double mat[][]=new double[10][10]; try { Class.forName("com.mysql.jdbc.Driver"); con = DriverManager.getConnection ("jdbc:mysql://localhost:3306/prathi","root","mysql"); try{ Statement st = con.createStatement(); ResultSet res = st.executeQuery("SELECT Service_ID,SUM(consumer_feedback) FROM consumer1 group by Service_ID"); while (res.next()){ int data=res.getInt(1); System.out.println(data); System.out.println("\n\n"); int c1 = res.getInt(2); e[m]=res.getInt(2); if(e[m]<0) e[m]=0; m++; System.out.print(c1); System.out.println("\t\t"); } sum=e[1]+e[2]+e[3]+e[4]+e[5]; System.out.println("\n \n The sum is" +sum); for( p=21; p<=25; p++) { if(e[p] != 0) e[p]=e[p]/(int)sum; //I have type casted sum to get output BigDecimal bd1 = new BigDecimal(e[p]); bd1 = bd1.setScale(decimalPlaces, BigDecimal.ROUND_HALF_UP); // setScale is immutable e[p] = bd1.intValue(); System.out.println("\n\n The normalized value is" +e[p]); mat[4][p-21]=e[p]; } } catch (SQLException s){ System.out.println("SQL statement is not executed!"); } } catch (Exception e1){ e1.printStackTrace(); } } } I have a table named consumer1.After calculating the sum i am getting the values as follows mysql select Service_ID,sum(consumer_feedback) from consumer1 group by Service_ ID; Service_ID sum(consumer_feedback) 31 17 32 0 33 60 34 38 35 | 38 In my program I am getting the sum for each Service_ID correctly.But,after normalization ie while I am calculating 17/153=0.111 I am getting the normalized value is 0.I want the normalized values to be displayed correctly after rounding off.My output is as follows C:javac Testd1.java C:java Testd1 Sum of the specific column! 31 17 32 0 33 60 34 38 35 38 The sum is153.0 The normalized value is0 The normalized value is0 The normalized value is0 The normalized value is0 The normalized value is0 But,after normalization i want to get 17/153=0.111 I am getting the normalized value is 0.I want these values to be rounded off.

    Read the article

  • C array assignment and indexing with similar variable.

    - by Todd R.
    Hello! I apologize if this has been posted before. Compiling under two separate compilers, BCC 5.5 and LCC, yields 0 and 1. #include <stdio.h> int main(void) { int i = 0, array[2] = {0, 0}; array[i] = ++i; printf("%d\n", array[1]); } Am I to assume not all compilers evaluate expressions within an array from right to left?

    Read the article

  • How to configure SQLite db in Visual Studio

    - by ChrisC
    I've messed with Access a little bit in the past, had one class on OO theory, and one class on console c++ apps. Now, as a hobby project, I'm undertaking to write an actual app, which will be a database app using System.Data.SQLite and C#. I have the db's table structure planned. I have System.Data.SQLite installed and connected to VS Pro. I entered my tables and columns in VS, but that's where I'm stuck. I really don't know how to finish the db set up so I can start creating queries and testing the db structure. Can someone give me guidance to online resources that will help me learn how to get the db properly set up so I can proceed with testing it? I'm hoping for online resources specific to beginners using C# and System.Data.SQLite, but I'll use the closest I can get. Thanks.

    Read the article

  • Mod Rewrite MS Hosting Hide Long Annoying URL By displaying the short URL?

    - by NJTechGuy
    Scenario : I have a PHP Forum and a Asp.Net site hosted on Linux and MS Hosting respectively (obvious right?!). My domain ABC.com is currently configured with PHP host whereas my ASP.Net site is using the default 1and1 generated URL (s0987465.onlinehome.us). So my question is, how to display ABC.com for any URL that includes s0987465.onlinehome.us? Example : s0987465.onlinehome.us/test.aspx?id=100 should display ABC.com or ABC.com/test.aspx?id=100 in the address bar by displaying content generated by s0987465.onlinehome.us?

    Read the article

  • Faking a dynamic schema in Core Data?

    - by Gouldsc
    From reading the Apple Docs on Core Data, I've learned that you should not use Core Data when you need a dynamic schema. If I wanted to provide the user the ability to create their own properties, in a core data model would it work if I created some "dummy" attributes like "custom decimal 1", "custom decimal 2", "custom text 1", "custom text 2" etc that the user could name and use for their own purposes? Obviously this won't work for relationships, but for simple properties it seems like a reasonable workaround. Will creating a bunch of dummy attributes on my entities that go unused by most users noticeably decrease performance for them? Have any of you tried something like this? Thanks!

    Read the article

  • how to submit a from with validation in PHP?

    - by jitendra
    I want to submit this form through PHP. with validation for required field and validation for phone number and email field also <form action="" method="" id="get-protected"> <div class="row requiredRow"> <label for="txt_FirstName"> First Name</label> <input id="txt_FirstName" type="text" class="required" title="First Name. This is a required field" /> </div> <div class="row"> <label for="txt_LastName"> Last Name</label> <input id="txt_LastName" type="text" title="First Name. This is a required field" /> </div> <div class="row"> <label for="txt_Phone"> Phone</label> <input id="txt_Phone" type="text" title="First Name. This is a required field" /> </div> <div class="row requiredRow"> <label for="txt_Email"> Email</label> <input id="txt_Email" type="text" class="required" title="Email. This is a required field" /> </div> <div class="row"> <input type="submit" value="" class="button" /> </div> </form>

    Read the article

  • Getting Argument Names In Ruby Reflection

    - by Joe Soul-bringer
    I would like to do some fairly heavy-duty reflection in the Ruby programming language. I would like to create a function which would return the names of the arguments of various calling functions higher up the call stack (just one higher would be enough but why stop there?). I could use Kernel.caller go to the file and parse the argument list but that would be ugly and unreliable. The function that I would like would work in the following way: module A def method1( tuti, fruity) foo end def method2(bim, bam, boom) foo end def foo print caller_args[1].join(",") #the "1" mean one step up the call stack end end A.method1 #prints "tuti,fruity" A.method2 #prints "bim, bam, boom" I would not mind using ParseTree or some similar tool for this task but looking at Parsetree, it is not obvious how to use it for this purpose. Creating a C extension like this is another possibility but it would be nice if someone had already done it for me. Edit2: I can see that I'll probably need some kind of C extension. I suppose that means my question is what combination of C extension would work most easily. I don't think caller+ParseTree would be enough by themselves. As far as why I would like to do this goes, rather than saying "automatic debugging", perhaps I should say that I would like to use this functionality to do automatic checking of the calling and return conditions of functions. Say def add x, y check_positive return x + y end Where check_positive would throw an exception if x and y weren't positive (obviously, there would be more to it than that but hopefully this gives enough motivation)

    Read the article

  • How do I create a multi-level TreeView using F#?

    - by TwentyMiles
    I would like to display a directory structure using Gtk# widgets through F#, but I'm having a hard time figuring out how to translate TreeViews into F#. Say I had a directory structure that looks like this: Directory1 SubDirectory1 SubDirectory2 SubSubDirectory1 SubDirectory3 Directory2 How would I show this tree structure with Gtk# widgets using F#? EDIT: gradbot's was the answer I was hoping for with a couple of exceptions. If you use ListStore, you loose the ability to expand levels, if you instead use : let musicListStore = new Gtk.TreeStore([|typeof<String>; typeof<String>|]) you get a layout with expandable levels. Doing this, however, breaks the calls to AppendValues so you have to add some clues for the compiler to figure out which overloaded method to use: musicListStore.AppendValues (iter, [|"Fannypack" ; "Nu Nu (Yeah Yeah) (double j and haze radio edit)"|]) Note that the columns are explicitly passed as an array. Finally, you can nest levels even further by using the ListIter returned by Append Values let iter = musicListStore.AppendValues ("Dance") let subiter = musicListStore.AppendValues (iter, [|"Fannypack" ; "Nu Nu (Yeah Yeah) (double j and haze radio edit)"|]) musicListStore.AppendValues (subiter, [|"Some Dude"; "Some Song"|]) |> ignore

    Read the article

  • PHP function generate UL LI

    - by apis17
    hi.. i'm referring this address for function olLiTree http://stackoverflow.com/questions/753853/php-function-that-creates-a-nested-ul-li i have this array $tree = array("A"=array("B"=array("C"="C","D"="D"),"E"=array("F"="F","G"="G"))); but not able to use this function function olLiTree($tree) { echo '<ul>'; foreach($tree as $item) { if (is_array($item)) { olLiTree($item); } else { echo '<li>', $item, '</li>'; } } echo '</ul>'; } to generate <ul> <li>A</li> <li>B <ul> <li>C</li> <li>D</li> </ul> </li> <li>E <ul> <li>F </li> </ul> </li> <ul> <li>G</li> </ul> </ul> can anybody help me to fix this? thanks..

    Read the article

  • svn merge - moved repository to a different server, and now getting 'has different repository root'

    - by HorusKol
    This is kind of similar to http://stackoverflow.com/questions/1601021/subversion-merge-has-different-repository-root-than - but appears to be a very different cause (especially as the answer for that question didn't resolve my problem). A while back, we swapped out the server where our SVN repositories are located - but we've been using an alias so that the old server name points to the new server. I've been getting in the habit where I will use the new server name wherever I checkout new working copies - but we having made changes to most of the current working copies as they are live websites. Until now, this hasn't been a problem - except that this morning I merged in some changes from my development branch to a working copy I have of the release version and I got the message "file has different repository root" and the merge stops dead. I know this is because I'm using the new server name when the development branch was updated via the old server name - but is there a simple way to fix this? Or if not a simple way - is there a well-documented way to fix this?

    Read the article

  • Delphi Component Serialization

    - by Peter
    Has anyone run into issues serializing components into a file and reading them back, specifically in the area where the component vendor upgrades the VCL components. For example a file serialized with DelphiX and then years later read back with delphiY. Do the serialization formats change and if so what can be done to prevent errors reading in the componets when upgrading.

    Read the article

  • 7-Zip

    An open source compression utility that supports the new 7z format with LZMA compression and much more

    Read the article

  • The Patent War of All Against All

    <b>Brendan Scott&#8217;s Weblog:</b> "Glyn notes that the software is being licensed under a BSD licence and notes that is a good thing, but then observes that there is a patent encumbrance on the code, and indicates this is a bad thing."

    Read the article

  • Workstations cannot see new MS Server 2008 domain, but can access DHCP. (solved)

    - by Radix
    The XP Pro workstations do not see the new replacement domain upon boot; they only see their cached entry for the old (server 2003) domain controller. The old_server is not connected to the network. I have DHCP working with the same scope as the old_server. In my "before-asking" search for a solution I came across the following two articles, and I recall doing things as suggested by the articles. http://www.windowsreference.com/windows-server-2008/how-to-setup-dhcp-server-in-windows-server-2008-step-by-step-guide/ http://www.windowsreference.com/windows-server-2008/step-by-step-guide-for-windows-server-2008-domain-controller-and-dns-server-setup/ The only possible issue is: I was under the impression that the domain netbios needed to match the DC's netbios. The DC netbios is city01 while the domain's FQDN is city.domain.org (I think this is mistaken and should have been just domain.org) But, the second link led me to a post which I believe answers my question. I did as they instructed by opening Local Area Connection Properties, then selecting TCP/IPv4 and setting the sole preferred DNS server to the local hosts static IP (10.10.1.1). Search for "Your problems should clear up" for the post I'm referencing: http://forums.techarena.in/active-directory/1032797.htm Have I misunderstood their instructions? I am hoping to reach the point where I can define users and user groups. Also, does TechNet have a single theoretical overview document I could read. I really don't like treating comps as magic. I will be watching this closely and will quickly answer any questions. If I've left anything out it is because I did not know it was needed. PS: I am loath to ask obviously basic questions, but I am tired and wish to fix this before tomorrow. Also, this is my first server installation, thank you for your help.

    Read the article

  • (Android SDk 2.1) Getting error when I use setAudioSource and setVideoSource

    - by Rainfer
    I got the follow error when I run setAudioSource and setVideoSource. 03-16 10:26:25.302: ERROR/audio_input(52): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value 03-16 10:26:25.302: ERROR/audio_input(52): VerifyAndSetParameter failed 03-16 10:26:25.302: ERROR/CameraInput(52): Unsupported parameter(x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value) 03-16 10:26:25.302: ERROR/CameraInput(52): VerifiyAndSetParameter failed on parameter #0 This error happen on both emulator and the device. (I am using Google nexus one) I have set the CAMERA and RECORD_AUDIO user permission already. I spent many days but I still cannot figure out what is the cause of this runtime error.

    Read the article

  • Memory leak in Qt signal and slots

    - by Ajay
    Hello, I am running valgrind on my Qt code,and even on successful exit of the application, get the following report from valgrind 8,832 bytes in 92 blocks are still reachable in loss record 12 of 12 at 0x4025390: operator new(unsigned int) (vg_replace_malloc.c:214) ==3339== by 0x4B75F05: QMutex::QMutex(QMutex::RecursionMode) (qmutex.cpp:123) ==3339== by 0x4B77602: QMutexPool::get(void const*) (qmutexpool.cpp:137) ==3339== by 0x4CA0EC2: signalSlotLock(QObject const*) (qobject.cpp:112) ==3339== by 0x4CA3939: QMetaObjectPrivate::connect(QObject const*, int, QObject const*, int, int, int*) (qobject.cpp:2900) ==3339== by 0x4CA5C00: QObject::connect(QObject const*, char const*, QObject const*, char const*, Qt::ConnectionType) (qobject.cpp:2599) I disconnect all signal connections and also delete the objects. The above mentioned leak increases if i increase the amount of signal and slot connections? Can anybody help with this?

    Read the article

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