Posts

Showing posts from April, 2013

javascript - jQuery get link id -

i'm trying id-attribute of dynamic generated table. if click on first link want "editemploee-4". <table id="example" class="table span12 table-bordered table-hover"> <thead> <tr> <th>firstname</th> <th>lastname</th> <th>edit</th> </tr> </thead> <tbody> <tr> <td>person 1</td> <td>name person 1</td> <td><a href="#" class = "editdialog" id="editemployee-4"><img src="img/edit.png" height="20" /></a></td> </tr> <tr> <td>person 2</td> <td>name person 2</td> <td><a href="#" class = "editdialog" id="editemployee-5"><img src="img/edit.png" height="20" />...

asp.net mvc - Include script in orchard cms partiall view? -

i have partial view in orchard cms have include, problem when include using script page not loading? here partilla view called list-projectionwidget.cshtml @using orchard.mvc.html; @using orchard.ui.resources; @using (script.head()) { <style type="text/css"> .featureslider li { height:@(model.group.groupheight)px; width:@(model.group.groupwidth)px; background-color:@(backgroundcolor); } .featureslider li h2, .featureslider li h3, .featureslider li h2 a, .featureslider l1 p.slidenumbers { color:@(foregroundcolor) !important; } .featureslider li span { width:@(model.group.imagewidth)px; height:@(model.group.imageheight)px; } .featureslider li span img, .featureslider li span img { width:@(model.group.imagewidth)px; height:@(model.group.imageheight)px; } div#slidenav a.activeslide { background-color: @(foregroundcolor); } .featureslider li p { position: relative; top:@(model.group.groupheight - 25)px; } ...

NHibernate Save Is Trying to Clear Child KeyColumn Id On Update -

i trying create parent object has multiple children in 1 many relationship. not referencing parent object on child object, instead mapping keycolumn field. when try save object first time, works expected without issues (cascading id's , children). when try object database, update properties on , re-save again, fails. actual error message getting "could not delete collection". the error above due fact trying set "parentid" field on child objects null (which violates fk constraint have in db). if remove constraint db, end result want; however, not want perform update (setting parent id null) @ , i'm not sure why is. can tell in sql code generating , sending db, else appears correct , work if wasnt last update statement. obviously, must have wrong mapping cannot figure out what. tried adding not.keyupdate() made not generate key @ all. have ideas doing wrong?? thanks in advance, appreciate it!!! please see below mapping: public class parent ...

algorithm - What is your favorite phrase, saying, or quote expressed as code? -

do not explicitly state saying, in comments or otherwise. code should express itself! for example: for (person person : people) { if (!housetypeenum.glass_house.equals(person.getresidence().gethousetype())){ throw new stonesexception(); } } this simple expression compact know... 2b || !2b or regex /(bb|[^b]{2})/

javascript - CKEditor Stylesheet in document -

we offering our customers html editor adjust email templates. email templates have custom stylesheet @ top. something linke this: <style type="text/css"> div, p, a, li, td { -webkit-text-size-adjust:none; text-decoration:none;} @font-face {font-family: 'elegible_nova_rgbold_italic';src: url('http://sub.example.com/mailing/defaultfiles/elegiblenova-boldit-webfont.eot');src: url('http://sub.example.com/mailing/defaultfiles/elegiblenova-boldit-webfont.eot?#iefix') format('embedded-opentype'),url('http://sub.example.com/mailing/defaultfiles/elegiblenova-boldit-webfont.woff') format('woff'),url('http://sub.example.com/mailing/defaultfiles/elegiblenova-boldit-webfont.ttf') format('truetype');font-weight: normal;font-style: normal;} </style> however, when loaded ckeditor css isn't in source of document. how can make sure css in "text area" , outputted well? i'm using creditor 3...

visual studio - DSFML building error (VisualD) -

Image
and @ first, sorry bad english. first project in d. , first project sfml (dsfml of course). i use dub making visual studio project (i use vs2010). open , set project settings: general compiler linker autocomplete works correctly: when try build project, here error: error 42: symbol undefined _d5dsfml8graphics12__moduleinfoz how can resolve it? this particular error saying can't find actual d code library. mean dub isn't grabbing/linking source somewhere, i've never used dub ide can't sure. my suggestion figure out going wrong , fix issue bug maintainer (who me, actually) on github opening issue lack of tutorials ide's available d right now. if want started dsfml right now, however, can sort of follow along command line tutorial , use basis of figuring out libraries need linked in, set import search paths, etc.

javascript - Filling a form in an Angular.js app using PhantomJS -

i want test angularjs application using phantomjs. first step fill login form username field (let's assume there no other fields). (in real browser) field controlled angular (it has ng-model attribute) , whole form has ng-submit attribute. so in phantomjs script do input username page.evaluate(function () { document.getelementsbyname('username')[0].value = 'tester'; }); take screenshot , see 'tester' present in input page.render('myfile.jpg'); click on submit button: page.evaluate(function () { document.getelementbyid('go').click(); }); take screenshot. what see happens button gets clicked, message displayed says value of username empty. guess model not updated. tried set these values using jquery - same result. how correctly input values fields controlled angular? phantomjs provides sendevent function can used implement rudimentary sendkeys , need focus on element first: function sendkeys(page...

html5- mp4 video is not supported in all browsers -

mp4 format not supported browsers when using video tag of html5. googled problem , came conclusion have convert video other formats .ogg .webm etc run video in browsers or use plugins. question if convert 1 video 3 others formats occupy more space on server , have huge data on website , isn't ridiculous solution convert 1 video 3 other formats. solution problem. have idea this. try reduce video frames bit rate,otherwise can't. per our clients requirement, need video play in browsers, we've need convert formats. otherwise compatibility not perfect. i've worked html5 videos , audios files in many projects. whether important compatibility. in video: we have include video , audio formats as,".mp4,.webm,.ogg,.ogv" <video width="480" height="300" controls="controls" preload="auto" poster="path-to-poster.jpg"> <source src="path-to-mp4.mp4" type="video/mp4" /> ...

javascript - Tab-off ui-bootstrap typeahead only when row is explicitly selected -

i've created jsbin demonstrate issue i'm having. if go here, try type "five" , move on. natural reaction type "five" , press tab, , if wanted "five-hundred," you'd arrow-down once; however, in case, have type "five" , either press escape or physically mouse out of box without clicking of other options so, basically, when you're using typeahead, if there @ least 1 matching result current criteria, pressing tab select it. expected behavior type, current selected option you're typing, , if want 1 of other results must down-arrow 1 or more times. here code that's in jsbin: <div ng-controller="testcontroller"> <div> {{selected}} </div> <input type="text" ng-model="selected" typeahead="item item in typeaheadoptions | filter:$viewvalue"> </div> and javascript: var app = angular.module('app', ['ui.bootstrap']) .contro...

c++ - How to induce some template classes being united by one template? -

i have template classes. united 1 namespace, , depends on each other's template parameter. that point using #define t instead of template, , use in classes, client classes may want create such pairs different t, why want use templates. but if create 2 separated classes own separated templates, have chance client make mistake , put different values there. so, avoid it, if possible, make set t once pair of such classes , use both classes it's value. i create (just imagine): template<int t> namespace sample { struct { char _data[t]; } struct b { void get(a& a) { memcpy(b, a._data, t); } char b[t]; } } so, there separated classes, if 1 has parameter t = 50, other have work same parameter. best solution - template namespace, c++ has no template namespaces. is possible make somehow? maybe need pattern? i don't want add like: char x1[t1 - t2 + 1]; char x2[t2 - t1 + 1]; insi...

Glass XE17.1 - tap on "ok glass" menu with custom voice command is broken -

i used create 1 voice trigger prompts user speak additional commands before starting activity or service, like: ok glass +-david ++-find me parking lot ++-show me stock chart in xe17 or version(xe16.2), either using voice command or tap on "ok glass" menu shows list(vertical list voice) or list of command cards (horizontal menu), in xe17.1 update, when tap on 'ok glass', hangs , no menu cards shows up, ok glass launcher, no other default voice triggers cards, after short debug, found it's same voice trigger "android:resource="@xml/voice_trigger" declare in androidmenifest.xml caused issue, voice command still works, help? thanks! ps. , also, im trying input prompt 2 more prompt won't work. <input prompt="@string/glass_voice_prompt"/> my code (gdk api19, rev.5) <> androidmanifest.xml <uses-permission android:name="com.google.android.glass.permission.development"/> <activity android:...

java - Sorting through an ArrayList of objects by an object's given constructor value -

Image
the focus of question pertains takeinventory() method. you can assume inventorydemo 's main() method functional (aside implementation of takeinventory() method). if desire, may find other classes here . the objective of takeinventory() method sort through list , , report integer value of each unique instance of product types. this differentiated exclusively name: product( name , cost) ). product s of name should grouped (regardless of cost). the output should report this: i assume there method of sorting data more effective current approach. however, not know of one. import java.util.*; public class inventorydemo { public static void main(string [] args) { arraylist<product> list = new arraylist<product>(); list.add(new car("jaguar", 1000000)); list.add(new car("neon", 17000)); list.add(new tool("jigsaw", 149.18)); list.add(new car("jaguar", 110000)); ...

javascript - AngularJS/Flash (how to embed flash video in angular html partial) -

i have been going around in circles trying embed flash game in angular html partial - have game loading without errors, except when right click on blank flash screen, says "movie not loaded." have used https://github.com/pleasurazy/angularjs-media , trying directive made on github (having trouble finding link right now). github page can't find used swfobject - angularjs-media doesn't seem need that. if please me flash video embedded onto angular html partial - appreciate it...thanks! let me know if want see code! per comments in question. http://plnkr.co/edit/sqzjv8tkvvxh50hy7eid?p=preview

validation - Rails & Primary Keys / Uniqueness. How do you use multiple columns for a primary key? -

my question quite identical 1 ( multicolumn primary keys in rails ) i'm still not understanding 100%. let's have model visit visits id room_id date created_at updated_at in case, want (room_id, date) 'primary key'. now, post saying don't need change primary key, jus add uniqueness validations , stuff? so need add_index :visits, [:room_id, :date] or add_index :visits, [:id, :room_id] add_index :visits, [:id, :date] ? tie each column want in 'primary key' :id latter code, or put desired columns []'s former code. also, how do validations? don't want either of :room_id or :date unique, combination. how do in rails? according previous question, right 1 is: add_index :visits, [:room_id, :date], :unique => true this piece of code prevents database inserting room_id same date . in terms of model validation, need add: validates_uniqueness_of :date, :scope => :room_id this way, activerecord...

android - Why is my button creating a white screen? -

ok i'm running tabhost app webview on each tab, each webview url ends ?id= , on tab 5 have textview , button when user types in value saves , loads value @ end of ?id=, when press button opens blank white screen , makes tab host disappear instead of reloading of tabs new webview url. why opening new blank white screen? tab 5, text view , button public class tab5 extends activity{ protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.tab5); button btngo; btngo = (button) findviewbyid(r.id.button1); final edittext edit = (edittext) findviewbyid(r.id.edittext1); btngo.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { intent intent = new intent(tab5.this, tab1.class); intent.putextra("com.sideresult.outputapps.name", edit.gettext().tostring()); startactivity(intent); } ...

php - How do i send a 2d array with ajax? -

i trying send 2d array receive database (sql, phpmyadmin) ajax. my ajax function looks this: (it generated in php) $.ajax({ type: \"post\", url: \"resultquizget.php\", data: \"getanswer=\"+question+\"\", //question int variable success: function(msg) { alert(\"data saved: \" + msg); } }); my resultquizget.php file like $sql = "select `quiz`.question,`quiz`.rightanswer `quiz` `quiz`.quizid=:qid"; $stmt = $dbh->prepare($sql); $stmt->bindparam(":qid", $_post['quiz']); $stmt->execute(); $resultsquiz = $stmt->fetchall(); echo ... what have receive 2d array instead of normal string. what msg variable 2d array equal $resultsquiz modify php follows, output data json formatted string: $sql = "select `quiz`.question,`quiz`.rightanswer `quiz` `quiz`.quizid=:qid"; $stmt = $dbh->prepare($sql); $stmt->bind...

asp.net mvc 3 - How can I get my ViewContext.ViewBag to work with my code? -

i’m trying create htmlhelper allow me communicate across parent , child views. got tutorial here: https://gist.github.com/primaryobjects/8442193 . first created class , method this: namespace schoolin.helpers { public static class viewbaghelpers { public static dynamic getpageviewbag(this htmlhelper html) { if (html == null || html.viewcontext == null) //this means page root or parial view { return html.viewdata; } controllerbase controller = html.viewcontext.controller; while (controller.controllercontext.ischildaction) //traverse hierachy root controller { controller = controller.controllercontext.parentactionviewcontext.controller; } return controller.viewbag; } } } in child view add using statement: @using schoolin.helpers and @{html.getpageviewbag().pagetitle = "my custom property readable parent view"; } in p...

javascript - recounting var when i delete characters -

i have script remove "disabled" attr of button when 2 vars has 3 , 5 characters respectively. but when deleted characters doesnt count back, , add again "disabled" attr button. dont know how it. suggestions ? fiddle: http://jsfiddle.net/ccwkp/ html <form action="" method="" class="login"> <ul class="userlogin"> <li> <input type="text" placeholder="e-mail" class="user" /> </li> <li> <input type="password" placeholder="senha" class="pass" /> </li> </ul> <button disabled />test</button> </form> js $(function () { var user = 0; var pass = 0; function userpassalert() { if (user >= 3 && pass >=5) { $('button').removeclass('disabled').addclass('availab...

java 8 - SNIMatcher not returning correct certificate -

i have server , i've added snimatcher based on example http://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/jsserefguide.html#sniexamples sslserversocket sslserversocket = ...; snimatcher matcher = snihostname.createsnimatcher("www\\.example\\.(com|org)"); collection<snimatcher> matchers = new arraylist<>(1); matchers.add(matcher); sslparameters params = sslserversocket.getsslparameters(); params.setsnimatchers(matchers); sslserversocket.setsslparameters(params); i've added example.com , example.org in hosts file 127.0.0.1 when go example.com , example.org both same localhost certificate (i've created separate certificate example.org) my question what's correct way attach snimatcher do need create separate matcher each virtual host has own certificate? (i did got illegalargumentexception because both hosts had same type 0 (standardconstants.sni_host_name) http://docs.oracle.com/javase/8/docs/api/javax/net/ssl/sslpa...

javascript - Can we set a CSS animation to happen after the previous child element animated? -

imagine have ten li element under same ul element. want do, slide in effect. currently, can css animation, if want animation happen in sequence, doesn't seem have obvious way it. i open javascript hybrid solution lone it's relatively fast (for smart phones). thanks! i suggest recursive function. i'll use jquery this. in code animation adding margin left. can edit animation preference <html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> </head> <body> <ul> <li id="li-1">list item 1</li> <li id="li-2">list item 2</li> <li id="li-3">list item 3</li> <li id="li-4">list item 4</li> <li id="li-5">list item 5</li> <li id="li-6">list item 6</li> <li id="li-7"...

javascript - IAB HTML5 CSS3 banners delivery specs -

i developing animated banners using jquery , such. cliënt wants distribute banners according iab standards resellers (hundreds). problem is, can not find standard delivery specs are. don't think code , files included in reseller site, because e.g. jquery versions might conflict. doubt iframe should used. in other words, have no clue , google returns no solid answer. does know how should work, how setup files , how embed? thanks in advance! iab umbrella standard , 2 main studio publish rich media html banners google's doubleclick , sizmek. should develop banners 1 of specs , can publish website want. following link give specification sizmek: https://support.sizmek.com/hc/en-us/articles/202732315-html5-formats-and-features and following doubleclick: https://support.google.com/richmedia/answer/2672545?hl=en&ref_topic=2672541&vid=1-635803329575855222-3463806884 in question wrote used jquery , don't know if website version allows or not. from...

ios - Can't sent detail in destinationViewController -

i want send detail in destinationviewcontroller. [segue.destinationviewcontroller setdetail:item]; http://2.firepic.org/2/images/2014-05/17/x2pu26iznie1.png but error: http://2.firepic.org/2/images/2014-05/17/obg25xfg6be6.png what should fix it? because detail view controller wrapped in navigation controller , aren't navigating through relationship set detail item. consider whether want using navigation controller , modal - why aren't pushing detail view controller? if want keep nav controller use topviewcontroller real detail controller.

How to separate and store elements from a string in c? -

i have open .txt file. suppose content of file is: 08123, (12/10/2010,m), (01/09/1990,d) i want store in different parameters of string 08123 , "12/10/2010" , 'm' , example: int code = 08123; char date[10] = '12/10/2010'; char day = 'm'; also, last argument finishes ) . how can iterate until line ends? #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct date { char date[11];//+1 '\0'. char day; } date; typedef struct rec { int code; int dc;//number of date date *dates; } record; record *parse_rec(char *line){ static const char *sep = ", "; static const int seplen = 2;//strlen(sep); record *rec = malloc(sizeof(*rec)); if(rec){ int i, count = 0; char *p; for(p=strstr(line, sep);p;p = strstr(p+seplen, sep)){ ++count; } rec->dc = count; rec->dates = malloc(count*sizeof(date)...

css - Align 2 sections next to each other in responsive -

Image
i want align 2 sections next each other. 1 has text(heading) , text changing in length. 1 more section has image. my issue when make screen size smaller, second section coming down. tried display:table-row; display:table; display:table-cell; nothing helps. second div still comes down. please help. -thanks in advance. this code: html <h2><span>be prepared prepared</span><img src="http://localhost/safesteps/wp-content/uploads/2014/04/before_bg_r.png" alt="before_bg_r"/></h2> css .inner_berfore h2{ display:table-row; border-top: 4px solid #767676; position: relative; float:left; width:98%; } .inner_berfore h2 span{ background:#767676; display:table-cell; font-family: 'arial-black'; text-transform:uppercase; padding-left:16px; font-size:22px; line-height:40px; color:#fff; float:left; } .inner_berfore h2 img{ display:table-cell; float:left; h...

php - PHPmyadmin error on site -

without changes, received following error while wanting access our mysql dbase via phpmyadmin: warning: unknown: open(/var/lib/php/session/sess_8i4gv03ka359ktq4tp4h81oufs638cig, o_rdwr) failed: read-only file system (30) in unknown on line 0 warning: unknown: failed write session data (files). please verify current setting of session.save_path correct (/var/lib/php/session) in unknown on line 0 does know why happened & how can solve ? thx bart your problem sessions directory not writable web server. disables ability create sessions. first check directory /var/lib/php/session/ exists. if so, check if it's on writable medium. because message read-only file system makes me little unsure. then make directory /var/lib/php/session/ , current contents writable web server. try chowning directory user runs web server. or (easier, bit less secure) chmod 777 /var/lib/php/session followed chmod 666 /var/lib/php/session/*

ruby on rails - link_to helper method not working with friendlyId Gem in production -

it's strange works on dev environment when deploy continues link product id. i using rails 4.04 , friendlyid v5 gem. on development when this: <%= link_to image_tag(product.photos.first.image.url(:feed)), product %> it generates picture link looks this: http://localhost:3000/products/my-product-slug but when deploy production same code generates http://myprodserver.com/products/68 why happening? as discussed you, problem explicitly generating slug field in model. though have correctly configured friendlyid in model - in production, there still many products slug field may not have value. need generate slugs them before can access route correctly (as intended). i take slug generation part in sort of callback. so, in production, can do: product.find_each(&:save) create slugs. friendlyid should work perfectly! :) good luck. :)

java - Garbage collection: Initial marking and concurrent marking -

for concurrent-mark-sweep garbage collector in java; i'm not clear different between these 2 phases. why concurrent marking needed ? did initial marking not find live objects ? cms used, called 3-color marking algorithm marking live objects. white - unmarked gray - object marked, outbound references not processed black - object marked , outbound references processed marking starts graying out objects reachable roots , , considered finished when no more gray objects available. concurrent marking in cms marking in old space only . references outside of old space root references . they are local variables available thread stacks references young space old as old space suitable concurrent marking, stacks , young space should precessed in stop-the-world fashion. constitutes initial-mark phase of cms. once initial-mark finish cms have number of grayed objects in old space start concurrent marking. during concurrent marking black objects may revert gray...

javascript - JQM 1.4.2 Adding template from ajax to popup not rendering -

im getting template php file via .get can't inputs or list view render properly. when append html directly within js file render think has how data template being returned. thanks in advanced. js $(document).ready(function() { $('#addoffice, #adddoctor').on('click', function() { var $popup = $("<div/>").popup({ dismissible : false, theme : "b", overlaytheme : "b", transition : "pop" }).on("popupafterclose", function() { $(this).remove(); }).css({ 'width': '400px', 'padding': '10px' }); $.get('../templates/'+$(this).attr('id')+'.php', function(data){ $(data).appendto($popup); }); $popup.popup('open').trigger("create"); }); }); php template <form id="doctoradd"> <div class="ui-field-contain"> <lab...

streamreader - Starting project in same solution with buttonClickEvent/Closing current c# -

what want achieve this: have solution 3 projects inside. i've added these projects explorer folder, solution explorer , made reference projecta projectb & projectc. now want this, when click button on form of projecta (the first project user sees when opens exe) this: private void projectbbutton_click(object sender, eventargs e) { this.hide(); projectb.form1 li = new projectb.form1 (); li.show(); } that projectb form opens up. this works problem other project hidden. possible add here projecta closed , projectb starts indepently. paths etc declared in projectb forms this: inputstream = file.opentext("gevaar17.txt"); are still valid. (because filenotfoundexeption since it's looking in debug folder of projecta). , when search textfile in projectb form1 example doesn't go looking in projecta/bin/debug folder textfile. goes looking in debug folder of projectb? thanks in advance. private ...

swing - How to add Transitions (Fade, dissolve etc ) in Java GUI -

i trying make game semester project. want show transition when user clicks on options button of game menu or when user clicks on credits button. want show transition when 1 panel replaces another. possible? using java swing library. you should use cardlayout swap views (jpanels) in gui. fade effect not simple thing do, can done little work. i've done here create special class called swappingimgpanel extends jpanel, , fades 1 image using swing timer. specifically, program this: the program adds swapping components cardlayout using jpanel. it adds single swappingimgpanel, jpanel created draw 2 images, 1 of component fading out, , 1 of component fading in. when swap components, create images of 2 components, 1 visible, , 1 next visible. you send images swappingimgpanel instance you call swap() on swappingimgpanel instance. the swappingimgpanel draw both images uses swing timer change graphic object's composite value. causes image partially visible. when swa...

javascript - Opening a page from DOM in current tab -

on button click php function called use file_get_html() simple html dom parser edit form in html file. want replace current page edited dom . tried using javascript, document.write , window.open in various ways eitherappends new page current page or nothing happens. you can use javascript document.body.innerhtml = 'your html'; if want change content of page, or location.href = 'some.url'; if want open new url in same page

javascript - Jquery removeClass() on click -

hi have problem: want click on div flipped (this work) next step flipp div on click on "x" (this problem). html code: <div class="col-md-4"> <div class="balik"> <div class="panel panel-default panel-cube"> <div class=" flip"> <div class="card"> <div class="panel-body face front"> <h4>balík 28 dní</h4> <br> <h1>16,80€</h1> <br> <h4>zisti viac o balíku &raquo;</h4> </div> <div class="panel-body face back"> <p class="close">x</p> <a href="#"><h4>o balíku 28 dní</h4></a> &raquo; cel...

java - Crosstab query with TRANSFORM and PIVOT is repeating rows -

Image
the query below used retrieve results in database inserted jtable. transform abs(a.present) select e.id, e.firstname, e.lastname, e.position, e.rate employees e left join attendance on e.id = a.empid group e.id, e.firstname, e.lastname, e.position, e.rate, a.present pivot a.dateattended the results retrieved query can seen below. now, merged results. problem in query arises when result date columns differ, (e.g. 1 | 0, or 0 | 1). id result being duplicated (encircled in red). want ask possible ways on how can merged results seen in right part of image. thank in advance. your problem want transform (i.e., report value of) a.present have included field group clause. try using transform first(abs(a.present)) , removing a.present group clause, i.e., transform first(abs(a.present)) select e.id, e.firstname, e.lastname, e.position, e.rate employees e left join attendance on e.id = a.empid group e.id, e.firstname, e.lastname, e.position, e.rate pivot a.dateattende...

ajax - Wordpress, wp-fullcalendar (0.8.4) with events manager (5.5.2): how to add additional text to title? -

i'm in nth hour of trying following: i'd add text/html snippets before title of event displayed in fullcalendar (i.e. inside of <div class="fc-event-title">). these snippets 1 of following: <span class="info">registration needed</span> <span class="cancelled">course cancelled</span> <span class="ok">held planned</span> blank value/no additional text i tried copy wp-fullcalendar.php theme's directory hoping able edit function couldn't accomplish overwrite original file - anyplace tried put it. i tried working in source file, test did (line 199 in original wp-fullcalendar.php): $title = 'lll' . $post->post_title; did nothing output in calendar. after while removed function 'function ajax()' wp-fullcalendar.php , calendar still displays fine. seems wrong place (which anyway it's source file, know). i hoping find quick way accomplish task can see i...

c# - bind a combo-box to a List with "static" content and show content from database on WPF with MVVM -

i having combo box , want show when click on gender "female" or "male" , same time want read database "gender" has selected employee. so, want read , show on combo-box "sex" database when click on want show 2 different options have ("female" or "male"). problem know how bind combo-box can show content on observable collection, not know first how can bind property on , how can show same time 2 different choices 1 can choose. thanks in advance! keep observablecollection binding. sounds if that's working fine , responsible providing options want exposed in dropdown of combobox. it sounds want show default sex property obtained database. presumably, have sex property on datacontext implementing inotifypropertychanged private string _sex; public string sex { { return _sex; } set { if (_sex != value) { _sex = value; onpropertychanged("sex"); ...

PHP Loop start at 0 instead of 1 -

trying increasing number each image has start @ 0, outputting 1 , don't know why! any appreciated, in advance! <div id="carousel"> <ul class="thumbs"> <?php $counts = 0 ; ?> <?php foreach( $images $image ): $counts++; ?> <li> <a data-slide-index="<?php echo $counts ;?>" href=""> <img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" /></a> </li> <?php endforeach; ?> </ul> </div> <?php endif; ?> because increamenting $counts before echo so : <?php $counts = -1 ; ?> or this: foreach( $images $image ) { echo '<li> <a data-slide-index="' . $counts . '" href=""> <img src="' . $image['sizes'][...

Simple curiosity about OpenGL VBO allocation -

i have written simple graphic engine using opengl , glsl. until here, when needed create new mesh scene node created vao, vbo , ibo each mesh. loaded vertex attributes each mesh way: glbufferdata(gl_array_buffer, this->getverticesbytesize(vertex_position) + this->getverticesbytesize(vertex_texture) + this->getverticesbytesize(vertex_normal), null, this->m_usage); glbuffersubdata(gl_array_buffer, 0, this->getverticesbytesize(vertex_position), &this->m_vertexbuffer[vertex_position][0]); if (!this->m_vertexbuffer[vertex_texture].empty()) glbuffersubdata(gl_array_buffer, this->getverticesbytesize(vertex_position), this->getverticesbytesize(vertex_texture), &this->m_vertexbuffer[vertex_texture][0]); if (!this->m_vertexbuffer[vertex_normal].empty()) glbuffersubdata(gl_array_buffer, this->getverticesbytesize( vertex_position) + this->getverticesbytesize(vertex_texture), ...

grails - Configuring Intellij-Idea to find css files -

i've been using grails new assets-pipeline plugin , i've realized css has moved web-app/css grails-app/assets/stylesheets, idea no longer css completion , can no longer go class definitions. i'm sure i'm missing something. i've tried adding source folders project pointed @ new assets folder, i've tried resources folder. i've tried adding web resources folder. nothing seems work. more point documentation on self referential it's useful if know answer in first place. so, given i've got css under grails-app/assets/stylesheets, how configure idea project knows can find project css here?

How to implement 2 themes in Android app -

i have android app got orange background, , actionbar gray, , buttons dark orange. want implement second theme user can choose, changing style in activities pink, blue actionbar , blue buttons. but im not sure how implement it... hoping this: <theme name="orange"> <style name="myactivitybackground"> <item name="background">@drawable/orangepattern</item> </style> <style name="titlebar"> <item name="background">@color/gray</item> <item name="color">@color/white</item> <item name="textsize">20sp</item> </style> <style name="mybuttonstyle"> <item name="background">@color/darkorange</item> <item name="color">@color/black</item> <item name="textsize">15sp</item> </style> </theme> <theme name="pink...

Wordpress site won't draw some visualizations, gives "'undefined' is not a function (evaluating 'b.I()')" error -

i completed website project: http://cunninghamk1.journalismanddesign.com/?page_id=150 seemed work month, until went few days ago. haven't made changes on site, except bit of css related header. on examples , tutorials page, have 2 data visualizations no longer draw. 1 (no. 3 on page) made wordpress plugin, have updated. other (no. 6 on page) works google charts api. don't see commonality problems, , i'm not sure how fix either one. i've redone charts visualizer (the plugin) same error, says 'undefined' not function (evaluating 'b.i()'). i've gone .js file nothing has changed or seems amiss otherwise. thanks ideas on might causing problem.

php - Disabling codeigniter xss filtering or running over it -

i have codeigniter website , i've turned on global xss filtering , i've developed website this. observed can't pass e-mails parameter no more . ex: www.foo.com/data?email=example@dot.com i wonder how can pass email parameter keeping global xss filtering on, don't want add lot of xss_clean('data') . i thought splitting in pieces www.foo.com/data?id=example&domain=dot&ext=com don't know if best idea. suggestions? are url-encoding email? name@domain.com should become name%40domain.com

python - Selenium - iframe headache - unable to solve -

i have been banging head against wall long enough okay turn here @ point. i have page iframe: <iframe frameborder="0" allowtransparency="true" tabindex="0" src="" title="rich text editor, listing_description" aria-describedby="cke_18" style="width:100%;height:100%"> when xpath using: '//*[@aria-describedby="cke_18"]' i web element where: >>> elem <selenium.webdriver.remote.webelement.webelement object @ 0x104327b50> >>> elem.id u'{3dfc8264-71bc-c948-882a-acd6a8b93ab5}' >>> elem.is_displayed <bound method webelement.is_displayed of <selenium.webdriver.remote.webelement.webelement object @ 0x104327b50>> now, when try extract put information in iframe, along following error: traceback (most recent call last): file "<stdin>", line 1, in <module> file "/applications/spyder.app/contents/res...

ios - Instagram API fetching images with Specific Hashtag -

Image
hi pretty new ios , instagram api. want retrieve pictures specific hashtag in ios app. how can that? awesome. start reading instagram api . need make use of following tag endpoint - once again, instagram api documentation rich. read tag endpoints here . furthermore, if new ios programming, suggest complete build photo browser iphone app project team treehouse . creating cool iphone app browsing instagram photos.

rss - Is it possible to apply news strip in android app -

Image
i have idea of making news app in breaking news or top stories seen @ bottom of android phone in tv. not occupy whole screen instead of show headlines in continuous moving news strip. know needing rss feeds different news website want know procedure of making app means "blueprint" of app. widget not idea not support animation, can update widgets periodically. if need ticker available on top of application. run service , show dialog activity. send current app background. here solution: the standout library pingpong boss achieve it.

java - External Trigger for Jenkins job -

do have option in jenkins trigger build remotely(externally) based on secret token? each dev team can given secret token in case need trigger emergency build you can use jenkins remote access api https://wiki.jenkins-ci.org/display/jenkins/remote+access+api

mysql - PHP store array to database logical issue -

i have array follows: $data = array('john',22,'peter',31,'kevin',30,'jessy',28.......'revin',23); this array contains thousands of elements in same format name, age. now need insert array in table follows using php/mysql function. -------------------- id name age -------------------- 1 john 22 2 peter 31 3 kevin 30 please note don't give options loops or explode. appreciated i hope bellow code work based on requirement, happy coding :-) $data=array('john',22,'peter',31,'kevin',30,'jessy',28);// list of array $array=array_chunk($data, 2);// converting array multidimensional array $arraytostr = implode(',', array_map(function($el){ return "('".$el['0']."',".$el['1'].")"; }, $array)); // implode multidimensional array ','separate array $query="inser...

asp.net - Error with ScriptManager -

hi have following code: scriptmanager.registerstartupscript (page, page.gettype (), guid.newguid () tostring (), "document.getelementbyid ('divwarning') innerhtml = 'my_message';", true); when write same method in class of specific routines (my_tools.cs), method not work: public static void showerro (page pag, string error) { scriptmanager.registerstartupscript (pag, pag.gettype (), guid.newguid () tostring (), "document.getelementbyid ('divwarning') innerhtml =. '" + error + "';"., true); } what reason not working when inside class instead of calling directly on page?

node.js - how to perform ternary operation in Nodejs -

am new nodejs. am trying perform ternary operation in nodejs code here code segment using if (filter.serverid != "0") {// filter server details report filterjson(report, report[items].server, filter.serverid, function ( filterddata) { report = filterddata; }); }else report = report; can write code this report = filter.serverid != "0" ? filterjson(report, report[items].server, filter.serverid, function (filterddata) { report = filterddata; }); : report in short, have no reason use ternary operator. full explanation , solutions below. the 2 code snippets saying different things. first 1 has two assignments. report = filterddata in anonymous function, if condition true, otherwise assigns report report . the second code snippet has three assignments. report = filterddata in anonymous function condition true, , assigns result of filterjson report (i gue...

wav - Change Bitrate of AudioRecord on Android -

how can on android bits per sample changed 16 bit 8 bit (or other bitrates) in audiorecord object when recording in wav format? this doesn't work (as discussed example here: using audiorecord 8-bit encoding in android ): private static int recorder_audio_encoding = audioformat.encoding_pcm_8bit; -->error: invalid audio format. buffersize = audiorecord.getminbuffersize(recorder_samplerate,recorder_channels, recorder_audio_encoding); recorder = new audiorecord(mediarecorder.audiosource.mic,recorder_samplerate, recorder_channels,recorder_audio_encoding, buffersize); with header: private void writewavefileheader( fileoutputstream out, long totalaudiolen, long totaldatalen, long longsamplerate, int channels, long byterate) throws ioexception { byte[] header = new byte[44]; header[0] = 'r'; // riff/wave header ...header content... header[32] = (byte) (2 * 16 / 8); // block alig...

Uploading Images on Google Drive from IOS Application -

i working ios application ,in have upload images on google drive .i able upload images on gdrive ,but first want create folder , upload selected images in folder. how create album folder , insert images in folder. please searched everywhere,but not getting solution. please me out. warning, none of code below not typed in ide. moving in right direction :) first, create empty folder this: gtldrivefile *folderobj = [gtldrivefile object]; folderobj.title = foldername; folderobj.mimetype = @"application/vnd.google-apps.folder"; gtlquerydrive *query = [gtlquerydrive queryforfilesinsertwithobject:folderobj uploadparameters:nil]; then, when inserting file, want add id of new folder parent references using similar to: gtldriveparentreference *parentref = [gtldriveparentreference object]; parentref.identifier = thefoldersid; fileobj.parents = [nsarray arraywithobject:parentref];