I wonder if this possible with Zend_Db, but I am looking for something like SQL query logging similar to how Hibernate does it, where it shows you what SQL it generates in the log file.
I am writing an abstract matrix class (and some concrete subclasses) for use on very differing hardwares/architectures, etc. and I want to write a row and column type that provides a transparent reference to the rows and columns of the matrix.
However, I want to tune for performance, so I'd like this class to be essentially a compiler construct. In other words, I'm willing to sacrifice some dev time to making the overhead of these classes as small as possible.
I assume all (small) methods would want to be virtual? Keep the structure small? Any other suggestions?
This is a follow-up to my previous question. I've simplified things as much as I could, and it still doesn't work! Although the good thing I got around using getGraphics().
A detailed explanation on what goes wrong here is massively appreciated. My suspicion is that something's wrong with the the way I used addMouseListener() method here.
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class MainClass1{
private static PaintClass22 inst2 = new PaintClass22();
public static void main(String args[]){
JFrame frame1 = new JFrame();
frame1.add(inst2);
frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame1.setTitle("NewPaintToolbox");
frame1.setSize(200, 200);
frame1.setLocationRelativeTo(null);
frame1.setVisible(true);
}
}
class PaintClass11 extends MouseAdapter{
int xvar;
int yvar;
static PaintClass22 inst1 = new PaintClass22();
public PaintClass11(){
inst1.addMouseListener(this);
inst1.addMouseMotionListener(this);
}
@Override
public void mouseClicked(MouseEvent arg0) {
// TODO Auto-generated method stub
xvar = arg0.getX();
yvar = arg0.getY();
inst1.return_paint(xvar, yvar);
}
}
class PaintClass22 extends JPanel{
private static int varx;
private static int vary;
public void return_paint(int input1, int input2){
varx = input1;
vary = input2;
repaint(varx,vary,10,10);
}
public void paintComponent(Graphics g){
super.paintComponents(g);
g.setColor(Color.RED);
g.fillRect(varx, vary, 10, 10);
}
}
With a long but plain html document opened on a mobile device (webkit), how do I ensure that text doesn't crop vertically when scrolling?
I think this should be possible by either adjusting line spacing or adding extra padding.
TIA.
| random_code | varchar(200) | YES | UNI | NULL | |
MyTable.objects.filter(random_code = None)
Is this correct? Will this SELECT where there is no random code set? Above is my table.
I have a search engine that searches albums.
For each music album, I have a page.
So, the work flow goes like this:
People search for music titles
The search engine displays a list of albums.
People click on an album to go to a details page.
I want google to index my front page and the details page. I want the details page to be highly ranked. How can I build a sitemap for this?
By the way, I have about 5 million albums (but I want the top 1000 ones to be highly ranked on google)
d3 = dict(d1, **d2)
I understand that this merges the dictionary. But, is it unique? What if d1 has the same key as d2 but different value? I would like d1 and d2 to be merged, but d1 has priority if there is duplicate key.
Suppose I have a datetime column in MySQL.
How do I select all that have a datetime within 2500 seconds of the current datetime?
SELECT ALL where current_datetime - that_datetime < 2500 ...
I display a best-sell list in front-end,Now I also want to show the QTY that how many already sell for this product,How do I get the QTY ?
And if the product is a "Configurable Product",How do I get the QTY ?
Hello,
Can anybody tell me how do i give absolute path of the img tag's src attribute?
The following doesn't work
<img alt="NO IMAGE" src="/home/administrator/tiger-info0[1].gif"/>
I am working On Ubuntu and i am very sure that image exists on this path.
I know there are many settings for a language for a table and a database.
I already created the database. I believe when I created it, it was default/LATIN. I want to change everything-I mean...both the table and the database, to UTF-8.
How can I do that? thanks.
Is there a simple :) and efficient way or reading very large number of rows sequentially using Zend_Db?
Basically I need to process entire table, row by row. Table is large, primary key sequence is not guaranteed(i.e. not an autoincrement, but is UNSIGNED INT).
What's the best way to approach this?
Environment: PHP 5.2, Zend Framework 1.10, MySQL 5.1
<td valign="center" colspan="2">
<a href="" class="table_desc" >
<span class="desc_info_butt"></span>
</a>
text here
</td>
.desc_info_butt{
background:url(Description_Button.png) top left no-repeat;
height:16px;
width:16px;
display:block;
}
For some reason, the image and text appear on two different lines!~
Hello, could some one recommend a way to get page name from a url using JavaScript?
For instance if I have http://www.cnn.com/news/1234/news.html?a=1&b=2&c=3
I just need to get "news.html" string
Thanks!
How do I use JQuery to get number from the drop down select?
<select aria-invalid="false" id="RatePercent" class="wpcf7-form-control wpcf7-select ratePercent" name="RatePercent">
<option value="">---</option>
<option value="Floating-6.5%">Floating-6.5%</option>
<option value="6 Months-5.65%">6 Months-5.65%</option>
<option value="1 Year-5.85%">1 Year-5.85%</option>
<option value="18 Months-5.99%">18 Months-5.99%</option>
<option value="2 Years-6.19%">2 Years-6.19%</option>
<option value="3 Years-6.85%">3 Years-6.85%</option>
<option value="4 Years-7.19%">4 Years-7.19%</option>
<option value="5 Years-7.40%">5 Years-7.40%</option>
</select>
If you choose 1 Year-5.85%, it returns '5.85', instead of '1 Year-5.85%'?
Hello there,
I'm working with a page that has several links that contain the same href text, and I need to select the second anchor element on the page that contains said href text. Here's a simplified version of the link structure of the page:
<a href="same/link/to/stuff/">same link</a>
<a href="same/link/to/stuff/">same link</a>
How do I fashion my selector so that it only selects the second anchor in the above example?
Currently I'm trying:
$('a[href=same/link/to/stuff/] :eq(1)')
but it is not working.
Thanks!!
class MyController(BaseController):
def index(self):
# Return a rendered template
#return render('/test.mako')
# or, return a response
return ''
Why does the function "index" have "self"?
I got this code from Pylons controller
i have tables
profiles (id, name, deleted)
categories (id, name, deleted)
profiles_categories (id, profile_id, category_id, , deleted)
I have wrong query
SELECT p.id, p.name CONCAT_WS(', ', c.name) AS keywords_categories
FROM profiles p
LEFT JOIN profiles_categories pc ON p.id = pc.profile_id
LEFT JOIN categories c ON pc.id = c.id
WHERE p.deleted = FALSE
So, i want have result with all profiles with concan categories.name.
Thanks
in active_admin partials created a form input:
<%= semantic_nested_form_for @item, :url => admin_items_path(@item) do |f| %>
<fieldset class="inputs">
<ol>
<%= f.input :category %></br>
<%= f.input :title %>
<%= f.input :photo1 %>
<%= f.input :photo2 %>
</ol>
</fieldset>
<%= f.fields_for :ItemColors do |i| %>
<fieldset class="inputs">
<ol>
<%= i.input :DetailColor %>
<%= i.input :size, :input_html => { :size => "10" } %>
<%= i.link_to_remove "remove" %>
</ol>
</fieldset>
<% end %>
<%= f.link_to_add "add", :ItemColors %>
<%= f.actions %>
<% end %>
to create a new Item okay creates and throws On the New Item, but if I do update an existing item is routed to an error occurs while such a path exists:
No route matches [PUT] "/admin/items.150" #150 is item_id
rake routes:
batch_action_admin_items POST /admin/items/batch_action(.:format) admin/items#batch_action
admin_items GET /admin/items(.:format) admin/items#index
POST /admin/items(.:format) admin/items#create
new_admin_item GET /admin/items/new(.:format) admin/items#new
edit_admin_item GET /admin/items/:id/edit(.:format) admin/items#edit
admin_item GET /admin/items/:id(.:format) admin/items#show
PUT /admin/items/:id(.:format) admin/items#update
DELETE /admin/items/:id(.:format) admin/items#destroy
help to solve this problem
UPD
I found the error, but not yet understood how to fix it
the upgrade is a request:
PUT "/admin/items"
but should:
PUT "/admin/items/some_id"
any ideas?
I have a method that effectively takes a string. However, there is a very limited subset of strings I want to use. I was thinking of typedef'ing std::string as some class, and call the functions explicit. I'm not sure that would work, however. Ideas?