Search Results

Search found 205 results on 9 pages for 'siblings'.

Page 4/9 | < Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >

  • How to implement a category hierarchy using collections

    - by Luke101
    Hello, I have about 200 categories that are nested. I am currently reading the documention on the C5 generics library. I am not sure if the C5 library is overkill or not. I am looking at converting all my custom algorithms to the C5 implemention. This is what I need. If a certain category is chosen i need to find its parents, siblings, direct children, and all children. This is the way I have it set up. To find the: Parents: I start from the current location then loop through the list and find the current parent. When I find the parent I loop through the whole list again to find the next parent and so on. Siblings: I loop through the whole list and find all the nodes that have the same parent as the choosen node. direct children: I loop through the whole list and find all nodes that is a parent of the choosen node. All Children: This one took me a while to figure out. But I used recursion to find all children of the choosen node. Is there a better way to implement something like this?

    Read the article

  • jquery fail to retrieve accurate data from sibling field.

    - by i need help
    wonder what's wrong <table id=tblDomainVersion> <tr> <td>Version</td> <td>No of sites</td> </tr> <tr> <td class=clsversion>1.25</td> <td><a id=expanddomain>3 sites</a><span id=spanshowall></span></td> </tr> <tr> <td class=clsversion>1.37</td> <td><a id=expanddomain>7 sites</a><span id=spanshowall></span></td> </tr> </table> $('#expanddomain').click(function() { //the siblings result incorrect //select first row will work //select second row will no response var versionforselected= $('#expanddomain').parent().siblings("td.clsversion").text(); alert(versionforselected); $.ajax({ url: "ajaxquery.php", type: "POST", data: 'version='+versionforselected, timeout: 900000, success: function(output) { output= jQuery.trim(output); $('#spanshowall').html(output); }, }); });

    Read the article

  • jQuery toggle menu dropdown

    - by Seong Lee
    I am working on a menu navigation that has parent horizontal bar as static and a vertical accordion child menu that interacts with the parent. I have them working fine except one part where I want to toggle show() and hide() child menu when clicked on the same parent menu item. I've looked at toggle() jQuery API but couldn't get it working properly. The following is only a script for parent part which I got rid of toggle() for now. $(function () { $('#mainMenu > ul > li > a').click(function () { $('#mainMenu li').removeClass('active'); $(this).closest('li').addClass('active'); if ($(this).text() == "1st click") { $('#subMenu > ul').siblings().hide(); $('#subMenu > ul:nth-child(1)').show(); } else if ($(this).text() == "2nd click") { $('#subMenu > ul').siblings().hide(); $('#subMenu > ul:nth-child(2)').show(); } }); }); The Full code that isolates the problem is available here

    Read the article

  • Array length is zero in jQuery.

    - by James123
    I wrote like this. After submit click loop is not excuting. But I saw value are there, But array lenght is showing '0'. (Please see picture). Why it is not going into loop? and $('#myVisibleRows').val(idsString); becoming 'empty'. $(document).ready(function() { $('tr[@class^=RegText]').hide().children('td'); var list_Visible_Ids = []; var idsString, idsArray; alert($('#myVisibleRows').val()); idsString = $('#myVisibleRows').val(); idsArray = idsString.split(','); $.each(idsArray, function() { if (this != "") { $('#' + this).siblings(('.RegText').toggle(true)); window['list_Visible_Ids'][this] = 1; } }); $('tr.subCategory1') .css("cursor", "pointer") .attr("title", "Click to expand/collapse") .click(function() { //this = $(this); $(this).siblings('.RegText').toggle(); list_Visible_Ids[$(this).attr('id')] = $(this).css('display') != 'none' ? 1 : null; alert(list_Visible_Ids[$(this).attr('id')]) }); $('#form1').submit(function() { idsString = ''; $.each(list_Visible_Ids, function(key, val) { alert(val); if (val) { idsString += (idsString != '' ? ',' : '') + key; } }); $('#myVisibleRows').val(idsString); form.submit(); }); });

    Read the article

  • jQuery validation plugin: valid() does not work with remote validation ?

    - by a-dilla
    I got started by following this awesome tutorial, but wanted to do the validation on on keyup and place my errors somewhere else. The remote validation shows its own error message at the appropriate times, making me think I had it working. But if I ask specifically if a field with remote validation is valid, it says no, actually, its not. In application.js I have this... $("#new_user").validate({ rules: { "user[login]": {required: true, minlength: 3, remote: "/live_validations/check_login"}, }, messages: { "user[login]": {required: " ", minlength: " ", remote: " "}, } }); $("#user_login").keyup(function(){ if($(this).valid()){ $(this).siblings(".feedback").html("0"); }else{ $(this).siblings(".feedback").html("1"); } }) And then this in the rails app... def check_login @user = User.find_by_login(params[:user][:login]) respond_to do |format| format.json { render :json => @user ? "false" : "true" } end end I think that my problem might have everything to do with this ticket over at jQuery, and tried to implement that code, but, being new to jQuery, it's all a bit over my head. When I say bit, I mean way way. Any ideas to fix it, or a new way to look at it, would be a big help.

    Read the article

  • Ubuntu suddenly freezes

    - by tapan
    I've a strange problem with my ubuntu 10.04 installation. Whenever i boot into ubuntu the entire system freezes / hangs soon after (~ 2 mins in). This problem exists on my windows 7 installation too. However if i start World of Warcraft or Warcraft on windows it doesnt hang for the duration i'm playing the game. After i stop playing and exit the game my laptop hangs inside 2 mins. Here is when it gets weirder. If i disconnect the charger, the laptop doesn't hang. However when I start it in ubuntu recovery mode and drop to root shell and use the 'startx' command everything works perfectly. I cannot figure out what the problem is. i have an intel core2duo 2.2ghz processor, intel mobile 965 graphics, 2 GB RAM for more details here is the output of cat /proc/cpuinfo : processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHz stepping : 11 cpu MHz : 2201.000 cache size : 4096 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida tpr_shadow vnmi flexpriority bogomips : 4389.80 clflush size : 64 power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHz stepping : 11 cpu MHz : 2201.000 cache size : 4096 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 apicid : 1 initial apicid : 1 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida tpr_shadow vnmi flexpriority bogomips : 4388.96 clflush size : 64 power management: here is the output of cat /proc/meminfo MemTotal: 2052440 kB MemFree: 55924 kB Buffers: 579352 kB Cached: 821752 kB SwapCached: 704 kB Active: 897124 kB Inactive: 1032256 kB Active(anon): 412140 kB Inactive(anon): 264804 kB Active(file): 484984 kB Inactive(file): 767452 kB Unevictable: 0 kB Mlocked: 0 kB HighTotal: 1178440 kB HighFree: 6012 kB LowTotal: 874000 kB LowFree: 49912 kB SwapTotal: 995988 kB SwapFree: 986616 kB Dirty: 8928 kB Writeback: 0 kB AnonPages: 527596 kB Mapped: 76536 kB Slab: 39480 kB SReclaimable: 21100 kB SUnreclaim: 18380 kB PageTables: 5672 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 2022208 kB Committed_AS: 1856400 kB VmallocTotal: 122880 kB VmallocUsed: 11928 kB VmallocChunk: 104644 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 4096 kB DirectMap4k: 16376 kB DirectMap4M: 892928 kB Also the kern.log doesn't show any errors. What I want to know is what might be the problem, how i could test for it and if there are any solutions I could try. Thanks :).

    Read the article

  • Ubuntu/Windows suddenly freezes

    - by tapan
    I've a strange problem with my ubuntu 10.04 installation. Whenever i boot into ubuntu the entire system freezes / hangs soon after (~ 2 mins in). This problem exists on my windows 7 installation too. However if i start World of Warcraft or Warcraft on windows it doesnt hang for the duration i'm playing the game. After i stop playing and exit the game my laptop hangs inside 2 mins. Here is when it gets weirder. If i disconnect the charger, the laptop doesn't hang. However when I start it in ubuntu recovery mode and drop to root shell and use the 'startx' command everything works perfectly. I cannot figure out what the problem is. i have an intel core2duo 2.2ghz processor, intel mobile 965 graphics, 2 GB RAM for more details here is the output of cat /proc/cpuinfo : processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHz stepping : 11 cpu MHz : 2201.000 cache size : 4096 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida tpr_shadow vnmi flexpriority bogomips : 4389.80 clflush size : 64 power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHz stepping : 11 cpu MHz : 2201.000 cache size : 4096 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 apicid : 1 initial apicid : 1 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida tpr_shadow vnmi flexpriority bogomips : 4388.96 clflush size : 64 power management: here is the output of cat /proc/meminfo MemTotal: 2052440 kB MemFree: 55924 kB Buffers: 579352 kB Cached: 821752 kB SwapCached: 704 kB Active: 897124 kB Inactive: 1032256 kB Active(anon): 412140 kB Inactive(anon): 264804 kB Active(file): 484984 kB Inactive(file): 767452 kB Unevictable: 0 kB Mlocked: 0 kB HighTotal: 1178440 kB HighFree: 6012 kB LowTotal: 874000 kB LowFree: 49912 kB SwapTotal: 995988 kB SwapFree: 986616 kB Dirty: 8928 kB Writeback: 0 kB AnonPages: 527596 kB Mapped: 76536 kB Slab: 39480 kB SReclaimable: 21100 kB SUnreclaim: 18380 kB PageTables: 5672 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 2022208 kB Committed_AS: 1856400 kB VmallocTotal: 122880 kB VmallocUsed: 11928 kB VmallocChunk: 104644 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 4096 kB DirectMap4k: 16376 kB DirectMap4M: 892928 kB Also the kern.log doesn't show any errors. What I want to know is what might be the problem, how i could test for it and if there are any solutions I could try. Thanks :).

    Read the article

  • js code works for one variable(?), how to make it work for many?

    - by jerry87
    I have working code of js, it shows different div for selected option. <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#box1').hide(); $('#box2').hide(); $('#box3').hide(); $("#thechoices").change(function(){ $("#" + this.value).show().siblings().hide(); }); $("#thechoices").change(); }); </script> </head> <body> <select id="thechoices"> <option value="box1">Box 1</option> <option value="box2">Box 2</option> <option value="box3">Box 3</option> </select> <!-- the DIVs --> <div id="boxes"> <div id="box1"><p>Box 1 stuff...</p></div> <div id="box2"><p>Box 2 stuff...</p></div> <div id="box3"><p>Box 3 stuff...</p></div> </div> </body> </html> Please, I have no js experience, so I don't know how to make it work several times on one page for many "thechoices". Something like copy paste but more suitable than this: <script type="text/javascript"> $(document).ready(function(){ $('#box1').hide(); $('#box2').hide(); $('#box3').hide(); $('#box4').hide(); $('#box5').hide(); $('#box6').hide(); $("#thechoices").change(function(){ $("#" + this.value).show().siblings().hide(); }); $("#thechoices2").change(function(){ $("#" + this.value).show().siblings().hide(); }); $("#thechoices").change(); }); $("#thechoices2").change(); }); </script> </head> <body> <select id="thechoices"> <option value="box1">Box 1</option> <option value="box2">Box 2</option> <option value="box3">Box 3</option> </select> <!-- the DIVs --> <div id="boxes"> <div id="box1"><p>Box 1 stuff...</p></div> <div id="box2"><p>Box 2 stuff...</p></div> <div id="box3"><p>Box 3 stuff...</p></div> </div> <select id="thechoices2"> <option value="box4">1</option> <option value="box5">2</option> <option value="box6">3</option> </select> <!-- the DIVs --> <div id="boxes"> <div id="box4"><p>1 stuff...</p></div> <div id="box5"><p>2 stuff...</p></div> <div id="box6"><p>3 stuff...</p></div> </div> I know you can help me, it seems to be simple but I can't handle with this. How can I change my second code to work in the same way but not only for two selectors. I need it for many. Don't want to copy paste the same section like in my second code.

    Read the article

  • Ubuntu 11 and 12 initially fast but later bogs down, CPU pegged

    - by uos??
    I started with Ubuntu 11 a few weeks ago. It's on a DELL M4300 with a OCZ SSD. Default setup, except that I've installed the proprietary NVIDIA graphics and BROADCOM wireless drivers. Dual boot with Windows. If I cold boot into Ubuntu, it is very fast, just like the Windows experience that I'm used to. But SOMETHING happens, and I haven't yet determined what, but the system gets incredibly slow and stays that way. At first I thought it had to do with Adobe Flash because it seemed to be triggered by sites with Flash. But then I removed Flash and the problem remains. I thought it was just an overheating problem, but I've now upgraded to 12.04 which supposedly fixes the overheating problems I've read about. Perhaps the heat situation was brought on by Flash in my early cases? So I installed Jupiter for CPU management, but the thermometer reports a familiar Windows-side temperature of 53 degrees Celsius. Switching Jupiter to lower performance doesn't help. When I check the System Monitor application, sorting by CPU usage, there are no obvious problem processes. However, in the graphs tab, both CPU cores are pegged at 100%! I notice that the slowness seems to be similar to the extremely bad performance I got prior to installing the NVIDIA drivers. I'm not sure if that helps. This is the strangest part to me - although the temperature seems OK, even after rebooting, the system remains slow - starting with GRUB2 which is very noticeably delayed, all the way through to either Ubuntu or Windows! That's right, even the Windows side suffers effects and takes several minutes to complete booting whereas normally (with my SSD) it's ready to use in 15 seconds. The only way to fix it is to shutdown and let the parts cool down. Or maybe it just needs to completely power off and boot rather than a soft reboot, temperature has nothing to do with it? - is that possible? But know that I have never had this problem in Windows, even if Windows gets very hot (135 F) a reboot would be enough time for it to recover. For this reason, I don't think it's a heat thing, but I can't imagine what else could be surviving the reboot. I'm entirely updated - there are no pending updates. I have the Post-Release updates of NVIDIA too, btw. If this sounds CLOSE to something you know about, but one of the details doesn't line up exactly, it might be a mistake in my perception. Are there tests you can suggest to rule something out? Thanks! processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Core(TM)2 Duo CPU T9500 @ 2.60GHz stepping : 6 microcode : 0x60c cpu MHz : 800.000 cache size : 6144 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm ida dts tpr_shadow vnmi flexpriority bogomips : 5187.00 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Core(TM)2 Duo CPU T9500 @ 2.60GHz stepping : 6 microcode : 0x60c cpu MHz : 800.000 cache size : 6144 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 apicid : 1 initial apicid : 1 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm ida dts tpr_shadow vnmi flexpriority bogomips : 5186.94 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: (Redundant figures removed. You can view them in the edits if they are still relevant) ps: %CPU PID USER COMMAND 9.4 2399 jason gnome-terminal 6.2 2408 jason bash 17.3 1117 root /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch -background none 13.7 1667 jason compiz 1.3 1960 jason /usr/lib/unity/unity-panel-service 1.3 1697 jason python /usr/bin/jupiter 0.9 1964 jason /usr/lib/indicator-appmenu/hud-service 0.6 1689 jason nautilus -n 0.4 1458 jason //bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session I should highlight specifically that GRUB2 can also be very slow. I don't know the relationship of which scenarios GRUB2 is also slow, but WHEN it is slow, it is slow both before the menu appears and after the selection is made - although for the diagnosis of GRUB2 it is harder for me to tell what the normal speeds should be. With SSD, I would expect that GRUB2 could load instantly, and that the GRUB2 purple would disappear instantly after the selection. The only delay to be expected is the change in graphics modes (though I couldn't guess why that ever requires any noticeable time)

    Read the article

  • Any way for ubuntu to use more than one core of i7 cpu on my Asus laptop?

    - by G. He
    Newly installed ubuntu 11.10 on a new Asus U46E laptop. /proc/cpuinfo correctly identified the cpu but shows only one core: processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 42 model name : Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz stepping : 7 cpu MHz : 800.000 cache size : 4096 KB physical id : 0 siblings : 1 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc up arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid bogomips : 5587.63 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: I search here and found the answer to one post suggesting remove boot parameter 'nolapic'. However, on my particular laptop, ubuntu won't boot without this nolapic parameter. Is there anyway for ubuntu correly utility the full cpu power?

    Read the article

  • nextSibling issue, again... sorry...

    - by SoLoGHoST
    Ok, I am using insertRow to insert a TR element into a table, but for some reason it doesn't count that inserted TR element as a sibling of the others when I do nextSibling on it. For example, consider the following table. <table id="myTable"> <tr id="row_0"> <td colspan="3">Row 1</td> </tr> <tr id="tr_0_0"> <td>Option 1</td> <td>Option2</td> <td>Option 3</td> </tr> <tr id="tr_0_1"> <td>Option 1</td> <td>Option 2</td> <td>Option 3</td> </tr> </table> So after I do this: var lTable = document.getElementById("myTable"); var trEle = lTable.insertRow(-1); trEle.id = "tr_0_2"; var cell1 = trEle.insertCell(0); cell1.innerHTML = "Option 1"; var cell2 = trEle.insertCell(1); cell2.innerHTML = "Option 2"; var cell3 = trEle.insertCell(-1); cell3.innerHTML = "Option 3"; Then I use this approach to get all of the siblings, but it NEVER gives me the last sibling in here, but ONLY if it's been added via insertRow, because it gets all nextSiblings just fine, but once I add a sibling via insertRow it never gives me that last Sibling, argggg.... var tempTr = document.getElementById("row_0"); var totalSibs = 0; while(tempTr.nextSibling != null) { var tempId = tempTr.id; // If no id, not an element, or not a tr_0 id. if (!tempId || tempTr.nodeType != 1 || tempId.indexOf("tr_0") != 0) { tempTr = tempTr.nextSibling; continue; } // This NEVER ALERTS the last id of the row that was inserted using insertRow, arggg. alert(tempId); totalSibs++; tempTr = tempTr.nextSibling; } So, totalSibs should return 3 because after I inserted the row, there should be 3 Siblings, but instead returns 2 and never counts the 3rd Sibling.... arggg. Can someone please help me here?? Thank a lot, you guys/gals are Awesome!

    Read the article

  • Is there any decent OpenGL SceneGraph API/framework?

    - by JohnIdol
    I am new to OpenGL. Wondering if there is any good Scenegraph API/framework for OpenGL. At the moment I am using glut with a custom node based solution: I am setting children and siblings for each node the calling a traverse function. I'd like a more flexible solution when it comes to managing dynamic elements in the scene.

    Read the article

  • setting a value through jquery

    - by Hulk
    <script> function edit(elem) { var ele=$(elem).siblings('label#test').html(); var a=document.getElementById('test'); var htm = '<input type="text" name="modal" id="modal" style="width:70%;" value="'+$(elem).siblings('label#test').html();+'"/>'; $dialog.html(htm) .dialog({ autoOpen: true, position: 'center' , title: 'EDIT', draggable: false, width : 300, height : 40, resizable : false, modal : true, buttons: { "Save" : function() { if($('#modal').val() != ''){a.value=$('#modal').val();$dialog.dialog('close');} else {alert('i++'+$('#modal').val()+'++');} } } }); $dialog.dialog('open'); } $(document).ready(function() { var flag=0; $("input:radio[@name=template]").click(function() { var checkedoption = $(this).val(); if (checkedoption == "template3") { if (flag == 0) { var html = '<input type="text" name="val" id="val" />&nbsp;&nbsp;&nbsp;<input type="button" value="Add" id="add"><br>'; $('#useroptions').append(html); flag=1; $('#add').click(function(){ var a = $('#val').val(); if (a == '') { alert('Enter options'); } else { var section= '<tr class="clickable"><td id="userval" BGCOLOR="#FF6699"><label id="test">' + a + '</label>&nbsp;&nbsp;&nbsp; <IMG SRC="/media/img/chunkedit.gif" onclick="javascript:edit(this);" >&nbsp;&nbsp;&nbsp;<IMG SRC="/media/img/close.gif" onclick="javascript:remove(this);" ></td></tr>'; $('#useroptions').append(section); } }); } } }); }); </script> <form> <table> <tr><td> <div id="useroptions"></div> </tr></td> </table> </form> How to set a new value for test in the above code.. Thanks

    Read the article

  • Silverlight Navigation Application

    - by cmaduro
    Is there anyway I can have one mainpage, with tabs, which load child pages in the content area, but also have within the child page another navigation menu which loads siblings into the same content area it itself is in? This is just a nested navigation frame situation really.

    Read the article

  • T-SQL Hierarchy to duplicate Dependent Objects tree view in SQL Server 2005

    - by drewg
    Hi Id like to map the calling stack from one master stored procedure through its hundreds of siblings. i can see it in the dialog, but cannot copy or print it, but couldnt trap anythiing worthwhile in proflier. do you know what sproc fills that treeview? i must be a recursive CTE that reads syscomments or information_schema.routines, but its beyond my chops, though i can imagine it thanks in advance drew

    Read the article

  • Expanding / grow a JQuery element selection?

    - by HipHop-opatamus
    In the Jquery example below, I would like to expand $(this) before it is cloned, so it includes everything contained in the parent class "comment". How do I do this? I've tried using ReplaceWith($(this).parent('.comment').clone()... and it does not work! $(document).ready( function(){ $('.forumthreadtitle').siblings().hide(); $('.forumthreadtitle').click( function() { $('#first-post').replaceWith($(this).clone().attr('id','first-post')); });

    Read the article

  • How can unwanted tags be removed from HTML using Nokogiri?

    - by sutch
    I need to strip out all font tags from a document. When attempting to do so with the following Ruby code, other elements and text within the font tags are lost. I've also attempted to iterate through all children elements and make them siblings of the font tag before unlinking the font tag--which also results in lost HTML. What is a good method for removing tags which can contain other elements and/or text? doc.css('font').each do |element| element.unlink end

    Read the article

  • C++ linked list based tree structure. Sanely move nodes between lists.

    - by krunk
    The requirements: Each Node in the list must contain a reference to its previous sibling Each Node in the list must contain a reference to its next sibling Each Node may have a list of child nodes Each child Node must have a reference to its parent node Basically what we have is a tree structure of arbitrary depth and length. Something like: -root(NULL) --Node1 ----ChildNode1 ------ChildOfChild --------AnotherChild ----ChildNode2 --Node2 ----ChildNode1 ------ChildOfChild ----ChildNode2 ------ChildOfChild --Node3 ----ChildNode1 ----ChildNode2 Given any individual node, you need to be able to either traverse its siblings. the children, or up the tree to the root node. A Node ends up looking something like this: class Node { Node* previoius; Node* next; Node* child; Node* parent; } I have a container class that stores these and provides STL iterators. It performs your typical linked list accessors. So insertAfter looks like: void insertAfter(Node* after, Node* newNode) { Node* next = after->next; after->next = newNode; newNode->previous = after; next->previous = newNode; newNode->next = next; newNode->parent = after->parent; } That's the setup, now for the question. How would one move a node (and its children etc) to another list without leaving the previous list dangling? For example, if Node* myNode exists in ListOne and I want to append it to listTwo. Using pointers, listOne is left with a hole in its list since the next and previous pointers are changed. One solution is pass by value of the appended Node. So our insertAfter method would become: void insertAfter(Node* after, Node newNode); This seems like an awkward syntax. Another option is doing the copying internally, so you'd have: void insertAfter(Node* after, const Node* newNode) { Node *new_node = new Node(*newNode); Node* next = after->next; after->next = new_node; new_node->previous = after; next->previous = new_node; new_node->next = next; new_node->parent = after->parent; } Finally, you might create a moveNode method for moving and prevent raw insertion or appending of a node that already has been assigned siblings and parents. // default pointer value is 0 in constructor and a operator bool(..) // is defined for the Node bool isInList(const Node* node) const { return (node->previous || node->next || node->parent); } // then in insertAfter and friends if(isInList(newNode) // throw some error and bail I thought I'd toss this out there and see what folks came up with.

    Read the article

  • how can i check all ul of nested checkboxes

    - by Mike
    Question: I have a category listing which some categories have children, I am trying to create a ALL category that when clicked, will check all sibling checkboxes in that same category. e.g; clicking ALL underneath the MUSIC category would check blues, jazz, rock n roll Code: HTML: <ul name="events-categories" id="events-categories"> <li><input type="checkbox" name="category-events" value="185" placeholder="" id="category-185" class="events-category"> CONVENTIONS <ul class="event-children"> <li><input type="checkbox" name="child-category-all" value="" class="events-child-category-all">ALL</li> <li><input type="checkbox" name="child-category-190" value="190" id="child-category-190" class="child events-child-category">SCIENCE</li> <li><input type="checkbox" name="child-category-191" value="191" id="child-category-191" class="child events-child-category">TECHNOLOGY</li> </ul> </li> <li><input type="checkbox" name="category-events" value="184" placeholder="" id="category-184" class="events-category"> MUSIC <ul class="event-children"> <li><input type="checkbox" name="child-category-all" value="" class="events-child-category-all">ALL</li> <li><input type="checkbox" name="child-category-189" value="189" id="child-category-189" class="child events-child-category">BLUES</li> <li><input type="checkbox" name="child-category-188" value="188" id="child-category-188" class="child events-child-category">JAZZ</li> <li><input type="checkbox" name="child-category-187" value="187" id="child-category-187" class="child events-child-category">ROCK N ROLL</li> </ul> </li> <li><input type="checkbox" name="category-events" value="186" placeholder="" id="category-186" class="events-category"> TRIBUTES</li> </ul>? CSS: .event-children { margin-left: 20px; list-style: none; display: none; }? jQuery So Far: /** * left sidebar events categories * toggle sub categories */ $('.events-category').change( function(){ console.log('showing sub categories'); var c = this.checked; if( c ){ $(this).next('.event-children').css('display', 'block'); }else{ $(this).next('.event-children').css('display', 'none'); } }); $('.events-child-category-all').change( function(){ var c = this.checked; if( c ){ $(this).siblings(':checkbox').attr('checked',true); }else{ $(this).siblings(':checkbox').attr('checked',false); } });? jsfiddle: http://jsfiddle.net/SENV8/

    Read the article

  • Windows Explorer is blank

    - by Scott Mitchell
    I am using Windows 7 Utlimate x64. Once a week, or so, when I boot up n the morning and launch Windows Explorer it shows up blank, as the following screen shot show. Clicking on my Computer doesn't load anything. Interestingly, I can go the the Address bar at the top and type in a folder name. This brings up that folder's files and subfolders, but as I drill around the tree of folders on the left only shows the immediate folder and not its siblings. There's no plus icon to expand the folder, etc. My usual "solution" is to reboot, which typically brings everything back to normal, but this is a frustrating remedy. Any idea what's going on and how to fix it? Some Googling turned up this discussion, but the remedy was to uninstall a particular piece of software that I don't have installed (Virtual Clone Drive). Thanks

    Read the article

  • What does "cpuid level" mean?

    - by ogzylz
    For an example, I put just output from 1 core of a 16 core machine. What does the output mean by "cpuid level" of "6"? Also, what do "bogomips" of "5992.10" and "clflush size" of "64" mean? processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 6 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 8 cpu MHz : 2992.689 cache size : 4096 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 2 fpu : yes fpu_exception: yes cpuid level : 6 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx cid cx16 xtpr lahf_lm bogomips : 5992.10 clflush size : 64 cache_alignment: 128 address sizes: 40 bits physical, 48 bits virtual power management:

    Read the article

  • Hyper-V CPU Utilization, Good Tools?

    - by yzorg
    I just learned a ton from this post: Host CPU% doesn't include child VM CPU%, specifically I learned that both the 'host OS' and 'child VM' are siblings within the HyperVisor layer. Are there good utilities for 'watching' the total CPU and other resource counters at the HyperVisor (hardware) layer? I know perfmon (watching special Hyper-V CPU counters) is the standard answer, but I've stayed away from perfmon for ad-hoc monitoring. Is there a good OSS or free tools to 'watch' the resource utilization as I create multiple new VMs running on the server? I'm a developer, so if there aren't any good UI tools to surface this data I'd consider creating one, but only if needed. P.S. My specific scenario is I'm creating new web, SQL and back-end server VMs for new Windows 8 Server and SQL 2012 (entire application stack). I need to monitor them for utilization and know when I need to grow beyond 1 host (I'll need to split the VMs into separate hosts as I hit hardware limits of the 1st host, and diagnose problems).

    Read the article

  • Running 64 bit Ubuntu distribution from 32 bit Ubuntu

    - by csg
    Related to this question How do I run qemu with 64bit processor on a 64bit machine?, I'm trying to run latest ubuntu 11.10 64bit distribution under Ubuntu 11.04 32 bit using qemu on a core2duo (64 bit cpu) machine, using following qemu parameters with no success. Error under qemu: "This kernel required an x86-64 CPU, but only detected an i686 CPU. Unable to boot - please use a kernel appropiate for your CPU" Isn't qemu suppose to emulate a 64 bit machine? I think I'm missing something, but I can't figure it out. qemu -cpu (kvm64|core2duo|qemu64) -boot d -cdrom ubuntu-11.10-desktop-amd64.iso qemu-system-x86_64 -boot d -cdrom ubuntu-11.10-desktop-amd64.iso Here is my uname -m i686 Here is my /proc/cpuinfo processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26GHz stepping : 6 cpu MHz : 800.000 cache size : 3072 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 apicid : 1 initial apicid : 1 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority bogomips : 4522.45 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management:

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >