Search Results

Search found 142 results on 6 pages for 'river tam'.

Page 3/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • How to implement a mailing system with Rails that sends emails in the background

    - by Tam
    I want to implement a reliable mailing system with Ruby on Rails that sends emails in the background as sending email sometimes takes like 10 seconds or more so I don't want the user to wait. Some ideas I thought of: 1- Write to a table in DB a have a background process that go over and send email (concern: potential many reads/writes to DB slows down my application) 2- Messaging Queue background process / Rake task (concern: if server crashes queued mails will be lost also might eat up a lot of memory if many emails) I was wondering if you a know of a good solution that provides a balance between reliability and performance.

    Read the article

  • Weird exception with delayed_job

    - by Tam
    Trying to queue a job with delayed_job as follows: Delayed::Job.enqueue(BackgroundProcess.new(current_user, object)) current_user and object are not nil when I print them out. The weird thing is that sometimes refreshing the page or running the command again works! Here is the exception trace: Delayed::Backend::ActiveRecord::Job Columns (44.8ms) SHOW FIELDS FROM `delayed_jobs` TypeError (wrong argument type nil (expected Data)): /Users/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/yaml.rb:391:in `emit' /Users/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/yaml.rb:391:in `quick_emit' /Users/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/yaml/rubytypes.rb:86:in `to_yaml' vendor/plugins/delayed_job/lib/delayed/backend/base.rb:65:in `payload_object=' activerecord (2.3.9) lib/active_record/base.rb:2918:in `block in assign_attributes' activerecord (2.3.9) lib/active_record/base.rb:2914:in `each' activerecord (2.3.9) lib/active_record/base.rb:2914:in `assign_attributes' activerecord (2.3.9) lib/active_record/base.rb:2787:in `attributes=' activerecord (2.3.9) lib/active_record/base.rb:2477:in `initialize' activerecord (2.3.9) lib/active_record/base.rb:725:in `new' activerecord (2.3.9) lib/active_record/base.rb:725:in `create' vendor/plugins/delayed_job/lib/delayed/backend/base.rb:21:in `enqueue'

    Read the article

  • Does introducing foreign keys to MySQL reduce performance

    - by Tam
    I'm building Ruby on Rails 2.3.5 app. By default, Ruby on Rails doesn't provide foreign key contraints so I have to do it manually. I was wondering if introducing foreign keys reduces query performance on the database side enough to make it not worth doing. Performance in this case is my first priority as I can check for data consistency with code. What is your recommendation in general? do you recommend using foreign keys? and how do you suggest I should measure this?

    Read the article

  • Can I dynamically embed fonts in Flex?

    - by Tam
    I'm wondering if I can dynamically embed fonts in Flex. I want to embed different fonts for different users so I don't want to embed all possible fonts in the same Flex file. If it's possible could you please post sample code.

    Read the article

  • Query to add a column depending of outcome of there columns

    - by Tam
    I have a user table 'users' that has fields like: id first_name last_name ... and have another table that determines relationships: user_id friend_id user_accepted friend_accepted .... I would like to generate a query that selects all the users but also add another field/column say 'network_status' that depends on the values of user_accepted and fiend_accepted. For example, if user_accepted is true friend_accepted is false I want the 'network_status' field to say 'request sent'. Can I possibly do this in one query? (I would prefer not to user if/else inside the query but if that's the only way so be it)

    Read the article

  • How can I move deleting photos to the background with delayed_job and paperclip

    - by Tam
    I let my users create photo albums with many photos. Relationship as follows: has_many :album_photos, :dependent => :destroy i upload photos to S3 When the user delete album I want to delete all photos as the relationship shows but it takes time if the user has many photos. Can I automatically set photo deletion to happen in the background (delayed_job) without having to manually call 'send_later' on every photo?

    Read the article

  • How to prevent components from rendering in Flex

    - by Tam
    Is there a way to prevent a component from rendering in Flex (to save memory or processing power)? I tried doing something like: <components:AddNewItemGroup id="addItemGroup" visible="false" enabled="false" horizontalCenter="0" bottom="0" /> I noticed that the component gets rendered but it's just not visible or functional.

    Read the article

  • is it possible to combine will_paginate with find_by_sql?

    - by Tam
    In my rails application I want to use will_paginate plugin to paginate on my query. Is that possible? I tried doing something like this but it didn't work: @users = User.find_by_sql(" SELECT u.id, u.first_name, u.last_name, CASE WHEN r.user_accepted =1 AND (r.friend_accepted =0 || r.friend_accepted IS NULL) .........").paginate( :page => @page, :per_page => @per_page, :conditions => conditions_hash, :order => 'first_name ASC') If not, can you recommend a way around this or a way that might work as I don't want to write my own pagination.

    Read the article

  • DateChooser is behaving strangely

    - by Tam
    I'm writing a Flex application and I came across what I think is a weird problem. I want to create a text box and a DateChooser as the datefield didn't do what I wanted and it's Halo so I can't skin it easily. I want the DateChooser to show when I click on the text input. Here is an except from my code: <s:TextInput id="wholeDate" width="100" mouseOver="stopChangeToNormal();" paddingRight="10" click="date1.visible = true" focusOut="date1.visible = false"/> <s:Button label="Go" width="70" /> </s:Panel> <mx:DateChooser id="date1" visible = "false" change="useDate(event);" mouseOver="changeToNormalState = false;" y="{wholeDate.y + buttonsGroup.y + 20}" x="{wholeDate.x + buttonsGroup.x - 175 }" /> The weird thing is that it works as I wanted if I make it visible = "true" to start but if I have it visible="false" it doesn't work! It shows but the date I select doesn't show in the box as it does if I have it as visible="true", but I don't want it to be visible initially. Any ideas?

    Read the article

  • How to pass a property to an event with a Button

    - by Tam
    I'm generating buttons dynamically that I want it to call a method like this: private function fetchTheDay(day:String):void { ... } But I wasn't sure how to make the button pass the string to it button.addEventListener(MouseEvent.CLICK,fetchTheDay); buttonVGroup.addElement(button); trying to do something like this didn't work: button.addEventListener(MouseEvent.CLICK,fetchTheDay(myString)); How should I do this?

    Read the article

  • How to know the order of component rendering in Flex

    - by Tam
    I have a component that has a sub-component they both use a shared variable from the model. The shared variable needs to be set by the parent component before it can be used by the child component. I did like this in the parent component: <mx:Canvas xmlns:mx="library://ns.adobe.com/flex/mx" ... creationComplete="group1_completeHandler(event)" > .... protected function group1_activateHandler(event:Event):void { model.myVariable = something; } .... <components:myCustomComponent> ... <components:myCustomComponent> ... </mx:Canvas> But for some reason when the code inside myCustomComponent tries to use myVariable for the first time I get a "null" object error. This means I guess that the child component gets rendered before the group1_activateHandler gets called and consequently myVariable gets set. What should I do to ensure that the parent container initializes the variable before the child component gets created?

    Read the article

  • Use modrewrite to redirect a url with querystring

    - by Alex
    I am trying to redirect an old URL that uses a query string to the new url that does not.. /tripinfo.cfm?RiverNameID=1&AdventureID=6 Now needs to go to /trips/big-ass-river/overnight.html So I am trying.. RewriteRule ^tripinfo.cfm?RiverNameID=1&AdventureID=6$ /trips/big-ass-river/overnight.html [R=301] But this is not working. . I can redirect the main page no problem using RewriteRule ^tripinfo.cfm$ /trips.html [R=301] If any one could tell me what Im missing that would be great.

    Read the article

  • 7 Web Design Tutorials from PSD to HTML/CSS

    - by Sushaantu
    Some time back when I was looking for some tutorials to create a website from scratch i.e. the process from designing the PSD to slice it and CSS/XHTML it, then not many quality results appeared. But that was like almost an year back and a lot of water has flown down the river Thanes since [...]

    Read the article

  • Fonts, goes back to default size

    - by Bladimir Ruiz
    Every time I change the font, it goes back to the default size, which is 12, even if I change it before with the "Tamano" menu, it only goes back to 12 every time, my guess would be the way I change the size with deriveFont(), but don't I now any other way to change it. public static class cambiar extends JFrame { public cambiar() { final Font aryal = new Font("Comic Sans MS", Font.PLAIN, 12); JFrame ventana = new JFrame("Cambios en el Texto!"); JPanel adentro = new JPanel(); final JLabel texto = new JLabel("Texto a Cambiar!"); texto.setFont(aryal); JMenuBar menu = new JMenuBar(); JMenu fuentes = new JMenu("Fuentes"); /* Elementos de Fuentes */ JMenuItem arial = new JMenuItem("Arial"); arial.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Font arrrial = new Font("Arial", Font.PLAIN, 12); float tam = (float) texto.getFont().getSize(); String hola = String.valueOf(tam); texto.setFont(arrrial); texto.setFont(texto.getFont().deriveFont(tam)); } }); fuentes.add(arial); /* FIN Fuentes */ JMenu tamano = new JMenu("Tamano"); /* Elementos de Tamano */ JMenuItem font13 = new JMenuItem("13"); font13.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { texto.setFont(texto.getFont().deriveFont(23.0f)); } }); JMenuItem font14 = new JMenuItem("14"); arial.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { texto.setFont(aryal); } }); JMenuItem font15 = new JMenuItem("15"); arial.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { texto.setFont(aryal); } }); JMenuItem font16 = new JMenuItem("16"); arial.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { texto.setFont(aryal); } }); JMenuItem font17 = new JMenuItem("17"); arial.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { texto.setFont(aryal); } }); JMenuItem font18 = new JMenuItem("18"); arial.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { texto.setFont(aryal); } }); JMenuItem font19 = new JMenuItem("19"); arial.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { texto.setFont(aryal); } }); JMenuItem font20 = new JMenuItem("20"); arial.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { texto.setFont(aryal); } }); tamano.add(font13); /* FIN tanano */ JMenu tipo = new JMenu("Tipo"); /* Elementos de tipo */ /* FIN tipo */ /* Elementos del JMENU */ menu.add(fuentes); menu.add(tamano); menu.add(tipo); /* FIN JMENU */ /* Elementos del JPanel */ adentro.add(menu); adentro.add(texto); /* FIN JPanel */ /* Elementos del JFRAME */ ventana.add(adentro); ventana.setVisible(true); ventana.setSize(250, 250); /* FIN JFRAME */ } } Thanks in Advance!

    Read the article

  • Why datacenter water cooling is not widespread?

    - by MainMa
    From what I read and hear about datacenters, there are not too many server rooms which use water cooling, and none of the largerst datacenters use water cooling (correct me if I'm wrong). Also, it's relatively easy to buy an ordinary PC components using water cooling, while water cooled rack servers are nearly nonexistent. On the other hand, using water can possibly (IMO): Reduce the power consumption of large datacenters, especially if it is possible to create direct cooled facilities (i.e. the facility is located near a river or the sea). Reduce noise, making it less painful for humans to work in datacenters. Reduce space needed for the servers: On server level, I imagine that in both rack and blade servers, it's easier to pass the water cooling tubes than to waste space to allow the air to pass inside, On datacenter level, if it's still required to keep the alleys between servers for maintenance access to servers, the empty space under the floor and at the ceiling level used for the air can be removed. So why water cooling systems are not widespread, neither on datacenter level, nor on rack/blade servers level? Is it because: The water cooling is hardly redundant on server level? The direct cost of water cooled facility is too high compared to an ordinary datacenter? It is difficult to maintain such system (regularly cleaning the water cooling system which uses water from a river is of course much more complicated and expensive than just vacuum cleaning the fans)?

    Read the article

  • EVENT RECAP: Oracle Day & Product Fair - Ft. Lauderdale

    - by cwarticki
    Are you attending any of the Oracle Days and other Events? They are fantastic!  Keep track of the Oracle Events by following @OracleEvents on Twitter.  Also, stay in the know by subscribing to one of the several Oracle Newsletters. Those will also keep you posted of upcoming in-person and webcast events. From the Oracle Events website, simply navigate to your geography and refine your options to locate what interests you. You can also perform keyword searches. Today, I had the opportunity to participate in the Oracle Day & Product Fair in Ft. Lauderdale, Florida  Thanks to those who stopped by to ask your support questions and watched me demo My Oracle Support features and best practices. (Bob Stanoch, Sales Consulting Manager giving the 2nd keynote address on Exadata below) Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} It was a pleasant surprise to run into my former Oracle colleague Josh Tieso.  Josh (pictured right) is Sr. Oracle DBA at United Healthcare. He used to work for Oracle Support years ago but for the last 6 years at UHC. Josh is a member of the ERP DBA team, working with Exalogic, Oracle ERP R12, & RAC. Along the exhibit/vendor row, I met with Marco Gangano, National Sales Manager at Mythics. It was great getting to meet Marco and I look forward to working with his company with regards to Support Best Practices. In addition, Lissette Paez (left) was representing TAM Training.  TAM Training is an Oracle University, award-winning training partner.  They cover training across the scope of Oracle products with 7 facilities in the U.S.  Lissette and I have done a couple of these Oracle Days before.  It's great to see familiar faces.  A little while ago, I was down in this area to work with Citrix with an onsite session on Support Best Practices.  Pablo Leon and Alberto Gonzalez (right)came to chat with me over at the Support booth.  They wanted to know when I was giving my session.  Unfortunately, not this time guys. I'm on booth duty only. Keep in touch. Many thanks to our sponsors: BIAS, Cloudera, Intel and TekStream Solutions.Come attend one of the many Oracle Days & other events planned for you. -Chris WartickiGlobal Customer Management

    Read the article

  • PHP4 including file during session

    - by Matherw
    I am trying to put second language on my webpage. I decided to use different files for different languages told apart by path - language/pl/projects.ln contains Polish text, language/en/projects.ln - English. Those extensions are just to tell language files from other, the content is simple php: $lang["desc"]["fabrics"]["title"] = "MATERIALY"; $lang["desc"]["fabrics"]["short_text"] = "Jakis tam tekst na temat materialów"; $lang["desc"]["services"]["title"] = "USLUGI"; $lang["desc"]["services"]["short_text"] = "Jakis tam tekst na temat uslóg"; And then on the index page I use it like so: session_start(); if (isset($_SESSION["lang"])) { $language = $_SESSION["lang"]; } else { $language = "pl"; } include_once("language/$language/projects.ln"); print $lang["desc"]["fabrics"]["title"]; The problem is that if the session variable is not set everything works fine and array item content is displayed but once I change and set $_SESSION["lang"] nothing is displayed. I tested if the include itself works as it should by putting print "sth"; at the beginning of projects.ln file and that works all right both with $_SESSION["lang"] set and unset. Please help.

    Read the article

  • How do you read from a file into an array of struct?

    - by Thomas.Winsnes
    I'm currently working on an assignment and this have had me stuck for hours. Can someone please help me point out why this isn't working for me? struct book { char title[25]; char author[50]; char subject[20]; int callNumber; char publisher[250]; char publishDate[11]; char location[20]; char status[11]; char type[12]; int circulationPeriod; int costOfBook; }; void PrintBookList(struct book **bookList) { int i; for(i = 0; i < sizeof(bookList); i++) { struct book newBook = *bookList[i]; printf("%s;%s;%s;%d;%s;%s;%s;%s;%s;%d;%d\n",newBook.title, newBook.author, newBook.subject, newBook.callNumber,newBook.publisher, newBook.publishDate, newBook.location, newBook.status, newBook.type,newBook.circulationPeriod, newBook.costOfBook); } } void GetBookList(struct book** bookList) { FILE* file = fopen("book.txt", "r"); struct book newBook[1024]; int i = 0; while(fscanf(file, "%s;%s;%s;%d;%s;%s;%s;%s;%s;%d;%d", &newBook[i].title, &newBook[i].author, &newBook[i].subject, &newBook[i].callNumber,&newBook[i].publisher, &newBook[i].publishDate, &newBook[i].location, &newBook[i].status, &newBook[i].type,&newBook[i].circulationPeriod, &newBook[i].costOfBook) != EOF) { bookList[i] = &newBook[i]; i++; } /*while(fscanf(file, "%s;%s;%s;%d;%s;%s;%s;%s;%s;%d;%d", &bookList[i].title, &bookList[i].author, &bookList[i].subject, &bookList[i].callNumber, &bookList[i].publisher, &bookList[i].publishDate, &bookList[i].location, &bookList[i].status, &bookList[i].type, &bookList[i].circulationPeriod, &bookList[i].costOfBook) != EOF) { i++; }*/ PrintBookList(bookList); fclose(file); } int main() { struct book *bookList[1024]; GetBookList(bookList); } I get no errors or warnings on compile it should print the content of the file, just like it is in the file. Like this: OperatingSystems Internals and Design principles;William.S;IT;741012759;Upper Saddle River;2009;QA7676063;Available;circulation;3;11200 Communication skills handbook;Summers.J;Accounting;771239216;Milton;2010;BF637C451;Available;circulation;3;7900 Business marketing management:B2B;Hutt.D;Management;741912319;Mason;2010;HF5415131;Available;circulation;3;1053 Patient education rehabilitation;Dreeben.O;Education;745121511;Sudbury;2010;CF5671A98;Available;reference;0;6895 Tomorrow's technology and you;Beekman.G;Science;764102174;Upper Saddle River;2009;QA76B41;Out;reserved;1;7825 Property & security: selected essay;Cathy.S;Law;750131231;Rozelle;2010;D4A3C56;Available;reference;0;20075 Introducing communication theory;Richard.W;IT;714789013;McGraw-Hill;2010;Q360W47;Available;circulation;3;12150 Maths for computing and information technology;Giannasi.F;Mathematics;729890537;Longman;Scientific;1995;QA769M35G;Available;reference;0;13500 Labor economics;George.J;Economics;715784761;McGraw-Hill;2010;HD4901B67;Available;circulation;3;7585 Human physiology:from cells to systems;Sherwood.L;Physiology;707558936;Cengage Learning;2010;QP345S32;Out;circulation;3;11135 bobs;thomas;IT;701000000;UC;1006;QA7548;Available;Circulation;7;5050 but when I run it, it outputs this: OperatingSystems;;;0;;;;;;0;0 Internals;;;0;;;;;;0;0 and;;;0;;;;;;0;0 Design;;;0;;;;;;0;0 principles;William.S;IT;741012759;Upper;41012759;Upper;;0;;;;;;0;0 Saddle;;;0;;;;;;0;0 River;2009;QA7676063;Available;circulation;3;11200;lable;circulation;3;11200;;0;;;;;;0;0 Communication;;;0;;;;;;0;0 Thanks in advance, you're a life saver

    Read the article

  • How can I modified the value of a string defined in a struc?

    - by Eric
    Hi, I have the following code in c++: define TAM 4000 define NUMPAGS 512 struct pagina { bitset<12 direccion; char operacion; char permiso; string *dato; int numero; }; void crearPagina(pagina* pag[], int pos, int dir) { pagina * paginas = (pagina*)malloc(sizeof(char) * TAM); paginas - direccion = bitset<12 (dir); paginas - operacion = 'n'; paginas - permiso = 'n'; string **tempDato = &paginas - dato; char *temp = " "; **tempDato = temp; paginas - numero = 0; pag[pos] = paginas; } I want to modify the value of the variable called "string *dato" in the struct pagina but, everytime I want to assing a new value, the compiler throws a segmentation fault. In this case I'm using a pointer to string, but I have also tried with a string. In a few words I want to do the following: pagina - dato = "test"; Any idea? Thanks in advance!!!

    Read the article

  • How can I modify the value of a string defined in a struct?

    - by Eric
    Hi, I have the following code in c++: #define TAM 4000 #define NUMPAGS 512 struct pagina { bitset<12> direccion; char operacion; char permiso; string *dato; int numero; }; void crearPagina(pagina* pag[], int pos, int dir) { pagina * paginas = (pagina*)malloc(sizeof(char) * TAM); paginas -> direccion = bitset<12> (dir); paginas -> operacion = 'n'; paginas -> permiso = 'n'; string **tempDato = &paginas -> dato; char *temp = " "; **tempDato = temp; paginas -> numero = 0; pag[pos] = paginas; } I want to modify the value of the variable called "string *dato" in the struct pagina but, everytime I want to assing a new value, the compiler throws a segmentation fault. In this case I'm using a pointer to string, but I have also tried with a string. In a few words I want to do the following: pagina - dato = "test"; Any idea? Thanks in advance!!!

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >