Search Results

Search found 44 results on 2 pages for 'rg'.

Page 1/2 | 1 2  | Next Page >

  • Wifi antenna extension with F-connector/RG-6(RG-59) cable?

    - by rjz2000
    In an older house, the wire mesh in walls surrounding the furnace behave like a Faraday cage and block wifi signals. It is also difficult to lay new cable, however there is television cable to multiple locations due to there once having been a roof-installed, television antenna. It would be relatively trivial to install the wifi router at the center distribution point, then have the antenna broadcasting/receiving the signal plugged in at each of the old television outlets. I assume that it would not be too difficult to find an adapter for SMA <- F-type connectors. The cable is actually RG-59 rather than RG-6, but I assume that it still has relatively good RF isolation along its length, which is no more than a couple hundred feet in any direction. Does anyone know a problem with the idea? Will a router get confused if there is /too little/ interference between the two antenna? Is that length of cable (~100ft) too long for the signal a router broadcasts? I have seen that it is also possible to use old ~$30/each FiOS cable modems available on eBay to extend a network over television cable. However, that seems like a less elegant solution, and might interfere with upnp and dlna services I'd like to have work on a single network. Thanks if anyone has answers or suggestions before I try this project!

    Read the article

  • Wifi antenna extension with F-connector/RG-6(RG-59) cable?

    - by rjz2000
    In an older house, the wire mesh in walls surrounding the furnace behave like a Faraday cage and block wifi signals. It is also difficult to lay new cable, however there is television cable to multiple locations due to there once having been a roof-installed, television antenna. It would be relatively trivial to install the wifi router at the center distribution point, then have the antenna broadcasting/receiving the signal plugged in at each of the old television outlets. I assume that it would not be too difficult to find an adapter for SMA <- F-type connectors. The cable is actually RG-59 rather than RG-6, but I assume that it still has relatively good RF isolation along its length, which is no more than a couple hundred feet in any direction. Does anyone know a problem with the idea? Will a router get confused if there is /too little/ interference between the two antenna? Is that length of cable (~100ft) too long for the signal a router broadcasts? I have seen that it is also possible to use old ~$30/each FiOS cable modems available on eBay to extend a network over television cable. However, that seems like a less elegant solution, and might interfere with upnp and dlna services I'd like to have work on a single network. Thanks if anyone has answers or suggestions before I try this project!

    Read the article

  • Wifi antenna extension with F-connector/RG-6(RG-59) cable?

    - by rjz2000
    In an older house, the wire mesh in walls surrounding the furnace behave like a Faraday cage and block wifi signals. It is also difficult to lay new cable, however there is television cable to multiple locations due to there once having been a roof-installed, television antenna. It would be relatively trivial to install the wifi router at the center distribution point, then have the antenna broadcasting/receiving the signal plugged in at each of the old television outlets. I assume that it would not be too difficult to find an adapter for SMA <- F-type connectors. The cable is actually RG-59 rather than RG-6, but I assume that it still has relatively good RF isolation along its length, which is no more than a couple hundred feet in any direction. Does anyone know a problem with the idea? Will a router get confused if there is /too little/ interference between the two antenna? Is that length of cable (~100ft) too long for the signal a router broadcasts? I have seen that it is also possible to use old ~$30/each FiOS cable modems available on eBay to extend a network over television cable. However, that seems like a less elegant solution, and might interfere with upnp and dlna services I'd like to have work on a single network. Thanks if anyone has answers or suggestions before I try this project!

    Read the article

  • SCHA API for resource group failover / switchover history

    - by krishna.k.murthy
    The Oracle Solaris Cluster framework keeps an internal log of cluster events, including switchover and failover of resource groups. These logs can be useful to Oracle support engineers for diagnosing cluster behavior. However, till now, there was no external interface to access the event history. Oracle Solaris Cluster 4.2 provides a new API option for viewing the recent history of resource group switchovers in a program-parsable format. Oracle Solaris Cluster 4.2 provides a new option tag argument RG_FAILOVER_LOG for the existing API command scha_cluster_get which can be used to list recent failover / switchover events for resource groups. The command usage is as shown below: # scha_cluster_get -O RG_FAILOVER_LOG number_of_days number_of_days : the number of days to be considered for scanning the historical logs. The command returns a list of events in the following format. Each field is separated by a semi-colon [;]: resource_group_name;source_nodes;target_nodes;time_stamp source_nodes: node_names from which resource group is failed over or was switched manually. target_nodes: node_names to which the resource group failed over or was switched manually. There is a corresponding enhancement in the C API function scha_cluster_get() which uses the SCHA_RG_FAILOVER_LOG query tag. In the example below geo-infrastructure (failover resource group), geo-clusterstate (scalable resource group), oracle-rg (failover resource group), asm-dg-rg (scalable resource group) and asm-inst-rg (scalable resource group) are part of Geographic Edition setup. # /usr/cluster/bin/scha_cluster_get -O RG_FAILOVER_LOG 3 geo-infrastructure;schost1c;;Mon Jul 21 15:51:51 2014 geo-clusterstate;schost2c,schost1c;schost2c;Mon Jul 21 15:52:26 2014 oracle-rg;schost1c;;Mon Jul 21 15:54:31 2014 asm-dg-rg;schost2c,schost1c;schost2c;Mon Jul 21 15:54:58 2014 asm-inst-rg;schost2c,schost1c;schost2c;Mon Jul 21 15:56:11 2014 oracle-rg;;schost2c;Mon Jul 21 15:58:51 2014 geo-infrastructure;;schost2c;Mon Jul 21 15:59:19 2014 geo-clusterstate;schost2c;schost2c,schost1c;Mon Jul 21 16:01:51 2014 asm-inst-rg;schost2c;schost2c,schost1c;Mon Jul 21 16:01:10 2014 asm-dg-rg;schost2c;schost2c,schost1c;Mon Jul 21 16:02:10 2014 oracle-rg;schost2c;;Tue Jul 22 16:58:02 2014 oracle-rg;;schost1c;Tue Jul 22 16:59:05 2014 oracle-rg;schost1c;schost1c;Tue Jul 22 17:05:33 2014 Note that in the output some of the entries might have an empty string in the source_nodes. Such entries correspond to events in which the resource group is switched online manually or during a cluster boot-up. Similarly, an empty destination_nodes list indicates an event in which the resource group went offline. - Arpit Gupta, Harish Mallya

    Read the article

  • Tuning Red Gate: #3 of Lots

    - by Grant Fritchey
    I'm drilling down into the metrics about SQL Server itself available to me in the Analysis tab of SQL Monitor to see what's up with our two problematic servers. In the previous post I'd noticed that rg-sql01 had quite a few CPU spikes. So one of the first things I want to check there is how much CPU is getting used by SQL Server itself. It's possible we're looking at some other process using up all the CPU Nope, It's SQL Server. I compared this to the rg-sql02 server: You can see that there is a more, consistently low set of CPU counters there. I clearly need to look at rg-sql01 and capture more specific data around the queries running on it to identify which ones are causing these CPU spikes. I always like to look at the Batch Requests/sec on a server, not because it's an indication of a problem, but because it gives you some idea of the load. Just how much is this server getting hit? Here are rg-sql01 and rg-sql02: Of the two, clearly rg-sql01 has a lot of activity. Remember though, that's all this is a measure of, activity. It doesn't suggest anything other than what it says, the number of requests coming in. But it's the kind of thing you want to know in order to understand how the system is used. Are you seeing a correlation between the number of requests and the CPU usage, or a reverse correlation, the number of requests drops as the CPU spikes? See, it's useful. Some of the details you can look at are Compilations/sec, Compilations/Batch and Recompilations/sec. These give you some idea of how the cache is getting used within the system. None of these showed anything interesting on either server. One metric that I like (even though I know it can be controversial) is the Page Life Expectancy. On the average server I expect see a series of mountains as the PLE climbs then drops due to a data load or something along those lines. That's not the case here: Those spikes back in January suggest that the servers weren't really being used much. The PLE on the rg-sql01 seems to be somewhat consistent growing to 3 hours or so then dropping, but the rg-sql02 PLE looks like it might be all over the map. Instead of continuing to look at this high level gathering data view, I'm going to drill down on rg-sql02 and see what it's done for the last week: And now we begin to see where we might have an issue. Memory on this system is getting flushed every 1/2 hour or so. I'm going to check another metric, scans: Whoa! I'm going back to the system real quick to look at some disk information again for rg-sql02. Here is the average disk queue length on the server: and the transfers Right, I think I have a guess as to what's up here. We're seeing memory get flushed constantly and we're seeing lots of scans. The disks are queuing, especially that F drive, and there are lots of requests that correspond to the scans and the memory flushes. In short, we've got queries that are scanning the data, a lot, so we either have bad queries or bad indexes. I'm going back to the server overview for rg-sql02 and check the Top 10 expensive queries. I'm modifying it to show me the last 3 days and the totals, so I'm not looking at some maintenance routine that ran 10 minutes ago and is skewing the results: OK. I need to look into these queries that are getting executed this much. They're generating a lot of reads, but which queries are generating the most reads: Ow, all still going against the same database. This is where I'm going to temporarily leave SQL Monitor. What I want to do is connect up to the server, validate that the Warehouse database is using the F:\ drive (which I'll put money down it is) and then start seeing what's up with these queries. Part 1 of the Series Part 2 of the Series

    Read the article

  • How to configure a zone cluster on Solaris Cluster 4.0

    - by JuergenS
    This is a short overview on how to configure a zone cluster on Solaris Cluster 4.0. This is a little bit different as in Solaris Cluster 3.2/3.3 because Solaris Cluster 4.0 is only running on Solaris 11. The name of the zone cluster must be unique throughout the global Solaris Cluster and must be configured on a global Solaris Cluster. Please read all the requirements for zone cluster in Solaris Cluster Software Installation Guide for SC4.0. For Solaris Cluster 3.2/3.3 please refer to my previous blog Configuration steps to create a zone cluster in Solaris Cluster 3.2/3.3. A. Configure the zone cluster into the already running global clusterCheck if zone cluster can be created # cluster show-netprops to change number of zone clusters use # cluster set-netprops -p num_zoneclusters=12 Note: 12 zone clusters is the default, values can be customized! Create config file (zc1config) for zone cluster setup e.g: Configure zone cluster # clzc configure -f zc1config zc1 Note: If not using the config file the configuration can also be done manually # clzc configure zc1 Check zone configuration # clzc export zc1 Verify zone cluster # clzc verify zc1 Note: The following message is a notice and comes up on several clzc commands Waiting for zone verify commands to complete on all the nodes of the zone cluster "zc1"... Install the zone cluster # clzc install zc1 Note: Monitor the consoles of the global zone to see how the install proceed! (The output is different on the nodes) It's very important that all global cluster nodes have installed the same set of ha-cluster packages! Boot the zone cluster # clzc boot zc1 Login into non-global-zones of zone cluster zc1 on all nodes and finish Solaris installation. # zlogin -C zc1 Check status of zone cluster # clzc status zc1 Login into non-global-zones of zone cluster zc1 and configure the shell environment for root (for PATH: /usr/cluster/bin, for MANPATH: /usr/cluster/man) # zlogin -C zc1 If using additional name service configure /etc/nsswitch.conf of zone cluster non-global zones. hosts: cluster files netmasks: cluster files Configure /etc/inet/hosts of the zone cluster zones Enter all the logical hosts of non-global zones B. Add resource groups and resources to zone cluster Create a resource group in zone cluster # clrg create -n <zone-hostname-node1>,<zone-hostname-node2> app-rg Note1: Use command # cluster status for zone cluster resource group overview. Note2: You can also run all commands for zone cluster in global cluster by adding the option -Z to the command. e.g: # clrg create -Z zc1 -n <zone-hostname-node1>,<zone-hostname-node2> app-rg Set up the logical host resource for zone cluster In the global zone do: # clzc configure zc1 clzc:zc1 add net clzc:zc1:net set address=<zone-logicalhost-ip> clzc:zc1:net end clzc:zc1 commit clzc:zc1 exit Note: Check that logical host is in /etc/hosts file In zone cluster do: # clrslh create -g app-rg -h <zone-logicalhost> <zone-logicalhost>-rs Set up storage resource for zone cluster Register HAStoragePlus # clrt register SUNW.HAStoragePlus Example1) ZFS storage pool In the global zone do: Configure zpool eg: # zpool create <zdata> mirror cXtXdX cXtXdX and # clzc configure zc1 clzc:zc1 add dataset clzc:zc1:dataset set name=zdata clzc:zc1:dataset end clzc:zc1 verify clzc:zc1 commit clzc:zc1 exit Check setup with # clzc show -v zc1 In the zone cluster do: # clrs create -g app-rg -t SUNW.HAStoragePlus -p zpools=zdata app-hasp-rs Example2) HA filesystem In the global zone do: Configure SVM diskset and SVM devices. and # clzc configure zc1 clzc:zc1 add fs clzc:zc1:fs set dir=/data clzc:zc1:fs set special=/dev/md/datads/dsk/d0 clzc:zc1:fs set raw=/dev/md/datads/rdsk/d0 clzc:zc1:fs set type=ufs clzc:zc1:fs add options [logging] clzc:zc1:fs end clzc:zc1 verify clzc:zc1 commit clzc:zc1 exit Check setup with # clzc show -v zc1 In the zone cluster do: # clrs create -g app-rg -t SUNW.HAStoragePlus -p FilesystemMountPoints=/data app-hasp-rs Example3) Global filesystem as loopback file system In the global zone configure global filesystem and it to /etc/vfstab on all global nodes e.g.: /dev/md/datads/dsk/d0 /dev/md/datads/dsk/d0 /global/fs ufs 2 yes global,logging and # clzc configure zc1 clzc:zc1 add fs clzc:zc1:fs set dir=/zone/fs (zc-lofs-mountpoint) clzc:zc1:fs set special=/global/fs (globalcluster-mountpoint) clzc:zc1:fs set type=lofs clzc:zc1:fs end clzc:zc1 verify clzc:zc1 commit clzc:zc1 exit Check setup with # clzc show -v zc1 In the zone cluster do: (Create scalable rg if not already done) # clrg create -p desired_primaries=2 -p maximum_primaries=2 app-scal-rg # clrs create -g app-scal-rg -t SUNW.HAStoragePlus -p FilesystemMountPoints=/zone/fs hasp-rs More details of adding storage available in the Installation Guide for zone cluster Switch resource group and resources online in the zone cluster # clrg online -eM app-rg # clrg online -eM app-scal-rg Test: Switch of the resource group in the zone cluster # clrg switch -n zonehost2 app-rg # clrg switch -n zonehost2 app-scal-rg Add supported dataservice to zone cluster Documentation for SC4.0 is available here Example output: Appendix: To delete a zone cluster do: # clrg delete -Z zc1 -F + Note: Zone cluster uninstall can only be done if all resource groups are removed in the zone cluster. The command 'clrg delete -F +' can be used in zone cluster to delete the resource groups recursively. # clzc halt zc1 # clzc uninstall zc1 Note: If clzc command is not successful to uninstall the zone, then run 'zoneadm -z zc1 uninstall -F' on the nodes where zc1 is configured # clzc delete zc1

    Read the article

  • Generate SVG in Javascript

    - by Shadowbob
    I'm trying to load a SVG with Javascript. I did it quite often with success, but this time it has a strange return. Here is my JS var xmlns = 'http://www.w3.org/2000/svg'; var container = document.getElementById('svgContainer'); var svg = document.createElementNS(xmlns, 'svg'); svg.setAttribute('xmlns', xmlns); svg.setAttribute('version', '1.2'); var defs = document.createElementNS(xmlns, 'defs'); var lg = document.createElementNS(xmlns, 'linearGradient'); lg.setAttribute('id', 'lg'); defs.appendChild(lg); var stop1 = document.createElementNS(xmlns, 'stop'); stop1.setAttribute('offset', '0'); stop1.setAttribute('style', 'stop-color:#ffffff;stop-opacity:1'); lg.appendChild(stop1); var stop2 = document.createElementNS(xmlns, 'stop'); stop2.setAttribute('offset', '1'); stop2.setAttribute('style', 'stop-color:#000000;stop-opacity:1'); lg.appendChild(stop2); var rg = document.createElementNS(xmlns, 'radialGradient'); rg.setAttribute('cx', '171.20810'); rg.setAttribute('cy', '196.85463'); rg.setAttribute('r', '200.00000'); rg.setAttribute('fx', '171.20810'); rg.setAttribute('fy', '196.85463'); rg.setAttribute('id', 'rg'); rg.setAttribute('xlink:href', '#lg'); rg.setAttribute('gradientUnits', 'userSpaceOnUse'); rg.setAttribute('gradientTransform', 'matrix(1.040418,0.796229,-0.814518,1.064316,153.4218,-150.4353)'); defs.appendChild(rg); svg.appendChild(defs); var g = document.createElementNS (xmlns, 'g'); g.setAttribute('transform', 'scale(0.2,0.2)'); svg.appendChild(g); container.appendChild(svg); var path = document.createElementNS (xmlns, 'path'); path.setAttribute('d', 'M 450.00000 255.00000 A 200.00000 205.00000 0 1 1 50.000000,255.00000 A 200.00000 205.00000 0 1 1 450.00000 255.00000 z'); path.setAttribute('style', 'opacity:1.0000000;fill:url(#rg);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:8.0000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1'); g.appendChild(path); So it generates the perfect HTML DOM elements in the proper order, but it doesn't show anything. When I copy the HTML from the source and paste it, it renders the HTML but not the Javascript, but it's the exact same code. You can see the source here. The weird thing is that when I put the radialGradient in the DOM, it works. You can see it in here. So how should I do this? This problem is on all browsers. Thank you for your help.

    Read the article

  • Download a .asp / .asx video file (Ubuntu)

    - by Adam Matan
    Hi, My local TV station offers streaming video of recorded documentaries, using a XML-like file with a.asx extension. Is there a way (preferably Ubuntu CLI) to download the file? Thanks, Adam PS - the file contents: <asx version="3.0"> <!-- GMX --> <param name="encoding" value="utf-8" /> <title>CastUP: V0109-msheni-Hayim_Hefer-120510 </title> <MOREINFO HREF = "" /> <PARAM NAME="Prebuffer" VALUE="true" /> <entry> <ref href="http://s3awm.castup.net/server12/31/176/17607833-61.wmv?ct=IL&rg=BZ&aid=31&ts=0&cu=91A297E2-5359-416A-912B-2D9BC106E491" /> <ref href="http://s0dwm.castup.net/server12/31/176/17607833-61.wmv?ct=IL&rg=BZ&aid=31&ts=0&cu=91A297E2-5359-416A-912B-2D9BC106E491" /> <ref href="http://s0ewm.castup.net/server12/31/176/17607833-61.wmv?ct=IL&rg=BZ&aid=31&ts=0&cu=91A297E2-5359-416A-912B-2D9BC106E491" /> <ref href="http://s0fwm.castup.net/server12/31/176/17607833-61.wmv?ct=IL&rg=BZ&aid=31&ts=0&cu=91A297E2-5359-416A-912B-2D9BC106E491" /> <ref href="http://s0gwm.castup.net/server12/31/176/17607833-61.wmv?ct=IL&rg=BZ&aid=31&ts=0&cu=91A297E2-5359-416A-912B-2D9BC106E491" /> <PARAM NAME="CanSkipBack" VALUE="No"/> <PARAM NAME="CanSkipForward" VALUE="No"/> <PARAM NAME="CanSeek" VALUE="No"/> <title>mondial_2010 </title> <PARAM NAME="Prebuffer" VALUE="true" /> <PARAM NAME="CastUP_Content_Config" VALUE="" /> </entry> <entry> <PARAM NAME="EntryType" VALUE="Content" /> <param name="encoding" value="utf-8" /> <PARAM NAME="CastUP_AssociatedURL" VALUE="" /> <PARAM NAME="CastUP_Content_Config" VALUE="" /> <PARAM NAME="CastUP_Content_ClipMediaID" VALUE="5382858" /> <author>iba</author> <title>CastUP: V0109-msheni-Hayim_Hefer-120510 </title> <PARAM NAME="Prebuffer" VALUE="true" /> <ref href="mms://s3awm.castup.net/server12/31/174/17482045-61.wmv?ct=IL&rg=BZ&aid=31&ts=0&cu=91A297E2-5359-416A-912B-2D9BC106E491" /> <ref href="mms://s0dwm.castup.net/server12/31/174/17482045-61.wmv?ct=IL&rg=BZ&aid=31&ts=0&cu=91A297E2-5359-416A-912B-2D9BC106E491" /> <ref href="mms://s0ewm.castup.net/server12/31/174/17482045-61.wmv?ct=IL&rg=BZ&aid=31&ts=0&cu=91A297E2-5359-416A-912B-2D9BC106E491" /> <ref href="mms://s0fwm.castup.net/server12/31/174/17482045-61.wmv?ct=IL&rg=BZ&aid=31&ts=0&cu=91A297E2-5359-416A-912B-2D9BC106E491" /> <ref href="mms://s0gwm.castup.net/server12/31/174/17482045-61.wmv?ct=IL&rg=BZ&aid=31&ts=0&cu=91A297E2-5359-416A-912B-2D9BC106E491" /> </entry> </asx>

    Read the article

  • Refactor: Javascript block

    - by Shpigford
    Need some help refactoring this code: $("span[rel=color_content]").ColorPicker({ onChange: function (hsb, hex, rg) { $("span[rel=color_content]").css('background-color', '#' + hex); } }); $("span[rel=color_link]").ColorPicker({ onChange: function (hsb, hex, rg) { $("span[rel=color_link]").css('background-color', '#' + hex); } }); $("span[rel=color_selected]").ColorPicker({ onChange: function (hsb, hex, rg) { $("span[rel=color_selected]").css('background-color', '#' + hex); } }); $("span[rel=color_page]").ColorPicker({ onChange: function (hsb, hex, rg) { $("span[rel=color_page]").css('background-color', '#' + hex); } }); $("span[rel=color_player]").ColorPicker({ onChange: function (hsb, hex, rg) { $("span[rel=color_player]").css('background-color', '#' + hex); } }); The only thing changing between each is the contents of the rel attribute.

    Read the article

  • OpenCV in Python can't scan through pixels

    - by Marco L.
    Hi everyone, I'm stuck with a problem of the python wrapper for OpenCv. I have this function that returns 1 if the number of black pixels is greater than treshold def checkBlackPixels( img, threshold ): width = img.width height = img.height nchannels = img.nChannels step = img.widthStep dimtot = width * height data = img.imageData black = 0 for i in range( 0, height ): for j in range( 0, width ): r = data[i*step + j*nchannels + 0] g = data[i*step + j*nchannels + 1] b = data[i*step + j*nchannels + 2] if r == 0 and g == 0 and b == 0: black = black + 1 if black >= threshold * dimtot: return 1 else: return 0 The loop (scan each pixel of a given image) works good when the input is an RGB image...but if the input is a single channel image I get this error: for j in range( width ): TypeError: Nested sequences should have 2 or 3 dimensions The input single channel image (called 'rg' in the next example) is taken from an RGB image called 'src' processed with cvSplit and then cvAbsDiff cvSplit( src, r, g, b, 'NULL' ) rg = cvCreateImage( cvGetSize(src), src.depth, 1 ) # R - G cvAbsDiff( r, g, rg ) I've also already noticed that the problem comes from the difference image got from cvSplit... Anyone can help me? Thank you

    Read the article

  • Excel 2007 Visual Basic Editor: eats spaces, throws cursor around

    - by Vincent
    I can't resolve this issue, I found a similar question here but: setting the workbook to Manual calculation (alt-m-x-m or alt-t-oformulas) didn't work Setting editor options to disable: Auto syntax check & Background compile didn't work anybody have any idea how to fix this very annoying behaviour, I'm used to quickly pop up VBA (alt-f11), f7 to get into code and write some quick procedures there... and it's hard to get out of that habit, I don't want to write any office extension to just add a single quote to every cell in the range For Each rg In Selection rg = chr(39) & rg.value Next F5, done...

    Read the article

  • ColdFusion web.xml?

    - by RG
    Is there a coldfusion analog for the deployment descriptor/web.xml file found in a jee web container? I know CF is running on top of JRun and that I could just tweak the jrun dd, but what about an application specific configuration file? Is there something like this that I'm not aware of or do you just have to roll your own?

    Read the article

  • Can I do a reduce on a list comprehension into two lists, based on two values?

    - by pdknsk
    I've got the following code. sum_review = reduce(add,[book['rw'] for book in books]) sum_rating = reduce(add,[book['rg'] for book in books]) items = len(books) avg_review = sum_review/items avg_rating = sum_rating/items What I'd like is this. sum_review,sum_rating = reduce(add,([book['rw'],[book['rg']) for book in books]) items = len(books) avg_review = sum_review/items avg_rating = sum_rating/items Obviously this doesn't work. How can I solve this redundancy, without a regular loop?

    Read the article

  • Tuning Red Gate: #2 of Many

    - by Grant Fritchey
    In the last installment, I used the SQL Monitor tool to get a snapshot view of the current state of the servers at Red Gate that are giving us trouble. That snapshot suggested some areas where I should focus some time, primarily in which queries were being called most frequently or were running the longest. But, you don't want to just run off & start tuning queries. Remember, the foundation for query tuning is the server itself. So, I want to be sure I'm not looking at some major hardware or configuration issues that I need to address first. Rather than look at the current status of the server, I'm going to look at historical data. Clicking on the Analysis tab of SQL Monitor I get a whole list of counters that I can look at. More importantly, I can look at them over a period of time. Even more importantly, I can compare past periods with current periods to see if we're looking at a progressive issue or not. There are counters here that will give me an indication of load, and there are counters here that will tell me specifics about that load. First, I want to just look at the load to understand where the pain points might be. Trying to drill down before you have detailed information is just bad planning. First thing I'm going to check is the CPU, just to see what's up there. I have two servers I'm interested in, so I'll show you both: Looking at the last 30 days for both servers, well, let's just say that the first server is about what I would expect. It has an average baseline behavior with occasional, regular, peaks. This looks like a system with a fairly steady & predictable load that probably has a nightly batch process that spikes the processor. In short, normal stuff. The points there where the CPU drops radically. that might be worth investigating further because something changed the processing on this system a lot. But the first server. It's all over the place. There's no steady CPU behavior at all. It's spike high for long periods of time. It's up, it's down. I'm really going to have to spend time looking at CPU issues on this server to try to figure out what's up. It might be other processes being shared on the server, it might be something else. Either way, I'm going to have to spend time evaluating this CPU, especially those peeks about a week ago. Looking at the Pages/sec, again, just a measure of load, I see that there are some peaks on the rg-sql02 server, but over all, it looks like a fairly standard load. Plus, the peaks are only up to 550 pages/sec. Remember, this isn't a performance measure, but just a load measurement, but from this, I don't think we're looking at major memory issues, but I may want to correlate these counters with the CPU counters. Again, the other server looks like there's stuff going on. The load is not at all consistent. In fact there was a point earlier in the year that looks pretty severe. Plus the spikes here are twice the size of the other system. We've got a lot more load going on here and I will probably need to drill down on memory usage on this server. Taking a look at the disk transfers/sec the load on both systems seems to roughly correspond to the other load indicators. Notice that drop right in the middle of the graph for rg-sql02. I wonder if the office was closed over that period or a system was down for maintenance. If I saw spikes in memory or disk that corresponded to the drip in CPU, you can assume something was using those other resources and causing a drop, but when everything goes down, it just means that the system isn't gettting used. The disk on the rg-sql01 system isn't spiking exactly the same way as the memory & cpu, so there's a good chance (chance mind you) that any performance issues might not be disk related. However, notice that huge jump at the beginning of the month. Several disks were used more than they were for the rest of the month. That's the load on the server. What about the load on SQL Server itself? Next time.

    Read the article

  • strchr in objective C?

    - by Brian Postow
    I'm trying to write the equivalent of strchr, but with NSStrings... I've currently got this: Boolean nsstrchr(NSString* s, char c) { NSString *tmps = [NSString stringWithFormat: @"%c", c]; NSCharacterSet *cSet = [NSCharacterSet characterSetWithCharactersInString: tmps]; NSRange rg = [s rangeOfCharacterFromSet: cSet]; return rg.location != NSNotFound; } This seems needlessly complex... Is there a way to do this (preferably, one that doesn't involve turning the NSString into a cstring which doubles the run time, or writing it myself using characterAtIndex:... Am I missing some obvious method in the NSString description?

    Read the article

  • A regular expression that will allow a string with only one Capital Letter

    - by Phoenix
    The string should be 6 - 20 characters in length. And it should contain 1 Capital letter. I can do this in code using C# string st = "SomeString" Regex rg = new Regex("[A-Z]"); MatchCollection mc = rg.Matches(st); Console.WriteLine("Total Capital Letters: " + mc.Count); if (mc.Count > 1) { return false; } But what i really want is a Regular expression that will match my string if it only contains one capital. The string can start with a common letter and should have only letters. Thanks In advance. (I did look at some of the other RegEx questions but they did not help).

    Read the article

  • Getting parameter sent via html form and saving in my db

    - by Wesley
    I have error in my code i don't know to solve it please help me: My Servlet: package br.com.cad.servlet; import java.io.IOException; import java.io.PrintWriter; import java.util.Date; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import br.com.cad.dao.Cadastro; import br.com.cad.basica.Contato; public class AddDados extends HttpServlet{ protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { PrintWriter out = response.getWriter(); String nome = request.getParameter("nome"); String sobrenome = request.getParameter("sobrenome"); String rg = request.getParameter("rg"); String cpf = request.getParameter("cpf"); String sexo = request.getParameter("sexo"); StringBuilder finalDate = new StringBuilder("DataNascimento1") .append("/"+request.getParameter("DataNascimento??2")) .append("/"+request.getParameter("DataNascimento3")); try { SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); finalDate.toString(); } catch(ParseException e) { out.println("Erro de conversão da data"); return; } Contato contato = new Contato(); contato.setNome(nome); contato.setSobrenome(sobrenome); contato.setRg(rg); contato.setCpf(cpf); contato.setSexo(sexo); if ("Masculino".equals(contato.getSexo())) { contato.setSexo("M"); } else { contato.setSexo("F"); } contato.setDataNascimento1(dataNascimento1); //error here ????? contato.setDataNascimento2(dataNascimento2); //error here ????? contato.setDataNascimento3(dataNascimento3); //error here ????? Cadastro dao = new Cadastro(); dao.adiciona(contato); out.println("<html>"); out.println("<body>"); out.println("Contato " + contato.getNome() + " adicionado com sucesso"); out.println("</body>"); out.println("</html>"); } } My object dao package br.com.cad.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Date; import br.com.cad.dao.ConnectDb; import br.com.cad.basica.Contato; public class Cadastro { private Connection connection; public Cadastro() { this.connection = new ConnectDb().getConnection(); } public void adiciona(Contato contato) { String sql = "INSERT INTO dados_cadastro(pf_nome, pf_ultimonome, pf_rg, pf_cpf, pf_sexo,pf_dt_nasc) VALUES(?,?,?,?,?,?,?,?)"; try { PreparedStatement stmt = connection.prepareStatement(sql); stmt.setString(1, contato.getNome()); stmt.setString(2, contato.getSobrenome()); stmt.setString(3, contato.getRg()); stmt.setString(4, contato.getCpf()); stmt.setString(5, contato.getSexo()); stmt.setDate(6, new Date( contato.getDataNascimento1().getTimeInMillis()) ); // i think there are error here i don't know to solve it ????? stmt.execute(); stmt.close(); System.out.println("Cadastro realizado com sucesso!."); } catch(SQLException sqlException) { throw new RuntimeException(sqlException); } } } My class cadastro package br.com.cad.basica; import java.util.Calendar; public class Contato { private Long id; private String nome; private String sobrenome; private String email; private String endereco; private Calendar dataNascimento1; private Calendar dataNascimento2; private Calendar dataNascimento3; private String rg; private String cpf; private String sexo; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } ...getters and setters I need to saving data in my mysql db, but i have some doubt about this code main how to get parameter send form html combobox( 1 for day, 2 for month, 3 for year of birth) i concatened with StringBuilder finalDate ... so i have some problem in my code please help me!!!

    Read the article

  • Configuration for Router Behind Uverse 2Wire

    - by Nori
    I have a 2Wire Uverse router(RG). I'm not particularly fond of it and want to use it as a modem only. I have a Linksys router with Tomato firmware on it and want that to be configured as the router. Most of the "guides" I've seen in my searches has been to enable DMZ Plus mode, but I don't see a way to make that work while my router has a static IP address. I played with it for quite some time yesterday and didn't see a way to get it to work. Then I ran across a setting in broadband for configuring another network. I played with that for a little bit but ran out of time and couldn't get it to work. So my question is for anyone out there who has Uverse and successfully setup a Tomato based firmware router behind the RG. How did you get it configured? I'm sure if I continued playing with it I could get it to work, but if someone out there already has it working then that would make my life easier. Thoughts? Thanks.

    Read the article

  • Count requests from access log for the last 7 days

    - by RoboForm
    I would like to parse an access log file and have returned the amount of requests, for the last 7 days. I have this command cut -d'"' -f3 /var/log/apache/access.log | cut -d' ' -f2 | sort | uniq -c | sort -rg Unfortunately, this command returns the amount of requests since the creation of the file and sorts it into HTTP-code categories. I would like just a number, no categories and only for the last 7 days. Thanks.

    Read the article

  • Fast Track Data Warehouse 3.0 Reference Guide

    - by jchang
    Microsoft just release Fast Track Data Warehouse 3.0 Reference Guide version. The new changes are increased memory recommendation and the disks per RAID group change from 2-disk RAID 1 to 4-Disk RAID 10. Memory The earlier FTDW reference architecture cited 4GB memory per core. There was no rational behind this, but it was felt some rule was better than no rule. The new FTDW RG correctly cites the rational that more memory helps keep hash join intermediate results and sort operations in memory. 4-Disk...(read more)

    Read the article

  • JavaScript Regex Problem

    - by oraclee
    Hi all; Csharp Regex Pattern: Regex rg = new Regex("(?i)(?<=>)[^<]+(?=</TD>)"); JavaScript Regex Pattern: var pattern = (?i)(?<=>)[^<]+(?=</TD>); var result = str.match(pattern); Csharp Regex pattern work, but javascript regex pattern not work pls help ?

    Read the article

  • displaying special characters in hyperlink text

    - by swati
    i have used html in my java class and in one case i have used username.Username is a variable which gets values dynamically. in one case its value is 'rg@bg' but here instead of d name i m getting d url which it is directed to in my jsp. how do i ensure tht d value of username comes on d display page as it is. i have tried "@"+username. didnt work

    Read the article

  • Enable compiz on intel core i5 (Nvidia GT330M) based laptop

    - by Eshwar
    Hi, I am trying to enable compiz on my laptop via Desktop Effects but it does not allow it. I modified the xorg.conf file as on the compiz wiki but still no luck. So can someone just tell me how to enable compiz desktop on an Intel i5 based system. This is an Arrandale processor so its got the graphics bit on the processor itself. My system also has a discrete graphics card (Nvidia GT330M - yup its those hybrid graphics combos n- not Optimus). As far as i know the nvidia gpu is not being used since the intel one is enabled and there is no bios route to disable it. The laptop is a Dell Vostro 3700 with bios version A10 I did lotsa google searches about intel compiz, etc but not a single conclusive guide as to how to enable it. so my guess is it should work out of the box. but it doesn't. glxinfo gives me: name of display: :0.0 Xlib: extension "GLX" missing on display ":0.0". Xlib: extension "GLX" missing on display ":0.0". Xlib: extension "GLX" missing on display ":0.0". Xlib: extension "GLX" missing on display ":0.0". Xlib: extension "GLX" missing on display ":0.0". Error: couldn't find RGB GLX visual or fbconfig Xlib: extension "GLX" missing on display ":0.0". Xlib: extension "GLX" missing on display ":0.0". Xlib: extension "GLX" missing on display ":0.0". Xlib: extension "GLX" missing on display ":0.0". Xlib: extension "GLX" missing on display ":0.0". Xlib: extension "GLX" missing on display ":0.0". Xlib: extension "GLX" missing on display ":0.0". 3 GLXFBConfigs: visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat ---------------------------------------------------------------------- Segmentation fault lsbusb gives me: 00:02.0 VGA compatible controller [0300]: Intel Corporation Core Processor Integrated Graphics Controller [8086:0046] (rev 18) 01:00.0 VGA compatible controller [0300]: nVidia Corporation GT216 [GeForce GT 330M] [10de:0a29] (rev a2)

    Read the article

1 2  | Next Page >