Daily Archives

Articles indexed Tuesday January 4 2011

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

  • How Can I Override the Remote Administrator security policy on Android 2.2 so that I can disable the lock screen?

    - by hagope
    On Android 2.2 Froyo, I added my Corporate exchange email account to the phone, however, the security policy set by the "remote administer" requires that I enter a 4-digit PIN at the lock screen and a maximum 10sec idle. How can I hack my Android, through root access or otherwise, such that I do not need to follow this security policy. I am very annoyed at having to enter the PIN every time I want to use the phone, because I open/close it so often through out the day? Please help...I'm so surprised at how difficult it is to find the answer!

    Read the article

  • How to use Ralink RT2501/RT2573 as wifi access point in Debian Linux

    - by user60813
    Hi, I have a fit-PC server with Debian GNU/Linux (Lenny). I would like to use it as a wifi access point since my Linksys WRT54GS has become unstable. I have a USB Ralink wifi NIC. When I insert the card to USB I can see this with lsusb: Bus 001 Device 002: ID 148f:2573 Ralink Technology, Corp. RT2501/RT2573 Wireless Adapter I have tried following various HOWTOs on using wifi card as AP in Linux, however, it seems that the card cannot go into monitor mode. I believe this is because I must use a newer driver or upload non-free firmware or something like that. I have tried installed wicd, but it does not help. I bought this wifi adapter because I was told that it is one of the most common used Linux supported wifi cards that can be used as access point and a lot of other stuff. So my question is: How do I set up this USB wifi card as wireless access point in Debian Lenny?

    Read the article

  • How To Enable “Stereo Mix” in Windows 7 (to Record Audio)

    - by YatriTrivedi
    Ever need to record something on your computer exactly as it comes out of your speakers?  Enabling “Stereo Mix” will let you do exactly that, and here’s how to do it. Nowadays, most sound cards have the ability to record whatever is being output.  The only hang-up is accessing that recording channel, which can be done rather easily Latest Features How-To Geek ETC How To Boot 10 Different Live CDs From 1 USB Flash Drive The 20 Best How-To Geek Linux Articles of 2010 The 50 Best How-To Geek Windows Articles of 2010 The 20 Best How-To Geek Explainer Topics for 2010 How to Disable Caps Lock Key in Windows 7 or Vista How to Use the Avira Rescue CD to Clean Your Infected PC Enjoy Old School Style Video Game Fun with Chicken Invaders Hide the Twitter “Litter” in Twitter’s Sidebar Area (Chrome and Iron) Public Domain Day: Reflections on Copyright and the Importance of Public Domain Angry Birds Coming to PS3 and PSP This Week I Hate Mondays Wallpaper for That First Day Back at Work Tune Pop Enhances Android Music Notifications

    Read the article

  • Python et l'agrégation d'outils, Par Laurent Pointal

    Bonjour Voici un nouveau article Intitulé: Python et l'agrégation d'outils Citation: Cet article est paru originellement dans le numéro 3/2007 de la revue francophone du Linux Developer Journal. La version présentée ici reprend globalement l'article paru, en y ajoutant des liens hypertext et des références. Ce document est mis à disposition sous un contrat Creative Commons Paternité. Bonne l...

    Read the article

  • Prosit Neujahr, auf ein schönes und erfolgreiches Jahr 2011!

    - by A&C Redaktion
    Wir hoffen, Sie sind gut im neuen Jahr angekommen und wünschen Ihnen für 2011 alles Gute, Gesundheit und natürlich ein erfolgreiches Geschäftsjahr!Hinter Oracle Alliances & Channels liegt ein Jahr voller Herausforderungen und wir freuen uns darauf, 2011 an die gute und vertrauensvolle Zusammenarbeit mit unseren Partnern anzuknüpfen. Im Januar starten wir gleich mit einem großen Partner-Event ins neue Jahr, demOPN Day Virtual am 24. Januar 2011Von 14 bis 17 Uhr dreht sich dort alles um die Spezialisierung: Von den ersten Schritten, über den Nutzen bis hin zu Erfahrungsberichten einzelner Partner wird das OPN Specialized von allen Seiten beleuchtet. Zum Fragenstellen laden die Q&A-Sessions ein, beliebt ist außerdem die Networking Lounge, in der sich Partner und Interessierte individuell austauschen und vernetzen können.Was sonst noch passiert, im Jahr 2011, das steht laufend aktualisiert im Oracle Channel Event Calender.

    Read the article

  • Oracle nomeada pela Forrester Leader em Enterprise Business Intelligence Platforms

    - by Paulo Folgado
    According to an October 2010 report from independent analyst firm Forrester Research, Inc., Oracle is a leader in enterprise business intelligence (BI) platforms. Forrester Research defines BI as a set of methodologies, processes, architectures, and technologies that transform raw data into meaningful and useful information, which can then be used to enable more effective strategic, tactical, and operational insights and decision-making. Written by Forrester vice president and principal analyst Boris Evelson, The Forrester Wave: Enterprise Business Intelligence Platforms, Q4 2010 states that "Oracle has built new metadata-level [Oracle Business Intelligence Enterprise Edition 11g] integration with Oracle Fusion Middleware and Oracle Fusion Applications and continues to differentiate with its versatile ROLAP engine." The report goes on, "And in addition to closing some gaps it had in 10.x versions such as lack of RIA functionality, [the Oracle Business Intelligence Enterprise Edition 11g] actually leapfrogs the competition with the Common Enterprise Information Model (CEIM)--including the ability to define actions and execute processes right from BI metadata across BI and ERP applications." "We're pleased that the Forrester Wave recognizes Oracle Business Intelligence as a leading enterprise BI platform," said Paul Rodwick, vice president of product management, Oracle Business Intelligence. Key Innovations in Oracle Business Intelligence 11g Released in August 2010, Oracle Business Intelligence 11g represents the industry's most complete, integrated, and scalable suite of BI products. Encompassing thousands of new features and enhancements, the latest release offers three key areas of innovations. * A unified environment. The industry's first unified environment for accessing and analyzing data across relational, OLAP, and XML data sources. * Enhanced usability. A new, integrated scorecard application, plus innovations in reporting, visualization, search, and collaboration. * Enhanced performance, scalability, and security. Deeper integration with Oracle Enterprise Manager 11g and other components of Oracle Fusion Middleware provide lower management costs and increased performance, scalability, and security. Read the entire Forrester Wave Report.

    Read the article

  • Release an upgraded iOS app with a different revenue model

    - by tassock
    I am starting a new iOS project and initially plan release a simple free version to gather feedback. I don't intend to monetize or market this initial version. However, I believe "Version 2" of this app will be good enough to pay for. I would prefer to release Version 2 as an upgrade from Version 1 rather than release it as a separate app. This way I can reserve a name for the app. It will also be easier to keep everything in a single repository. Are there any downsides of this approach? It's my understanding that I can change the price of an app at any point in time, so it shouldn't be an issue transitioning to a paid app, should it?

    Read the article

  • Alt+F2 (Run Application) doesn't work for custom commands

    - by Felix
    In order to speed up Android development, I've edited my ~/.bashrc to add some paths to PATH: export PATH=${PATH}:/opt/android-sdk/tools:/opt/android-sdk/platform-tools This works just fine from the command line (I can just type android and, no matter where I am, the Android SDK and AVD Manager will start up just fine. However, if I try to type android in the Alt+F2 dialog (Run Application), it gives the following error: Could not open location 'file:///home/felix/android' Error stating file '/home/felix/android': No such file or directory Why is that? What PATH does the Run Application dialog use?

    Read the article

  • Google Chrome and Theora

    - by Michas
    I have problem with Google Chrome and Theora video. I have video that plays nice in Opera and Firefox. However, it doesn't play in Google browser and I don't know why. I've made this video in ogg2theora. Test sample: http://wwsi.edu.pl/video/enigma.html Does anyone know how should I encode to Theora that Google Chrome works? P.S. I am not interested in encoding in WebM or h.264, this time. I am not asking what is the best way to publish video on a website. I only do experiments with Ogg Theora. The test site has fallback for h.264 in video tag and WMV in WMP plugin.

    Read the article

  • Search Multiple Tables of a Mysql Database

    - by DogPooOnYourShoe
    I have the following code: $query = "select * from customer where Surname like \"%$trimmed%\" OR TitleName like \"%$trimmed%\" OR PostCode like \"%$trimmed%\" order by Surname"; However, I have another table which I want to search from with the same paramaters(variables) as that. I know that something like "select * from customer,othertable" might not be possible, Is there a way to do it?

    Read the article

  • Separation of domain and ui layer in a composite

    - by hansmaad
    Hi all, i'm wondering if there is a pattern how to separate the domain logic of a class from the ui responsibilities of the objects in the domain layer. Example: // Domain classes interface MachinePart { CalculateX(in, out) // Where do we put these: // Draw(Screen) ?? // ShowProperties(View) ?? // ... } class Assembly : MachinePart { CalculateX(in, out) subParts } class Pipe : MachinePart { CalculateX(in, out) length, diamater... } There is an application that calculates the value X for machines assembled from many machine parts. The assembly is loaded from a file representation and is designed as a composite. Each concrete part class stores some data to implement the CalculateX(in,out) method to simulate behaviour of the whole assembly. The application runs well but without GUI. To increase the usability a GUi should be developed on top of the existing implementation (changes to the existing code are allowed). The GUI should show a schematic graphical representation of the assembly and provide part specific dialogs to edit several parameters. To achieve these goals the application needs new functionality for each machine part to draw a schematic representation on the screen, show a property dialog and other things not related to the domain of machine simulation. I can think of some different solutions to implement a Draw(Screen) functionality for each part but i am not happy with each of them. First i could add a Draw(Screen) method to the MachinePart interface but this would mix-up domain code with ui code and i had to add a lot of functionality to each machine part class what makes my domain model hard to read and hard to understand. Another "simple" solution is to make all parts visitable and implement ui code in visitors but Visitor does not belong to my favorite patterns. I could derive UI variants from each machine part class to add the UI implementation there but i had to check if each part class is suited for inheritance and had to be careful on changes to the base classes. My currently favorite design is to create a parallel composite hierarchy where each component stores data to define a machine part, has implementation for UI methods and a factory method which creates instances of the corresponding domain classes, so that i can "convert" a UI assembly to a domain assembly. But there are problems to go back from the created domain hierarchy to the UI hierarchy for showing calculation results in the drawing for example (imagine some parts store some values during the calculation i want to show in the schematic representation after the simluation). Maybe there are some proven patterns for such problems?

    Read the article

  • Display the newest result from my database

    - by nogggin1
    Im building a webpage that displays the newest result from a database as a news article. The parts of the database are title, bodytext and created although I wish to keep created hidden. I am quite new to PHP and dont have any idea how to do this, could i please get some help just to display it as: title bodytext i need to be able to connect to the database with my details then display the results in a div i have set up. although i only want to show the newest result! thank you. Ned Perkins

    Read the article

  • How to determine Windows.Diagnostics.Process from ServiceController

    - by Alex
    This is my first post, so let me start by saying HELLO! I am writing a windows service to monitor the running state of a number of other windows services on the same server. I'd like to extend the application to also print some of the memory statistics of the services, but I'm having trouble working out how to map from a particular ServiceController object to its associated Diagnostics.Process object, which I think I need to determine the memory state. I found out how to map from a ServiceController to the original image name, but a number of the services I am monitoring are started from the same image, so this won't be enough to determine the Process. Does anyone know how to get a Process object from a given ServiceController? Perhaps by determining the PID of a service? Or else does anyone have another workaround for this problem? Many thanks, Alex

    Read the article

  • This regx does not work only in Chrome

    - by Deeptechtons
    Hi i just put up a validation function in jScript to validate filename in fileupload control[input type file]. The function seems to work fine in FF and sometimes in ie but never in Chrome. Basically the function tests if File name is atleast 1 char upto 25 characters long.Contains only valid characters,numbers [no spaces] and are of file types in the list. Could you throw some light on this function validate(Uploadelem) { var objRgx = new RegExp(/^[\w]{1,25}\.*\.(jpg|gif|png|jpeg|doc|docx|pdf|txt|rtf)$/); objRgx.ignoreCase = true; if (objRgx.test(Uploadelem.value)) { document.getElementById('moreUploadsLink').style.display = 'block'; } else { document.getElementById('moreUploadsLink').style.display = 'none'; } }

    Read the article

  • JQuery: calling ajax on drop element

    - by Lukasz Baran
    $("div.square").droppable({ accept: '.white', drop: function (event, ui) { $to = "#" + $(this).attr('id'); alert(to); $.post( "/Game/AddMove", { from: $from, to: $to, GameID: $("#gameID").val() }); } }); Well it's nor working. So I must ask, is it possible to call AJAX on droping some UI element ? The problem is, it's not even calling an controller,

    Read the article

  • ReportViewer datadinding (WPF)

    - by user512150
    I have a rdlc file and I try to show it using report viewer control in WPF. My DataSource is called 'OfficeDataSet' and DataSet used in report is called 'Address'. I try to initialize report viewer (I put it in WindowsFormsHost) like this: private void PrepareReport() { reportDataSource = new ReportDataSource(); officeDataSet = new OfficeDataSet(); adapter = new AddressTableAdapter(); adapter.Fill(officeDataSet.Address); reportDataSource.Name = "OfficeDataSet_Address"; reportDataSource.Value = officeDataSet.Address; viewerInstance.LocalReport.DataSources.Add(reportDataSource); viewerInstance.LocalReport.ReportEmbeddedResource = "WpfApplication1.Reports.TestReport.rdlc"; viewerInstance.Location = new System.Drawing.Point(0, 0); viewerInstance.RefreshReport(); } but I got the message "A data source instance has not been supplied for the data source 'Address'". Anybody know what can be wrong with this code? (I'm totally new in WPF and Reporting Services).

    Read the article

  • How does one programmatically create a topic w/ hornet q ?

    - by mP
    I have been looking at the org.hornetq.core.server package which seems to have the most interesting low level APIS relating to managing the server. The server session has a few methods labelled something Queue but none include Topic ... ServerSession void createQueue(SimpleString address, SimpleString name, SimpleString filterString, boolean temporary, boolean durable) throws Exception; void deleteQueue(SimpleString name) throws Exception interface QueueFactory Queue createQueue(long persistenceID, final SimpleString address, SimpleString name, Filter filter, boolean durable, boolean temporary); However i could not figure out how to create a topic. Am i missing something is a JMS topic implemented as a queue ?

    Read the article

  • java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z

    - by Panayiotis Karabassis
    I am getting this error: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z These are the jars in my classpath: com.sun.faces/jsf-api/jars/jsf-api-2.0.0.jar com.sun.faces/jsf-impl/jars/jsf-impl-2.0.0.jar org.apache.myfaces.orchestra/myfaces-orchestra-core20/jars/myfaces-orchestra-core20-1.5-SNAPSHOT.jar commons-lang/commons-lang/jars/commons-lang-2.1.jar commons-logging/commons-logging/jars/commons-logging-1.1.1.jar org.springframework/spring/jars/spring-2.5.6.jar commons-el/commons-el/jars/commons-el-1.0.jar org.richfaces.ui/richfaces-ui/jars/richfaces-ui-3.3.3.Final.jar org.richfaces.framework/richfaces-api/jars/richfaces-api-3.3.3.Final.jar commons-collections/commons-collections/jars/commons-collections-3.2.jar commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.0.jar org.richfaces.framework/richfaces-impl-jsf2/jars/richfaces-impl-jsf2-3.3.3.Final.jar com.sun.facelets/jsf-facelets/jars/jsf-facelets-1.1.14.jar org.hibernate/hibernate-core/jars/hibernate-core-3.6.0.Final.jar antlr/antlr/jars/antlr-2.7.6.jar dom4j/dom4j/jars/dom4j-1.6.1.jar org.hibernate/hibernate-commons-annotations/jars/hibernate-commons-annotations-3.2.0.Final.jar org.slf4j/slf4j-api/jars/slf4j-api-1.6.1.jar org.hibernate.javax.persistence/hibernate-jpa-2.0-api/jars/hibernate-jpa-2.0-api-1.0.0.Final.jar javax.transaction/jta/jars/jta-1.1.jar org.hibernate/hibernate-c3p0/jars/hibernate-c3p0-3.6.0.Final.jar c3p0/c3p0/jars/c3p0-0.9.1.jar org.hibernate/hibernate-entitymanager/jars/hibernate-entitymanager-3.6.0.Final.jar cglib/cglib/jars/cglib-2.2.jar asm/asm/jars/asm-3.1.jar javassist/javassist/jars/javassist-3.12.0.GA.jar org.hibernate/hibernate-search/jars/hibernate-search-3.3.0.Final.jar org.hibernate/hibernate-search-analyzers/jars/hibernate-search-analyzers-3.3.0.Final.jar org.apache.lucene/lucene-core/jars/lucene-core-3.0.3.jar org.apache.lucene/lucene-analyzers/jars/lucene-analyzers-3.0.3.jar mysql/mysql-connector-java/jars/mysql-connector-java-5.1.13.jar com.ocpsoft/prettyfaces-jsf2/jars/prettyfaces-jsf2-3.0.1.jar commons-digester/commons-digester/jars/commons-digester-2.0.jar org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.6.1.jar log4j/log4j/bundles/log4j-1.2.16.jar xom/xom/jars/xom-1.2.5.jar xml-apis/xml-apis/jars/xml-apis-1.3.03.jar xerces/xercesImpl/jars/xercesImpl-2.8.0.jar xalan/xalan/jars/xalan-2.7.0.jar org.jboss.jsfunit/jboss-jsfunit-core/jars/jboss-jsfunit-core-1.3.0.Final.jar net.sourceforge.htmlunit/htmlunit/jars/htmlunit-2.8.jar xalan/xalan/jars/xalan-2.7.1.jar xalan/serializer/jars/serializer-2.7.1.jar xml-apis/xml-apis/jars/xml-apis-1.3.04.jar commons-collections/commons-collections/jars/commons-collections-3.2.1.jar commons-lang/commons-lang/jars/commons-lang-2.4.jar org.apache.httpcomponents/httpclient/jars/httpclient-4.0.1.jar org.apache.httpcomponents/httpcore/jars/httpcore-4.0.1.jar commons-codec/commons-codec/jars/commons-codec-1.4.jar org.apache.httpcomponents/httpmime/jars/httpmime-4.0.1.jar org.apache.james/apache-mime4j/jars/apache-mime4j-0.6.jar net.sourceforge.htmlunit/htmlunit-core-js/jars/htmlunit-core-js-2.8.jar xerces/xercesImpl/jars/xercesImpl-2.9.1.jar net.sourceforge.nekohtml/nekohtml/jars/nekohtml-1.9.14.jar net.sourceforge.cssparser/cssparser/jars/cssparser-0.9.5.jar org.w3c.css/sac/jars/sac-1.3.jar commons-io/commons-io/jars/commons-io-1.4.jar cactus/cactus/jars/cactus-13-1.7.1.jar cactus/cactus-ant/jars/cactus-ant-13-1.7.1.jar commons-httpclient/commons-httpclient/jars/commons-httpclient-2.0.2.jar junit/junit/jars/junit-3.8.1.jar aspectj/aspectjrt/jars/aspectjrt-1.2.1.jar cargo/cargo/jars/cargo-0.5.jar ant/ant/jars/ant-1.5.4.jar and this is my ivy.xml: <dependencies> <!-- JSF 2.0 RI --> <dependency org="com.sun.faces" name="jsf-api" rev="2.0.0"/> <dependency org="com.sun.faces" name="jsf-impl" rev="2.0.0"/> <!-- MyFaces Orchestra --> <dependency org="org.apache.myfaces.orchestra" name="myfaces-orchestra-core20" rev="1.5-SNAPSHOT"/> <dependency org="org.springframework" name="spring" rev="2.5.6"/> <dependency org="commons-el" name="commons-el" rev="1.0"/> <!-- RichFaces --> <dependency org="org.richfaces.ui" name="richfaces-ui" rev="3.3.3.Final"/> <dependency org="org.richfaces.framework" name="richfaces-impl-jsf2" rev="3.3.3.Final"/> <dependency org="com.sun.facelets" name="jsf-facelets" rev="1.1.14"/> <!-- Hibernate --> <dependency org="org.hibernate" name="hibernate-core" rev="3.6.0.Final"/> <dependency org="org.hibernate" name="hibernate-c3p0" rev="3.6.0.Final"/> <dependency org="org.hibernate" name="hibernate-entitymanager" rev="3.6.0.Final"/> <dependency org="org.hibernate" name="hibernate-search" rev="3.3.0.Final"/> <dependency org="mysql" name="mysql-connector-java" rev="5.1.13"/> <!-- PrettyFaces --> <dependency org="com.ocpsoft" name="prettyfaces-jsf2" rev="3.0.1"/> <!-- SLF4J --> <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1"/> <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.6.1"/> <!-- XOM --> <dependency org="xom" name="xom" rev="1.2.5"/> <!-- JSF Unit --> <dependency org="org.jboss.jsfunit" name="jboss-jsfunit-core" rev="1.3.0.Final" conf="development"/> </dependencies> I am deploying to tomcat 6.0 Update After the answer below, I solved this by adding the following dependency to my ivy.xml: <dependency org="org.hibernate.javax.persistence" name="hibernate-jpa-2.0-api" rev="1.0.0.Final"/> then putting this jar above everything else under Eclipse's build order tab. I was using JRE/JDK 6.

    Read the article

  • how to send sms programmatically in iphone 2.0

    - by MaheshBabu
    Hi folks, I need to send email programmatically in iphone os 2.0. some where i found NSString *url = [NSString stringWithString: @"mailto:[email protected][email protected]&subject=Greetings%20from%20Cupertino!&body=Wish%20you%20were%20here!"]; [[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]]; is this is code work on iphone os 2.0. similarly i need to send sms in iphone 2.0 and make a call. i found it is not possible in sending sms in iphone 2.0 and making call. is there any third party tools to send sms. can any one pls help me. Thank u in advance.

    Read the article

  • how to compile youtube-api appliation

    - by Gpathy
    Hi, i am developing a custom Youtube video player. But i am not able to compile the program. I am missing something in Makefile. My program looks like main.c #include<gdata/services/youtube/gdata-youtube-service.h> int main(int argc, char **argv[]) { printf("Youtube Application\n"); return 0; } makefile gcc `pkg-config --cflags --libs libgdata-google-1.2`  -lgdata-google-1.2 main.c -o youtube When i compile, it is giving error like error: gdata/services/youtube/gdata-youtube-service.h: No such file or directory Do i got to install some other packages ? Or, i need to include something in my Makefile ? Thanks...

    Read the article

  • Deploying Qt / MySQL application

    - by canardman
    Hi everyone, I hadn't found a anwser on the web, so i ask to you. I am unable to run my compiled mysql driver on a deployment solution. On the pc A the app work fine when run with QtCreator, but via the .exe in the following working directory, the driver is not loaded : root/ -----/bin --------/app.exe --------/libgcc_s_dw2-1.dll --------/mingwm10.dll --------/QtCore4.dll --------/QtGui4.dll --------/QtSql4.dll -----/sqldrivers --------/libmysql.dll --------/qsqlmysql4.dll Whereas with libmysql.dll under bin/ driver is loaded. Now on the pc B, with no Qt or MySQL lib installation and with any of the 2 last working dir, the driver is not loaded. pc A : Qt 4.7 2010.05, Win 7 pc B : Win 7 Thanks for your help !

    Read the article

  • php foreach looping twice

    - by Jack
    Hi, I am trying to loop through some data from my database but it is outputting it twice. $fields = 'field1, field2, field3, field4'; $idFields = 'id_field1, id_field2, id_field3, id_field4'; $tables = 'table1, table2, table3, table4'; $table = explode(', ', $tables); $field = explode(', ', $fields); $id = explode(', ', $idFields); $str = 'Egg'; $i=1; while ($i<4) { $f = $field[$i]; $idd = $id[$i]; $sql = $writeConn->select()->from($table[$i], array($f, $idd))->where($f . " LIKE ?", '%' . $str . '%'); $string = '<a title="' . $str . '" href="' . $currentProductUrl . '">' . $str . '</a>'; $result = $writeConn->fetchAssoc($sql); foreach ($result as $row) { echo 'Success! Found ' . $str . ' in ' . $f . '. ID: ' . $row[$idd] . '.<br>'; } $i++; } Outputting: Success! Found Egg in field3. ID: 5. Success! Found Egg in field3. ID: 5. Could someone please explain why it is looping through both the indexed and associative values? UPDATE I did some more playing around and tried the following. $fields = 'field1, field2, field3, field4'; $idFields = 'id_field1, id_field2, id_field3, id_field4'; $tables = 'table1, table2, table3, table4'; $table = explode(', ', $tables); $field = explode(', ', $fields); $id = explode(', ', $idFields); $str = 'Egg'; $i=1; while ($i<4) { $f = $field[$i]; $idd = $id[$i]; $sql = $writeConn->select()->from($table[$i], array($f, $idd))->where($f . " LIKE ?", '%' . $str . '%'); $string = '<a title="' . $str . '" href="' . $currentProductUrl . '">' . $str . '</a>'; $sth = $writeConn->prepare($sql); $sth->execute(); $result = $sth->fetch(PDO::FETCH_ASSOC); foreach ($result as $row) { echo 'Success! Found ' . $str . ' in ' . $f . '. ID: ' . $row[$idd] . '.<br>'; } $i++; } The interesting thing is that this outputs the below: Success! Found Egg in field3. ID: E. Success! Found Egg in field3. ID: E. Success! Found Egg in field3. ID: 5. Success! Found Egg in field3. ID: 5. Success! Found Egg in field3. ID: E. Success! Found Egg in field3. ID: E. Success! Found Egg in field3. ID: 5. Success! Found Egg in field3. ID: 5. I have also tried adding $i to the output and this outputs 2 as expected. If I change fetch(PDO::FETCH_BOTH) to fetch(PDO::FETCH_ASSOC) the output is as follows: Success! Found Egg in field3. ID: E. Success! Found Egg in field3. ID: E. Success! Found Egg in field3. ID: 5. Success! Found Egg in field3. ID: 5. This has been bugging me for too long, so if anyone could help I would be very appreciative!

    Read the article

  • Image size guidelines

    - by user502014
    Hi all, This may well be a little of an open-ended question The site I am working on requires to be optimised for performance. One of the key areas is to optimise the file sizes of the images used upon the site. Unfortunatley these images are being created by employees who do not have the required knowledge for creating images for the web, and it is my job to produce a set of guidelines for them to use. I was wondering whether there was any resource/guidlines/literature regarding typical images file sizes for images of different dimensions - as I would like to include something like this to aid them to ensure their images are being created properly. Any info would be greatly appreciated. Thanks in advance

    Read the article

  • How to access generic property without knowing the closed generic type

    - by Martin Booka Weser
    I have a generic Type as follows public class TestGeneric<T> { public T Data { get; set; } public TestGeneric(T data) { this.Data = data; } } If i have now an object (which is coming from some external source) from which i know that it's type is of some closed TestGeneric<, but i don't know the TypeParameter T. Now I need to access the Data of my object. Problem is that i can't cast the object, since i don't know exactly to which closed TestGeneric. I use // thx to http://stackoverflow.com/questions/457676/c-reflection-check-if-a-class-is-derived-from-a-generic-class private static bool IsSubclassOfRawGeneric(Type rawGeneric, Type subclass) { while (subclass != typeof(object)) { var cur = subclass.IsGenericType ? subclass.GetGenericTypeDefinition() : subclass; if (rawGeneric == cur) { return true; } subclass = subclass.BaseType; } return false; } to make sure, my object is of the generic type. The code in question is as follows: public static void Main() { object myObject = new TestGeneric<string>("test"); // or from another source if (IsSubclassOfRawGeneric(typeof(TestGeneric<>), myObject.GetType())) { // the following gives an InvalidCastException // var data = ((TestGeneric<object>)myObject).Data; // if i try to access the property with reflection // i get an InvalidOperationException var dataProperty = typeof(TestGeneric<>).GetProperty("Data"); object data = dataProperty.GetValue(myObject, new object[] { }); } } I need the Data regardless of its type (well, if i could ask for its type using GetType() would be fine, but not necessary) since i just want to dump it in xml using ToString(). Any suggestions? Thanx.

    Read the article

  • How to calculate

    - by Bob
    Hi, I hv a table like this :- Item Qty Price A Price B abc 5 36.00 0 qwe 8 0 48.00 zxc 6 12.00 0 poi 4 10.00 0 lkj 9 12.00 0 mnb 3 0 14.00 vfr 7 0 6.00 How can I sum the value using SQL ie. if Price A is zero, it will pick Price B. The expected results will be as follows :- Item Value abc 180.00 qwe 384.00 zxc 72.00 poi 40.00 lkj 36.00 mnb 42.00 vfr 42.00

    Read the article

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