Posts

Showing posts from May, 2013

greensock - Green Sock GSAP TweenMax, settle on last frame -

i have animated spritesheet uses following code: tweenmax.to(".globe__globe", 5, { backgroundposition:'0 -67280px', ease:steppedease.config(145)}); this means on 5 seconds, background position animated. steppedease function defines there 145 frames. works expected, @ end of animation resets first frame. need end on last frame. help? turns out frames zero-indexed if knocked 1 frames-worth height off background position , reduced frames 145, fixes it.

php - Unit testing in Laravel5 - Error -

according to: /** * call given uri , return response. * * @param string $method * @param string $uri * @param array $parameters * @param array $files * @param array $server * @param string $content * @param bool $changehistory * @return \illuminate\http\response */ public function call() in order pass headers, set them in $server parameter, i'm doing so: public function testcreatelocation(){ $response = $this->call('post', '/api/v1/token', $this->test_token_request); $tokenobject = json_decode($response->getcontent()); /** run test */ $response = $this->call('post', '/api/v1/location', $this->test_1_create_tag, [], ['authorization' => 'bearer '.$tokenobject->token]); /** read response */ $this->assertresponseok(); } however, when run unit test, following error: vagrant@homestead:~/code$ php phpunit.phar tests/locationmodeltest.php phpunit 4.6.2 seba

user interface - python GUI button manipulates label text -

hej, i want program gui in python compares prompted word (from list) entry. shall possible several times, want make button erases both entry , label , prompts next word list. thus, clicking button shall manipulate text displayed on label. bus how do this? my code excerpt is: from tkinter import * = 0 vocablist = ['one', 'two', 'three'] np.random.shuffle(vocablist) vocab = vocablist[i] (...) class simpleapp_tk(tkinter.tk): def __init__(self,parent): tkinter.tk.__init__(self,parent) self.parent = parent self.initialize() (...) self.label = tkinter.label(self, text=vocab,anchor="w") self.label.grid(column=1,row=0) def clear_text(): global self.entry.delete(0, 'end') += 1 # don't know if works! self.label.insert(0, vocab) # not work! button_next = tkinter.button(self,text=u"next", command=clear_text) button_nex

Migrating ios In App Purchase Verification -

i build ios app in ios 6. i'm trying migrate ios 7+ / ios 8, , i'm having trouble in-app purchase verification. the verification done server side. after each purchases, send skpaymenttransaction.transactionreceipt base64 string server (nodejs), uses iap_verifier ( https://github.com/pcrawfor/iap_verifier ) verify receipt. since skpaymenttransaction.transactionreceipt depricated, want change new nsbundle.appstorereceipturl, however, when send receipt server verification, apple verification says invalid. comparing base64 string of transacationreceipt , appstorereceipt , different, appstorereceipt being bigger. how verify single in-app purchase receipt new method? are sure it's not sandbox/production issue? check page , question 15: url should use verify receipt ? and make sure not hit wrong environment. check base64 encoding different tool make sure don't use buggy encoding function.

ios - Get openfire Chat History -

i unable history open fire. using xmpp framework how chat history open fire archive , print history data in nslog? you need enable option in openfire chat history. login on openfire, go group chat, go group chat settings, go history settings , select show entire chat history option.

exc bad access - HTTP Status 403 - Bad or missing CSRF value -

while i'm submitting form i'm getting error page(http status 403 - bad or missing csrf value), , in form if give method "get" working fine. when give "post" method showing above error (even not entering in controller). please give me solution it. <form action="${request.contextpath}/cart/voucher" method="post"> <input type="text" name="voucher"/> <input type="submit" value="redeem"> </form just go through link may helps https://spring.io/blog/2013/08/21/spring-security-3-2-0-rc1-highlights-csrf-protection/

c# - How to intercept any drawings on a Window's DC -

i writing program in c#. place hook on external window's dc function gets called whenever window's content has changed, , can overlay graphics/text on top of it. know kind of hooking possible since live thumbnail preview appears on windows 7. unfortunately couldn't find info on subject. clues, please ?

asp.net core - Deploy MVC 6 app in IIS -

i'm using visual studio express 2015rc , created simple mvc 6 application, when try publish don't see option deploy iis, see options microsoft azure web app, import , file system, tried file system looks more creating stand alone applications launched console, now, when debugging can select iis express or web command, there no iis option, question is, how can deploy mvc6 web application created iis? file system publish want; dnx applications stand-alone, whether asp.net 5 or console app. when publish file system, few folders; wwwroot (assuming kept default in project.json ) folder iis should point. web.config in folder generated automatically assuming keep else is. for it's worth, official documentation here , once it's written. also, on stack overflow, asp.net 5 project hosting on iis has useful information, though looks it's bit out of date @ moment.

php - Including another set of results into many-to-many relationship -

let's have 3 tables: article: id, ... advert: id, display_on_every_subsite, ... article_advert: advert_id, article_id i have eloquent's relationship: belongstomany between article , advert - article_advert pivot table. the problem need fetch adverts specified article(s) , adverts display_on_every_subsite = 1. i'm trying achieve using unions, i've @ moment: $this->belongstomany('advert', 'article_advert', 'article_id', 'advert_id')->union(advert::allsubpages()->selectraw('`advert`.*, `advert`.`id` `pivot_advert_id`, null `pivot_article_id`')->getquery()); the problem when pivot_article_id null, eloquent not attach fetched rows related model. it's that, change following: // assume have inside article model $articleid = $this->id; $this->belongstomany('advert', 'article_advert', 'article_id', 'advert_id') ->union(advert::allsubpages()

javascript - Regex JS. New line for each dot, but only outside of a quotation -

this strong me. give up, after 2 days, ask you turn this var str = 'the quick "brown. fox". jumps over. "the lazy dog"' var str2 = 'the quick «brown. fox». jumps over. «the lazy dog»' into this the quick "brown. fox". jumps over. "the lazy dog" or the quick «brown. fox». jumps over. «the lazy dog» in other words wrap every dot, should not happen if dot inside quote thanks you can use lookahead based regex: var re = /(?=(([^"]*"){2})*[^"]*$)\./g; var r; r = str.replace(/(?=(([^"]*"){2})*[^"]*$)\./g, '.\n'); quick "brown. fox". jumps over. "the lazy dog" r = str2.replace(re, '.\n'); quick «brown. fox». jumps over. «the lazy dog» (?=(([^"]*"){2})*[^"]*$) lookahead makes sure there number of quotes following dot making sure dot outside quotes. note quotes should balanced , unescaped.

java - Right place to flush the object -

i have written small piece of code printing: bufferedwriter out = null; try { out = new bufferedwriter(new outputstreamwriter( new fileoutputstream(filedescriptor.out), "ascii"), 512); out.write(msg + '\n'); out.flush(); } catch (unsupportedencodingexception e) { throw new illegalstateexception( "test failed ", e); } catch (ioexception e) { throw new illegalstateexception( "test failed", e); } { if (out != null) { out = null; } } flushing of obj done in try block only. way or should flush object in block? use modern syntax if can , don't worry that. closing automatically flush it, use try-with-resources syntax. code shorter , more readable: try(bufferedwriter out = new bufferedwriter(new outputst

OData also apply $expand in children on self-referencing entity -

i have self-referencing entity, , need $expand=other on each level. expected result: { id: 1, other: {...}, children: [ { id: 2, other: {...}, children: [...] } ], ... } but can't figure out how write query. /odata/entities/$expand=children($levels=max),other yields { id: 1, other: {...}, children: [ { id: 2, children: [...] } ], ... } the child (id: 2) missing other. here go /odata/entities/$expand=children($levels=max;$expand=other),other

php - Accessing request obejct in zend (1.12) custom validator is legal? -

i using zend framework 1.12 . have service validating token. service having 2 functions settoken : responsible generating token , store in session. validatetoken : responsible regenerating token , validate token stored in session. current situation calling settoken() function while loading form , validatetoken() function called after form submission. now want write zend custom validator . process. here custom validator: class my_validator_csrf extends zend_validate_abstract { const invalid_token = 'invalid_token'; /** * message templates * @var array */ protected $_messagetemplates = array( self::invalid_token => "csrf_form_error", ); /** * generates , set token in session. */ public function __construct() { $request = zend_controller_front::getinstance()->getrequest(); if (!$request->ispost()) { $csrfvalidator = new website_service_csrfvalidator();

Android MediaPlayer action OnCompleteListener after preparing -

after opening app , select first song play, mediaplayer action oncompletelistener , skip next song.this glitch appear 1 time after opening app , pretty annoying.any ideea how can solve ? think using preparelistener correctly. mediaplayer.setonpreparedlistener(new mediaplayer.onpreparedlistener() { @override public void onprepared(mediaplayer mp) { mp.start(); } }); mediaplayer.setoncompletionlistener(new mediaplayer.oncompletionlistener() { @override public void oncompletion(mediaplayer mp) { if (currentposition < musicurl.size() - 1) { currentposition = currentposition + 1; url = musicurl.get(currentposition); uri uri = uri.parse(url); try { mediaplayer.stop(); mediaplayer.reset(); mediaplayer.setdatasource(url); mediaplayer.prepareasync();

Scraping a website using Python and printing to a file conflict -

i trying scrape data website , write extracted data in file. related question here . in answer there function: def get_books(data): soup = beautifulsoup(data) title in soup.select("div.zg_itemimmersion div.zg_title a"): print title.get_text(strip=true) and whole thing works great. but, add line write book title in file, see not book titles displayed on screen. if there conflict somewhere or there time sensitive function somewhere. the code behave strangely alone line: def get_books(data): soup = beautifulsoup(data) f = open('myfile','a') title in soup.select("div.zg_itemimmersion div.zg_title a"): print title.get_text(strip=true) f.write(title.get_text(strip=true)) f.close()

sqlite - Recursive Query CTE in SQL Lite -

i have following table structure. (i new sql lite) create table relations ( code int, parentcode int , fname text ) go insert relations values(1,null,'a'); insert relations values(2,null,'b'); insert relations values(3,2,'c'); insert relations values(4,3,'d'); i want initial parent of code =4 : i.e. values 2 null b i not able figure out how write recursive query in sqllite. in advance.. was version issue.. query not working & getting syntax error. upgraded 3.7.17 3.8.7.4 version & worked.. with recursive works(code,parent) ( select code,parentcode relations a.code=4 union select relations.code, relations.parentcode relations , works relations.code=works.parent ) select * works parent null

java - HtmlUnit on Moodle: FileUpload fails despite success message -

i try upload file moodle2 container. done via yui. skip stuff disable java script in webclient (browser) "noscript" elements. after analysing these page filepicker.php of moodle called. the page looks this. <form action="http://demo.moodle.net/repository/filepicker.php?ctx_id=41&amp;itemid=861552155&amp;env=editor&amp;course=2&amp;maxbytes=67108864&amp;areamaxbytes=-1&amp;maxfiles=-1&amp;subdirs=1&amp;sesskey=chtrokyblc&amp;action=browse&amp;draftpath=%2f&amp;savepath=%2f&amp;repo_id=3" method="post" enctype="multipart/form-data" style="display:inline"> <label>attachment: </label><input name="repo_upload_file" type="file"><br> <input name="action" value="upload" type="hidden"><br> <input name="draftpath" value="/" type="hidden"><br>

php - wrap new line variable with <li> -

we using whmcs , within product section want wrap product <li></li> on every new line. far have done following, gets me items puts them in 1 line, haven't been able work out how assign these stripped values new var wrapped list tag. {foreach from=$product.features key=feature item=value} {$value|strip_tags} {foreachelse} {$product.description|strip_tags} {/foreach} you can use following code: {assign var=lines value="\n"|explode:$product.description|strip_tags} <ul> {foreach key=k item=line from=$lines} <li>{$line}</li> {/foreach} </ul>

Controlling the tubes for Queued Events in Laravel 5 -

so i've started using queued events in l5 handling logic , wondering if possible tell laravel tube use when pushing events onto beanstalkd. i couldn't see in documentation it. after digging through event dispatcher code . i found if there queue method on event handler laravel pass arguments through method , let call push method manually. so if have sendemail event handler can this: <?php namespace app\handlers\events; use app\events\userwascreated; use illuminate\queue\interactswithqueue; use illuminate\contracts\queue\shouldbequeued; class sendemail implements shouldbequeued { use interactswithqueue; public function __construct() { } public function queue($queue, $job, $args) { // manually call push $queue->push($job, $args, 'tubenamehere'); // or pushon $queue->pushon('tubenamehere', $job, $args); } public function handle(userwascreated $event) { /

python - How to use the same auth userprofile in multiple apps in Django 1.6 -

i'm using django 1.6 auth module login users , have project consisting of 2 apps , want use same user calling request.user.username in view in second app. is, in template login.html in first app works {% if user.is_authenticated %} {% if user.is_authenticated %} not work in second apps templates , i'm wondering how can fetch in functions in second app? i've tried fetch user=request.user.username doesn't work. in first app: models.py from django.contrib.auth.models import user class userprofile(models.model): user = models.onetoonefield(user) title = models.charfield(max_length = 70) def __unicode__(self): return self.title class oneuser(models.model): firstname = models.charfield(max_length = 35) lastname = models.charfield(max_length = 35) email = models.emailfield() belongsto = models.foreignkey(userprofile, related_name='pcslabeler_userprofile') def __unicode__(self): return self.firstname in view

sql - SUM quantity based on 3 columns in the table -

Image
i have table shown here: . i need sum quantities same item , loc combinations dates in monthly buckets. instance between 1-june , 30 june, need sum quantities based on item , loc combinations. select item, loc, year(date), month(date), sum(qty) quantity table group item, loc, year(date), month(date)

python 3.x - How to check the part of file name in python3? -

for example if have files: applepie.txt applejam.txt applesauce.txt beercan.txt beercup.txt and want download apple.txt, boar.txt, , cat.txt on internet. here's point. if not os.path.isfile(apple.txt) urlretrieve(apple.txt) is not work, of course. there not apple.txt. but exist applepie, jam, sauce. so don't want download apple, boar, cat. how can check of apple files, , pass download. you can use os.listdir() or glob module. listdir easier use should start that.

javascript - Looping throught json -

i'm writing ajax post request. problem don't know how loop throught json. on success got function: .done(function ( data ) { $('#records').append(data); }); and prints content #records this: 0: {id: 1, user_id: 1, title: "first", created_at: "2015-05-15 06:50:21",…} 1: {id: 2, user_id: 2, title: "second", created_at: "2015-05-15 06:50:38",…} 2: {id: 3, user_id: 3, title: "third", created_at: "2015-05-15 06:50:41",…} 3: {id: 4, user_id: 4, title: "fourth", created_at: "2015-05-15 06:50:45",…} how loop throught id's , pick it's content (1,2,3,4)? in advance! .done(function ( data ) { $.each(data, function(item) { $('#records').append(item.id); }); });

javascript - Facebook Login callback not working in titanium -

i trying implement facebook login in titanium app. login working callback method not calling when user login or logout. i have added module. added key in tiapp.xml then have coded in .js file var fb = require('facebook'); fb.appid = 11111111111111; fb.permissions = ['public_profile','email']; fb.forcedialogauth = true; var fblogin = fb.createloginbutton({ top : '25%', style : fb.button_style_wide, zindex : 10 }); fb.addeventlistener('login', function(e) { if (e.success) { alert('logged in'); } else if (e.error) { alert(e.error); } else if (e.cancelled) { alert("canceled"); } console.log("outside "); }); fb.addeventlistener('logout', function(e) { alert('logged out'); }); win.add(fblogin); try calling fb.initialize() @ end of file.

javascript - Backbone search collection for model that has attribute that matches string -

i writing search function @ moment backbone application, idea user can enter string , app search , return matching models string appears in of attributes. far have following, view function run on keyup, this.results = this.collection.search(letters); this runs following code located in collection, search: function( filtervalue ) { filtervalue = filtervalue.tolowercase(); var filterthroughvalue = function(data) { return _.some(_.values(data.tojson()), function(value) { console.log(value); if(value != undefined) { value = (!isnan(value) ? value.tostring() : value); return value.tolowercase().indexof(filtervalue) >= 0; } }); }; return app.collections.filtercollection = this.filter(filterthroughvalue); } however running following error, uncaught typeerror: undefined not function this error shown being line return value.tolowercase().indexof(filtervalue) >= 0;

Groovy using variable in import command -

there same question python language on web-site, need same thing in groovy: env = system.getenv("instance") cp = ${env} + ".vars" import "${cp}" this of course doesn't work, there possibility use variable inside import command in groovy? i'm novice in groovy , can't figure out, googled lot, without success. grateful helps. no can not import via string. can load class there via class.forname(cp) (then use e.g. via newinstance() .

javascript - X-Editable bootstrap plugin "hidden" event issue on dynamically added elements -

i cannot x-editable`s "hidden" event work on dynamically added classes (or fields) via js. can manage work if add editable classes straight on html, approach not suitable me. doing wrong? $.fn.editable.defaults.mode = "inline"; $.fn.editable.defaults.onblur = "submit"; $(document).ready(function () { $('.field').each(function() { $(this).addclass('editable'); }); $('.editable').editable(); }); $(document).on('hidden', '.editable', function(e, params) { alert('was hidden!'); }); fiddle: http://jsfiddle.net/4vj8buks/17/ you can hook editable's hidden event this: $.fn.editable.defaults.mode = "inline"; $.fn.editable.defaults.onblur = "submit"; $(document).ready(function () { $('.field').each(function() { $(this).addclass('editable'); }); $('.editable').editable().on('hidden', function (e, pa

java - Is my HTTP protocol design correctly implemented in the coding? -

it's simple client-server application. client sends commands server , server gives output client. however, special concern get command sent server. client request get filename download named file. file gets downloaded client directory http response headers, have designed protocol. now afraid if coding follows protocol accurately. http response headers line break (in both client , server side). protocol design: client: syntax: namedfile crlf crlf meaning: downloading named file server representation: text file server: syntax: status: ok crlf length: 20 bytes crlf crlf file contents meaning: file exist in server , ready download representation: text file code: serverside: ................. ................. else if (request.startswith("get")) { system.out.println(""); string filename = request.substring(4); file file

c# - Package.appxmanifest: Identity-property and certificate (correlation?) -

Image
i'm confused. lot of stuff microsoft development process regarding windows store apps. i'm going submit app windows store i'm uncertain following in package.appxmanifest file. <identity name="mycompanyname.123456789" publisher="cn=abcabcab-abca-abca-abca-abcabcabcabc" version="1.0.0.0"/> this example , similar created when using a test-certificate. on windows store dashboard can find identity think i'm supposed use: in docs says "publisher" property used for: describes publisher information. publisher attribute must match publisher subject information of certificate used sign package. what mean? "must match publisher subject information", referring to? since need create real certificate soon, need know stuff needs match before create it. any appreciated. thanks! if you're publishing through store don't need worry this. store sign app. associate app store visual st

ios - How to prevent crash when selecting specific contact using AdressBookUI -

i'm getting crash on line. phonenumber = cfbridgingrelease(abmultivaluecopyvalueatindex(numbers, index)); if first phone number selected index of 1 wrong. should 0 , therefore choses wrong number. if select second number gives index of -1 crashes app. #pragma mark helper methods - (void)didselectperson:(abrecordref)person identifier:(abmultivalueidentifier)identifier { nsstring *phonenumber = @""; abmultivalueref numbers = abrecordcopyvalue(person, kabpersonphoneproperty); if (numbers) { if (abmultivaluegetcount(numbers) > 0) { cfindex index = 0; if (identifier != kabmultivalueinvalididentifier) { index = abmultivaluegetindexforidentifier(numbers, identifier); } phonenumber = cfbridgingrelease(abmultivaluecopyvalueatindex(numbers, index)); } cfrelease(numbers); } self.numbertextfield.text = [nsstring stringwithformat:@"%@", phonenumber];

php - Symfony templating array doesn't work -

i use symfony. created helper class sendmessage use symfony\component\dependencyinjection\containerinterface container; class sendmessage { private $container; public function __construct(container $container) { $this->container = $container; } public function addentitymessage($creator, $projectname, $type, $sendto) { $mailer = $this->container->get('mailer'); $message = \swift_message::newinstance() ->setsubject('hello email') ->setfrom('emailfrom@gmail.com') ->setto($sendto) ->setbody( $this->container->get('templating') ->render('mybundle:email:new_entity.html.twig'), array( 'creator' => $creator, 'name' => $projectname, 'type' => $type ) ) ; $m

php - How to use default parameter value in a nested call? -

i have situation: function a (a class method, it's not important, here...) invokes function b . function a has 1 parameter (say, $p2 ), default value. function b has 1 parameter (say, $q2 ), default value, too. if function a called without parameter $p2 , function b should called without parameter $q2 , too, force using it's default value. if function a called with parameter $p2 , function b should called with parameter $q2 . to clearify example: function a($p1, $p2 = "default value one") { if ($p2 === "default value") { b($p1); } else { b($p1, $p2); } } function b(q1, q2 = "default value two") { ... } of course it's possible use test, in example above, looks me ugly solution... question is: is there better (faster, cleaner, smarter) code implement use case? i think should you're looking for: just function arguments func_get_args() , call next function call_user_func_array() . func

how to track emails in google analytics? -

so want track emails sent web application, follow [tutorial][1] but didn't have result, image url put email template : http://www.google-analytics.com/collect?v=1&tid=tid_id&cid=cid_key&t=event&ec=email&ea=open&el=open_email&cs=newsletter&cm=email&cn=test_newsletter in google analytics create account web application address dev.mylittlebiz.fr emails send via mailgun via address mylittlebiz.fr. so please if has idea appreciative.

c# - Is there a way to add a web.config value to xml documentation? -

so have web.config value access code behind as: configurationmanager.appsettings["searchalgorithmenabled"] is there way add tag in xml documentation similar this? /// <summary> /// search algorithm enabled: <%=configurationmanager.appsettings["searchalgorithmenabled"]%> /// </summary> thanks. xml documentation generated @ compile time , static. the web.config value can change after application has been deployed. perhaps need 'settings' or 'config' page shows value dynamically.

Issue with WebView.EvaluateJavaScript in Android Xamarin -

i using following code injecting java script in android web view webview webview = findviewbyid<webview> (resource.id.learningwebview); if (null != webview) { webview.settings.javascriptenabled = true; webview.settings.setsupportzoom (true); webview.setwebviewclient (new customwebviewclient ()); } webview client implementation public class customwebviewclient : webviewclient { public override bool shouldoverrideurlloading (webview view, string url) { view.loadurl (url); return true; } public override void onpagestarted (webview view, string url, android.graphics.bitmap favicon) { } public override void onpagefinished (webview view, string url) { base.onpagefinished (view, url); hidelearningdivs (view); } void hidelearningdivs (webview view) { try { view.evaluatejavascript ("document.getelementbyid(\"suitebar\").parentnode.style.display=

iphone - Speech to text in ios -

i want create ios application convert voice text. searched , found openears framework. framework need words , sentences saved in project. i want convert voice text in application. suggest me framework or sample code more helpful.

multithreading - Why only std::atomic_flag is guaranteed to be lock-free? -

from c++ concurrency in action: difference between std::atomic , std::atomic_flag std::atomic may not lock-free; implementation may have acquire mutex internally in order ensure atomicity of operations i wonder why. if atomic_flag guaranteed lock-free, why isn't guaranteed atomic<bool> well? because of member function compare_exchange_weak ? know machines lack single compare-and-exchange instruction, reason? first of all, allowed have std::atomic<very_nontrivial_large_structure> , std::atomic such cannot guaranteed lock-free (although specializations trivial types bool or int could, on systems). unrelated. the exact reasoning why atomic_flag , nothing else must be lock-free given in note in n2427/29.3: hence operations must address-free. no other type requires lock-free operations, , hence atomic_flag type the minimum hardware-implemented type needed conform standard. the remaining types can emulated atomic_flag , though less ideal pro

gsettings changes are not working over ssh -

i trying set idle timeout ubuntu 14.04 using gsettings ssh. the commands using this dbus-launch gsettings set org.gnome.desktop.session idle-delay 600 dbus-launch gsettings set org.gnome.desktop.screensaver lock-delay 0 dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled true dbus-launch gsettings set org.gnome.desktop.screensaver idle-activation-enabled true after commands executed various timeout periods changes taking place, timeout changes getting lost after reboot or logout. is possible make timeout change persistent on reboot/logout.

java - How to set javax.ws.rs.Path annotation value from properties -

this question has answer here: jaxrs variable @path 1 answer i want set javax.ws.rs.path annotation value properties file. the purpose not make configurable, rather purpose separate value code. the following code works: private final string path="my_path"; @get @path(path) @produces(mediatype.text_xml) public string wsdlrequest(@context uriinfo uriinfo) { .... ... .. } but following not: private final string path=bundle.getstring("path"); i guess 1 cannot, since value isn't available in compile time.

java - how to run weblogic domain as windows service -

i have created domain on weblogic server version 10.3.6. after deployed war file on domain. windows server server 2003 when start startweblogic.cmd in mydomain\bin server work alright. when log off stops automatically. here tried create window service described on oracle docs " http://docs.oracle.com/cd/e11035_01/wls100/server_start/winservice.html ". but service stops saying has nothing . here 2 files created 1.) run.cmd in d:\weblogic\user_projects\domains\test\bin { setlocal set domain_name=test set userdomain_home=d:\weblogic\user_projects\domains\test set wl_home=d:\weblogic\wlserver_10.3 set server_name=adminserver set java_home=d:\java\jdk1.7.0_79\jdk1.7.0_79 set wls_user=weblogic set wls_pw=weblogic123 pause set production_mode=true pause call d:\weblogic\wlserver_10.3\server\bin\installsvc_ank.cmd pause endlocal } 2.) installsvc.cmd in d:\weblogic\wlserver_10.3\server\bin { @echo off setlocal set admin_url=http://localhost:7005 set mem_

java - How do I place two JMenuItems adjacent to each other? -

Image
my code: jmenubar bar = new jmenubar(); jmenu menu = new jmenu("edit circle"); jmenuitem = new jmenuitem("help"); jmenuitem exit = new jmenuitem("exit"); bar.add(menu); bar.add(help); bar.add(exit); output of jmenubar : i want output this: what need in order expected output? you cannot add jmenuitem in jmenubar . try this.. it'll work.. jmenubar bar = new jmenubar(); jmenu menu1 = new jmenu("edit circle"); jmenu = new jmenu("help"); jmenu exit = new jmenu("exit"); bar.add(menu1); bar.add(help); bar.add(exit); exit.addmenulistener(new menulistener() { @override public void menuselected(menuevent e) { system.out.println("exiting"); } @override public void menudeselected(menuevent e) { } @override public void menucanceled(menuevent e) { } }); you cannot add actionl

print a file in landscape from Windows command line or powershell -

i can happily print file using get-content e.g. : get-content .\test.txt|out-printer "epson wp-4525 series" how can in landscape? can't in powershell on command line matter of sending correct escape code printer. printers support hp escape sequences that. see eg here basic list. can either echo characters directly printer, insert them in text file or send them through separate files. in last case can insert code esc&l1o in file, eg landscape.prn, need code eject page printer esc&l0h . esc ascii 27 character, need save in editor capable of this, in notepad need save file unicode. copying whole thing printer goes shared usb or network printer copy /b landscape.prn+text.txt+eject.prn \\pcname\shared_printer_name or copy /b landscape.prn+text.txt+eject.prn lpt1 if use parallel printer or redirect lpt1 the /b copy in binary mode making sure characters passed.

java - Implicitly convert groovy type to pass to a fixed non-groovy method -

i writing scala application loads groovy "plugin" classes @ runtime. once plugins loaded, standard scala types (like list , option ) passed them processing. groovy naturally doesn't have syntactic sugar scala types (particularly function* family), i'd similar easy syntax. best have right use as operator coerce groovy closures scala types, e.g: list<string> list = ... // scala list list.map({ it.touppercase() } function1<string,string>) it nice not have include as ... tail every time it's bigger actual closure. this question suggests changing receiving method not specify parameter type, works when it's groovy method can control. i'm using compiled scala/java classes. i'm aware there various means implicitly converting things in groovy, there many small isolated groovy scripts being loaded independently. don't know groovy enough understand mechanism best suits architecture loaded plugins implicit conversion minimal cere

gwt rpc - how to minimize servlet declarations for gwt-rpc in web.xml? -

sorry still beginner in gwt. have noticed when project grow , declarations of servlets rpc in web.xml file many, many , many. single *serviceimpl class , need define in web.xml as <servlet> <servlet-name>greetservlet</servlet-name> <servlet-class>com.my.testing.server.greetingserviceimpl</servlet-class> </servlet> <servlet-mapping> <servlet-name>greetservlet</servlet-name> <url-pattern>/testing/greet</url-pattern> </servlet-mapping> if if have 30 *serviceimpl class, may take 200 lines in web.xml rpc calls. , know is web.xml file place declare rpc servlets ? has someways skip declarative styles (i mean via annotations '@' etc) ? gwt works pretty without these declarations in web.xml, using annotations: /* * server-side rpc-implementation */ @webservlet(name = "yourservice", urlpatterns = {"/path/to/yourservice"}) public class yourserviceimpl ex

Fullcalendar not showing up events - PHP mysql -

Image
i using full calendar in php application. issue events don't show in calendar. calendar.php - <?php $host = "localhost"; $user = "myusername"; $pw = "mypass"; $database = "mydb"; $db = mysql_connect($host,$user,$pw) or die("cannot connect mysql."); mysql_select_db($database,$db) or die("cannot connect database."); $year = date('y'); $month = date('m'); $command = "select * `calendar_urls` "; $result = mysql_query($command, $db); while ($row = mysql_fetch_assoc($result)) { $url = $row['calendar_array']; $urls[] = $url; } ?> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html> <head> <link rel='stylesheet' type='text/css' href='fullcalendar/fullcalendar.css' /> <link rel='stylesheet' type='text/css' href

After jQuery page reload without refresh, animation is not working -

i need page reload without refresh function reset statement of animation. that's why tried reload $('#wrapper').load('http://localhost:7002/myproj/home'); but, after reloading, jquery click functions not working. idea please? thanks the below piece of code.. still need give function other 2 div. called div1 , div3. $(".div2").mouseover(function () { $('#pp').attr('src', '../../resources/images/aa.png'); if (cube.width() == 550) { $('.imagediv').append(pp); } }).mouseout(function () { $('#pp').attr('src', '../../resources/images/bb.png'); pp.remove(); }).on("click", function (event) { $('.div1, .div3').on('click', function () { $('#cube').fadeto("slow", 1); $('.imagediv').contents(':not("#cube")').remove(); $('#cube').animate({ width: '550px'

c# - Send email with attach file WinRT -

i need send email log file windows phone 8.1 app. found way : var mailto = new uri("mailto:?to=recipient@example.com&subject=the subject of email&body=hello windows 8 metro app."); await windows.system.launcher.launchuriasync(mailto); is there special parameter specify attach file or completly different way ? you should able use emailmessage class this. sample code can this: private async void sendbtn_click(object sender, routedeventargs e) { emailmessage email = new emailmessage { subject = "sending test file" }; email.to.add(new emailrecipient("mymailbox@mail.com")); // create sample file send storagefile file = await applicationdata.current.localfolder.createfileasync("testfile.txt", windows.storage.creationcollisionoption.replaceexisting); await fileio.writetextasync(file, "something inside file"); email.attachments.add(new emailattachment(file.name, file)); // add attachment

Separate allocate() definition leads to "undefined reference" link error in C++ custom allocator -

this question has answer here: why can templates implemented in header file? 13 answers the code placed in 3 files: test.hpp, test.cpp, another.cpp. source code test.hpp: #ifndef test_hpp_ #define test_hpp_ template<typename t> class allocator { public: typedef size_t size_type; typedef ptrdiff_t difference_type; typedef t* pointer; typedef const t* const_pointer; typedef t& reference; typedef const t& const_reference; typedef t value_type; template<typename o> struct rebind { typedef allocator<o> other; }; allocator() {} allocator(const allocator& alloc) {} template<typename o> allocator(const allocator<o>& alloc) {} ~allocator() {} pointer address(reference __x) const { return &__x; } const_pointer address(const_reference __x) const { return &__x; }

android - Scrolling GridView's items make GridView scrolls up down and will be gone -

i request see video know issue https://www.youtube.com/watch?v=gszsmrpezsi&feature=youtu.be gridview scrolls , gone when scroll it's item this issue not occurring when there limited no. of items in gridview or when scroll slowly i have taken custom gridview, in loading images , text server below code gridview's xml file <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/background" > <textview android:id="@+id/edttxtprofilequotes" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="@dimen/small_margin" android:background="@drawable/blue_notification_shape" android:dr