Daily Archives

Articles indexed Thursday September 13 2012

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

  • Slow retrieval of data in SQLITE takes a long using ContentProvider

    - by Arlyn
    I have an application in Android (running 4.0.3) that stores a lot of data in Table A. Table A resides in SQLite Database. I am using a ContentProvider as an abstraction layer above the database. Lots of data here means almost 80,000 records per month. Table A is structured like this: String SQL_CREATE_TABLE = "CREATE TABLE IF NOT EXISTS " + TABLE_A + " ( " + COLUMN_ID + " INTEGER PRIMARY KEY NOT NULL" + "," + COLUMN_GROUPNO + " INTEGER NOT NULL DEFAULT(0)" + "," + COLUMN_TIMESTAMP + " DATETIME UNIQUE NOT NULL" + "," + COLUMN_TAG + " TEXT" + "," + COLUMN_VALUE + " REAL NOT NULL" + "," + COLUMN_DEVICEID + " TEXT NOT NULL" + "," + COLUMN_NEW + " NUMERIC NOT NULL DEFAULT(1)" + " )"; Here is the index statement: String SQL_CREATE_INDEX_TIMESTAMP = "CREATE INDEX IF NOT EXISTS " + TABLE_A + "_" + COLUMN_TIMESTAMP + " ON " + TABLE_A + " (" + COLUMN_TIMESTAMP + ") "; I have defined the columns as well as the table name as String Constants. I am already experiencing significant slow down when retrieving this data from Table A. The problem is that when I retrieve data from this table, I first put it in an ArrayList and then I display it. Obviously, this is possibly the wrong way of doing things. I am trying to find a better way to approach this problem using a ContentProvider. But this is not the problem that bothers me. The problem is for some reason, it takes a lot longer to retrieve data from other tables which have only upto 12 records maximum. I see this delay increase as the number of records in Table A increase. This does not make any sense. I can understand the delay if I retrieve data from Table A, but why the delay in retrieving data from other tables. To clarify, I do not experience this delay if Table A is empty or has less than 3000 records. What could be the problem?

    Read the article

  • trying to put an mysql result into a string

    - by user1583432
    I'm trying to put an mysql query result into an string I tried to find an answer but all the similar posts were getting subquery answers which is not what I'm trying to do. for example Fruits_tbl ID Fruit Color Number __________________________________ 2 Apple Red 5 $sql = "select Fruits,Color,Number from Fruits_tbl where ID = 2"; $result = $pdo->query($sql); $row = $result->fetch(); print_r($row); This will give me something like Array([0]="Apple", [1]="Red", [2]="5", [Fruit]="Apple", [Color]="Red", [Number]="5") implode will give me 2 of each I want just need a string = "Apple, Red, 5" what I currently have is $string = $row[Fruit].", ".$row[Color].", ".$row['Number'] As you can see that's rather tedious. Is there something like implode but only return the index array or something?

    Read the article

  • PHP client for asmx service

    - by Carlos Mora
    A few days ago I was in charge of the development of some webServices for a client, the thing is that the client also asked for a php client that consumes the webservices. The service were published online on a server, with public access, right now I can see the wsdl from any computer, but when trying to consume it with PHP it shows me an error that says something about HTTP header and blablabla, that happened before I connected with a VPN to the server where the service is being hosted, after doing the VPN just by curiosity I reloaded the php client, and I don't know why... It did worked.... Q: Can anybody tell me why did this happened?

    Read the article

  • lfs 7.2 compilation of glibc 2.16.0

    - by avinash
    I am making an linux system following the procedure in lfs. But while i was following the fifth step(i.e. the one before make) on this page, i get an error at the last. configure: error: linker with -z relro support required Now after this if i call make i get an error make: *** No targets specified and no makefile found. Stop. I am running this on a ubuntu 12.04 machine. How to fix this error?

    Read the article

  • Jquery returns index -1 always

    - by jfreak53
    This is my index code that I use to return the buttons parent div's index: j('#optionform').index( j(this).parent() ) I'm trying to find out the DIV index of the button clicked, so I can remove the DIV. The HTML layout is like so: <form id="optionform" onsubmit="return false;"> <label><input type="checkbox" id="s_name" value="s_name"> Survey Name </label> <label><input type="checkbox" id="s_type" value="s_type"> Survey Type </label><br> Filter Results:<br> <div id="template" style="display: none;"> Column: <select id="fcolumn[]"> <option></option> <option value="s_name">Survey Name</option> <option value="s_type">Survey Type</option> </select><br> Filter Type: <select id="ftype[]"> <option></option> <option value="=">Equals</option> <option value="LIKE">Like</option> </select><br> Filter content: <input type="text" id="fcontent[]"><br> <img src="images/add.png" width="32px" onclick="addTemp(); return false;"> <img src="images/delete.png" width="32px" onclick="alert(j(this).attr('src')); remTemp(j('#optionform').index( j(this).parent() )); return false;"> </div> <div class="template" style="display: block;"> Column: <select id="fcolumn[]"> <option></option> <option value="s_name">Survey Name</option> <option value="s_type">Survey Type</option> </select><br> Filter Type: <select id="ftype[]"> <option></option> <option value="=">Equals</option> <option value="LIKE">Like</option> </select><br> Filter content: <input type="text" id="fcontent[]"><br> <img src="images/add.png" width="32px" onclick="addTemp(); return false;"> <img src="images/delete.png" width="32px" onclick="alert(j(this).attr('src')); remTemp(j('#optionform').index( j(this).parent() )); return false;"> </div> <div class="template" style="display: block;"> Column: <select id="fcolumn[]"> <option></option> <option value="s_name">Survey Name</option> <option value="s_type">Survey Type</option> </select><br> Filter Type: <select id="ftype[]"> <option></option> <option value="=">Equals</option> <option value="LIKE">Like</option> </select><br> Filter content: <input type="text" id="fcontent[]"><br> <img src="images/add.png" width="32px" onclick="addTemp(); return false;"> <img src="images/delete.png" width="32px" onclick="alert(j(this).attr('src')); remTemp(j('#optionform').index( j(this).parent() )); return false;"> </div> </form> But it always returns -1 in the index.

    Read the article

  • How do I solve this indexOutOfBoundsException in my server send/receive thread?

    - by Stefan Schouten
    I am creating a multiplayer game in Java with a server and multiple clients. Everything runs perfectly, until I press the Kick-button in the server to kick a client. Error at receive thread of server, after kicking the first person who joined out of three: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 at java.util.ArrayList.rangeCheck(ArrayList.java:604) at java.util.ArrayList.get(ArrayList.java:382) > at networktest.Server$3.run(Server.java:186) at java.lang.Thread.run(Thread.java:722) The pointed line is the ois = new ObjectInputStream where I send datatype. The server kicks the first person perfectly, but removes the second one in the list too, with an error of java.lang.ClassCastException. server receive: private static Thread receive = new Thread() { @Override public void run() { ObjectInputStream ois; while (true) { for (int i = 0; i < list_sockets.size(); i++) { try { ois = new ObjectInputStream(list_sockets.get(i).getInputStream()); int receive_state = (Integer) ois.readObject(); // receive state ois = new ObjectInputStream(list_sockets.get(i).getInputStream()); byte datatype = (byte) ois.readObject(); // receive datatype if(datatype == 2){ ois = new ObjectInputStream(list_sockets.get(i).getInputStream()); ChatLine chatLine = (ChatLine) ois.readObject(); // receive ChatLine } else if (datatype == 0){ ois = new ObjectInputStream(list_sockets.get(i).getInputStream()); DataPackage dp = (DataPackage) ois.readObject(); // receive dp list_data.set(i, dp); } if (receive_state == 1) // Client Disconnected by User { disconnectClient(i); i--; } } catch (Exception ex) // Client Disconnected (Client Didn't Notify Server About Disconnecting) { System.err.println("Error @ receive:"); ex.printStackTrace(); disconnectClient(i); i--; } } try { this.sleep(3); } catch (InterruptedException ex) { Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex); } } } }; user send: Thread send = new Thread() { public void run() { ObjectOutputStream oos; byte datatype = 0; while (connected){ if (socket != null){ try { DataPackage dp = new DataPackage(); dp.x = Client.player.x; dp.y = Client.player.y; dp.username = username; dp.charType = charType; dp.walking = (byte)Client.player.walking; if (Client.outputChatLine.line != null) datatype = 2; else { datatype = 0; } oos = new ObjectOutputStream(socket.getOutputStream()); oos.writeObject(Integer.valueOf(Client.this.state)); // send state oos = new ObjectOutputStream(socket.getOutputStream()); oos.writeObject(Byte.valueOf(datatype)); // send datatype if (datatype == 2) { oos.reset(); oos.writeObject(Client.outputChatLine); Client.outputChatLine = new ChatLine(); } else { oos = new ObjectOutputStream(socket.getOutputStream()); oos.writeObject(dp); } if (Client.this.state == 1) { connected = false; socket = null; JOptionPane.showMessageDialog(null, "Client Disconnected", "Info", 1); System.exit(0); } } catch (Exception ex){} } try { this.sleep(2); } catch (InterruptedException ex) { Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex); } } } }; disconnect client method: public static void disconnectClient(int index) { try { list_clients_model.removeElementAt(index); list_client_states.remove(index); list_data.remove(index); list_sockets.remove(index); } catch (Exception ex) {} } Does anyone know how to solve this?

    Read the article

  • NSNumberFormatter customize?

    - by Frederick C. Lee
    I wish to use NSNumberFormatter to merely attached a percent ('%') to the supplied number WITHOUT having it multiplied by 100. The canned kCFNumberFormatterPercentStyle automatically x100 which I don't want. For example, converting 5.0 to 5.0% versus 500%. Using the following: NSNumberFormatter *percentFormatter = [[NSNumberFormatter alloc] init]; [percentFormatter setNumberFormat:@"##0.00%;-##0.00%"]; But 'setNumberFormat' doesn't exist in NSNumberFomatter. I need to use this NSNumberFormatter for my Core-Plot label. How can I customize NSNumberFormat? Ric.

    Read the article

  • Jquery Serialize data

    - by Richard
    So I have several text boxes, drop down menus, and radio options on this form. When the user clicks submit i want to save ALL that information so I can put it into a database. So this is all the form's inputs <div id="reg2a"> First Name: <br/><input type="text" name="fname" /> <br/> Last Name: <br/><input type="text" name="lname" /> <br/> Address: <br/><input type="text" name="address" /> <br/> City: <br/><input type="text" name="city" /> <br/> State: <br/><input type="text" name="state" /> <br/> Zip Code: <br/><input type="text" name="zip" /> <br/> Phone Number: <br/><input type="text" name="phone" /> <br/> Fax: <br/><input type="text" name="fax" /> <br/> Email: <br/><input type="text" name="email" /> <br/> Ethnicity: <i>Used only for grant reporting purposes</i> <br/><input type="text" name="ethnicity" /> <br/><br/> Instutional Information Type (select the best option) <br/> <select name="iitype"> <option value="none">None</option> <option value="uni">University</option> <option value="commorg">Community Organization</option> </select> <br/><br/> Number of sessions willing to present: <select id="vennum_select" name="vnum"> <?php for($i=0;$i<=3;$i++) { ?> <option value="<?php echo $i ?>"><?php echo $i ?></option> <?php } ?><br/> </select><br/> Number of tables requested: <select id="tabnum_select" name="tnum"> <?php for($i=1;$i<=3;$i++) { ?> <option value="<?php echo $i ?>"><?php echo $i ?></option> <?php } ?> </select><br/><br/> Awarding of a door prize during the conference will result in a reduction in the cost of your first table. <br/><br/> I am providing a door prize for delivery during the conference of $75 or more <select id="prize_select" name="pnum"> <option value="0">No</option> <option value="1">Yes</option> </select><br/> Prize name: <input type="text" name="prize_name" /><br/> Description: <input type="text" name="descr" /><br/> Value: <input type="text" name="retail" /><br/><br/> Name of Institution: <br/><input type="text" name="institution" /> <br/><br/> Type (select the best option) <br/> <select name="type"> <option value="none">None</option> <option value="k5">K-5</option> <option value="k8">K-8</option> <option value="68">6-8</option> <option value="912">9-12</option> </select> <br/><br/> Address: <br/><input type="text" name="address_sch" /> <br/> City: <br/><input type="text" name="city_sch" /> <br/> State: <br/><input type="text" name="state_sch" /> <br/> Zip Code: <br/><input type="text" name="zip_sch" /> <br/> <form name="frm2sub" id="frm2sub" action="page3.php" method="post"> <input type="submit" name="submit" value="Submit" id="submit" /> </form> </div> This is my jquery function: $("#frm2sub").submit( function() { var values = {}; values["fname"] = $("#fname").val(); }); I can do this for each one of the input boxes but I want to give all this data to the next page. So how do I put this array into $_POST? Btw, I've tried doing var data = $("#reg2a").serialize(); and var data = $(document).serialize(); Data ended up being empty. Any ideas? Thanks

    Read the article

  • CSS list menu; extra padding on rollover of buttons

    - by user1669878
    I have been going crazy trying to figure out why there is extra padding showing up on my navigation buttons when I rollover them. It's only showing up to the left and right of them though. Here's a link to the screenshot of what it looks like: http://i179.photobucket.com/albums/w319/jdauel/Screenshot2012-09-13at25417PM.png I think it has something to do with my CSS but I have no idea anymore. Please help me??? I tried using Firebug to figure it out with no prevail. Here's the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Farren's Photography</title> <style type="text/css"> html { height: 100%; width: 100%; } body { margin: 0px; } #container { font-family: Georgia, "Times New Roman", Times, serif; font-size: 1.2em; color: #000; background-color: #06F; text-align: left; padding: 0px; height: 650px; width: 960px; margin-right: auto; margin-left: auto; background-image: url(images/background_image.png); background-repeat: no-repeat; margin-top: 45px; } a:link { color: #FFF; } a:visited { color: #FFF; } a:hover { color: #FFF; } #container #logo { } #container #logo #fp-logo { background-image: url(images/logo.png); height: 137px; width: 408px; text-indent: -9999px; display: block; } #logo { height: 137px; width: 408px; position: relative; padding-top: 35px; padding-right: 0px; padding-bottom: 0px; padding-left: 35px; } #main { background-color: #FFF; min-height: 383px; width: 707px; position: relative; left: 217px; top: 16px; right: 36px; bottom: 113px; } #container #navbar { font-family: Georgia, "Times New Roman", Times, serif; font-size: 14px; color: #FFF; text-align: right; height: 45px; background-color: #CC0000; position: relative; top: 8px; bottom: 0px; left: 0px; right: 0px; } #container #navbar ul li a { text-decoration: none; } #container #navbar ul { list-style-type: none; padding-top: 16px; } #container #navbar ul li { display: inline; background-color: #280803; margin: 0px; height: 0px; width: 0px; position: relative; padding-top: 16px; padding-right: 15px; padding-bottom: 17px; padding-left: 15px; } #container #navbar ul li a:link { text-decoration: none; color: #FFF; } #container #navbar ul li a:visited { text-decoration: none; color: #FFF; } #container #navbar ul li a:hover { text-decoration: none; color: #FFF; background-color: #027e8e; padding-top: 16px; padding-right: 15px; padding-bottom: 17px; padding-left: 15px; margin: 0px; } #footer { font-family: Arial, Helvetica, sans-serif; font-size: x-small; height: 28px; position: relative; top: 8px; color: #FFF; font-style: italic; } </style> </head> <body> <div id="container"> <div id="logo"><a href="http://www.farrensphotography.com" title="Farren's Photography" target="_self" id="fp-logo">Farren's Photography</a></div><!-- end logo --> <div id="main"> <div id="content"> </div><!-- end content --> </div><!-- end main --> <div id="navbar"> <ul> <li><a href="index.html" target="_self">Home</a></li> <li><a href="portfolio.html" target="_self">Portfolio</a></li> <li><a href="mystyle.html" target="_self">My Style</a></li> <li><a href="specials.html" target="_self">Specials</a></li> <li><a href="pricing.html" target="_self">Pricing</a></li> <li><a href="contact.html" target="_self">Contact</a></li> </ul> </div> <!-- end navbar --> <div id="footer"> <div id="copyright">All images copyright© Farrens Photography </div><!-- end copyright --> <div id="network">Facebook button </div><!-- end network --> </div><!-- end footer --> </div><!-- end container --> </body> </html>

    Read the article

  • floating a div with jquery/offset - ignores href hashtag

    - by Kevin Crawley
    <script type="text/javascript"> $(document).ready(function () { var top = $('#rt_outer').offset().top - parseFloat($('#rt_outer').css('marginTop').replace(/auto/, 0)); $(window).scroll(function (event) { // what the y position of the scroll is var y = $(this).scrollTop(); // whether that's below the form if (y >= top) { // if so, ad the fixed class $('#rt_outer').addClass('fixed'); } else { // otherwise remove it $('#rt_outer').removeClass('fixed'); } }); }); </script> The problem is fairly straight forward. If I use a header redirect to a new location in the page (say half way down, I jump to #halfway after processing a php script using header("somepage.php#halfway") the div container which is handled by this script won't jump down until the page is scrolled in either direction. I know there is a solution to this, I just don't know what.

    Read the article

  • Get node value from document

    - by J Noel
    I have XML in PHP, I am trying to get the value of the status node: <?xml version="1.0" encoding="utf-8" ?> <response> <result> <form name="MREP"> <update> <criteria> <field name="Serial_Number" compOperator="Equals" value="A-000-1012"></field> <reloperator>AND</reloperator> <field name="MREP_Type" compOperator="Equals" value="0"></field> </criteria> <newvalues> <field name="Is_being_Used"> <value><![CDATA[TRUE]]></value> </field> </newvalues> <status>Success</status> </update> </form> </result> </response> I tried $xml = simplexml_load_string($mrepValide); echo $xml->status; (where $mrepValide is a string of XML shown above) But I think it didnt work since status is not the parent node. Any help would be greatly appreciated.

    Read the article

  • inserts 'Array' into mysql table

    - by Noah Smith
    i want to insert an array into a mysql table. The array is produced by script scanning all the links, converting into absolute links and then displaying them in an array. i decided to mysql_query the array into the table but now i am stuck. it only posts 'Array', instead of every row from the array into a different row. Any ideas??! <?php require_once('simplehtmldom_1_5/simple_html_dom.php'); require_once('url_to_absolute/url_to_absolute.php'); $connect = mysql_connect("xxxx", "xxxx", "xxx") or die('Couldn\'t connect to MySQL Server: ' . mysql_error()); mysql_select_db("xxxx", $connect ) or die('Couldn\'t Select the database: ' . mysql_error( $connect )); $links = Array(); $URL = 'http://www.theqlick.com'; // change it for urls to grab // grabs the urls from URL $file = file_get_html($URL); foreach ($file->find('a') as $theelement) { $links[] = url_to_absolute($URL, $theelement->href); } print_r($links); mysql_query("INSERT INTO pages (url) VALUES ('$links[]')"); mysql_close($connect);

    Read the article

  • Android: Communication with host computer

    - by dannyn382
    I am looking for ideas as to how all of you can think to solve this issue. I am going to be using an Android Tablet as basically a touch screen input for a project. I need to be able to control servos and solenoids and such, so I will be using a Raspberry Pi to do this. I am looking for ideas on how to get the tablet and the Raspberry Pi to talk. Here are a few that I have though of so far. Use Wifi (which I really do not want to, Ethernet would be okay) to ssh into the Raspberry Pi (with an external library) and run scripts that way from the Android app. Use a com port for Android (maybe Andropod if there hardware becomes available?) and run scripts on the Raspberry Pi. Those are probably two of the "best" ideas that I can think of for now. Can anyone think of any other "better" ideas? Thanks in advance for the help, Dan

    Read the article

  • Computed Column with relationships

    - by Sethery
    I have a table, MapLocation, which has a column and two relationships with tables that have a field that really need to be displayed as a single concatenated value. I was thinking this was a perfect case for a computed column, but not sure how to go about it. MapLocation MaoNo Section _____________________ _____________________ _____________________ MapNoId MapNoId SectionId SectionId MapNumber (int) Section (int) Identifier (nvarchar) LocationName (nvarchar) LocationName = "MapNUmber - SectionNumber - Identifier" ex: 20 - 03 - SW4 How would I write that? I haven't done much with computed columns or concatenating in SQL. Edit: I need an actual computed column that is automatically updated, im looking for the formula. Or is this more of a function/trigger? Its possible, I certainly barely know what I'm doing. The idea is that I dont want to have to do two more server calls and concatenate these values client side.

    Read the article

  • Can a Highcharts range selector use non-date linear ranges?

    - by Simon
    I am using the HighStock JS lib to produce a chart that uses a linear series (not a time-series) for the xAxis. I'd still like to use the range-selector in order to zoom to pre-determined ranges within my linear series. Is this possible? For example; say my xAxis has a series: [[121,616],[122,600],[123,605],[124,585.5],[125,575.5],[126,580.5],[127,582],[128,582],[129,584],[130,583]] I'd like to use the range selector to zoom to the last n in the series.

    Read the article

  • Django Querying Relation of Relation

    - by Brent
    I'm stuck on a Django ORM issue that is bugging me. I have a set of models linked by a foreign key but the requirements are a bit odd. I need to list items by their relation's relation. This is hard to explain so I've tried to depict this below, given: Work ManyToMany(Award) Award ForeignKey(AwardCategory) AwardCategory I need to list work items so they are listed by the award category. Desired output would be: Work Instance A Award Instance A that belongs to Award Category Instance A Award Instance C that belongs to Award Category Instance A Award Instance G that belongs to Award Category Instance A Work Instance A (same instance as above, but listed by different award__category) Award Instance F that belongs to Award Category Instance B Award Instance R that belongs to Award Category Instance B Award Instance Z that belongs to Award Category Instance B Work Instance B Award Instance B that belongs to Award Category Instance A Award Instance A that belongs to Award Category Instance A Essentially I want to list all work by the award category. I can get this to work in part but my solution is filthy and gross. I'm wondering if there is a better way. I considered using a ManyToMany and a through attribute but I'm not certain if I'm utilizing it correctly.

    Read the article

  • session expires to soon in php

    - by user1669425
    I want to extend a session time so that a session variable does not expire until after 12 hours. Problem is that after 24 minutes (default time for a session until it expires) of inactivity it still expires the session and hence gives me undefined indexes for those SESSION variables. What else do I need to do in the code below in order to be able to extend the sessions so that it does not expire on its own until 12 hours has passed: <?php ini_set('session.gc_maxlifetime',12*60*60); ini_set('session.cookie_lifetime',12*60*60); phpinfo(); session_start(); ....//rest of code below ?> in phpinfo() it states this below for gc_maxlifetime: Local Value Master Value session.gc_maxlifetime 43200 1440 session.cookie_lifetime 43200 0

    Read the article

  • can't get data from database to dropdownlist in loginview

    - by Thomas Bøg Petersen
    I have this code on an aspx page. <asp:DropDownList runat="server" ID="ddlSize" CssClass="textbox" Width="100px"> <asp:ListItem Value="" Text="" /> <asp:ListItem Value="11" Text="11. Mands" /> <asp:ListItem Value="7" Text="7. Mands" /> <asp:ListItem Value="" Text="Ikke Kamp"/> </asp:DropDownList> <asp:DropDownList runat="server" ID="ddlType" CssClass="textbox" Width="100px"> <asp:ListItem Value="" Text="" /> <asp:ListItem Value="K" Text="Kamp" /> <asp:ListItem Value="T" Text="Træning" /> <asp:ListItem Value="E" Text="Aktivitet"/> </asp:DropDownList> ts inside a loginview with some other fields (textbox) Im trying to get a record id into the page so i can edit it, I have fix it with the Textbox and its working 100%, but i cant get the value from the database into the dropdownlist so it show that value as selected. I have tryed these 3 codes, but nothing is working fore the dropdownlist. // DataValueField Dim drop_obj As DropDownList = TryCast(LoginView2.FindControl("ddlSize"), DropDownList) drop_obj.DataValueField = dtEvents.Rows(0)("EventEventSize") Dim drop_obj2 As DropDownList = TryCast(LoginView2.FindControl("ddlType"), DropDownList) drop_obj2.DataValueField = dtEvents.Rows(0)("EventType") // SelectedIndex Dim drop_obj As DropDownList = TryCast(LoginView2.FindControl("ddlSize"), DropDownList) drop_obj.SelectedIndex = dtEvents.Rows(0)("EventEventSize") Dim drop_obj2 As DropDownList = TryCast(LoginView2.FindControl("ddlType"), DropDownList) drop_obj2.SelectedIndex = dtEvents.Rows(0)("EventType") // SelectedValue Dim drop_obj As DropDownList = TryCast(LoginView2.FindControl("ddlSize"), DropDownList) drop_obj.SelectedValue = dtEvents.Rows(0)("EventEventSize") Dim drop_obj2 As DropDownList = TryCast(LoginView2.FindControl("ddlType"), DropDownList) drop_obj2.SelectedValue = dtEvents.Rows(0)("EventType") Can someone plz. help !? I have values in the 2 dtEvents.Rows(0) i have checked that, with a debug and then step-into. and i get values like 7 or 11 and T or K.

    Read the article

  • HTTP crawler in Erlang

    - by ctp
    I'm coding on a simple HTTP crawler but I have an issue running the code at the bottom. I'm requesting 50 URLs and get the content of 20+ back. I've generated few files with 150kB size each to test the crawler. So I think the 20+ responses are limited by the bandwidth? BUT: how to tell the Erlang snippet not to quit until the last file is not fetched? The test data server is online, so plz try the code out and any hints are welcome :) -module(crawler). -define(BASE_URL, "http://46.4.117.69/"). -export([start/0, send_reqs/0, do_send_req/1]). start() -> ibrowse:start(), proc_lib:spawn(?MODULE, send_reqs, []). to_url(Id) -> ?BASE_URL ++ integer_to_list(Id). fetch_ids() -> lists:seq(1, 50). send_reqs() -> spawn_workers(fetch_ids()). spawn_workers(Ids) -> lists:foreach(fun do_spawn/1, Ids). do_spawn(Id) -> proc_lib:spawn_link(?MODULE, do_send_req, [Id]). do_send_req(Id) -> io:format("Requesting ID ~p ... ~n", [Id]), Result = (catch ibrowse:send_req(to_url(Id), [], get, [], [], 10000)), case Result of {ok, Status, _H, B} -> io:format("OK -- ID: ~2..0w -- Status: ~p -- Content length: ~p~n", [Id, Status, length(B)]); Err -> io:format("ERROR -- ID: ~p -- Error: ~p~n", [Id, Err]) end. That's the output: Requesting ID 1 ... Requesting ID 2 ... Requesting ID 3 ... Requesting ID 4 ... Requesting ID 5 ... Requesting ID 6 ... Requesting ID 7 ... Requesting ID 8 ... Requesting ID 9 ... Requesting ID 10 ... Requesting ID 11 ... Requesting ID 12 ... Requesting ID 13 ... Requesting ID 14 ... Requesting ID 15 ... Requesting ID 16 ... Requesting ID 17 ... Requesting ID 18 ... Requesting ID 19 ... Requesting ID 20 ... Requesting ID 21 ... Requesting ID 22 ... Requesting ID 23 ... Requesting ID 24 ... Requesting ID 25 ... Requesting ID 26 ... Requesting ID 27 ... Requesting ID 28 ... Requesting ID 29 ... Requesting ID 30 ... Requesting ID 31 ... Requesting ID 32 ... Requesting ID 33 ... Requesting ID 34 ... Requesting ID 35 ... Requesting ID 36 ... Requesting ID 37 ... Requesting ID 38 ... Requesting ID 39 ... Requesting ID 40 ... Requesting ID 41 ... Requesting ID 42 ... Requesting ID 43 ... Requesting ID 44 ... Requesting ID 45 ... Requesting ID 46 ... Requesting ID 47 ... Requesting ID 48 ... Requesting ID 49 ... Requesting ID 50 ... OK -- ID: 49 -- Status: "200" -- Content length: 150000 OK -- ID: 47 -- Status: "200" -- Content length: 150000 OK -- ID: 50 -- Status: "200" -- Content length: 150000 OK -- ID: 17 -- Status: "200" -- Content length: 150000 OK -- ID: 48 -- Status: "200" -- Content length: 150000 OK -- ID: 45 -- Status: "200" -- Content length: 150000 OK -- ID: 46 -- Status: "200" -- Content length: 150000 OK -- ID: 10 -- Status: "200" -- Content length: 150000 OK -- ID: 09 -- Status: "200" -- Content length: 150000 OK -- ID: 19 -- Status: "200" -- Content length: 150000 OK -- ID: 13 -- Status: "200" -- Content length: 150000 OK -- ID: 21 -- Status: "200" -- Content length: 150000 OK -- ID: 16 -- Status: "200" -- Content length: 150000 OK -- ID: 27 -- Status: "200" -- Content length: 150000 OK -- ID: 03 -- Status: "200" -- Content length: 150000 OK -- ID: 23 -- Status: "200" -- Content length: 150000 OK -- ID: 29 -- Status: "200" -- Content length: 150000 OK -- ID: 14 -- Status: "200" -- Content length: 150000 OK -- ID: 18 -- Status: "200" -- Content length: 150000 OK -- ID: 01 -- Status: "200" -- Content length: 150000 OK -- ID: 30 -- Status: "200" -- Content length: 150000 OK -- ID: 40 -- Status: "200" -- Content length: 150000 OK -- ID: 05 -- Status: "200" -- Content length: 150000 Update: thanks stemm for the hint with the wait_workers. I've combined your and mine code but same behaviour :( -module(crawler). -define(BASE_URL, "http://46.4.117.69/"). -export([start/0, send_reqs/0, do_send_req/2]). start() -> ibrowse:start(), proc_lib:spawn(?MODULE, send_reqs, []). to_url(Id) -> ?BASE_URL ++ integer_to_list(Id). fetch_ids() -> lists:seq(1, 50). send_reqs() -> spawn_workers(fetch_ids()). spawn_workers(Ids) -> %% collect reference to each worker Refs = [ do_spawn(Id) || Id <- Ids ], %% wait for response from each worker wait_workers(Refs). wait_workers(Refs) -> lists:foreach(fun receive_by_ref/1, Refs). receive_by_ref(Ref) -> %% receive message only from worker with specific reference receive {Ref, done} -> done end. do_spawn(Id) -> Ref = make_ref(), proc_lib:spawn_link(?MODULE, do_send_req, [Id, {self(), Ref}]), Ref. do_send_req(Id, {Pid, Ref}) -> io:format("Requesting ID ~p ... ~n", [Id]), Result = (catch ibrowse:send_req(to_url(Id), [], get, [], [], 10000)), case Result of {ok, Status, _H, B} -> io:format("OK -- ID: ~2..0w -- Status: ~p -- Content length: ~p~n", [Id, Status, length(B)]), %% send message that work is done Pid ! {Ref, done}; Err -> io:format("ERROR -- ID: ~p -- Error: ~p~n", [Id, Err]), %% repeat request if there was error while fetching a page, do_send_req(Id, {Pid, Ref}) %% or - if you don't want to repeat request, put there: %% Pid ! {Ref, done} end. Running the crawler forks fine for a handful of files, but then the code even doesnt fetch the entire files (file size each 150000 bytes) - he crawler fetches some files partially, see the following web server log :( 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /10 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /1 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /3 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /8 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /39 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /7 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /6 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /2 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /5 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /50 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /9 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /44 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /38 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /47 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /49 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /43 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /37 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /46 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /48 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:00 +0200] "GET /36 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:01 +0200] "GET /42 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:01 +0200] "GET /41 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:01 +0200] "GET /45 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:01 +0200] "GET /17 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:01 +0200] "GET /35 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:01 +0200] "GET /16 HTTP/1.1" 200 150000 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:01 +0200] "GET /15 HTTP/1.1" 200 17020 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:01 +0200] "GET /21 HTTP/1.1" 200 120360 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:01 +0200] "GET /40 HTTP/1.1" 200 117600 "-" "-" 82.114.62.14 - - [13/Sep/2012:15:17:01 +0200] "GET /34 HTTP/1.1" 200 60660 "-" "-" Any hints are welcome. I have no clue what's going wrong there :(

    Read the article

  • Can I accesss an external file when testing an R package?

    - by Abe
    I am using the testthat package to test an R package that is within a larger repository. I would like to test the contents of a file outside of the R package. Can I reference a file that is located outside of an R package while testing? What I have tried A reproducible example can be downloaded as MyRepo.tar.gz My repository is called "myRepo", and it includes an R package, "myRpkg" and a folder full of miscellaneous scripts ~/MyRepo/ ~/MyRepo/MyRpkg ~/MyRepo/Scripts The tests in "MyRpkg" are in the /tests/ folder ~/myRepo/myRpkg/tests/test.myscript.R And I want to be able to test a file in the Scripts folder: ~/MyRepo/Scripts/myscript.sh I would like to read the script to test the contents of the first line doing something like this: check.script <- readLines("../../../Scripts/myscript.sh")[1] expect_true(grepl("echo", check.script)) This works fine if I start from the MyRepo directory: cd ~/MyRepo R CMD check MyRpkg But if I move to another directory, it fails: cd R CMD check MyRepo/MyRpkg

    Read the article

  • Change Preference Item Summary Text Color in Android 4

    - by AntounG
    I have the below sample of preference items <CheckBoxPreference android:key="chkSound" android:summary="Sound is Off" android:title="Sound" /> I use a theme in the res/values to change the Summary text color <style name="ThemeDarkText"> <item name="android:textColor">#000000</item> </style> And in the code I write this line setTheme(R.style.ThemeDarkText); Its working fine in Android 2.1 but when I tried to run it on a different os (ex Android 4.0) It didn't change the summary text color just the title color only..!! Any help?

    Read the article

  • Using Hibernate with MS ACCESS 2007 Database (Free JDBC Driver)

    - by Quentin T.
    1. I want to do a reverse engineering action with the Hibernate plugin of Eclipse on a MS Access 2007 Database. I'm forced to use a existing MS Access 2007 db. A easy solution is to buy the HXTT. But I want to use a free driver to do my work. So I tried to apply this post : http://www.programmingforfuture.com/2011/06/how-to-use-ms-access-with-hibernate.html (That uses the SQL Server dialect and the driver sun.jdbc.odbc.JdbcOdbcDriver) Unfortunately I have an error that nobody seems to have been on the internet: Exception while generating code Reason : org.hibernate.exception.GenericJDBCException: Error while reading primary key meta data for `c:/myaccessdb.mdb`.TableTest1 I have try to change the primary key on my MS Access DB (deleting all primary key) or to try the reverse engineering on a MS ACCESS with only one table without primary key, but I got all times the problems. 2. The purpose of my job is to transfer daily (weekly) an Oracle 11g database with data from an existing database MS ACCESS 2007. And I thought to use a procedure (Hibernate EJB) Java to be launched automatically every week to do the data transfer. Is this is the best solution ? Configuration : sun.jdbc.odbc.JdbcOdbcDriver v??? Hibernate v3.4 Eclipse ps: If you are a HXTT developer or seller please be indulgent with my post ;). Making money by making people believe that you help, it's bad ! A solution is to use Derby Client driver, as the solution in the post: Does anyone know if Hibernate and java will work effectively with Access? But a clarification of the answer of Rich Seller is required. Could you explain your answer and explain your configuration (hibernate.cfg.xml, persistence.xml and what URL you use in the property name="hibernate.connection.url") without using paying HXTT driver but with the free Derby driver.

    Read the article

  • How to create a newsletter application?

    - by tftd
    I'm required to create a newsletter php application that would send template emails to all subscribed to the system users. We're currently using PostgreSQL so PhpList will not work for us if it's not capable to work with PostgreSQL. What's the appropriate way of handling this task ? Also keep in mind that there will be big amounts of subscribers. Edit: I'm opened to java applications that could do the trick.. Thanks in advance.

    Read the article

  • Apps Script Office Hours - September 13, 2012

    Apps Script Office Hours - September 13, 2012 In this week's episode of Google Apps Script office hours, Jan and Arun: - Introduce the Google Apps Script app that was recently published in the Chrome Web Store: chrome.google.com - Answer a variety of questions from the Google Moderator. - Answer live questions about UiApp, triggers, ScriptDb, and other topics. To find out when the next office hours will be held, visit developers.google.com From: GoogleDevelopers Views: 221 7 ratings Time: 17:26 More in Science & Technology

    Read the article

  • Google Games Chat, September 13

    Google Games Chat, September 13 The Google Games Chat (official motto: "Still not cancelled") is back for yet another rousing debate about industry trends, the state of gaming in general, and, frankly, any other random thoughts that happen to cross our minds. We don't really filter what we say very much. This week, we'll be talking about App Discovery, a subject near and dear to everybody's heart. From: GoogleDevelopers Views: 0 2 ratings Time: 00:00 More in Science & Technology

    Read the article

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