Search Results

Search found 3177 results on 128 pages for 'david espejo'.

Page 72/128 | < Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >

  • XmlHttpRequest in a bookmarklet returns empty responseText on GET?

    - by David Eyk
    I'm trying to build a javascript bookmarklet for a special URL shortening service we've built at http://esv.to for shortening scripture references (i.e. "Matthew 5" becomes "http://esv.to/Mt5". The bookmarklet is supposed to do a GET request to http://api.esv.to/Matthew+5, which returns a text/plain response of http://esv.to/Mt5. The code for the bookmarklet itself looks like this (expanded for readability): var body = document.getElementsByTagName('body')[0], script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'http://esv.to/media/js/bookmarklet.js'; body.appendChild(script); void(0); The code from http://esv.to/media/js/bookmarklet.js looks like this: (function() { function shorten(ref, callback) { var url = "http://esv.to/api/" + escape(ref); var req = new XMLHttpRequest(); req.onreadystatechange = function shortenIt() { if ( this.readyState == 4 && this.status == 200 ) { callback(req.responseText); }; }; req.open( "GET", url ); req.send(); }; function doBookmarklet() { var ref = prompt("Enter a scripture reference or keyword search to link to:", "") shorten(ref, function (short) { prompt("Here is your shortened ESV URL:", short); }); }; doBookmarklet(); })(); When called from http://esv.to itself, the bookmarklet works correctly. But when used on another page, it does not. The strange thing is, when I watch the request from Firebug, the response is 200 OK, the browser downloads 17 bytes (the length of the returned string), but the response body is empty! No error is thrown, just an empty responseText on the XmlHttpRequest object. Now, according to http://stackoverflow.com/questions/664689/ajax-call-from-bookmarklet, GET shouldn't violate the same origin policy. Is this a bug? Is there a workaround?

    Read the article

  • How do I display a Wicket Datatable, sorted by a specific column by default?

    - by David
    Hello everyone! I have a question regarding Wicket's Datatable. I am currently using DataTable to display a few columns of data. My table is set up as follows: DataTable<Column> dataTable = new DataTable<Column>("columnsTable", columns, provider, maxRowsPerPage) { @Override protected Item<Column> newRowItem(String id, int index, IModel<Column> model) { return new OddEvenItem<Column>(id, index, model); } }; The columns look like so: columns[0] = new PropertyColumn<Column>(new Model<String>("Description"), "description", "description"); columns[1] = new PropertyColumn<Column>(new Model<String>("Logic"), "columnLogic"); columns[2] = new PropertyColumn<Column>(new Model<String>("Type"), "dataType", "dataType"); Here is my column data provider: public class ColumnSortableDataProvider extends SortableDataProvider<Column> { private static final long serialVersionUID = 1L; private List<Column> list = null; public ColumnSortableDataProvider(Table table) { this.list = Arrays.asList(table.getColumns().toArray(new Column[0])); } public ColumnSortableDataProvider(List<Column> list) { this.list = list; } @Override public Iterator<? extends Column> iterator(int first, int count) { /* first - first row of data count - minimum number of elements to retrieve So this method returns an iterator capable of iterating over {first, first+count} items */ Iterator<Column> iterator = null; try { if(getSort() != null) { Collections.sort(list, new Comparator<Column>() { private static final long serialVersionUID = 1L; @Override public int compare(Column c1, Column c2) { int result=1; PropertyModel<Comparable> model1= new PropertyModel<Comparable>(c1, getSort().getProperty()); PropertyModel<Comparable> model2= new PropertyModel<Comparable>(c2, getSort().getProperty()); if(model1.getObject() == null && model2.getObject() == null) result = 0; else if(model1.getObject() == null) result = 1; else if(model2.getObject() == null) result = -1; else result = ((Comparable)model1.getObject()).compareTo(model2.getObject()); result = getSort().isAscending() ? result : -result; return result; } }); } if (list.size() > (first+count)) iterator = list.subList(first, first+count).iterator(); else iterator = list.iterator(); } catch (Exception e) { e.printStackTrace(); } return iterator; } Sorting by clicking a column works perfectly, but I would like the table to initially be sorted, by default, by the Description column. I am at a loss to do this. If you need to see some other code, please let me know. Thank you in advance!!! - D

    Read the article

  • How to convert a PCRE to a POSIX RE?

    - by David M
    This interesting question http://stackoverflow.com/questions/2837267/ concerned how to do a negative look-ahead in MySQL. The poster wanted to get the effect of Kansas(?! State) because MySQL doesn't implement look-ahead assertions, a number of answers came up the equivalent Kansas($|[^ ]| ($|[^S])| S($|[^t])| St($|[^a])| Sta($|[^t])| Stat($|[^e])) The poster pointed out that's a PITA to do for potentially lots of expressions. Is there a script/utility/mode of PCRE (or some other package) that will convert a PCRE (if possible) to an equivalent regex that doesn't use Perl's snazzy features? I'm fully aware that some Perl-style regexes cannot be stated as an ordinary regex, so I would not expect the tool to do the impossible, of course!

    Read the article

  • ASP.NET The underlying connection was closed: Could not establish trust relat

    - by David Lively
    When attempting to use HttpWebRequest to retrieve a page from my dev server, I get a web exception: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel." The remote certificate is invalid according to the validation procedure... The url I'm attempting to read from is a plain-old http://myserver.com/mypage.asp - no SSL. The production server has a valid certificate so this shouldn't be an issue, but our dev server doesn't. Help!

    Read the article

  • Backing Up Transaction Logs to Tape?

    - by David Stein
    I'm about to put my database in Full Recovery Model and start taking transaction log backups. I am taking a full nightly backup to another server and later in the evening this file and many others are backed up to tape. My question is this. I will take hourly (or more if necessary) t-log backups and store them on the other server as well. However, if my full backups are passing DBCC and integrity checks, do I need to put my T-Logs on tape? If someone wants point in time recovery to yesterday at 2pm, I would need the previous full backup and the transaction logs. However, other than that case, if I know my full back ups are good, is there value in keeping the previous day's transaction log backups?

    Read the article

  • How to re-use a thread in Java ?

    - by David
    I am a building a console Sudoku Solver where the main objective is raw speed. I now have a ManagerThread that starts WorkerThreads to compute the neibhbors of each cell. So one WorkerThread is started for each cell right now. How can I re-use an existing thread that has completed its work? The Thread Pool Pattern seems to be the solution, but I don't understand what to do to prevent the thread from dying once its job has been completed. ps : I do not expect to gain much performance for this particular task, just want to experiment how multi-threading works before applying it to the more complex parts of the code. Thanks

    Read the article

  • Factory Girl Association

    - by David Lyod
    I have an association of a Admin - Account in factory girl I now wish to associate a second user with the same account but am unable to do so. I build my Admin-Account association like this u.account { |account| account.association(:account)} This works fine and creates the Account and Admin association. Im looking for a way to setup a second user who's account also points to the record created in the Admin factory association. I currently just build the second user as such @user = Factory.build(:seconduser) @user.account = Account.first @user.save! Which works but seems somewhat hacky .

    Read the article

  • Create a user-defined aggregate without SQL CLR

    - by David Pfeffer
    I am planning on deploying a database to SQL Azure, so I cannot use the SQL CLR. However, I have a need to create an aggregate function -- in my case, I need to STUnion a bunch of Geography objects together. (Azure is expected to support Spatial by June.) Is there another way to accomplish this, without making use of the CLR, in a query? Or do I have to create a UDF that will take a table as a parameter and return the aggregate?

    Read the article

  • How to make <dl> layout horizontally?

    - by David
    I'm trying to develop a layout for my website in which elements of a definition list will be laid out horizontally, kind of like this: term 1 term 2 term 3 definition 1 definition 2 definition 3 Anyone know a way to make a definition list look like this using valid CSS? Or if I can't do it with a <dl>, what would be the recommended structure?

    Read the article

  • Zend database query result converts column values to null

    - by David Zapata
    Hi again. I am using the next instructions to get some registers from my Database. Create the needed models (from the params module): $obj_paramtype_model = new Params_Model_DbTable_Paramtype(); $obj_param_model = new Params_Model_DbTable_Param(); Getting the available locales from the database // This returns a Zend_Db_Table_Row_Abstract class object $obj_paramtype = $obj_paramtype_model->getParamtypeByValue('available_locales'); // This is a query used to add conditions to the next sentence. This is executed from the Params_Model_DbTable_Param instance class, that depends from Params_Model_DbTable_Paramtype class (reference map and dependentTables arrays are fine in both classes) $obj_select = $this->select()->where('deleted_at IS NULL')->order('name'); // Execute the next query, applying the select restrictions. This returns a Zend_Db_Table_Rowset_Abstract class object. This means "Find Params by Paramtype" $obj_params_rowset = $obj_paramtype->findDependentRowset('Params_Model_DbTable_Param', 'Paramtype', $obj_paramtype); // Here the firebug log displays the queries.... Zend_Registry::get('log')->debug($obj_params_rowset); I have a profiler for all my DB executions from Zend. At this point the log and profiler objects (that includes Firebug writers), shows the executed SQL Queries, and the last line displays the resulting Zend_Db_Table_Rowset_Abstract class object. If I execute the SQL Queries in some MySQL Client, the results are as expected. But the Zend Firebug log writer displays as NULL the column values with latin characters (ñ). In other words, the external SQL client shows es_CO | Español de Colombia and en_US | English of United States but the Query results from Zend displays (and returns) es_CO | null and en_US | English of United States. I've deleted the ñ character from Español de Colombia and the query results are just fine in my Zend Log Firebug screen, and in the final Zend Form element. The MySQL database, tables and columns are in UTF-8 - utf8_unicode_ci collation. All my zend framework pages are in UTF-8 charset. I'm using XAMPP 1.7.1 (PHP 5.2.9, Apache at port 90 and MySQL 5.1.33-community) running on Windows 7 Ultimate; Zend Framework 1.10.1. I'm sorry if there is so much information, but I don't really know why could that happen, so I tryed to provide as much related information as I could to help to find some answer.

    Read the article

  • How do I override generic activerecord error messages in ruby-on-rails?

    - by David Smith
    In my en.yml translation file, I have: activerecord: errors: template: header: one: "1 error prohibited this {{model}} from being saved" other: "{{count}} errors prohibited this {{model}} from being saved" When an activerecord/validation error occurs during logging into my application, the error message: "1 error prohibited this user session from being saved" is displayed (where user_session is the model being used). I'd rather have it say something like "An error has occured to prevent you from logging into your account". How do I override the generic error message with my specific one?

    Read the article

  • ASP.NET Nested masterpages, how to set content in the top page from the aspx file?

    - by David Suarez
    I have some content from a CMS that I need to move to raw asp.net pages. Since the templates are nested I guess I can use nested masterpages to acomplish it, but I'm finding that I can't set values on the top masterpage from the deep child page. Here is a sample. I have several nested masterpages with contentplaceholders: top master (with contentPlaceHolder1) nested master, dependent on top master (with contentPlaceHolder2) aspx page, dependent on nested master, defines content for contentPlaceHolder1 and 2 The problem is that asp.net doesn't allow me to have the value of contentPlaceHolder1 defined in the content page, it should be defined in the nested master. But the point is that the client page knows that value, not the template masters (for instance, the page knows about the graphic it has to display on the the top, but the placeholder for the graphic is the top master). How can I set values in the aspx page to be rendered in the top master?

    Read the article

  • Singletons in Cocoa Plugins

    - by David Beck
    How would I get a hold of a singleton in the main application from a SIMBL plugin? When I try to call something like [ProcessControl sharedInstance], I get an error that ProcessControl is undefined (even though it is declared in a header file).

    Read the article

  • How to make this Makefile more concise?

    - by David
    I know there are ways to remove duplicates in Makefile. Can you tell me how to make the Makefile below more concise? Thanks! And is there any tool to automate it? CC=gcc CFLAGS=-pthread -g -o all: dotprod_mutex dotprod_serial dotprod_mutex: dotprod_mutex.c $(CC) $(CFLAGS) dotprod_mutex dotprod_mutex.c dotprod_serial: dotprod_serial.c $(CC) $(CFLAGS) dotprod_serial dotprod_serial.c

    Read the article

  • Equivalent of http://www.cplusplus.com/ for C# .net

    - by David Relihan
    Hi Folks I've read through a lot of the "Learn C# .Net" questions just to see if this question was answered already (directly or indirectly). I program mostly in C++ so I find the website http://www.cplusplus.com/ invaluable and there's rarely a day when it is not open in my browser! However, I'm just wondering is there an C# .Net equivalent that people find themselves constantly referencing? The best I'm aware of is: http://stackoverflow.com http://msdn.microsoft.com/en-us/vcsharp/aa336809.aspx http://www.java2s.com/Tutorial/CSharp/CatalogCSharp.htm Thanks,

    Read the article

  • What is the Null Character literal in TSQL?

    - by David in Dakota
    I am wondering what the literal for a Null character (e.g. '\0') is in TSQL. Note: not a NULL field value, but the null character (see link). I have a column with a mix of typical and a null character. I'm trying to replace the null character with a different value. I would have thought that the following would work but it is unsuccessfull: select REPLACE(field_with_nullchar, char(0), ',') from FOO where BAR = 20

    Read the article

  • C# graphics flickering

    - by David
    Hello, I am working on kind of drawing program but I have a problem with flickering while moving a mouse cursor while drawing a rubberband line. I hope you can help me to remove that flickering of line, here is the code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace GraphicsTest { public partial class Form1 : Form { int xFirst, yFirst; Bitmap bm = new Bitmap(1000, 1000); Graphics bmG; Graphics xG; Pen pen = new Pen(Color.Black, 1); bool draw = false; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { bmG = Graphics.FromImage(bm); xG = this.CreateGraphics(); bmG.Clear(Color.White); } private void Form1_MouseDown(object sender, MouseEventArgs e) { xFirst = e.X; yFirst = e.Y; draw = true; } private void Form1_MouseUp(object sender, MouseEventArgs e) { bmG.DrawLine(pen, xFirst, yFirst, e.X, e.Y); draw = false; xG.DrawImage(bm, 0, 0); } private void Form1_MouseMove(object sender, MouseEventArgs e) { if (draw) { xG.DrawImage(bm, 0, 0); xG.DrawLine(pen, xFirst, yFirst, e.X, e.Y); } } private void Form1_Paint(object sender, PaintEventArgs e) { xG.DrawImage(bm, 0, 0); } } }

    Read the article

  • Using Thor for generators in a Ruby Gem

    - by David Burrows
    How do I setup a Gem to have a binary command eg. "project newProject" that uses Thor's set of generator commands to create files etc.? A good answer would describe how to layout the skeleton of a gem that that when run from the command line "project newProject" creates 1 file named "newProject.txt" in the directory it's run from. I've seen that Rails 3 is using Thor to power it's generators, seems like a really good solution and i'd like to use a similar approach in non-Rails ruby gem i'm working on. Tried looking at the Rails 3 source but it's a bit labyrinthine hence the question.

    Read the article

  • NSZombieEnabled hides EXC_BAD_ACCESS error entirely

    - by David Liu
    So I have a subclass of a UIView that starts causing EXC_BAD_ACCESS errors when I go through a specific set of conditions (run on iPad instead of iPhone or simulator, first login only). It throws the exception when the UIView subclass gets deallocated, during the last line, where I have [super dealloc]. I heard about using NSZombieEnabled, so I tossed that on to see if I could get any more information about it, but now it hides the error completely! Does anyone know a bit more about this type of situation? I thought NSZombie would start spewing stuff into my console like before, but I'm hoping that the nonexistance of errors would tell me some sort of information as well.

    Read the article

  • Returning recursive ternary freaks out

    - by David Titarenco
    Hi, assume this following function: int binaryTree::findHeight(node *n) { if (n == NULL) { return 0; } else { return 1 + max(findHeight(n->left), findHeight(n->right)); } } Pretty standard recursive treeHeight function for a given binary search tree binaryTree. Now, I was helping a friend (he's taking an algorithms course), and I ran into some weird issue with this function that I couldn't 100% explain to him. With max being defined as max(a,b) ((a)>(b)?(a):(b)) (which happens to be the max definition in windef.h), the recursive function freaks out (it runs something like n^n times where n is the tree height). This obviously makes checking the height of a tree with 3000 elements take very, very long. However, if max is defined via templating, like std does it, everything is okay. So using std::max fixed his problem. I just want to know why. Also, why does the countLeaves function work fine, using the same programmatic recursion? int binaryTree::countLeaves(node *n) { if (n == NULL) { return 0; } else if (n->left == NULL && n->right == NULL) { return 1; } else { return countLeaves(n->left) + countLeaves(n->right); } } Is it because in returning the ternary function, the values a => countLeaves(n->left) and b => countLeaves(n->right) were recursively double called simply because they were the resultants? Thank you!

    Read the article

  • Adding LegendItems in Flex places horizontally not vertically (as it's supposed to)

    - by David
    I'm dynamically inserting LegendItems into a Legend using the following code: signalLegend.removeAllChildren(); signalLegend.direction = "vertical"; for (var i:int = 0; i < numItems - 1; i++) { signalLegend.addChild(new LegendItem()); legendItem = signalLegend.getChildAt(i) as LegendItem; legendItem.label = "Title here"; legendItem.setStyle("fill", theColour); } While the Legend direction is set as vertical, all the items are appearing horizontally. Very annoying.

    Read the article

< Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >