Posts

Showing posts from June, 2015

amazon web services - AWS sdk file renaming android -

can rename file or folder in aws(amazon web services) sdk android?? i have implemented many features upload,edit,delete,share file/folder,but not getting docs renaming file or folder. any link or doc helpful. amazon s3 cloud-based object storage system. highly scalable , resilient, , processes on 1.5 million transactions per second worldwide. in exchange operating @ such scale, there attributes of amazon s3 make different standard file system , such as: it flat storage space , does not support directories it provides directory-like structures known common prefixes , act directories (for example, possible list objects common prefix, same listing files in directory) the key of object (analogous filename) contains full path of object for example, object foo.jpg stored in directory cheese has key of: cheese/foo.jpg this means that: objects cannot renamed. instead, objects can copied new key , original deleted. directories cannot renamed because don...

jquery - Where in this example is masonry.js being initialized? -

in example (which working perfectly), http://codepen.io/anon/pen/cotjv masonry.js included, after reading other tuturials, understanding have not import script initialize masonry. i have codepen example working locally on machine, reason ask how initialize masonry i'm trying change gutter size, , don't see anywhere that. for example line off masonry.js website shows can set columnwidth. var container = document.queryselector('#container'); var msnry = new masonry( container, { columnwidth: 200, itemselector: '.item' }); in codepen i've pasted above, not see similar line, i'm wondering need go in code set columnwidth , guttersize. codepen direct clone of tympanus masonry.js demo. http://tympanus.net/codrops/2013/07/02/loading-effects-for-grid-items-with-css-animations/ have imported entire demo tympanus onto local machine , don't see masonry.js being initialized anywhere. there i'm not understanding here. can take snippet poste...

ruby - Rails hStore postgresql activerecord database query? -

i want able query hstore column on pg database , return values corresponding specific key. the data looks this: (keep in mind :data postgresql hstore ) [ id: 2, data: {"tags"=>"ruby, objects", "type"=>"video", "title"=>"rubytapas: blocks, procs, , lambdas"}, id: 3, data: {"tags"=>"javascript, objects", "type"=>"video", "title"=>"rubytapas: blocks, procs, , lambdas"} ] i want effect of this: model.uniq.pluck(:tags) and output expect is: ruby, objects, javascript *i strictly trying implement activerecord , postgresql. i able desired result doing: model.pluck(:data).map{|j| j['tags'].split(',') }.flatten.uniq i still interested in solution doesn't require map on activerecord relation. please advise.

ios - How to make search results appear in a field under the search bar? -

i'm making ios app search bar in middle of page (google style, it's simple). search bar in case text field. i'm trying make search results appear right under search bar (google instant style) , give suggestions while user typing. tried using searchresultsdisplaycontroller expects tableview not planning on using. any ideas? figured out pretty way! just make uitableview (set hidden) , put under search bar. then, put logic searching in: - (void) searchbar:(uisearchbar *)searchbar textdidchange:(nsstring *)searchtext and make appear! (set hidden property false) make sure you've implemented protocols uitableviewdelegate , uitableviewdatasource , uisearchbardelegate . only trouble i'm having can't make stay hidden if type , delete text in search bar. disappears second , comes random values.

Unable to access WCF service from Mobile Service in Azure -

wanted access wcf service mobile service in windows azure . this, using service bus relay connection configured credentials call wcf service . when published mobile service on local machine, call wcf service without issue. but when published mobile service on azure, giving following error when trying access it. iservice1 contract wcf service. defined endpoint in web.config file in mobile service contract. can me resolve this? exception=system.invalidoperationexception: not find default endpoint element references contract 'servicereference1.iservice1' in servicemodel client configuration section. might because no configuration file found application, or because no endpoint element matching contract found in client element. edit: upon further investigating issue, found out that, proxy class, generated adding service reference, not picking endpoint definition defined in web.config when host in cloud. when service run on machine's azure emulator, pi...

html - Background Image not showing up in jumbotron -

i not know problem is. made style.css , used code .jumbotron { background-image:url(images/bikebg.jpg); margin-top:-20px } before putting background in images folder, worked fine. since changed it, no longer work. site live here http://bikesite.web44.net/bikes.html try this .jumbotron { background-image:url(../images/bikebg.jpg); margin-top:-20px }

Selenium - Update to WebDriver -

i using "selenium-server-server-standalone-2.44.0.jar" jar file run test suite in selenium test runner. runs in firefox & chrome, gives info text in test run report "info: selenium 1.0 (core, rc, etc) no longer under active development. please update webdriver asap" how update webdriver manually? or how can rid of info text? the info message seeing warning if continue use selenium rc api, tests can stop working more recent releases of browsers. in upcoming selenium 3, rc api dropped outright. there no way rid of text, warning message, , valuable warning message. in order move on webdriver need rewrite tests. suggestion start failing ones first. start reading through official documentation . there link there pointing towards more specifics. while @ it, might want consider refactoring code use pageobjects , not available in selenium 1. note while migrating tests, quite possible run mix of webdriver , rc tests in same project.

java - Android Spreadsheet data into ArrayList HashMap populate ListView -

i have public google spreadsheet pulling data , loading arraylist < hashmap < string, string > > then trying populate custom listview. essentially spreadsheet has 3 columns "timestamp" "question1" , "question2". assuming keys hashmaps should same, value change? i using custom arrayadapter custom xml layout 3 textviews. in getview() i've been trying iterate through hashmap , populate listview. can't seem work. when run, shows me last cell. this code using pull individual rows spread sheet , put hashmap: // print entries for(listentry row : feed.getentries()) { //print first column's cell value system.out.println("new row"); for(string : row.getcustomelements().gettags()) { system.out.println(" "+i + ": " + row.getcustomelements().getvalue(i)); rowmap...

scala - Error on opening the Apache Spark source code in IntelliJ IDEA -

i’m trying open apache spark source code in intellij idea. i opened pom.xml on spark source code root directory. project tree displayed in project tool window. but, when open source file, org.apache.spark.deploy.yarn.clientbase.scala, lot of red marks shows on editor scroll bar. ‘cannot resolve symbol’ error. cannot resolve stringops.format. how can fix it? on file | project structure window, following error message displayed pink background: library ‘maven: org.scala-lang:scala-compiler-bundle:2.10.4’ not used can hint? the versions i’m using follows: os: windows 7 intellij idea: 13.1.6 scala plugin: 0.41.2 spark source code: 1.1.1 (with few file modified me) i’ve tried fix , error state changed somewhat, gave fixing on own (with googling) , deleted .idea folder , started over. i’m seeing errors described above. update: i noticed thw following popup: maven projects need imported: import changes enable auto-import and enabled auto-import according ar...

php - How to utilize the functions of OSClass? -

i want create new .php file , want utilize functions within osclass codex. instance code won't work because haven't imported functions , dependencies. how accomplish this. <?php osc_query_item("region_name=madrid"); if( osc_count_custom_items() == 0) { ?> <p class="empty"><?php _e('no listings', 'modern') ; ?></p> <?php } else { ?> <table border="0" cellspacing="0"> <tbody> <?php $class = "even"; ?> <?php while ( osc_has_custom_items() ) { ?> <tr class="<?php echo $class. (osc_item_is_premium()?" premium":"") ; ?>"> <?php if( osc_images_enabled_at_items() ) { ?> <td class="photo"> <?php if( osc_count_item_resources() ) { ?> <a href="...

How to create a visual sitemap to Codeigniter Website -

please me in creating visual sitemap codeigniter website, new codeigniter details follows. you try this: http://enarion.net/tools/phpsitemapng/ hope helps!

ios - How to get index number from within tableView: cellForRowAtIndexPath: using `indexPath` argument? -

i want change backgroundcolor of uitableviewcell , want index number of each table view cell, because want change color of cells respect index number. however how can index number within tableview: cellforrowatindexpath: ? example, in following code (within tableview: cellforrowatindexpath: ): let numberofcell = indexpath.length // returns 2, if add more cells println(indexpath) // returns <nsindexpath: 0xc000000000000016> {length = 2, path = 0 - 0} in 0..<numberofcell { let alpha = cgfloat(1.0 - double(i) / 10.0) cell.backgroundcolor = uicolor(red: 227/256, green: 245/256, blue: 61/256, alpha: alpha) } return cell i want change alpha value of each cell respect index number, code above makes cell's alpha 1.0 , because numberofcell 2 , though table view has 4 objects. i'm not sure why returns 2 . added more cells result didn't change. so why return 2 , how can correct value of each index? want 0 first cell, 1 second, 2 third, , goes on....

php - How to SELECT LIKE from SQL without duplicate viewing id -

i using code : <? $i_count=1; $ssql = "select * projects status=1 , location '%" . $a_project[0]["location"] . "%' order delivery_year desc, project_id desc limit 0,5"; $mysql_result = mysql_query($ssql, $globals['conn']); $num_rows = mysql_num_rows($mysql_result); if ($num_rows > 0) { ?> <br /> it show project same location viewing project. show current project in result. ex : have 02 projects in location hanoi name , b. when view project a, related projects show both , b project. how can fix ? thanks exclude current project in where: select * projects status=1 , location '%" . $a_project[0]["location"] . "%' , id <> " . $a_project[0]["id"] . " order delivery_year desc, project_id desc limit 0,5 (or it, depending on field names , such)

JavaFx - show objects in TableView containing ObservableList -

Image
i have class person amongst other attributes contains observablelist<car> . want display data in tableview looks this: first name | last name | car -----------+-----------+--------- john | doe | bmw john | doe | audi walter | johnson | chrysler how can javafx extract list of class person , create row each item in list? the easyest way create new class carofperson, contains car , owner: class carofperson { person myowner; car mycar; public carofperson(car car, person person) { myowner = person; mycar = car; } public person getowner() { return myowner; } public car getcar() { return mycar; } } this class can used table item. if create observable list these instances set table as: tablecolumn<carofperson,string> c1 = new tablecolumn<carofperson,string>("first"); c1.setcellvaluefactory(p -> p.getvalue().getowner().firstnameproperty()); table.getcolum...

x86 - In Assembly, Do Instructions Specify Data Types? -

i'm beginner in assembly language programming (x86). is following true it? in assembly data types byte, word, dword mean 8bit,16bit , 32 bit patterns respectively, not integers. don't have meaning themselves, bit patterns. instructions use them give them meaning. "assembly" code many special instructions operate on various size operands (for x86, 1 or more bytes) contain values individual instructions assume of particular type. most of basic instruction set (e.g., add, cmp, xor) assumes/treats operands if n-byte 2's complement integers. byte, dword, etc. hints saying "n" is. the so-called "floating point" instructions treat operands if 32 bit or 64 bit ieee floating point numbers. there "crossover" instructions treat 1 operand 2's complement integer; allow programs convert between these representations. the so-called string instructions treat operand register ecx long string of 1,2,4 or 8 byte values. ...

node.js - 500 TypeError: Object #<IncomingMessage> has no method 'csrfToken' -

i trying add csrf protection nodejs app using express. when add midlleware : app.use(function (req, res, next) { res.locals.csrftoken = req.csrftoken(); }); i error : 500 typeerror: object #<incomingmessage> has no method 'csrftoken' someone can me resolve this. here app.js code : var express = require('express') , routes = require('./routes') , http = require('http') , path = require('path'); var app = express(); app.configure(function () { app.set('port', process.env.port || 3000); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.favicon()); app.use(express.logger('dev')); app.use(express.bodyparser()); app.use(express.cookieparser()); app.use(express.session({ secret: 'the secret' })); app.use(express.csrf()); ap...

spring mvc - SpringSecurity, security annotations and MVC validation -

i have restful application developed springmvc 4. use security annotations on service layer , works well. have following (common) situation: rest controller receives json needs validated, security on service layer validation performed before security control. means unaothorized user receives validation errors before access denied error. i have tried move @secured annotation on controller method, strangely not work. the ideal solution move validation in service layer, not seem possible. what best solution in these cases? @service public class myserviceimpl { @secured("is_authenticated_fully") public responsedto servicemethod(requestdto richiesta) { //do stuff } } @restcontroller @requestmapping("/api/v1/blabla") public class blablacontroller { @autowired myservice myservice; @requestmapping(method=requestmethod.post) @responsebody myresponsedto blablamethod(@requestbody @valid requestdto req) { return myservi...

html - How to make horizontal accordion in Angular js? -

i new angular.js, have got vertical accordion in angular.js, need horizontal accordion. here vertical accordion: http://jsfiddle.net/carpasse/rst62/ i need same thing in horizontal accordion : http://stitchui.com/liteaccordion/ please check link example. code var directivesmodule = angular.module('mymodule', []); directivesmodule.directive('accordion', function factory(){ return { priority:0, restrict:'e', transclude:true, replace:true, scope:{}, template:'<div class="accordion" ng-transclude></div>', link: function(scope, ielement, iattr){ ielement.accordion({header: "h3.accordiontitle"}); } }; }); directivesmodule.directive('accordiontab', function(){ return { priority:1, restrict:'e', replace:true, transclude:true, scope:{ title:'bind'}, template:...

SQL Server: replace constant values with name -

i have query: select * table value = 1 but value used in lot of places and want use like: uservalue = 1 select * table value = $uservalue is feasible? thank you. when want use value @ lots of places use: declare @uservalue int set @uservalue = 1 select * table value= @uservalue below link provide details on how use local variables: http://technet.microsoft.com/en-us/library/aa258839%28v=sql.80%29.aspx also these basics. try find own.

asp.net mvc - Passing UserId with UserName in MVC4 FormsAuthentication -

as not have userid in formsauthentication want pass it.here code public bool isvalid(string email, string password) { bool isvalid = false; var user = db.users.firstordefault(u => u.email == email); if (user != null) { if (user.password == encryptpassword(password)) { isvalid = true; } } return isvalid; } if (user.isvalid(user.email, user.password)) { formsauthentication.setauthcookie(user.email + "|" + user.id, true); return redirecttoaction("index", "testvaliduser"); } now issue user.id 0 in formsauthentication.setauthcookie() how can set it? int userid=0; public bool isvalid(string email, string password,out int userid) { if (user.password == encryptpassword(password)) { isvalid = true; userid= user.id ...

google chrome - Magento cart SSL issue submitting data to an insecure location -

i have issue ssl on magento cart page. reason submitting data not being done via https. in google chrome following error: the page @ ' https: //www .mystore.nl/checkout/cart/ ' loaded on https, submitting data insecure location @ ' http: //www .mystore.nl/checkout/cart/updatepost/ ': content should submitted on https.(index):418 the page @ ' https: //www.mystore.nl/checkout/cart/ ' loaded on https, submitting data insecure location @ ' http: //www.mystore.nl/checkout/cart/couponpost/ ': content should submitted on https. so google chrome saying cart page isn't secure. other browsers there's no ssl certificate @ all. ssl in checkout working fine. webserver rewrites set to: yes secure/unsecure base urls correctly configured ( double checked! ) use secure urls in frontend set to: yes i've searched web couldn't find solution. know wrong? appreciated! magento version 1.6.2.0 we updated magento 1.9.1.0. ssl issu...

php - Is Hash::make function always return 60 characters in Laravel? -

i installed fresh version of laravel 4.2, making user table , want ask if hash::make function return 60 characters can make password field data type char(60). additional: i'm using default configurations of laravel. judging implementation : $hash = password_hash($value, password_bcrypt, array('cost' => $cost)); it uses password_hash() , according manual: use crypt_blowfish algorithm create hash. produce standard crypt() compatible hash using "$2y$" identifier. result always 60 character string , or false on failure.

c# - How to set up 1..0-1 relationship using Code-first? -

based on article , and: using fluent api, and not having navigation property in dependent entity (ie. studentaddress) is possible create 1..0-1 relationship? something like... modelbuilder.entity<student>().hasoptional(e => e.studentaddress).withrequired().map(ca => ca.mapkey(new string[] {"studentid"});

java - mysql loading previous query data to present queries also -

public class sample { public static void main(string[] args) { connection con; try { class.forname("com.mysql.jdbc.driver"); con = drivermanager.getconnection( "jdbc:mysql://localhost/cluster", "root", "password"); preparedstatement pst = con .preparestatement("insert employee_details (employee_id,name,salary,department,manager)values(?,?,?,?,?)"); pst.clearparameters(); pst.setobject(1, 101); pst.setobject(2, "sam"); pst.setobject(3, 1000000); pst.setobject(4, "it"); pst.setobject(5, "jord"); pst.execute(); system.out.println("values got updted-----"); } catch (classnotfoundexception e) { e.printstacktrace(); } catch (sqlexception e) { e.prints...

php - Passing 2 Parameters to Laravel Routes - Resources -

i'm trying build routes using resources can pass 2 parameters resources. i'll give few examples of how urls look: domain.com/dashboard domain.com/projects domain.com/project/100 domain.com/project/100/emails domain.com/project/100/email/3210 domain.com/project/100/files domain.com/project/100/file/56968 so can see need have reference project_id , email/file id etc. i realize can manually writing routes hand, i'm trying stick resource model. i figured might work? route::group(['prefix' => 'project'], function(){ route::group(['prefix' => '{project_id}'], function($project_id){ // files route::resource('files', 'filecontroller'); }); }); as far know resources route::resource('files', 'filecontroller'); the above mentioned resource route following urls. few actions handled resource controller route::resource('files', 'filecontroller'); route::get...

ios - Access app data on iCloud drive -

i'm new ios development silly question easy answer. i have created ios app using core data , cloudkit. syncing icloud drive running on ios 8.1.1 the app functioning, , icloud syncing data multiple devices correctly, know how use web browser locate files stored remotely in icloud drive account. it not located in icloud drive folder data other ios applications on www.icloud.com , although can find name of datastore in icloud container section of developer profile, cannot see how access directly browser. is there way can access stored data externally test security , monitor it's size? thanks help! i don't know if can see using web interface. might able use icloud browser in xcode see files, don't think works either. the way open terminal, , cd ~/library/mobile documents , , container app. icloud data should in there. (note can't use finder because hides data outside documents.)

php - PDO Insert SQL not executing with no errors -

i running code: $stmt = $pdo_conn->prepare("insert ticket_updates (ticketnumber, notes, datetime, contact_name, contact_email, customer, internal_message, type) values (:ticketnumber, :notes, :datetime, :contact_name, :contact_email, :customer, :internal_message, :type) "); $stmt->execute(array(':ticketnumber' => $ticketnumber, ':notes' => $ticketsummary, ':datetime' => date("y-m-d h:i:s"), ':contact_name' => $ticket_contactname, ':contact_email' => $ticket_contactemail, ':customer' => 'y', ':internal_message' => 'n', ':type' => 'update')); all table columns exist , correct not getting past point i tried var_dump($stmt); nothing use following verify connection established correctly try { $dbh = new pdo("mysql:host=xxx...

node.js - node js error in render (template show) -

when trying create template , node execute gives error please me error: failed lookup view "default" in views directory "c:\users\act027\desktop\node\views" @ eventemitter.app.render (c:\users\act027\desktop\node\node_modules\express\lib\application.js:519:17) @ serverresponse.res.render (c:\users\act027\desktop\node\node_modules\express\lib\response.js:904:7) @ c:\users\act027\desktop\node\app.js:7:6 @ layer.handle [as handle_request] (c:\users\act027\desktop\node\node_modules\express\lib\router\layer.js:82:5) @ next (c:\users\act027\desktop\node\node_modules\express\lib\router\route.js:100:13) @ route.dispatch (c:\users\act027\desktop\node\node_modules\express\lib\router\route.js:81:3) @ layer.handle [as handle_request] (c:\users\act027\desktop\node\node_modules\express\lib\router\layer.js:82:5) @ c:\users\act027\desktop\node\node_modules\express\lib\router\index.js:235:24 @ function.proto.process_params (c:\users\act027\desktop\no...

ffmpeg - ffserver leave original stream size -

hope guys me, because have got stuck , can't find solution problem myself. trying stream video webcam users using ffmpeg+ffserver. have faced problem: ffmpeg gets stream camera , pushes feed of ffserver: ffmpeg -rtsp_transport tcp -i rtsp://admin:admin@192.168.10.76:80 -y -vcodec libvpx http://127.0.0.1:8090/1.ffm ffserver stream options: <stream 1.webm> feed 1.ffm format webm noaudio #videocodec libvpx #videosize 480x320 videoframerate 24 avoptionvideo flags +global_header avoptionvideo cpu-used 0 avoptionvideo qmin 1 avoptionvideo qmax 31 avoptionvideo quality preroll 0 startsendonkey videobitrate 128 </stream> (note, videosize option commented). default videosize (160x128), ffserver doesn't respond each request. browser gets: http/1.0 200 ok pragma: no-cache content-type: video/webm but video content not sent. if uncomment videosize option - same problem less successfull requests comparing default video size. ffserver log looks regular no erro...

jquery - Run a javascript when an element has loaded into the HTML page -

i have script loads html code <div id="nav"> element. the div element located in index.html. the load script looks this, , run when index.html loaded. $(document).ready(function () { $('#nav').load('nav.html'); }); nav.html contains code want load <div id="nav"> element nav.html: <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <title>nav</title> <body> <nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <!-- brand , toggle grouped better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-...

java - Large int on checkedId setoncheckedchangeListener -

whenever receive id checkedid, it's long int example (2131034187) if have declared id every radiobutton in xml file. have no idea causes or how fix it. here's code. xml layout <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="textview" android:layout_gravity="right" /> <radiogroup android:id="@+id/radiogroup1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" > <radiobutton android:id="@+id/radio0" android:layout...

sql server - How to write this SQL JOIN query with multiple conditions -

i have following query: select a.reservationstayid, c.createdon, a.firstname + ' ' + a.lastname 'name', b.propertycode as'property', b.reservationstatus 'status', d.rsl_rateplan 'rate plan code', d.rsl_mealplan, d.rsl_roomtype, b.marketsegmentcode 'market segment', e.travelagencytypecode 'source of business', a.arrivaldate 'date of arrival', a.departuredate 'date of departure', (select datediff (day,arrivaldate,departuredate) reservationstay c c.reservationstayid = a.reservationstayid) 'nights', c.adultcount 'adult', c.childcount 'child', b.guestcount 'guest', d.rsl_reasonstay, c.taprofileid, c.pmsconfirmationnumber, c.currencycode 'currency', d.rsl_nationality 'nationality', d.rsl_country 'country of residence', d.rsl_totalroomrate, e.name 'tour operator', e.cou...

How to create a simple webkit browser in vala? -

i have simple code: using glib; using gtk; using webkit; public class browser : window { private const string url = "http://mixtape.quadhome.com/6/"; public browser() { this.add(this.create_web_window()); this.destroy.connect(gtk.main_quit); } private scrolledwindow create_web_window() { var view = new webview(); view.load_uri(browser.url); var scrolled_window = new scrolledwindow(null, null); scrolled_window.set_policy(policytype.automatic, policytype.automatic); scrolled_window.add(view); return scrolled_window; } public static int main(string[] args) { gtk.init(ref args); var browser = new browser(); browser.show_all(); gtk.main(); return 0; } } my problem here when compile with: valac --pkg gtk+-3.0 --pkg webkit2gtk-4.0 searcher.vala it gives error: fatal error: webkit2/webkit2.h: no such file or directory #include <webkit2/webkit2.h> i use valac-0.26 has webkit2gtk-4.0. found googleing t...

json - java.lang.NoClassDefFoundError: org/codehaus/jackson/map/util/ISO8601DateFormat -

i using stormpath , trying register user. have not done jvm configuration, configurations default ones. one try register user error get: nov 27, 2014 12:05:17 pm com.sun.jersey.spi.container.containerresponse mapmappablecontainerexception severe: exception contained within mappablecontainerexception not mapped response, re-throwing http container java.lang.noclassdeffounderror: org/codehaus/jackson/map/util/iso8601dateformat @ java.lang.class.getdeclaredconstructors0(native method) @ java.lang.class.privategetdeclaredconstructors(class.java:2663) @ java.lang.class.getconstructor0(class.java:3067) @ java.lang.class.getconstructor(class.java:1817) @ com.stormpath.sdk.lang.classes.getconstructor(classes.java:179) @ com.stormpath.sdk.impl.ds.defaultresourcefactory.instantiate(defaultresourcefactory.java:59) @ com.stormpath.sdk.impl.ds.defaultdatastore.getresource(defaultdatastore.java:207) @ com.stormpath.sdk.i...

unityscript - Combine 3 Unity3D projects into one -

i have build 3 unity games in different project, each project contain 1 scene : game1 game2 game3 . all of games uses same scripts names code inside different, want export each scene unity packege, create new project 3 buttons , allow user load each game pressing. problem 40% of scripts named same, changing each 1 manually can become nightmare. how should handle this?

xml - Java: how to check if a program has been correctly launched? -

i developping little java jar application storage data in file.xml using basex server. @ beginning, before main program starts, need basex server correctly launched , activated. here do: runtime runtime = runtime.getruntime(); if (iswindows(os)) { process server = runtime.exec("cmd /c basexserver.bat"); system.out.println(server.waitfor()); } else { if (islinux(os)) { runtime.exec("basexserver"); } } to check if basexserver correctly running have tried check value returned waitfor method , if value equal 0 command executed while if returned value greater 0 error has occurred. problem method returns 1 command "basexserver.bat" correct. why? if process goes background after start, can check exitvalue() zero. secondly can attache error , standard outputs methods geterrorstream() , getinputstream() . , monitor them error messages. have @ stream gobbler pattern also, useful. process can stuck if it's output not ...

javascript - Find previously selected value of drop down list on change event -

function loaddata(id) { var employeeid = $.trim($("#employeeid").val()); var employeetype = $.trim($("#employeetype").val()); var obj = ""; var cityid = $.trim($("#ddlcity").val()); obj = new viewmodel1(employeeid, employeetype, 0, $.trim($("#deptname").val()), "", "", $.trim($("#sectionname").val()), cityid); var posteddata = json.stringify(obj); loader(); $.ajax({ //........... //........... }) } i have above function , want selected value in element #ddlcity. above function called line below. @html.dropdowngrouplistfor(m => m.cityid, model.groupedtypeoptions, new { name = "ddlcity", id = "ddlcityname", @onchange = "javascript:loaddata(this.value)" }) var cityid = $.trim($("#ddlcity").val()); giving me cityid of new selection in dropdownlist. so how can cityid of selected value? might post comment answer (too:). have onchange s...

javascript - How to add a Button/Link to the last item in a list of search results -

i'm trying add button last item in list of results generating using jquery autocomplete . currently, each list item created so: create: function(item) { $(this).data('ui-autocomplete')._renderitem = function (ul, item) { return $('<li>') .append('<a>' + item.label + " " + " - " + item.type +'</a>') .appendto(ul); }; }, what i'd when last element in list add button, can't figure out how that. i'd appreciate help. you can use jquery pseudo selector last item. $('li:last')

sql server - How to reach an index-seek on nullable columns? -

let's assume following code: create table foo (v1 int null, v2 int not null) create index nifoov1v2 on foo(v1, v2) declare @searchforv1 int = null declare @searchforv2 int = 0 how can write query uses index find rows specified value of v1 , v2? basically, there index , should possible find rows single seek. whatever try, sqlserver never use both columns of index. e.g. tried following: select * foo with(forceseek) ((v1 null , @searchforv1 null) or (v1 not null , @searchforv1 not null , @searchforv1 = v1)) , v2 = @searchforv2 in execution-plan, executes 2 independent index-seeks v1 (one null , 1 non-null) , applies filter v2 after this. in case, first index-seeks return 100.000 rows scanned v2 reduce result 100 rows. not efficient. another way of solving might if-else-construct, write 2 independent queries depending on whether @searchforv1 null or not null. seems awkward... any other options? well, turns out sqlserver bit stupid here. the issue filter-c...

php - REST authentication -

with restful authentication in javascript application, state kept @ client. requests server should independent 1 , authentication should happen on every request. this mean password or accesstoken (social media auth) stored @ client in form of cookie. there doesn't seem way around it. cookies still considered "public" in terms of security because possible xss attack give attacker access cookie. in database on other hand, password / accesstoken should stored in encrypted form well. so don't understand. not make sense encrypt password / accesstoken , store in cookie. if attacker gets his/her hands on cookie, user's encrypted credentials unsafe, , can used matched against encrypted password stored in database. one way or another; if cookie gets stolen, attacker has same access rights user. how can prevent happening? note want use restful authentication user authenticates on every request independently.

Where place static css file in a spring-boot project -

in current spring-boot project, views have line: <link href="signin.css" rel="stylesheet"/> to reference static css file. when run project, , access 1 of views reference file, 404 not found error or 403 unauthorized error, depending put file inside project. i try far: src/main/resources/static/css (with this, use css/signin.css instead of signin.css) src/main/resources/templates/static/css (with this, use css/signin.css instead of signin.css) src/src/main/resources/templates/acesso (same folder of html file) what right place store type of files? anywhere beneath src/main/resources/static appropriate place static content such css, javascript, , images. static directory served / . example, src/main/resources/static/signin.css served /signin.css whereas src/main/resources/static/css/signin.css served /css/signin.css . the src/main/resources/templates folder intended view templates turned html templating engine such thymeleaf, freem...

How can I use Azure Active Directory Users as virtual machine users? -

is there way, use users in azure active directory users azure virtual machine? respectively, there in general way create multiple user accounts azure virtual machine? greetings you cannot use azure ad users login vm. azure ad not domain controller. the general way create multiple user accounts in azure vm remote desktopping , create user accounts user accounts section in control panel / computer management.

css - Can the windows metro style layout be reproduced with flexboxes? -

Image
can type of layout implemented using non-nested flex boxes? i know flex-wrap make boxes go on next line if don't fit, how can boxes variable height in screenshot above, without nesting more flex boxes? yes, normal css float based grids, possible create boxy layouts these. example see this example , how author did it . also ms proposed standard called " css grid layout " w3c described in msdn . allows create such layouts without flexbox support. never got adopted outside ie if need care ie, can use it.

edmx no longer opens in designer after uninstalling Entity Framework Power tools -

i using vs 2013 update 4 uninstalled entity framework power tools , when open edmx opens xml have looked @ projects use entity framework 6.1 , 6.2 beta, , both have problem. in addition if right click edmx , select run custom tool, error canot find custom tool 'entitymodelcodegenerator' on system. i have since reinstalled power tools problem remains i have run visual studio repair i have removed , re-added entity framework when try create new edmx in new project, , click new item, can not see option add ado.net entity data model i re-installed entity framework 6 tools visual studio 2013 the download link and solved problem

Loop for Multiple Vlookup in R -

i have data frame looks this: lhs1=c("a","d","c","b") lhs2=c("b","a","c","i") lhs3=c("i","b","a","d") lhs4=c("a","c","b","d") df <- data.frame(lhs1,lhs2,lhs3,lhs4) lhs1 lhs2 lhs3 lhs4 1 b 2 d b c 3 c c b 4 b d d and want add 4 more columns shows sale of each letter base on value on data frame: category <- c("a","b","c","d","e","i") sale <- c(12,23,34,35,38,42) <- data.frame(category,sale) category sale 12 b 23 c 34 d 35 e 38 42 so data frame this: lhs1 lhs2 lhs3 lhs4 lhs1.sale lhs2.sale lhs3.sale lhs4.sale b 12 23 42 12 d b c 35 12 ...

variadic functions - pass variable number of arguments (both key & value) in PHP -

how can pass variable number of argument(both key , values) php <?php function tryfun() { echo "inside try()"; $args = func_get_args(); print_r($args); } tryfun(1,2); tryfun(array("key"=>"value")); ?> output root@ip-:~# php trycmd.php inside try()array ( [0] => 1 [1] => 2 ) inside try()array ( [0] => array ( [key] => value ) ) what want be root@ip:~# php trycmd.php inside try()array ( [0] => 1 [1] => 2 ) inside try()array ( [key] => value ) how can achieve in php using debian 7 wheezy php 5.4 you cannot dictate "names" of arguments outside function. function ($foo, $bar) ... here first positional argument assigned variable $foo ,...

regex - Change head <link href=""> to another DIRECTORY by jquery/javascript -

i want change head link href="..." css files target directory jquery/javascript, following: it's this: <link href="css/style.css"> i want change this: <link href="../css/style.css"> my try is: $(document).load(function () { function headlinkschange() { $('head link').each(function () { var newurl = $(this).attr('href').replace("css", "\.\.\/css"); $(this).attr('href', newurl); }); } headlinkschange(); }); how can that? thanks you can way using function overload of attr method of jquery object. no need of regex, string concatenation. there no need of function here, suppose. $('head link').attr('href', function(_, src){ return "../" + src; });

javascript - Rotating Background Image with jQuery -

i trying rotate background image of div jquery. works fine content within div disappears when image rotates. how can prevent content disappering , make such present: code: jquery(document).ready(function($) { $(window).load(function() { var =0; var images = ['http://dl.dropboxusercontent.com/u/96099766/changebackgroundjquery/image2.png','http://dl.dropboxusercontent.com/u/96099766/changebackgroundjquery/image3.png','http://dl.dropboxusercontent.com/u/96099766/changebackgroundjquery/image1.png']; var image = $('#slideit'); image.css('background-image', 'url(http://dl.dropboxusercontent.com/u/96099766/changebackgroundjquery/image1.png)'); setinterval(function(){ image.fadeout(1000, function () { image.css('background-image', 'url(' + images [i++] +')'); image.fadein(1000); }); if(i == images.length) = 0; }, 5000)...

.htaccess - Apache mod_rewrite rule and forever loop -

i need rewrite files start "t" 1 directory directory. from /gallery/txyz.ext /gallery/thumbnails/thumbs_xyz.ext i have problem rewriterule: rewritecond %{request_filename} -f rewriterule ^gallery/t(.*)$ /gallery/thumbs/thumbs_$1 [r=301,nc,l] because catches thumbs directory again (starts "t") , forever loop occurs. problem word thumbs matches t* pattern , caused redirection loop. use rule fix it: rewritecond %{request_filename} -f rewritecond %{request_uri} !^/gallery/thumbs/ [nc] rewriterule ^gallery/t(.*)$ /gallery/thumbs/thumbs_$1 [r=301,nc,l] or else: rewritecond %{request_filename} -f rewriterule ^gallery/t(?!humbs/)(.*)$ /gallery/thumbs/thumbs_$1 [r=301,nc,l]

java - Validate UUID without divider "-" -

i uuids in format "005056963ab75fd48bdc59c100314c40" , want validate them. tried code this: public boolean isuuid(string uuid){ try { uuid.fromstring(uuid); } catch (exception e) { return false; } return true; } but tell me "005056963ab75fd48bdc59c100314c40" not valid id. site http://guid.us/test/guid on other hand tells me , gives me uuid "-" added. there elegant way validate uuid in java or have manually add "-" right places? try regex uuid = uuid.replaceall("(.{8})(.{4})(.{4})(.{4})(.+)", "$1-$2-$3-$4-$5"); uuid.fromstring(uuid);

Vim NERDTree. How to prohibit duplicate files in tabs? -

i use nerdtree setting: """" " nerdtree " bundle 'scrooloose/nerdtree' bundle 'jistr/vim-nerdtree-tabs' map <f2> :nerdtreetabstoggle<cr> i can open number of tabs same file pressing 't'. example: |foo.txt|bar.txt|foo.txt|foo.txt| how prevent opening of duplicate files? want open existing buffer pressing 't'. i found solution here https://github.com/scrooloose/nerdtree/issues/439 grab latest version , stick in ~/.vim/nerdtree_plugin/override_tab_mapping.vim https://gist.github.com/scrooloose/0495cade24f1f2ebb602 thanks @moeabdol

html - Revolution Slider not working on my Unify themes (bootstrap) -

did know why revolution slider not working ? images not found when uploaded server . go fine in offline . here link : http://cloudsblack.info/ thanks ! the file names case sensitive in linux server. i.e cover_01.jpg vs cover_01.jpg please take difference between these names. check following directory images uploaded correct name. http://cloudsblack.info/assets/img/sliders/revolution/cover_01.jpg

python - PySide/PyQt: insert data/table from database to another database -

this question has answer here: copy table remote sqlite database? 1 answer working pyside. have sqlite database default database: db1 = qtsql.qsqldatabase.adddatabase("qsqlite") db1.setdatabasename(path_of_db) db1.open() and second database connection name "second_db": db2 = qtsql.qsqldatabase.adddatabase("qsqlite", "second_db") db2.setdatabasename(path_of_db) db2.open() query = qsql.qsqlquery("second_db") query.exec_("select * table_name") now want insert records table db1 table db2 . have model db1. know can insert record per record through models. thought writing records db1 in file/variable , insert these db2 . there simpler/quicker solution maybe sql-query? how can solve problem? thank ;-) i'd try row row insertion, , see how fast is. might need. few tips on bulk insertions here...

jquery - How to POST data on payload instead of formdata -

i'm trying make request alfresco service web-script made, passing json data on payload. this alfresco service: http://localhost:8080/share/proxy/alfresco/api/internal/downloads and need pass json array whit script node, that: var jsondata = "[{'noderef':'workspace://spacesstore/920b43d4-e79c-40eb-96f3-1dff3a169929'}, {'noderef':'workspace://spacesstore/f19fba4b-0cf6-4379-a858-70d0d7d9efb0'},{'noderef':'workspace://spacesstore/6ea51288-9364-4070-a23b-499025a6c1f9'}]"; i make call on way $.ajax({ url: serviceurl, type: "post", datatype: "json", data: jsondata }); unfortunately when chek request list developer tools see json data passed form data on request , internal server error response. i saw same service used on website , there data passed payload, so, think need data passed on payload. does know how force ? i think depends on content-type header of reque...

sip - How do I make multiple concurrent VOIP calls from one PC? -

i'm trying create program can manage devices in field phoning them , sending various dtmf tones. important requirement can have multiple calls happening in parallel, simultaneously playing different tones. i using sflphone on linux, , have program can make useful call. can't find way of making second call in parallel -- first call gets put on hold. does know of libraries, software, hacks etc make happen? you can use pjsua softphone, open-source , allows multiple calls: http://www.pjsip.org/

Multiple models for one route in Ember.js -

i'm sort of new mvc applications in general , ember specifically. i'm writing simple dashboard application ember. application gathering data using json queries several external sources. first iteration of application uses 1 route , 1 model, since don't need interaction in way. reply , i'm using rsvp.hash function collect data. on given timer refresh model making queries again. app.indexroute = ember.route.extend({ model: function() { return new ember.rsvp.hash({ releaseinfo: getreleaseinfo(), buildresults: getsomeexternalresults(), autotestresults: getsomeotherexternalresults(), }); }, actions: { didtransition: function() { _this = this; ember.run.later(function() { _this.refresh(); }, 1000 * 60 * 5); }, }, }); one thing try make each type of result it's own independent model can fetched , updated independently . how architect application scenario? far understan...

c++ - Qt how to create bitmap from data from QVector and show it on widget? -

Image
i'm wondering how can create bitmap data , show on widget. i have qvector vector, vector of points draw chart. how can repaint on widget using qbitmap? don't want draw on widget, prefer pass pixmap widget, show it. how can this? my code: qpainter painter(pixmap); painter.setpen(qpen(qt::black, 2)); painter.drawpolyline(this->data.data(), this->data.size()); painter.drawline(qpointf(5,5),qpointf(50,50)); setpixmap(*pixmap); here sample code. why it's not working? can't see on widget. i have widget class class widget : public qlabel { public: widget(qvector<qpointf> * data); ~widget(); protected: void paintevent(qpaintevent * event); private: qvector<qpointf> data; qpixmap *pixmap; }; in constructor have widget::widget(qvector<qpointf> * data){ pixmap = new qpixmap(300,300); pixmap->fill(qt::red); } and in paintevent void waveform::paintevent(qpaintevent *event) { qpainter painter(...