Posts

Showing posts from February, 2010

javascript - Get data from jQuery Fullcalendar and pass it to controller -

i need value of id of event chosen, when it's clicked. once dialog box open, have link redirect page. need pass eventid controller use redirected page. i can't seem resolve issue, got going week already. here's script: <script type='text/javascript'> $(document).ready(function(){ $('#calendar').fullcalendar({ header : { left: 'prev,next', center: 'title', right: 'month,agendaweek,agendaday' }, allday: false, events: "<?php echo site_url('home/calendarlist') ?>", eventclick: function(event, jsevent, view) { //set values , open modal $("#starttime").html(moment(event.start)); $("#starttime").html(moment(event.start).format('h:mm a')); $("#endtime").html(moment(event.start).add('hours',1).format('h:mm a')); $("#eventinfo").html(event.desc...

Create a separate Database class android -

i new android.in application need created 4-5 tables. wanted know if can create separate database class , separate class tables? because of code looks clean instead of using public dbadapter extends sqliteopenhelper{ //all crud operations 4-5 tables in same class } can suggest how make separate initiate db , use crud operations different tables classes? import java.util.arraylist; import android.content.contentvalues; import android.content.context; import android.database.cursor; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqliteopenhelper; import android.util.log; public class databasehandler extends sqliteopenhelper { // static variables // database version private static final int database_version = 1; // database name private static final string database_name = "contactsmanager"; // contacts table name private static final string table_contacts = "contacts"; // contacts ...

c++ - Returning a CString will call the destructor? -

what happenes if return cstring method? call destructor of cstring? cstring f(){ cstring s = g(); return s; } const char* g(){ return new char[5]; } thanks :) not necessarily. if compiler implements return value optimization (rvo) can set call f() such s constructed caller store return value, , therefore can elide calls cstring copy constructor , destructor. optimization 1 of few exceptions permitted c++ standard as-if optimization rule. if compiling optimizations disabled, see 1 or more calls cstring copy constructor , destructor in processing call f() .

c# - Can't get desired tabPage & form to display on startup -

revising question ask why after finding offending line trial , error. hints answers suggested occurring after form load. found line setting tabcontrol1.selectedindex = 1; tabpage2 index 1 why wasn't selecting tabpage2? after changing 1 0 displays correctly. i can't find white paper or tutorial on tabcontrol , use of selectedindex can tell me how works? private void form1_load(object sender, eventargs e) { getregions(); tabcontrol1.selectedindex = 1; i have windows form had 10 tabpages on tabcontrol1. change in requirement necessitated except 2 & 8. prior removing tabpages, tabpage2 , form displayed @ startup. can remove 3,4,5,6,7,9,10 without problem (1,2,8 left). if remove tabpage1 tabpage , form displays @ startup tabpage8. tabpage2 , stay way. i've played on , off couple of weeks , stumped. can't seem find article or question describing this. found multiple suggestions add this.tabcontrol1.selectedtab = tabpa...

javascript - How download files in jquery -

i need implement file download in mvc project. have repository there upload file repository not in project folder i.e. e: drive while running project in c: drive. i file url info below " http://cdn1.zerofootprint.com.au/assets/4785/photography/mstestdesert.jpg " , a'm binding these url dynamically. is there ant way download these file of anchor. sample code appreciated. <div class="image"> <a href="http://cdn1.zerofootprint.com.au/assets/4785/photography/mstestdesert.jpg" > <img src="http://cdn1.zerofootprint.com.au/assets/4785/photography/mstestdesert.jpg" class="img-responsive" alt="mstestdesert.jpg"> </a> </div> in advance.. you use 'download' attribute js fiddle <div class="image"> <a href="http://cdn1.zerofootprint.com.au/assets/4785/photography/mstestdesert.jpg" download> <img src="http://cdn1.ze...

Is there a need to recomplie my linux kernel? -

i beginner learning linux kernel module development. following tutorial says recompile kernel enable various debugging features forced module unloading e.t.c. is okay if that? effects pre-built kernel. in cases forced insert module running kernel , kernel won't allow me so? it okay compile , install kernel kernel module development. if in ubuntu, can follow following steps make sure using same kernel sources booted machine. step 1. find out linux being used in booting /boot/grub/grub.cfg file. entry agains 'linux ' in boot option entries select while booting up. example excerpt : linux /boot/vmlinuz-3.13.0-24-generic root=uuid=e377a464-92db-4c07-86a9-b151800630c0 ro quiet splash $vt_handoff step 2. name of package same version using following command. dpkg -l | grep linux | grep 3.13.0-24-generic example output: $ dpkg -l | grep linux | grep 3.13.0-24-generic ii linux-headers-3.13.0-24-generic 3.13.0-24.46 ...

Why am I still getting a cannot find Java SE Runtime Environment? -

Image
these errors when try run simple java version in command window. i followed advice on error: registry key 'software\javasoft\java runtime environment'\currentversion'? . when went on regedit, here's saw which meant there nothing change - right runtime version. did next step "delete previous versions of java (using "programs , features" uninstall process) , re-install version want work with" however, didn't work either...... here current java directory(see have installed) and current environmental variables are java_home - c:\program files\java\jdk1.7.0_71 path - c:\program files\java\jdk1.7.0_71\bin which believe correct http://www.oracle.com/technetwork/java/javase/install-windows-189425.html does know how can rid of issue? 1 more uninstall/install think waste of time , won't make difference. try adding "%java_home%\bin;" in path section instead of "c:\program files\java\jdk1.7.0_71\bin", should...

javascript - addeventlistener to <div> appended in d3 -

i trying add events (addeventlistner) multiple elements appended d3.however, when click on , won't trigger attached "alert".interestingly, works on <div> manually add inside .could shed light on this? d3.csv("output1.csv",function(data){ var width = 700, height = 600; d3.select('body').selectall("div") .data(data) .enter() .append("div") .style("width",30) .style('height',30) .style("background-color",function(d){ return d.color; }) var divs = document.getelementsbytagname("div") // returns array of div elements function show(){ alert("ya") } (var = 0; < divs.length; i++) { divs[i].addeventlistener('click',function(){ alert("yaho") }) } }) since using d3, use d3 event listeners shown below. var divs = d3.select('body').selectall("div") ...

Yii2 model relation not working -

other model data not showing in gridview. i have 2 models,listforms , lists. want show list name lists on listforms gridview. code. listforms model: class listforms extends \yii\db\activerecord{ // relation name public $listname; /** * @inheritdoc */ public static function tablename() { return 'listforms'; } public function getlistname() { return $this->hasone(lists::classname(), ['listid' => 'listids']); } listforms gridview: [ 'label'=>'list name', 'attribute' => 'listname', 'value' => 'listname.listname' ], listformssearch: public function search($params){ $query = listforms::find(); $query->joinwith(['listname']); //... } remove public $listname; from model, because...

android - played video again automatically after finished -

i doing android application related video player.i played video want when video complete,it resumption automatically in application how can do? using videoview in appliation. // displays video file. videoview mvideoview = (videoview) findviewbyid(r.id.videoview); string uripath = "android.resource://com.example.anket4dammy/" + r.raw.dunyagoz; uri uri = uri.parse(uripath); mvideoview.setvideouri(uri); mvideoview.requestfocus(); mvideoview.start(); } @override public boolean ontouchevent(motionevent event) { int eventaction = event.getaction(); switch (eventaction) { case motionevent.action_down: // timer.cancel(); intent intent = new intent(getapplicationcontext(), mainactivity.class); intent.putextra("exit", false); intent.setflags(intent.flag_activity_clear_top); startactivity(intent); break; } return true; } @override public...

jenkins - BUILD FAILED : a module is not authorized to depend on itself: com.vaadin.external.atmosphere#atmosphere-compat-jbossweb;2.0.1-vaadin1 -

my project vaadinframework based project.i run build.xml file through jenkins. struck error this. /build.xml:28: impossible resolve dependencies: java.lang.illegalargumentexception: module not authorized depend on itself: com.vaadin.external.atmosphere#atmosphere-compat-jbossweb;2.0.1-vaadin1, if know answer please me out the above 3 addons added in ivy.xml file.my problem salved. becouse project vaadin based project.so using vaadin dependencies in compile , runtime. anyhow im looking otherways soughtout problem inspite of addons.

git - What's the proper way to "go get" a private repository? -

i'm searching way go get work private repository, after many google try. the first try $ go -v gitlab.com/secmask/awserver-go fetching https://gitlab.com/secmask/awserver-go?go-get=1 https fetch failed. fetching http://gitlab.com/secmask/awserver-go?go-get=1 parsing meta tags http://gitlab.com/secmask/awserver-go?go-get=1 (status code 200) import "gitlab.com/secmask/awserver-go": parse http://gitlab.com/secmask/awserver-go?go-get=1: no go-import meta tags package gitlab.com/secmask/awserver-go: unrecognized import path "gitlab.com/secmask/awserver-go yep, did not see meta tags because not know how provide login information??? second try follow https://gist.github.com/shurcool/6927554 . add config .gitconfig [url "ssh://git@gitlab.com/"] insteadof = https://gitlab.com/ $ go -v gitlab.com/secmask/awserver-go --> not work $ go -v gitlab.com/secmask/awserver-go.git --> work got src/gitlab.com/secmask/awserer-go.git yes work .git...

Wordpress categories redirecting to index.php -

hello , day all! i started developing wordpress theme scratch, , seemed going far. have small problem. when click on 1 of post categories in default wp sidebar, redirected index.php, despite fact link referencing exact name of category. how can fix that, when click category, posts in category? my guess must problem archive.php page or that. new of this, please excuse question. big in advance! so managed fix problem anstrangel0ver's refference category.php file, led me http://bit.ly/1umc6uc , code there has little mistake fixed, here is: i must place in category.php file in order me fix issue: <?php /** * simple category template */ get_header(); ?> <section id="primary" class="site-content"> <div id="content" role="main"> <?php // check if there posts display ?> <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> ...

wix3.5 - How to create application in IIS using Wix? -

i beginner in msi creation. using wix 3.5.i want create application directory in iis on installation of msi. using below code - <directory id="targetdir" name="sourcedir"> <directory id="iismain" name="inetpub"> <directory id="wwwmain" name="wwwroot"> <directory id="applicationrootdirectory" name="servicestest"></directory> </directory> </directory> </directory> but code creating virtual directory name - "servicestest", not application directory. how create application directory using wix? try article bart de mayer: http://blog.bartdemeyer.be/2013/10/create-an-installer-for-website-with-wix-part-1/ and here files article: https://github.com/bartdm/wixinstallerdemo/tree/master/demowebsite.setup

angularjs - protractor E2E tests stopped working on 11 second timeout -

i using protractor 1.4 e2e test our angular website. had suite of tests running , passing perfectly, until week ago when of them started fail on 11 seconds timeout ("timed out waiting protractor synchronize page after 11001ms") since wanted backtrack , find if there piece of code somewhere resposible that, reverted commit ok , marked tests passing , nada - still same issue. at point don't know cause , how continue. seems in environment has changed (that reverting didnt change back) not sure can be. thought might chrome version tried firefox - same results. i highly appreciate given. example test fails on that: it('should succeed new user , fail registered one', function () { //check create account link var createaccountlink = element(by.id('createnewaccountlink')); expect(createaccountlink.gettext()).toequal("or create account"); createaccountlink.click(); //check create account title expect(element(by.c...

compact framework - .NET CF Assembly corrupted after warm boot -

our customer support came weird problem. every day there devices didn't start our application because error occured during app launch phase. while investigating issue further found following post. unfortunately doesn't apply problem. windows ce deletes .net cf on reset the gac still present after warm boot problem doesn't come corner. while digging deeper found problem caused corrupted log4net.dll. right before problem arises there software update running. happens there is: - download new version - reboot device (warm) - vendor specific cab installer installs cab - device gets rebooted again - sysbackup running - warm boot - our own application started @ last step app crashes error log4net assembly couldn't found or invalid (something that). after comparing working version of assembly 1 on device found out somewhere along way of software update log4net assembly gets corrupted. oddly there part of different config xmls @ start of assembly. me looks lot ...

c# - Cannot add Linq2Twitter package to Xamarin Studio -

when trying add linq2twitter nuget package xamarin studio, following error: could not find part of path "(..)/packages/linqtotwitter.3.1.1/linqtotwitter.3.1.1.nupkg". previously package installed not reference code. after bit of research found may has missing support pcl's ( http://lastexitcode.com/blog/2014/11/16/installingportableclasslibrariesforxamarinstudio/ ) after installing mono mdk (mono development kit) here http://www.mono-project.com/download/ , no longer able add package project. any ideas :-) had same issue multiple times, in xamarin studio on mac. issue fixed manually editing packages.config have id in lowercase instead of 1 provided nuget, both in pcl , ios project.. the entry based on id be: <package id="linqtotwitter" version="(...)" targetframework="(...)" /> more info in discussion other answer in topic of @mattward

php - how to skip entries that are NULL in MySQL -

i'm having trouble 2 things on news feed. i'm trying news feed show database entries, don't have date because sort of sticked news feeds aren't date related. problem still pushes enter/empty line those. how can make feed skip date column if there no date entry in id, still show news? and second question, how can add span class date returning feed? this code loading database: <?php // grab data our people table $sql = "select * news order id desc"; $result = mysql_query($sql) or die ("could not access db: " . mysql_error()); while ($row = mysql_fetch_assoc($result)) { echo "<div class=\"newsstory\">"; echo "<p>"; echo $row['date'] . " " . "<br />"; echo $row['news']; echo ...

python - How to scrap websites filtering by its keywords in metadata? -

i have writen scraper suposed scrap websites keywords matching given ones. code: class myspider(crawlspider): name = 'smm' allowed_domains = [] start_urls = ['http://en.wikipedia.org/wiki/social_media'] rules = ( rule(sgmllinkextractor(deny=('statcounter.com/','wikipedia','play.google','books.google.com','github.com','amazon','bit.ly','wikimedia','mediawiki','creativecommons.org')), callback="parse_items", follow= true), ) def parse_items(self, response): items = [] #define keywords present in metadata scrap webpage keywords = ['social media','social business','social networking','social marketing','online marketing','social selling', 'social customer experience management','social cxm','social cem','social crm','...

arrays - Run a function on all parts of string php -

i built function capture text between brackets , output them array. problem function executes first time in string. function getbetween($content,$start,$end){ $r = explode($start, $content); if (isset($r[1])){ $r = explode($end, $r[1]); return $r[0]; } return ''; } function srthhcdf($string){ $innercode = getbetween($string, '[coupon]', '[/coupon]'); $iat = explode('&&', $innercode); $string = str_replace('[coupon]','',$string); $string = str_replace('[/coupon]','',$string); $newtext = '<b>'.$iat[0].'</b> <i>'.$iat[1].'</i><b>'.$iat[2].'</b>'; $string = str_replace($innercode,$newtext,$string); return $string; } $text = srthhcdf($text); but matches first [coupon] , [/coupon] not others. when string hello world [coupon]hello && bad && world[/coupon] , [cou...

php - Get connection parameters -

is there way access connection parameters given mysqli connection? $con = mysqli_connect("127.0.0.1","root","","mydb") ; now how can use $con acces database connection properties? $username = $con->username ??? thanks i don't know why you'd want this? save data in variable acces later instead of using connection variable. and no it's impossible data using $con variable. try var_dump see if acces property of object.

html - CSS3 Transistion not worked properly in safari 3.1.7 -

i have page element css3, want transit image left right fadeout. it works in chrome, firefox, ie, op, not in safari 5.1.7 windows. any highly appreciated. js fiddle link html <li class="product"> <div class="image"><img src="http://elektronika.techtestbox.com/images/product.png"></div> <span>products</span> </li> css .product .image img { animation:fadeoutright 5s linear infinite; -moz-animation: fadeoutright 5s linear infinite; -webkit-animation: fadeoutright 5s linear infinite; -o-animation: fadeoutright 5s linear infinite; } @-webkit-keyframes fadeoutright { 0% { opacity: 1; } 100% { opacity: 0; -webkit-transform: translate3d(100%, 0, 0); transform: translate3d(100%, 0, 0); } } @keyframes fadeoutright { 0% { opacity: 1; } 100% { opacity: 0; -webkit-transform: translate3d(100%, 0, 0); transform: translate3d(100...

c# - How to handle null if passed from a calling function to a called function whose parameter is nullable integer? -

i have been asked question in interview public int add(int? a, int? b) { return a+b; } null passed in a's place. how handle this? i said if (a == null ) { //do } else { // } he didnot anything. waiting reply. whtever have said correct interviewer might wanted know how updated are.. if(!a.hasvalue) { = 0; } or shorter :- a = != null ? : 0; and 1 more operator suggested askolein ?? shown below :- a ?? 0;

angularjs - Questions relative to $scope & controllers -

i'm trying play 2 controllers speaking each other i'm stuck 2 problems/questions: $scope.display not displayed @ first in view. wonder why. $scope.display seems shared between 2 controllers whereas read $scope(s) isolated. wonder why. i read on stackoverflow best communicate between controllers use $rootscope.broadcast & $rootscope.on. apply example? js angular.module("superapp", []) .controller("headerctrl", function ($scope) { $scope.display = 'hello'; }) .controller("homectrl", function ($scope) { }); html <div ng-app="superapp"> <div ng-ctrl="headerctrl"> <p>{{ display }}</p> <div class="bar hello" ng-show="display == 'hello'"> <span>hello world<span> <button ng-click="display = 'bye'">say bye</button> </div> ...

Convert Xaml Code Activity to C# -

we have been using wf code activity. there few xaml files our business logic resides. in process of re-architecting whole application & xaml code activities need discarded. i looking out xaml parsers convert xaml code c# classes & methods. i did extensive search on google & so, not find any. know tool out there?

php - Soap connection with Silex -

i've tried connect api here: http://www.hrd.pl/wsparcie/api/nawiazanie-polaczenia/ micro-framework silex. i've found on github solution: https://github.com/ibsciss/zend-soap-service-provider i've made on readme. registered service that: $app->register(new zendsoapserviceprovider()); and after i've got blank page , error.log says: php fatal error: class 'zendsoapserviceprovider' not found in /home/stolarz/public_html/hosting-site/web/index.php on line 30 can give me hint, i've stucked. there way connect soap silex? you need specify namespace of class trying instantiate. use ibsciss\silex\provider\zendsoapserviceprovider;

php - How to display the content after contact form submitted? -

i watched tutorial teaches how create simple php form youtube. follow instruction , created form, form working alright, there problem facing form. is, got no idea how display full data of form field display on email after contact form submitted. here have php code of process_contact.php. click link see attachment of php code have contact form. http://www.ytcopier.com.my/img/process_contact.jpg at moment, can see field of $inquiry. can guide me in order display field? thank you! highly appreciated. you have build message having required details in email. this $emailmsg = "details: <br/> contact person: {$contactperson} <br/> phone number: {$phonenumber} <br/> email : {$emailaddress} <br/> company name: {$companyname} <br/> company address: {$companyaddress} <br/> service inquired: {$serviceinquire} <br/> find us: {$findus} <br/> inquiry: {$inquiry} <br/> "; insert above in code. replace mail($to,$su...

java - Special characted incorrectly stored in POSTGRES DB -

project based on postgres database version 9.3.5, java 7, org.hibernate hibernate-core 3.6.10.final problem : have 2 separate system running same web application. 1 on of systems persisted correctly on other strings sent postgres database contain unicode characters , text 'nnés' persisted 'nns' or 'nnés-2' . difference noticed between 2 systems 1 displaying unicode , otherutf8 client encoding when doing show client_encoding; in console. 1 running unicode works correctly other not. my question is possible client encoding got stuck/hardcoded somehow , not being selected based on real client encoding mean strings sent in unicode arent converted utf8 persisted. what can reasons such behavior. try request.setcharacterencoding("utf-8");

Javascript or CSS for image hover navigation overlay -

what technology safest use older browsers such ie 6/7/8? want when user hovers on image, simple next/prev navigation links fade in across bottom of image. have looked @ tutorials css version 3 know new wont support older browsers. many thanks if want support browser versions, javascript best way it.

cordova - Notification not working in android 4.4.2 version -

i trying in implementing push notification in application. notification working android 4.3.0 version devices. in android 4.3.0 , when install app, app not open getting unfortunately application name has stopped. when change service in manifest file android:name="com.plugin.gcm.gcmintentservice" android:name="com.plugin.gcm.gcmbroadcastreceiver" . app open in android 4.4.2 version, notification not working in android versions. push plugin version 2.4.0. i using cordova 3.6.4 version. if 1 have implement push notification in android 4.4.2 version using phonegap push plugin, send me github link.

angularjs - combine string and html string and display in ui-bootstrap popover -

i using restangular collection of items server. each item has description, normal string , longdescription contains html describing how should formatted. i trying display information in single ui-bootstrap popover i have added restangule response interceptor so var addtrusteddesc = function(room) { var result; var desc = room.description; var longdesc = room.longdescription; if(desc && longdesc) { result = desc + ' </br> ' + longdesc; } else if(desc) { result = desc; } else if(longdesc) { result = longdesc; } room.trusteddesc = $sce.trustashtml(result); return room; }; restangularconfigurer.addresponseinterceptor(function(data) { return _.map(data, function(room) { return addtrusteddesc(room); }); }); and later try use trust...

sql - Ordering the query results based on the order given inside the IN clause -

i order result set of sql query based on order inside in clause example: select * employee empid='eng' , deptid in ('software','mech','aero','civil'), for above query order result set in order 1. software, 2. mech, 3. aero, 4. civil in oracle, use instr() or case : select * employee empid='eng' , deptid in ('software','mech','aero','civil') order instr('software,mech,aero,civil', deptid) this should work in db2. the case form work in both databases, longer: order (case deptid when 'software' 1 when 'mech' 2 when 'aero' 3 when 'civil' 4 end)

excel - Best methods to reference a user function in a macro -

afternoon, i have user function saved: function alphanumericonly(strsource string) string dim integer dim strresult string = 1 len(strsource) select case asc(mid(strsource, i, 1)) case 48 57, 65 90, 97 122: 'include 32 if want include space strresult = strresult & mid(strsource, i, 1) end select next alphanumericonly = strresult end function i call user function in macros run (checking open in macro). issue i'm having when need share macro references user. i of course copy user function , send along copy of macro, save locally , adjust macro check local copy open. seems quite long winded. could offer suggestions? wondering if somehow embed user function in macro, or store centrally how. web searching , asking around has drawn blank on one. thank you. please see complete macro along user function @ end: option explicit public const csformula = "=concatenate(""agsbis"...

javascript - Regular expression to find a word at the end of the string -

i have string, based on end character of string need check condition. have managed write following script, not taking intended. //var receivers_type = "d2845a48f91b29f9d0a6e96858f05d85xing"; var receivers_type = "d21fca8635940e97d0f8e132d806cedaxingpage"; if (/.*xing/.test(receivers_type)) { console.log('xing profile'); flag = 1; } if (/.*xingpage/.test(receivers_type)) { console.log('xing page'); flag = 0; } when receivers_type = "d2845a48f91b29f9d0a6e96858f05d85xing" condition working properly. enter first if loop. when receivers_type = "d21fca8635940e97d0f8e132d806cedaxingpage" entering in both if cases. me solve issue. you don't need .* selector, should use folowing regexp /xing$/ <-- character $ means xing must @ end of string so code be: //var receivers_type = "d2845a48f91b29f9d0a6e96858f05d85xing"; var receivers_type = "d21fca8635940e97d0f8e132d806cedaxingpage...

c# - To get Dropdownlist selected value inside static method -

in below code have static method inside static method want dropdown selected value.pls me this. [webmethod] public static void insertdata() { } <asp:dropdownlist id="divlocation" runat="server" style="width:40%;" enableviewstate="true"/> here example of ajax $.ajax({ type: "post", contenttype: "application/json; charset=utf-8", url: "pagename.aspx/webmethodname", data: json.stringify({ dropdownvalue: $('select[id$=divlocation]').val()}), datatype: "json", async: false, success: function (data) { alert("success"); }, error: function (err) { alert(err.responsetext); } }); and in webmethod receive value this [webmethod] public static void insertdata(string dropdownvalue) { }

ruby - What is the best way to rewrite this code (Line is too long) -

i checking code rubocop , warning code: def questions_from_time_by_page(t, pagesize, page) "#{@base_url}questions?pagesize=#{pagesize}&page=#{page}&fromdate=#{t}&site=stackoverflow&key=#{@key}" end lib/stackify.rb:99:81: c: line long. [108/80] "#{@base_url}questions?pagesize=#{pagesize}&page=#{page}&fromdate=#{t}&site=stackoverflow&key=#{@key}" what best way rewrite it? split line multiple lines ? def questions_from_time_by_page(t, pagesize, page) "#{@base_url}questions?pagesize=#{pagesize}&page=#{page}" + "&fromdate=#{t}&site=stackoverflow&key=#{@key}" end or may there better way? you can call to_query on hash take care of url encoding etc. maybe this: params = { :a => "http://google.com", :b => 123 } url = "http://example.com?#{params.to_query}" this produces "http://example.com?a=http%3a%2f%2fgoogle.com&b=123...

javascript - Access elements in JSON after ajax request -

i have spent last couple of hours trying figure out this. make ajax request using jquery. response in string format , use jquery.parsejson(response); to convert object. response: { "columns": ["n"], "data": [ [{ "extensions": {}, "labels": "http://localhost:7474/db/data/node/168/labels", "outgoing_relationships": "http://localhost:7474/db/data/node/168/relationships/out", "traverse": "http://localhost:7474/db/data/node/168/traverse/{returntype}", "all_typed_relationships": "http://localhost:7474/db/data/node/168/relationships/all/{-list|&|types}", "property": "http://localhost:7474/db/data/node/168/properties/{key}", "self": "http://localhost:7474/db/data/node/168", "properties": "http://l...

How to send Outlook email with HTML content -

can me in how send email html content (google charts) using microsoft outlook 2010. below sample html content of google charts. <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["corechart"]}); google.setonloadcallback(drawchart); function drawchart() { var data = google.visualization.arraytodatatable([ ['task', 'hours per day'], ['work', 11], ['eat', 2], ['commute', 2], ['watch tv', 2], ['sleep', 7] ]); var options = { title: 'my daily activities' }; var chart = new google.visualization.piechart(document.getelementbyid('piechart')); chart.draw(da...

three.js - Superimposing of color -

Image
i want paint cubes red color means of mouse. green cube (at left) becomes not red, black. white cube (on right) colored normally. do? example here // init var material = new three.meshlambertmaterial({ color: 0x00ff00, side: three.doubleside, vertexcolors: three.facecolors }); var geometry = new three.boxgeometry(100, 100, 100, 4, 4, 4); var cube = new three.mesh(geometry, material); cube.position.x = -100; scene.add(cube); objects.push(cube); var material = new three.meshlambertmaterial({ color: 0xffffff, side: three.doubleside, vertexcolors: three.facecolors }); var geometry = new three.boxgeometry(100, 100, 100, 4, 4, 4); var cube = new three.mesh(geometry, material); cube.position.x = 100; scene.add(cube); objects.push(cube); document.addeventlistener('mousedown', ondocumentmousedown, false); // function ondocumentmousedown(event) { var vector = new three.vector3( (event.clientx / window.innerwidth) * 2 - 1, -(event.clienty...

javascript - JQuery Mobile prevent radio from being checked -

i make simple radio group using jquery mobile in way: <fieldset id="current_status" data-role="controlgroup" data-type="horizontal"> {% state in states %} <input type="radio" name="state-choice" id="state-{{ state.id }}" value="{{ state.id }}" data-code="{{ state.code }}" {% if state == currentstate %}checked="checked"{% endif %} /> <label for="state-{{ state.id }}">{{ state.description }}</label> {% endfor %} </fieldset> i need validate changing, tried use like: $(document).ready(function() { $('#current_status label').click(function(event) { event.stoppropagation(); event.preventdefault(); changestatus($(this)); return false; }); $('#current_status inp...

Amazon Route 53 Alias not working -

for reasons not able set static website in s3. trying resolve last 2 weeks not working me. what have done is: uploaded files within s3 bucket. set routing policy - thats fine. alias target dropdown - can see s3 endpoints. created hosted zones. set both alias , without www. result - when typing url in address bar, throws error..either site down or dns related errors. i tried implementing same steps 6-7 times,no problems @ domains not working in end. absolutely clueless going wrong? your hosted zone , domain name servers out of sync: in route 53, verify name servers (ns) generated hosted zone match what's listed under registered domains . screenshot: aws route 53 top left menu - hosted vs registered domains click on "hosted zones" select domain (example.com) select "record set" type ns copy each line item / name server value box ns1.amazon.com ns2.amazon.org ns3.amazon.net ns4.amazon.co.uk now click o...

mongodb - Matching mongo query using Java -

hi want query mongo using java. i have query below: db.flights.find({"timestamp" : {"$lte": new date("2014-09-05t00:00:00.001z")}}).count() which gives output 68 when try using java code below: table = db.getcollection("flights"); dbobject match = new basicdbobject(); date enddate = new simpledateformat("yyyy-mm-dd't'hh:mm:ss.sss").parse("2014-09-05t00:00:00.001z"); match.put("timestamp", new basicdbobject("$lte", enddate)); int count=table.find(match).count(); system.out.println(collections+" "+"count : "+count); the output 48. can tell me issue in code ?? saving format dateformat format = new simpledateformat("yyyy-mm-dd hh:mm:ss"); dateformat formatdate = new simpledateformat("yyyy-mm-dd"); classname classobject=null; date d1=new date(); classobject.setdatecolumn(format.parse(format.format(d1))); /-----------------------...

java - How does Maven manage duplicate artifactIds when they belong to a different group? -

i'm building different web projects maven , thinking how name artifacts. rest api layer, it's convenient share classes, want create exchange-api.jar files shared among different projects. let's suppose i've got web application has it's own exchange-api module. groupid com.mycompany.app1 whole maven id artifact should com.mycompany.app1:exchange-api:1.0 . let's suppose want access other app's api application. have include dependency com.mycompany.app2:exchange-api:1.0 . artifactid s same, groupid different. however, both should end exchange-api-1.0.jar in classpath. how maven take care of this? should use unique artifactid each of them? maven manages problem allowing customize file name mapping, can done both war , ear applications. think naming convention poor. suppose projects publicly downloadable , people not using maven download them manually , add them projects: think generic "exchange-api" clear enough? think no....

wordpress - <p></p> missing with wp_editor( get_option() ); -

i trying add options theme , added wysiwyg textarea , value of textarea go option table (wp-options). so here code used: $settings = array( 'textarea_name' => 'options[content]', 'quicktags' => true, 'tinymce'=> true, ); wp_editor( get_option('content','default_value'), 'content', $settings ); this work pretty fine apparently remove <p> tags content , have absolutely no idea why.. for example when wrote this: level 1 title level 2 title paragraph paragraph this code sent db called 'content': <h1>level 1 title</h1> <h2>level 2 title</h2> paragraph paragraph instead of this: <h1>level 1 title</h1> <h2>level 2 title</h2> <p>a paragraph</p> <p>another paragraph</p> do have idea can unchanged value tags? ps: when add <p> tags manually text side, works until go visual side , re-...

android - Wallpaper not scaling correctly when placing it as activity backgroung -

i have custom .png image set android device's wallpaper. as understand it, wallpaper size should 960x800 pixels android device present middle part of image , right , left parts when scroll right , left on screen. i’ve taken small image want in center of screen (350x350) , filled rest of image black surrounding. my problem is: have activity in application needs background similar wallpaper (to imitate blank activity textview presented on it). i’m using code so: private wallpapermanager wallpapermanager; private drawable wallpaperdrawable; private relativelayout rtemp; rtemp = (relativelayout)findviewbyid(r.id.temp_layout); wallpapermanager = wallpapermanager.getinstance(this); wallpaperdrawable = wallpapermanager.getdrawable(); rtemp.setbackground(wallpaperdrawable); but screen appears have wallpaper whole , not middle part anymore (it shrink down image) , not consistent regular wallpaper anymore. are there suggestions on how solve it? there way avoid image shrinking ...

jsp - how to upload file to the server by specifying only the local path in the computer -

currently using jsp , struts build website. there requirement user can upload file typing in local path of file. when submitting local path of file, server automatically retrieve file , upload it. possible achieve goal? all can ask client supply file. cannot make server retrieve file client, client not expose file system. for file uploads using jsps refer to: http://www.tutorialspoint.com/jsp/jsp_file_uploading.htm i hope help, please specify problem in more detail if need further input. you interessted in: https://blueimp.github.io/jquery-file-upload/basic.html

sharepoint - Office 365 internet explorer issues with activeX -

i got problem sharepoint on office 365 created sharepoint database solution our company. turns out sharepoint tables, require internet explorer 32 bit. sharepoints table filters require activex active. well 64bits win 7, contain programs x86\ ander thats 32bit version of internet explorer assume. still brouwsing office 365 website, browser. still shows warning under table solution: "de standaardweergave van de lijst actief omdat de browser geen activex-besturingselementen ondersteunt." which in egnlish translates : the defaultview of list active browser not support activex (sorry tried set admin pages english sharepoint once language set doesnt change error warnining) i'm using latest internet explorer 32 bits, should work see activex content.. doesnt ideas make use of sharepoints office 365 list tables ? so wonder how other people solve problems office 365 wont support activex could related https://support.microsoft.com/kb/3025036/en-us?wa=wsig...

php - Featured Image Issues -

the featured image isn't shown container width , height. how display featured image: <div id="featuredimage"><?php the_post_thumbnail();?></div> this css featuredimage #featuredimage { height:200px; background-color:#000; margin-left: -40px; margin-right: -40px; margin-top: -20px; } .featuredimage img { height:200px; width:600px; } this code in php functions <?php add_theme_support( 'post-thumbnails' ); ?> what's wrong? can see final result here . may notice, featured image adopts size 1 want be. did try using id instead of class, e.g. #featuredimage img { height:200px; width:600px; } however , repeating use of id i.e. <div id="featuredimage"> is used multiple times on page. id's should unique (see http://www.w3.org/tr/wcag20-techs/h93.html ) therefore consider changing id class; .featuredimage { height:200px; background-color:#000; margin-left: -40px; mar...

java - Google Cloud Storage : create bucket with ACL -

i can create bucket not find how change bucket's acl when create it. want can read objects not write. to create bucket : storage storage = new storage(......); storage.buckets().insert(projectname, new bucket().setname(bucketname)).execute(); i saw can use : new bucket().setacl(list<bucketaccesscontrol>) how use .setacl methode ? thx. i think want set default object acl bucket. apply acl new objects uploaded bucket. to that, can use setpredefineddefaultobjectacl method of storage.buckets.insert operation returned storage.buckets().insert call. take @ applying predefined acl section of documentation list of predefined acls. in case, want use publicread .

ios - I'm getting an "Extra argument" error trying to use the coordinateWritingItemAtURL() method of NSFileCoordinator -

the error is: argument 'writingitematurl' in call i'm developing in swift ios i'm using xcode 6.1.1 on yosemite i've tried deleting deriveddata , restarting xcode , has not helped. here playground code illustrate issue: let movingoption = nsfilecoordinatorwritingoptions.formoving let replacingoption = nsfilecoordinatorwritingoptions.forreplacing var testurl1 = nsurl(fileurlwithpath: "file1") var testurl2 = nsurl(fileurlwithpath: "file2") var error1: nserrorpointer? var error2: nserrorpointer? let fc = nsfilecoordinator(filepresenter: nil) var result = false fc.coordinatewritingitematurl(testurl1, options: movingoption, writingitematurl: testurl2, options: replacingoption, error: &error1, byaccessor: { (newurl1: nsurl, newurl2: nsurl) in let fm = nsfilemanager.defaultmanager() result = fm.moveitematurl(newurl1, tourl: newurl2, error: error2) if !result { println("debug: failed move file \(moveerror?.locali...

while loop stops working after second user input C++ -

i trying implement feature program says "do want quit?" if 'y or 'y' exit program. if 'n' or 'n' rerun menu , let user whatever want. the issue facing menu runs first time , user can yes or no. second time can yes or no. third time when reaches while loop infinitely outputs menu. can please advise? the code menu char exitinput = null; char y = 'y', y = 'y', n = 'n', n = 'n'; while (exitinput != y || exitinput != y || exitinput == n || exitinput == n) { cout << "*\t please choose 1 of following options. \t *" << endl; cout << "1. \t" << "transfer amount \n" << "2. \t" << "list recent transactions \n" << "3. \t" << "display account details , current balance \n" << "4. \t...

c# - LINQ grouping and ordering of top 5 rows into ViewModel List -

i trying create new list of top 5 hits leaders softball web application. new mvc , having trouble putting query , passing information viewmodel. use non-query call "var results" in controller if possible. trying group atbats playerid in stat table. able call firstname , lastname of player player table in view list. thank help! in stat.cs using system; namespace theflyingpig.models { public class stat { public int statid { get; set; } public int seasonid { get; set; } public int playerid { get; set; } public datetime gamedate { get; set; } public int atbats { get; set; } public int hits { get; set; } public int walks { get; set; } public int singles { get; set; } public int doubles { get; set; } public int triples { get; set; } public int homeruns { get; set; } public int rbis { get; set; } public int runs { get; set; } public int reachedonerrors { g...

Check if the elements in array have been connected into a pair in Javascript -

i have problem can't seem solve, maybe can help. there array have. e.g. ['@dog','@cat','@mouse'] i want reiterate through each value in array , connect other values in same array (through building db query). however, because i'll writing in database need avoid duplicates. so if @cat has been connected @mouse time for statement reaches @mouse want skip adding connection @cat (and @dog because connected on first iteration @mouse . i've been trying for loops, such for (var i=0; i<animals.length; i++) { (var j = 0; j<animals.length; j++) { if (animals[i] !== animals[j]) { // adds connection between animals[i] , animals[j] } } } but what's best way implement check of existing pairs? (where doesn't matter element first, second - e.g. graph not unidirectional). this becomes problem if i'm going have more 4 elements in array... thank help! for (var i=0; i<animals....

c# - Change encoding of a list of objects -

i have program using dapper read in data sql server , save data mysql database. doing is: read in data sql server list of objects e.g. list<akindofobject> = read in data sql server open connection mysql, save list<akindofobject> the problem property of akindofobject saved chinese in original database. when data transferred mysql database, chinese characters shown "?". is there way change encoding of list<akindofobject> gb2312 in c# code? i suspect happening here simply: database has non-unicode columns, , trying store unicode data. unrepresentable characters indeed greeked. correct fix there is: make sure column unicode. messing column encodings could work, damn that's lot of work compared using unicode. dapper passes things "as is" ado.net; provider provider. there is way tell choose between ansi , unicode when sending data into database, though - via dbstring , i.e. conn.execute(sql, new { id, ...