Posts

Showing posts from March, 2013

objective c - NSURLConnection not return data -

i have nsurlconnection has been working while , of sudden not working. for reason, delegate method gets called is: -(void)connection:(nsurlconnection *)connection didreceiveresponse: none of other delegate methods called. have other classes uses pretty same code, different request , url , seem work fine. have read alot of post talk making sure connection on same thread delegate etc nothing seems work me. know server returning response because if pass same information through simple html form response in browser, , can see evidence server side script running because can see changes making in sql data. , app getting sort of resonse, not getting data or calling connectiondidfinishloading delegate method. any ideas of problem might be? here simplified version on code: #import "registrationviewcontroller.h" @interface registrationviewcontroller () @end nsmutabledata *responsedata; nsurlconnection *theconnection; @implementation registrationviewcontroller /* *

Play base64 audio string from Azure Blob service REST api with Javascript/Phonegap -

im having trouble playing audio file (.aac) stored bae64 encoded string in azure blob storage javascript. i have following scenario: a mobile app (phonegap) records audio .aac file , stores in localstorage. file same small (<250kb) the file get's converted base64 encoded string , uploaded blob storage account through jquery ajax call (see upload_code) below using blob service rest api. see this page details on blob service rest api. when download file manually through browser can see base64 encoded string starts witch "data:application/octet-stream;base64,aaaa....." upload_code snippet: $.ajax({ url: url, type: "put", data: requestdata, processdata: false, beforesend: function (xhr) { xhr.setrequestheader('x-ms-blob-type', 'blockblob'); }, trycount: 0, retrylimit: number_of_retries, success: successcallback, error

QuickBooks PHP DevKit connection errors -

i've been trying sync qb-web connector keep receiving errors: the first was: 'fatal error: class 'quickbooks_loader' not found', fixed adding including file location @ top of page: include_once("$_server[document_root]/qb/quickbooks/loader.php"); now getting following error web-connector: qbwc1012: authentication failed due following error message. client found response content type of 'text/html', expected 'text/xml'. request failed empty response. see qwclog more details. remember turn logging on. i checked files sure content type text/xml, still no dice. please help. <?php /** * example of generating quickbooks *.qwc files * * @author keith palmer <keith@consolibyte.com> * * @package quickbooks * @subpackage documentation */ // error reporting... error_reporting(e_all | e_strict); ini_set('display_errors', 1); /** * require utilities class */ require_once '../quickbooks.php'

c# - How to solve issue "Could not translate expression ...into SQL and could not treat it as a local expression." -

this question has answer here: linq “could not translate expression… sql , not treat local expression.” 3 answers i have code below: void main() { var q = in applicants where(a.claims.any()) select a.claims.sum(c => c.totalclaimamount()); q.dump(); } public static class myext { public static decimal totalclaimamount(this claim c) { var t = c.accommodations.sum(a => a.amountclaimed) + c.mealallowances.sum(ma => ma.amountclaimed) + c.meals.sum(m => m.amountclaimed) + c.mileages.sum(mi => mi.amountclaimed) + c.others.sum(o => o.amountclaimed) + c.parkingtransits.sum(pt => pt.amountclaimed) + c.travels.sum(tr => tr.amountclaimed); return (decimal)t; } } when run in linqpad below issue

Graphite Network interface monitoring -

i'm trying monitor network usage graphite can't figure out how this, me please? in addition this, monitor other services, nginx, mysql, etc,.. thanks help! best. ofcourse there multiple solutions possible. solution i'm using collectd . collectd can collect statistic data plugins in rrd files. has lot of plugins network, nginx , mysql. not generate graphs itself, there multiple ways generate graphs. 1 of them send collected data graphite graphite plugin .

javascript - Can't .push() sub-document into Mongoose array -

i have mongoosejs schema parent document references set of sub-documents: var parentschema = mongoose.schema({ items : [{ type: mongoose.schema.types.objectid, ref: 'item', required: true }], ... }); for testing i'd populate item array on parent document dummy values, without saving them mongodb: var itemmodel = mongoose.model('item', itemschema); var item = new itemmodel(); item.blah = "test data"; however when try push object array, _id stored: parent.items.push(item); console.log("...parent.items[0]: " + parent.items[0]); console.log("...parent.items[0].blah: " + parent.items[0].blah); outputs: ...parent.items[0]: 52f2bb7fb03dc60000000005 ...parent.items[0].blah: undefined can equivalent of `.populate('items') somehow? (ie: way populate array when reading document out of mongodb) within question details own investigation shows pushing document can find it's _id value. not actual problem

asp.net - Add multiple dynamic classes to LinkButton in a ListView -

i trying add multiple classes linkbutton in listview. this works: <asp:linkbutton id="lbattendee" runat="server" cssclass='checkedintrue attendee'> and works: <asp:linkbutton id="lbattendee" runat="server" cssclass='<%#eval("checkedin") %>'> but does not <asp:linkbutton id="lbattendee" runat="server" cssclass='checkedin<%#eval("checkedin") %> attendee'> when 3rd way, class rendered literally, this: <a id="lvattendees_ctrl1_lbattendee" class="checkedin<%#eval("checkedin") %> attendee" href="javascript:__dopostback('lvattendees$ctrl1$lbattendee','')"> <span style="display:none;">2</span> <p class="studentname">joseph conrad</p> <p class="studentid">13526861</p>

python - Trouble installing JCC (required for pylucene) on mac -

i following closely installation guide pylucene . unable past first step, requires installing jcc. to install jcc instructions briefly note mac users need to: edit setup.py , review values in includes, cflags, debug_cflags, lflags , javac correct system. these values going compiled jcc's config.py file , going used jcc when invoking distutils or setuptools compile extensions generating code for. i not sure edit. have java 1.6 installed. when run setup.py (without edits), gives me error (which expect because haven't edited anything, instructed): can't determine java jdk has been installed on machine. please set environment variable jcc_jdk location before running setup.py. i novice coder, having trouble finding should edit in setup.py make work on mac? have tried putting in file path java, has not helped. advice appreciated, thanks!

Zip a Local StorageFolder in windows phone 8 using SharpCompress or Sytem.IO.Compression or -

i'm working on windows phone 8 store app , need zip local storagefolder (with images). environment vs 2013. learned can add references sharpcompress & system.io.compression (but not .filesystem) only. sharpziplib & dotnetzip don't seem support wp8. the examples given sharpcompress don't work. any suggestion code lot. thanks. system.io.compression: string guidpath = path.combine(localstorage, guid.newguid().tostring()) + ".zip"; using (filestream ziptoopen = new filestream(guidpath, filemode.create)) { using (ziparchive archive = new ziparchive(ziptoopen, ziparchivemode.create)) { string[] files = directory.getfiles(szfldrpath); foreach( string echfile in files ) { ziparchiveentry readmeentry = archive.cr

c# - Object deep clone implementation -

i have implement generic extention deepclone method can used reference type instance deep copy. implement following static class classcopy { static public t deepclone<t> (this t instance) { if (instance == null) return null; var type = instance.gettype(); t copy; var flags = bindingflags.flattenhierarchy | bindingflags.public | bindingflags.nonpublic | bindingflags.instance; var fields = type.getfields(flags); // if type serializable - create instance copy using binaryformatter if (type.isserializable) { using (var stream = new memorystream()) { var formatter = new binaryformatter(); formatter.serialize(stream, instance); stream.position = 0; copy = (t) formatter.deserialize(stream); } // copy fiels not marked serializable foreach (var field in fields)

css - Why does my navigation div not extend to the full width of the screen on mobile devices? -

i need troubleshooting css experts. :) my website @ www.daylightfoods.com loads on full desktop browsers. while home page on mobile devices works well, sub pages on mobile devices have problem navigation div @ top. finding navigation div (where grey background , navigation links) not expanding full width of mobile device screen. can't figure out why, , love help! i have been doing mobile testing google chrome ios (both iphone 5s , ipad). here page in question: http://www.daylightfoods.com/sustainability/ it loads on desktop versions, on mobile devices navigation @ top reason not full 100% width. any appreciated! it caused <meta name="viewport" content="width=device-width"> on subpages

python - Why is numpy array's .tolist() creating long doubles? -

i have math operations produce numpy array of results 8 significant figures. when use tolist() on array y_axis , creates assume 32-bit numbers. however, wonder if garbage. assume is garbage, seems intelligent enough change last number rounding makes sense. print "y_axis:",y_axis y_axis = y_axis.tolist() print "y_axis:",y_axis y_axis: [-0.99636686 0.08357361 -0.01638707] y_axis: [-0.9963668578012771, 0.08357361233570479, -0.01638706796138937] so question is: if not garbage, using tolist in accuracy calculations, or python using entire number, not displaying it? when call print y_axis on numpy array, getting truncated version of numbers numpy storing internally. way in truncated depends on how numpy's printing options set. >>> arr = np.array([22/7, 1/13]) # init array >>> arr # np.array default printing array([ 3.14285714, 0.07692308]) >>> arr[0]

java - Android - Retrofit being received as null when the model contains a byte[] -

i'm using retrofit post data webapi rest service. however, if model contains byte[] , value received webapi null. if remove property signature model received expected rest of values. also, leaving signature property null work. it's when signature has content webapi receives null value. the byte array contains png signature image captured on device. here's model, containing byte[] property: public class refunddto { public string id; public string amount; public int assetid; public string comments; public string datecreated; public string datemodified; public int faultid; public int refundactionid; public int siteid; public int userid; public byte[] signature; // culprit } i send model using following code: refunddto dto = getdto(); service.postrefund(dto, new callback<refunddto>() { @override public void success(refunddto dto, response response) { databasehandler db = new databasehandler(co

forms - How to create select box from a table and query a <td> with jquery? -

essentially trying recreate functionality seen @ bottom of www.hurtta.com client. have list of dogs, products , size each dog , product. given data in excel spreadsheet (yuck) able save off html table , strip of fluff classes , id's come excel. have under 13,000 lines of code table. each excel row looks this: <tr > <td>hurtta collars</td> <td>thai ridgeback</td> <td>55, 60</td> </tr> i need figure out how take first td , create select box these values, same second td , when selection made third row value appears jquery snazzy. thoughts, ideas, suggestions? again, there on 2500 tr's 1 see above.

c# - Update Multiple Rows in Entity Framework from a list of ids -

i trying create query entity framework allow me take list of ids , update field associated them. example in sql: update friends set msgsentby = '1234' id in (1, 2, 3, 4) how convert above entity framework? something below var idlist=new int[]{1, 2, 3, 4}; using (var db=new somedatabasecontext()) { var friends= db.friends.where(f=>idlist.contains(f.id)).tolist(); friends.foreach(a=>a.msgsentby='1234'); db.savechanges(); } update: you can update multiple fields below friends.foreach(a => { a.property1 = value1; a.property2 = value2; });

bash - How do I read the first line of lscpu? -

i learning bash right on own. i'm trying write if else statement small script i'm writing. want script read lscpu command check if system x86 or 64 bit system. think can me? basically script installs favorite programs ubuntu system. of programs not in depository , therefore have install offsite. however, of them have different installer files different architectures. pseudo code: if [firstlineoflscpu = architecture: x86_64] install blahblah else blahblahblah fi to answer question: if lscpu | grep architecture | grep -q x86_64 # install 64-bit version else # else fi however, notice uname command, may more direct: $ uname -i x86_64

CSS horizontal menu issue - buttons on multiple lines text -

i have simple horizontal menu square buttons have text on multiple lines . want them appear centered vertical. tried many solutions , nothing seems work. here code, feel free edit. keep buttons square , text on multiple lines. i want text in yellow box centered in middle of yellow box. vertically html <div> <ul> <li> <a href="#">text1</a></li> <li> <a href="#">short</a></li> <li> <a href="#">3 row longer</a></li> <li> <a href="#">2 rows text</a></li> <li> <a href="#">text3</a></li> <li> <a href="#">text6</a></li> <li> <a href="#">text3</a></li> <li> <a href="#">more text here</a></li> </ul> </div> css div * { dis

R lme4 nested fixed effects. Do I nest as random effects? -

i fitting model in glmer (although same question applies lmer). however have 2 (what think are) nested fixed effects. testing how long people spend eating compared sex , weight. how heavy depends on sex (the distribution of weights different between sexes), care in model. want test whether heaviest women eats more lightest women , heaviest man eats more lightest man, want 1 model see if there population wide effect. this how thought of doing having 2 fixed effects nested random effect: model <- glmer(timeeating ~ sex + weight + (1|sex:weight), data, family = poisson(link = "log"))

swing - Weird bug involving background images in java -

my problem when run program white screen , text earlier build instead of background image that's suppose displayed. i've deleted code associated build. i've looked around , threads i've seen write code how i've set up. don't understand displayed background coming from. here relivent code: package tactics; import java.awt.*; import java.awt.image.bufferedimage; import java.io.ioexception; import javax.swing.jframe; public class tactics2 extends jframe{ private screen s; private bufferedimage bg; private bufferedimage template; private boolean loaded = false; public static void main(string[] args) throws ioexception{ displaymode dm = new displaymode(1024, 768, 16, displaymode.refresh_rate_unknown); tactics2 t = new tactics2(); t.run(dm); } //run method public void run(displaymode dm) throws ioexception{ loadpics(); s = new screen(); try{ s.setfullscreen(dm

MySQL call from PHP (CodeIgniter) not working right -

i'm new php (and codeigniter) , i'm having trouble trying simple call of $this->db->query() work. in code (see bottom of post) looking through errors , warnings have been logged in database table eventlog , comparing each list of accepted error messages. if message isn't found on list, want acknowledge setting "ack = 't'". code can't run , gives message: error number: 1064 you have error in sql syntax; check manual corresponds mysql server version right syntax use near '' @ line 1 update eventlog set ack = 't' id = this message seems indicate "$row['id']" not working way intended. should give me id of error or warning, error suggests it's giving nothing, or in wrong format. missing? or there better way may bypass problem? my code: $acceptedmessages = array("whatever", "whateverelse" ); $sql = "(select id,

scala - Understanding Type Parameters -

looking @ part of io monad 's signatures functional programming in scala : trait io[+a] { self => def run: def map[b](f: => b): io[b] = new io[b] { def run = f(self.run) } as understand, io[+a] means io type takes type parameter of "a or subclasses." looking @ def map[b]... , b type involved in function. it's useful use map[b](f: => b): io[b] since, understand, can list b return type of f , returned type parameter of io ? so, following implementation cause compile-time problem: map(f: int => string): io[int] so +a means similar thing t <: a . means "for subtypes of including a". "limitation" useful here because supposed pass f function map method , restricting specific type a , it's subtypes. when extend trait in class allow substitution of f while being typesafe. b here result of applying f a . since it's monad not b io[b] . in other words might fail , might b wrapped in "s

java - Having trouble getting my output to show up in my terminal while using methods -

having problem dealing methods. simple program, can't seem data print terminal here's code: public class method { public static void main( string args[] ) { double result = 0; int i; system.out.println("i" + "\t\t" + "m(i)"); system.out.println("-------------------"); //columns , header } public double thesum(int i, double result) { for(i=0; < 21; i++) { system.out.print(i + "\t\t" + result + "\n"); result +=(double) (i + 1)/(i+2); // computing data } return result; } } everything compiles, output prints headers... think bottom method may wrong, not sure where. sample output: 1 0.5 2 1.16 ... 19 16.40 20 17.35 you need call method print output public static void main( string args[] ) { double result =

graphics - In gouraud shading, what is the T-junction issure and how to demonstrate it with OpenGL -

Image
i noticed here in gouraud shading part, said "t-junctions adjoining polygons can result in visual anomalies. in general, t-junctions should avoided". it seems t-junction 3 surfaces in picture below share edges , point may have different normal vector due belongs different surfaces. but effect when t-junction happened , how use opengl implement it? tried set different normal each vertex of each rectangle , put light in scene, however, didn't see strange in junction point a. here code: glcolor3f(1.0f, 0.0f, 0.0f); glbegin(gl_quads); glnormal3f(0, 0,1); glvertex3f(-5.0f, 5.0f, 0.0f); glnormal3f(0, 1,1); glvertex3f(5.0f, 5.0f, 0.0f); glnormal3f(1, 1,1); glvertex3f(5.0f, 0.0f, 0.0f); glnormal3f(0, -1,1); glvertex3f(-5.0f, 0.0f, 0.0f); glend(); glcolor3f(0.0f, 1.0f, 0.0f); glbegin(gl_quads); glnormal3f(1, 0,1); glvertex3f(-5.0f, 0.0f, 0.0f); glnormal3f(1, 2,1); glvertex3f(0.0f, 0.0f, 0.0f); glnormal3f(0, 0,1); glvertex3f(0.0f, -5.0f, 0.0f); glnormal3f(0, 1, 2);

Breeze: how to make the original values map more secure -

i use originalvaluesmap custom auditing on save. in breeze docs, mention may need add additional security (it's coming client, don't trust it). my goal find way validate original values map not tampered with, audit entries accurate. (an example of exploit want defeat of altering value in original values map make if had not changed value). i thinking doing this: when data queried server, apply hash values of entity include hash in serialization graph of entity (so hash opaque value sent client, salt hash secret known server). when client calls save changes, echo hash server inside of beforesaveentities, reconstruct original entity using values originalvaluesmap. a hash of "de-deltaed" entity should match original. my problem is, don't know how insert hash breeze's serialization graph , extract out. it looks there several promising extension points (custom serializer on client, custom content provider). how 1 this? there better way? nuts?

java - No getter method for property... error -

i unable find out doing wrong. i error: javax.servlet.jsp.jspexception: no getter method property: "firstname" of bean: "org.apache.struts.validator.dynavalidatorform" @ org.apache.struts.taglib.tagutils.lookup(tagutils.java:915) @ org.apache.struts.taglib.html.basefieldtag.preparevalue(basefieldtag.java:126) @ org.apache.struts.taglib.html.basefieldtag.renderinputelement(basefieldtag.java:102) @ org.apache.struts.taglib.html.basefieldtag.dostarttag(basefieldtag.java:80) @ org.apache.jsp.login_jsp._jspx_meth_html_005ftext_005f1(login_jsp.java:1095) @ org.apache.jsp.login_jsp._jspx_meth_html_005fform_005f1(login_jsp.java:1040) @ org.apache.jsp.login_jsp._jspservice(login_jsp.java:759) @ org.apache.jasper.runtime.httpjspbase.service(httpjspbase.java:70) @ javax.servlet.http.httpservlet.service(httpservlet.java:717) in struts-config.xml file tage used: <form-bean name="sendcontactform" type="org.apache.

javascript - How to split file into small data chunks using Node.JS -

i trying parse large file segmenting file data chunks on go. can please me not expert @ node.js? generally node , underlying os automatically when read file via fs.createreadstream . use instead fs.readfile , file streamed in chunks.

Android MusicPlayer uses Stagefright or opencore -

i read if media.stagefright.enable-player set true device uses stagefright . in device's build.prop see media.stagefright.enable-player = false when tired below mediaplayer mp = new mediaplayer(); mp.setdatasource(string.format("http://127.0.0.1:%d/", socketport)); mp.prepare(); mp.start(); i hosted server socket mediaplayer connects serversocket serversocket = null; try { serversocket = new serversocket(0); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } socketport = serversocket.getlocalport(); socket socket = null; try { socket = serversocket.accept(); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } inputstream = null; try { = socket.getinputstream(); } catch (ioexception e) { // todo auto-generate

Limitations of application dictionary in openbravo -

i using openbravo3.0 since 5 months, , wondering limitations of application dictionary in openbravo(what things not possible in application dictionary?). searched in internet not result related it. thanks in advance one of limitation of application dictionary is, cannot develop page radio buttons,obviously can add manual window. achieve functionality in standard application window need use checkbox , write validation checkbox fields if 1 checked other should disabled. check out link https://issues.openbravo.com/view.php?id=6459

php - move uploaded file success but could not find file in folder -

i have following code public function upload() { if($_files){ $this->load->model('account/customer'); $file = $_files['profile']; $file_name = $file['name']; // $ext = end(explode('.', $file_name)); // $file_name = 'na_'.md5(time()).'.'.$ext; echo $file_content = $file['tmp_name']; $data = array('customer_id' => $this->customer->getid(), 'img_url' => $file['name']); $this->model_account_customer->profileimage($data); echo 'test/'.$file_name; $img = move_uploaded_file($file['tmp_name'], 'test/'.$file['name']); if($img) { $return = json_encode(array('status' => 1)); } else { $return = json_encode(array('status' => 0)); } echo $return; } } the above code returning status 1 not see f

osx - gui git client for auto-complete -

in trotoise svn if have many changed files in 1 commit, for examples, committed these 3 files config/application.yml db/schema.rb app/views/streaming_verifications/index.html.haml those file name can auto-completed on tortoise message window, is there equivalent auto-complete function acheive on osx ? or if bad way log commit message ? i'm using gittower now we don't have autocompletion feature in tower this. i wouldn't directly call "bad way", can not many users mention concrete filenames in commit messages. often, message used describe changes on higher / more abstract level. tower support support[at]git-tower.com

out of memory - What is the best way to process large data in PHP -

i have daily cron job xml web service. large, contains more 10k products information , xml size 14m example. what need parsing xml object processing them. processing quite complicated. not directly put them database, need lot operation on them, , put them many database tables. it in 1 php script. don't have experience on dealing large data. so problem take lot of memory. , long time it. turn localhost php memory_limit 4g , running 3.5hrs got successful. production host not allowed such amount memory. i research confused right way dealing situation. here sample of code: function my_items_import($xml){ $results = new simplexmlelement($xml); $results->registerxpathnamespace('i', 'http://schemas.microsoft.com/dynamics/2008/01/documents/item'); //it loop on 10k foreach($results->xpath('//i:item') $data) { $data->registerxpathnamespace('i', 'http://schemas.microsoft.com/dynamics/2008/01/documents/item

java - Why do I need to add an 'f' to value so my code outputs the right value? -

this question has answer here: why division of 2 integers return 0.0 in java? 6 answers the following code works :: public class avgspeed{ public static void main(string[] args){ double kph, km, hours, seconds, minutes, time; km = (1.6 * 24); hours = 1; minutes = 2/3f; seconds = 35/3600f; time = hours + minutes + seconds; kph = km/time; system.out.println(kph); } } if remove f's minutes , seconds, keeps printing out 38.4, not right. should number close 22.906 i don't know reason why need add f, did on whim. thought declaring 2 variables double enough? declaring variables doubles doesn't make 2 or 3 double. conversion double happens after 2/3 computed in integer arithmetic. fix this, calculation in double arithmetic: minutes = 2.0/3; // ^ dou

php curl download page after certain time -

i using below function download webpage using curl function works great. currently downloading page site. problem using java script have countdown of 15 sec. possible download page after time (searched , brainstorm nothing work me)? function curldll($target_url) { $ch = curl_init(); curl_setopt($ch, curlopt_useragent, 'mozilla/5.0 (windows nt 6.1; win64; x64; rv:25.0) gecko/20100101 firefox/25.0)'); curl_setopt($ch, curlopt_url,$target_url); curl_setopt($ch, curlopt_failonerror, true); curl_setopt($ch, curlopt_followlocation, true); curl_setopt($ch, curlopt_autoreferer, true); curl_setopt($ch, curlopt_returntransfer,1); curl_setopt($ch, curlopt_timeout, 100); $html= curl_exec($ch); return $html; } since page using javascript timer load content not able curl can try phantomjs , headless webkit browser execute page , return dynamically assembled dom.

jquery - Exception handling in Ajax -

i making following ajax call https page, $.ajax({ url: "http://www.w3schools.com", datatype: 'jsonp', crossdomain: true, complete: function (e, xhr, settings) { switch (e.status) { case 200: //everything fine break; default: //somethings wrong, show error msg break; } } }); but since making http call https page call gets blocked. can see "insecure content warning" in console(chrome), but error not catched either in complete,error, or success. don't fire @ all. i need catch error. way can ? error type: function( jqxhr jqxhr, string textstatus, string errorthrown ) function called if request fails. function receives 3 arguments: jqxhr (in jquery 1.4.x, xmlhttprequest) object, string describing type of error occurred , optional exception object, if 1 occurred. possibl

android - PayPal in-app purchase breaks the Terms Conditions? -

does using paypal in app purchase, more stars game, break terms , conditions play store? lets developed racing game , want include option buy new cars , tracks, can use paypal in-app purchase system? yes does. from policy : in-app purchases: developers offering virtual goods or currencies within game downloaded google play must use google play's in-app billing service method of payment.

jquery - creating a image viewer pop up with next and prev button -

i creating image box. in body image thumbnails appearing , on click them wish show clicked image in pop , next , prev buttons <html> <head> <style> .image_box{height:600px; width: 1000px;} .image_1{height: 100px; width: 100px; float: left; margin: 10px 0 0 10px;} .my_popup{top:0; left:0; right:0; bottom: 0; background: rgba(####); position: absolute;} .box_pop_up{float: left; margin-left: 20px;} </style> <script> function hidepopup(){ $('.my_popup').hide(); } function showpopup(){ $('.my_popup').show(); } $(function(){ $('.image_1').on('click', function({ showpopup(); }); $('.my_popup').on('click', function({ hidepopup(); }); }); </script> </head>

Android app crashes with SIGABRT Signal 6 only while Eclipse debugging -

i have app runs fine on device without debugger attached. however, have problem when debugging in eclipse: when main thread suspended 10 seconds or more (for example after hitting breakpoint), main thread throws sigabrt, apparently coming libc. the explanation think of message queue on main thread, when not being polled, overflowing messages coming thread. however, don't see heap growing when main thread suspended. moreover, while app has 20 threads between services, content providers, broadcast receivers, http , map worker threads, etc., can't think of source of excessive messages. so question is: how fix problem? tools can use , how go finding causing app crash while sitting suspended in debugger? edit 1: the thing in logcat is: 02-05 22:23:54.861: i/dalvikvm(26795): threadid=3: reacting signal 3 02-05 22:23:54.901: d/dalvikvm(26795): threadid=1: still suspended after undo (sc=1 dc=1) 02-05 22:23:54.901: i/dalvikvm(26795): wrote stack traces '/data/anr/t

haskell - Typechecking problems with pipes-attoparsec -

i've been trying out pipes-attoparsec haven't been having luck. it appears there type mismatch between void , x in (what seems be) relatively straightforward code. i've read in library (that type synonym @ point), i'm not sure how interpret type error. test code: {-# language overloadedstrings,rankntypes #-} module main import qualified data.attoparsec.char8 import qualified pipes p import qualified pipes.attoparsec pa import qualified pipes.bytestring pb import qualified pipes.parse pp passthrough :: a.parser pb.bytestring passthrough = a.takewhile (\s->true) f :: monad m => pp.statet (p.producer pb.bytestring m r) m (either string string) f = r <- pa.parse passthrough return $ case r of left e -> left "a" right (_,r1) -> right "b" g = pp.evalstatet f pb.stdin h = p.runeffect g this results in error: p.hs:16:8: couldn't match type `pipes-4.0.2:pipes.internal.proxy

ruby on rails - How to scope validation to specific model in polymorphic association.? -

i have 2 model user , investment , 1 polymorhic model address class user < activerecord::base has_one :address, as: :addressable, dependent: :destroy accepts_nested_attributes_for :address end class investment < activerecord::base has_many :addresses, as: :addressable, dependent: :destroy accepts_nested_attributes_for :addresses, reject_if: lambda { |v| v['address'].blank? } && :address_blank, :allow_destroy => true end class address < activerecord::base belongs_to :addressable, polymorphic: true validates :address, presence: true end now validates :address, presence: true applicable both investment user want applicable investment not user . how do that. thanks. in class investment add validates :address_id, presence: true and remove bellow class address validates :address, presence: true

javascript - show multiple selected span values in jquery using comma -

i've posted full code on jsfiddle. i'm trying show user selected seats here. if user selected 2 bs result should bs-2. again if user selected 4 fc result should added old 1 bs-2, fc-4. but, i've tried here. show value of span element if selected 1 replaces previous one. how add comma , show multiple selected span values in jquery? jsfiddle jquery $(".text").click(function(){ $(this).toggleclass('selected'); var data = $(this).text(); $('.returndata').text(data); }) try var $texts = $(".text").click(function () { $(this).toggleclass('selected'); var selected = $texts.filter('.selected').map(function () { return $.trim($(this).text()) }).get() $('.returndata').text(selected.join()); }) demo: fiddle

javascript - how to add string to url before the last string -

i want add string in between url i have url hostname.com/test1/test i want add test2 before test it should hostname.com/test1/test2/test do need break strings / , again build string adding tests? or there other way can work on? var url ="hostname.com/test1/test"; var lastslash = url.lastindexof("/"); var output = url.substring(0,lastslash) + "/test2" + url.substring(lastslash, url.length); console.log(output); hope helps.

javascript - HTML Accordion 50/50 split screen -

Image
i new html5 , css3 apologies if stupid question… looking @ image below, trying have page split 50 / 50, if user clicks on top arrow top part shrinks , bottom takes of space, alternatively if user clicks bottom arrow shrink bottom top takes of space i can’t figure out do, please hi please find working demo <div id="accordion"> <h3>section 1</h3> <div> <p> mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. integer ut neque. vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. nam nibh. donec suscipit eros. nam mi. proin viverra leo ut odio. curabitur malesuada. vestibulum velit eu ante scelerisque vulputate. </p> </div> <h3>section 2</h3> <div> <p> sed non urna. donec et ante. phasellus eu ligula. vestibulum sit amet purus. vivamus hendrerit, dolor @ aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. vivamus non quam.

oop - Pros and Cons of creating a separate class for the GUI (in actionscript) -

this related similar question asked; however, 1 tailored individual project, rather object-oriented programming in general. i working on version of hangman interesting programming twists. don't need go detail of logic game finished. can run entire game hard-coding variables user input (such guess selection). in process of replacing bits require user interaction trappings of actual game buttons, images, sounds, etc. i trying figure out whether better have of stuff part of main class, or whether should create class handle all. example, want players able click on on-screen keyboard make guess, each button firing separate event listener call makeguess function. better create buttons direct children of main game class, or should create subclass (called keyboard, example) creates keyboard section of board appropriate events, add keyboard class child main rather pieces? pros , cons of each of these choices? for record, i'm programming using flashdevelop, nothing timeline m

xslt - Facing some attribute node issue -

i having following code on full length xslt, and, creates errors during transformation. error xpty0004: sequence of more 1 item not allowed first argument of matches() <xsl:template match="par[@class='tablecaption']" exclude-result-prefixes="html"> <p class="caption1"> <xsl:variable name="n2" select="./text()|./*/text()"/> <xsl:attribute name="id"> <xsl:if test="matches($n2, '(table)\s(\d+|[a-z])(\.)(\d+)')"> <xsl:variable name="y2" select="replace($n2, '(table)\s(\d+|[a-z])(\.)(\d+)', '$4')"/>tab<xsl:value-of select="normalize-space(substring($y2, 1, 2))"/></xsl:if> </xsl:attribute> <strong><xsl:apply-templates/></strong></p> </xsl:template> what wrong here? pls change variable n2 ./descendant::text()[1] <xsl:template match="par[@class='tabl

c# - Getting Mono and Firebird Embedded working on Linux -

i looking firebird embedded product replace sqlite in project. thing is, able use same compilation of application both on windows , linux, , unfortunately sqlite it's not possible. still, can't firebird running on linux mono (haven't tried windows yet). things i've done: installed firebird ado.net provider nuget. downloaded 32 bit embedded client windows libraries , extracted bin directory: fbembed.dll , firebird.cfg , firebird.msg , ib_util.dll , icudt30.dll , icuin30.dll , icuuc30.dll . created connection string with: string fbconnectionstring = string.format ("servertype=1;user=sysdba;" + password=masterkey;dialect=3;database={0};charset=utf8", _dbfile); fbconnection.createdatabase (fbconnectionstring); still, error, fbembed.dll not found in path. what should do? the firebird .net provider developed windows platform. wire protocol implementation works mono , under linux, can connect normal firebird server. the fbembed.d

vba - Get Excel cell background color hex value -

i obtain background color of cell in excel sheet using formula or vga. found udf: public function bcolor(r range) long bcolor = r(1).interior.colorindex end function it can used in cell: =bcolor(a1) i'm not familiar vga, returns long value , wonder if possible obtain hex value directly. thank you! try this function hexcode(cell range) string hexcode = right("000000" & hex(cell.interior.color), 6) end function

weblogic - Is it safe to delete the stage directory? -

one of servers running out of capacity, due weblogic's stage folder. i've been looking information , seems temporal folder, unlike older versions, on wl11g folder out of tmp folder. i'm not sure whether or not can safely remove it. stage directory weblogic copies applications needs deploy on managed servers. wls not delete file folder. in long run if have done deployment of many versions of application folder can become rather large. so yes can delete contents of folder. @ time of restart wls copy necessary files folder (this take time).

CryptoJS run very slow in IE7 -

the following cryptojs code run in normal speed in ie9 very slow in ie7, reason behind , method speed script in ie7? var keylength = 256; var iteration = 1000; var salt = cryptojs.lib.wordarray.random(128/8); var key = cryptojs.pbkdf2(passphrase, salt, { keysize: keylength/32, iterations: iteration }); var iv = cryptojs.lib.wordarray.random(128/8); var loginpassword = document.getelementsbyname("password")[0].value; var encrypted = cryptojs.aes.encrypt(loginpassword, key, {iv:iv},{mode:cryptojs.mode.cbc,padding: cryptojs.pad.pkcs7}); microsoft has improved speed of javascript engine in ie9 bring par other modern js engines (see here ). i'm afraid there's nothing can done improve performance of ie7 engine. of course, in specific case, reduce number of iterations, although not familiar enough pbkdf2 how far can reduce before function becomes unsafe. option consider moving password hashing server...

android - How to pass the class type -

i trying remake 1 library.i need pass class type object, , cast variable type. trying public class baseactivity extends fragmentactivity { class<? extends application> appclass; public void setappclass(class<? extends application> c) { appclass = c; } protected socialprovidermanager getsocialprovidermanager() { return ((appclass) getapplication()).getsocialprovidermanager(); } } another class public class gameapplication extends application { private socialprovidermanager socialprovidermanager; public socialprovidemanager getsocialprovidermanager() { return socialprovidermanager } @override public void oncreate() { super.oncreate(); baseactivity.setappclass(this); } } how make construction work. thanks.

java - Unable to get the gradle build running on Jenkins and Hudson -

i installed gradle plugin jenkins when try build above project, error: https://issues.jenkins-ci.org/browse/jenkins-21653 removed jenkins , installed hudson. installed gradle plugin hudson gradle doesn't show in build options. tried running build command line option hudson has, , gives following error: started user anonymous java.io.ioexception: failed mkdirs: /home/nav/temphudsonbuild @ hudson.filepath.mkdirs(filepath.java:852) @ hudson.model.abstractproject.checkout(abstractproject.java:1538) @ hudson.model.abstractbuild$abstractrunner.checkout(abstractbuild.java:610) @ hudson.model.abstractbuild$abstractrunner.run(abstractbuild.java:517) @ hudson.model.run.run(run.java:1450) @ hudson.model.freestylebuild.run(freestylebuild.java:44) @ hudson.model.resourcecontroller.execute(resourcecontroller.java:82) @ hudson.model.executor.run(executor.java:137) finished: failure there's no lack of space or permission issue

java - Multithreaded bundle and service instances -

assume have 3 bundles a , b , b1 . bundle a starting point of application. bundle b provides api of service used a . bundle b1 implementation of service. basically, bundle a has set of records processes 1 after other. there no order processing records. i improve performance of application processing subsets of records concurrently. i thought 2 different ways: multiple instances of bundle and, bundle multiple threads. afaik, not possible add multiple instances of same bundle (i.e. same osgi identity) in osgi container. regarding second possibility, each thread created bundle a have own identity. , service exported b1 needs know identity of thread uses it. thus, thought servicefactoy fit here. however, i've read once service instance obtained bundle, cached. therefore, threads same service instance. am right? if yes, "right way" implement model? feel free propose me different approach more osgi friendly. thanks, mickael edit: another possibil