Posts

Showing posts from September, 2014

java - Mocking a void method from the same class that is being tested -

i trying test method using mockito , powermockito, method internally calling method returns void, wanted mock method since dont care result of method. have been trying on unable find solution please me on this. i tries using powermockito searchprocedurecodecontrollerbean mock = mock(searchprocedurecodecontrollerbean.class); powermockito.donothing().when(mock).seterrormessage((string)anyobject(), mockito.anylist().toarray(), (string)anyobject(), (string)anyobject()); seterrormessage void method, signature method follows public void seterrormessage(string errorname, object[] arguments, string messagebundle, string componentid) { } you can stub method of mocked object only. tested object not mocked. power mockito can stub static methods, it's not case. if don't care method behavior leave this. it`s void baisically don't matter. if , suppress it's influence, mean real problem design class under test owns responsibility. extract method class

php - Get a table that can change data directly -

i want data create table can edit,that means data in database can shown in input type box , user can change directly in table. here code: in code name , dob(date of born) , tel. want these data show in text boxes in way allows direct edition of these data. <?php $con = mysql_connect("127.0.0.1","root","password"); mysql_select_db("school2"); $sql = "select * student"; $results = mysql_query($sql,$con); echo "<table border=1 cellpadding=10>"; echo "<tr><th>sid</th><th>name</th><th>dob</th><th>tel</th></tr>"; while($row = mysql_fetch_array($results)) { echo "<tr> <td>$row[0]</td> <td>$row[1]</td> <td>$row[2]</td> <td>$row[3]</td> </tr>"; } echo "</table>"; ?> if ta

javascript - Tooltip not showing up in Safari 5.1.7 -

i have used title attribute show tool tip option in select shown in code below: <select> <option title="hello 1"> hello 1 </option> <option title="hello 2"> hello 2 </option> <select> but tool tip works in chrome , firefox, doesn't work in safari 5.1.7 . can know how fix or work around issue. here demo note: can't use mutiple="multiple" attribute on select try this $(document).ready(function () { $('select option').each(function () { $(this).attr({ 'title': $(this).html() }); }); }); see demo http://jsfiddle.net/vkwbr/1/

double in C preprocessor directives -

what differences between, #define myvariable 1.25 and, #define myvariable (double)1.25 while declaring preprocessor directives in c. the difference preprocessor will, when sees myvariable , substitute in (double)1.25 rather 1.25 . this have no effect on code (possibly bizarre edge cases notwithstanding) since 1.25 already double literal, per c11 6.4.4.2 floating constants /4 : an unsuffixed floating constant has type double . if suffixed letter f or f , has type float . if suffixed letter l or l , has type long double .

Liferay 6.0: Deploy error -

i'm in process of upgrading liferay 5.2 6.0. all went (not really, i've spent 2 months on - upgrade ext, db, etc). currently managed deploy portlets of mine without issue except 1 portlet... after build-service success, proceed ant deploy , failed. return error: c:\barterfli\liferay\plugins\portlets\membershipactivation-portlet\docroot\web- inf\src\com\leadingside\portal\membership\service\service\persistence\users_activationpersistenceimpl.java:129: unreported exception com.leadingside.portal.membership.service.nosuchusers_activationexception; must caught or declared thrown return remove(((long)primarykey).longvalue()); ^ c:\barterfli\liferay\plugins\portlets\membershipactivation-portlet\docroot\web- inf\src\com\leadingside\portal\membership\service\service\persistence\users_activationpersistenceimpl.java:240: unreported exception com.leadingside.portal.membership.service.nosuchusers_activationexception; must caught or declared thrown return findbyprimarykey(((lo

java - Setting up L on Android Studio -

Image
so i've been learning android on eclipse summer decided try out android studio along new android-l release. right when make new project though, 3 errors. first 2 failed find support:wearables , gms:play-service-wearable , third android-l needing jdk 7 compile. downloaded jdk 7 , double-checked skd manager make sure had updated tools. looks me can't seem these errors go. here screenshot: for first 2 issues ran , fixed https://code.google.com/p/android/issues/detail?id=72454 : for android studios version 0.8.0 tools > manage add-on sites > user defined sites. for android studios verison 0.8.1 android sdk manager > tools > manage add-on sites > user defined sites. add site https://dl-ssl.google.com/android/repository/addon-play-services-5.xml then make sure have latest google play services (18) for jdk issue i'm vaguely remember getting same thing months ago , fixed downloading jdk 7.

c# - How to bind key value pair to dropdown in MVC4 Razor -

i have country table "tblcountry", there 2 columns country name, country id, want display country name store country id in rest of tables. please tell me approach creating models view, using database first approach. public partial class tblrfatcountry { public long countryid { get; set; } public string country { get; set; } } this model tried add dictionary. public partial class tblrfatcountry { public long countryid { get; set; } public string country { get; set; } public dictionary<string, long> countrydic = new dictionary<string, long>(); } i want can display name store value. please suggest you need : @{ dictionary<long, string> dictionarycountry = new dictionary<long, string>() { {1, "item1"}, {2, "item2"}, {3, "item3"}, {4, "item4"}, }; selectlist countrylist= new selectlist( dictionarycountry.select(x

c# - how to insert data from database in combox -

i'm trying insert data database in combo box showing tables in combobox here's connection private void form1_load(object sender, eventargs e) { string connetionstring = null; sqlconnection cnn; connetionstring = "data source=itworksdev01;initial catalog=itworksdev"; cnn = new sqlconnection(connetionstring); (int = 0; < 5; i++) { combobox1.items.add(i.tostring()); } } first of all, database-type using ? you can look-up correct connection-code each database here: http://www.connectionstrings.com/ second, don't forget open connection: private void form1_load(object sender, eventargs e) { string connetionstring = null; connetionstring = "data source=itworksdev01;initial catalog=itworksdev"; using (sqlconnection cnn = new sqlconnection(connetionstring)) { cnn.open(); after opened connection, create datareader , sql-statement: sqldatareader , sqlcommand

Using Jetbrains Youtrack + TeamCity + TFS -

were using tfs source control , team city ci. i'd introduce youtrack mix. what's integration between 3 of them like? eg can raise bugs in youtrack against product backlog items (a "story") in tfs? cheers pearls of wisdom!! in integration environment describe tfs act vcs, no, won't able raise bugs in yt against story in tfs. however, able modify state of yt issue mentioning in commit comment #iss-123 fixed . you'll able view commits related issue in yt. in tc see issues relate build.

hpc - How to differentiate between Intel Xeon Phi Coprocessors 7120P, 7120X, 7120D, 7120A -

i have xeon phi coprocessor 7120p. when run micinfo, see board sku c0prq-7120 p/a/x/d. notice smc hw revision states product 300w passive cs , read on tomshardware p stands passive cooling intel xeon phi familiy devices. or there other way tell device have on system 7120 p/a/x or d? from specs given on ark.intel.com, 4 devices appear same. can 1 elaborate on actual differences between these devices. the a/p/x/d variants of intel xeon phi coprocessor 7120 different form factors different cooling. codes are: = active, is, fan; p = passive, is, air stream needs supplied chassis fans; d = dense, special form factor dense design; x special form factor manufacturers want make individual designs. the cpu , memory of these coprocessor versions same in 4 cases. cheers, -michael

woocommerce - How to change the date format in order-detail? -

i want change date format of order-detail. right coming in "8 06europe/amsterdam18 2014" , want in 26-06-2014 like: here link . appreciated. note: site in dutch . date format needs changed. $your_date = "2014-06-26";// may in date format or in date time format "2014-06-26 00:00:00" $date=date_create($your_date,timezone_open("europe/amsterdam")); echo date_format($date,"d-m-y");//gives output-> 26-06-2014

javascript - how to add custom history in HTML5 to prevent android back button to display just previous view in cordova application? -

Image
i created application of http://coenraets.org/blog/cordova-phonegap-3-tutorial/ . when click on sms link in employee details view opens native message composer because link's href="sms:6170000010". when click on android button during message composer opened takes application previous view window.history.back(), want close message composer. how can customise source code close message composer when button pressed particular situation , rest of application should behave is. below employee details view screenshot i fixed using html5 history pushstate function.this allow me add history entry in history array. on android button click pop current(smscomposer) view history array , employee details view is. <a href="sms:6170000010" onclick="modifybrowserhistory()" > function modifybrowserhistory(){ window.history.pushstate({page:"smscomposer"},"sms composer"); }

jQuery datepicker is not closing after select date in IE 10 and below -

asp.net 3.5 / jquery 1.9.1 / jquery ui 1.10.4 i have got jquery datepicker on page , found issue in ie10 , below versions datepicker popup not closing after select date. i can suggest use like .datepicker({autoclose: true}); when enter date picker

rest - Jersey 1.18.1 is unable to pick my restful service when deployed on Jboss 7.1.1 final -

i have confusing problem me. have eclipse restful service project being built gradle. can build , run application in tomcat 7.0.54, within eclipse , deploying war directly in /webapps folder of tomcat. but when deploy same war in jboss 7.1.1 final, gives me below error. 10:43:45,390 warn [org.jboss.jaxrs] (msc service thread 1-7) jbas011204: resteasy.scan found , ignored in web.xml. not necessary, resteasy use container integration in jax-rs 1.1 specification in section 2.3.2 10:43:45,390 warn [org.jboss.jaxrs] (msc service thread 1-7) jbas011204: resteasy.scan.providers found , ignored in web.xml. not necessary, resteasy use container integration in jax-rs 1.1 specification in section 2.3.2 10:43:45,391 warn [org.jboss.jaxrs] (msc service thread 1-7) jbas011204: resteasy.scan.resources found , ignored in web.xml. not necessary, resteasy use container integration in jax-rs 1.1 specification in section 2.3.2 10:43:46,128 info [com.sun.jersey.api.core.packagesresourceconfig]

jsf - Is it possible to disable f:event type=“preRenderView” listener on fileupload primefaces -

i have fileuploader disappears after partial site refresh here xhtml file <?xml version='1.0' encoding='utf-8' ?> <!doctype composition public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" template="/web-inf/templates/traleerdf-template.xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns="http://www.w3.org/1999/xhtml"> <ui:define name="content"> <f:metadata> <f:event type="prerenderview" listener="#{registration.loadregistrationdetails()}" ></f:event> </f:metadata> <p:ajaxstatus onstart="pf('statusdialog').show();" onsuccess="pf('stat

What is the difference between scrollTop() method and scrollTop property in jQuery? -

i bit confused try understand difference between jquery method scrolltop() , property scrolltop. read jquery method scrolltop() @ several places on internet surprisingly didn't read anywhere scrolltop jquery property. not sure though saw in many code of animate() method, people using scrolltop: value scroll page. please let me understand this. there resource on internet can tell scrolltop can used property. jquery's .scrolltop() method wraps native element.scrolltop property. that is, .scrolltop() method belongs jquery objects while property belongs native elements . 2 won't present in same object. i saw in many code of animate() method, people using scrolltop: value scroll page yes, scrolltop animatable property. see .animate() docs: in addition style properties, non-style properties such scrolltop , scrollleft , custom properties, can animated. is there resource on internet can tell scrolltop can used property. the jquery ap

java - JTextPane wrap and unwrap long words with out space using JButton -

i trying implement wordwrap/unwrap using button jtextpane . had tried that, not working correctly. problem here is: i typed text spaces working, without spaces it's not working. here code: public class testvisual extends javax.swing.jframe { private boolean wrapped; private jbutton togglebutton = null; private jtextpane jtp = null; private jpanel nowrappanel = null; private jscrollpane scrollpane = null; public testvisual() { super(); init(); } public void init() { this.setsize(300, 200); this.setlayout(new borderlayout()); wrapped = false; jtp = new jtextpane(); nowrappanel = new jpanel( new borderlayout() ); nowrappanel.add( jtp ); scrollpane = new jscrollpane( nowrappanel); togglebutton = new jbutton("wrap"); togglebutton.addactionlistener(new java.awt.event.actionlistener() { public void actionperformed(java.

amazon web services - AWS: Multiple EC2 Instance and single RDS Instance -

how manage aws multiple instances... , use of different options available while enter "aws console"... like: east (n. virginia), west (oregon) , west (n. california) etc... what understood is, can created multiple instances same configuration (deploy same web pages, services on instances - right?) , single rds instance... these ec2 instance point single rds instance - right? (not sure here...) as result have 3 ec2 instances instance_1: east (n. virginia) instance_2: west (oregon) and instance_3: west (n. california) all above instances point single "rds instance" - right? , in dns resolving list add name record pointing different ip address (single dns above 3 instance ip address) just want know correct understanding? key benefit of aws services - or suggestion appreciated. thank you. having 3 web server - instance in 3 different regions , 3 connected single rds instance having web server , rds instance in same region i.e. east (n.virgin

javascript - How to remove loaded script and add new script? -

i creating demo in have added query string in url. when load html value of query. want if query string has value "simple", removes js file loaded. if finds value other "simple" should load js file. i google searched solution, nothing works. here html: <!doctype html> <html> <head> <script src="js/jquery-1.11.0.min.js" type="text/javascript"></script> <script src="js/copynode.js" type="text/javascript" id="dynamic_files"></script> <script type="text/javascript"> $(window).load(function(){ // full load var query = decodeuricomponent(window.location.search.substring(1)); console.log("---------------------"); var index=query.indexof("=") query=query.substr(index+1,query.length); console.log(query); if(query=="simple"){ alert('if--');

c# - MySQL data source is not appearing in Visual studio 2010 express edition -

i have installed mysql connector .net 6.8.3 , mysql visual studio 1.1.1 in machine. when try create ado.net entity data model entity framework 6.0 cannot see mysql data source in "choose data source" window. i wondering whether mysql connector supported vs2010 express. visual studio express not allow install extensions. not "see" mysql data source in "choose data source" window. see here . i see have used vs 2012 tag. if professional edition or higher, suggest if using entity framework 6, download , install mysql connector 1.1.4. use v6.8.3. v1.1.4 fixed bugs relating ef 6. you can read here , download here .

c# - True pixel quantity -

i know question littel strange need realy help. have algorithme calculate true pixel quantity in binary image. example how work: binary image : 0 0 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 0 0 1 0 1 0 0 0 1 her result : 18 15 11 8 6 5 16 13 9 7 5 4 11 9 6 5 4 3 5 4 2 2 2 2 2 2 1 1 1 1 and how work : result (i,j) = result (i+1, j) + result (i, j+1) - result(i + 1, j + 1) + image(i,j) her example 18 value: 18 = 16 + 15 - 13 + 0 my question : name of algorithm because need more information it? thank help. this called integral image, or summed area table . used speedup box filtering, among others. 2d generalization of prefix sum .

javascript - how best to create a single scrollable view in famo.us? -

famo.us has "scrollview" scrolls if have multiple surfaces inside it. i single long page of text, doesn't respond scrolling. given famo.us deliberately overrides normal native scrolling views ( https://github.com/famous/views/issues/45 ), best method famous scroll long page of content? i'm considering breaking content html apart (eg div div), , adding bunch of surfaces normal scrollview. may work simple content complex non-trivial - js have parse dom of to-be-displayed html. i thought maybe iframe setup have own scrollbar, haven't got work yet. mean somehow overriding famous' css hiding clipping. fact touchmove events swallowed famous require lot of other workarounds, or forking famous. i assume using true-sized surface dynamic length long form content. when doing so, scrollview can't understand size of true, no scrolling. can instead wrap our surface in rendernode , modifier , use sizefrom function of modifier wrap true sized surface a

Passing file path in Delphi from TOpenDialog as a string -

i'm trying make use of topendialog in order pass path selected file adoconection , load content of excel file table. i'm attempting code below last part of code not connect excel returning error: [dcc32 error] sample_map.pas(80): e2010 incompatible types: 'string' , 'topendialog' procedure tform1.button1click(sender: tobject); var opendialog : topendialog; // open dialog variable strconn : widestring; // declare wide string connection begin // create open dialog object - assign our open dialog variable opendialog := topendialog.create(self); // set starting directory current 1 opendialog.initialdir := getcurrentdir; // allow existing files selected opendialog.options := [offilemustexist]; // allow .dpr , .pas files selected opendialog.filter := 'excel 2003 , older|*.xls|excel 2007 , older|*.xlsx'; // select pascal files starting filter type opendialog.filterindex := 2; // display open file dialog if opendial

PostgreSQL clarification -

i have written function inside postgresql has following code: for (i = 0; < 4; i++) { datum dat_value = cstringgetdatum(inp->str[0][i]); values[i] = datumcopy(dat_value, stats->attrtype->typbyval, stats->attrtype->typlen); } the input strings {algeria,argentina,brazil,canada}. code runs algeria,argentina terminates abruptly brazil. when investigated found inside datumcopy function, statement after memcpy not getting printed. checked if palloc failed (s == null) condition, seems not reason. think memcpy failing. reason why? thanks! datum datumcopy(datum value, bool typbyval, int typlen) { datum res; if (typbyval) res = value; else { size realsize; char *s; if (datumgetpointer(value) == null) return pointergetdatum(null); realsize = datumgetsize(value, typbyval, typlen); s = (char *) palloc(realsize); printf ("value : %s\n&quo

how to validate XML node text using vbscript -

this xml file. <parameter> <etpar_guix> <item> <pname>coas_1</pname> <ptyp>x</ptyp> <pdesc>generated table view</pdesc> <pindex>0001</pindex> <pgroup>gettab</pgroup> <xmlref_typ>t</xmlref_typ> <pstruc_typ>t</pstruc_typ> <pref_type>view</pref_type> <pref_name>coas</pref_name> <pdatlen>0000</pdatlen> <pintlen>000000</pintlen> <pdecimals>000000</pdecimals> <sort_lnr>0001</sort_lnr> <pref_name2>coas</pref_name2> <val_type>t</val_type> <tab_index>0</tab_index> </item> <item> <pname>i_order_number_from_table</pname> <ptyp>i</ptyp> <pdesc>generated table view</pdesc> <pindex>00

timeout - Mistake in jquery function -

i have jquery timeout function, think made syntax mistakes, can correct me did wrong i want scroll page after 5 second, if user click on button don't want scroll, here have now, ok when user click don't know how prevent scroll? here example code $(document).ready(function () { var clickscroll = 0; $('.jumper').click(function () { clickscroll = clickscroll + 1; $('html, body').animate({ scrolltop: $(".section-one-home").offset().top - 98 }, 2000); }); if (clickscroll == 0) { settimeout(function () { $('html, body').animate({ scrolltop: $(".section-one-home").offset().top - 500 }, 2000); }, 5000); } }); any suggestion? you can using cleartimeout cancel function in settimeout : $(document).ready(function () { var clickscroll; clickscroll = settimeout(function () { $('html, body').animate({ scrollt

jsp - Error in uploading large size of files : EXC E:java.io.IOException: Posted content length of 12000169 exceeds limit of 1048576 -

i got error when try upload 11.4 mb text file. exc e:java.io.ioexception: posted content length of 12000169 exceeds limit of 1048576 here's upload.jsp <html> <body > <form action="read.jsp" method="post" enctype="multipart/form-data" > <head> <link rel="stylesheet" type="text/css" href="./css/master.css" /> <link rel="stylesheet" type="text/css" href="./css/nav.css" /> </head> <p> <h1>upload</h1><br> </p> <p> <h3> please specify file:</h3><br> <input type="file" name="file" size="40"> </p> <div> <input type="submit" value="send"> </div> </form> </body> </html> here's read.jsp <html> <head> <title

ios - Create separate xcdatamodel file for Core Data and merge them on runtime -

i have project separated in 1 main-project , sub-projects. i have abstract entities in core data model file in main-project , create entities inherit of abstract entities each sub-projects in other core data model file. then, when run app, merge core data model files in one. do know if it's possible? thanks lot!

ajaxcontroltoolkit - asp.net AjaxFileUpload Could not find a part of the path catch exception in code behind -

asp.net 3.5 ajaxfileupload not find part of path: 'c:\users\xxxx\appdata\local\temp_ajaxfileupload\8f1933d0-9c0b-8d40-c342-cad6c4833f58 an exception of type 'system.io.directorynotfoundexception' occurred in mscorlib.dll not handled in user code i have 2 problems: 1) happen sometime. 99% of time works fine small , large files sometime exception. idea why? 2) generate yellow screen because, has says "was not handled in user code" , caught application , proper message displayed, how can catch exception in page code behind, there not seams or error server side event. there client side event no server side , time is late. have try catch in onuploadcomplete not catch anything put in web.config below system.web closing tag: <system.webserver> <validation validateintegratedmodeconfiguration="false"/> <handlers> <add name="ajaxfileuploadhandler" verb="*" path="ajaxfileuploadhandler.axd&quo

SQL XML DIFF on attributes -

i have xml field in table , want set trigger store changes in table. want know example attribute "url" changed " http://example.com/ " " http://newurl.com " , when. this have now: declare @xml1 xml declare @xml2 xml set @xml1 = '<newdataset> <employee> <empid>1005</empid> <name> keith </name> <dob>12/02/1981</dob> <deptid>acc001</deptid> </employee> </newdataset>' set @xml2 = '<newdataset> <employee> <empid>1005</empid> <name> keith </name> <dob>12/02/1981</dob> <deptid>acc002</deptid> </employee> </newdataset>' ;with xml1 ( select t.n.value('local-name(.)', 'nvarchar(100)') nodename, t.n.value('.', 'nvarchar(100)') value @xml1.nodes('/newdataset/employee/*') t(n) ), xml2 ( select t.n.value('local-name(.)', 'nvarchar(

javascript - Grouping nested table rows -

what best way of grouping table rows in html table? of groupings supposed nested, using <tbody> not ideal solution (they not supposed nested). my data has following format: level 1 level 1 level 2 level 2 level 3 level 4 level 3 level 3 level 2 level 1 level 2 level 3 level 4 level 4 level 3 level 2 level 3 what trying achieve: sensible document structure that's easy read so far achieved 'easy read' part css different levels some of nested levels may required collapsible, grouping (?) make things easier. have work such nested level following particular higher level collapse via mechanism (clicking, likely). not sure how sense collapsing makes may 1 of requirements. the table generated in javascript (from json object has nested structure), can sorts of magic it. data represents financial balance sheets, , may want display/hide more detailed inform

php - Laravel/Blade: How to style error message in form -

i made form validation (laravel blade template engine) , works expected. here's code: @if ($errors->first('email')) {{ form::text('email', null, $attributes = array('class'=>'error')) }} {{ $errors->first('email', '<small class=error>:message</small>') }} @else {{ form::text('email') }} @endif is there cleaner solution? i'd write form::text('email') once... this should self-explanatory {{ form::text('email', null, $attributes = $errors->has('email') ? array('class'=>'error') : array()) }} @if ($errors->has('email')) {{ $errors->first('email', '<small class=error>:message</small>') }} @endif

Text File writing in Java -

i writing string content text file in java code after writing saving file onto disk, getting incorrect encoding exception, please suggest me correct java code? string content =filecontent;//filecontent.tostring(); system.out.println("file contt===>"+content); file filewrite = new file("/homedesktop/normalfile/"+filename); // if file doesnt exists, create if (!filewrite.exists()) { filewrite.createnewfile(); } filewriter fw = new filewriter(filewrite.getabsolutefile()); bufferedwriter bw = new bufferedwriter(fw); bw.write(filecontent); bw.close(); ioutils.tostring(string) converts coding. string not encoded in utf-8 note: dont need this: // if file doesnt exists, create if (!filewrite.exists()) { filewrite.createnewfile(); } file create automatically new file, if there isn't one.

clojurescript - Unable to display two components in OM -

i attempting learn om, , have come across don't understand. expect code (defn search-page-view [app owner] (reify om/irender (render [_] (dom/div #js {:id "search-block"} "test") (dom/div #js {:id "results-block"} "test2")))) (om/root search-page-view app-state {:target (. js/document (getelementbyid "app"))}) to result in html: <div id="app> <div id="search-block"> test </div> <div id="results-block"> test2 </div> </div> however, not! first div containing test not display. misunderstanding? edit solution (pointed out fakerainbrigand): changing code (defn search-page-view [app owner] (reify om/irender (render [_] (dom/div nil (dom/div #js {:id "search-block"} "test") (dom/div #js {:id "results

audio - What is the best way to merge mp3 files? -

i've got many, many mp3 files merge single file. i've used command line method copy /b 1.mp3+2.mp3 3.mp3 but it's pain when there's lot of them , namings inconsistent. time never seems come out right either. as thomas owens pointed out, concatenating files leave multiple id3 headers scattered throughout resulting concatenated file - time/bitrate info wildly wrong. you're going need use tool can combine audio data you. mp3wrap ideal - it's designed join mp3 files, without needing decode + re-encode data (which result in loss of audio quality) , deal id3 tags intelligently. the resulting file can split component parts using mp3splt tool - mp3wrap adds information idv3 comment allow this.

javascript - How can I stop queue animation jquery? -

i using function add or remove products favorites. when add or remove product favorites div pops out message. have problem queue animation. does knows way fix this? function addfavorite(code, action) { var website = 'http://localhost'; var cod = code; var action = action; var $this = $j(this); if (action == 'removefav') { $j.ajax({ type: 'post', url: '/ajax/handler.favorite.php?action=removefav', data: { 'cod': cod }, beforesend: function() { $j('.topmessage').show(); $j('.topmessage span').html('<img src="' + website + '/assets/loader.gif" alt="loading..">'); $j('.topmessage span').animate({ top: "+=80px", }, 500); }, success: function(data) {

smartfoxserver - Java error java.util.concurrent.ConcurrentHashMap.keySet -

hey guy's getting error: can guy's possibly try fix this? or see whats wrong post fix or thanks alot guy's :) exception in thread "extensionhandler-1" java.lang.nosuchmethode rror: java.util.concurrent.concurrenthashmap.keyset()ljava/util/concurrent/concu rrenthashmap$keysetview; @ aerivial.requests.aqw.getaction.process(getaction.java:196) @ it.gotoandplay.smartfoxserver.controllers.extensionhandler.processeve nt(extensionhandler.java:535) @ it.gotoandplay.smartfoxserver.controllers.extensionhandler.run(extens ionhandler.java:344) @ java.lang.thread.run(thread.java:619) the error code: concurrenthashmap tgtbuffdebuffs = (concurrenthashmap)usertgt.properties.get(users.buffs_debuffs); (iterator = tgtbuffdebuffs.keyset().iterator(); i.hasnext(); ) { int auraid = ((integer)i.next()); aura aura = (aura)world.instance.auras.get(integer.valueof(auraid)); if ((aura.getdamage() >= 0.0d) &a

c# - YouTube Analytics API -

i newbie google apis , wanted start on working youtube analytics api generate reports.i have created project in side google developer console.when click on credentials there 2 options - oauth , public api access .i not able understand way should go oauth or public api access .for oauth while creating new client id there 3 options - web application,service account , installed application here recommended way ?please me understand things. note : our requirement use youtube analytics api generate reports uploaded videos on our clients channel. when comes private user data, oauth 2.0 recommended authorization method analytics api. if you're collecting , storing data used on end, want go server-side application approach. from documentation: the server-side flow supports web applications can securely store persistent information. the client-side flow supports javascript applications running in browser. the installed application flow supports application

jquery - generic breadcrumb in mvc 4 -

please me m totally new asp.net mvc.i want implement generic breadcrumb in asp.net mvc. created partial view(cshtml) , in pages , in partial view,i embed logic show breadcrumbs , working fine.but problem that, page can open in 2 ways through dashboard through menu my coding handles 1 scenario(either dashboard or menu), can please simplify scenario or guide me apply breadcrumb in pages. so want this if user enters customer's page , menu breadcrumb should show hierarchy menu admin > customer and if user enters customer's page dashboard breadcrumb should show hierarchy dashboard dashboard > customer thanks in advance. regards. i take @ mvcsitemapprovider.mvc5 i have used in past same kind of thing. wrapping bootstrap around give better styling

parsing - How can I parse an email passed as a string in Rails 3 -

i'm using postfix mail server , i'm sending incoming emails controller through alias: v2mail1: |"/var/www/html/dev/rails/v2p0/script/email_handler.sh incoming_email development" in email_handler.sh i'm passing email standard input controller post message: /usr/bin/curl -f email='<-' -s -f $base_url/$1 so whole email string in controller. how can parse string to , cc , subject , body , attachments , etc. did not find gem that. e.g. string: "from nagyt@hu.inter.net fri jun 27 11:14:28 2014\nreturn-path: <nagyt@hu.inter.net>\nx-original-to: v2mail1\ndelivered-to: v2mail1@centos1.tibi1959.hu\nreceived: centos1.tibi1959.hu (postfix, userid 276)\n\tid c0dc7283a04; fri, 27 jun 2014 10:18:59 +0200 (cest)\ndate: fri, 27 jun 2014 10:18:59 +0200\nto: v2mail1@centos1.tibi1959.hu\nsubject: test ntibor v2mail1\nuser-agent: heirloom mailx 12.5 7/5/10\nmime-version: 1.0\ncontent-type: text/plain; charset=us-ascii\ncontent-transfer-encoding: 7

c# - Fluent NHibernate - Failure: NHibernate.MappingException : No persister for Tag -

i read 20 question prolem find no solution specific case here... i use last version of nhibernate , fluent nhibernate installed via nuget all class pubblic, have no error on build this base class tests: namespace gedi.integrationtest { public class basedbtest : idisposable { private static nhibernate.cfg.configuration configuration; private static isessionfactory sessionfactory; protected isession session; public basedbtest() { if (configuration == null) { configuration = new nhibernate.cfg.configuration(); configuration.configure(); // read config default style fluently.configure(configuration) .mappings(m => m.automappings.add(automap.assemblyof<tag>(new automapconfiguration()))); sessionfactory = configuration.buildsessionfactory(); } session = sessionfactory.opensession(); new schemaexport(configuration).execute(true, true, fals

ruby - Binding within a block -

i'd use block within method initialize . code: class settlement attr_reader :url, :parameters def initialize(&block) instance_eval block.call end def parameters(x) ; @parameters = x; end def url(x) ; @url = x; end end settlement = settlement.new url "https://xxxxx" parameters("ffff") end i got error message below: nomethoderror - undefined method parameters any ideas? when call instance_eval block.call block.call evaluated before instance_eval called. means block called without instance binding. this should work: def initialize(&block) instance_eval &block end

propertygrid - How to add a property to a c# class at runtime -

i created class propertygrid control looks this: public class detailfilterproperties { public detailfilterproperties(treevieweventargs e) { ... } [categoryattribute("base"), descriptionattribute("filtered fields referring formatted yam field"), readonly(true)] public dictionary<string, string> filteredfields { get; set; } ... } at runtime want add string property (or list of strings) class can give me example of how please. i browsed web , read expandoobject bet there easier way achieve this, didnt find example yet. thanks in advance. you can't actually add property c# class @ runtime; however, propertygrid respects flexible types via icustomtypedescriptor . can supply custom type descriptor either implementing interface directly (lots of work), or registring typedescriptionprovider (also lots of work). in either case, you'll have implement custom propertydescrip

salesforce - Session id issue: Different id for vf and developer console -

i facing following issue: on load of visualforce page making http callout internal salesforce page here facing authentication problem. if running same http callout developer console getting successful response same code not working visualforce page. reason not working session id in developer console , visualforce domain different. for fetching session id using "userinfo.getsessionid()" i have tried {!$api.session_id} not working my controller: public sharing class httprequestforpage { public httprequestforpage() { requestforpage('https://ap1.salesforce.com/home/home.jsp'); } public void requestforpage(string pageurl) { httpresponse responseofpage; string responsestring; httprequest request = new httprequest(); request.setmethod('get'); request.setendpoint('https://ap1.salesforce.com/home/home.jsp'); request.setheader('cookie', 'sid='+userinfo.getsessi

javascript - Adding Pagination or Lazy Load to Instagram feed -

i'm working on instagram feed fashion campaign whereby users of instagram hash-tag photos common tag. script, based on instagram api, pulls recent posts common tag appear on web page. obviously, instagram limits script 20 image requests have been looking way of either implementing pagination feature, or more preferably, ajax 'load more' button or lazy load plugin. similar feed @ http://blackrebelmotorcycleclub.com/media/ perfect. if shed light on how might go this, brilliant. have limited knowledge when comes javascript , ajax, , lot of tutorials have come across don't go detail regarding actual implementation of code. the current development can viewed @ www.lovedesignerglasses.com/ig-feed. have included instagram script below. thanks! javascript <script type="text/javascript"> $.ajax({ type: "get", datatype: "jsonp", cache: false, url: "https://api.instagram.com/v1/tags/sungl

php - CSqlDataProvider sort attributes in CListView -

i have following, $dataprovider in controller: $sql = 'select * tbl_user order id_user'; $count = 'select count(*) tbl_user'; $dataprovider = new csqldataprovider($sql, array( 'keyfield' => 'id_user', 'totalitemcount' => $count, 'sort' => array( 'attributes' => array( 'name', ), ), 'pagination' => array( 'pagesize' => 15, ), )); and clistview in view: $this->widget('zii.widgets.clistview', array( 'dataprovider' => $dataprovider, 'sortableattributes' => array( 'name' => 'name', ), )); the sort by: name appears when click nothing happens i.e. ajax request works records not sorted. missing? thanks. i have solved problem with: $sql = 'select * tbl_user'; $dataprovider = new csqldataprovider($sql, array( 'keyfield' => 'id_user', 'totalitemcou

android - Specify class names for Proguard to avoid obfuscating to -

i see proguard can specify dictionary of names used when obfuscating (and these can @ field/method, class or package level). is there way give list of names not obfuscate to? tried putting ! in front in dictionary didn't seem work. bit of context, i'm thinking not obfuscate class names r avoid conflicts android generated r class. as aside, it's worth checking out example dictionaries in proguard distribution (examples/dictionaries/) - last 2 made me chuckle! i stumbled upon question while searching same thing. this not answer core question, use-case adding proguard-project.txt should enough: -keep public class **.r { public *; } -keep public class **.r$* { public *; }

c# - Getting selected Item in DataGrid in WPF -

Image
i have datagrid , textboxes. when select row in datagrid want textboxes filled related data of datagrid column. here picture., i have written code in mainwindow.xaml.cs : private void personelentitydatagrid_loaded(object sender, routedeventargs e) { personelentity pers = (personelentity)personelentitydatagrid.selecteditem; namebox.text = pers.name; // exception here agebox.text = pers.age.tostring(); phonenumberbox.text = pers.phonenumber; addresbox.text = pers.address; } when run code null reference exception in line wrote. here exception: {"object reference not set instance of object."} i guess object pers null. can tell me how make work? here xaml file : <window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.

Python mock, patch os.environ returns None -

i have simple module: # my_module os.path import join os import environ some_file_name = 'foo.txt' def file_path(): join(environ['target_directory'], some_file_name) and simple test: import os import unittest os.path import join mock import patch my_module import some_file_name, file_path class mytest(unittest.testcase): def test_can_create_path(self): some_folder = '/path/to/directory' patch.dict('my_module.environ', {'target_directory': some_folder}): self.assertequal(file_path(), join(some_folder, some_file_name)) if __name__ == '__main__': unittest.main() i expected call environ['target_directory'] return '/path/to/directory' returns none your function returns none , there no explicit return statement. add return : def file_path(): return join(environ['target_directory'], some_file_name) the mock patch worked fine otherwise.

Objective C copy array to another array with index 1 -

i have array 1 object in @ index 0 if correct. copy array x objects first array 1 object, leaving object there so: array 1: objecta array 2: object1, object 2, object 3 now array 1 = copy array 2 array 1 array 1: objecta, object1, object2, object 3.... how can that? try this: array1 = [array1 arraybyaddingobjectsfromarray:array2];

python - Redirect with data parameter in flask -

i trying learn flask , came across following problem.this example trying implement. @app.route('/poll', methods = ['get', 'post']) def poll(): form = pollform() if form.validate_on_submit(): return render_template('details.html', form = form) return render_template('poll.html', form=form) but wanted have different url mapping details.html, purpose created route as, @app.route('/details/<form>') def details(): return render_template('details.html', form = form): for using have used return redirect(url_for('details', form=form)) in poll method inside if condition. , when tried access same detail.html , not able object. when tried replace form string, worked fine. please suggest mechanism access form object inside /details route ? edit i asking possible. @app.route('/poll', methods = ['get', 'post']) def poll(): form = pollform()