Search Results

Search found 1517 results on 61 pages for 'ben tew'.

Page 45/61 | < Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >

  • Same font, character spacing and line-height but different results

    - by Ben Huh
    The introduction of @font-face in CSS3 allows web designers to use fonts that look the same across all browsers. That is what I thought until trying it out with the following code in jsFiddle: HTML: <div> The_Quick_Brown<br> Fox_Jumps_Over<br> The_Lazy_Dog </div> CSS: @font-face { font-family: 'Open Sans'; font-style: normal; font-weight: 400; src: url('http://themes.googleusercontent.com/static/fonts/opensans/v6/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff'); } div { display: block; width: 496px; height: 86px; font-size: 1.3em; font-family: 'Open Sans'; font-style: normal; margin: 0; border: 0; padding: 0; background: cyan; letter-spacing: 1.44em; line-height: 1.44; overflow: hidden; } This is the view from Firefox 12.0. Take note of the partially obscured 'o' in 'brown', the position of 'g' in 'dog' and the underscore '_' at the bottom edge. This is the view from Google Chrome 19.0. Despite explicitly setting letter-spacing and line-height for the same font, why are the results still different?

    Read the article

  • Memory leak when declaring NSString from ABRecordCopyValue

    - by Ben Thompson
    I am using the following line of code... NSString *clientFirstName = (NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty); The 'analyse' feature on Xcode is saying that this giving rise to a potential memory leak. I am not releasing clientFirstName at all as I have neither alloc or retain'd it. However, I am conscious that ABRecordCopyValue may not be returning an object as say a command like [NSMutableArray arrayWithArray:someArray] would which might mean I am indeed creating a new object that I control and must release. Keen to hear thoughts...

    Read the article

  • AdMob ad is showing in iOS simulator, but not on iDevice

    - by Ben Toscano
    As the heading states, I can get my AdMob Ad to show in the iOS 5.1 and 6.0 simulator just fine, however, when running my application on my iOS 5.1.1 or 6.0 devices, there is just a blank space where the ad should be served. The code in my .m file is as follows: bannerView_ = [[GADBannerView alloc] initWithFrame:CGRectMake(0.0, 411.0 - GAD_SIZE_320x50.height, GAD_SIZE_320x50.width, GAD_SIZE_320x50.height)]; bannerView_.adUnitID = @"**myID**"; bannerView_.rootViewController = self; [self.view addSubview:bannerView_]; [bannerView_ loadRequest:[GADRequest request]]; //GADRequest *r = [[GADRequest alloc] init]; //r.testing = YES; //[bannerView_ loadRequest:r]; Furthermore, if I initiate testing of ads (see commented-out section), the test ad shows on both the simulator AND my iDevices, which is baffling me! What am I missing? Thanks for your help.

    Read the article

  • How can I force a jQuery plugin to refresh the data it has loaded?

    - by Ben Dauphinee
    I am working with jQuery Pagination, and a popup form. On saving the data in the form, how would I go about forcing the Pagination plugin to reload the data it would load for whatever page I am on, without reloading the entire webpage? Ex: Item 1 Item 2 Item 3 Add Item-Item 23-Save-Reload List Item 1 Item 2 Item 3 Item 23 http://d-scribe.de/webtools/jquery-pagination/lib/jquery_pagination/README

    Read the article

  • jQuery Dialog form serialize reposting incorrect data on subsequent uses

    - by Ben Dauphinee
    I'm working with forms inside jQuery Dialog, and am having some issues with the data it's posting. First load and save works fine, posts the correct data. Until I refresh the page though, every subsequent load seems to work, as in the correct data is in the form, however, when saved, the data from the first load is what is posted every time. function formdialog(url, tack, divid, scriptload){ $.getJSON(url+tack+"/form", function(data){ var formwin = '<div><form id="formdialog">'+data['form']+'</form></div>'; var dialog = $(formwin).dialog({ title: data['title'], autoOpen: false, modal: true, buttons: { "Save": function(){ $.post(url+tack+"/process", $("#formdialog").serialize(), function(data){ alert($("#formdialog").serialize()); $(this).dialog('close'); $(this).remove(); } ); }, "Cancel": function(){$(this).dialog('close'); $(this).remove();} } }); dialog.dialog("open"); }); } $(function(){ $("a.edlnk").click(function(){ var url = $(this).attr("href"); formdialog(CONFIG_HREF_SITE+"ajax/"+appControl, "/"+url, divid); return false; }); });

    Read the article

  • Search sort by parameter match count in the query? PostgreSQL

    - by Ben Dauphinee
    I am working on a search query in PostgreSQL, and one of the things I do is sort my query results by the number of parameters matched. I have no clue how this can be done. Does anyone have a suggestion or solution? Table brand color type engine Ford Blue 4-door V8 Maserati Blue 2-door V12 Saturn Green 4-door V8 GM Yellow 1-door V4 Current Query SELECT brand FROM table WHERE color = 'Blue' or type = '4-door' or engine = 'V8' Result Should Be Ford (3 match) Saturn (2 match) Maserati (1 match)

    Read the article

  • How to efficiently convert String, integer, double, datetime to binary and vica versa?

    - by Ben
    Hi, I'm quite new to C# (I'm using .NET 4.0) so please bear with me. I need to save some object properties (their properties are int, double, String, boolean, datetime) to a file. But I want to encrypt the files using my own encryption, so I can't use FileStream to convert to binary. Also I don't want to use object serialization, because of performance issues. The idea is simple, first I need to somehow convert objects (their properties) to binary (array), then encrypt (some sort of xor) the array and append it to the end of the file. When reading first decrypt the array and then somehow convert the binary array back to object properties (from which I'll generate objects). I know (roughly =) ) how to convert these things by hand and I could code it, but it would be useless (too slow). I think the best way would be just to get properties' representation in memory and save that. But I don't know how to do it using C# (maybe using pointers?). Also I though about using MemoryStream but again I think it would be inefficient. I am thinking about class Converter, but it does not support toByte(datetime) (documentation says it always throws exception). For converting back I think the only options is class Converter. Note: I know the structure of objects and they will not change, also the maximum String length is also known. Thank you for all your ideas and time. EDIT: I will be storing only parts of objects, in some cases also parts of different objects (a couple of properties from one object type and a couple from another), thus I think that serialization is not an option for me.

    Read the article

  • What wording in the C++ standard allows static_cast<non-void-type*>(malloc(N)); to work?

    - by ben
    As far as I understand the wording in 5.2.9 Static cast, the only time the result of a void*-to-object-pointer conversion is allowed is when the void* was a result of the inverse conversion in the first place. Throughout the standard there is a bunch of references to the representation of a pointer, and the representation of a void pointer being the same as that of a char pointer, and so on, but it never seems to explicitly say that casting an arbitrary void pointer yields a pointer to the same location in memory, with a different type, much like type-punning is undefined where not punning back to an object's actual type. So while malloc clearly returns the address of suitable memory and so on, there does not seem to be any way to actually make use of it, portably, as far as I have seen.

    Read the article

  • How can I get the previous logged events when a particular logger is triggered?

    - by Ben Laan
    I need to show the previous 10 events when a particular logger is triggered. The goal is to show what previous steps occurred immediately before NHibernate.SQL logging was issued. Currently, I am logging NHibernate sql to a separate file - this is working correctly. <appender name="NHibernateSqlAppender" type="log4net.Appender.RollingFileAppender"> <file value="Logs\NHibernate.log" /> <appendToFile value="true" /> <rollingStyle value="Size" /> <maxSizeRollBackups value="10" /> <maximumFileSize value="10000KB" /> <staticLogFileName value="true" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%d{dd/MM/yy HH:mm:ss,fff} [%t] %-5p %c - %m%n" /> </layout> </appender> <logger name="NHibernate.SQL" additivity="false"> <level value="ALL"/> <appender-ref ref="NHibernateSqlAppender"/> </logger> <logger name="NHibernate" additivity="false"> <level value="WARN"/> <appender-ref ref="NHibernateSqlAppender"/> </logger> But this only outputs SQL, without context. I would like all previous logs within a specified namespace to also be logged, but only when the HNibernate.SQL appender is triggered. I have investigated the use of BufferingForwardingAppender as a means to collect all events, and then filter them within the NHibernateSqlAppender, but this is not working. I have read about the LoggerMatchFilter class, which seems like it is going to help, but I'm not sure where to put it. <appender name="BufferingForwardingAppender" type="log4net.Appender.BufferingForwardingAppender" > <bufferSize value="10" /> <lossy value="true" /> <evaluator type="log4net.Core.LevelEvaluator"> <threshold value="ALL"/> </evaluator> <appender-ref ref="NHibernateSqlAppender" /> </appender> <appender name="NHibernateSqlAppender" type="log4net.Appender.RollingFileAppender"> <file value="Logs\NHibernate.log" /> <appendToFile value="true" /> <rollingStyle value="Size" /> <maxSizeRollBackups value="10" /> <maximumFileSize value="10000KB" /> <staticLogFileName value="true" /> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="NHibernate.SQL" /> <loggerToMatch value="Laan" /> </filter> <filter type="log4net.Filter.LoggerMatchFilter"> <loggerToMatch value="NHibernate" /> <acceptOnMatch value="false"/> </filter> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%d{dd/MM/yy HH:mm:ss,fff} [%t] %-5p %c - %m%n" /> </layout> </appender> <root> <level value="ALL" /> <appender-ref ref="BufferingForwardingAppender"/> </root> The idea is that buffering appender will store all events, but then the NHibernateSqlAppender will only flush when an NHibernate.SQL event fires, plus it will flush the buffer (of 10 previous items, within the specified logger level, which in this example is Laan.*).

    Read the article

  • Exception throwing

    - by Ben Aston
    In C#, will the folloing code throw e containing the additional information up the call stack? ... catch(Exception e) { e.Data.Add("Additional information","blah blah"); throw; }

    Read the article

  • Django User "per project" group assignation

    - by Ben G
    Hi, Here's my problem : my site has users, which can create projects, and access other user's projects. Each project can assign different rights to users. So, i could have Project A : user "John" is in group "manager" , and Project "B" user "John" is in group "worker". How could I use the Django User authentication model to do that ? From a SQL point a view, what i would like is to be able to add "project_id" in the primary key for the "auth_user_groups" table. I don't think profile is of any help here. Any advice ? UPDATE : "worker" and "manager" are just two examples of the permission group (or "roles") that my application defines. There will be more in the future. Eg : i will probably also have "admin", "reporting", etc...

    Read the article

  • How can I get jcifs to play nicely with apache axis

    - by Ben Hammond
    I need to connect Apache Axis 1.4 to a Webservice that uses NTLM authentication to restrict access to its operations. I'm expecting to use Samba Jcifs to handle the NTLM handshake. I found http://hc.apache.org/httpcomponents-client/ntlm.html which gives me fantastic directions for how to wire up HttpClient 4.0 with jcifs. Trouble is, Axis wants to use Http Client 3.0 and the two apis look very different. There are 2 possibilities that I can see Write an object for Axis that lets it plug into HttpClient 4. Figure out how to wire HttpClient 3.0 up with Samba Jcifs. Number 1. looks non-trivial, but possible Number 2. I cannot find any encouraging messages on the web describing how to do this. My question is: has anyone successfully connected samba jcifs with HttpClient 3.0 ? Has anyone already created an Axis HttpSender object that works with HttpClient 4 ? Is there some better alternative that I have not considered?

    Read the article

  • What's the equivalent of use-commit-times for git?

    - by Ben W
    I need the timestamps of files on my local and on my server to be in sync. This is accomplished with Subversion by setting use-commit-times=true in the config so that the last modified of each file is when it was committed. Each time I clone my repository, I want the timestamps of files to reflect when they were last changed in the remote repository, not when I cloned the repo. Is there any way to do this with git?

    Read the article

  • javascript and extJs - scope question

    - by ben
    Hi guys, I got a little scope related problem with some js code, maybe somebody can explain to me what I'm making wrong: I'm using extJs and got this snippet: Ext.onReady(function(){ // Form for filter selection var formFilter = new Ext.FormPanel({ // ... items: [ cbGroup = new Ext.form.ComboBox({ fieldLabel: 'Group', store: dsGroups, displayField: 'name', valueField: 'number', emptyText : '- Please choose a group -', listeners:{ 'select': function() { alert(cbGroup.selectedIndex +' '+this.selectedIndex); } } }) ] }); }); The problem: When I access the combobox over 'this' within the listener function, I get the correct result for the selectIndex property. When I access the combobox over it's var name, I allways get the result '-1'. Thank a lot for your help!

    Read the article

  • nasm infinite loop with FPU

    - by Ben Ishak
    i'm trying to create a small nasm program which do this operation in floating point while(input <= 10^5) do begin input = input * 10 i = i - 1 end the equivilant program in nasm is as following section .data input: resd 1 n10: dd 0x41200000 ; 10 _start: mov eax, 200 ; eax = 200 ; extract eax -> Floating Point IEEE 754 and eax, 0x7f800000 shr eax, 23 sub eax, 127 mov dword [input], eax ; input = eax = 200 mov edx, 0x49742400 ; 10^5 ; %begin mov ecx, 0 ; i = 0 jmp alpha alpha: fld dword [input] cmp [input], edx ; input <= 10^5 jle _while jmp log2 _while: fld dword [n10] ; 10 fld dword [input] ; input fmul st0, st1 ; input * 10 fst dword [input] ; input = input dec ecx ; i = i - 1 jmp alpha the _while loop is iterating infinitely ecx / i gards always the same value = -4194304 (it is sepposed to be 0) and doesn't decrement

    Read the article

  • View controller/NIB architecture for non-navigation application with transitions?

    - by Ben
    I'm tinkering with an app that doesn't use the UINavigation root view control system, so I don't have natural ownership for each app "view". I essentially have two basic views, a document list view, and a document edit view. I'm playing with UIView animation for getting from a selected document to the edit view. I also have a toolbar that exists in both "views". Because I don't have UINavigation running the show for me, I have a tendency to just throw more and more stuff into one NIB and one view controller that owns the whole container. But now I'm trying to figure out how to segue from the document list view to the edit view if the edit view lives inside a different NIB, preserving the toolbar too. Anyone have thoughts or experience on app structures like this? I find the docs lacking on best practices around code/UI structure for anything except trivial one-screen apps or full-on navigation apps. Thanks!

    Read the article

  • Javascript Canvas Element - Array Of Images

    - by Ben Shelock
    I'm just learning JS, trying to do things without jQuery, and I want to make something similar to this however I want to use an array of images instead of just the one. My image array is formed like this var image_array = new Array() image_array[0] = "image1.jpg" image_array[1] = "image2.jpg" And the canvas element is written like this. (Pretty much entirely taken from the Mozilla site) function draw() { var ctx = document.getElementById('canvas').getContext('2d'); var img = new Image(); img.src = 'sample.png'; img.onload = function(){ for (i=0;i<5;i++){ for (j=0;j<9;j++){ ctx.drawImage(img,j*126,i*126,126,126); } } } } It uses the image "sample.png" in that code but I want to change it to display an image from the array. Displaying a different one each time it loops. Apoligies if I've not explained this well.

    Read the article

  • Visual Studio + Database Edition + CDC = Deploy Fail

    - by Ben
    Hi All, I've got a database using change data capture (CDC) that is created from a Visual Studio database project (GDR2). My problem is that I have a stored procedure that is analyzing the CDC information and then returning data. How is that a problem you ask? Well, the order of operation is as follows. Pre-deployment Script Tables Indexes, keys, etc. Procedures Post-deployment Script Inside the post-deployment script is where I enable CDC. Here-in lies the problem. The procedure that is acting on the CDC tables is bombing because they don't exist yet! I've tried to put the call to sys.sp_cdc_enable_table in the script that creates the table, but it doesn't like that. Error 102 TSD03070: This statement is not recognized in this context. C:...\Schema Objects\Schemas\dbo\Tables\Foo.table.sql 20 1 Foo Is there a better/built-in way to enable CDC such that it's references are available when the stored procedures are created? Is there a way to run a script after tables are created but before other objects are created? How about a way to create the procedure dependencies be damned? Or maybe I'm just doing things that shouldn't be done?!?! Now, I have a work around. Comment out the sproc body Deploy (CDC is created) Uncomment sproc Deploy Everything is great until the next time I update a CDC tracked table. Then I need to comment out the 'offending' procedure. Thanks for reading my question and thanks for your help!

    Read the article

  • How to install previously-archived apps from xcode organizer to my iphone

    - by Ben Clayton
    Hi all. Xcode keeps an archive of all the versions of my apps that I've submitted to the app store in the 'archived applications' section. I assumed using this I could install an old version of an app to my device, in order to reproduce any problems my client may have had with that particular version. However, when I try to do this I get an error: 'this executable was signed with invalid entitlements, the entitlements specified in your applications code signing entitlements do not match those specified in your provisioning profile' The original app was signed using our App Store distribution certificate, and I use the Organizer interface to re-sign it using our Developer profile. select the archived app select the version I want to test click 'share' select 'iphone developer' next to identity save to disk (saves the ipa file) then copy the ipa to the device using the little + button you see next to 'applications' on the screen you get when you select the connected device. Then I get the error, and the app isn't installed. Is there something obvious I'm doing wrong here? Or is there a different process to re-install an archived app to my device? Thanks,

    Read the article

  • Flash AS3 Mysterious Blinking MovieClip

    - by Ben
    This is the strangest problem I've faced in flash so far. I have no idea what's causing it. I can provide a .swf if someone wants to actually see it, but I'll describe it as best I can. I'm creating bullets for a tank object to shoot. The tank is a child of the document class. The way I am creating the bullet is: var bullet:Bullet = new Bullet(); (parent as MovieClip).addChild(bullet); The bullet itself simply moves itself in a direction using code like this.x += 5; The problem is the bullets will trace for their creation and destruction at the correct times, however the bullet is sometimes not visible until half way across the screen, sometimes not at all, and sometimes for the whole traversal. Oddly removing the timer I have on bullet creation seems to solve this. The timer is implemented as such: if(shot_timer == 0) { shoot(); // This contains the aforementioned bullet creation method shot_timer = 10; My enter frame handler for the tank object controls the timer and decrements it every frame if it is greater than zero. Can anyone suggest why this could be happening? EDIT: As requested, full code: Bullet.as package { import flash.display.MovieClip; import flash.events.Event; public class Bullet extends MovieClip { public var facing:int; private var speed:int; public function Bullet():void { trace("created"); speed = 10; addEventListener(Event.ADDED_TO_STAGE,addedHandler); } private function addedHandler(e:Event):void { addEventListener(Event.ENTER_FRAME,enterFrameHandler); removeEventListener(Event.ADDED_TO_STAGE,addedHandler); } private function enterFrameHandler(e:Event):void { //0 - up, 1 - left, 2 - down, 3 - right if(this.x > 720 || this.x < 0 || this.y < 0 || this.y > 480) { removeEventListener(Event.ENTER_FRAME,enterFrameHandler); trace("destroyed"); (parent as MovieClip).removeChild(this); return; } switch(facing) { case 0: this.y -= speed; break; case 1: this.x -= speed; break; case 2: this.y += speed; break; case 3: this.x += speed; break; } } } } Tank.as: package { import flash.display.MovieClip; import flash.events.KeyboardEvent; import flash.events.Event; import flash.ui.Keyboard; public class Tank extends MovieClip { private var right:Boolean = false; private var left:Boolean = false; private var up:Boolean = false; private var down:Boolean = false; private var facing:int = 0; //0 - up, 1 - left, 2 - down, 3 - right private var horAllowed:Boolean = true; private var vertAllowed:Boolean = true; private const GRID_SIZE:int = 100; private var shooting:Boolean = false; private var shot_timer:int = 0; private var speed:int = 2; public function Tank():void { addEventListener(Event.ADDED_TO_STAGE,stageAddHandler); addEventListener(Event.ENTER_FRAME, enterFrameHandler); } private function stageAddHandler(e:Event):void { stage.addEventListener(KeyboardEvent.KEY_DOWN,checkKeys); stage.addEventListener(KeyboardEvent.KEY_UP,keyUps); removeEventListener(Event.ADDED_TO_STAGE,stageAddHandler); } public function checkKeys(event:KeyboardEvent):void { if(event.keyCode == 32) { //trace("Spacebar is down"); shooting = true; } if(event.keyCode == 39) { //trace("Right key is down"); right = true; } if(event.keyCode == 38) { //trace("Up key is down"); // lol up = true; } if(event.keyCode == 37) { //trace("Left key is down"); left = true; } if(event.keyCode == 40) { //trace("Down key is down"); down = true; } } public function keyUps(event:KeyboardEvent):void { if(event.keyCode == 32) { event.keyCode = 0; shooting = false; //trace("Spacebar is not down"); } if(event.keyCode == 39) { event.keyCode = 0; right = false; //trace("Right key is not down"); } if(event.keyCode == 38) { event.keyCode = 0; up = false; //trace("Up key is not down"); } if(event.keyCode == 37) { event.keyCode = 0; left = false; //trace("Left key is not down"); } if(event.keyCode == 40) { event.keyCode = 0; down = false; //trace("Down key is not down") // O.o } } public function checkDirectionPermissions(): void { if(this.y % GRID_SIZE < 5 || GRID_SIZE - this.y % GRID_SIZE < 5) { horAllowed = true; } else { horAllowed = false; } if(this.x % GRID_SIZE < 5 || GRID_SIZE - this.x % GRID_SIZE < 5) { vertAllowed = true; } else { vertAllowed = false; } if(!horAllowed && !vertAllowed) { realign(); } } public function realign():void { if(!horAllowed) { if(this.x % GRID_SIZE < GRID_SIZE / 2) { this.x -= this.x % GRID_SIZE; } else { this.x += (GRID_SIZE - this.x % GRID_SIZE); } } if(!vertAllowed) { if(this.y % GRID_SIZE < GRID_SIZE / 2) { this.y -= this.y % GRID_SIZE; } else { this.y += (GRID_SIZE - this.y % GRID_SIZE); } } } public function enterFrameHandler(Event):void { //trace(shot_timer); if(shot_timer > 0) { shot_timer--; } movement(); firing(); } public function firing():void { if(shooting) { if(shot_timer == 0) { shoot(); shot_timer = 10; } } } public function shoot():void { var bullet = new Bullet(); bullet.facing = facing; //0 - up, 1 - left, 2 - down, 3 - right switch(facing) { case 0: bullet.x = this.x; bullet.y = this.y - this.height / 2; break; case 1: bullet.x = this.x - this.width / 2; bullet.y = this.y; break; case 2: bullet.x = this.x; bullet.y = this.y + this.height / 2; break; case 3: bullet.x = this.x + this.width / 2; bullet.y = this.y; break; } (parent as MovieClip).addChild(bullet); } public function movement():void { //0 - up, 1 - left, 2 - down, 3 - right checkDirectionPermissions(); if(horAllowed) { if(right) { orient(3); realign(); this.x += speed; } if(left) { orient(1); realign(); this.x -= speed; } } if(vertAllowed) { if(up) { orient(0); realign(); this.y -= speed; } if(down) { orient(2); realign(); this.y += speed; } } } public function orient(dest:int):void { //trace("facing: " + facing); //trace("dest: " + dest); var angle = facing - dest; this.rotation += (90 * angle); facing = dest; } } }

    Read the article

< Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >