Posts

Showing posts from February, 2011

javascript - Fancybox Youtube issue -

having real issues using fancy box display youtube videos. i've followed instructions from: http://fancyapps.com/fancybox/ rather displaying youtube video in pop-out window on website it's supposed to, takes me direct youtube instead. can help? javascript/fancybox: <script type="text/javascript" src="fancybox/source/jquery.fancybox.pack.js"></script> <script type="text/javascript" src="fancybox/lib/jquery.mousewheel-3.0.6.pack.js</script> <link rel="stylesheet" href="fancybox/source/jquery.fancybox.css" type="text/css"media="screen" /> <script type="text/javascript"> $(document).ready(function() { $(".info").fancybox({ openeffect : 'elastic', closeeffect : 'fade', helpers : { media : {} } }); }); </script> html: <div class="view view-first"> <img

Stuck in while loop with BufferedReader-java -

i'm @ lose why isn't working. i've had similar loops before , they've worked fine. try{ text = new bufferedreader(new filereader(filename)); while ((lineoftext = text.readline()) != null){ stringtokenizer tokens = new stringtokenizer(lineoftext," , .;:\"&!?-_\n\t12345678910[]{}()@#$%^*/+-"); while (tokens.hasmoretokens()){ counttotalwordsindocument++; string word = tokens.nexttoken(); counttotalcharactersinallwords = counttotalcharactersinallwords + word.length(); } } text.close(); } catch (ioexception e) { system.out.println("file not found"); }

database - Migrating Stored Procedures with Flyway -

how should procedural database code stored procedures managed database migration tool flyway? unlike ddl not want see changes stored procedure stored within multiple database migration files. how can procedural code managed within single file under source control, take advantage of database migrations tool flyway? there no special construct in framework deal this. because haven't figured out way pleases me. update: repeatable scripts supported of flyway 4.0. see https://flywaydb.org/documentation/migration/repeatable

Incorrect rotations using openGL GLM and shaders -

Image
the goal of program display simple colored triangle rotating on y axis without translation. i'm using glm library. problem transformations of triangle not correct : has strange , not logical behaviour. here's c++ code plus vertex shader , fragment shader code : c++ code : float angle = 0.0f; struct vertex { float x, y, z; }; static vertex vertices[9] = { -1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f }; static vertex colors[9] = { 1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f }; [...] int main(int ac, char **av) { bool continuer = true; sdl_event event; gluint vboid[2]; gluint programid = 0; //sdl window initialization sdl_init(sdl_init_video); sdl_wm_setcaption("vbo tests",null); sdl_setvideomode(width, height, 32, sdl_opengl); //viewp

Modelling UML Class Diagram with a stack variable -

say have class a, , inside have class b. inside class a, have stack of class b's. how write notation out in uml diagram class a, , relationship between class , b? class may share composition relationship class b, whereas 1 many b. represent connecting 2 classes arrow in uml, having "1" in a's end, , "0...*" in b's end. check http://en.wikipedia.org/wiki/object_composition more details.

algorithm - Sorting Geographical non-contiguous line segments along an implied curve -

given: a set (for sake of discussion call s ), unordered collection of line segments . each line segment defined 2 longitude-latitude end-points. while of line segments follow implied curve, there "gaps" between each of segments, of various sizes. refer curve "implied" because not explicitly defined anywhere. information have available line segments contained within s . desired result: a sequence (for sake of discussion call r ), ordered collection of line segments . each line segment defined before, following same implied curve before sorted position along implied curve . context (i.e. "why in heck need this?"): basically have incomplete geographical data needs normalized , "completed" doing simple interpolation form complete curve no gaps. might ask "why not fit curve line segment end-points , done it?" -- well, that's not quite after. line segments precisely should located, , there no need final curve &qu

meteor - Uncaught TypeError on the server but works on the client -

when run this: var vtop=posts.findone({},{sort: {created_at:-1},reactive:false}).created_at; console.log(vtop); it comes error: "uncaught typeerror: cannot read property 'created_at' of undefined", when run posts.findone({},{sort: {created_at:-1},reactive:false}).created_at; on web console comes expected result. you need make sure subscriptions complete before call data. in meteor data sent on wire, when javascript/html sent down browser hasn't yet been told download data server. there 2 ways round this: if you've not yet reached stage you're using subscriptions app can use deps.autorun using deps deps.autorun(function() { var subscribed = session.equals("subscribed",true); if(!subscribed && posts.find().count()) { session.set("subscribed",true); var vtop = posts.findone({},{sort: {created_at:-1},reactive:false}).created_at; console.log(vtop) } or wait subsc

ruby - Time.now does not match the same Time as generated from Time.parse or Time.at -

while testing ruby code, ran strange behavior. can please explain why time.now doesn't match same time created either time.at or parsed time.parse ? [1] pry(main)> require 'time' => true [2] pry(main)> t = time.now => 2013-04-04 19:46:49 -0400 [3] pry(main)> = time.at t.to_i => 2013-04-04 19:46:49 -0400 [4] pry(main)> t == => false [5] pry(main)> t.to_i == i.to_i => true [6] pry(main)> p = time.parse t.to_s => 2013-04-04 19:46:49 -0400 [7] pry(main)> t == p => false [8] pry(main)> t.to_i == p.to_i => true [8] pry(main)> t.class => time [9] pry(main)> i.class => time [10] pry(main)> p.class => time [11] pry(main)> t.inspect => "2013-04-04 19:46:49 -0400" [12] pry(main)> i.inspect => "2013-04-04 19:46:49 -0400" [13] pry(main)> p.inspect => "2013-04-04 19:46:49 -0400" update 1 it seems trying sub-second precision shows same behavior: [1] pry(main)>

add on - World of Warcraft Lua - Changing frame:SetAttribute() -

i'm working on addon world of warcraft overhauls interface adapt play style. in addon, have large button acts "main dps rotation" mage. change spell casts based on optimal @ given time. doesn't cast spell automatically, presents next best option user. here code far: print "interface overhaul : loaded" heatingupisactive = false print(heatingupisactive) local button = createframe("button", "mybutton", uiparent,"secureactionbuttontemplate") button:setwidth(256) button:setheight(256) button:setframestrata("high") button:setpoint("left") button:settext("main rotation") button:registerforclicks("anyup") button:setattribute("type", "spell") button:setattribute("spell", "fireball") button:registerevent("unit_aura"); local function auragained(self, event, ...) if (unitaura("player", "heating up")) if

knockout.js - KO Template with Foreach If condition causing afterAdd not to fire -

in example below you'll see dosomething never fires. if remove if: comments templating binding dosomething fire expected. know happening cause this? occurs while using data attribute on template binding handler. i using knockout 2.2.1. jsfiddle http://jsfiddle.net/yadzx/2/ <div data-bind="template: { if: comments, name: 'comments' }"></div> <script type="tmpl" id="comments"> <div data-bind="foreach: { data: comments, afteradd: $root.dosomething }"> <div data-bind="text: name"></div> </div> </script> <script> var vm = { comments: ko.observablearray([{name:'hey'}]), dosomething: function (element, index, data) { $(element).addclass('wow'); } }; ko.applybindings(vm); vm.comments.push({name:'foo'}); vm.comments.push({name:'bar'}); </script> the if condition on template binding

php - laravel - dependency injection and the IoC Container -

i'm trying wrap head around dependency injection , ioc container , i'm using usercontroller example. i'm defining usercontroller depends on in constructor , binding objects using app::bind(). if i'm using input::get() facade/method/thing not taking advantage of request object injected it? should using following code instead, request object injected or doesinput::get() resolve same request instance? i'd use static facades not if resolve un-injected objects. $this->request->get('email'); dependency injection <?php app::bind('usercontroller', function() { $controller = new usercontroller( new response, app::make('request'), app::make('view'), app::make('validator'), app::make('hash'), new user ); return $controller; }); usercontroller <?php class usercontroller extends basecontroller { protected $response; protected $request; protected

android - Have a ListView load Views before they are scrolled into view -

i have listview uses custom arrayadapter inflate views. of these views need display images. in order keep listview hiccuping while scroll, have each view needs load bitmap on dedicated thread, , call ui thread when bitmap ready added imageview. this works great, problem layout bitmap added need expand hold bitmap, , instantaneous expansion looks jarring user. if there way load bitmap little earlier, before it's scrolled view, there chance loaded time scrolled view. question is: is there way extend boundaries of region listview uses determine when ask adapter view display? assume can go hack listview source, wanted avoid if possible. or, if have better suggestion, please let me know. use injustdecodebounds load size of image first in ui thread self , set size of image view accordingly start loading full image in thread

javascript - WCF data service not responding with json, only xml -

i trying consume data service function jquery ajax call, i've tried many ways of calling it, , setting service contract , data service, no matter keeps giving me xml. have heard people need use jsonp, necessary? [servicecontract] public interface iservice1 { [operationcontract] [webinvoke(method = "post", bodystyle = webmessagebodystyle.wrappedrequest, responseformat = webmessageformat.json)] string getdata(int value); [operationcontract] compositetype getdatausingdatacontract(compositetype composite); // todo: add service operations here } // use data contract illustrated in sample below add composite types service operations. [datacontract] public class compositetype { bool boolvalue = true; string stringvalue = "hello "; [datamember] public bool boolvalue { { return boolvalue; } set { boolvalue = value; } } [datamember] public string stringvalue { { return stri

java - Unable to access ArrayList object method -

i'm trying write program randomly picks 3 countries pool, outputs them string. these countries receive gold, silver, , bronze in order. method olympicresults add each string array. eventually, countries sorted number of gold, silver , bronze medals attained. i'm having trouble eventresult method - can't seem access methods country class, getname() - gives me cannot find symbol error. seemed work before when initialized arraylist in eventresult method, wouldn't work since new arraylist initialized every time method called. another problem preventing repeats of countries appearing in eventresult string - ideas of did wrong? code: public class olympicmedals { public static void main (string[] args) { string[] countries = {"can", "brb", "blr", "hkg", "chn", "swe"} arraylist<country> list = new arraylist<country>(); (int j=0; j<9; j++) //initialize countries { list

java - Why I am returning integers instead of characters in the 3rd and 4th print statement? -

can please explain what's going in last 2 print statements? that's lost. public class { public static void main(string[] args){ char whatever = '\u0041'; system.out.println( '\u0041'); //prints expected system.out.println(++whatever); //prints b expected system.out.println('\u0041' + 1); //prints 66 understand unicode of 1 adds //unicode representing 66 why returning integer when in previous statement returned char? system.out.println('\u0041' + 'a'); //prints 130 wanted show adding //integer unicode in previous print statement not implicit casting because //here add char not implicitly cast char on returned value } } this happens because of binary numeric promotion when operator applies binary numeric promotion pair of operands, each of must denote value convertible numeric type, following rules apply, in order, using widening conv

How to append the dragging LI element at the end of UL in Jquery sortable? -

in jquery sortable how can restrict behavior of draggable 'li', should append 'ul' @ end? <ul id="sortable1" class="connectedsortable"> <li class="ui-state-default">item 1</li> <li class="ui-state-default">item 2</li> <li class="ui-state-default">item 3</li> <li class="ui-state-default">item 4</li> <li class="ui-state-default">item 5</li> </ul> <ul id="sortable2" class="connectedsortable"> <li class="ui-state-highlight">item 1</li> <li class="ui-state-highlight">item 2</li> <li class="ui-state-highlight">item 3</li> <li class="ui-state-highlight">item 4</li> <li class="ui-state-highlight">item 5</li> </ul> <script> $(function() { $( "#sortable

android - What Does Intent.putExtra will do -

i new android , use intents transfer data 1 activity another. wanted know whether object reference or object copy sending second activity. intent.putextra sends copy of object not same reference when intent make new reference there

PHP, Two pages, option from one page shows one of three forms in the another page -

i trying find how 1 example made. there page , page b. page contains form. in form there radio buttons options, add, delete, , update... choosing add page , pressing submit, open page b.php form add shown. choosing delete in page a.php , submitting show same pageb.php delete form showing , not add. , on. question is, how done. have heard of multiple forms on same page , 1 filled out executed, cannot locate way above described done. help? when check pageb.php code below: if($button == "delete") { //your code delete } if($button == "add") { //your code add } and on.. as per form submisstion , values getting different code executied on pageb.php note: above code dummy only, explain how work flow be.

jquery - Loading finished before of execute all in web -

i have web page @ moment of submit, call image gif show using text of loading using jquery showloading plugin v1.0 image showed, when load page send action (same page). web leave of show image before finish load page. last page have code php execute function, image leave of show , , funciton no finished of execute. i want loading follow showing image until finish process any idea??? using jquery.ajax can set settings async attribute false. jquery.ajax({ ... async: false, ...}); // subsequent code wait 'til ajax call finishes hope helps cheers

visual c++ - ATL errors compiling 64-bit COM excel addin -

i have c++ atl com adding implements utility functions refer excel api: void dosomething(ccomptr<excel::range> &mastercell) { // ... ccomptr<excel::range> cell = mastercell->offset[vertical][horizontal]; // ... } when compiling excel addin x64 i'm getting lots of spurious errors such as: cannot convert 'excel::range' 'atl::ccomptr<t>' however, when compile win32 there no problem. helper utility functions not exposed excel udf's don't think this question applicable since function not have stdmethodimp part. any ideas? thanks in advance. ccomptr accepts interface template argument, while range dispinterface. need ccomptr<excel::irange> instead.

java - How is timezone EST different from EST5EDT? -

this question has answer here: joda time datetimezone 2 answers how different est est5edt ? isn't est take account dst? i wrote small java snippet figure out difference , output says est5edt takes in account dst while est not simpledateformat dateformat = new simpledateformat("yyyy-mmm-dd hh:mm:ss.sss"); dateformat.settimezone(timezone.gettimezone("est5edt")); system.out.println("est5edt" +dateformat.format(new date())); /* prints est5edt2013-apr-05 02:24:16.471 */ dateformat = new simpledateformat("yyyy-mmm-dd hh:mm:ss.sss"); dateformat.settimezone(timezone.gettimezone("est")); system.out.println("est "+dateformat.format(new date())); /*prints est 2013-apr-05 01:24:16.472 */ but below snippet produced shocking output system.out.println("est5edt offset "+timezone.gettimez

Wordpress 3.5.1: plugin for multiple author -

is there wp plugin assign single post many authors/users? after search found multiple authors after activate select authors single post & save manage user terms not normal user. for created special category , moved posts under category & showing authors. i used used co-authors plus plugin same.. see if find useful.. link : http://wordpress.org/extend/plugins/co-authors-plus/installation/ after add multiple authors using plugin. show like, posted "author 1" , "author 2".. very plugin active development.

jquery - Unable to upload large excel file with ajaxUpload() -

when trying import excel file using ajaxupload, small file able perform import. little larger excel file consisting of data close 2mb, below error. here ajaxupload() inside jsp: $.ajaxfileupload( { url:'pi/importpi.do?custnamefrmlist='+custnamefrmlist+'&nenamefrmlist='+nenamefrmlist+'&bindex='+bindex+'+&fullpath='+fullpath+'', type:"post", secureuri:false, fileelementid:'uploadfile', method:'post', //datatype: 'json', datatype: 'json', cache:false, async:false, success: function (data) { } apr 5, 2013 12:14:51 pm org.apache.catalina.c

sql - Splitting letters and number in SQLite -

i have 1 column containing letters , numbers (mix/random) 914103b01292ab21hrvh92665 i need split this 914103012922192665 -numbers babhrvh -letters thanks in advance! the simplest way in sqlite series of replace functions - so: select replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(the_string, '0', ''), '1', ''), '2', ''), '3', ''), '4', ''), '5', ''), '6', ''), '7', ''), '8', '&#

python - Can't make categories in my webpy blog, bad default value use, using browser direction bar input like alias -

i'm trying make categories in self-developed blog webpy try make : mywebpage.com/c/categoriename be input shows categorie (like alias ?¿?) urls = ( '/c/(.*)','index' ) then index class is: class index(object): def get(self,cat): seleccion = functions.categoria(db,cat) #seleccion = db.select('contenido',what="*",order="modificado desc") #print seleccion return render.index(seleccion.getthread(),cat) i have .py document helping functions: class categoria(object): def __init__(self,datab,nombre='frutas'): ''' selecciona y asigna una lista o diccionario con el contenido de la base de datos dispuesto en objetos de la clase noticias. ''' self.datab = datab #objeto database self.nombre = nombre #cadena con el nombre de la categoria self.n = self.getcat() #calculo del numero de la ca

iphone - provisioning profile name -

i have new app, , create profile developing. i weird mistake: provisioning profile 'vallabici' specifies application identifier 'com.ingeniasoluciones.vallabici' doesn't match current setting 'com.ingeniasoluciones.vallabici' it's same. tried cleaning project, still doesnt work. how can solved? its glich. occurs when upgrade xcode. how solved it. had close project , delete current provisioning profile , downloaded again. , added organizer , start project , cleaned , voilla run again.

css - change div color after scrolling 15% down with jquery -

i have jquery code below makes div scroll. change div color #32200f when down 15% top.then return original barckground when less 15% top. <script type="text/javascript"> $().ready(function() { var $scrollingdiv = $("#navbar"); $(window).scroll(function(){ $scrollingdiv .stop() .animate({"margintop": ($(window).scrolltop() + 0) + "px"}, "slow" ); }); }); </script> here css code of original background.i can make class make easier: #navbar { /* fallback web browsers don't support rgba */ background-color: rgb(0, 0, 0); background-color: rgba(50,32,15,0.5); /* ie 5.5 - 7*/ filter:progid:dximagetransform.microsoft.gradient(startcolorstr=#4c32200f, endcolorstr=#4f32200f); /* ie 8*/ -ms-filter: "progid:dximagetr

html - Jquery mobile - update button style -

if add items listview, you'll need call refresh() method on update styles , create nested lists added. example: $('#mylist').listview('refresh'); what code need if add buttons page , refresh style. this one: $('buttonid').button(); working example: http://jsfiddle.net/gajotres/m4rjz/ there's function called buttonmarkup() , used change styled button properties, example change button icon: $('buttonid').buttonmarkup({ icon: "star" }); read more in other article: jquery mobile: markup enhancement of dynamically added content and link official documentation .

javascript - Use iScroll to create a Picker with the snap-feature -

i'm trying create list looks , feels typical 'picker', means it's normal list fades out @ top , bottom, , there's mask overlay in middle. example the problem normal list starts first <li>-element on top while should in middle, , scrolling down the last element it's @ bottom while should in middle. to fix this, implemented padding . after scrolling down , up, padding isn't applied anymore. think has maxscrolly in source code. has ever tried this, or alternatives? here's code: var myscroll = new iscroll('hour-list-wrapper', { snap: "li", momentum: false, vscrollbar: false } ); http://jsfiddle.net/2kbdv/3 mobiscroll library make easier you, see demo here http://demo.mobiscroll.com/select/select if want create custom solution anyway can inspiration in source code.

visual studio 2010 - Resetting Toolbox -

i want bring toolbox original state, each time reset toolbox, devexpress controls come back. want devexpress controls available me choose, don't want controls added toolbox automatically, after click reset toolbox. ideas? what have tried deleting tbd files deleting 10.0 folder in appdata/roaming/microsoft/visualstudio if find devexpress entries in following registry location, delete , check resetting again if comes still. 64 bit : hkey_local_machine\software\wow6432node\microsoft\visualstudio\10.0\toolboxcontrolsinstaller

sql server 2008 - highlight particular row in Crystal Report based on column value C#.net -

how highlight particular row in crystal report based on column value c#.net after generate report want highlight records value in column (assume "status") values="ok" if there way using in c#.net in crstal report right click relevant field object want highlight , select "format field.." option. in border tab tick "background" check box , can enter condition select background color of field. script looks bellow. (comment: {user1.username} --> user1 table , username column.) if {user1.username}='ok' crgreen

how to break line in ruby on rails after X characters? -

i using code display headline if there one <%= @user.headline if @user.headline? %> i have limited 100 characters. how can break headline after 50 characters , display broken part below? planning have them centered in 2 lines. for example: if headline goes on 100 characters want display this display: if headline goes on 100 characters then i want display this you use word_wrap text helper: include actionview::helpers::texthelper # or in controller # helper :text word_wrap(@user.headline, :line_width => 50)

core location - iOS CoreLocation: Turn it off after position was found or let it run -

i build gps tracker takes current position every 20 seconds or if device rotates more xx °. now i'm not sure what's best solution saving battery energy: 1) stop corelocation service after got position , turn on if timer expires 2) don't turn off corelocation service while tracking so, turn service on , off consumes more battery power not turn off (during tracking)? you should turn off when not tracking. should not alternate between on , off while tracking. if interval 3-4x longer turn off in between.

ios - Navigationbar title and back button name are same? -

i created 1 title navigationbar in storyboard project ,but when moved next viewcontroller button shows same name previous navigationbar(main navigationbar) title.? can set separate title , button names? i tried following code not working ? why? self.navigationitem.title=@"recent books"; self.navigationitem.backbarbuttonitem.title=@"back"; according uinavigationitem class reference "when navigation item below top item in stack, navigation controller derives button navigation bar navigation item. [...] if want specify custom image or title button, can assign custom bar button item (with custom title or image) property instead." so try in first vc pushing other vc self.navigationitem.title=@"recent books"; uibarbuttonitem *backbutton = [[uibarbuttonitem alloc] initwithtitle:@"back" style:uibarbuttonitemstyleplain

SuspensionManager Error when application has more than 1 page in windows 8 XAML/C# app -

i'm writing windows 8 xaml/c# app , have little problem session manager. within app.xaml.cs onsuspending method looks this: private async void onsuspending(object sender, suspendingeventargs e) { var deferral = e.suspendingoperation.getdeferral(); //todo: save application state , stop background activity await suspensionmanager.saveasync(); deferral.complete(); } i have registed rootframe suspensionmanager in onlaunched method in app.xaml.cs: suspensionmanager.registerframe(rootframe, "appframe"); so, in first page of app have overriden savestate method. looks this: protected override void savestate(dictionary<string, object> pagestate) { save(true); base.savestate(pagestate); } when application suspended method called , works fine. i have 2nd page savestate method same first (so above). when navigate 2nd page 1st page , suspend application neither of savestate methods cal

android - LazyList set item height -

i using listview lazyadapter , need change item row height, seems little more tricky. here adapter: public class albumdetailsadapter extends baseadapter { private activity activity; private arraylist<songs> data; private static layoutinflater inflater = null; private mediaplayer mediaplayer; public albumdetailsadapter(activity a, arraylist<songs> products) { activity = a; mediaplayer = new mediaplayer(); data = products; inflater = (layoutinflater) activity .getsystemservice(context.layout_inflater_service); } public int getcount() { return data.size(); } public object getitem(int position) { return position; } public long getitemid(int position) { return position; } public view getview(final int position, view convertview, viewgroup parent) { view vi = convertview; if (convertview == null) vi = inflater.inflate

java - XML parsing. How can I get child's child? -

i'm trying parse xml in java: <entities> <entity name="product_section" id="1"> <product_type>3</product_type> <section_type>1</section_type> <name>empresa</name> <description>d</description> <position>1</position> <align>left</align> <files section_id="1"> <ico id="ico_1" type="normal" src="sections/1/icons/ico.png"></ico> <ico id="ico_2" type="hover" src="sections/1/icons/ico.png"></ico> <ico id="ico_3" type="active" src="sections/1/icons/ico.png"></ico> <img id="img_1" type="normal" src="sections/1/img/pestanya.png"></img> <img id="img_2" type="hover" src="sections/1/img/pestanya-hover.png&qu

objective c - Problems when setting up Frank for iOS -

i have problem setting frank in ios project. following instructions , executing in console: sudo gem install frank-cucumber -v what is: error: error installing frank-cucumber: activesupport requires i18n (= 0.6.1, runtime) i have no idea may wrong. checked gems using: gem list --local and got: i18n (0.6.4) do know may wrong? every answer! looks there's version mismatch between activesupport requires , have installed. i try gem update , see if helps.

crontab - Deleting individual cron jobs using PHP -

i have php script sets cron job once data inserted sql database: <? $output = shell_exec('crontab -l'); file_put_contents('/tmp/crontab.txt', $output.'* * * * * /usr/local/bin/php /home/dldl1330/public_html/new/mailchimp.php'.php_eol); echo exec('crontab /tmp/crontab.txt'); ?> this cron job executes script syncs sql db mailchimp. in mailchimp php script deletes cron tab: echo exec('crontab -r'); once happens loose jobs in cron tab (and removes email gets emailed after every cron job), how can make above line deletes /home/dldl1330/public_html/new/mailchimp.php cron job? i used above advise , came solution, not sure how efficient or correct is.... welcome comments. note: //find string section in there debugging/learning purposes <?php //get contents of cron tab $output = shell_exec('crontab -l'); echo "<pre>$output</pre>"; //find string $cronjob = ('* * * * * /usr/local/bin/php

user interface - VisualStateManager applys in Visual Studio, but not in the app -

i've got view looks this: http://www.imgbox.de/users/public/images/w3pituctow.png as can see, it's standard design. when click in visual studio @ 'snapped', looks this: www.imgbox.de/users/public/images/8fw93piwbt.png as can see, second grid "west" below left grid "ost". the problem is, won't work when start app (it keeps standard) (don't irritated top bar...) http://www.imgbox.de/users/public/images/c6aytknjjo.png problem solved. has in code-behind: public mainpage() { this.initializecomponent(); window.current.sizechanged += current_sizechanged; } void current_sizechanged(object sender, windows.ui.core.windowsizechangedeventargs e) { visualstatemanager.gotostate(this, applicationview.value.tostring(), true); }

regex - find an import in code with regular expression -

Image
i have import error somewhere in code can't find it. can use search function in editor (sublime text) search regular expression in files inside project. search terms 'import' , 'views' in between or before / after, want match line contains these 2 words. i'm not familiar 'sublime text', following regex works in 'notepad++': (.*)(import)(.*)(views)(.*) now, in line matched, $1 , $2 , $3 , $4 , $5 may used refer text before "import", "import", text between "import" , "views", "views" , text after "views" respectively. edit - 1 it works 'sublime text' well. for example, text, asdf1234 ..import.fghj4567 views...hjkl7890 find (as above): (.*)(import)(.*)(views)(.*) replace with: $2, $4, $5, $3, $1 result: import, views, ...hjkl7890, .fghj4567 , asdf1234 .. for text, asdf1234 views fghj4567 import hjkl7890 find (as above): (.*)(views)

database - kohana auth module with multiple user types -

is there way use auth module in kohana work 3 different users tables? or maybe better have 1 user table 'users' , have different profiles tables theese 3 kind of users? problem different users have vave different fields in table, authentification needs done on different criteria (fields). please advice how model such scenario. (kingkero right) should extend kohana_auth or kohana_auth_orm , override methods need..

USB OTG interface on Zedboard -

i working on zynq based zedboard designed avnet. want use usb functionality of zedboard. want write c code on processor access data attached device (e.g. camera). drivers available given xilinx. can me out in c code? how use these functions. int xusbps_epbuffersend(xusbps instanceptr, u8 epnum, const u8 bufferptr, u32 bufferlen); int xusbps_epbufferreceive(xusbps instanceptr, u8 epnum, u8 bufferptr, u32 bufferlenptr, u32 handle); i not understand how set value epnum & handle.

java - Running script files and use of Css files with Spring MVC? -

i'm developing spring mvc application , have login page (login.jsp) should call scripts , link css files . problem applications doesn't run scripts . here files ; web.xml <servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>*.css</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>/ressources/js/*</url-pattern> </servlet-mapping> my mvc dispatcher spring file : <mvc:resources mapping="/resources/**" location="/ressources/" /> <mvc:resources mapping="/scripts/**" location="/ressources/js/" /> <bean class="org.springframework.web.servlet.mvc.annotation.annotationmethodhandleradapter" /> <bean class="org.springframework.web.servlet.mvc.annotation.defaultannotationhandlermapping"> </bean>

android - how to apply zoom in/out functionality for Image view on button click? -

i new android , have create 1 android application shows images server. want apply zoom effects on button click. have 2 buttons 1 zoom in , form zoom out. want apply zoom in or out on click of related button click. searched lot did not find thing related specific case. have far implemented imageview.ontouchlisterner() zoom effects don't want want zoom on button click please me. thank in advance. a simple technique used such purpose, make webview , load image using url webview on image clicked this: webview web=(webview)findviewbyid(r.id.web); mprogress = progressdialog.show(this, "please wait!", "loading image , zoom controlls..."); web.getsettings().setloadwithoverviewmode(true); web.getsettings().setusewideviewport(true); web.getsettings().setbuiltinzoomcontrols(true); websettings settings = web.getsettings(); settings.setjavascriptenabled(true); string url=getintent().getextras().getstring("imageurl");

sql - Deleting from SQLite table -

i running following command delete tuple table in sqlite error delete students s s.name="smith" i sure there entry named smith, , sure there column named "name". here error message: sqlitemanager: sql syntax error: delete students s s.name="smith" [ near "s": syntax error ] exception name: ns_error_failure exception message: component returned failure code: 0x80004005 (ns_error_failure) [mozistorageconnection.createstatement] i think renaming table:"students s", cannot find solution. can help? thanks in sql delimit strings single, not double quotes. in addition, not alias tables in delete statements in way did: delete students name='smith' if must use alias, syntax should work: delete s students s s.name='smith'

php - MySQL exact word existence check in a table Field -

i've query. there built-in function or other method associated mysql, return rows contains exact word in database table field? i'm aware mysql operator, can search specified pattern in column match string value against pattern string containing wild-card characters. mysql clause, it'll return substring entries too. eg. suppose 3 column values below: 1. "take shot of courage" 2. "the end of age not yet" 3. "employers can obtain wage rate submitting request" i want retrieve rows in column value contains exact word 'age' if prepare query select * sometable somefield '%age%' it'll return 3 rows. intention second row. how achieve this? in advance. cheers, jenson. use query select * sometable somefield '% age %' or somefield 'age %' or somefield '% age'

c# - dropdownlist in header template of repeater not working -

i have set think correct markup , code behind put dropdownlist in header template of repeater, yet reason, it's not working correctly. see dropdown list, when make selection in list, onselectedindexchanged event not seem trigger use of method added handle , can't figure out i'm missing, thought straightforward thing. here essentials of markup: <asp:repeater id="repnewsitems" runat="server"> <headertemplate> <asp:dropdownlist id="dddatesortcategories" runat="server" width="200" autopostback="true" onselectedindexchanged="dddatesortcategories_selectedindexchanged1" cssclass="mergersdropdown"> <asp:listitem selected="true" text="most recent" value="newest"></asp:listitem> <asp:listitem text="oldest" value="oldest"></asp:listitem> </asp:dropdownlist> <

c# - Serialize run-time created type -

i have created type system.reflection.emit following msdn doc i create type , instance code : //following tutorial created method returns dynamic type type mydynamictype = createnewobject("mydynamictype", fields); var instance = activator.createinstance(mydynamictype); now want seralize object xmlserializer tried : filestream fs = new filestream(@"c:\test\serializeddynamic.xml", filemode.create); xmlserializer xs = new xmlserializer(typeof(object)); xs.serialize(fs, instance); but throws exception : "the type mydynamictype not expected. use xmlinclude or soapinclude attribute specify types not known statically." any ? expanding on comment: i think issue you're creating xmlserializer typeof(object) . if use either of following should work: xmlserializer xs = new xmlserializer(mydynamictype); xmlserializer xs = new xmlserializer(instance.gettype());

java - Multiple queries in different methods Twitter4j Processing -

i trying execute separate queries in different methods, code below not actual code example of error, have twitter twitter = new twitterfactory(cb.build()).getinstance(); called in both methods, error illegalstateexception: cannot use builder longer, build() has been called if make global same error, me being stupid cant work out, iv been staring @ long now. here code: configurationbuilder cb = new configurationbuilder(); double lat = 51.5171; double lon = 0.1062; double res = 37; string resunit = "mi"; public void setup(){ cb.setoauthconsumerkey("xxxxxxxxxxxxxxxxxxxxxx"); cb.setoauthconsumersecret("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); cb.setoauthaccesstoken("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); cb.setoauthaccesstokensecret("xxxxxxxxxxxxxxxxxxxxxxxxxxxx"); querylon(); querybir(); } void querylon(){ try { twitter twitter = new twitterfactory(cb.build()).getinstance(); (int j = 0; j