Posts

Showing posts from March, 2010

javascript - Getting tax price to calculate before submitting a form -

i'm trying tax value in checkout page calculate once state field selected. want without having submit form want display tax rate on page before order processed. i sure have ajax , have used ajax limited amount of times. know send request ajax php page , ajax pulls field need. need pull is, if ohio selected need pull value of 1.065. if other state pulled need value of 1. i have state variables listed in array format because using options state dropdown.. $taxvalue['ohio'] = "ohio"; $taxvalue['virginia'] = "virginia"; etc then tried if isset statement when ohio selected pull $taxed_state value of 1.065. else else untaxed_state. $taxed_state = 1.065; $untaxed_state = 1; if(isset($taxvalue['ohio'])){ $taxed_state; } else { $untaxed_state; } this how trying configure tax rate know work once can state set before form submitted. $base_price = 0; foreach($_session['shopp

ios - How to apply multiple transforms in Swift -

Image
i apply multiple transforms uiview (or subclass of uiview ), such translate, rotate, , scale. know 2 transforms can applied cgaffinetransformconcat , how do if have 3 or more transforms? i have seen these questions: applying multiple transforms uiview / calayer using multiple cgaffinetransforms on text matrix but these questions asking different, , given answers talk applying 2 transforms cgaffinetransformconcat . also, use objective-c rather swift. this answer updated swift 3 you can apply multiple transforms stacking them on top of each other. var t = cgaffinetransform.identity t = t.translatedby(x: 100, y: 300) t = t.rotated(by: cgfloat.pi / 4) t = t.scaledby(x: -1, y: 2) // ... add many want, apply to view imageview.transform = t or more compactly (but not readable): imageview.transform = cgaffinetransform.identity.translatedby(x: 100, y: 300).rotated(by: cgfloat.pi / 4).scaledby(x: -1, y: 2) this series of transforms produces image on right: th

New android Support Design Library, scroll tablayout offscreen not working -

trying use new support design library. in layout want toolbar stay @ top of screen, have tablayout go off screen when user scrolls down. looks viewpager goes underneath appbarlayout . used blog post reference https://medium.com/ribot-labs/exploring-the-new-android-design-support-library-b7cda56d2c32 this layout, within viewpager holds fragments consist of recycler views <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/material_grey50" android:clickable="true"> <android.support.design.widget.coordinatorlayout android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v4.view.viewpager andr

javascript - Play/pause using howler.js with meteor framework -

okay, i'm trying let users play/pause when click on gif once or twice. have set user play sound once without stopping it. i'm using javascript audio library howler.js , meteor framework. below code: template.gif.rendered = function () { freezeframe_options = { trigger_event: "click" }; $.getscript("/client/scripts/freezeframe.js", function () { $(".gif").click(function () { if (!$(this).hasclass('played')) { var gifid = $(this).attr("data-gif-id"); // return gif id number var soundfile = $(this).attr("data-sound-file"); // return sound file var fileformat = "mp3"; var mp3test = new audio(); var canplaymp3 = (typeof mp3test.canplaytype === "function" && mp3test.canplaytype("audio/mpeg") !== ""); if (!canplaymp3) { fileformat = "ogg";

javascript - enable button if user fill the input box, if user emptied or not fill then disable -

i want enable button once user fill or type on input box , disabled if user not fill or emptied input box. sadly, snippet below not working. help, suggestion, recommendation, ideas , clues appreciated. $(document).ready(function(){ $("input").keypress(function(){ if($(this).val() !== ""){ //user fill or did type on input search box, lets enable button $("button").attr("disabled", false); }else if($(this).val() === ""){ //user not fill or emptied box, lets disabled button $("button").attr("disabled", true); } }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="text" name="search_input" value="" placeholder="type search here" /> <button disabled>go</button> try utilizing input , focus events , input bei

python - csv.writerows() puts newline after each row -

this example o'reilly cookbook (truncated dataset) headers = ['symbol','price','date','time','change','volume'] rows = [{'symbol': 'aa', 'volume': 181800, 'change': -0.18, 'time': '9:36am', 'date': '6/11/2007', 'price': 39.48}, {'symbol': 'aig', 'volume': 195500, 'change': -0.15, 'time': '9:36am', 'date': '6/11/2007', 'price': 71.38} ] open('stocks2.csv','w') f: f_csv = csv.dictwriter(f, headers) f_csv.writeheader() f_csv.writerows(rows) the output file has \n @ end of each line, , apparently 1 more @ end. when bring excel, blank lines between each row. same if open notepad++. but, if more if command line, \n don't show up. i saw q&a \n @ end of file - 1 \n @ end of each line. (and don't see why more doe

php - Email is already in database, returns as if it isn't -

here background information on i'm trying here. i'm try create registration form website (successful far until point). data can entered db. thing i'm trying prevent duplicate email/usernames being entered db. through stackoverflow research, have found , tested following code: $query = "select count(*) num_rows users email = ?"; $stmt = $mysqli->prepare($query); $stmt->bind_param("s", $email); if ($stmt->execute()) { return $stmt->num_rows; } what following: if(user_exists($user_email) > 0) { echo "email exists!"; } but passes if statement if email exist in database! email i'm trying enter, tests testemail@testemailweb.com in database! possibly point out have messed in code? there silly mistake have possibly done when trying perform this? the fix particular problem here not using count(*) mentioned john , not depend on mysqli_stmt->num_rows using buffered result set: $query = "select

c - How would I make an array of all the integers between 0 and 1000? -

not finding anywhere online google... , i'm not typing out numbers 1 one either because there has easier way! int myfunction(void) { //numbers = ??????; int sum = 0; for(int = 0; < sizeof(numbers); i++) { int currentnumber = numbers[i]; if (currentnumber % 3 == 0 || currentnumber % 5 == 0) { sum = sum + currentnumber; } } printf("%d", sum); } update someone in comments made point setting condition of loop, i'm still curious how 1 make array of integers [0,1,2,3,4..1000] i'm not sure makes sense create array 1-1000, if going numbers[i] , given numbers[i] == i . using single integer i , can save wasting space. if there motivation other have posted, can following: int numbers[1001]; for(int = 0; <= 1000; i++) numbers[i] = i;

bash - WC on OSX - Return includes spaces -

when run word count command in osx terminal wc -c file.txt below answer includes spaces padded before answer. know why happens, or how can prevent it? 18000 file.txt i expect get: 18000 file.txt this occurs using bash or bourne shell. i suppose way of getting outputs line nicely, , far know there no option wc fine tunes output format. you rid of them pretty piping through sed 's/^ *//' , example. there may simpler solution, depending on why want rid of them.

How can I determine the length of a multi-page TIFF using Python Image Library (PIL)? -

i know image.seek() , image.tell() methods of pil allow me go particular frame, , list current frame, respectively. know how many frames there total. there function getting info? alternatively, there way in python can make loop , catch error occurs if there no image? from pil import image videopath = '/volumes/usb20fd/test.tif' print "using pil open tiff" img = image.open(videopath) img.seek(0) # .seek() method allows browsing multi-page tiffs, starting 0 im_sz = [img.tag[0x101][0], img.tag[0x100][0]] print "im_sz: ", im_sz print "current frame: ", img.tell() print img.size() in above code open tiff stack, , access first frame. need know "how deep" stack goes don't error in downstream calculations if no image exists. if can wait until 1st july 2015, next release of pillow (the pil fork) allow check using n_frames . if can't wait until then, can copy implementation,patch own version, or use latest dev ver

export - Do you know some service to generate PDF online? -

i'm looking online service design , export pdf source of data (maybe csv). need export pdfs basic data, name addresses ~1500 registers in database. know webmerge, , need, price high needs, $200 do know alternative webmerge ? thank you! you should use google docs. check them here: google docs you can import .csv files google sheets , export .pdf. also, can import many other file formats .doc, .docx etc.

string - In which situation stringLit in StandardTokenParsers doesn't work? -

i writing parser in arithmetic operation going parsed. arithmetic operation contains variables instance: var1+1 the parser follow: package org.pvamu.hadoop.image; import org.apache.spark.serializer.{kryoserializer, kryoregistrator} import java.nio.file.files; import java.io.file; import scala.util.parsing.combinator.lexical._ import scala.util.parsing.combinator.token.stdtokens import scala.util.parsing.combinator.lexical.stdlexical import scala.util.matching.regex import scala.util.parsing.combinator.syntactical._ import scala.util.parsing.combinator._ abstract class expr { def rpn:string } case class binaryoperator(lhs:expr, op:string, rhs:expr) extends expr { def rpn:string = lhs.rpn + " " + rhs.rpn + " " + op } case class number(v:string) extends expr { def rpn:string = v } case class variable(v:string) extends expr { def rpn:string = v } case class function(f:string, e:list[expr]) exte

date format - Java DateFormat issue on Mac vs Windows -

i using code below on mac osx 10.10.2 , it's behaving strangely. import java.text.dateformat; import java.text.simpledateformat; import java.util.date; public class stringtodate { public static void main(string[] args) throws exception { string dateinstring = "23/oct/2015"; dateformat formatter = new simpledateformat("dd/mmm/yyyy"); date date = formatter.parse(dateinstring); system.out.println(date); } } output on mac:          sun dec 28 00:00:00 cst 2014 output on windows: fri oct 23 00:00:00 cdt 2015 why mac output wrong? y week year. use y year. dateformat formatter = new simpledateformat("dd/mmm/yyyy"); also, make sure dateformat's locale right one. edit: a date has millisecond precision, if want nanosecond precision, shouldn't use date , simpledateformat. s milliseconds. since tell simpledateformat last part of string milliseconds, parses that: 545000000 milliseco

TFS 2013 in VS reports no history for a file with multiple commits in Git -

tldr version: how work around or resolve tfs reporting single file has no history, when git , webportal report does, , clearing tfs cache has no effect? disclaimer: have tried various methods in numerous stackoverflow posts regarding clearing of cache. date, has produced no results. hoping find different perspective on issue, if perspective indicates doing wrong. lately, myself , coworker have been experiencing following seemingly pseudo-random symptoms: clone repository git, using git command line tools. in vs2013, right-click on file, , retrieve history. works. right-click on second file, , tfs behaves in 1 of 2 ways: display dialog message, "an item key has been added", , display message, "no history available item" in history window. simply display history window message "no history available item." note once behavior appears file in solution, continues appear without relief. unable view history in way through visual studio.

asp.net mvc - How to update only certain columns of a table using AJAX in MVC -

say have 4 columns in table. in mvc list view, need add ajax call (ajax.beginform) update values of 3rd , 4th column of table when button in 3rd column clicked. since 'div' cannot added inside td of table, not clear on how achieve (how reference target in updatetargetid in ajax options?) here part of view, @foreach (var item in model) { <tr> <td> @html.displayfor(modelitem => item.num) </td> <td> @html.displayfor(modelitem => item.name) </td> <td> <input type="submit" value="x" /> @html.displayfor(modelitem => item.x) </td> <td> @html.displayfor(modelitem => item.y) </td> when submit button in 3rd column clicked need update both x , y (column 3 , 4) based on values returned controller action method. how achieve this?

c# - Parallel.ForEach loop is performing like a serial loop -

i've spent 8+ hours searching online , couldn't find so, here goes. i'm working team foundation server , c# , i'm trying acquire list of work items , convert them generic object made bound special ui. work items tasks specific day , list 30ish items in size, not big of deal. the loop looks this: list<iworkitemdata> workitems = new list<iworkitemdata>(); var queryfordata = store.query(query).cast<workitem>(); if (queryfordata.count() == 0) return workitems; parallel.foreach(queryfordata, (wi) => { var temp = wi; lock (workitems) { tfsworkitemdata tfsworkitem = new tfsworkitemdata(temp); workitems.add(tfsworkitem); } }); the inside of tfsworkitemdata's constuctor looks this: public tfsworkitemdata(workitem workitem) { this.workitem = workitem; this.fields = new dictionary<string, ifielddata>(); // add fields foreach (field field in workitem.fields) { tfsfieldd

python - How do I take the users input and if it equals 1 it would be day and a 2 would be night? -

i trying user's input , if enter 1 shift print out day shift , 2 equal night shift. doing using object oriented not know how new it. also, have read on here way taught set classes not best way python how professor wants not can that. class employee class employee: def __init__(self, name, number): self.__name = name self.__number = number def set_name(self, name): self.__name = name def set_number(self, number): self.__number = number def get_name(self): return self.__name def get_number(self): return self.__number class productionworker import employee class productionworker(employee.employee): def __init__(self, name, number, shift, pay): employee.employee.__init__(self, name, number) self.__shift = shift self.__pay = pay def set_shift(self, shift): self.__shift = shift def set_pay(self, pay): self.__pay = pay def get_shift(self):

Filtering JSON with PostgreSQL / Excluding elements of JSON array -

i want able return part of json using postgresql. example if have json { "dress_code": "casual", "design": "solid", "fit": "straight-cut", "aesthetic": [ { "aesthetic_id": 1, "primary_color": "light blue", "secondary_color": "light gray", "sizes": [ { "size_id": "1", "basic_size": "s", "waist": 30, "pictures": [ { "angle": "front", "url": "fashion.com/img1f" }, { "angle": "back", "ur

php - binding parameters using the NOW function -

in mysql, how bind parameters when using now() function? $stmt = $conn->prepare("insert myguests (firstname, lastname, date) values (?, ?, ?)"); $stmt->bind_param("sss", $firstname, $lastname, now()); this doesn't work. now() not parameter of query. put this: $stmt = $conn->prepare("insert myguests (firstname, lastname, date) values (?, ?, now())"); $stmt->bind_param("sss", $firstname, $lastname);

c - Remove close button from BulletinBoard widget in Motif -

is possible remove close button bulletinboard widget in motif? or, alternatively, attach callback function it? know can toplevel widget can't seem bulletinboard. for toplevel shell can attach callback function close button: xmaddwmprotocolcallback(toplevel, xminternatom(display,"wm_delete_window",true), (xtcallbackproc)buttoncb, (xtpointer)data); or can remove entirely this: xtvasetvalues(toplevel, xmnmwmfunctions, mwm_func_all | mwm_func_close, null); but neither of these work bulletinboard widget. latter has no effect. former gives error, "warning: widget must vendorshell." i found way already. instead of using xtvasetvalues, found can use xtsetarg(mybb, ...) @ time bb widget created. in other words, n=0; xtsetarg(args[n], xmnheight, 300); n++; xtsetarg(args[n], xmnwidth, 300); n++; // ...etc... xtsetarg(args[n], xmnmwmfunctions, mwm_func_all|mwm_func_close); n++; // <--- answer mybb = xmcreatebulletinboarddialog(parent, &

database - How to subset the rows of dataset from the values of another vector in R -

i have data frame this n <- c("abc;xml", "abc;derm;sip", "xol;exp", "ban;lopic", "lpll2", "lpll") fac <- sample(n, 6, replace = f) d <- data.frame(x = 1:6, fac = fac) d x fac 1 1 abc;xml 2 2 ban;lopic 3 3 xol;exp 4 4 abc;derm;sip 5 5 lpll 6 6 lpll2 and vector this: vec=c("abc", "xml","sip", "exp", "lopic", "lpll") i subset rows have similar match values in vectors. i tried code: nam="abc|xml|sip|exp|lopic|lpll" subset(d, regexpr(nam, d$fac) > 0) but doesn't work correctly, because include , lpll2! the problem regex find match, if not exact. work: index <- sapply(strsplit(as.character(d$fac), split = ";"), function(x) any(x%in% vec)) d[index, ] x fac 1 1 xol;exp 2 2 abc;xml 3 3 ban;lopic 5 5 lpll 6 6 abc;derm;sip

Is the Javascript String length constant time? -

i'm new js, , realize length considered property. received comment not use str.length in loop: for (i=0; i<str.length; i++){...} vs var len = str.length; (i=0; i<len; i++){...} now, know str.length() constant time operation in java because length stored field in string class. again, strings immutable in java. not sure js strings though. str.length guaranteed constant time in js too? couldn't find discussed anywhere in web. strings immutable in javascript. length property not need computed each time accessed. i created jsperf benchmark view here. you'll notice speeds same.

html - jQuery images do not fade in -

i have list of image urls in json using put bunch of images in div. start out opacity 0 , supposed fade in loop. here jquery: $.ajax('http://thesabreslicer.site.nfoservers.com/thesabreslicer/dw/json/imgs.json').done(function(data) { (var = 0; < data.length; i++) { var image = data[i]; $('#imgs').append('<img src="' + image.url + '" class="img-responsive" style="float:left; padding:5px;opacity:0;">'); } var imgs = $('#imgs > img'); (var = 0; < imgs.length; i++) { if (imgs.eq(i).css('opacity') === 0) { imgs.eq(i).animate({ 'opacity': '1' }, 1000); } } }); and here html div: <div class="col-md-4"> <div class="text-center"> <h3>technologies use</h3> </div> <div id="imgs" class="col-md-12"&

java - Iterating through a Collection, avoiding ConcurrentModificationException when removing in loop -

we know can't this: for (object : l) { if (condition(i)) { l.remove(i); } } concurrentmodificationexception etc... apparently works sometimes, not always. here's specific code: public static void main(string[] args) { collection<integer> l = new arraylist<integer>(); (int i=0; < 10; ++i) { l.add(new integer(4)); l.add(new integer(5)); l.add(new integer(6)); } (integer : l) { if (i.intvalue() == 5) { l.remove(i); } } system.out.println(l); } this, of course, results in: exception in thread "main" java.util.concurrentmodificationexception ... though multiple threads aren't doing it... anyway. what's best solution problem? how can remove item collection in loop without throwing exception? i'm using arbitrary collection here, not arraylist , can't rely on get . iterator.remove() safe, can use this: list<string&g

Using Dagger 2 to inject values when deserializing with Jackson -

when deserializing, jackson fetch values of properties of object marked @jacksoninject mapping supplied objectmapper instead of json. mapping specified calling objectmapper.setinjectablevalues() , providing injectablevalues object can values injected on request. it easy create such object guice (as jackson-module-guice does). first, when create object mapper, inject injector , wrap in injectablevalues implementation forwards requests injector (the class of thing injected , annotations available). to make work dagger 2, need able take class object (and relevant annotations) , inject instance @ runtime. however, given dagger 2's code-generation approach, not seem possible. missing something?

javascript - How to build out this complex Array based on this Simple Object -

http://jsfiddle.net/leongaban/tuhgns3q/ my simple object: { portfolio: "aapl", t1_tag1: "1111", t2_tag1: "2222", t3_tag1: "3333", ticker1: "aa", ticker2: "goog", ticker3: "aapl" } the desired end result below. array objects containing array of objects: [ 0:object { tags: [ 0:object { t1_tag1: "1111" } ] ticker: ticker1 }, 1:object { tags: [ 0:object { t2_tag2: "2222" } ] ticker: ticker2 }, 3:object { tags: [ 0:object { t3_tag3: "3333" } ] ticker: ticker3 } ] is there simplier way accomplish _lodash ? here's came using vanilla javascript , no lodash or underscore: function expand(simple) { var outerarray = [], i

c# - FIM how to rename the anchor in SQL MA -

i'm doing fim 2010r2 sync engine project i'm importing ad user fim , exporting info sql table. have written provisioning code , works fine. here target sql table. create table [dbo].[tbl_fgpp_members]( [memberobjectguid] [varbinary](50) null, [memberdn] [nvarchar](255) not null, [memberobjecttype] [nvarchar](10) not null, [member_addomain] [nvarchar](16) null, [member_samaccountname] [nvarchar](64) null ) on [primary] on fim management agent sql, have set memberdn anchor. means can write provisioning code , cannot flow distinguishedname ad user directly. however, after ad user information lands in sql, if ad user renamed or moved in ad, it's distinguishedname changes. when reimport changes, want fim able update memberdn column. since can't have flow rule (as says memberdn readonly), tried doing following provisioning code when meet following condition mvobject. if(sqlfgppuser.connectors.count == 1) { updatefgppusersinsql(mventry,

c# - Database.SetInitializer(new MigrateDatabaseToLatestVersion<Context, Configuration>()); Error -

well error getting compiler error cs0311: there no implicit reference conversion from... i enabled migrations package manager public class configuration : dbmigrationsconfiguration<pmdbcontext> { public configuration() { automaticmigrationsenabled = true; automaticmigrationdatalossallowed = true; contextkey = "context.db.context"; } protected override void seed(pmweb.models.pmdbcontext context) { // method called after migrating latest version. // can use dbset<t>.addorupdate() helper extension method // avoid creating duplicate seed data. e.g. // // context.people.addorupdate( // p => p.fullname, // new person { fullname = "andrew peters" }, // new person { fullname = "brice lambson" }, // new person { fullname = "rowan miller" } // );

java - NPE with Current Thread Context Class Loader getResourceAsStream(file) -

Image
i trying excel file resource folder. method works fine: public jobordergenerator(list<shoporder> shoporder) throws invalidformatexception, ioexception { inputstream = thread.currentthread().getcontextclassloader().getresourceasstream("shop-order.xlsx"); createjoborder(shoporder); } which calls void createjoborder(list<shoporder> shoporder) throws invalidformatexception, ioexception{ (shoporder shoporder1 : shoporder) { system.out.println("inside createjoborder "+shoporder1.getpo_number()); writetospecificcell(2, 1, sheetnumber, shoporder1.getpo_number()); //po number writetospecificcell(7, 3, sheetnumber, shoporder1.getpo_number()); //part number localdate date = shoporder1.getpo_due_date(); string datetostring = date.tostring(); writetospecificcell(1, 2, sheetnumber, datetostring); //due_date writetospecificcell(7, 5, sheetnumbe

mysql - Ibatis Sequence Number Generation -

i new ibatis. how generate sequence number using ibatis , insert number mysql table? sequence number should start 1000 can used primary key in table. using spring, ibatis , mysql. as ibatis dead since 2010, presume mybatis usage. mybatis can use these annotations insert , retrieve primary key db , map both interface : @insert("insert table2 (name) values(#{name})") @selectkey(statement="call identity()", keyproperty="nameid", before=false, resulttype=int.class) int inserttable2(name name);

inner Join or self query -

i have table 3 columns column 1 called uri values : 1,2,3,4,5,6, column 2 called record type values : box, folder, box, folder, item, folder column 3 called parent uri values : 0,2,0,4,4,1 basically table has information record number ( uri),what ? box, folder or item ( record type) , , uri of container ( parent uri) so ideally item should exist in folder , folder in box. , there cases record orphan need write query can show in perhaps 4 columns uri, record type, parent uri, , parent uri record type i think can done because row like 3,box, 5 means record number 3 box , parent 5. there exist row have 5 uri , record type , parent. help regards

Migrating Codeplex SVN to Git with git svn clone -

in past (2013), able migrate repository codeplex (under svnbridge) git repository. i'm trying again, same repository, , 'git svn clone' method not working. basically, creates .git folder , it's all. no code downloaded, no message issued... i'm trying execute line of command: git svn clone https://mohid.svn.codeplex.com/svn -s mohid_code as said, no code downloaded, no messages issued. am missing something? have tried operation recently? i noticed codeplex, our project have been little "unresponsive" in last couple of days. any other ideas history , put on git repository? i've being trying avoid using svn2git, maybe i'll give try. thanks! eduardo try git svn clone https://mohid.svn.codeplex.com/svn mohid_code without argument -s, because mohid doesn't use standard layout. also wait time. first ~10 minutes looks nothing hapens, because git try fetch revisions 1 , first revision in mohid repo 28559

oracle - select only one row that has the highest count in sql -

i need select 1 row has highest count. how do that? this current code: select firstname, lastname, count(*) total trans join work on trans.workid = work.workid join artist on work.artistid = artist.artistid datesold not null group firstname, lastname; example current: firstname | lastname | total ------------------------------ tom | cruise | 3 angelina | jolie | 9 britney | spears | 5 ellie | goulding | 4 i need select this: firstname | lastname | total -------------------------------- angelina | jolie | 9 in oracle 12, can do: select firstname, lastname, count(*) total trans join work on trans.workid = work.workid join artist on work.artistid = artist.artistid datesold not null group firstname, lastname order count(*) desc fetch first 1 row only; in older versions, can subquery: select twa.* (select firstname, lastname, count(*) total trans join work

VB.net DomainUpDown Infinite Selection -

how can domainupdown in vb.net go from: default flat largebiomes amplified customized default , on ? infinite selection. that the .wrap property : updowncontrol.wrap = true

javascript - Firefox rendering of OpenType font does not match the font specification -

Image
i loading opentype webfont open sans via google fonts api / css. in both chrome 43 (linux+windows) , internet explorer 11 (windows) browser renders text specified in font. however, in firefox 38.0.5, text width and/or spacing rendered differently characters. font variants @ default value ("normal"). as example, can use characters 1 , a , b , , i . open sans "unitsperem" 2048. therefore, @ font size of 18.0px, width of 30 characters of each of above characters should follows based on 1/u * p * c * w u = 2048, p = 18.0, c = 30, , w advance width of each char ( wolfram alpha equation ). +----------------------------------------+-----------+ | char | font(px) | numchars | advance | width(px) | +------+----------+----------+-----------+-----------+ | 1 | 18.0 | 30 | 1171 | 308.76 | | | 18.0 | 30 | 1139 | 300.322 | | b | 18.0 | 30 | 1255 | 330.908 | | | 18.0 | 30 | 518 | 136.

webforms - Using bootbox.confirm with .NET web forms -

i trying work web forms. have basic knowledge (i work mvc). <asp:button runat="server" id="linkbutton1" onclientclick="return confirmitemdelete()" commandargument='<%# eval("id") %>' text="delete" onclick="lbdeletemessage_click"></asp:button> function confirmitemdelete() { bootbox.confirm('are sure want delete message?', function (confirmed) { return confirmed; }); }; button click causes server side delete. because bootbox.confirm works callbacks (return false or true in callback). causes run server side postback. what best solution here?

sql - PIVOT Oracle - transform multiple row data to single row with multiple columns, no aggregate data -

Image
i have need transfer following data set: in highlighted lines 1 of interest (tag in ('ln','sn')) interested in serialnumber , lotnumber of products. convert data set above following data set: where lists product along serialnumber , lot number in 1 row. after doing reading online, think pivot might need. however, struggling technical side of statement. i have tried: select * ( select * test2 tag in ('ln','sn') ) pivot ( max(value) tag in ('ln','sn') ) order category,subcat,item,"date" but not generate output wanted. suggestion? pivot correct statement use or there other statement more appropriate in case? realize pivot requires aggregate function not count or add anything. please advise. below test table data create table "test2" ( "date" date, "subcat" varchar2(6 byte), "category" varchar2(7 byte), "value" varchar2(17 byte),

angularjs - How to request new banner ad in AdMob Pro? -

i have angular ionic mobile app. switched old admob cordova plugin ( https://github.com/floatinghotpot/cordova-plugin-admob ) admob pro plugin ( https://github.com/floatinghotpot/cordova-admob-pro ). have working, can't figure out how request new ad. old plugin had function requestad new ad , display/replace in existing banner. using admob pro, way see new ad display using createbanner function. works, content shifts , down banner first removed, , redisplayed new ad. not have flicker. is there way in admob pro cordova plugin request new ad without having remove current banner , create new one? set refresh interval in admob portal. by default interval 60 seconds, can configure wish.

php - javascript problems with array -

i've write this: document.getelementsbyname("elname[]")[0].value=array('val1','val2','val3', etc); my problem inside "array" elements, because have write inside values array initialized var val_vec= new array(<?php echo $count ?>); i've tried this, doesn't work: document.getelementsbyname("elname")[0].value=array( for(var i=0; i< <?php echo $count ?> ; i++) { document.write('"'+ val_vec[i] + '"'); if(i!=<?php echo $count-1 ?>) document.write(','); }); the 'if' condition writed because of commas betweens 'vars' (the last comma must not written!) can me please? your syntax makes no sense whatsoever. using for loop inside of array(…) , complete nonsense. if want array values comma-separated string, use .join() or, if question how php ar

android - how to maintain inflated radio button state in listView -

so have listview i'm populating static xml, inside xml have dynamic container inflate items when user clicks on item in listview. basically view(s) i'm inflating looks (x) amount of radio buttons , textview. the reason have way amount of radio buttons inflated change depending on type of list item is. the issue i'm running once radio buttons inflated , user selects button, list doesn't save state user last selected radio button. or rather, recycles radio button state position in list. correct since that's listview does. want save user selected answer @ position selected in listview. i've been working on week , can't find solution. if i'd appreciate it. i'll post relevant code below. surveyview (custom container inflate views into) public class surveyview extends linearlayout { private linearlayout pollcontainer; private context context; private string type; private int numofanswers; private listview answerslist; private arraylist<s