Posts

Showing posts from July, 2012

java - Table missing error while maaping MySQL view to hibernate -

i trying map mysql view hibernate. when getting , table missing error while starting application. view create algorithm = undefined definer = `mydbadmin`@`%` sql security definer view `reservation_transaction_view` select convert( concat(`apst`.`tid`, _utf8'-', `apst`.`roomindex`, _utf8'-', `apst`.`rid`) using utf8) `id`, `apst`.`tid` `transactionid`, `apst`.`roomindex` `room no`, `apst`.`pid` `paymentid`, `apst`.`rid` `reservationid` `agent_payment_sub_transaction` `apst` (`apst`.`rid` <> 0) group `apst`.`tid` , `apst`.`roomindex` the mapping <?xml version="1.0"?> <hibernate-mapping> <class name="com.abc.def.entity.reservationtransactionview" table="reservation_transaction_view" catalog="abcd"> <id name="id" type="string" /> <property name="transactionid" type="java.la...

c++ - Reading binary data in memory into a stringstream and stream this over a socket -

i know if possible to, instance, take piece of data in memory, read output stringstream (as binary data) , write onto socket client application process. the problem run while attempting following: example: char name[1024] = "test"; std::ostringstream message (std::stringstream::out | std::stringstream::binary); len = strlen(name); message.write(reinterpret_cast<const char*>(&len), sizeof(int)); message.write(test, len*sizeof(char)); i want write stringstream socket of data in it, problem this: stringstream write executes first time, in case writing 4 (the length of string) , none of subsequent writes. missing here? if not best way it, best way accomplish this? partly reduce file i/o cached memory snapshots. thanks in advance.. your code (with minor fixes) appears work me, might check sure correctly handling buffered binary data, i.e. not assume std::string contains string.

regex - Trim extra pipes off end of text file in Windows -

so have process outputs text file pipe delimited, looks this: |abc123|1*|004|**gobbligook|001|%|2014-01-01||||||||||||| this example, , i'm not sure if answer involves regular expressions. if put actual line. anyways issue so example import process accepts file looking 8 pipes, there 20, if sees more pipes after 8 it's looking import process fails. question is there process can use in windows environment trim trailing pipes off end of entire file? update magoo supplied me great answer working keep getting error: delimiter unexpected @ time here code: @echo off setlocal set "sourcedir=c:\users\desktop\pipe delimiter project" set "destdir=c:\users\desktop\pipe delimiter project" ( /f "tokens=1-7delims=|" %%a in ('type "%sourcedir%\test.txt"') ( echo(^|%%a^|%%b^|%%c^|%%d^|%%e^|%%f^|%%g^| ) )>%destdir%\newfile.txt anyone know what's wrong? put in line question |abc123|..| pasted in file 6 times...th...

How to find whether app is running in background or foreground or killed android -

i need suggestion guyzz that, in application using gcm broadcast receiver , , app having pin page also. here need check condition either user logged in or not when ever push notification comes, depends upon need set different activities . can suggest me how solve this?? sorry english. you can followed: when app not started/ running , start notification, oncreate gets called. @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); } when app running (background or foreground), , start new intent notification method gets called: (if using singletop) @override protected void onnewintent (intent intent){ } to detect whether app running back- or foreground, can set boolean in onpause/onresume: @override protected void onresume() { super.onresume(); runningonbackground = false; } @override protected void onpause() { super.onpause(); runningonbackground = true; } hope helps!

php - Compare two CSV files and update prices on the main CSV -

magento csv sku,price bfj182h,£89.85 bfj135y,£163.10 ec32,£100.00 ec37,£104.00 price update sheet sku,price bfj182h,£109.47 bfj135y,£180.28 ec32,£150.69 ec37,£200.73 basically want run query searches sku codes in price update sheet , compares price price update sheet against price magento csv , if price different in magento csv price in price update sheet regardless of if lower or higher , update price on magento csv same price update sheet. how can go doing this? which can put full csv , re upload site update prices. use magmi instead. http://sourceforge.net/projects/magmi/ it takes little while learn -- when around learning import processes using tool, you'll never back. read docs! http://sourceforge.net/apps/mediawiki/magmi/index.php?title=main_page for magmi, price update sheet alone sufficient update. (you don't need original csv really, assuming have values magento csv current prices on magento store). need 'store' column after sku e...

Android - How to reload a fragment on tab selection -

i developed android application action bar 3 tabs , 3 frgments.i need tabs parameter sharedpreferences , operations on every time tab selected. problem app operations once @ start of application, not know how define every time user select tab, idea? set index each tab when add tabs action bar this taba.settag(1); // 1 - first tab and override ontabselected() method , operations fragment in specific tab @override public void ontabselected(actionbar.tab tab, fragmenttransaction ft) { int tabindex = (integer)tab.gettag(); // stuff here based not tab id }

Python constructors with default values? -

so, assignment create ship class has attributes 'name' , 'fuel.' name should have default value of "enterprise" , fuel should have default of 0. , have create object no parameters, each single parameter, , both. 1 that's not working 1 fuel , i'm not sure why. here's code: class ship(object): def __init__(self, name = "enterprise", fuel = 0): self.name = name self.fuel = fuel def status(self): if self.fuel < 0: self.fuel = 0 print self.name, "\nfuel:", self.fuel, "\n" #main ship1 = ship() ship1.status() ship2 = ship("space ship1") ship2.status() ship3 = ship(10) ship3.status() ship4 = ship("space ship2", 10) ship4.status() and here's it's outputting: enterprise fuel: 0 space ship1 fuel: 0 10 fuel: 0 space ship2 fuel: 10 the third 1 printing fuel name , defaulting fuel 0 isn't right. how can fix it? ...

Where does Notepad++ maintain its list of currently opened files? -

i using notepad++ on windows machine , mistake opened 64mb file. notepad++ stuck permanently , not able use it. is there configuration file notepad++ uses maintain list of opened files? if yes, can open file , remove entry of 64mb file have opened in it? c:\users\user_name\appdata\roaming\notepad++\session.xml

ios7 - How to present a half modal view controller over the top with iOS 7 custom transitions -

how go presenting "half view" controller on top of main view controller? requirements: - present second view controller slides on top of main view controller. - second view controller should show on half of main view controller - main view controller should remain visible behind second view controller (transparent background, not showing black underneath) - second view controller should animate in animation similar modal vertical cover, or ios 7 custom transition - user can still interact buttons on main view controller when second view controller active (i.e. second view controller not cover entire main view controller)r - second view controller has own complex logic (cannot simple view) - storyboards, segues, ios 7 - iphone only, not ipad. i have tried modal view controller, not allow interaction main view controller. can provide example of how ios7 custom transition or method. one way add "half modal" controller child view controller, , animat...

javascript - Ember controller seems to create multiple instances in template and route? -

i have created small jsfiddle doesn't perform login right using ember 1.5 , handlebars 1.3. login controller holds property "islogin" set true. why afterwards none of other routes , templates takes notice of change? <script type="text/x-handlebars"> {{#if controllers.login.islogin}} <div class="container"> <div class="navbar"> <div class="navbar-inner"> <a class="brand" href="#">ember digest</a> <ul class="nav pull-right"> <li>{{#link-to 'articles'}}articles{{/link-to}}</li> <li>{{#link-to 'photos'}}photos{{/link-to}}</li> <li>{{#link-to 'login'}}login{{/link-to}}</li> </ul> </div> </div> {{outlet}} </div> {{/if}} {{render 'login' controllers....

ios - How to get visible viewController from app delegate when using storyboard? -

i have viewcontrollers , , don't use navigationcontroller . how can visible view controller in app delegate methods (e.g. applicationwillresignactive )? i know how nsnotification , think it's wrong way. this should you: - (void)applicationwillresignactive:(uiapplication *)application { uiviewcontroller *vc = [self visibleviewcontroller:[uiapplication sharedapplication].keywindow.rootviewcontroller]; } - (uiviewcontroller *)visibleviewcontroller:(uiviewcontroller *)rootviewcontroller { if (rootviewcontroller.presentedviewcontroller == nil) { return rootviewcontroller; } if ([rootviewcontroller.presentedviewcontroller iskindofclass:[uinavigationcontroller class]]) { uinavigationcontroller *navigationcontroller = (uinavigationcontroller *)rootviewcontroller.presentedviewcontroller; uiviewcontroller *lastviewcontroller = [[navigationcontroller viewcontrollers] lastobject]; return [self visibleviewcontroller:...

java - Issue with arrays -

i have issue array while developing bukkit plugin. why doesn't work? supposed check whether player has placed block. keeps on saying "diamonds!!" ingame. @eventhandler public void onplaceofdiamond(blockplaceevent e){ player player = e.getplayer(); string storage[] = new string[100]; int = 0; if(e.getblock().gettype() == material.diamond_block){ if(arrays.aslist(storage).contains(player.getname())){ player.sendmessage(chatcolor.blue + "you on list"); }else{ player.sendmessage(chatcolor.blue + "diamonds!!"); storage[i] = player.getname(); i++; } } } it's because creating new storage array every time player places block: @eventhandler public void onplaceofdiamond(blockplaceevent e){ player player = e.getplayer(); string storage[] = new string[100]; so you'll never have complete list of players. fix this, should declare array ou...

python - How can I stop TastyPie doing UPDATE queries for no reason? -

Image
i'm seeing usual goings on in application. no reason server slows down when have little or no traffic. after lots of trial , error found problems disappeared when removed toonefield on tastypie resource! what found unknown reason tastypie doing db updates on these toonefields no reason! the... moment! i found possible bug filed here claims have fixed update issue. have installed latest version pip still see problem. can help? class incentiveresource(modelresource): product_introducer = fields.toonefield(productresource, 'referrer_product', full=true) product_friend = fields.toonefield(productresource, 'referee_product', full=true) class meta: queryset = incentive.objects.all().order_by('-date_created') resource_name = 'incentive' allowed_methods = ['get'] authentication = multiauthentication(clientauthentication(), apikeyauthentication()) authorization = authorization() ...

java - unknown ISRA exception while uploading a doc IN Filenet -

i have setup isra in local webshpere , trying upload document filenet thourgh isra. isra connection happening fine but, getting following exception while trying upload document through israutil.jar , isra.jar: at com.citigroup.rel.citip8.pe.peutils.uploaddocument(peutils.java:434) @ com.citigroup.rel.citip8.pe.peutils.uploaddocumentnewimage(peutils.java:334) @ com.citigroup.rel.defaultmail.action.workitemdetailopsaction.delete(workitemdetailopsaction.java:418) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:60) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:37) @ java.lang.reflect.method.invoke(method.java:611) @ org.apache.struts.actions.dispatchaction.dispatchmethod(dispatchaction.java:276) @ org.apache.struts.actions.dispatchaction.execute(dispatchaction.java:196) @ org.apache.struts.action.requestprocessor.processactionperform(requestprocessor.java:4...

javascript - Firefox displaying static gif. Works fine in Internet explorer -

please me. have spent amount of time fix without success. following loading modal box works fine in browsers except firefox. in firefox shows static gif image instead of animated loading spin. html: <input type="submit" name="submitpayment" value="complete order" class="square checkout button" onclick="showprogressanimation();" /> <div id="loading-div-background"> <div id="loading-div" style="display:none"><img style="margin:30px;" src="images/loading.gif" alt="loading.."/> <p align="center" valign="middle" style="color:##1a0980; font-size:24px; font-weight:normal; text-align:center">please wait while processing order....</p> </div> </div> java script: <script type="text/javascript"> $(document).ready(function () { $("#loading-div-background ...

php - Codeigniter Why I can't load view from MY_Controller -

i want every controller have method _render_page, loads master template , passes data object. my home controller class looks this: class home extends my_controller { function __construct() { parent::__construct(); } public function index() { $data['title'] = "site title"; $data['the_view'] = 'welcome_message'; $this->_render_page($this->layout, $data); //$this->load->view($this->layout, $data); //this works ok.. } } my_controller class: class my_controller extends ci_controller { public $layout; public $viewdata; public function __construct() { parent::__construct(); $this->layout = 'layout/master_template'; $this->viewdata = null; } public function _render_page($view, $data=null, $render=false) { $this->viewdata = $data; $this->viewdata['the_view'] = $view; if($this-...

drjava - Java Type mismatch: cannot convert from java.lang.Object -

i working out of blue pelican java textbook , using drjava. working on lesson 43 big bucks project have use bankaccount class: public class bankaccount { public bankaccount(string nm, double amt) { name = nm; balance = amt; } public void deposit(double dp) { balance = balance + dp; } public void withdraw(double wd) { balance = balance - wd; } public string name; public double balance; } and creat class allow me enter multiple accounts, store them in array list , determine account has largest balance. here code far: import java.io.*; import java.util.*; //includes arraylist import java.text.*; //for numberformat public class bigbucks { public static void main(string args[]) { numberformat formatter = numberformat.getnumberinstance( ); formatter.setminimumfractiondigits(2); formatter.setmaximumfractiondigits(2); string name; list arylst...

Echo: Class, Style and php -

i have these 3 strings need convert php can echo them. strings little complex me write out in straight php wondering if give me example of how below. you don't have use code if don't want to, example on how can echo out these lines html class, style , embedded php sufficient. this 1st one. original: <div class="newsdate" style="margin: 10px 0 !important;"><?= date("f d, y", strtotime($r['date'])); ?></div> this tried getting confused in syntax: echo "<div class='newsdate' style='margin: 10px 0 !important;'>"."date('f d, y', strtotime($r[date])).'</div>"; 2nd one (little more complex me) original: <div class="articletext"><style>.articletext img{width:100%; height:auto;}</style><?php $string = $r[3]; $max = 300; // or 200, or whatever if(strlen($string) > $max) { // find last space < $max: $shorter =...

c# - Validation error: EntityType has no key defined -

Image
when try create controller error call " entitytype has no key defined" . why that? using system; using system.collections.generic; using system.data.entity; using system.linq; using system.web; using system.componentmodel.dataannotations; namespace hotelmanagementsystem.models { public class room { public int roomno { get; set; } public string packageid { get; set; } public string resid { get; set; } public bool tv { get; set; } public bool wifi { get; set; } public bool internet { get; set; } public bool telephone { get; set; } public bool ac { get; set; } public bool bathroom { get; set; } public bool fridge { get; set; } public bool homethearter { get; set; } } public class roomcontext : dbcontext { public dbset<room/*table name*/> hotelmanagementsystem /*data base name */ { get; set; } } } erroe message : add property of id primary key this:...

css - Stylus mixin referring to the mixed-in element's parent? -

i've been fiddling stylus bit now, , wanted accomplish mixin feels like should possible though can't figure out. specifically, i'd write mixin styles parent of element mixin applied. can never remember right syntax vertically centering pseudo-element, example, i'd have handy-dandy mixin it; i'd ideally apply element centered, , pseduo-element belongs on element's parent. not surprisingly, didn't work: vertical-middle() display inline-block vertical-align middle & font-size 0 &::before content '' display inline-block height 100% vertical-align middle .nav-wrapper .nav vertical-middle() ...and in fact may have confused stylus bit, since css generated had 2 .nav-wrapper .nav blocks: .nav-wrapper .nav { display: inline-block; vertical-align: middle; } .nav-wrapper .nav { font-size: 0; } .nav-wrapper .nav::before { content: '';...

c# - MVVM ObservableCollection inside a ObservableCollection (ViewModel) -

i wondering how can have sub collection of parent collection? for example, i have observablecollection of products, adding , hen binding xaml correctly. however, need have observablecollection contains product items. basically thinking in view model of having productcollection[0].productitemcollection.add(newproductitem); how go in mvvm? thanks chris not sure if that's looking but... let's have 2 grids in xaml. first shows porducts, second selected product's items. <window x:class="wpfapplication1.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <grid> <grid.rowdefinitions> <rowdefinition height="173*" /> <rowdefinition height="147*" /> </grid.rowdefinitions>...

sql - MySQL CASE QUERY with INNER JOIN -

i have 1 table string type. (photo_add, photo_comment etc.) have 4 other tables connected these types. i need make query choose data these tables according type. i created not work. select distinct a.id, a.event, a.params, a.created_at, a.item_id, a.sender_id, a.receiver_id, u.name, u.id userid `eva49_lovefactory_activity` a, eva49_users u case a.event when "photo_add" inner join eva49_lovefactory_photos lp on lp.id = a.item_id , lp.fsk18 = -1 when "group_create" inner join eva49_lovefactory_groups lg on lg.id = a.item_id , lg.fsk18 = -1 when "photo_comment" inner join eva49_lovefactory_item_comments lic on lic.item_id = a.item_id , lic.fsk18 = -1 when "profile_comment" inner join eva49_lovefactory_item_comments lic on lic.item_id = a.item_id , lic.fsk18 = -1 when "profile_comment" inner join eva49_lovefactory_profiles lp on lp.user_id = a.receiver_id , lp.status_fsk18 = -1 else 1...

python - Slice one Pandas DataFrame based on another -

i have created following pandas dataframe based on lists of ids. in [8]: df = pd.dataframe({'groups' : [1,2,3,4], 'id' : ["[1,3]","[2]","[5]","[4,6,7]"]}) out[9]: groups id 0 1 [1,3] 1 2 [2] 2 3 [5] 3 4 [4,6,7] there dataframe following. in [12]: df2 = pd.dataframe({'id' : [1,2,3,4,5,6,7], 'path' : ["p1,p2,p3,p4","p1,p2,p1","p1,p5,p5,p7","p1,p2,p3,p3","p1,p2","p1","p2,p3,p4"]}) i need path values each group. e.g groups path 1 p1,p2,p3,p4 p1,p5,p5,p7 2 p1,p2,p1 3 p1,p2 4 p1,p2,p3,p3 p1 p2,p3,p4 i'm not sure quite best way it, worked me. incidentally works if create id variable in df 1 without "" marks, i.e. lists, not strings... import itertools df = pd.dataframe({'groups' : [1,...

c++ - Entry point for MFC application -

i have created new emty project. have added cpp , header hello world files taken jeff prosise 'programming windows mfc' book. have set use of mfc use mfc in shared dll got error entry point must defined how fix problem? cpp: #include <afxwin.h> #include "hello.h" cmyapp myapp; ///////////////////////////////////////////////////////////////////////// // cmyapp member functions bool cmyapp::initinstance () { m_pmainwnd = new cmainwindow; m_pmainwnd->showwindow (m_ncmdshow); m_pmainwnd->updatewindow (); return true; } ///////////////////////////////////////////////////////////////////////// // cmainwindow message map , member functions begin_message_map (cmainwindow, cframewnd) on_wm_paint () end_message_map () cmainwindow::cmainwindow () { create (null, _t ("the hello application")); } void cmainwindow::onpaint () { cpaintdc dc (this); crect rect; getclientrect (&rect); dc.drawtext ...

logging - separating stdout and sterr in cron jobs -

***i'm not sure if belongs here on on serverfault seems borderline. if serverfault better, please shift on , apologies trouble. i have task running on cron , want stderr , std out redirected file , stderr directed file. (note: script php) i've tried things <script> 1>> a.log 2>> | tee -a a.log | /bin mail -se and <script> | a.log 2>> /bin/mail -se but can't seen right. either stdout winds in mail or double entries in log file etc. i tried <script> >> test.log 2> tee test.log | /bin/mail -s but email blank when introduced error. message displayed stdout upon start execution (the script takes 40 seconds complete): "null message body; hope that's ok" finally found solution works <script> 1 3>> <log> 2>&1 1>&3 | tee -a <log> | /bin/mail

html - CSS - Menu Text moving out of background -

Image
hey guys new in css sorry if simple , stupid question, try style website begining, cant fail happend me menu, text moving out of background , cant find why. it looks like: http://funedit.com/imgedit/soubory/small_18262058231396865881.jpg but text should in middle of blacck background :p my html: <div id="menu"> <ul> <a href="#"><li>gamesites<span id="arrow"></span></li></a> <li id="spacer"> </li> <a href="#"><li>hry<span id="arrow"></span></li></a> <li id="spacer"> </li> <a href="#"><li>servery<span id="arrow"></span></li></a> <li id="spacer"> </li> <a href="#"><li>clanky<span id="arrow"></span></li></a> <li id=...

php - how to decrypt magento dataencrypted -

i want decrypt magento data using data encrypted , config key show data plan test i tried alotof ways no 1 has done me there way i mean there way php script it and thanks i used code found here doesn't show anything <?php class encryption { const cipher = mcrypt_rijndael_128; // rijndael-128 aes const mode = mcrypt_mode_cbc; /* cryptographic key of length 16, 24 or 32. not password! */ private $key; public function __construct($key) { $this->key = $key; } public function encrypt($plaintext) { $ivsize = mcrypt_get_iv_size(self::cipher, self::mode); $iv = mcrypt_create_iv($ivsize, mcrypt_dev_random); $ciphertext = mcrypt_encrypt(self::cipher, $this->key, $plaintext, self::mode, $iv); return base64_encode($iv.$ciphertext); } public function decrypt($ciphertext) { $ciphertext = base64_decode($ciphertext); $ivsize = mcrypt_get_iv_size(self::cipher, self::mode); ...

php - Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number -

im having error select statment using pdo, , im not understanding reason why happening. do see wrong here? i'm having error: warning: pdostatement::execute(): sqlstate[hy093]: invalid parameter number: parameter not defined in $readgallery->execute(); $delid = $_get['delid']; $thumb = $_get['thumb']; $folder = '../uploads/'; $readgallery = $pdo->prepare("select * gallery news_id = ?"); $readgallery->bindparam(':news_id', $delid); $readgallery->execute(); $numgallery = $readgallery->rowcount(); change $readgallery = $pdo->prepare("select * gallery news_id = ?"); to $readgallery = $pdo->prepare("select * gallery news_id = :news_id");

angularjs - ng-click not firing from anchor tag using directive -

i've written directive return ul 1 list item along function action should fire. action not fire, , see no error in log. here's code: localizer_module.directive('utilitymenu', function(){ return { scope: { action: '&' }, restrict: 'e', replace: true, template: "<ul ><li style='font-size:12px; color:#fff;'><a href ng-click='action()'>hello, world</a></li></ul>", }; }); localizer_module.writelog = function(){ console.log("called!"); }; if add onclick="alert('fired')", alert. doing wrong directive? thanks i don't have enough here you. need plunker or can figure out why isn't working. here's things check though: make sure parent scope contains directive has function assigned calling via action attribute. so if you're doing this: <utility-menu a...

jquery - Downloading and then uploading files with JavaScript -

now first of all, i'm making userscript, meaning don't own servers download files or servers upload files. so need download file server (needs type, not text files), , somehow submit file file upload form on website. possible? @ first wondering if i'd able submit file directly 1 server other, don't think that's possible. so there way can this? can use jquery well. as long won't blocked xss prevention, load data using xmlhttprequest post other site. here basic functional example: var xhr = new xmlhttprequest(); xhr.open("get", "http://www.example.com/file", true); xhr.onload = function () { xhr.close(); var xhr2 = new xmlhttprequest(); xhr2.open("post", "http://www.example2.com/form", true); xhr2.send(xhr.response); } xhr.send(); i advise add code catch errors for more details on xmlhttprequests, documentation can found on mdn here , instructions on how use on mdn here

python - How do I use log.debug in a .py file in django? -

i have log.debug("variable %s" % variable) in .py file in django. when went run in debugger in textwrangler clicking on #! --> run in terminal, couldn't log.debug output show up. i'm familiar javascript, can type console.log() , see output when open console. what's equivalent of web console python? the correct way debug django/python app place breakpoint in code import pdb; pdb.set_trace() if want print variable in console, use print function. you can raise exception or return httpresponse containing variable. although, encourage use breakpoint approach.

How to loop a php file when there is a $_GET? -

i little confused on structure need build php file. i have $_session['listingname'] = $_get['listingname']; @ start of file, listingname last php file. want have button submit text , refresh page. not sure how should approach it, because if refresh/reload page, can't perform $_get['listingname'] gives error of undefined method. some advice appreciated. thanks try this... if(!empty($_get['listingname'])) { $_session['listingname'] = $_get['listingname']; }

Shapes get repeated in kineticjs stage.draw()? -

when ever draw shape, call stage.draw() method, shapes repeated once again. question how add shapes without more occurrence of drawn shapes. here sample code //creating group adding text var textgroup = new kinetic.group({ x: e.pagex, y: e.pagey - posy, draggable: true, id: 'textgroup' }); layer.add(textgroup); stage.add(layer); textname = 'text' + shapecount; //creating text var text = new kinetic.text({ x: 0, y: 0, text: comment, fill: "#" + fillcolor, fontsize: 24, opacity: 0.5, name: textname }); //adding text group textgroup.add(text); //finally drawing stage stage.draw(); can me out...

csv - Powershell move-item file in use -

trying match string in bunch of csv files , move string folder. script logic seems work keep getting errors file use. imagine powershell has file locked. how can work around this? $destdir = "c:\temp\newcsv" $srcdir = "c:\temp\csv" $searchstring = "teststring" gci $srcdir -filter *.csv | select-string $searchstring | select path | move-item -dest $destdir -whatif i'm not sure why script doesn't work, unless select-string keeping file open object being passed down pipe. if rephrase it'll work: $destdir = "c:\temp\newcsv" $srcdir = "c:\temp\csv" $searchstring = "title" gci $srcdir -filter *.csv | ?{select-string $searchstring $_ -quiet}|move-item -destination $destdir

sql - C# Left join in LINQ -

this question has answer here: convert sql query join lambda expression 1 answer not sure how convert following sql linq expression. db use referential integrity , table content related table content_training in 1 many relationship (ex: 1 content can have many content_trainings). select c.contentid, c.name, ct.trainingtypeid dbo.content c left join dbo.contenttraining ct on c.contentid = ct.contentid c.expirationdate not null order ct.trainingtypeid, c.name i have tried this, seems work. however, not usage of "let" keyword. var data = (from c in context.contents let ct = ( t in context.content_training t.contentid == c.contentid select new { t.trainingtypeid } ).firstordefault() c.expirationdate.hasvalue orderby ct.trainingtypeid, c.name select new { c.contentid, c.name, ct.trainingtypeid } ).tolist(); for left join, need use defaultifempty(...

How to transfer SSL from Windows to Linux server in shared hosting? -

i've found tutorials transferring ssl windows linux server such 1 here: https://major.io/2007/03/23/exporting-ssl-certificates-from-windows-to-linux/ . possible in shared hosting because in shared hosting apache configuration may not allowed? well possible transfer ssl certificate windows (iis) environment linux (apache) environment. within shared hosting environment, (at least majority of them) not possible install ssl certificate hosting account without of hosting provider. ssl installation requires ip allocated domain within server's configuration, unless deployed sni, , virtualhost entry routing requested port 443 (tls/ssl) domain on ip have created. needless these configurations affect server whole , chargeable services providers not provide direct access this. if provider uses plesk or cpanel or vdeck case. that being said worth money have hosting provider complete configuration , related services pretty cheap. providers average around $20.00 per year se...

ruby on rails - New Relic with Mixpanel -

when website protected login pwd gate, mixpanel not showing new relic pings on live view know pinging showing when website down. reason, since remove “gate” meaning website public, new relic every 20 seconds pings showing on mixpanel live view. terrible. both new relic , mixpanel have been integrated ruby. any idea cause this? thanks class applicationcontroller < actioncontroller::base http_basic_authenticate_with name: "xxxx", password: "xxx", if: proc.new{ rails.env.staging? } # before_filter :check_beta_user before_filter :get_tracker before_filter :verify_account_existance, :except => [:destroy] include simplecaptcha::controllerhelpers def check_beta_user # return if rails.env == "development" return true unless rails.env.production? session[:beta] = true if request.referrer && request.referrer == "http://signup.mawwell.com/" return redirect_to "http://xxxxxx.com/" unless session[:...

sql server - How to get max number in a column? -

i'm been trying find example of how max number in column.what want is, find max number of column in table_a, points(column). want output max number example <cfoutput> <tr> <th><div align="right">#maxnumber#</div></th> </tr> </cfoutput> not sure if way output, want 1 number(the max) , not array of column. thanks help, new coldfusion. you can top x query , output them accordingly <cfquery name="maxquery"> select top 2 points table_a order points desc </cfquery> <cfoutput query="maxquery"> #maxquery.currentrow# - #maxquery.points#<br> </cfoutput>

c# - Breeze js save changes does not work if the controller method name is not `SaveChanges()` -

hi new breezejs i have post method on controller // post api/company/post [authorize(roles = "admin")] [acceptverbs("post")] [httppost] public object **savechanges**(jobject companyrequest) { return companyservice.saveentity(companyrequest); } and have call method in breezejs manager.**savechanges**().then(savesucceeded).fail(savefailed); this savechanges() same name controller method name. it's working now! but if change controller method name savechanges() savechangescompany() , change breeze side manager.savechangescompany() code // post api/company/post [authorize(roles = "admin")] [acceptverbs("post")] [httppost] public object **savechangescompany(jobject companyrequest)** { return companyservice.saveentity(companyrequest); } and breeze side **manager.savechanges...

wso2is - WSO2 RemoteUserStoreManagerService add user auto assign "Internal/everyone" role -

we using remoteuserstoremanagerservice admin service add subscribers (end application users) wso2 system. web service automatically assign "internal/everyone" role such user. if provide list of desired roles user ws function. can change such behavior? can turn off auto-assignment or need use different api creating subscribers? main problem is, "internal/everyone" role default has maximum system priorities, want manually assign desired roles subscriber. it's expected behavior 'internal/everyone' role assigned each , every user. purpose of having role assign permissions newly registered users (if want newly registered users capable of login , change password etc.). if not want such functionality, remove permissions role. hope helps.

intrusion detection - Snort rules for byte code -

i started learn how use snort today. however, need bit of rules setup. i trying following code on network sent machine. machine has snort installed on (as installed now). the code want analyze on network in bytes. \xaa\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x02\x74\x00\x00' (total of 14 bytes) now, looking @ wanting analyze first 7 bytes of code. me if 1st byte (aa) , 7th byte (0f). want snort set off alarm. so far rules are: alert tcp any -> any \ (content:"|aa 00 00 00 00 00 00 0f|"; msg:"break in attempt"; sid:10; rev:1; \ classtype:shellcode-detect; rawbytes;) byte_test:1, =, aa, 0, relative; byte_test:7 =, 0f, 7, relative; i'm guessing have made mistake somewhere. maybe familair snort me out? thanks. congrats on deciding learn snort. assuming bytes going found in payload of tcp packet rule header should fine: alert tcp any -> any we can specify content match using pipes (||) let snort know these characters should ...

php - Format content of array (to match Highcharts requirements) -

i have php array created simple xml object , looks following example (hard-coded demoing): $arr = array("item1"=>"53","item2"=>"20","item3"=>"7","item4"=>"4","item4"=>"2","item6"=>"2","item7"=>"1"); i use array create chart using highcharts requires different format (see below). how can convert content of array match format ? [['item1',53],['item2',20],['item3',7],['item4',4],['item5',2],['item6',2],['item7',1]] many this, mike. just try with: $output = json_encode(array_map(function($key, $value){ return array($key, (int) $value); }, array_keys($arr), array_values($arr))); output: string '[["item1",53],["item2",20],["item3",7],["item4",2],["item6",2],["item7",1]]' (length=75...

Where is PayPal's elusive IPN History? -

i have ipn receiver on server receiving ipns , re-posting them paypal's server ( https://www.paypal.com/cgi-bin/webscr ) validation. testing using ipn simulator , receives invalid . i've done bulk of work , got servers talking. there's bit of fine polishing needed , cannot debug because have no feedback. can feedback? paypal's docs state following: " check ipn history on paypal.com. ipn history tells whether paypal sent given ipn message , whether listener responded it. page may provide information status of server on listener running. if necessary, can request paypal re-send given ipn message via ipn history page." -- https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/ipntesting/ so need find ipn history, right? account these ipn logs recorded? include ipns generated using simulator? if not what's point , how dev debug? i've looked in live merchant account, sandbox merchant account, sandbox payer account. th...

wso2is - wso2 identity server PAP,PDP,PEP caching -

http://xacmlinfo.org/tag/pep-cache/ how enable cacheing in pdp,pep,pap in wso2 identity server 4.5.0 in identity server, can find... pdp level caching... means, there 3 caches.. policy cache --> default enable. policies stored in in-memory default. can not change thing this. decision cache --> default enable. can configure (enable/disable , cache timeout) using entitlement.properties file can found @ <is_home>/repository/conf/security directory. attribute cache --> default enable. can configure (enable/disable , cache timeout) using entitlement.properties file can found @ <is_home>/repository/conf/security directory. policy , decision caches invalidated, when policy update detected. there web service api clear these caches.

c++ - Building a Unity exported Xcode project with LLVM and libc++ -

i'm attempting build xcode project exported unity llvm against libc++ (the llvm c++ standard library). project compiles , links against libstdc++ (the gnu c++ standard library). if include "/usr/lib/libstdc++.dylib" amongst other linker flags resolves of issues leaves 1 problem: undefined symbols architecture i386: "__z21unitykeyboard_gettextpss", referenced from: __znk16keyboardonscreen7gettextev in libiphone-lib.a(iphonekeyboard.o) it seems looking method void unitykeyboard_gettext(std::string* text) part of keyboard.mm. when dump symbols keyboard.o get 00002900 t __z21unitykeyboard_gettextpnst3__112basic_stringicns_11char_traitsiceens_9allocatoriceeee 000161c0 s __z21unitykeyboard_gettextpnst3__112basic_stringicns_11char_traitsiceens_9allocatoriceeee.eh so mangled names seem incompatible when use libc++. there possible of way of resolving issue?

bash - Parse a name out of a string -

there many server logs need analyzed. every log message string , i'm looping though stings. problem: i need see if string matches pattern some text job *some_one_word_name* has finished, status some more text i need save word between words job , has finished . in particular case (see below) save egimmswellhdr seq_loading_sor_to_landing..jobcontrol (dswaitforjob): job egimmswellhdr has finished, status = 1 (finished ok) you can use awk: s='job egimmswellhdr has finished' awk -f 'job | has finished' '{print $2}' <<< "$s" egimmswellhdr and using pure bash: [[ "$s" =~ "job "([^[:blank:]]+)" has finished" ]] && echo ${bash_rematch[1]} egimmswellhdr

computer science - Push Down Automanton-Computation -

Image
i trying understand how pda works. in following diagram understand how transition functions work , how stack must updated. question have why start state accept state well? while pda l = {on1n | n ≥ 0}, means must not accept empty string. can 1 explain reason making start accept state, please? l = {0 n 1 n | n ≥ 0} when n=0, string is: 0 0 1 0 = 0 0's followed 0 1's empty string. according definition, language l include empty string. if not accept empty string, definition be: l = {0 n 1 n | n > 0}

jquery - Sliding sidebar position calculations not correct -

i'm building follow or sticky sidebar in jquery website i'm working on. here's link site sidebar. you can see it's behavior strange. i'm trying follow guide , add stop function once gets bottom: http://css-tricks.com/scrollfollow-sidebar/ when user scrolls down, want sidebar remain @ top 32px top-padding, , when user scrolls bottom, want sidebar stop 32px bottom-padding @ top of footer. i'm confused variables , math behind it, in head makes sense, maybe need else take @ it. anyways, here's jquery code: <script> $(function() { var $sidebar = $("#sidebar"), $window = $(window), $footer = $("footer"), // use footer id here foffset = $footer.offset(), offset = $sidebar.offset(), threshold = foffset.top - $sidebar.height(), toppadding = 15; $window.scroll(function() { if ($window.scrolltop() > threshold) { $sidebar.stop().an...

Unzip an entry to memory in Racket -

i'm trying read file entry. program have now: #lang racket (require file/unzip) (require xml) (define (get-content file-name) (let ([in (open-input-file file-name #:mode 'binary)]) (unzip-entry in (read-zip-directory in) #"content.xml"))) currently program writes file content.xml filesystem. need have stored in memory (either output port, or string, or return value) instead of polluting filesystem. tell me please how can that? yes, can this, passing in custom entry-reader parameter unzip-entry . here's example of how it: (define (unzip-entry->bytes path zipdir entry) (call-with-output-bytes (lambda (out) (unzip-entry path zipdir entry (lambda (name dir? in) (copy-port in out))))))

java - How to Autowire in Junit Tests (General Newb Enquiry) -

this general question spring , creating application contexts. i working on unit test web site application. website uses spring , hibernate , want test data database. not know how connect spring ioc container unit tests. know applicationcontext.xml lives, how access beans in unit tests? here code: package com.example.test; import junit.framework.assert; import org.hibernate.sessionfactory; import org.hibernate.classic.session; import org.junit.test; import org.springframework.beans.factory.annotation.autowired; public class sessionfactorytest { @autowired sessionfactory sessionfactory; @test public void testsessionfactoryautowiring() { session session = sessionfactory.getcurrentsession(); assert.assertequals(session.getclass(),session.class); } } which generates error testsuite: com.example.test.sessionfactorytest tests run: 1, failures: 0, errors: 1, time elapsed: 0.011 sec testcase: testsessionfactoryautowiring took 0.002 sec...

ruby - adding spring gem breaks tests - rails -

i have test using rails spec (and capybara , factory girl ) , passing fine describe "project creation" before(:each) @project = factorygirl.create(:project) end "create projects fluently" visit root_path @project.should validate_presence_of(:title) end end then installed spring , , when run spring rspec spec/features/projects_spec.rb , throws failure/error: @project.should validate_presence_of(:title) nomethoderror: undefined method `validate_presence_of' #<rspec::core::examplegroup... how can be this issue discussed here: https://github.com/rails/spring/issues/209 , in readme file of shoulda-matchers gem how install preloader, solution was: move rspec-rails line in gemfile above shoulda-matchers add require: :false shoulda-matchers in gemfile add require 'shoulda/matchers' in spec_helper.rb my gemfile like: group :test gem "rspec-rails" gem 'shoulda-matchers', requ...