Search Results

Search found 115 results on 5 pages for 'att'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Understanding tcptraceroute versus http response

    - by kojiro
    I'm debugging a web server that has a very high wait time before responding. The server itself is quite fast and has no load, so I strongly suspect a network problem. Basically, I make a web request: wget -O/dev/null http://hostname/ --2013-10-18 11:03:08-- http://hostname/ Resolving hostname... 10.9.211.129 Connecting to hostname|10.9.211.129|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: ‘/dev/null’ 2013-10-18 11:04:11 (88.0 KB/s) - ‘/dev/null’ saved [13641] So you see it took about a minute to give me the page, but it does give it to me with a 200 response. So I try a tcptraceroute to see what's up: $ sudo tcptraceroute hostname 80 Password: Selected device en2, address 192.168.113.74, port 54699 for outgoing packets Tracing the path to hostname (10.9.211.129) on TCP port 80 (http), 30 hops max 1 192.168.113.1 0.842 ms 2.216 ms 2.130 ms 2 10.141.12.77 0.707 ms 0.767 ms 0.738 ms 3 10.141.12.33 1.227 ms 1.012 ms 1.120 ms 4 10.141.3.107 0.372 ms 0.305 ms 0.368 ms 5 12.112.4.41 6.688 ms 6.514 ms 6.467 ms 6 cr84.phlpa.ip.att.net (12.122.107.214) 19.892 ms 18.814 ms 15.804 ms 7 cr2.phlpa.ip.att.net (12.122.107.117) 17.554 ms 15.693 ms 16.122 ms 8 cr1.wswdc.ip.att.net (12.122.4.54) 15.838 ms 15.353 ms 15.511 ms 9 cr83.wswdc.ip.att.net (12.123.10.110) 17.451 ms 15.183 ms 16.198 ms 10 12.84.5.93 9.982 ms 9.817 ms 9.784 ms 11 12.84.5.94 14.587 ms 14.301 ms 14.238 ms 12 10.141.3.209 13.870 ms 13.845 ms 13.696 ms 13 * * * … 30 * * * I tried it again with 100 hops, just to be sure – the packets never get there. So how is it that the server does respond to requests via http, even after a minute? Shouldn't all requests just die? I'm not sure how to proceed debugging why this server is slow (as opposed to why it responds at all).

    Read the article

  • Why does 'sort' ignore special characters, like the asterisk?

    - by Aaron Digulla
    I thought that sort would sort common prefixes together but that doesn't always happen. Take this input for example: AT0S*eightieths AT0S*eyetooth's AT*ad AT*Ad AT*AD AT*Eydie AT*eyed ATF*adv ATF*ATV ATF*edify ATF*Ediva ATFKT*advocate ATFKTNK*advocating ATFKT*outfought ATFKTS*advocates ATHT*whitehead ATHT*Whitehead AT*id AT*I'd AT*Ito AT*IUD ATJ*adage ATNXNS*attention's ATNXNS*attenuation's ATNXNS*autoignition's AT*oat AT*OD AT*outweigh AT*owed ATP0K*idiopathic ATP*adobe ATT*wighted ATT*witted ATT*wooded AT*UT AT*Uta AT*wowed AT*Wyatt ATX*atishoo After sort, I'd expect all the AT* to end up in one chunk but when you run this data through sort, the output == input. Why is that? I'm not specifying any option to ignore non-alphabetic characters or anything. Just sort dict > out. My version of sort comes from coreutils 8.5-1ubuntu3.

    Read the article

  • Bash script throws, "syntax error near unexpected token `}'" when ran

    - by Tab00
    I am trying to write a script to monitor some battery statuses on a laptop running as a server. To accomplish this, I have already started to write this code: #! /bin/bash # A script to monitor battery statuses and send out email notifications #take care of looping the script for (( ; ; )) do #First, we check to see if the battery is present... if(cat /proc/acpi/battery/BAT0/state | grep 'present: *' == present: yes) { #Code to execute if battery IS present #No script needed for our application #you may add scripts to run } else { #if the battery IS NOT present, run this code sendemail -f [email protected] -t 214*******@txt.att.net -u NTA TV Alert -m "The battery from the computer is either missing, or removed. Please check ASAP." -s smtp.gmail.com -o tls=yes -xu [email protected] -xp *********** } #Second, we check into the current state of the battery if(cat /proc/acpi/battery/BAT0/state | grep 'charging state: *' == 'charging state: charging') { #Code to execute if battery is charging sendemail -f [email protected] -t 214*******@txt.att.net -u NTA TV Alert -m "The battery from the computer is charging. This MIGHT mean that something just happened" -s smtp.gmail.com -o tls=yes -xu [email protected] -xp *********** } #If it isn't charging, is it discharging? else if(cat /proc/acpi/battery/BAT0/state | grep 'charging state: *' == 'charging state: discharging') { #Code to run if the battery is discharging sendemail -f [email protected] -t 214*******@txt.att.net -u NTA TV Alert -m "The battery from the computer is discharging. This shouldn't be happening. Please check ASAP." -s smtp.gmail.com -o tls=yes -xu [email protected] -xp *********** } #If it isn't charging or discharging, is it charged? else if(cat /proc/acpi/battery/BAT0/state | grep 'charging state: *' == 'charging state: charged') { #Code to run if battery is charged } done I'm pretty sure that most of the other stuff works correctly, but I haven't been able to try it because it will not run. whenever I try and run the script, this is the error that I get: ./BatMon.sh: line 15: syntax error near unexpected token `}' ./BatMon.sh: ` }' is the error something super simple like a forgotten semicolon? Thanks -Tab00

    Read the article

  • MVC Model architecture

    - by ATT
    I'm getting into CodeIgniter and trying to figure out the good architecture for my models. What kind of models would you create for the following simple example: list page of blog entries: shows part of the entry data, number of comments blog entry page: shows all the entry data, comment list (with part of the comment data) comment page: shows all the comment data I'm trying to get this right so that it's simple and effective. I don't want to load too much information (from the db) on the pages where I don't need them. E.g. should the same entry model handle both multiple entries as well as a single entry? And how should the comments be loaded? I only need the number of comments on the multiple entries (list) page but some of the comment data on the single entry page. How would you handle this?

    Read the article

  • Accessing E4X nodes having special characters in name without breaking binding chain in flex.

    - by Jonas
    I am using E4X to bind some values from xml in flex 3. There is a problem when xml tag's (or attribute's) name has special character in it: having xml content var xml:XML = <tag> <special-name att="val" /> </tag> special-name could not be accessed using xml.special-name.@att because it is interpreted as subtraction, on the other hand using square bracket notation xml['special-name'].@att breaks binding chain. Is there an elegant way to solve this (like special language syntax) without writing custom binding setters and listeners?

    Read the article

  • Could not load file or assembly System.EnterpriseServices

    - by Nifle
    I'm trying to read up on asp.net mvc, I have never used asp.net before but are familiar with regular c# development. Freshly installed, fully patched Windows XP Home. Freshly installed updated to SP1 Visual Studio 2008 Pro. Started a new project, selected "ASP.NET MVC Web Application", target framework is 3.5 I hit F5 and I get: "Could not load file or assembly System.EnterpriseServices" Exact wording in swedish: [FileNotFoundException: Det går inte att hitta filen. (Undantag från HRESULT: 0x80070002)] [FileNotFoundException: Det går inte att läsa in filen eller sammansättningen System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a eller ett av dess beroenden. Det går inte att hitta filen.] Adding a reference to System.EnterpriseServices in my project did not work. A quick google suggested I copy this file Microsoft.NET/Framework/v2.0.50727/System.EnterpriseServices.dll into %WINDOWS%/assembly but that did not work either. Any suggestions? Found the answer, I added it to the GAC with gacutil. C:\WINDOWS"C:\Program\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe" /i Microsoft.NET/Framework/v2.0.50727/System.EnterpriseServices.dll

    Read the article

  • Powershell script to send e-mails, losing text in e-mail attachment

    - by Beuy
    I have the following function to send e-mails in powershell with attachments: function SendMail(){ if($e -ine '') { $mail = New-Object System.Net.Mail.MailMessage $mail.From = $f; $mail.To.Add($t); $mail.Subject = $s; $att = New-Object System.Net.Mail.Attachment –ArgumentList $l $mail.Attachments.Add($att) $mail.Body = $b; $smtp = New-Object System.Net.Mail.SmtpClient($serv); $smtp.Send($mail); } } When I try to send a .txt file attachment it seems to strip out all of the information from within the text file. Any suggestions as to what's going wrong?

    Read the article

  • eMail with Conflicting Headers not blocked in MS365

    - by John Meredith Langstaff
    On occasion, a company receives eMail with two header fields (“Received” and “From”) containing data that contradict each other drastically. Should they not expect their anti-spam system to flag or block items with contradictions in these fields? For example, they received an eMail which contained [almost exactly] these two headers: Received: from [107.52.51.26] by web315204.mail.ne1.yahoo.com via HTTP; Mon,28 Oct 2013 04:28:04 PDT From: Barry Smith [email protected] Obviously, eMail from an @att.net address isn’t coming from a server on the domain yahoo.com, and Yahoo isn’t forwarding AT&T’s eMail. There were no other headers indicating that the item was sent “OnBehalfOf”, or “Forwarded-by”, or “By_Proxy” or any other such. Should I write a utility to scan incoming eMail for such conflicts, or look more closely at their spam filtering to block this kind of eMail? Their eMail system is Hosted Exchange on MS-365. My central question is, where specifically do I look in MS-365 to get this type of conflicted eMail blocked?

    Read the article

  • Powershell script to send e-mails, loosing text in e-mail attachment

    - by Beuy
    I have the following function to send e-mails in powershell with attachments: function SendMail(){ if($e -ine '') { $mail = New-Object System.Net.Mail.MailMessage $mail.From = $f; $mail.To.Add($t); $mail.Subject = $s; $att = New-Object System.Net.Mail.Attachment –ArgumentList $l $mail.Attachments.Add($att) $mail.Body = $b; $smtp = New-Object System.Net.Mail.SmtpClient($serv); $smtp.Send($mail); } } When I try to send a .txt file attachment it seems to strip out all of the information from within the text file. Any suggestions as to what's going wrong?

    Read the article

  • How to detect device type from device connected to router?

    - by molly
    I have a att router and there is an unknown device connected to my network. I can't seem to kick it off because of how att's router settings are created which is kind of dumb. I am able to see its local ip and mac address. I am on a mac with snow leopard. How can I get more information on the device with the information that I have? I want to see what kind of device it is, I have checked all devices that are connected to the router and none seem to match the local ip that is connected. I have WPA encryption setup with a strong password.

    Read the article

  • how to detect device type from connected device to router?

    - by molly
    i have a att router and there is an unknown device connected to my network. i cant seem to kick it off because of how att's router settings are created which is kind of dumb. i am able to see its local ip and mac address. i am on a mac with snow leopard. how can i get more information on the device with the information that i have? i want to see what kind of device it is, i have checked all deviced that are connected to the router and non seem to match the local ip that is connected. i have wpa encryption setup with a strong password.

    Read the article

  • How do I reconstruct depth in deferred rendering using an orthographic projection?

    - by Jeremie
    I've been trying to get my world space position of my pixel but I4m missing something. I'm using a orthographic view for a 2.5d game. My depth is linear and this is my code. float3 lightPos = lightPosition; float2 texCoord = PostProjToScreen(PSIn.lightPosition)+halfPixel; float depth = tex2D(depthMap, texCoord); float4 position; position.x = texCoord.x *2-1; position.y = (1-texCoord.y)*2-1; position.z = depth.r; position.w = 1; position = mul(position, inViewProjection); //position.xyz/=position.w; // I comment it but even without it it doesn't work float4 normal = (tex2D(normalMap, texCoord)-.5f) * 2; normal = normalize(normal); float3 lightDirection = normalize(lightPos-position); float att = saturate(1.0f - length(lightDirection) /attenuation); float lightning = saturate (dot(normal, lightDirection)); lightning*= brightness; return float4(lightColor* lightning*att, 1); I'm using a sphere but it's not working the way I want. I reproject the texture properly onto the sphere but the light coordinates in the pixel shader seems to be stuck at zero even if when I move the light volume update properly.

    Read the article

  • Storage model for various user setting and attributes in database?

    - by dvd
    I'm currently trying to upgrade a user management system for one web application. This web application is used to provide remote access to various networking equipment for educational purposes. All equipment is assigned to various pods, which users can book for periods of time. The current system is very simple - just 2 user types: administrators and students. All their security and other attributes are mostly hardcoded. I want to change this to something like the following model: user <-- (1..n)profile <--- (1..n) attributes. I.e. user can be assigned several profiles and each profile can have multiple attributes. At runtime all profiles and attributes are merged into single active profile. Some examples of attributes i'm planning to implement: EXPIRATION_DATE - single value, value type: date, specifies when user account will expire; ACCESS_POD - single value, value type: ref to object of Pod class, specifies which pod the user is allowed to book, user profile can have multiple such attributes with different values; TIME_QUOTA - single value, value type: integer, specifies maximum length of time for which student can reserve equipment. CREDIT_CHARGING - multi valued, specifies how much credits will be assigned to user over period of time. (Reservation of devices will cost credits, which will regenerate over time); Security permissions and user preferences can end up as profile or user attributes too: i.e CAN_CREATE_USERS, CAN_POST_NEWS, CAN_EDIT_DEVICES, FONT_SIZE, etc.. This way i could have, for example: students of course A will have profiles STUDENT (with basic attributes) and PROFILE A (wich grants acces to pod A). Students of course B will have profiles: STUDENT, PROFILE B(wich grants to pod B and have increased time quotas). I'm using Spring and Hibernate frameworks for this application and MySQL for database. For this web application i would like to stay within boundaries of these tools. The problem is, that i can't figure out how to best represent all these attributes in database. I also want to create some kind of unified way of retrieveing these attributes and their values. Here is the model i've come up with. Base classes. public abstract class Attribute{ private Long id; Attribute() {} abstract public String getName(); public Long getId() {return id; } void setId(Long id) {this.id = id;} } public abstract class SimpleAttribute extends Attribute{ public abstract Serializable getValue(); abstract void setValue(Serializable s); @Override public boolean equals(Object obj) { ... } @Override public int hashCode() { ... } } Simple attributes can have only one value of any type (including object and enum). Here are more specific attributes: public abstract class IntAttribute extends SimpleAttribute { private Integer value; public Integer getValue() { return value; } void setValue(Integer value) { this.value = value;} void setValue(Serializable s) { setValue((Integer)s); } } public class MaxOrdersAttribute extends IntAttribute { public String getName() { return "Maximum outstanding orders"; } } public final class CreditRateAttribute extends IntAttribute { public String getName() { return "Credit Regeneration Rate"; } } All attributes stored stored using Hibenate variant "table per class hierarchy". Mapping: <class name="ru.mirea.rea.model.abac.Attribute" table="ATTRIBUTES" abstract="true" > <id name="id" column="id"> <generator class="increment" /> </id> <discriminator column="attributeType" type="string"/> <subclass name="ru.mirea.rea.model.abac.SimpleAttribute" abstract="true"> <subclass name="ru.mirea.rea.model.abac.IntAttribute" abstract="true" > <property name="value" column="intVal" type="integer"/> <subclass name="ru.mirea.rea.model.abac.CreditRateAttribute" discriminator-value="CreditRate" /> <subclass name="ru.mirea.rea.model.abac.MaxOrdersAttribute" discriminator-value="MaxOrders" /> </subclass> <subclass name="ru.mirea.rea.model.abac.DateAttribute" abstract="true" > <property name="value" column="dateVal" type="timestamp"/> <subclass name="ru.mirea.rea.model.abac.ExpirationDateAttribute" discriminator-value="ExpirationDate" /> </subclass> <subclass name="ru.mirea.rea.model.abac.PodAttribute" abstract="true" > <many-to-one name="value" column="podVal" class="ru.mirea.rea.model.pods.Pod"/> <subclass name="ru.mirea.rea.model.abac.PodAccessAttribute" discriminator-value="PodAccess" lazy="false"/> </subclass> <subclass name="ru.mirea.rea.model.abac.SecurityPermissionAttribute" discriminator-value="SecurityPermission" lazy="false"> <property name="value" column="spVal" type="ru.mirea.rea.db.hibernate.customTypes.SecurityPermissionType"/> </subclass> </subclass> </class> SecurityPermissionAttribute uses enumeration of various permissions as it's value. Several types of attributes imlement GrantedAuthority interface and can be used with Spring Security for authentication and authorization. Attributes can be created like this: public final class AttributeManager { public <T extends SimpleAttribute> T createSimpleAttribute(Class<T> c, Serializable value) { Session session = HibernateUtil.getCurrentSession(); T att = null; ... att = c.newInstance(); att.setValue(value); session.save(att); session.flush(); ... return att; } public <T extends SimpleAttribute> List<T> findSimpleAttributes(Class<T> c) { List<T> result = new ArrayList<T>(); Session session = HibernateUtil.getCurrentSession(); List<T> temp = session.createCriteria(c).list(); result.addAll(temp); return result; } } And retrieved through User Profiles to which they are assigned. I do not expect that there would be very large amount of rows in the ATTRIBUTES table, but are there any serious drawbacks of such design?

    Read the article

  • How would I use HTMLAgilityPack to extract the value I want

    - by Nai
    For the given HTML I want the value of id <div class="name" id="john-5745844"> <div class="name" id="james-6940673"> UPDATE This is what I have at the moment HtmlDocument htmlDoc = new HtmlDocument(); htmlDoc.Load(new StringReader(pageResponse)); HtmlNode root = htmlDoc.DocumentNode; List<string> anchorTags = new List<string>(); foreach (HtmlNode div in root.SelectNodes("//div[@class='name' and @id]")) { HtmlAttribute att = div.Attributes["id"]; Console.WriteLine(att.Value); } The error I am getting is at the foreach line stating: Object reference not set to an instance of an object.

    Read the article

  • get value of Checkbox in datagrid

    - by Himadri
    I am working with windows application. I have a datagrid in vb.net. Its first column is a checkbox. I want to know which checkboxes are checked and which are not. My code is : Dim dr As DataGridViewRow For i = 0 To gdStudInfo.RowCount - 1 dr = gdStudInfo.Rows(i) att = dr.Cells(0).Value.ToString() If att.Equals("Present") Then qry = "insert into Stu_Att_Detail values(" & id & "," & gdStudInfo.Rows(i).Cells(1).Value.ToString() & ",'" & dr.Cells(0).Value.ToString() & "')" con.MyQuery(qry) End If Next I am getting correct values for all checked check box, but it gets error when the checkbox is not checked.

    Read the article

  • Getting publish_stream extended permission from the user

    - by José Joel.
    I was ussing Facbook connect in my iPhone app, but in december the posts stopped working. After some research I found that i'm supossed to use stream.publish, something like: NSString *att = @"{\"bob\":\"i\'m happy\",\"caption\": \"User rated the internet 5 stars\", \"description\": \"a giant cat\"}"; NSDictionary *attachment = [NSDictionary dictionaryWithObject:att forKey:@"attachment"]; [[FBRequest requestWithDelegate:self] call:@"facebook.stream.publish" params:attachment]; Which i think it's correct, but the posts still don't work. Someone told me that i need to get publish_stream extended permission from the user, but i dont know how to do that.

    Read the article

  • An appropriate C API for inspecting attribute values

    - by uk82
    There are two obvious ways in C to provide outside access to internal attribute values (A) provide a generic interface that accepts a list of attributes that changes over time (some added / some die) or (B) a specific interface for each and every attribute. Example A: int x_get_attribute_value(ATT att) { if (a) return a_val; if (b) return b_val; } Example B: A_Enum x_get_a_type_attribute() {} B_Enum x_get_b_type_attribute() {} I recall that Eclipse's API is very much like A (I could be wrong). What I can't do is come up with a compelling argument against either. A is clean - any user will no where to go to find out a property value. It can evolve cleanly without leaving dead interfaces around. B has type checking to a degree - this is C enums! Is there a big hitter argument that pushes the balance away from opinion?

    Read the article

  • libjpcap.so on Ubuntu for AT&T ARO

    - by Geertjan
    I now have AT&T ARO also running on Ubuntu, in addition to the Windows scenario I blogged about earlier: I managed to get it up and running thanks again to Doug Sillars, who pointed me here: http://developer.att.com/developer/forward.jsp?passedItemId=14100207&passedItemId=14100207 My plan is to make a screencast soon on HOW to port something like ARO, i.e., as an example of how to do something similar yourself, to a plugin for NetBeans IDE, as a follow up to Five Simple Ways to Extend NetBeans IDE. Thanks again, Doug.

    Read the article

  • The Alienware M11xR3 has arrived

    - by Enrique Lima
    A week or so ago, I mentioned my gear was evolving.  The newest member of my gear arrived yesterday, an Alienware M11xR3. Here are the specs: Intel Core i7-2617M 1.5GHz (2.6GHz Turbo Mode, 4MB Cache) NVIDIA GeForce GT540 graphics with 2.0GB Video Memory and Optimus 16GB Dual Channel DDR3 at 1333MHz 11.6in High Def (720p/1366x768) with WLED backlight 750GB 7200RPM SATA 3Gb/s Soundblaster X-Fi Hi Def Audio - Software Enabled Intel Advanced-N WiFi Link 6250 a/g/n 2x2 MIMO Technology with WiMax Gobi Mobile Broadband with GPS - supports ATT with contract Internal Bluetooth 3.0   Some pics from the unboxing event:

    Read the article

  • AT&T Upload Filtering?

    - by xpda
    Using an AT&T DSL, I cannot ftp upload or ftp download a few files of a large 1500 set. The problem is the file name. I can change a few characters of the file name, and they upload fine. I can change the filenames from upper to lower case and they upload fine. If I change back to the original filename, it will not upload again. When it doesn't upload, it starts, transfers about 5% of a 5-10 meg file, and then times out. I have uploaded one of the files under a different name, changed the name back to the original, and it will not download via ftp. It will download onto a browser, and it will ftp download just fine with a different name. It just will not download with ftp. I have reproduced this uploading to three different servers on 1and1 and Amazon EC2. When I try it on a non-AT&T ISP client, it works OK. Here is a file that did not upload until I had renamed it. (I have changed it back to the original name): "http://xpda.com/nautnew/11302 STOVER POINT TO PORT BROWNSVILLE SIDE A.png" This problem is unrelated to connection, speed, and file content. Only things I can see that makes a difference are the file name and ATT DSL. Does ATT have some kind of ftp file filtering? Is there anything else that could cause this behavior?

    Read the article

  • Trying get dynamic content hole-punched through Magento's Full Page Cache

    - by rlflow
    I am using Magento Enterprise 1.10.1.1 and need to get some dynamic content on our product pages. I am inserting the current time in a block to quickly see if it is working, but can't seem to get through full page cache. I have tried a variety of implementations found here: http://tweetorials.tumblr.com/post/10160075026/ee-full-page-cache-hole-punching http://oggettoweb.com/blog/customizations-compatible-magento-full-page-cache/ http://magentophp.blogspot.com/2011/02/magento-enterprise-full-page-caching.html (http://www.exploremagento.com/magento/simple-custom-module.php - custom module) Any solutions, thoughts, comments, advice is welcome. here is my code: app/code/local/Fido/Example/etc/config.xml <?xml version="1.0"?> <config> <modules> <Fido_Example> <version>0.1.0</version> </Fido_Example> </modules> <global> <blocks> <fido_example> <class>Fido_Example_Block</class> </fido_example> </blocks> </global> </config> app/code/local/Fido/Example/etc/cache.xml <?xml version="1.0" encoding="UTF-8"?> <config> <placeholders> <fido_example> <block>fido_example/view</block> <name>example</name> <placeholder>CACHE_TEST</placeholder> <container>Fido_Example_Model_Container_Cachetest</container> <cache_lifetime>86400</cache_lifetime> </fido_example> </placeholders> </config> app/code/local/Fido/Example/Block/View.php <?php /** * Example View block * * @codepool Local * @category Fido * @package Fido_Example * @module Example */ class Fido_Example_Block_View extends Mage_Core_Block_Template { private $message; private $att; protected function createMessage($msg) { $this->message = $msg; } public function receiveMessage() { if($this->message != '') { return $this->message; } else { $this->createMessage('Hello World'); return $this->message; } } protected function _toHtml() { $html = parent::_toHtml(); if($this->att = $this->getMyCustom() && $this->getMyCustom() != '') { $html .= '<br />'.$this->att; } else { $now = date('m-d-Y h:i:s A'); $html .= $now; $html .= '<br />' ; } return $html; } } app/code/local/Fido/Example/Model/Container/Cachetest.php <?php class Fido_Example_Model_Container_Cachetest extends Enterprise_PageCache_Model_Container_Abstract { protected function _getCacheId() { return 'HOMEPAGE_PRODUCTS' . md5($this->_placeholder->getAttribute('cache_id') . $this->_getIdentifier()); } protected function _renderBlock() { $blockClass = $this->_placeholder->getAttribute('block'); $template = $this->_placeholder->getAttribute('template'); $block = new $blockClass; $block->setTemplate($template); return $block->toHtml(); } protected function _saveCache($data, $id, $tags = array(), $lifetime = null) { return false; } } app/design/frontend/enterprise/[mytheme]/template/example/view.phtml <?php /** * Fido view template * * @see Fido_Example_Block_View * */ ?> <div> <?php echo $this->receiveMessage(); ?> </span> </div> snippet from app/design/frontend/enterprise/[mytheme]/layout/catalog.xml <reference name="content"> <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml"> <block type="fido_example/view" name="product.info.example" as="example" template="example/view.phtml" />

    Read the article

  • Retrieve enum value based on XmlEnumAttribute name value

    - by CletusLoomis
    I need a Generic function to retrieve the name or value of an enum based on the XmlEnumAttribute "Name" property of the enum. For example I have the following enum defined: Public Enum Currency <XmlEnum("00")> CDN = 1 <XmlEnum("01")> USA= 2 <XmlEnum("02")> EUR= 3 <XmlEnum("03")> JPN= 4 End Enum The first Currency enum value is 1; the enum name is "CDN"; and the XMLEnumAttribute Name property value is "00". If I have the enum value, I can retrieve the XmlEnumAttribute "Name" value using the following generic function: Public Function GetXmlAttrNameFromEnumValue(Of T)(ByVal pEnumVal As T) As String Dim type As Type = pEnumVal.GetType Dim info As FieldInfo = type.GetField([Enum].GetName(GetType(T), pEnumVal)) Dim att As XmlEnumAttribute = CType(info.GetCustomAttributes(GetType(XmlEnumAttribute), False)(0), XmlEnumAttribute) 'If there is an xmlattribute defined, return the name Return att.Name End Function So using the above function, I can specify the Currency enum type, pass a value of 1, and the return value will be "00". What I need is a function to perform if the opposite. If I have the XmlEnumAttribute Name value "00", I need a function to return a Currency enum with a value of 1. Just as useful would be a function that would return the enum name "CDN". I could then simply parse this to get the enum value. Any assistance would be appreciated.

    Read the article

  • SQL Server 2008 need just like crosstab query on XML column?

    - by user1332896
    <abc id="abc1"> <def id="def1"> <ghi att='ghi1'> <mn id="0742d2ea" name="RF" dt="0" df="3" ty="0" /> <mn id="64d9a11b" name="CJ" dt="0" df="3" ty="0" /> <mn id="db72d154" name="FJ" dt="2" df="4" ty="0" /> <mn id="39af9fa1" name="BS" dt="0" df="2" ty="0" /> </ghi> <jkl att='jkl1'> <mn id="0742d2ea" name="RF" dt="1" gl="19" /> <mn id="64d9a11b" name="CJ" dt="0" gl="6" /> <mn id="db72d154" name="FJ" dt="0" gl="0" /> <mn id="39af9fa1" name="BS" dt="0" gl="12" /> <mn id="ac4f566f" name="DJ" dt="0" gl="9" /> <mn id="4bf3ba2f" name="RP" dt="0" gl="16" /> <mn id="db1af021" name="SC" dt="1" gl="10" /> <mn id="c4c93a2d" name="DN" dt="1" gl="15" /> </jkl> </def> </abc> I need this output. Is this possible in SQL Server 2008? id name ghiDT ghiDF ghiTY jklDT jklGL 0742d2ea RF 0 3 0 1 19 64d9a11b CJ 0 3 0 0 6 db72d154 FJ 2 4 0 0 0 39af9fa1 BS 0 2 0 0 12 ac4f566f DJ 0 0 0 0 9 4bf3ba2f RP 0 0 0 0 16 db1af021 SC 0 0 0 1 10 c4c93a2d DN 0 0 0 1 15

    Read the article

  • Access class instance "name" dynamically in Python

    - by user328317
    In plain english: I am creating class instances dynamically in a for loop, the class then defines a few attributes for the instance. I need to later be able to look up those values in another for loop. Sample code: class A: def init(self, name, attr): self.name=name self.attr=attr names=("a1", "a2", "a3") x=10 for name in names: name=A(name, x) x += 1 ... ... ... for name in names: print name.attr How can I create an identifier for these instances so they can be accessed later on by "name"? I've figured a way to get this by associating "name" with the memory location: class A: instances=[] names=[] def init(self, name, attr): self.name=name self.attr=attr A.instances.append(self) A.names.append(name) names=("a1", "a2", "a3") x=10 for name in names: name=A(name, x) x += 1 ... ... ... for name in names: index=A.names.index(name) print "name: " + name print "att: " + str(A.instances[index].att) This has had me scouring the web for 2 days now, and I have not been able to find an answer. Maybe I don't know how to ask the question properly, or maybe it can't be done (as many other posts seemed to be suggesting). Now this 2nd example works, and for now I will use it. I'm just thinking there has to be an easier way than creating your own makeshift dictionary of index numbers and I'm hoping I didn't waste 2 days looking for an answer that doesn't exist. Anyone have anything? Thanks in advance, Andy Update: A coworker just showed me what he thinks is the simplest way and that is to make an actual dictionary of class instances using the instance "name" as the key.

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >