Search Results

Search found 4060 results on 163 pages for '400 the cat'.

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

  • Microsoft signed drivers appears as publisher not verfied

    - by Priyanka Gupta
    Task at hand: Microsoft sign drivers on Win 7. I microsoft signed my driver package 3 times every time thinking I might have missed a step or something. However, I cannot seem to get rid of the Windows Security error message "Windows can't verify the publisher of this driver software'. This is not the first time I have signed the driver packages. I was successfully able to sign other driver packages a few months ago. However, with this driver package I keep getting Windows security dialog box. Here's the procedure I follow - Create a new cat file using INF2CAT tool. Self sign the driver using a Versign Class 3 Public Primary Certification Authority - G5.cer. Run the microsoft tests on DTM Servers and clients with the devices that use this driver. Create WLK submission package. Self sign the cab file. Submit the package for certification. The catalog file that comes back after successfully passing tests says Name of signer "Microsoft Windows Hardware Comptibility Publisher". When I check the validity of signature using SignTool, it says the signature is vaild. However, when I try to install the driver with new signed catalog file the windows complain. Any ideas? Edit 11/12/2012: Reply to Eugene's comment Thanks for the help, Eugene. Yes. I did sign two other driver packages before. One of them was modified version of WinUSB driver. I am using the same certificate I used when I signed those two driver packages a few months ago. It costs $250 per signing from Microsoft. I would think that Microsoft would complain about it during certification if the certificate is wrong. I use the following command to self sign the CAT file. I don't have to specify the ceritificate name as there's only one certificate in the directory - Signtool sign /v /a /n CompanyName /t http://timestamp.verisign.com/scripts/timestamp.dll OurCatalogFile.cat Below is the result from running Verify command on the Microsoft signed OutCatalogFile.cat C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\x64signtool verify /v "C:\User s\logotest\Documents\serialdriversigning\OurCatalogFile.cat" Verifying: C:\Users\logotest\Documents\serialdriversigning\OurCatalogFile.cat" Hash of file (sha1): BDDF39B1DD95881B462164129758A7FFD54F47D9 Signing Certificate Chain: Issued to: Microsoft Root Certificate Authority Issued by: Microsoft Root Certificate Authority Expires: Sun May 09 18:28:13 2021 SHA1 hash: CDD4EEAE6000AC7F40C3802C171E30148030C072 Issued to: Microsoft Windows Hardware Compatibility PCA Issued by: Microsoft Root Certificate Authority Expires: Thu Jun 04 16:15:46 2020 SHA1 hash: 8D42419D8B21E5CF9C3204D0060B19312B96EB78 Issued to: Microsoft Windows Hardware Compatibility Publisher Issued by: Microsoft Windows Hardware Compatibility PCA Expires: Wed Sep 18 18:20:55 2013 SHA1 hash: D94345C032D23404231DD3902F22AB1C2100341E The signature is timestamped: Tue Nov 06 11:26:48 2012 Timestamp Verified by: Issued to: Microsoft Root Authority Issued by: Microsoft Root Authority Expires: Thu Dec 31 02:00:00 2020 SHA1 hash: A43489159A520F0D93D032CCAF37E7FE20A8B419 Issued to: Microsoft Timestamping PCA Issued by: Microsoft Root Authority Expires: Sun Sep 15 02:00:00 2019 SHA1 hash: 3EA99A60058275E0ED83B892A909449F8C33B245 Issued to: Microsoft Time-Stamp Service Issued by: Microsoft Timestamping PCA Expires: Tue Apr 09 16:53:56 2013 SHA1 hash: 1895C2C907E0D7E5C0292B92C6EA8D0E236F525E Successfully verified: C:\Users\logotest\Documents\serialdriversigning\OurCatalogFile.cat" Number of files successfully Verified: 1 Number of warnings: 0 Number of errors: 0 Thank you!

    Read the article

  • Nhibernate, mapping as (n)varchar max ?

    - by Quandary
    Question: In nHiberne, I map a string like this: [NHibernate.Mapping.Attributes.Property(Name = "MLST_Description", Type = "String", Length = 400)] which maps string to nvarchar(400) This one [NHibernate.Mapping.Attributes.Property(Name = "MLST_Description", Type = "String")] maps to nvarchar(255) But how can I map to nvarchar(max) ?

    Read the article

  • How to resize QInputDialog, PyQt

    - by siege
    I am getting input with this here areaInput = QtGui.QInputDialog.getText(self, "Copy Area", "New Area Name:", 0) However I would like to make the dialog box larger, I've tried things such as QtGui.QInputDialog.resize(400, 400) However it says "the first argument must be a QWidget class" and I'm not quite sure what this means or how to fix it. Thanks.

    Read the article

  • Fatal error: Uncaught exception 'Exception' in PHPExcel classes

    - by Chakrapani
    Can any one please let me know, why this following error has been thrown from PHPExcel classes Fatal error: Uncaught exception 'Exception' with message 'Could not close zip file /var/www/mydomain/myexcel.xlsx.' in /var/www/mydomain/Classes/PHPExcel/Writer /Excel2007.php:400 Stack trace: #0 /var/www/mydomain/myexcel.php(173): PHPExcel_Writer_Excel2007->save('/var/www/mydomain...') #1 {main} thrown in /var/www/mydomain/Classes/PHPExcel/Writer/Excel2007.php on line 400

    Read the article

  • Java2d: JPanel set background color not working

    - by Algorist
    I am having the below code. public VizCanvas(){ { this.setBackground(Color.black); this.setSize(400,400); } } It worked fine and displays the panel in black background. But when I implement the paint method, which does nothing, the color changes to default color i.e gray. I tried to set graphics.setColor() but it didn't help. Thank you.

    Read the article

  • How to get the clicked element in a dynamically built JQuery Treeview?

    - by Alexander
    I have a product database with several product categories. Each category has a number of sub-categories, which has sub-sub-categories, which has... Well, quite some levels deep. The tree is too huge to load at once, so I need to built it dynamically as users select specific product categories. Here's a snapshot of the product tree. Initially, only the first level is loaded. The second level (Cat. 1.1 and cat. 1.2) is added when the user clicks on cat. 1: <ul id="navigation"> <li id="625212">Product cat. 1 <ul> <li id="625213">Product cat. 1.1 <ul></ul> </li> <li id="625109">Product cat. 1.2 <ul></ul> </li> </ul> </li> <li id="624990">Product cat. 2 <ul></ul> </li> </ul> I intend to extend the tree as users click on specific product categories. I can get the list of sub-categories from a URL that takes the parent product category ID as input and outputs HTML in the format needed by treeview. I cannot use PHP and have to make this work with the .click() event. Here's the code that I have: $(document).ready(function(){ function doSomethingWithData(htmldata, id) { var branches = $(htmldata).appendTo("#navigation #"+id+" ul"); $("#navigation").treeview({ add: branches }); } $("#navigation").treeview({ collapsed: true, unique: true, persist: "location" }); $("#navigation li[id]").click(function() { var id=$(this).attr("id"); if ($("#"+$(this).attr("id")+" ul li").size()==0) { $.get('someurl?id='+$(this).attr("id"), function(data) { doSomethingWithData(data, id); } ) } }); }); The problem I'm having is with the click-event. When clicking on cat 1.1. to extend it one level deeper, it still returns the ID of the top level product category. How can I change the click events so that it will return the ID of the clicked <LI> instead of the top one? If the product category does not have any sub-categories, how can I remove the <UL></UL> and thus inidcating that the tree cannot be expanded any further?

    Read the article

  • How do I retrieve a list of base class objects without joins using NHibernate ICriteria?

    - by Kristoffer
    Let's say I have a base class called Pet and two subclasses Cat and Dog that inherit Pet. I simply map these to three tables Pet, Cat and Dog, where the Pet table contains the base class properties and the Cat and Dog tables contain a foreign key to the Pet table and any additional properties specific to a cat or dog. A joined subclass strategy. Now, using NHibernate and ICriteria, how can I get a list of "pure" Pet objects (not cats or dogs, just pets), without making any joins to the other tables?

    Read the article

  • Signal Handling in C

    - by Dave
    How can I implement signal Handling for Ctrl-C and Ctrl-D in C....So If Ctrl-C is pressed then the program will ignore and try to get the input from the user again...If Ctrl-D is pressed then the program will terminate... My program follows: int main(){ char msg[400]; while(1){ printf("Enter: "); fgets(msg,400,stdin); printf("%s\n",msg); } } Thanks, Dave

    Read the article

  • How to “unbind” .result on Jquery Autocomplete?

    - by Cesar
    I have this code: $("#xyz").unautocomplete().autocomplete(dataVar, { minChars: 0, width: 400, matchContains: true, highlightItem: true, formatItem: formatItem, formatResult: formatResult }) .result(findValueCallback).next().click(function() { $(this).prev().search(); }); I call this code many times and the first call works correctly, but after he calls findValueCallback many times, not once more. The unautocomplete don't clear .result What I have to do for call findValueCallback once? Sample Code: var niveis01 = []; var niveis02 = []; var niveis03 = []; $(document).ready(function(){ carregaDadosNivel1(); }); function carregaDadosNivel1() { $.ajax({ url: "http://.....", cache: true, type: "POST", dataType:"json", success: function(data){ ... niveis01 = data; habilitaComboNivel1(); ... }, error: function(xhr, ajaxOptions, thrownError){ ... } }); } function habilitaComboNivel1() { function findValueCallback1(event, data01, formatted) { ... carregaDadosNivel2(); ... } $("#nivel01").unautocomplete().autocomplete(niveis01, { minChars: 0, width: 400, matchContains: true, highlightItem: true, formatItem: formatItem, formatResult: formatResult }).result(findValueCallback1).next().click(function() { $(this).prev().search(); }); } function carregaDadosNivel2() { $.ajax({ url: "http://.....", cache: true, type: "POST", dataType:"json", success: function(data){ ... niveis02 = data; habilitaComboNivel2(); ... }, error: function(xhr, ajaxOptions, thrownError){ ... } }); } function habilitaComboNivel2() { function findValueCallback2(event, data02, formatted) { ... carregaDadosNivel3(); ... } $("#nivel02").unautocomplete().autocomplete(niveis02, { minChars: 0, width: 400, matchContains: true, highlightItem: true, formatItem: formatItem, formatResult: formatResult }).result(findValueCallback2).next().click(function() { $(this).prev().search(); }); } function carregaDadosNivel3() { $.ajax({ url: ""http://.....", cache: true, type: "POST", dataType:"json", success: function(data){ ... niveis03 = data; habilitaComboNivel3(); ... }, error: function(xhr, ajaxOptions, thrownError){ ... } }); } function habilitaComboNivel3() { function findValueCallback3(event, data03, formatted) { ... } $("#nivel03").unautocomplete().autocomplete(niveis03, { minChars: 0, width: 400, matchContains: true, highlightItem: true, formatItem: formatItem, formatResult: formatResult }).result(findValueCallback3).next().click(function() { $(this).prev().search(); }); }

    Read the article

  • two galleryView on the same page problem!

    - by user334922
    I'm using two galleryView on the same page, but the navigation control get crazy, and navigate the worng gallery sometimes.i think is because the gallery create the frame with the same name. how can i fix? $('#photos').galleryView({ panel_width: 650, panel_height: 400, frame_width: 60, frame_height: 60, transition_speed: 1200, transition_interval:0, border: 'none', nav_theme: 'dark' }); $('#videos').galleryView({ panel_width: 650, panel_height: 400, frame_width: 60, frame_height: 60, transition_speed: 1200, transition_interval:0, border: 'none', nav_theme: 'dark' });

    Read the article

  • Quick help with some jQuery toggle

    - by mplacona
    I have the following code: <script> $(document).ready(function() { $('.toggle_section').click(function(e){ parent = $(e.target).closest("div") objChild = parent.children('div'); $('.sectionContentId').hide(400); $(objChild).toggle(400); }); }); </script> <br /> <div class="box" id="parent_section_1"> <strong> <a class="toggle_section" href="javascript:;">New Section 1</a> </strong> <div class="sectionContentId" id="section_1" style="display: none"> <br /> Contents<br />for<br />section<br />1 </div> </div> <br /> <div class="box" id="parent_section_2"> <strong> <a class="toggle_section" href="javascript:;">New Section 2</a> </strong> <div class="sectionContentId" id="section_2" style="display: none"> <br /> Contents<br />for<br />section<br />2 </div> </div> And example can be seen here As you can see, what I'm trying to accomplish is that when you click on one of the links, all the other "already expanded sections" collapse, and the clicked section expand. this works fine as it is, but obviously by using the logic: $('.sectionContentId').hide(400); $(objChild).toggle(400); When I click one of the expanded sections in the attempt to close it, it closes briefly and opens again. I wanna keep the same functionality, but wanna be able to open and close a section by clicking on a link, as well as when I'm opening a section, I wan't it to close everything before opening this new section. I'm not sure I'm being very clear here, but by looking at the example, you will be able to understand better what I mean. Thnks in advance

    Read the article

  • Issues loading SWF with External SWF Files - using SWFObject and ExternalInterface

    - by wdense51
    I'm having issues with loading a SWF that references external SWF files... The main SWF loads fine if the HTML file is in the same folder as all the SWFs using the following code: <script type="text/javascript" src="../js/swfobject.js"></script> <script type="text/javascript"> var flashvars = {}; var params = { allowScriptAccess: "always" }; params.quality = "high"; params.wmode = "transparent"; var attributes = {id:"IDofSWF", name:"IDofSWF"}; swfobject.embedSWF("event_so_js.swf", "flashContent", "700", "400", "7.0.0", false, flashvars, params, attributes);</script> </head> <body> <div id="flashContent"> <object data="event_so_js.swf" name="IDofSWF" id="IDofSWF" type="application/x-shockwave-flash" width="700" height="400"></object></div> But as soon as I move the HTML file out of that folder to the root folder and update the links, it doesn't load correctly - it seems that it's having trouble with the external SWF files. I did have it successfully load one of the external SWF files directly, but it's having trouble with the main SWF. All of the SWF files are in the same folder, so I don't know why it's having issues. Here's the code for the HTML file when it's in the root folder: <script type="text/javascript" src="js/swfobject.js"></script> <script type="text/javascript"> var flashvars = {}; var params = { allowScriptAccess: "always" }; params.quality = "high"; params.wmode = "transparent"; var attributes = {id:"IDofSWF", name:"IDofSWF"}; swfobject.embedSWF("folio/event_so_js.swf", "flashContent", "700", "400", "9.0.0", false, flashvars, params, attributes);</script> </head> <body> <div id="flashContent"> <object data="folio/event_so_js.swf" name="IDofSWF" id="IDofSWF" type="application/x-shockwave-flash" width="700" height="400"></object></div> There is also a link on the page that calls a function in the actionscript using ExternalInterface, so it could be that causing the issues. The code for the link is: <a href="#" onclick="document.getElementById('IDofSWF').clicky()"> Any help would be awesome, because it's really confusing me.

    Read the article

  • Keyboard selecting nested li's with jquery

    - by Joel
    I have a load of nested <ul>'s and <li>'s and I would like to be able to have a hover / selected class on an <li>, and use the keyboard up and down buttons to select up and down on the <li>s.. however they are nested and need to jump across <ul>s if necessary. For instance: <ul> <li class='cat'> cat 1 <ul> <li class='hover'>item 1</li> <li>item 2</li> <li>item 3</li> <li>item 4</li> </ul> </li> <li class='cat'> cat 2 <ul> <li>item 5</li> <li>item 6</li> <li>item 7</li> <li>item 8</li> </ul> <ul class='subcat'> <li class='cat'> Cat 3 <ul> <li>item 9</li> <li>item 10</li> <li>item 11</li> <li>item 12</li> </ul> </li> </ul> </li> <li class='cat'> cat 4 <ul> <li>item 13</li> <li>item 14</li> <li>item 15</li> <li>item 16</li> </ul> </li> </ul> As I press the down key I wish the items to be selected in numerical order (they do not have numerical order IDs and sometimes some of them are hidden so they should be ignored. But it needs to go to the next <li> that isn't a category and set that as hover.

    Read the article

  • How do you implement position-sensitive zooming inside a JScrollPane?

    - by tucuxi
    I am trying to implement position-sensitive zooming inside a JScrollPane. The JScrollPane contains a component with a customized 'paint' that will draw itself inside whatever space it is allocated - so zooming is as easy as using a MouseWheelListener that resizes the inner component as required. But I also want zooming into (or out of) a point to keep that point as central as possible within the resulting zoomed-in (or -out) view (this is what I refer to as 'position-sensitive' zooming), similar to how zooming works in google maps. I am sure this has been done many times before - does anybody know the "right" way to do it under Java Swing?. Would it be better to play with Graphic2D's transformations instead of using JScrollPanes? Sample code follows: package test; import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import javax.swing.*; public class FPanel extends javax.swing.JPanel { private Dimension preferredSize = new Dimension(400, 400); private Rectangle2D[] rects = new Rectangle2D[50]; public static void main(String[] args) { JFrame jf = new JFrame("test"); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.setSize(400, 400); jf.add(new JScrollPane(new FPanel())); jf.setVisible(true); } public FPanel() { // generate rectangles with pseudo-random coords for (int i=0; i<rects.length; i++) { rects[i] = new Rectangle2D.Double( Math.random()*.8, Math.random()*.8, Math.random()*.2, Math.random()*.2); } // mouse listener to detect scrollwheel events addMouseWheelListener(new MouseWheelListener() { public void mouseWheelMoved(MouseWheelEvent e) { updatePreferredSize(e.getWheelRotation(), e.getPoint()); } }); } private void updatePreferredSize(int n, Point p) { double d = (double) n * 1.08; d = (n > 0) ? 1 / d : -d; int w = (int) (getWidth() * d); int h = (int) (getHeight() * d); preferredSize.setSize(w, h); getParent().doLayout(); // Question: how do I keep 'p' centered in the resulting view? } public Dimension getPreferredSize() { return preferredSize; } private Rectangle2D r = new Rectangle2D.Float(); public void paint(Graphics g) { super.paint(g); g.setColor(Color.red); int w = getWidth(); int h = getHeight(); for (Rectangle2D rect : rects) { r.setRect(rect.getX() * w, rect.getY() * h, rect.getWidth() * w, rect.getHeight() * h); ((Graphics2D)g).draw(r); } } }

    Read the article

  • WPF Storyboard works well, except for the first time it runs. Why?

    - by sofri
    Hi, I'm doing a Surface Application. And there I have something like a bulletin board where little cards with news on it are pinned on. On click they shall fly out of the board and scale bigger. My storyboard works well, except for the first time it runs. It's not a smooth animation then but it scales to its final size immediately and it's the same with the orientation-property. Just the center-property seems to behave correctly. This is an example for one of my Storyboards doing that: Storyboard stb = new Storyboard(); PointAnimation moveCenter = new PointAnimation(); DoubleAnimationUsingKeyFrames changeWidth = new DoubleAnimationUsingKeyFrames(); DoubleAnimationUsingKeyFrames changeHeight = new DoubleAnimationUsingKeyFrames(); DoubleAnimationUsingKeyFrames changeOrientation = new DoubleAnimationUsingKeyFrames(); moveCenter.From = News1.ActualCenter; moveCenter.To = new Point(250, 400); moveCenter.Duration = new Duration(TimeSpan.FromSeconds(1.0)); moveCenter.FillBehavior = FillBehavior.Stop; stb.Children.Add(moveCenter); Storyboard.SetTarget(moveCenter, News1); Storyboard.SetTargetProperty(moveCenter, new PropertyPath(ScatterViewItem.CenterProperty)); changeWidth.Duration = TimeSpan.FromSeconds(1); changeWidth.KeyFrames.Add(new EasingDoubleKeyFrame(266, KeyTime.FromTimeSpan(new System.TimeSpan(0, 0, 1)))); changeWidth.FillBehavior = FillBehavior.Stop; stb.Children.Add(changeWidth); Storyboard.SetTarget(changeWidth, News1); Storyboard.SetTargetProperty(changeWidth, new PropertyPath(FrameworkElement.WidthProperty)); changeHeight.Duration = TimeSpan.FromSeconds(1); changeHeight.KeyFrames.Add(new EasingDoubleKeyFrame(400, KeyTime.FromTimeSpan(new System.TimeSpan(0, 0, 1)))); changeHeight.FillBehavior = FillBehavior.Stop; stb.Children.Add(changeHeight); Storyboard.SetTarget(changeHeight, News1); Storyboard.SetTargetProperty(changeHeight, new PropertyPath(FrameworkElement.HeightProperty)); changeOrientation.Duration = TimeSpan.FromSeconds(1); changeOrientation.KeyFrames.Add(new EasingDoubleKeyFrame(0, KeyTime.FromTimeSpan(new System.TimeSpan(0, 0, 1)))); changeOrientation.FillBehavior = FillBehavior.Stop; stb.Children.Add(changeOrientation); Storyboard.SetTarget(changeOrientation, News1); Storyboard.SetTargetProperty(changeOrientation, new PropertyPath(ScatterViewItem.OrientationProperty)); stb.Begin(this); News1.Center = new Point(250, 400); News1.Orientation = 0; News1.Width = 266; News1.Height = 400; Pin1.Visibility = Visibility.Collapsed; news1IsOutside = true; Scroll1.IsEnabled = true; What's wrong with it?

    Read the article

  • Ideal PHP Session Size?

    - by Jason
    Hi, I have a PHP form (mortgage app) that is about 400 fields, traffic on the site will be low. What is the ideal Session size for 400 fields going into a MySQL db? In PHP.ini what do I set? Anything I should set that I am missing? -Jason

    Read the article

  • add autocomplete facility for dynamically added input tag

    - by hunt
    I am creating autocomplete functionality on an input tag using following code. $('.query').autocomplete({ serviceUrl:'http://localhost/main/finder.php', minChars:2, delimiter: /(,|;)\s*/, // regex or character maxHeight:400, width:400, zIndex: 9999, deferRequestBy: 0, //miliseconds onSelect: function(value, data){ } }); Now the problem is my input element is added dynamically so for first input tag autocomplete is working but when i add one more input tag then it fails for the second one. so i need some facility that live() provide in jquery ... please do post the solution

    Read the article

  • How to get column value into row header

    - by Dharmendra Mohapatra
    ID amount year 1 300 02-02-2010 00:00 2 400 02-02-2009 00:00 3 200 02-02-2011 00:00 4 300 22-02-2010 00:00 5 400 12-02-2009 00:00 6 500 22-02-2009 00:00 7 600 02-02-2006 00:00 8 700 02-07-2012 00:00 9 500 08-02-2012 00:00 10 800 09-02-2011 00:00 11 500 06-02-2010 00:00 12 600 01-02-2011 00:00 13 300 02-02-2019 00:00 Desired output Y1 Y2 Y3 ........... sum(amount) sum(amount) sum(amount) Please suggest a approach Y1 is the year part of the date so my result column would be 2006 2009 2010 2011 2012 600 1300 800 1900 1200 Thanks. DB- MYSQL, SQL SERVER Thanks.

    Read the article

  • SQL column length query

    - by Mike
    i've been using the following query: select LEN(columnname) as columnmame from dbo.amu_datastaging This works, but is there a way to only return the greatest value instead of all the values? So if i return 1million records and the longest length is 400, the query would just return the value of 400?

    Read the article

  • SQL: Find the max record per group

    - by user319088
    I have one table, which has three fields and data. Name , Top , Total cat , 1 , 10 dog , 2 , 7 cat , 3 , 20 horse , 4 , 4 cat , 5 , 10 dog , 6 , 9 I want to select the record which has highest value of Total for each Name, so my result should be like this: Name , Top , Total cat , 3 , 20 horse , 4 , 4 Dog , 6 , 9 I tried group by name order by total, but it give top most record of group by result. Can anyone guide me, please?

    Read the article

  • group by query issue

    - by user319088
    gorup by query issue i have one table, which has three fields and data. Name , Top , total cat , 1 ,10 dog , 2, 7 cat , 3 ,20 hourse 4, 4 cat, 5,10 Dog 6 9 i want to select record which has highest value of "total" for each Name so my result should be like this. Name , Top , total cat , 3 , 20 hourse , 4 , 4 Dog , 6 , 9 i tried group by name order by total, but it give top most record of group by result. any one can guide me , please!!!!

    Read the article

  • string combinations

    - by vbNewbie
    I would like to generate a combination of words. For example if I had the following list: {cat, dog, horse, ape, hen, mouse} then the result would be n(n-1)/2 cat dog horse ape hen mouse (cat dog) (dog horse) (horse ape) (ape hen) (hen mouse) (cat dog horse) (dog horse ape) (horse ape hen) etc Hope this makes sense...everything I found involves permutations The list I have would be a 500 long

    Read the article

  • webscraper grabbing images, but not entering info into database

    - by Jason
    Hello, again. I'm having more issues with my script entering info into my database. The script below grabs a page, strips down the necessary info, then downloads the related image file. After that, it is supposed to enter the information gleaned from the URL into the database. For some reason, the script seems to iterate through the URLs, as I get downloaded images for each URL, but each URL's product is not entered into the database. The script will insert the first product's categories and product info, and then it just stops, and continues to download images. Any suggestions? <?php define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'includes/simple_html_dom.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); set_time_limit(259200); function save($in, $out) { $ch = curl_init ($in); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER,1); $rawdata=curl_exec($ch); curl_close ($ch); if(file_exists($out)) { unlink($out); } $fp = fopen($out,'x'); fwrite($fp, $rawdata); fclose($fp); } function scrape($i) { $url = 'http:/xxxxxxxx/index.php?main_page=product_info&products_id='.$i.'&zenid=e4b7dde8de02e1df005d4549e2e3e529'; echo "$url -- "; $exists = file_get_contents($url); if ($exists != false) { $html = file_get_html($url); foreach($html->find('body') as $html) { $test = $html->find('#productName', 0); if ($test) { $item['title'] = trim($html->find('#productName', 0)->plaintext); $item['price'] = trim($html->find('#productPrices', 0)->plaintext); $item['cat'] = $html->find('#navBreadCrumb', 0)->plaintext; list($home, $item['cat'], $item['subcat'], $title) = explode("::", $item['cat']); $item['cat'] = str_replace("&nbsp;", "", $item['cat']); $item['subcat'] = str_replace("\n", "", str_replace("&nbsp;", "", $item['subcat'])); $item['desc'] = trim($html->find('#productDescription', 0)->plaintext); $item['model'] = $html->find('ul#productDetailsList', 0)->find('li', 0)->plaintext; $item['model'] = explode(":", $item['model']); $item['model'] = trim($item['model'][1]); $item['manufacturer'] = $html->find('ul#productDetailsList', 0)->find('li', 1)->plaintext; $item['manufacturer'] = explode(":", $item['manufacturer']); $item['manufacturer'] = trim($item['manufacturer'][1]); foreach($html->find('img') as $img) { if($img->alt == $item['title']) { $item['img_sm'] = $img->src; } } $ret[] = $item; } } $html->clear(); unset($html); unset($item); return $ret; } else { echo "Could not find page<br />"; } unset($exists); } $i = 1; $end = 9999999; while($i < $end) { $ret = scrape($i); if(isset($ret)) { foreach($ret as $v) { $item['title'] = $v['title']; $item['price'] = $v['price']; $item['desc'] = $v['desc']; $item['model'] = $v['model']; $item['manufacturer'] = $v['manufacturer']; $item['image'] = $v['image']; $item['cat'] = $v['cat']; $item['subcat'] = $v['subcat']; $item['img_sm'] = $v['img_sm']; } unset($ret); unset($v); $sm_img_src = "http://xxxxxx/".$item['img_sm']; $ext = strrchr($item['img_sm'], '.'); $filename = $item['model'] . $ext; $lg_img_src = "http://xxxxx/images/STC/".$filename; $new_sm = "./rip_images/small/{$filename}"; $new_lg = "./rip_images/large/{$filename}"; $item['image'] = $filename; save($lg_img_src,$new_lg); save($sm_img_src,$new_sm); //see if parent cat exists $sql = 'SELECT cat_id FROM ' . SHOP_CAT_TABLE . ' WHERE cat_name = "'.$db->sql_escape($item['cat']).'"'; $result = $db->sql_query($sql); $parent = $db->sql_fetchrow($result); $db->sql_freeresult($result); // if not exists if($parent['cat_id'] == '') { //add the parent cat to the db $sql_ary = array( 'cat_name' => $item['cat'], 'cat_parent' => 0 ); $sql = 'INSERT INTO '.SHOP_CAT_TABLE.' '.$db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); $cat_id = $db->sql_nextid(); //see if subcat exists $sql = 'SELECT cat_id FROM ' . SHOP_CAT_TABLE . ' WHERE cat_name = "'.$db->sql_escape($item['subcat']).'"'; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); // if not exists if($row['cat_id'] == '') { //add subcat to db $sql_ary = array( 'cat_name' => $db->sql_escape($item['subcat']), 'cat_parent' => $cat_id ); $sql = 'INSERT INTO '.SHOP_CAT_TABLE.' '.$db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); $item_cat = $db->sql_nextid(); } else //if exists { $item_cat = $row['cat_id']; } } else //if parent cat exists { //see if subcat exists $sql = 'SELECT cat_id FROM ' . SHOP_CAT_TABLE . ' WHERE cat_name = "'.$db->sql_escape($item['subcat']).'"'; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); // if not exists if($row['cat_id'] == '') { //add the subcat to the db $sql_ary = array( 'cat_name' => $db->sql_escape($item['subcat']), 'cat_parent' => $parent['cat_id'] ); $sql = 'INSERT INTO '.SHOP_CAT_TABLE.' '.$db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); $item_cat = $db->sql_nextid(); } else //if exists { $item_cat = $row['cat_id']; } } $sql_ary = array( 'item_title' => $db->sql_escape($item['title']), 'item_price' => $db->sql_escape($item['price']), 'item_desc' => $db->sql_escape($item['desc']), 'item_model' => $db->sql_escape($item['model']), 'item_manufacturer' => $db->sql_escape($item['manufacturer']), 'item_image' => $db->sql_escape($item['image']), 'item_cat' => $db->sql_escape($item_cat) ); $sql = 'INSERT INTO ' . SHOP_ITEM_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); garbage_collection(); echo 'Done<br />'; } $i++; unset($item); } ?>

    Read the article

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