Search Results

Search found 456 results on 19 pages for 'joshua dance'.

Page 8/19 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How To Access Namespace Elements In MXML Using Actionscript

    - by Joshua
    In Actionscript... If I Have an XML variable that equals this: var X:XML=XML("<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:ns1="Tools.*" minWidth="684" minHeight="484" creationComplete="Init();" xmlns:ns3="Components.*" initialize="I()"/>"); And I try to list the attributes via: var AList:XMList=X.attributes(); The three namespaces, "xmlns:mx","xmlns:ns1", and "xmlns:ns3" aren't listed among the attributes! How can I access this information programmatically?

    Read the article

  • unable to inject seam cache provider

    - by Joshua
    Env: Seam 2.2, ehcache-core 2.1.0 I tried injecting the CacheProvider using the following call in my bean scoped for session @In CacheProvider cacheProvider; WEB-INF\components.xml contains the following line to enable the cache provider <cache:eh-cache-provider/> The above configuration seems to return a null value for the cache provider Using the cache provider like this CacheProvider cacheProvider = CacheProvider.instance(); throws the following warning 15:29:27,586 WARN [CacheManager] Creating a new instance of CacheManager using the diskStorePath "C:\DOCUME~1\user5\LOCALS~1\Temp\" which is already used by an existing CacheManager. The source of the configuration was net.sf.ehcache.config.generator.Configuratio nSource$DefaultConfigurationSource@15ed0f9. The diskStore path for this CacheManager will be set to C:\DOCUME~1\user5\LOCALS ~1\Temp\\ehcache_auto_created_1276682367586. To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache .xml) for each CacheManager instance. What am I missing here?

    Read the article

  • Subclassing UIButton.

    - by Joshua
    I would like to subclass UIButton so I can give it a fill image, left side image and right side image which I can't do in IB. All I can do in IB is give it a full background image which would mean the background would get stretched if the text was larger than the image. How would I do this? as unlike NSButton, there is no UIButtonCell class.

    Read the article

  • PHP detmine numbers in between two numbers then query

    - by Joshua Anderson
    This should be simple but I can't figure it out <?php $testid = 240; $curid = 251; $cal = $curid - $testid; echo $cal; ?> I want to determine the numbers in between two other numbers so for this example it detects there are 11 numbers in between the $testid and $curid, but i dont need it to do that. I need it to literally figure the numbers in between $curid - $testid which in this example would be 241, 242, 243... all the way to 251 then i need to create a loop with those numbers and do a query below with each one $cal = $curid - $testid; mysql_query("SELECT * FROM wall WHERE id='".$cal."'") // and for each number mysql should out put each data field with those numbers. Thanks again, love you guys.

    Read the article

  • Why does vbkeyup produce different results than vbkeydown does in this Code.

    - by Joshua Rhoads
    I have a VB6 app. It consists of a flexgrid. I have code to allow the user to press the up or down arrow key to switch rows in the grid. When the down arrow key is pressed the cursor is placed at the end of the text in the next row, but when the Up arrow key is pressed the cursor is placed in the middle of the text of the previous row. Anybody have any explantion for this. Private Sub Command1_Click() With MSFlexGrid1 .Cols = 4 .Rows = 5 .FixedCols = 1 .FixedRows = 1 MSFlexGrid1.TextMatrix(0, 1) = "FROM" MSFlexGrid1.TextMatrix(0, 2) = "THRU" MSFlexGrid1.TextMatrix(0, 3) = "PAGE" MSFlexGrid1.TextMatrix(1, 1) = "Aa" MSFlexGrid1.TextMatrix(1, 2) = "Az" MSFlexGrid1.TextMatrix(1, 3) = "-" MSFlexGrid1.TextMatrix(2, 1) = "Ba" MSFlexGrid1.TextMatrix(2, 2) = "Bz" MSFlexGrid1.TextMatrix(2, 3) = "-" MSFlexGrid1.TextMatrix(3, 1) = "Ca" MSFlexGrid1.TextMatrix(3, 2) = "Cz" MSFlexGrid1.TextMatrix(3, 3) = "-" MSFlexGrid1.TextMatrix(4, 1) = "Da" MSFlexGrid1.TextMatrix(4, 2) = "Dz" MSFlexGrid1.TextMatrix(4, 3) = "-" End With End Sub Private Sub Command2_Click() End End Sub Private Sub Form_Load() Text1.Visible = False End Sub Private Sub MSFlexGrid1_DblClick() FlexGridEdit Asc(" ") Exit Sub End Sub Private Sub FlexGridEdit(KeyAscii As Integer) Text1.Left = MSFlexGrid1.CellLeft + MSFlexGrid1.Left Text1.Top = MSFlexGrid1.CellTop + MSFlexGrid1.Top Text1.Width = MSFlexGrid1.ColWidth(MSFlexGrid1.Col) - 2 * (MSFlexGrid1.ColWidth (MSFlexGrid1.Col) - MSFlexGrid1.CellWidth) Text1.Height = MSFlexGrid1.RowHeight(MSFlexGrid1.Row) - 2 * (MSFlexGrid1.RowHeight(MSFlexGrid1.Row) - MSFlexGrid1.CellHeight) Text1.MaxLength = 2 Text1.Visible = True Text1.SetFocus Select Case KeyAscii Case 0 To Asc(" ") Text1.Text = MSFlexGrid1.Text Text1.SelStart = Len(Text1.Text) Case Else Text1.Text = Chr$(KeyAscii) Text1.SelStart = 1 End Select Exit Sub End Sub Function ValidateFlexGrid1() As Boolean Dim llCntrRow As Integer Dim llCntrCol As Integer Dim max_len As Single Dim new_len As Single Dim liCntr As Integer Dim lsCheck As String With MSFlexGrid1 If Text1.Visible Then .Text = Text1.Text If .Rows = .FixedRows Then ValidateFlexGrid1 = False End If For llCntrCol = .FixedCols To MSFlexGrid1.Cols - 1 For llCntrRow = .FixedRows To MSFlexGrid1.Rows - 1 If .TextMatrix(llCntrRow, llCntrCol) = "" Then ValidateFlexGrid1 = False Exit Function End If Next llCntrRow Next llCntrCol End With ValidateFlexGrid1 = True Exit Function End Function Private Sub Text1_Keydown(KeyCode As Integer, Shift As Integer) Select Case KeyCode Case vbKeyRight, vbKeyLeft, vbKeyReturn If Text1.Visible = True Then If Text1.Text = "/" Then If MSFlexGrid1.Row > 1 Then Text1.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row - 1, MSFlexGrid1.Col) Text1.SelStart = Len(Text1.Text) End If End If MSFlexGrid1.Text = Text1.Text If KeyCode = vbKeyRight Or KeyCode = vbKeyReturn Then If Text1.SelStart = Len(Text1.Text) Then FlexGridChkPos KeyCode FlexGridEdit Asc(" ") End If Else If Text1.SelStart = 0 Then FlexGridChkPos KeyCode FlexGridEdit Asc(" ") End If End If End If Case vbKeyDown, vbKeyUp If Text1.Visible = True Then MSFlexGrid1.Text = Text1.Text FlexGridChkPos KeyCode FlexGridEdit Asc(" ") End If End Select Exit Sub End Sub Function FlexGridChkPos(KeyCode As Integer) As Boolean Dim llNextRow As Long Dim llNextCol As Long Dim llCurrCol As Long Dim llCurrRow As Long Dim llTotCols As Long Dim llTotRows As Long Dim llBegRow As Long Dim llBegCol As Long Dim llCntrCol As Long Dim lsText As String With MSFlexGrid1 llCurrRow = .Row + 1 llCurrCol = .Col + 1 llTotRows = .Rows llTotCols = .Cols llBegRow = .FixedRows llBegCol = .FixedCols If KeyCode = vbKeyRight Or KeyCode = vbKeyReturn Then llNextCol = llCurrCol + 1 If llNextCol > llTotCols Then llNextRow = llCurrRow + 1 If llNextRow > llTotRows Then .Rows = .Rows + 1 llCurrRow = llCurrRow + 1 llCurrCol = 1 + llBegCol Else llCurrRow = llNextRow llCurrCol = 1 + llBegCol End If Else llCurrCol = llNextCol End If End If If KeyCode = vbKeyLeft Then llNextCol = llCurrCol - 1 If llNextCol = llBegCol Then llNextRow = llCurrRow - 1 If llNextRow = llBegRow Then llCurrRow = llTotRows Else llCurrRow = llNextRow End If llCurrCol = llTotCols Else llCurrCol = llNextCol End If End If If KeyCode = vbKeyUp Then llNextRow = llCurrRow - 1 If llNextRow = llBegRow Then llCurrRow = llTotRows Else llCurrRow = llNextRow End If End If If KeyCode = vbKeyDown Then llNextRow = llCurrRow + 1 If llNextRow > llTotRows Then llCurrRow = llBegRow + 1 Else llCurrRow = llNextRow End If End If .Col = llCurrCol - 1 .Row = llCurrRow - 1 End With Exit Function End Function

    Read the article

  • Creating a Custom UIButton.

    - by Joshua
    I am looking to create a Custom UIButton (not subclass) progrmatically, I would like it to have a background image that will stretch as the UIButton's width increases. How would I do this?

    Read the article

  • List of Django model instance foreign keys losing consistency during state changes.

    - by Joshua
    I have model, Match, with two foreign keys: class Match(model.Model): winner = models.ForeignKey(Player) loser = models.ForeignKey(Player) When I loop over Match I find that each model instance uses a unique object for the foreign key. This ends up biting me because it introduces inconsistency, here is an example: >>> def print_elo(match_list): ... for match in match_list: ... print match.winner.id, match.winner.elo ... print match.loser.id, match.loser.elo ... >>> print_elo(teacher_match_list) 4 1192.0000000000 2 1192.0000000000 5 1208.0000000000 2 1192.0000000000 5 1208.0000000000 4 1192.0000000000 >>> teacher_match_list[0].winner.elo = 3000 >>> print_elo(teacher_match_list) 4 3000 # Object 4 2 1192.0000000000 5 1208.0000000000 2 1192.0000000000 5 1208.0000000000 4 1192.0000000000 # Object 4 >>> I solved this problem like so: def unify_refrences(match_list): """Makes each unique refrence to a model instance non-unique. In cases where multiple model instances are being used django creates a new object for each model instance, even if it that means creating the same instance twice. If one of these objects has its state changed any other object refrencing the same model instance will not be updated. This method ensure that state changes are seen. It makes sure that variables which hold objects pointing to the same model all hold the same object. Visually this means that a list of [var1, var2] whose internals look like so: var1 --> object1 --> model1 var2 --> object2 --> model1 Will result in the internals being changed so that: var1 --> object1 --> model1 var2 ------^ """ match_dict = {} for match in match_list: try: match.winner = match_dict[match.winner.id] except KeyError: match_dict[match.winner.id] = match.winner try: match.loser = match_dict[match.loser.id] except KeyError: match_dict[match.loser.id] = match.loser My question: Is there a way to solve the problem more elegantly through the use of QuerySets without needing to call save at any point? If not, I'd like to make the solution more generic: how can you get a list of the foreign keys on a model instance or do you have a better generic solution to my problem? Please correct me if you think I don't understand why this is happening.

    Read the article

  • Translating CURL to FLEX HTTPRequests

    - by Joshua
    I am trying to convert from some CURL code to FLEX/ActionScript. Since I am 100% ignorant about CURL and 50% ignorant about Flex and 90% ignorant on HTTP in general... I'm having some significant difficulty. The following CURL code is from http://code.google.com/p/ga-api-http-samples/source/browse/trunk/src/v2/accountFeed.sh I have every reason to believe that it's working correctly. USER_EMAIL="[email protected]" #Insert your Google Account email here USER_PASS="secretpass" #Insert your password here googleAuth="$(curl https://www.google.com/accounts/ClientLogin -s \ -d Email=$USER_EMAIL \ -d Passwd=$USER_PASS \ -d accountType=GOOGLE \ -d source=curl-accountFeed-v2 \ -d service=analytics \ | awk /Auth=.*/)" feedUri="https://www.google.com/analytics/feeds/accounts/default\ ?prettyprint=true" curl $feedUri --silent \ --header "Authorization: GoogleLogin $googleAuth" \ --header "GData-Version: 2" The following is my abortive attempt to translate the above CURL to AS3 var request:URLRequest=new URLRequest("https://www.google.com/analytics/feeds/accounts/default"); request.method=URLRequestMethod.POST; var GoogleAuth:String="$(curl https://www.google.com/accounts/ClientLogin -s " + "-d [email protected] " + "-d Passwd=secretpass " + "-d accountType=GOOGLE " + "-d source=curl-accountFeed-v2" + "-d service=analytics " + "| awk /Auth=.*/)"; request.requestHeaders.push(new URLRequestHeader("Authorization", "GoogleLogin " + GoogleAuth)); request.requestHeaders.push(new URLRequestHeader("GData-Version", "2")); var loader:URLLoader=new URLLoader(); loader.dataFormat=URLLoaderDataFormat.BINARY; loader.addEventListener(Event.COMPLETE, GACompleteHandler); loader.addEventListener(IOErrorEvent.IO_ERROR, GAErrorHandler); loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, GAErrorHandler); loader.load(request); This probably provides you all with a good laugh, and that's okay, but if you can find any pity on me, please let me know what I'm missing. I readily admit functional ineptitude, therefore letting me know how stupid I am is optional.

    Read the article

  • Finding the last focused element

    - by Joshua Cody
    I'm looking to determine which element had the last focus in a series of inputs, that are added dynamically by the user. This code can only get the inputs that are available on page load: $('input.item').focus(function(){ $(this).siblings('ul').slideDown(); }); And this code sees all elements that have ever had focus: $('input.item').live('focus', function(){ $(this).siblings('ul').slideDown(); }); The HTML structure is this: <ul> <li><input class="item" name="goals[]"> <ul> <li>long list here</li> <li>long list here</li> <li>long list here</li> </ul></li> </ul> <a href="#" id="add">Add another</a> On page load, a single input loads. Then with each add another, a new copy of the top unordered list's contents are made and appended, and the new input gets focus. When each gets focus, I'd like to show the list beneath it. But I don't seem to be able to "watch for the most recently focused element, which exists now or in the future." To clarify: I'm not looking for the last occurrence of an element in the DOM tree. I'm looking to find the element that currently has focus, even if said element is not present upon original page load. So in the above image, if I were to focus on the second element, the list of words should appear under the second element. My focus is currently on the last element, so the words are displayed there. Do I have some sort of fundamental assumption wrong?

    Read the article

  • Error Creating View From Importing MysqlDump

    - by Joshua
    I don't speak SQL... Please, anybody help me. What does this mean?: Error SQL query: /*!50001 CREATE ALGORITHM=UNDEFINED *//*!50001 VIEW `v_sr_videntity` AS select `t`.`c_id` AS `ID`,`User`.`c_id` AS `UserID`,`videntityfingerprint`.`ID` AS `VIdentityFingerPrintID`,`videntityfingerprint`.`FingerPrintID` AS `FingerPrintID`,`videntityfingerprint`.`FingerPrintFingerPrint` AS `FingerPrintFingerPrint` from ((`t_SR_u_Identity` `t` join `t_SR_u_User` `User` on((`User`.`c_r_Identity` = `t`.`c_id`))) join `vi_sr_videntity_0` `VIdentityFingerPrint` on((`videntityfingerprint`.`c_r_Identity` = `t`.`c_id`))) */; MySQL said: #1054 - Unknown column 'videntityfingerprint.ID' in 'field list' What does this mean? What is it expecting? How do I fix it? This file was created by mysqldump, so why are there errors when I import it?

    Read the article

  • Problem with WiX major upgrade!

    - by Joshua
    Okay, my last question on this journey of WiX upgrades managed to get my settings file to be preserved! However, There is another component that is being preserved that I don't want to! I need it to overwrite, and it's not. The component "Settings" now works, with the NeverOverwrite="yes", and a KeyPath="yes". However, the component immediately below it does not work! It needs to overwrite both the MDF and the LDF with new ones from the install! I've tried lots of stuff, and am stumped. Please and thank you! Here is the components: <DirectoryRef Id="CommonAppDataPathways"> <Component Id="CommonAppDataPathwaysFolderComponent" Guid="087C6F14-E87E-4B57-A7FA-C03FC8488E0D"> <CreateFolder> <Permission User="Everyone" GenericAll="yes" /> </CreateFolder> <RemoveFolder Id="CommonAppDataPathways" On="uninstall" /> <!-- <RegistryValue Root="HKCU" Key="Software\TDR\Pathways" Name="installed" Type="integer" Value="1" KeyPath="yes" />--> </Component> <Component Id="Settings" Guid="A3513208-4F12-4496-B609-197812B4A953" NeverOverwrite="yes"> <File Id="settingsXml" KeyPath="yes" ShortName="SETTINGS.XML" Name="Settings.xml" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\Settings\settings.xml" Vital="yes" /> </Component> <Component Id="Database" Guid="1D8756EF-FD6C-49BC-8400-299492E8C65D"> <File KeyPath="yes" Id="pathwaysMdf" Name="Pathways.mdf" DiskId="1" Source="\\fileserver\Shared\Databases\Pathways\SystemDBs\Pathways.mdf" /> <File Id="pathwaysLdf" Name="Pathways_log.ldf" DiskId="1" Source="\\fileserver\Shared\Databases\Pathways\SystemDBs\Pathways.ldf" /> <RemoveFile Id="pathwaysMdf" Name="Pathways.mdf" On="uninstall" /> <RemoveFile Id="pathwaysLdf" Name="Pathways_log.ldf" On="uninstall" /> </Component> </DirectoryRef> And here is the features: <Feature Id="App" Title="Pathways Application" Level="1" Description="Pathways software" Display="expand" ConfigurableDirectory="INSTALLDIR" Absent="disallow" AllowAdvertise="no" InstallDefault="local"> <ComponentRef Id="Application" /> <ComponentRef Id="CommonAppDataPathwaysFolderComponent" /> <ComponentRef Id="Settings"/> <ComponentRef Id="ProgramsMenuShortcutComponent" /> <Feature Id="Shortcuts" Title="Desktop Shortcut" Level="1" Absent="allow" AllowAdvertise="no" InstallDefault="local"> <ComponentRef Id="DesktopShortcutComponent" /> </Feature> </Feature> <Feature Id="Data" Title="Database" Level="1" Absent="allow" AllowAdvertise="no" InstallDefault="local"> <ComponentRef Id="Database" /> </Feature> And here is the InstallExecuteSequence: <InstallExecuteSequence> <RemoveExistingProducts After="InstallFinalize"/> </InstallExecuteSequence> What am I doing wrong?

    Read the article

  • Checking if a touch is withing a UIButton's bounds.

    - by Joshua
    I am trying to make an if statement which will check whether the users touch is within a UIButton's bounds. I thought this would be an easy affair as UIButton is a subclass of UIView, however my code doesn't seem to work. This is the code I have been using. - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { NSArray *array = [touches allObjects]; UITouch *specificTouch = [array objectAtIndex:0]; currentTouch = [specificTouch locationInView:self.view]; if (CGRectContainsPoint(but.bounds, currentTouch)) { //Do something is in bounds. } //Else do nothing. }

    Read the article

  • alternative ways to display a list

    - by joshua
    Hi everyone, I know on how to display a list by using loop. For example, choice(a):-write('This is the top 15 countries list:'),nl, loop(X). loop(X):-country(X),write(X),nl,fail. Unfortunately,I don't know on how to display list by using list.anyone can guide me?

    Read the article

  • How to repeat a particular execution multiple times

    - by Joshua
    The following snippet generates create / drop sql for a particular database, whenever there is a modification to JPA entity classes. How do I perform something equivalent of a 'for' operation where-in the following code can be used to generate sql for all supported databases (e.g. H2, MySQL, Postgres) Currently I have to modify db.groupId, db.artifactId, db.driver.version everytime to generate the sql files <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>hibernate3-maven-plugin</artifactId> <version>${hibernate3-maven-plugin.version}</version> <executions> <execution> <id>create schema</id> <phase>process-test-resources</phase> <goals> <goal>hbm2ddl</goal> </goals> <configuration> <componentProperties> <persistenceunit>${app.module}</persistenceunit> <drop>false</drop> <create>true</create> <outputfilename>${app.sql}-create.sql</outputfilename> </componentProperties> </configuration> </execution> <execution> <id>drop schema</id> <phase>process-test-resources</phase> <goals> <goal>hbm2ddl</goal> </goals> <configuration> <componentProperties> <persistenceunit>${app.module}</persistenceunit> <drop>true</drop> <create>false</create> <outputfilename>${app.sql}-drop.sql</outputfilename> </componentProperties> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>${hibernate-core.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>${slf4j-api.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-nop</artifactId> <version>${slf4j-nop.version}</version> </dependency> <dependency> <groupId>${db.groupId}</groupId> <artifactId>${db.artifactId}</artifactId> <version>${db.driver.version}</version> </dependency> </dependencies> <configuration> <components> <component> <name>hbm2cfgxml</name> <implementation>annotationconfiguration</implementation> </component> <component> <name>hbm2dao</name> <implementation>annotationconfiguration</implementation> </component> <component> <name>hbm2ddl</name> <implementation>jpaconfiguration</implementation> <outputDirectory>src/main/sql</outputDirectory> </component> <component> <name>hbm2doc</name> <implementation>annotationconfiguration</implementation> </component> <component> <name>hbm2hbmxml</name> <implementation>annotationconfiguration</implementation> </component> <component> <name>hbm2java</name> <implementation>annotationconfiguration</implementation> </component> <component> <name>hbm2template</name> <implementation>annotationconfiguration</implementation> </component> </components> </configuration> </plugin>

    Read the article

  • Rake uninitialized constant RDoc::RDoc

    - by Joshua
    When ever I run make I get this 'uninitialized constant RDoc::RDoc' error rake -T (in Main) rake aborted! uninitialized constant RDoc::RDoc C:/Ruby186/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile' (See full trace by running task with --trace) --edit Running --trace it seems the only non rails code is from rdoc_rails. Since other people seem to be able to run it fine I assume I am missing a gem or plugin but I can't figure out which.

    Read the article

  • Changing Base Path In PHP

    - by Joshua
    I need to change the folder that "relative include paths" are based on. I might currently be "in" this folder: C:\ABC\XYZ\123\ZZZ And in this case, the path "../../Source/SomeCode.php" would actually be in this folder: C:\ABC\XYZ\Source And realpath('.') would = 'C:\ABC\XYZ\123\ZZZ'; If however, realpath('.') were "C:\Some\Other\Folder" Then in this case, the path "../../Source/SomeCode.php" would actually be in this folder: C:\Some\Source How do I change what folder is represented by '.' in realpath()? Like this: echo ('BEFORE = '.realpath('.')); // BEFORE = C:\ABC\XYZ\123\ZZZ // Some PHP code here... echo ('AFTER = '.realpath('.')); // AFTER = C:\Some\Other\Folder How can I change the folder represented by '.', as seen by realpath()?

    Read the article

  • How can I turn a SimpleXML object to array, then shuffle?

    - by Joshua Cody
    Crux of my problem: I've got an XML file that returns 20 results. Within these results are all the elements I need to get. Now, I need to return them in a random order, and be able to specifically work with item 1, items 2-5, and items 6-17. Idea 1: Use this script to convert the object to an array, which I can shuffle through. This is close to working, but a few of the elements I need to get are under a different namespace, and I don't seem to be able to get them. Code: /* * Convert a SimpleXML object into an array (last resort). * * @access public * @param object $xml * @param boolean $root - Should we append the root node into the array * @return array */ function xmlToArray($xml, $root = true) { if (!$xml->children()) { return (string)$xml; } $array = array(); foreach ($xml->children() as $element => $node) { $totalElement = count($xml->{$element}); if (!isset($array[$element])) { $array[$element] = ""; } // Has attributes if ($attributes = $node->attributes()) { $data = array( 'attributes' => array(), 'value' => (count($node) > 0) ? xmlToArray($node, false) : (string)$node // 'value' => (string)$node (old code) ); foreach ($attributes as $attr => $value) { $data['attributes'][$attr] = (string)$value; } if ($totalElement > 1) { $array[$element][] = $data; } else { $array[$element] = $data; } // Just a value } else { if ($totalElement > 1) { $array[$element][] = xmlToArray($node, false); } else { $array[$element] = xmlToArray($node, false); } } } if ($root) { return array($xml->getName() => $array); } else { return $array; } } $thumbfeed = simplexml_load_file('http://gdata.youtube.com/feeds/api/videos?q=skadaddlemedia&max-results=20&orderby=published&prettyprint=true'); $xmlToArray = xmlToArray($thumbfeed); $thumbArray = $xmlToArray["feed"]; for($n = 0; $n < 18; $n++){ $title = $thumbArray["entry"][$n]["title"]["value"]; $desc = $thumbArray["entry"][0]["content"]["value"]; $videoUrl = $differentNamespace; $thumbUrl = $differentNamespace; } Idea 2: Continue using my working code that is getting the information using a foreach, but store each element in an array, then use shuffle on that. I'm not precisely sure hwo to write to an array within a foreach loop and not write over one another, though. Working code: foreach($thumbfeed->entry as $entry){ $thumbmedia = $entry->children('http://search.yahoo.com/mrss/') ->group ; $thumb = $thumbmedia->thumbnail[0]->attributes()->url; $thumburl = $thumbmedia->content[0]->attributes()->url; $thumburl1 = explode("http://www.youtube.com/v/", $thumburl[0]); $thumbid = explode("?f=videos&app=youtube_gdata", $thumburl1[1]); $thumbtitle = $thumbmedia->title; $thumbyt = $thumbmedia->children('http://gdata.youtube.com/schemas/2007') ->duration ; $thumblength = $thumbyt->attributes()->seconds; } Ideas on if either of these are good solutions to my problem, and if so, how I can get over my execution humps? Thanks so much for any help you can give.

    Read the article

  • Finding out if an IP address is static or dynamic?

    - by Joshua
    I run a large bulletin board and I get spammers every now and again. My moderation team does a good job filtering them out but every time I IP ban them they seem to come back (I'm pretty sure it's the same person on some occasions, as the post patterns are exactly the same as are the usernames) but I'm afraid to ban them by IP address every time. If they are on a dynamic IP address, I could be banning innocent users later down the line when they try to get to my forum through SERPs, but if I ban only via static IPs I know that I'm only banning that one person. So, is there a way to properly determine if an IP address is static or dynamic? Thanks.

    Read the article

  • Can't log in: Error occurred while sending a direct message or getting the response

    - by Joshua Gitlin
    This belongs on Meta but I can't ask it there since, well, I can't log in :-) I'm unable to log into my account using my OpenID, josh.gitlin.name on either StackOverflow or Meta. The error message I receive after entering my OpenID on the login page and pressing "Login" is: Unable to log in with your OpenID provider: Error occurred while sending a direct message or getting the response My alternate OpenID hmblprogrammer.pip.verisignlabs.com doesn't work either. Anything I can try? (And is there any way this question can be associated with my account even though I'm not logged in?)

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >