Daily Archives

Articles indexed Sunday June 13 2010

Page 18/73 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Formating a date field in the Model (Codeigniter)

    - by Landitus
    Hi, I', trying to re-format a date from a table in Codeigniter. The Controller is for a blog. I was succesfull when the date conversion happens in the View. I was hoping to convert the date in the Model to have things in order. This is the Model: class Novedades_model extends Model { function getAll() { $this->db->order_by('date','desc'); $query = $this->db->get('novedades'); if($query->num_rows() > 0) { foreach ($query->result() as $row) { $data[] = $row; } } return $data; } } This is part of the controller $this->load->model('novedades_model'); $data['records'] = $this->novedades_model->getAll(); Here's the date conversion as it happens in the View. This is inside the posts loop: <?php foreach($records as $row) : ?> <?php $fdate = "%d <abbr>%M</abbr> %Y"; $dateConv = mdate($fdate, mysql_to_unix($row->date)); ?> <div class="article section"> <span class="date"><?php echo $dateConv ;?></span> ... Keeps going ... How can I convert the date in the Model? Can I access the date key and refactor it?

    Read the article

  • dynamically create sitemap xml using php

    - by rekhasathvika
    Hi, I have created sitemap for my site using some reference code in the below link http://stackoverflow.com/questions/2747801/creating-an-xml-sitemap-with-php But I am getting error as XML Parsing Error: undefined entity Location: as my content is as follows << alt attribute and it says something like < loc http://www.example.com/700- & laquo;alt & raquo;-attributes-in-images.php< /loc Can anyone tell me how to get rid of this error.

    Read the article

  • Is there a way to suppress warnings in Xcode?

    - by kdbdallas
    Is there a way to suppress warnings in Xcode? For example I am calling an undocumented method and since the method is not in the header I get a warning on compile. I know I can add it to my header to stop the warning, but I am wondering if there is a way other then adding it to the header (so I can keep the headers clean and standard) to suppress the warning? A pragma or something?

    Read the article

  • wait for the second VB script untill ended from primary VB script

    - by yael
    Hi I have VB script that run second VB script The second VB script ask some questions from the input box My problem is that “MyShell.Run” not wait until SecondVBscript.vbs will ended And the Other VB syntax run immodestly also Need to wait for MyShell.Run process ended and then perform the Other VB syntax How can I do that? Set MyShell = Wscript.CreateObject("WScript.Shell") MyShell.Run " C:\Program Files\SecondVBscript.vbs" Set MyShell = Nothing Other VB syntax

    Read the article

  • jQuery fadeOut() function doesn't ALWAYS work in Chrome, Firefox, IE

    - by user365568
    Sometimes, the slideshow on my website, which uses fadeOut and fadeIn to cycle through three main images, will fadeIn a new photo without fading in the old one. This doesn't happen every time the page loads though. My site is here (the slideshow will take 7 seconds to change): http://codersarepeople.com/v2/ The code I use is this: slideshow = new Array('#slideshow1','#slideshow2','#slideshow3'); var i = Math.floor(Math.random()*3); $(slideshow[i]).fadeIn(125); var t = setInterval(function() { $(slideshow[i%3]).fadeOut(250,function() { $(slideshow[(i+1)%3]).fadeIn(250); }); i++; },7000);

    Read the article

  • Bitwise operators and converting an int to 2 bytes and back again.

    - by aKiwi
    first time user, Hi guys! So hopefully someone can help.. My background is php so entering the word of lowend stuff like, char is bytes, which are bits.. which is binary values.. etc is taking some time to get the hang of ;) What im trying to do here is sent some values from an Ardunio board to openFrameWorks (both are c++). What this script currently does (and works well for one sensor i might add) when asked for the data to be sent is.. int value_01 = analogRead(0); // which outputs between 0-1024 unsigned char val1; unsigned char val2; //some Complicated bitshift operation val1 = value_01 &0xFF; val2 = (value_01 >> 8) &0xFF; //send both bytes Serial.print(val1, BYTE); Serial.print(val2, BYTE); Apparently this is the most reliable way of getting the data across.. So now that it is send via serial port, the bytes are added to a char string and converted back by.. int num = ( (unsigned char)bytesReadString[1] << 8 | (unsigned char)bytesReadString[0] ); So to recap, im trying to get 4 sensors worth of data (which im assuming will be 8 of those serialprints?) and to have int num_01 - num_04... at the end of it all. Im assuming this (as with most things) might be quite easy for someone with experience in these concepts.. Any help would be greatly appreciated. Thanks

    Read the article

  • Apache/2.2.9, mod_perl/2.0.4: status_line doesn't seem to work

    - by Eugene
    Response is prepared this way: my $r = Apache2::RequestUtil->request; $r->status_line('500 Internal Server Error'); $r->send_cgi_header("Content-Type: text/html; charset=UTF-8\n\n"); print 'Custom error message'; Request: GET /test_page HTTP/1.1 Host: www.xxx.xxx Response: HTTP/1.1 200 OK Date: XXXXXXXXXX Server: Apache/xxxxxxxx Vary: Accept-Encoding Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 44 Custom error message 0 Why response status is 200 and not 500?

    Read the article

  • mutt isn't sending large messages

    - by Guy
    I'm using mutt in the following way: echo <MESSAGE> | mutt -s <SUBJECT> -- <TO-ADDR> This usually works when I try small message (messages with ~10 lines in the body). But when trying very large message (a message with ~200 lines) the email just isn't received. Any ideas?

    Read the article

  • Test Jboss JMS externally - outside of the application server

    - by bmatsliah
    Hi All, I'm pretty new to the JMS functionality. I need to test a remote JMS which is on Jboss 4.2.1. I want to develop an external test (e.g from a main class) which sends and receives messages to/from the app. server. (I do have full access to the remote server.) My questions are: 1) How do I send messages to the Jboss JMS? 2) Where is the information needed to send a message located on the Jboss? ip, port, queue, user, pw, ect. to set up the local messaging test. 3) Is there a way to config/ develop a mechanism on the remote JMS Jboss server that sends back acknowledgments to the sender (in this case)? I greatly appreciate your help. Thanks, Ben

    Read the article

  • How to get the embeded button of UIBarButtonItem

    - by Jagie
    In an iPhone app,we can make a UIBarButtonItem by using the following code: UIBarButtonItem *bbix=[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:nil action:nil]; the generated UIBarButtonItem has a system-provided "action" icon.My question is :how to get this UIBarButtonItem's inner UIButton and add this UIButton to another UIView? who can show me some code? thanks in advance

    Read the article

  • creating tables in ruby-on-rails 3 through migrations?

    - by fayer
    im trying to understand the process of creating tables in ruby-on-rails 3. i have read about migrations. so i am supposed to create tables by editing in the files in: Database Migrations/migrate/20100611214419_create_posts Database Migrations/migrate/20100611214419_create_categories but they were generated by: rails generate model Post name:string description:text rails generate model Category name:string description:text does this mean i have to use "rails generate model" command everytime i want to create a table? what if i create a migration file but want to add columns. do i create another migration file for adding those or do i edit the existing migration file directly? the guide told me to add a new one, but here is the part i dont understand. why would i add a new one? cause then the new state will be dependent of 2 migration files. in symfony i just edit a schema.yml file directly, there are no migration files with versioning and so on. im new to RoR and want to get the picture of creating tables. thanks

    Read the article

  • Consolidating separate Loan, Purchase & Sales tables into one transaction table.

    - by Frank Computer
    INFORMIX-SE with ISQL 7.3: I have separate tables for Loan, Purchase & Sales transactions. Each tables rows are joined to their respective customer rows by: customer.id [serial] = loan.foreign_id [integer]; = purchase.foreign_id [integer]; = sale.foreign_id [integer]; I would like to consolidate the three tables into one table called "transaction", where a column "transaction.trx_type" [char(1)] {L=Loan, P=Purchase, S=Sale} identifies the transaction type. Is this a good idea or is it better to keep them in separate tables? Storage space is not a concern, I think it would be easier programming & user=wise to have all types of transactions under one table.

    Read the article

  • Unable to use XSSF with Excel 2007

    - by Tarun
    Hello All, I am having tough time getting to read data from excel 2007. I am using XSSF to read data from a specific cell of excel but keep getting error - Exception in thread "main" java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.setSaveAggressiveNamespaces()Lorg/apache/xmlbeans/XmlOptions; at org.apache.poi.POIXMLDocumentPart.(POIXMLDocumentPart.java:46) This is my piece of code - public static void main(String [] args) throws IOException { InputStream ins = new FileInputStream("C:\\Users\\Tarun3Kumar\\Desktop\\test.xlsx"); XSSFWorkbook xwb = new XSSFWorkbook(ins); XSSFSheet sheet = xwb.getSheetAt(0); Row row = sheet.getRow(1); Cell cell = row.getCell(0); System.out.println(cell.getStringCellValue()); System.out.println("a"); } I have following jars added to build path - poi-3.6 poi-ooxml-3.6 poi-ooxml-schemas-3.6 x-bean.jar I could only figure out that "setSaveAggressiveNamespaces" has replaced "setSaveAggresiveNamespaces"....

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >