Posts

Showing posts from July, 2011

Vaadin - How add checkbox component to a tree? -

Image
i'm using vaadin 7.5.3 develop web application. there need tree selectable nodes. want select nodes using checkboxes. after trying many ways , goggling, not find how add checkbox component tree node. as per knowledge, current latest version aka vaadin 7.5.6, not possible, jouni point out in discussion on forums . has opened an improvement ticket don't see changes far. nonetheless, should able fake using treetable component . can find here complete example, , below excerpt it: final treetable ttable = new treetable("my treetable"); ttable.addcontainerproperty("name", checkbox.class, ""); ttable.addcontainerproperty("city", string.class, ""); ttable.setwidth("20em"); // create tree nodes ttable.additem(new object[]{new checkbox("root"), "helsinki"}, 0); ttable.additem(new object[]{new checkbox("branch 1"), "tampere"}, 1); ttable.additem(new object[]{new checkbo...

mysql - Retrieving data from Database using angular.js and PHP -

i need retrieve data database , bind them in text-field using angular.js , php. explaining code below. index.php <?php include_once 'dbconfig.php'; ?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>crud operations php , mysql - cleartuts</title> <link rel="stylesheet" href="css/style.css" type="text/css" /> </head> <body> <center> <div id="body"> <div id="content"> <table align="center"> <tr> <th colspan="5"><a href="add_data.html">add data here.</a></th> </tr> <th>first name</th> ...

asp.net - Umbraco Website content issues -

i have strange problem umbraco i have 3 websites locally using umbraco 6.2.5 lets website1, website2 , website3 all 3 using 3 different mssql databases. everything fine until finished third website. when browse locally navigations fine...they connect respective pages database. but problem started ..when connect website1's backend.. left hand side content pane showing website2's content pages similarly when open website3 in browser showing pages respective databases backend content pane showing website2's content. i have make sure databases different in each case. think caching problem not sure...also not sure solution please me you can try force reloading cache: right mouse click on content -> republish entire site or directly calling url http://<<yourdomain.com>>/umbraco/dialogs/republish.aspx?xml=true

java - Date returned by resultset.getString was wrong at some time -

i using mysql database.here have datetime field in table , in java code value using resultset.getstring method.it works fine returns wrong date or previous date. here java code: resultset.getstring("date_of_schedule") it returns '2015-09-21' correctly return '2015-09-20' date.can explain me doing wrong.

html - How this div align the middle? -

i have sample: link i want align second div middle of first div...i tried vertical-align:middle not working. it because put container display: table ? code html: <div class="container-logo"> <div class="logo">logo</div> <div class="profile-name">name</div> </div> code css: .container-logo { display: table; margin: 0 auto;} .logo{ clear: none; float: left; height: 57px; width: auto; background:red; } .profile-name{ float: left; width: auto; color: blue; /* line-height: 22px; */ font-size: 14pt; background:aqua; font-family: montserrat regular; } what problem not work ... can give me advice please? thanks in advance! edit: my items must in line , have same height ... want second div put in middle of first ... same height <div class="container-logo"> replace class name. .container-logo { ...

excel - Find the difference between two cells -

Image
below example of excel sheet. in want find gain , loss using e , d cells. if e>d should calculate e-d , value should entered in f cell , if e enter formula cell f2 : =if(e2 > d2, e2 - d2, "-") then enter formula cell g2 : =if(e2 <= d2, e2 - d2, "-") for row not gain or loss, - dash appear in column.

PHP CURL cookie not sent in the website but works in the localhost test -

$ch=curl_init(); curl_setopt($ch,curlopt_url,$url); curl_setopt($ch,curlopt_header,false); curl_setopt($ch, curlopt_cookie,"denial=93a7a7e8b5af9f19a6df5e9850f8a64a;"); curl_setopt($ch,curlopt_returntransfer,1); $the_source = curl_exec($ch); //echo $the_source; curl_close($ch); the code works in localhost, not work in real site, have check curl installed , works when using post method not method. keep googling hours no solution yet. appreciate. it server depended problem. or 3rd tools on server. for example this issue looks similar. the problem hosting use special "php protection system suhosin " encrypt session (session cookies) curlopt_cookie not work. the solution disable suhosin.session.encrypt parameter in /etc/php5/conf.d/suhosin.ini file: suhosin.session.encrypt = off did try answer in server os community ? know "specail" php tools on server installed ? describe in question.

ios - Weird issues with xcode 7 -

when use xcode 6 apps works fine. when update new xcode 7 apps has problems. scrollview news not work. in tableview when tap 1 record simulator or iphone freeze. problem? i had similar problem xcode 7. if app runs on ios 9 please refer ios 9 release notes possible issues: https://developer.apple.com/library/prerelease/ios/releasenotes/general/rn-iossdk-9.0/ sometimes, recreating problematic view controllers in story board solve problem, in xcode 7 outlets in storyboard work differently way used work in previous versions. (as worked xcode 7 beta quite time, can tell how annoying can get...).

Sonarqube report in graph/chart for time (weekly/daily) and number of issues -

i want display graphical report based on time (weekly/daily) shows status of static code analysis on period of time. e.g. vertical bar denote number of issue , horizontal display time day/month/week. keep watch of code quality on period of time (something burn down chart of scrum). can me this? the 5.1.2 issues search web service includes parameters let query issues creation date. best best use ajax requests data need , build widget there. note can query iteratively across date range using &p=1&ps=1 (page=1 , page size=1) limit volume of data flying around, , mine total value in top level of response answer. here's example on nemo

python - django user group from request user -

i have assigned user group developer , in admin want query like: user_group = request.user.groups its giving me auth.group.none though have assigned user in group. why getting none while have assigned user group as matth pointed out here https://stackoverflow.com/a/2245908/5936450 use following (slightly altered example): user_group = request.user.groups.values_list('name', flat=true)

c++11 - an error "undefined reference to 'log4cplus::Logger::operator=(log4cplus::Logger&&)'" -

now there problem when want compile project needs ld liblog4cplus.a when use compile option -std=c++11 ,then there's error undefined reference 'log4cplus::logger::operator=(log4cplus::logger&&)' but whole project needs option -std=c++11 how can solve problem? ps : compiled on ubuntu 12.04 ,which gcc version:4.8.2 , liblog4cplus version:1.1.3 you have compile both code , log4cplus library or without -std=c++11 flag. mixed compilations not supported.

javascript - How to close a tooltip message when onblur? -

i tried view tooltip message on mobile. when click on tooltip image, show message, message not close when scroll down screen. how can close tooltip message onblur tooltip image? following code works fine when viewed in desktop browser, not on mobile. /* add attribute element needs tooltip */ [data-tooltip] { position: relative; z-index: 2; cursor: pointer; } /* hide tooltip content default */ [data-tooltip]:before, [data-tooltip]:after { visibility: hidden; -ms-filter: "progid:dximagetransform.microsoft.alpha(opacity=0)"; filter: progid: dximagetransform.microsoft.alpha(opacity=0); opacity: 0; pointer-events: none; } /* position tooltip above element */ [data-tooltip]:before { position: absolute; bottom: 150%; left: 50%; margin-bottom: 5px; margin-left: -80px; padding: 7px; width: 160px; border-radius: 2px; border: 1px outset #c0c0c0; box-shadow: 3px 2px 5px #9f9f9f; background-color: #000; ba...

arrays - Get Value After Payment -

i have following object. how email value it? { "payment_method": "paypal", "payer_info": { "email": "example@domain.com", "first_name": "example", "last_name": "xxx", "payer_id": "12313213", "shipping_address": { "recipient_name": "example", "id": "5435345", "line1": "1 ss ", "city": "san jose", "state": "ca", "postal_code": "95131", "country_code": "us" }, "phone": "4547567", "country_code": "us" } }

java - How to use logback filter by this case? -

i have 3 java files: asimple.java bsimple.java csimple.java asimple.java: private final logger logger = loggerfactory.getlogger("i logger"); bsimple.java: private final logger logger = loggerfactory.getlogger("smile"); csimple.java: private final logger logger = loggerfactory.getlogger("i handsome"); i want print logger name "i am*". (just print asimple.java , csimple.java) not "smile". how change logback.xml?

oracle - Issue while checking data before loading in sql data loader -

i using following code excerpt while loading data in oracle db using sql loader: "tran_code position(238:239)," + "frm_acct position(247:265) \"to_number(:frm_acct)\" nullif :frm_acct='*******************'," + "to_acct position(269:287)," + it giving error on null if guess issue clear want insert null when data contains asterisk otherwise convert number , insert. thanx in advance. you can try - "decode(:your_col,'***************',null,to_number(:your_col))" however, suggest better option in scenarios "external table". here's link reference :- http://docs.oracle.com/cd/b19306_01/server.102/b14215/et_concepts.htm

php - laravel 5.1 white screen error; -

i working on project , completed tasks; need deploy on ftp test. stuck right there when shows blank page; .htaccess file working, index.php reachable; works line 50 of index.php: $kernel = $app->make(illuminate\contracts\http\kernel::class); // upto every thing fine after line echo command not working means error right there $response = $kernel->handle( $request = illuminate\http\request::capture() ); $response->send(); $kernel->terminate($request, $response); i set appropriate permission folders storage , bootstrap; , php version 5.5.9. how can shoot problem; took long time what's problem it only guess able answer here possible. i guess missing php module curl or did not enable fopen wrappers http/url. depends "illuminate\http" using. try enable php error log.

php - Anchor tag redirects to wrong path -

i want redirect using anchor tag. path changed while redirecting. for eg.my path ' company/limit -l.doc ' it redirects ' company/limit+-l.doc '. file uploaded company/limit -l.doc in folder. adds '+' in whitespace. $headers .= "content-type: text/html; charset=iso-8859-1\r\n"; $url='resume/'.$_files['resume']['name']; $url1="//sample.com/domain/".$url; $body.='resume :<a href="'.$url1.'" download>download</a> <br>'; you need url encode document name because has space http://php.net/manual/en/function.rawurlencode.php convert "limit -l.doc" "limit%20-l.doc" $body.='resume :<a href="//sample.com/domain/company/'.'.rawurlencode($url).'" download>download</a> <br>'; the slashes '/' encoded rawurlencode need keep folder structure out of url encoding http://sandbox.onlineph...

android - How to Click on item of recycler view using robotium -

i have robotium 5.4 don't know how click on item in recycler view in android. for me worked method clickinrecyclerview(int itemindex). from source code: /** * clicks specified item index , returns arraylist of textview objects that * item index displaying. use first recyclerview finds. * * @param itemindex item index click * @return {@code arraylist} of {@linktextview} objects located in item index */ public arraylist clickinrecyclerview(int itemindex) {

java - Parsing key value pairs using regular expression -

i've scenario have capture key value pairs string key cannot contain spaces. following constraints apply values: they can contain spaces when delimited single or double quotes. they can contain single quotes when delimited double quotes. they can contain double quotes when delimited single quotes. key value pairs separated using spaces/tabs. single string contains key/value pairs extract (using / string delimiters simplicity): /abc="hello how you" xyz="i'm good. how you?" pqr='using " double quotes'/ i parse above string , extract name/value pairs: abc="hello how you" xyz="i'm good. how you?" pqr='using " double quotes' see demo (\w+)=(['"])((?!\2).+?)\2 $1 key , $3 value while(match.find()){ //save map }

Loopback MySQL to MongoDB migration with relationship -

i have mysql structured schema maintained proper relationship in mysql in loop-back, wish convert same schema in mongodb maintaining relationship in embedded followed mongo. tool can run in loopback converts same schema , relationship in mongodb. i have done simple database name changes in model-config.json implement/convert in mongodb. right approach? please suggest migration mongodb.

php - Accessing Silex Application class from other classes; how to inject? -

i'm working on first silex (2.0) project. have pheasant models defined, can access within controller: // used both static $p = \model\post::onebyid(3); // .. , instance $p = new \model\post; $p->title = 'foobar'; $p->save(); now, in cases i'd access application class within model. example, check if we're running in debug mode (or not). right now: public function beforesave() { global $app; if($app['debug']) { // ... } } but doesn't feel silex. figured need kind of thing that'll automatically inject $app class models: class pheasantmodelreflector { protected $app; public function __construct(\silex\application $app) { $this->app = $app; } public function __get($classname) { $r = (new reflectionclass(sprintf('model\%s', $classname)))->newinstance(); $r->__invoke($this->app); return $r; } } $app['model'] = function ($app) { r...

.net - How to Detect a form open inside the application -

is possible detect when form opens inside application? i have assembly used , initialized several applications. need use assembly detect, when form inside application opens, able modify it. the solution found, yet, using messagefilter, edit: most efficient way getting notified on window open - ask windows in processes want windows in own process. since i'm interested in own application/process hope find sole .net solution. application.addmessagefilter(new messagefilterimpl()); class messagefilterimpl : imessagefilter { public bool prefiltermessage(ref message m) { control wnd= form.fromhandle(m.hwnd); if (wnd form) knownforms.add((form)wnd); return false; } } i found first message receive 0xc052, still didn't find actual meaning. the first intention choose better design, i'm not allowed to.

java - Sending two different emails at the same time using JavaMail API -

i'm using javamail api notify administrator when there's data insertion in database this works fine. admin receives notification of data entry. however, need notify client sending him confirmation @ same time, not work. customer not receive confirmation. want paste confirmation number in subject. related port conflict? emailadmin.sendemail(to, subject, body); emailcustomer.sendemail(em, subjectsub, bodybod, cn); emailadmin.java package session; import java.util.date; import java.util.properties; import javax.ejb.localbean; import javax.ejb.stateless; import javax.mail.*; import javax.mail.internet.internetaddress; import javax.mail.internet.mimemessage; @stateless @localbean public class emailadmin { private final int port = 465; private final string host = "smtp.server.com"; private final string = "admin@domain.com"; private final boolean auth = true; private final string username = "admin@domain.com"; ...

android - Coordinatorlayout adjustresize not working -

my code (and more): have coordinator layout follows <android.support.design.widget.coordinatorlayout android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true"> <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:fitssystemwindows="true"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapse_toolbar" android:layout_width="match_parent" android:layout_height="280dp" android:fitssystemwindows="true" app:contentscrim="@color/transparent" app:layout_scrollflags="scroll|exituntilcollapsed"> <include layout="@layout/top" /> <!-- relativelayout --> ...

python - Replace characters without opening Excel file -

i have large excel file (450mb+). need replace (,) -> (; or .) 1 of fastload scripts work. not able open file @ all. script involve opening file, performing operation, saving , closing file, in order. will vb script work here 450mb+ file, wherein file not opening only. is there vb script , shell script, python, java etc can write perform replacement(operation) without opening excel file? or alternatively, there way of opening excel file big , performing operation. if have access linux environment (which might since mention shell script 1 of options) use sed in terminal or putty: sed -i .bak 's/,/;/g' yourfile.excel sed streams text without loading entire file @ once. -i make changes original file providing .bak create copy named yourfile.excel.bak first

javascript - In the tabpanel of ExtJS 4, how to create parent tab includes 2 child tab -

Image
i have 2 parent tabs, each tab includes 2 child tab. pls see picture more detail: how create group tab parent tab , when author click parent tab, child tab shown. thanks ext.widget('tabpanel', { width: 500, activetab: 0, items: [{ title: 'parent tab 1', items : [ ext.widget('tabpanel', { activetab: 0, items : [{ title: 'child tab 1', bodypadding: 10, html : "my content of child tab 1 here" },{ title: 'child tab 2', bodypadding: 10, html : "my content of child tab 2 here" }] }) ] },{ title: 'parent tab 2', bodypadding: 10, html : "parent tab 2 content here without child tabs" }] }); here fiddle example of parent tab conta...

selenium - For cycle to catch an exception in Java -

i have code expected exception not being caught. i'm trying find element of time stale. loop 60 times attempting element before element not found exception. doesn't print out caught exception though still stale element exception. public static webelement dropdown(webdriver driver) throws interruptedexception { webelement element = null; (int = 0; < 60; i++) { try { element = driver.findelement(by.cssselector("html body div.navbar.navbar-inverse.main-navbar ")); break; } catch (org.openqa.selenium.staleelementreferenceexception e) { system.out.println("caught staleelement exception"); } thread.sleep(1000); } return element; } i think there more 1 issue here. first, i'd give stacktrace. assume, exception thrown elsewhere , stacktrace tell where. second, after have written " element " variable call break; stateme...

version control - Git syntactic sugar for "current branch"? -

i know in git can use - refer previous branch on. so example, if i'm in tester branch , run git checkout master , decide want go tester , run git checkout - instead of git checkout tester . my question this: is there kind of syntactic sugar in git allows me reference current branch i'm in? so instance, if i'm in master , want run git pull origin master , run instead git pull origin {current branch sugar} ? it's getting annoying having specify current branch name common commands push , pull , etc. actually, git pull should enough, provided branch set upstream branch git branch -u origin/master master so isn't syntactic sugar reference current branch: more default parameters of git commands. git pull instance: default values <repository> , <branch> read " remote " , " merge " configuration current branch set git-branch --track .

c3.js - c3js bar width not adjusting to the zooming -

Image
the chart pretty when normal. expect adjust bar width upon zoom. graph without zoom below. when zoom graph, bars width remains same, thin! is there anyway auto adjust? saw link example adjusts bar width zoom. don't see missing. here's example : http://blog.trifork.com/2014/07/29/creating-charts-with-c3-js/ here's charting code. missing setting? var chart = c3.generate({ bindto: '#chart', data: { xformat: '%m/%d/%y %i:%m %p', json: final_data, keys: { x: 'date', value: values }, type: 'bar', groups: val }, bar: { width: { ratio: 0.9 } }, axis: { x: { type: 'timeseries', tick: { format: '%b %d' } } }, zoom: { enabled: true }, color: { pattern: colors } }); try removing key value pair "bar"....

android - NullPointerException on ViewPager with Recyclerview -

we have on our app viewpager fragmentpageradapter contains 3 fragments. 2 of these fragments composed recyclerview each one. the first page (the fragment without viewpager) displayed correctly. however, when viewpager tries pre-load next page (a recyclerview), app crashes because of nullpointerexception following log : java.lang.nullpointerexception: attempt invoke virtual method 'boolean android.support.v7.widget.recyclerview$viewholder.shouldignore()' on null object reference @ android.support.v7.widget.recyclerview.findminmaxchildlayoutpositions(recyclerview.java:2839) @ android.support.v7.widget.recyclerview.dispatchlayout(recyclerview.java:2626) @ android.support.v7.widget.recyclerview.onlayout(recyclerview.java:3011) @ android.view.view.layout(view.java:15684) @ android.view.viewgroup.layout(viewgroup.java:4981) @ android.support.v4.view.viewpager.onlayout(viewpager.java:1626) @ android.view.view....

Faster way of storing Excel worksheet to system.data.datatable using C# -

i trying find faster way read xml file can opened in excel 2010. cannot read xml file using readxml method because contains workbook, style, cell, data , other tags. approach open in excel data on sheet 2 only. sample file contains 9,000+ rows , takes 2mins 49secs store in datatable. actual file has 25,000+ rows. have tried: private void bulkinsert() { var s = new stopwatch(); s.start(); try { killexcel(); gcollector(); excel.application app = null; app = new excel.application(); excel.worksheet sheet = null; excel.workbook book = null; book = app.workbooks.open(@"my directory file"); sheet = (worksheet)book.sheets[2]; sheet.select(type.missing); var xlrange = (excel.range)sheet.cells[sheet.rows.count, 1]; int lastrow = (int)xlrange.get_e...

angularjs - Parse amount in input in Javascript -

i have input in form user have write amount pay. problem user have different ways it, 1,350.55 (this correct one), 1.350,55 or 1.350. so, there way parse amount correct form? thanks! you want parse input, right? why not try make input currency field? , parse container through angular, customers may see value , work angular filtered value. here fiddle: http://jsfiddle.net/lacrioque/voulmrac/ <p><label for='numberinput'>your price here: </label><input type='number' name='numberinput' ng-model='numbertofilter' placeholder="1,350.99"/></p> <p>price: <span>{{numbertofilter | currency }}</span></p>

javascript - jQuery clone validation not working for HTML drop down -

working on clone in jquery. current code original div getting cloned validation working fine original 1 , cloned one. these things working code. initially if user click next button show message you have missed 7 fields. please fill before submitted . once user starts fill fields automatically starts reduced. if user clicked add more button cloned div. once user starts fills of field in cloned 1 , missed rest of mandatory fields if user click next button show these many number of fields missed. below things not working: with current code if have select drop down / radio button in cloned div validation not working the validation count wrong after cloned function bind_change_events(){ $('.cloned_field').on('input',function(e){ if($(this).val().trim().length > 0) { //$(this).removeclass("cloned_field"); $(this).addclass("required_field"); var parent_div = $(this).closest("div.cloned-row1,div.clo...

typo3 update 4.7 -> 6.2 - broken backend -

Image
i've performed update typo3 4.7.20 6.2.15. process worked fine , there no critical errors while running install tool. the frontend looks fine backend broken: i've removed uncompatible extensions before run update. i've checked settings in installationtool und deleted temp/cache folder first. i've got feeling error caused templavoila! extension, i'm using v. 1.9.8. firebug not shows error. does had similar problem , have solved it? thank much! i have come across 1 multiple times. more because there broken tbe_styles. suggest around $tbe_styles in typo3conf folder , disable time being. in exttables.php or other file included dynamically.

c++ - unresolved external symbol inflateEnd (and others) while using boost Zlib -

i'm in process of converting 32bit project x64. in cases means appending 64 library paths (and building libraries x64). assume libraries ready , code x64 compatible. keep getting errors boost zlib library, these: error lnk2019: unresolved external symbol inflateend error lnk2019: unresolved external symbol inflate error lnk2019: unresolved external symbol inflateinit_ error lnk2019: unresolved external symbol deflateend error lnk2019: unresolved external symbol deflate error lnk2001: unresolved external symbol "int const boost::iostreams::zlib::default_compression" error lnk2001: unresolved external symbol "int const boost::iostreams::zlib::deflated" error lnk2001: unresolved external symbol "int const boost::iostreams::zlib::default_strategy" i enabled verbose mode linker (in ms visual studio adding /verbose:lib additional linker options). that, can see output line: searching .\..\..\libs\boost145\stage\lib64\libboost_zlib-vc100-mt-gd-1_4...

php - Encrypt the data using Silex framework -

i using silex framework web application. encrypt returning data server client/server. does silex built-in service related encrypt data such ssl, https etc.? had take @ silex documentation cannot find anything. you can add dependencies composer, if you, use apache2 handle https , require in routing or .htaccess

URL format of IOS deeplinking, -

i needed know, how can have url in such way that, if application installed, navigate application, if not navigate fallback url(any url). thanks in advance you need implement universal links. refer guide here

ios - after updating xcode 6.4 to xcode 7 getting this issue -

i getting issue after updating xcode 6.4 7.0. i using objective c ld: embedded dylibs/frameworks supported on ios 8.0 , later (@rpath/afnetworking.framework/afnetworking) architecture arm64 clang: error: linker command failed exit code 1 (use -v see invocation) how fix ? i tried add prefix header unable llvm 6.0 there getting llvm 7.0” i found this post might have solution. keith smiley suggested these import statements: #ifdef __objc__ #import <uikit/uikit.h> #import <systemconfiguration/systemconfiguration.h> #import <mobilecoreservices/mobilecoreservices.h> #endif

ios - Strange-random crash on SKNode addChild -

i have simple class func adding skemitternode on many different occasions. i cannot reproduce steps when exception occurs. happens , quite randomly. can call method 500 times without error or in cases error can happen after 1 or 2 call, etc. the problem/exception line is: root?.addchild(sparks) below method , stack trace. have no idea how debug this. i've tried many different things without success. any ideas ? class func setsimplesparkseffect(root:sknode?, color:uicolor, position:cgpoint) { if cgpointequaltopoint(position, cgpointzero) { return } let sparks = skemitternode(filenamed: "simplesparks") sparks.alpha = gameobjectsdefaultalpha sparks.particlecolorsequence = nil sparks.particlecolorblendfactor = 1.0 sparks.particlecolor = color sparks.position = position sparks.zposition = sparkselementszposition root?.addchild(sparks) sparks.runaction(skaction.waitforduration(nstimeinterval(emmitersimple...

asp.net - How to create a ScriptBundle from dynamically generated content -

i have big javascript file generated dynamically method in controller. public actionresult geteditingcontext() { string json = jsonconvert.serializeobject(...); return javascript(json); } the javascript same, user can change settings in admin panel , javascript should updated. thought scriptbundle perfect handle that. automatically check if content has changed , update url script. the problem don't know how include url in bundle. i tried : bundles.add(new tsbundle("~/bundles/editcontext").include( "~/invoice/geteditingcontext")); but generated script bundle empty, , has no hash. if remove ~ exeption (only application relative urls (~/url) allowed.)

ios - Whats wrong here: Instance member cannot be used on type -

this question has answer here: how initialize properties depend on each other 3 answers i have following code , i'm confused error message: instance member 'mydate' cannot used on type 'tableviewcontroller' code: class tableviewcontroller: uitableviewcontroller { let mydate = nsdate() let items = [ (1, 9, 7, "a", mydate), (2, 9, 7, "b", mydate), (3, 9, 7, "c", mydate), (4, 9, 7, "d", mydate) ] when write following, can build don't know why oder snippet not working: class tableviewcontroller: uitableviewcontroller { let mydate = nsdate() let items = [ (1, 9, 7, "a", nil), (2, 9, 7, "b", mydate), (3, 9, 7, "c", mydate), (4, 9, 7, "d", mydate) ] the probl...

android - How can get timer from asynctask? -

cant access time in asynctask, variable point doesn't change anymore here code: import android.app.activity; import android.content.intent; import android.graphics.drawable.bitmapdrawable; import android.media.mediaplayer; import android.os.asynctask; import android.os.bundle; import android.os.systemclock; import android.view.view; import android.widget.button; import android.widget.imageview; import android.widget.progressbar; import android.widget.textview; import java.util.arraylist; import java.util.collections; import java.util.random; public class gameplayactivity extends activity { arraylist<player> arrplayer = new arraylist<player>(); textview tvlevel, tvpoint; imageview ivguessedimage; button btn1stchoice, btn2ndchoice, btn3rdchoice, btn4thchoice; int level = 1; int point = 0; random rand = new random(system.currenttimemillis()); progressbar customprogress; textview progressdisplay; int myprogress; mediap...

angularjs - Bind custom methods and class mentioned in HTML to Directive template -

hi have created directive toggle button. directive app.directive('togglebtn',[function () { return { restrict: 'ea', replace: true, require: ['name', '^ngmodel'], scope: { isdisabled: '=', name: '@', ngmodel: '=' }, template: ' <div class="toggle-switch on off"> ' + ' <input ng-model="ngmodel" id="{{name}}" type="checkbox" ng-disabled="{{isdisabled}}" ' + ' hidden=""><label for="{{name}}" ' + ' class="ts-helper"></label> ' + ' </div> ' }; }]); html <input ng-model="sample1" name="sample1" type="checkbox" class="someclass" ng-change="dosomething()" toggle...

java ee - Injection of EJB in EntityListener via CDI fails (JPA 2.1) -

i trying inject @stateless ejb entitylistner. @prepresist method of entitylistener invoked, injected ejb resolves null nullpointerexception thrown. public class myentitylistener { @inject private myservice myservice; // @stateless ejb @prepersist public void prepersist(myentity entity) { final foo foo = myservice.getfoo(); // !! npe thrown here!! entity.setfoo(foo); } } previous questions found here on dealing problem, jpa provide cdi jpa 2.1 on not jpa 2.0, using jpa 2.1. else may problem here? <?xml version="1.0" encoding="utf-8"?> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" > <persistence-unit name="my_pu" transaction-typ...

c# - Can't Find Package (Pechkin) in Nuget -

Image
i have problem visual studio nuget. i want use pechkin in web project , cant find package in visual studio nuget maneger. i thought have been remove , can find on nuget web. nuget - pechkin is visual studio nuget have problem ? or got wrong step on ? how can find pechkin in nuget ? (can't found pechkin 0.5.8.1 , pechkin.synchronized in nuget , tuespechkin , else) i have no problems visual studio add package. check out image: i've found package windows forms application. type of application using? maybe package not available type of application want. there packages available windows forms application, not mobile application, example. edit: as library designed work .net 4.0, must ensure application targets 4.0 .net framework. check this, right-click on project , go properties. see target framework option. set .net 4.0 option or above , test again see if package appears in nuget.

ibm mobilefirst - EventTransmitterPiggybacker.onFailure(EventTransmitterPiggybacker.java:68) when trying to invoke any worklight adapter Android -

hey i'm creating android app using worklight native api i'm getting exception when there connection error , don't know how handle @ com.worklight.location.internal.events.eventtransmitterpiggybacker.onfailure(eventtransmitterpiggybacker.java:68) 09-21 14:09:44.472 20167-20285/cloudappers.com.rta_ca e/androidruntime: @ com.worklight.wlclient.wlrequest.processfailureresponse(wlrequest.java:597) 09-21 14:09:44.472 20167-20285/cloudappers.com.rta_ca e/androidruntime: @ com.worklight.wlclient.wlrequest.requestfinished(wlrequest.java:194) 09-21 14:09:44.472 20167-20285/cloudappers.com.rta_ca e/androidruntime: @ com.worklight.wlclient.internalrequestsender.run(asynchronousrequestsender.java:138) 09-21 14:09:44.472 20167-20285/cloudappers.com.rta_ca e/androidruntime: @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1112) 09-21 14:09:44.472 20167-20285/cloudappers.com.rta_ca e/androidruntime: @ java.util.con...