Posts

Showing posts from August, 2011

odata - Developing Mobile Native iOS applications to intergrate with SAP middleware -

i involved in defining strategy large future project, proposed developed native mobile phone applications integrate sap middleware. i understand how 1 develop native ios mobile app communicate sap netweaver, using odata? regards. you can create server side odata service , communicate mobile app http/https protocol. odata supports both json , xml formats. if application rather simple - common bsp application can used. works faster little bit harder develop complex application.

apache spark - what is the difference between 'abs' function in R and sparkR -

in sparkr api there functions same name in r. of examples abs,cosine functions. what difference between abs function in r , in sparkr. when abs function executed in spark? documentation sparkr abs function http://spark.apache.org/docs/latest/api/r/abs.html the difference function lives. in base r, abs primitive: function(x) .primitive("abs") in spark, abs wrapper around call spark engine: setmethod("abs", signature(x = "column"), function(x) { jc <- calljstatic("org.apache.spark.sql.functions", "abs", x@jc) column(jc) }) you can see r source code sparkr package here .

jquery - Wait For Div To Be Shown Before Loading Script -

i trying make once picture has faded out replaced script.js file. have following code: <!doctype html> <html> <head> <title>timothy lampen</title> </head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <!-- latest compiled , minified css --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <!-- optional theme --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> <link rel="stylesheet" type="text/css" href="styles.css"> <!-- latest compiled , minified javascript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <body> <script> $(document).ready(function(...

jpa - Hibernate 5 with annotation -

can use jpa annoation perist domain model (classes , relations , heritage) instead of hbm configuration, , use sessionfactory make crud operations. means possible use annotation without using persistence.xml , entitymanager? asked question because in hibernate doc, thay assiciate jpa annotation persistence.xml yes possible use annotation without using persistence.xml , entity manager. you can achieve same using traditonal approach using : sessionfactory transaction session for details please visit post : - http://techpost360.blogspot.se/2015/12/hibernate-5-maven-example.html package com.hibernate.tutorial.entity; import javax.persistence.column; import javax.persistence.entity; import javax.persistence.id; import javax.persistence.table; @entity @table(name = "employee") public class employee { @id @column(name = "id") long id; @column(name="employee_name") string employeename; @column(name="employee_address")...

javascript - How to edit value in a specific td after clicking button -

here's button <button id="modify" role="button" class="btn btn-warning" disabled>modify</button> here's script modify button $("#modify").click(function(e) { e.preventdefault(); var id = $('#cloanout2 tr.active').attr('id'); bootbox.confirm("are sure want modify order?","no","yes",function(r){ if(r) { $.ajax({ url : "<?php echo $server_name; ?>/emcis_coopmain/process/php_groceryreleasingprocess.php", type : "post", async : false, data : { empgrocmstid:id, todo:"modify" }, success:function(result){ bootbox.alert('order modified',function(){ $("#modify").attr("disabled", true); }); ...

jsf - To migrate java web project from PrimeFaces 3.4 to PrimeFaces 5.2 -

i have not lot work experience primefaces. have migrate java web primefaces project 3.4 5.2. although searched on internet there not proper solution situation. if ever have experience kind of problem or ever heard of please let me know or send me link that. want way of doing it. have idea witch component should changed. there except replacing jar? tried replace primefaces 3.4 primefaces 5.2 jar. not allow me replace jar. have to change code too? please want migration steps. there primefaces migration guide. need go step step 3.5 5.2. here full migration guide situation: copied migrationguide 3.4 3.5 component changes dateselectevent, scheduledateselectevent, scheduleentryselectevents classes removed, use selectevent instead. column class in sortevent , columnresizeevent replaced uicolumn support dynamic columns. scrollable , resizable datatable-treetable features reimplemented. datatable , treetable no longer render cell container div eleme...

AngularJS template and AngularJS view differences -

what exact difference between template , view in angularjs. both terms defined separately in guide can found here . both seems same me question lot of times people uses both terms different purposes never understood till now. i found links on stackoverflow not answered correctly. could please me here find out differences ? (if any)

node.js - Can I change the output of jasmine-node to show the passing tests in the console as well as the failing? -

i have following file runs when run node test.js . var jasmine = require('jasmine'); var jasmine = new jasmine(); var request = require('request'); describe("test", function(){ it("works", function(){ expect(5 + 2).toequal(4); }); it("should respond hello world", function(done){ request('http://localhost:3000/', function(err, res, body){ expect(body).toequal('hello world'); done(); }) }); }) jasmine.execute(); and gives me following output: started f. failures: 1) test works message: expected 7 equal 4. stack: error: expected 7 equal 4. @ object.<anonymous> 2 specs, 1 failure finished in 0.037 seconds obviously 1 fails, showing f, , 1 passes, showing dot. can change configuration have show both passing , failing tests? you'll want use custom reporter . recommend using jasmine-console-reporter , give nicel...

c# - Unable to edit form using DevExpress -

Image
puu.sh/kiq0k/aa28192731.png does know how can manipulate objects in form? able edit of tabs. it's using devexpress v14.1 to edit tabs, click tab control , use design time helper icon on tab controls upper right corner. there, can find link called "tab pages". alternatively can select tab control clicking , head on properties window (press f4) can every control. there, find property called tabpages . if want edit controls on tabs , selecting them per mouse click , change controls' properties on properties window (press f4).

c# - Building a website with multiple database instances for each user type(.net) -

Image
i building website big companies,the website same,but company "a" have sensitive data , want keep database @ place(server),the company "b" don't have sensitive data sow don't have problem keep database @ website server.how can (if possible) use database company "a" if user if type "a" logged in,and if user type"b" use database.i need change connection string each type of user,because each 1 of users-type(company) want have own database in place think safe. i checking mvc/6 , asp.net5 decision. which approach best? thanks in advance! there can several ways achieve this. 1 way use "security" database contain 2 data tables. 1 table contain connection string of main database. second table contain user credentials along data source user have access to.. when user logs in, program can corresponding connection string , based on login correct data source. one user can have, if want, access multiple da...

meta tags - What could cause the Twitter card validator to give a redirect loop error? -

Image
i'm using https://cards-dev.twitter.com/validator on http://parlaywith.me . when include tag (currently included): <meta property="og:url" content="http://parlaywith.me"> i error: when remove tag, get: how can keep og:url tag , avoid error? you might have specify url trailing slash: http://parlaywith.me/ instead of http://parlaywith.me also note html5 requires use link (instead of meta ) if value uri: <link property="og:url" href="http://parlaywith.me/">

google app engine - Subfolders and packages when using Appengine and Go -

when deploying and/or testing go project appengine, appcfg.py , dev_appserver.py tools used compile project that works fine when *.go files in 1 folder, how can project be compiled when code divided subfolders- yet need access functions , constants eachother? in go- subfolders definition package boundaries, , can't see way allow appengine tools compile multiple packages before testing or deploying, 1 project. advice on how tackle this- other keeping in 1 folder, appreciated. if solution approach 1 package (folder) @ time, advice on how structure quick iteration on 1 project uses packages appreciated. thanks! there no magic here. make sure each of go files placed in folder , not in root of appengine project. for example: -[project root] app.yaml -[packagea] packagea.go -[packageab] packageab.go -[packageb] packageb.go in example above, package declarations should follows: packagea.go: package packagea ...

java - Its giving me an error saying Column not found -

its giving me error saying column not found import java.sql.*; class jdbc_demo { public static void main(string args[]) { try { class.forname("sun.jdbc.odbc.jdbcodbcdriver"); connection con=drivermanager.getconnection("jdbc:odbc:testc"); //class.forname("com.mysql.jdbc.driver"); //connection con=drivermanager.getconnection("jdbc:mysql://localhost/db","root","abc"); statement st=con.createstatement(); //st.execute("create table student(rollno int,name varchar(20),class varchar(10))"); //st.execute("insert student values(1,'raj','fy')"); //st.execute("insert student values(2,'karan','sy')"); //st.execute("insert student values(3,'sameer','ty')"); //st.execute("delete student name='xyza...

php - Sending a custom header with ZEND_HTTP_CLIENT -

how can send custom header zend_http_client . trying send variable key value, check later authenticity i've tried this $client = new zend_http_client('http://localhost/v3/files/'); $client->setheaders('content-type','multipart/form-data'); $client->setheaders('key','xxxxxxxxxxxxxxxxxx'); $client->setparameterpost('document_id', $id); $client->setparameterpost('type_id', $doctype['type']); $client->setparameterpost('file', $form->file); $response = $client->request(zend_http_client::post); and this $client = new zend_http_client('http://localhost/v3/files/'); $client->setheaders(array( 'content-type','multipart/form-data', 'key','xxxxxxxxxxxxxxxxxx')); $client->setparameterpost('document_id', $id); $client->setparameterpost('type_id',...

Google Chrome Arc Android App: Unable to play Video -

i unable play videos on arc videoview. videos working on android devices , emulators. tried local stored , online videos. downloaded form youtube mp4 files , didn't work. unable play video alert. do have information this? supported formats, encodings? thank you code: // set video holder video_view = (videoview) getview().findviewbyid(r.id.video_view); // set url uri myslideuri = uri.parse(filelocation(this.videos.get(currentvideo).fileurl)); myslideuri=uri.parse("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"); video_view.setvideouri(myslideuri); video_view.setontouchlistener(this); // start video video_view.start();

mondrian - MDX sum from date dim to now -

i trying create calculated measure showing sum of measure on period of time current member of date dimension now. the following code pretty bad hope give idea: with member [measures].[numberfromdate] ( sum( [date].currentmember:strtomember(format(now() , '[date]\.&[yyyy-mm-dd hh:mm:ss.0]' ) ), [measures].[number] ) in schema date dimension single level date of type date. mdx code give me error "cannot find mdx member '[date]'". try strtoset instead: with member [measures].[numberfromdate] ( sum( strtoset( '[date].currentmember:[date].[' & format(now() ,'yyyy-mm-dd hh:mm:ss.0') & ']' ) ) , [measures].[number] ) here similar request on msdn: https://social.msdn.microsoft.com/forums/sqlserver/en-us/fdee9f45-8383-4446-b022-e9e877477aec/mdx-date-format i'm bit unsure if format sring ok. string used in cube? 'yyyy-mm-dd hh:mm:ss.0' ...

Watch video and share on social media for rewards is allowed by google policy? -

i making 'watch video reward' option users. add option users redirected facebook fan page rewards. these allowed or not? you allowed reward people liking/sharing facebook page, not allowed open page without confirm user.

c# - How to connect to remote OPC server -

i trying connect opc server present in remote pc in lan. here code objopcserver.connect(opcservername, "192.168.1.5"); 192.168.1.5 ip of remote pc. want know put username & password of remote pc connect to, since remote pc contains username & password. thanks if use opc da, have opc dcom settings. , if connecting remote pc, make sure have same user name in both local , remote machine , user have rights access opc enum service. check link, contains details related opc remote settings. dcom settings

javascript - want to remove a previously added class and add a new class to the same div -

i making frombuilder in on choosing option value (from 1 12) adds col-xs-(1-12) class div. when want choose other option add different col-xs-(1-12) class previous class doesn't deleted. function addgrid() { console.log("addgrid called !"); console.log($(".grid_cols").val()); var col_val = $(".grid_cols").val(); console.log("col_val :" + col_val - 1); if ($(".fb-field-wrapper").find('col-xs' + '-' + col_val)) { console.log("hasclass ??"); $(".fb-field-wrapper").removeclass('col-xs' + '-' + col_val); console.log("removed class"); } else { $(".fb-field-wrapper").addclass('col-xs' + '-' + col_val); } } you may also: use bit of regex see if class of pattern col-xs-<num> exists if yes, remove it add new class here code, simplified above points. function ad...

python - Looped nesting -- Factorising -

this question has answer here: visualising factors 1 answer i trying write program takes user input, limit , prints table visualise factors of each integer ranging 1 limit. each row represents integer between 1 , limit, whilst first row represents number 1, second number 2 etc. given position (starting 1) in row n, if factor of limit '*' there, if not '-'. for example input of 20 should produce: maximum number factorise: 20 * - - - - - - - - - - - - - - - - - - - * * - - - - - - - - - - - - - - - - - - * - * - - - - - - - - - - - - - - - - - * * - * - - - - - - - - - - - - - - - - * - - - * - - - - - - - - - - - - - - - * * * - - * - - - - - - - - - - - - - - * - - - - - * - - - - - - - - - - - - - * * - * - - - * - - - - - - - - - - - - * - * - - - - - * - - - - - - - - - - - * * - - * - - - - * - - - - - - - - - - * - - - - - - - - - *...

c# - list.Take(100).ToList() vs. list.GetRange(0,100) -

list<attendeeinfo> attendees = new list<attendeeinfo>(); foreach ... // error: "there many target users in email address array" // more 100 attendees. take first 100 attendees only. if(attendees.count > 100) attendees = attendees.getrange(0,100); // or if(attendees.count > 100) attendees = attendees.take(100).tolist(); since work on list longer 100, , take first 100, obvious differences (evaluation strategy, possibility skip, throwing on errors) not interesting. but perhaps shed light on "creates shallow copy of range of elements in source list" means. sounds expensive, more take, it? the difference list.getrange more efficient take(n).tolist() since knows size of new list whereas linq methods don't know it's size. so tolist enumerates sequence , adds items new list doubling algorithm increasing backing array consecutively. list.getrange can create proper list right initial size beforehand , uses array.copy copy subs...

dictionary - Performance in Nesting three maps Vs Separate maps in C++ -

i confused choose between 2 methods have stl structure , method a: map<pair<string,int>,map<string,map<ulong,vector<string>>*>*> method b: is above advisable or having separate maps below, map<pair<string,int>,vector<string>> after querying parent map , iterating vector , query second map map<string,map<ulong,vector<string>>*> out of above 2 methods optimal way , cause more performance overhead? update 1: my target store output logs in memory has 3 groups.. outermost key "pair" parent grouping , has it's own sub groups.. , each sub groups have it's own groups. after typedef method a: typedef map<ulong,vector<string>> sub_map2; typedef map<string,sub_map2*> sub_map1; typedef map<pair<string,int>,sub_map1*> parent_map; for better readability don't go premature optimization. use clean code , try optimize if see bottleneck in c...

c# - Creating similiar classes programatically including methods -

hopefully title, explained question, trying create classes programmatically each 1 have different properties along methods specific each. currently, each class manually created change programmatically if possible. @ moment, each class following: public class someeventname : eventbase { public string hardwareid { get; set; } public ushort componantstatus { get; set; } public override string tostring() { return string.format("someeventname event - hardwareid: {0}, generatedtime: {1}, receivedtime: {2}", hardwareid , generatedtime, receivedtime); } public static someeventname default(string tvmid, datetime createtime, datetime receivetime) { return new someeventname { hardwareid = hardwareid, generatedtime = generatedtime, receivedtime = receivedtime, adaptedtime = datetime.utcnow }; } } i have substituted names someeventname name of event the prope...

ruby on rails - How do I set up the proper routes for an acts_as_commentable form? -

there 2 models: user , commenting (provided devise), , audio , comment on. each audios#show page should list comments audio, , have little form through submit one. i made audio acts_as_commentable . made sure comment belongs_to :user , , user has_many :comments . for routes, have resources :audios resources :comments end then, on audios_controller, def show if user_signed_in? @comment = @audio.comments.new end end then wrote simple form_for(@comment) form 'comment' field , submit button. that's it. the error upon loading page undefined method 'comments_path' . googled error, read stackoverflow responses, , tried form_for(@audio, @comment) instead. gets error **can't write unknown attribute 'html'`. i'm little stumped; i've got models , relationships sketched out on notepad i'm inexperienced , use of things don't understand, devise behind scenes, throwing me loop. if give me tip on these routes/forms lo...

php - PHPExcel not well-formed -

hello i'm trying generate , download excel file via ajax, unfortunately i'm getting error not well-formed , nothing more specific.. i've checked variables etc , i'm sure there aren't missing required values.. code calls phpexcel script.. $("#myform").submit(function(e) { var group_id = <?php echo $group_id; ?>; var month = <?php echo $month; ?>; var year = <?php echo $year; ?>; $.ajax({ url: 'ajax/events_to_excel.php?id='+group_id+'&m='+month+'&y='+year, type: 'post', data: $(this).serialize(), success: function(data, textstatus, jqxhr) { //console.log(data); }, error: function(jqxhr, textstatus, errorthrown) { } }). done(function(data) { }); e.preventdefault(); }); and ending header code generating excel document.. (i not show previous code know there ok , no errors, chec...

javascript - How to install jQuery UI in Rails app? -

i want use jquery ui in rails app. have installed gem packages: gem list |grep jquery jquery-rails (4.0.4) jquery-ui-rails (5.0.5) add below code /app/assets/javascripts/application.js : //= require jquery //= require jquery_ujs //= require jquery.ui but doesn't work, error below: showing /users/liuxin/public/my_blog/mongo_project/app/views/layouts/application.html.erb line #6 raised: couldn't find file 'jquery.ui' type 'application/javascript' hope can me , in advance! rails version: rails 4.2.3 ruby version: ruby 2.2.2 try this: //= require jquery //= require jquery_ui

talend - TAC execution plan configuration to start from the job which makes error -

i had problem configure execution plan in talend administrator center. execution plan : job 0 ---on ok--->job 1--on ok-->job 2. example if run , made error in job 1 , want run again starts beginning. please tell me how make work job has problem , not beginning. thank in advance may didnt try it: ¤ job 0 > onok job 1 > onerror job 1 > onok job 2 > onok job 3 even if work, dont recommand because may enter infinite loop if job 1 still exit on error, prefer using master job launch job 1 , control how many time can exit on error: master job: tloop--------(iterate)------trunjob[job1]--------(onsubjobok)---------tjava tloop: for int =0 ; (i < context.max_try)&& context.again; ++; tjava: context.again= false;

matlab - Modeling a floor/ground for a walking robot in Simulink -

Image
i'm trying create simple model of body later controlled. however, running trouble when i'm connecting both legs body. what have done have built model starting left foot, attached world frame, , torso. ended duplicating 1 of legs , attached again the world frame , torso, closing "loop". however, following error message when trying run simulation. 'untitled/right leg/hip/revolute joint' has degenerate mass distribution on follower side. i have feeling has fact both legs attached torso and world frame. if let legs dangle torso attaching torso world frame directly, works. need legs attached "ground/floor" what correct way model can later actuate joints? i believe need 3 connections between robot , floor: a contact force between left foot , floor a contact force between right foot , floor a virtual connection lets specify initial height of torso above floor. the virtual connection specify initial height above floor done...

javascript - Change DropDownListFor content based on other DropDownListFor content using ajax -

i use advice in order create new list based on selected input in first dropdownlist. what i'm trying when user selects in dropdownlist, should reload somehow (not whole page) , generate new list shown in 2nd dropdownlist. to explain better, have created 2 dropdownlistfor --> departure route , return route. data have shown under here: departure dropdown: <p> @html.label("departure route:") @html.dropdownlistfor(m => m.departureroute, model.routeslist, new { @class = "dropdownlist", @id = "departureroute" }) </p> the model.routeslist comes following method: public list<selectlistitem> routes() { var routes = new list<selectlistitem> { new selectlistitem {value = "osco", text = "oslo - copenhagen"}, new selectlistitem {value = "coos", text = "copenhagen - oslo"}, new selectlistitem {value = "cost"...

adaptive design - Javascript / Get an image element on page and but it in div (getElementByID) -

for banner, need put image displayed on same page. i'm bad developpement - so, use way - but, indeed, doesn't work... <!doctype html> <html lang="fr"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="ad.size" content="width=300,height=600"> <title>stack</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <link href='https://fonts.googleapis.com/css?family=open+sans:400,700' rel='stylesheet' type='text/css'> </head> <body> <a id="clickthroughbtn" href="javascript:window.open(window.clicktag)"> <div id="border"> <div id="container"> <div class="border2"> ...

css - stick one image over another -

i have structure below: .a { display: block; height: auto; left: 11px; top: 89.3px; width: auto; position: absolute; } .a img { display: block; height: auto; width: 100%; } .b1 { position: absolute; } .prev { background: rgba(0, 0, 0, 0) url("http://ww1.prweb.com/prfiles/2014/04/10/11752526/gi_134971_best-image-web-hosting.png") no-repeat scroll 0 0 !important; border: medium none !important; height: 25px; left: -807px; overflow: hidden; padding: 0; position: absolute !important; top: -220px; width: 25px; } .prev span { text-indent: -9999px; } <div class="a"> <div class="a1"> <img src="http://s.hswstatic.com/gif/shasta-daisy-3.jpg" /> </div> <div class="b"> <div class="b1"> <button class="prev"> <span>previous</span> </button> ...

ios - Cancel PFQuery takes too much time to load -

apologies couldn't think of better way describe application’s functionality. i've found quite lot of posts topic, in old archive @ parse.com. nevertheless doesn't work me. after creating instance of pfquery triggered pfquery.findobjects (but runs on background thread) i'm not able cancel during request process. scenario : have app connects parse. have display data more 100 records in datadisplay screen , has button when user click on button , if pfquery.findobjects still run on background thread have cancel it. i have tried inserting pfquery.cancel in viewwilldisappear, can not stop , due these datadisplay screen’s dealloc method not call. my code, incase may help: - (void)loadandsortingsonginformationws { if(isinternet) { if(self.isshowloadingforskipsong)//not showing activity indicator self.isshowloadingforskipsong = no; else if(self.isfirstload || self.isaddpulltorefreshlikesong)//showing indicator [self showhideloading...

javascript - Value variable as 0 not as false in shorthand-if expression -

i'm calling function in either 2 ways foo([x,y]) or foo({x:x,y:y}) x,y ∈ [0,∞) the foo function looks this var x = pos.x || pos[0], y = pos.y || pos[1]; if call function second way x=0 pos.x valuated false, leaves x=pos[0] undefined . i wondered whether there way 0 not valuated false in longhand method if(pos.x===0){/*...*/} you need check if pos.x exists, rather checking it's value. can hasownproperty function: var x = pos.hasownproperty('x') ? pos.x : pos[0];

javascript - Remove &quot from json using laravel -

hello wanted know how use blade variable in javascript. here query in laravel $users=json_encode(db::table('ledger')->select('name','openingbalance')->get()); i'm trying access in javascript file shown below var users ="{{ $users }}"; and output shown below: [ {&quot;name&quot;:&quot;harsh&quot;,&quot;openingbalance&quot;:&quot;5755.00&quot;}, {&quot;name&quot;:&quot;harh&quot;,&quot;openingbalance&quot;:&quot;-12000.00&quot;}, {&quot;name&quot;:&quot;gfgfhgf&quot;,&quot;openingbalance&quot;:&quot;-333.00&quot;} ] i wanted know how remove &quot perfect json use. you're escaping data {{ }} automatically in laravel 5. use {!! $users !!} instead.

hadoop - Talend HiveDB connection needs cloudera SerDe -

Image
i'm trying connect talend open studio hive. in hive have table custom defined fields( from cloudera-twitter-example ). open studio find table without problems, if try retrieve schema such error: and in talend log get: !entry org.talend.platform.logging 4 0 2015-09-21 10:49:12.375 !message 2015-09-21 10:49:12,372 error org.talend.commons.exception.commonexceptionhandler - java.lang.reflect.invocationtargetexception !stack 0 java.sql.sqlexception: java.lang.reflect.invocationtargetexception @ org.talend.metadata.managment.hive.embeddedhivedatabasemetadata.getcolumns(embeddedhivedatabasemetadata.java:401) @ org.talend.core.model.metadata.builder.database.manager.extractmanager.getcolumnsresultset(extractmanager.java:844) @ org.talend.core.model.metadata.builder.database.manager.extractmanager.extractcolumns(extractmanager.java:641) @ org.talend.core.model.metadata.builder.database.manager.extractmanager.returnmetadatacolumnsformtable(extractmanager.java:52...

java - how to create rtsp stream server using netty -

Image
pls me create rtsp server. if there working example.. try netty example. link github but display following error, exception in thread "main" org.springframework.beans.factory.beandefinitionstoreexception: failed load bean class: com.darkmi.server.config.serverconfig; nested exception java.io.filenotfoundexception: class path resource [application.properties] cannot opened because not exist @ org.springframework.context.annotation.configurationclasspostprocessor.processconfigbeandefinitions(configurationclasspostprocessor.java:267) @ org.springframework.context.annotation.configurationclasspostprocessor.postprocessbeandefinitionregistry(configurationclasspostprocessor.java:203) @ org.springframework.context.support.abstractapplicationcontext.invokebeanfactorypostprocessors(abstractapplicationcontext.java:622) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:451) @ org.springframework.context....

javascript - Incredibly fast JS loop? -

today i've got idea check performance of loop have called "scoped for". idea simply. loop has 2 variables, "i" , "l" defined "one scope higher" loop itself. there's nothing else in 2 scopes. i've created jsperf , got amazing results. http://jsperf.com/variable-scoped-loop/6 i decided create local test, , results better ( 1000x1000 loops average time of 5s "standard for" , under 0.01s "scoped for" ). so wondering why loop damn fast. i`m assuming it's v8, never know. so willing explain? tldr : why loop damn fast? var loop = ( function() { var i, l; return function( length, action ) { for( = 0, l = length ; < l ; ++i ) { action(); } }; }() ); unfortunately, there's no magic here: test faulty. for varinfor , empty function correctly called 9999^2 times, w...

ios - UIButton auto-adjust Button font size Swift -

i try make out quiz , have problem answer buttons. simple fact: text long , try auto-adjust cells using different methods. current status: btn in btnarr{ btn.titlelabel!.minimumscalefactor = 0.3 btn.titlelabel!.numberoflines = 0 btn.titlelabel!.adjustsfontsizetofitwidth = true btn.titlelabel?.baselineadjustment = uibaselineadjustment.aligncenters //btn.contentedgeinsets = uiedgeinsets(top: 3.0,left: 3.0,bottom: 3.0,right: 3.0) } i hope has option me make work :) regards, patrick edit: self.view.addconstraint(nslayoutconstraint(item: btn.titlelabel!, attribute: nslayoutattribute.height, relatedby: nslayoutrelation.equal, toitem: btn, attribute:nslayoutattribute.height, multiplier: 0.99, constant: 0)) with auto layout can set space between buttons, , max , min size. in code labels use: self.button.titlelabel.numberoflines = 0; self.button.titlelabel.adjustsfontsizetofitwidth = yes; with labels adjust text ...

asp.net core mvc - Difference between ToList()[0] and FirstOrDefault() -

i'm debugging mvc6 (beta7) application. found if execute test code, collection has elements (as should). reservations.tolist()[0].requestedvehicletype.photos // photos.count == 1 with same data, original code resulted in empty collection. reservations.firstordefault().requestedvehicletype.photos // photos.count == 0 what's more strange if call reservations.tolist() before 2nd code executed, result good. reservations.tolist(); reservations.firstordefault().requestedvehicletype.photos // photos.count == 1 i understand mvc6 in beta, , may have bugs. question if 1 expected behavior or bug? all navigation property scenarios not implemented in beta 7, wait beta 8 and/or try daily builds

php - Codeigniter weird database error -

everytime insert new data post_id cannot null when check phpmyadmin. correct id stored. i'm using ajax send id's view controller. i've tried alert(id) see if id selected , selected no problem in jquery part. it works way want to, it's there error not stop insertion , can hide error fix without using that. jquery var post_id = $(this).closest('.portlet').find('.form').find('.postid').val(); var comment = $(this).closest('.comments').find('textarea').val(); alert("this post id "+post_id+"\nthis comment "+comment); $(this).closest('.comments').submit(); $.ajax({ type: "post", url: base_url+'classes/addcomment', datatype: 'json', data: {post_id: post_id, comment: comment}, async: false }); in alert, can see id , comments , correct. i'm pretty sure there no problem ...

javascript - Drag and drop in RaphaelJS -

i have following fiddle: http://jsfiddle.net/zugzq7vv/ what want able drag number 1 on left of input box center of square , make square change black , number white. how can accomplished raphaeljs 2.1? js code: // creates canvas 320 × 200 @ 10, 50 var paper = raphael(document.getelementbyid("papercanvas"), 320, 200); var circle = paper.rect(50, 40, 50, 50); // sets fill attribute of circle red (#f00) circle.attr("fill", "#f00"); // sets stroke attribute of circle white circle.attr("stroke", "#fff"); var t = paper.text(75, 65,""); //i want empty string text drag and simple html: 1<input id="teste" disabled></input> <div id="papercanvas"></div> i know interface drag , drop, can't seem able apply individual numbers. you cannot make non-svg/raphael elements drag using raphael.js i.e. string "1" before input element. need have raphael-text eleme...

Share content using Intent to Facebook Lite Android -

am using following code sharing content directly facebook app, intent shareintent = new intent(android.content.intent.action_send); shareintent.settype("text/plain"); shareintent .putextra( android.content.intent.extra_text, "some text"); packagemanager pm = v.getcontext().getpackagemanager(); list<resolveinfo> activitylist = pm.queryintentactivities( shareintent, 0); (final resolveinfo app : activitylist) { if ((app.activityinfo.name).contains("facebook")) { final activityinfo activity = app.activityinfo; final componentname name = new componentname( activity.applicationinfo.packagename, activity.name); shareintent.addcategory(intent.category_launcher); shareintent.setflags(intent.flag_activity_new_task ...

Entity Framework Database First approach with Asp.net MVC -

i using entity framework 4.4 database first approach asp.net mvc 4, had master tables country, city, want insert data it, validation need define separate model each table. using t4 template method generate separate class each table. my simple question how can put validation in db class generate t4 template method, not need create separate model each of master tables. you don't need change classes generated ef classes regenerated ef , change made lost. think approach right - apply validation on model classes have created (using data annotations)

python 3.4 - ldap3 operation: SEARCH seems to fail (search_filter syntax vs RFC4515) -

edit: tl;dr - search_filter argument used in search might non conforming rfc4515. i've got django server running version 1.8.4 on ubuntu 14.04. i'm using python 3.4 , i'm trying configure ldap authentication using ldap3 . this part of upgrade versions named above 1.6.2, 12.04, , 2.7.3, respectively. working correctly, assume problem on end , not authentication server. the way works i've got file called authenticate_user.py receives username , password passed through html form shown below. def authenticatestudent(request): username = request.post.get('username','') logger.info("user " + username + " has logged in.") password = request.post.get('password','') x = auth(username, password) retval = x.authenticatepy() logger.info('retvale '+str(retval)) #this returns false #more code , more logging the method instantiates object auth class (shown below), stores username , ...

php - bootstrap not working in laravel5 -

i followed this turotial basic laravel learning. executed composer require illuminate/html . import bootstrap in project, in 'providers', added illuminate\view\viewserviceprovider::class, illuminate\html\htmlserviceprovider::class, and in alaises, added 'form'=> illuminate\html\formfacade::class, 'html'=> illuminate\html\htmlfacade::class, but bootstrap not seem working. {!! form::open() !!} <div class="form-group"> {!! form::label("name : ", "your name") !!} {!! form::text("username", null, ["class"=>"form-control"]) !!} </div> {!! form::close() !!} the text field not stretch width of page, supposed to. any idea why so? or other alternative solution ? you need include link bootstrap in html template file. <!doctype html> <html> <head> <link rel="stylesheet" href="...

javascript - Google Maps not working on Angular JS after changing view -

i making mobile app using cordova angular js , google maps api. on home screen have 3 tabs. third tab integration google maps. first time enter on third tab, map load , runs perfect. but, when change view has controller , go view , controller of google maps, won't load. here code run everytime change tab 3 (where google maps). $rootscope.mapoptions = { center: new google.maps.latlng(-18.894608, -48.260980), zoom: 14, maptypeid: google.maps.maptypeid.roadmap }; $rootscope.map = new google.maps.map(document.getelementbyid("map-canvas"), $rootscope.mapoptions); here html of view <div id="map-canvas" style="height: 90%; width: 100%"></div> i stuck on problem , appreciate. obs: if need more information code, ask. thanks! wrap map-canvas div under ng-if condition, work definitely. <div ng-if="showmap" id="map-canvas" style="height: 90%; width: 100%"></div>

php - Create Moodle activities programmatically -

does know if it’s possible add activity programmatically course in moodle? i thinking maybe use class module_add_instance() lib.php of custom plugin... e.g. function feedback_add_instance(stdclass $mod) { global $db; $newmodule->timecreated = time(); // may have add stuff in here. $newmodule->id = $db->insert_record('exams', $newmodule); unicexams_grade_item_update($newmodule); return $newmodule->id; } but again: $mod variable? contain , how construct it? does has knowledge on subject? or advise? add_moduleinfo() better. below use facetoface. to started, edit /course/modedit.php temporarily add following, add required activity via front end - give list of of properties required: var_dump($fromform); die(); $fromform = add_moduleinfo($fromform, $course, $mform); code create facetoface instance $newfacetoface = new stdclass(); $newfacetoface->name = $facetoface->facetofacename; $newfacetoface->intro = ...