Posts

Showing posts from July, 2015

wix - ICE03: String overflow (greater than length permitted in column); Table: CustomAction -

i getting ice03: string overflow warning following code: <customaction id="customactionid" return="check" property="someproperty" value="very long string comes here" execute="immediate"/> this code included in separate .wxs file in fragment. if include directly within "product" tag warning disappears. happens following code: <binary id="somebinarywithaverylongname" sourcefile="sourcefile" /> i find out why happening? the customaction/@value attribute has limit of 255 characters in windows installer. so, if "very long string comes here" has more 255 characters hitting ice warning. binary/@id shorter because "identifiers" in msi , windows installer standardized on 72 characters identifiers. it mystery why ice03warning message different when placed under product element because ice validation executed against fi...

image - Screen Capture program in VB.NET -

i had created application captures screenshot of desktop screen. works button have used in form. want make thing works automatically using timers whenever try run program nullreferenceexception occur can 1 tell me whats going wrong here. timercapture interval=5 timersave interval=6 here code can tell scenario: public class form1 private sub timercapture_tick(byval sender system.object, byval e system.eventargs) handles timercapture.tick dim bounds rectangle dim screenshot system.drawing.bitmap dim graph graphics bounds = screen.primaryscreen.bounds screenshot = new system.drawing.bitmap(bounds.width, bounds.height, system.drawing.imaging.pixelformat.format32bppargb) graph = graphics.fromimage(screenshot) graph.copyfromscreen(bounds.x, bounds.y, 0, 0, bounds.size, copypixeloperation.sourcecopy) picturebox1.image = screenshot end sub private sub timersave_tick(byval sender system.object, byval e...

c# - Text is invisible in ContextMenu -

subj. while clicking on contextmenuitem, event shows fine, foreground , background totally white. <toolkit:contextmenuservice.contextmenu > <toolkit:contextmenu x:name="menu1"> <toolkit:menuitem header="item1" click="menuitem_click"/> <toolkit:menuitem header="item2" click="menuitem_click" /> <toolkit:menuitem header="item3" click="menuitem_click" /> <toolkit:contextmenu.itemcontainerstyle > <style targettype="toolkit:menuitem"> <setter property="background" value="yellowgreen" /> <setter property="margin" value="5" /> <setter property="foreground" value="red"/> </style> </toolkit:contextmenu.itemcontainerstyle...

html - Hide textfield blinking cursor -

i have textfield there way hide blinking text cursor? because doing horror/mystery website , 1 of clues start typing anywhere. maybe can javascript? try this: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title >text area no carat</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <style type="text/css"> .textarea-wrapper { position:relative; } .textarea-wrapper textarea { background-color:white; } .textarea-wrapper, .textarea-wrapper textarea { width:500px; height:500px; } .textarea-wrapper textarea.hidden { ...

file - Sharing directory in network c# -

i have copy files distant directory in same network. succed access directory : string[] parts = regex.split(@directory_path, @"\\"); // l'emplacement de repertoire \\nom de la machine\nomde repertoire string distant_directory = @"\\"+environment.machinename+ @"\" + parts[parts.length - 2]; string local_directory = @"stldirectory"; copydir(distant_directory, local_directory); the function of copy following : public void copydir(string sourcedir, string destdir) { directoryinfo dir = new directoryinfo(sourcedir); if (dir.exists) { string realdestdir; if (dir.root.name != dir.name) { realdestdir = system.io.path.combine(destdir, dir.name); if (!directory.exists(realdestdir)) directory.createdirectory(realdestdir); ...

webdriver - JUnit4 test case won't continue -

i created test suite 2 test cases using selenium ide. exported suite java/junit4/webdriver. the first test case allow user log-in site, member search after match found, access member's profile the second test case: once in member profile, click on link 'donation' add pledge. the test suite runs fine in selenium ide, hang in eclipse when executed suite. behavior in eclipse, first test case runs fine, 2nd case opens new browser, system required log-in (enter username , password). i know shall do, test cases 2 continues without asking user log-in. appreciate , advises. here test suite code break down 3 sections (i removed uid , pd, due site internal site) -test suite runner file: searchdonoraddpledge -test case1: searchdonorsuzy.class -test case2: donoraddpledge.class failure trace message: org.openqa.selenium.staleelementreferenceexception: element not found in cache - perhaps page has changed since looked command duration or timeout: 30.12 se...

c# - Paging not working with list view -

i have followed tutorial at codeproject , , have stumbled issue. i have listview , listing current members names of site: <asp:listview id="lstmembers" runat="server"> <layouttemplate> <table> <tr> <th>name</th> </tr> <tr id="itemplaceholder" runat="server"></tr> </table> </layouttemplate> <itemtemplate> <tr> <td> <%# eval("membername") %> </td> </tr> </itemtemplate> </asp:listview> and datapager underneath: <asp:datapager id="datapagerproducts" runat="server" pagedcontrolid="lstmembers" pagesize="3" onprerender="datapagerproducts_prerender"> <fields> <asp:numericpagerfield /> </field...

coffeescript - How to work with copy of an array and reset it later -

i have array list predefined data want work on. then want make copy of array on work, i.e. shuffling , popping 1 element. after list empty, want reset it, i.e. fill again contents of list . what have this: list = [{...}, {...}, {...}] list2 = list shuffle = (a) -> = a.length while --i > 0 j = ~~(math.random() * (i + 1)) t = a[j] a[j] = a[i] a[i] = t get_list_item = -> shuffle(list2) list2.pop() reset_list = -> list2 = list but after i've popped items list2 , reset_list() doesn't reset list. it's still empty list2 = list doesn't make copy of list , creates pointer same array. when using pop() original (and only) array loses elements. replace these instructions list2 = list.slice 0 , should work want to.

sql - Counting same column multiple times, already grouped -

i'm trying count "y"s , "n"s in 1 column group them column. can pull "y" or "n" where: select table2.group_by_this,count(table1.flag) table1 inner join table2 on table1.primary_key = table2.foreign_key table1.flag_required = "y" group table2.group_by_this and can see "y"s , "n"s whole data set , not grouped other column using first answer here: sql - counting column twice i'm not sure how desired outcome should little this: group_by_this y count n count ------------------------------- group1 10 1 group2 10 100 group3 0 10 group4 50 500 group5 1000 0 do need further grouping somehow? select table2.group_by_this , count(case when table1.flag = 'y' 1 end) , count(case when table1.flag = 'n' 1 end) table1 join table2 on table1.primary_key = table2.foreign_key group table2...

ajax - Check the username before registering in Wordpress -

i created script checking username before registering, not work. returns mistake. script in functions.php: function check_user_login_init(){ /* Подключаем скрипт для проверки */ wp_register_script('ajax-login-script', get_template_directory_uri() . '/js/ajax-login-script.js', array('jquery') ); wp_enqueue_script('ajax-login-script'); /* Локализуем параметры скрипта */ wp_localize_script( 'ajax-login-script', 'ajax_check_login_object', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'loadingmessage' => __('verified data, wait second...') )); // Разрешаем запускать функцию check_user_login() пользователям без привелегий add_action( 'wp_ajax_nopriv_check_user_login', 'check_user_login' ); } if (!is_user_logged_in()) { add_action('init', 'check_user_login_init'); } function check_user_logi...

vb.net - Send unsaved image or image from clipboard to to a program as a parameter -

question may not written. i have image viewing program , able send image program, photoshop. i can if image has saved source, can't figure out way send unsaved image program. adding image clipboard, , sending paste command application loads - works on condition paste command executed after program starts. mspaint, simple thread sleep fine. programs take unpredictable , long time open - gimp , photoshop - doesn't work unless set high enough sleep value. so question - can send image clipboard program parameter, or there way somehow know if program has loaded? i've thought first saving image temp image , sending - rather program not attempt save temp directory when pressing save. "is there way somehow know if program has loaded?" i think closest generic answer you'll use process.waitforinputidle() : use waitforinputidle() force processing of application wait until message loop has returned idle state. when process user interface exec...

windows - In wix repairing a setup throws an error -

to repair uninstall condition: <condition message="true">(launchfromexe = "true")</condition> this condition throws install error. use below condition: <condition message="true">launchfromexe</condition> i able repair setup. the first example requires launchfromexe property set string value "true" . second condition requires launchfromexe set value @ (i.e. value needs non-blank). in second case, in repair operations setting launchfromexe value (maybe initialized "false" ) , working. in old blog entry of mine , mention why should consider adding installed or launch conditions. recommend doing same above.

c# - Is there a function that waits for a button to be clicked instead of using the event function -

in windows forms, there function waits button clicked instead of using event function? basically want continue piece of code in function after enter button has been clicked instead of taking me start of click event function. or there way tackle this? okay sorry, edit: haven't written code story yet, have base classes , such, think of more interactive story, has linear style of game play follows story, have different functions control different parts of story, want every time enter button clicked continue story left of last. input i build class called gamestate . this state keep items displayed on single screen. graphics, text, title, etc. then find way sequence multiple instances of gamestate object, simple option list<gamestate> read in textfile/database/config @ startup. each time user presses button, move global counter forward 1 increment, , refresh game state screen. this way button "does same thing" every time, because stored in separ...

ios - Animating UIImageView with colorWithPatternImage -

i have uiimageview animated using following code: nsmutablearray *imagearray = [[nsmutablearray alloc] init]; for(int = 1; < 15; i++) { nsstring *str = [nsstring stringwithformat:@"marker_%i.png", i]; uiimage *img = [uiimage imagenamed:str]; if(img != nil) { [imagearray addobject:img]; } } _imagecontainer.animationimages = imagearray; _imagecontainer.animationduration = 0.5f; [_imagecontainer startanimating]; what want repeat image pattern. there colorwithpatternimage , isn't made animations. i want whole background filled animated pattern. instead of using large images (960x640) use image of 64x64 example , repeat fill screen. is there way? leave code is, instead using uiimageview use subclass: // // animatedpatternview.h // #import <uikit/uikit.h> @interface animatedpatternview : uiimageview; @end // // animatedpatternview.m // #import "animatedpat...

perl - Is it unpolite to put an END block in a module? -

would ok keep end block in example, because nobody wants broken terminal or shouldn't put end block in module? package my_package; use warnings; use strict; use term::readkey; sub _init_scr { ( $arg ) = @_; $arg->{backup_flush} = $|; $| = 1; term::readkey::readmode 'ultra-raw'; } sub _end_win { ( $arg ) = @_; print "\n\r"; term::readkey::readmode 'restore'; $| = $arg->{backup_flush}; } end { term::readkey::readmode 'restore'; } sub my_function { $arg = {}; _init_scr( $arg ); while ( 1 ) { $c = readkey 0; if ( ! defined $c ) { _end_win( $arg ); warn "eot"; return; } next if $c eq "\e"; given ( $c ) { when ( $c ge 'a' && $c le 'z' ) { print $c; $arg->{string} .= $c; } when ( $c eq "\cc" )...

sql - Merge same cells in iReport -

is possible have sum in detail band in ireport? important have cells merged vertically after export excel this: ----------------------------- | id | year | value | sum | ----------------------------- | | 2010 | 55 | | | 1 | 2011 | 65 | 180 | | | 2012 | 60 | | ----------------------------- | 2 | 2010 | 70 | 70 | ----------------------------- my idea have main query group clause , "year" , "value" use table component query. problem query long running , need have 1 in whole report. first have @ here . it's grouping rows. see should create group in report, not in query depending on id field. for calculating sum field, drag value field column footer, , see pop-up menu. click result of aggregation function radio button, choose sum function. create variable calculate sum of value field. change variable's reset type group (to id_group). use field in sum field. for grouping rows depending on id, click on su...

java - How do I create a tree out of this? -

i have text file has content this: a.b.c.d a.c a.d a.x.y.z a.x.y.a a.x.y.b a.subtree i want make tree: / / \ \ \ b c d x subtree | | c y | / | \ d z b edit : a.x.y.a path 2 a nodes need treated seperate entities. a.x.y.a path. we can @ input file this: level0.level1.level2... i'm trying in python (i'm familiar java too, java answers well) somehow i'm logically not able it. my basic tree structure kind of this: class tree: def __init__(self,data): self.x = data self.children = [] logic this: for line in open("file","r"): foos = line.split(".") foo in foos: put_foo_in_tree_where_it_belongs() how approach this? also, if there java library helping me this, can shift java well. ne...

hash - Java: Duplicate objects getting added to set? -

if run below code output 2 means set contains 2 elements. think set should contain 1 since both objects equal based on hashcode() value .equals() method. seems obvious mistake in understanding ? package hello; import java.util.hashset; import java.util.set; public class test { public static void main(string[] args) throws exception { set<alpha> s = new hashset<alpha>(); alpha a1 = new alpha(); alpha a2 = new alpha(); s.add(a1); s.add(a2); system.out.println(s.size()); } } class alpha { int = 10; public int hashcode() { return a; } public boolean equals(object obj) { return (obj instanceof alpha && ((alpha) obj).a == this.a); } public string tostring() { return "alpha : " + a; } } your hash c ode method not override object class's hash c ode method , equals method breaks contract since doesn't agree hashcode results...

JavaScript/Php strange mishap, data became a key? -

i using code: javascript: (function () { var jscode = document.createelement('script'); jscode.setattribute('src', '//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js'); document.body.appendchild(jscode); var stuid = prompt("please provide student id"); $.ajax({ url: "data.php", data: stuid, success: function(response) { console.log(response); } }); }()); and var_dump came strange. var_dumped request , got.. array(1) { [1]=> string(0) "" } why did become associative array's key? how can avoid it? i sorry if sounds stupid question, new. this problem: data: stuid, the data variable needs key - value pairs, need like: data: { "id": stuid },

zooming - How to implement zoom in and out on screen in android? -

i have implement zoom in , out functionality on particular screen of app. in need apply on every item(on vertical lines, image,dots) available on screen. things has zoom when zoom @ point of screen google map. if 1 have solution, please me. indeed. :( take @ "screen magnifier" code. may you. or can reverse engineering of current available "screen magnifier app" .

php - Sometimes Session variables stop working -

i've had twice now. out of blue, log-in system stops working, , debugging find out $_session variable not survive log-in process. then, without obvious cause, resumes working. here's flow: user logs in @ index.html , form submits login.php ; login.php basic sanity, isset , empty checks, checks credentials database. if email address , password correct (i.e., exist in database) put them in $_session variable , redirect user home.php . home.php retrieves $_session variables. here fails. the second time (a few minutes ago) read more , found forum thread hadn't read previous time happened (i stopped reading when session variables worked again) said need have <?php instead of <? before session_start(); . tried it, not expecting work, when logged in, directly after changing (and thing changed afaik) worked. cause found? let's check after changing <?php <? . still works. can cause of , how can prevent (or, if can't prevented, detect what's...

.net - How do you register/unregister an EXE as a COM object from C#? -

edit 5/11/2013 : question asked how programmatically register com object using code .net without having use regasm. yahia's answer covers both how register dll programmatically , exe. original question : @ moment, have batch script call our ui register/unregister our software in com when setting default version (using regasm , adding registry entries). no longer wish use batch script running problem if script fails, program not aware of failure. there several ways can address issue, don't notion of calling batch scripts code if don't have to, i'd switch registering our software com using managed code. assuming it's possible, how register/unregister com objects c#? googling turns ways installer packages, or tells me use regasm, can't find information on how programmatically or if it's possible. thanks in advance assistance this. edit 5/10/2013 : looks registering exe com object not same registering dll. there programmatic way in .net (pinvoke fine...

JavaScript is not indented Firebug -

my javascript indented in eclipse, when debug same javascript code in firebug not. not sure why , makes harder debug. how fix this? things can think of cause are: a minifier on server side the internet provider minifying response save bandwidth (e.g. umts connections) a bad setting extensions.firebug.replacetabs (like e.g. 0 or 1) a bug in firebug i'd guess it's 1 of first two. sebastian

javascript - Passing values from child window to parent window which is on another domain? -

parent window served my.salesforce.com domain , child (pop-up) window served domain, visual.force.com. functionality populate value user selects in pop-up parent window. using window.opener communicate parent window, error message " domains, protocols , ports must match" in parent window. any idea how avoided? , values passed child parent? -sameer you might able hack around srcup function. it's not official api, blah blah blah seem recall it's used sf, around service cloud console. http://boards.developerforce.com/t5/java-development/issue-with-javascript-button-within-service-console-need-advice/td-p/290171 http://boards.developerforce.com/t5/visualforce-development/getting-quot-not-implemented-quot-javascript-error-on-srcup/td-p/361585 https://salesforce.stackexchange.com/questions/5009/open-a-service-console-primary-tab-from-a-custom-component-module (pity link techtrekker's comment has expired). http://salesforcedevbj.blogspot.com/20...

php - MySQLi Connection Issue -

i having trouble getting mysqli connect , respond properly. should relaying connection error time unable connect database, doesn't, when enter invalid details in attempt force connection error. $emailaddress = $_post['emailaddress']; $password = $_post['password']; if ($emailaddress&&$password) { $db = new mysqli('loalhost','rot','','fitesshouse'); if($db->connect_errno > 0) { die('unable connect database [' . $db->connect_error . ']'); } } edit: let me more clear. trying mysqli return connection error because connection fails. i'm not trying fix connection. when hit "submit" takes me blank page, means die statement not working. fixed , have error: notice: undefined index: emailaddress in /applications/xampp/xamppfiles/htdocs/fitnesshouse/login.php on line 5 this line of code should display error , stop scrip...

java - WebLogic OpenJDK 7 compatibility -

what versions of weblogic application server compatible openjdk 7? can't find concise answer googling oracle's documentation. although there reference getting oracle's binary release of jdk 7 working, don't know if extends openjdk. according wikipedia : standard | wls 7.0 | wls 8.1 | wls 9.0 | wls 10.0 | wls 10.3 | wls 12c ============================================================================== java | 1.3 | 1.4 | 5 | 5 | 6 (7 in 10.3.6+) | 7 java ee | 1.3 | 1.3 | 1.4 | 5 | 5 | 6 servlet | 1.2 | 2.3 | 2.4 | 2.5 | 2.5 | 3.0 jsp | 1.2 | 1.2 | 2.0 | 2.1 | 2.1 | 2.2 ejb | 2.0 | 2.0 | 2.1 | 3.0 | 3.0 | 3.1 jdbc | 2.0 | 2.0 | 3.0 | 3.0 | 3.0 | 4.0

javascript - how to use json parsed data to be displayed in html table -

like so how use json parsed data displayed in html table. display data in each row using html parsed data. <!doctype html> <html> <head> <script> function tjsonparse() { var i=0; var j=0; alert('1'); var obj = json.parse('{"employeelist": [{"name":"john","age":"40","gender":"male", "employment": [{"company":"tml","tenure":"2"}, {"company":"sys","tenure":"4"}, {"company":"rew","tenure":"5"}]}, {"name":"john2","age":"402","gender":"male2", "employment":[{"company":"tml2","tenure":"22"}, {"company":"sys2","tenure":"42"}, {"company":"rew2","tenure":...

Cassandra coexistence 1.1.x and 1.2.x -

we're running cassandra version 1.1.10 on 2 data centers , want upgrade 1 version 1.2.x it's possible upgrade 1 dc , work mixed version cluster? thanks it possible in short term part of upgrade not beyond that. in general, streaming between different cassandra versions not supported wouldn't able run repairs or add or remove nodes. it risky because mixed version clusters aren't tested long periods of time since mixed version support designed upgrades.

cocos2d x - the difference between coscos2dx xna and cocos2dx for wp8 -

i confused information on http://www.cocos2d-x.org/ what difference between cocos2dx xna , cocos2dx wp8? it looks cocos2dx xna support c# programming, cocos2dx wp8 support c++ , support wp8 welcome comment in nutshell: cocos2dx xna: supports wp7 & wp8, it's port written in c# (because @ time wp7 didn't support native languages) cocos2dx wp8: support wp8 it's written in c++ (it uses directx instead of opengl)

GWT eclipse : errors/warnings preferences -

is there possibility change gwt errors/warnings preferences without using eclipse ui ? these preferences stored anywhere or can overwrite them somehow using preference files in .settings directory ? best regards, jake if you're referring gwt compiler's log level setting it can set command line .

.htaccess - Multiple rewrite rules in htaccess -

i have .htaccess file rewrites urls seo purposes rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ /display.php?page=$1 [l,nc,qsa] rewriterule ^search/([^/\.]+)/?$ search.php?what=$1&where=$2 [l,nc,qsa] now first rewrite rule works fine. (www.domain.com/user goes display.php?page=user) second 1 should work (www.domain.com/search/something/else must go search.php?what=something&where=else what doing wrong here? your second rule incorrect looking for. requesting result of 2 captures, making 1 capture. try instead: rewriterule ^search/([^/\.]+)/([^/\.]+)/?$ search.php?what=$1&where=$2 [l,nc,qsa] edit: you'll need switch rules around. first rule captures everything, , therefore discard second. so, swap them around, , use l flag, suggested already.

ruby on rails - How to reject update attribute if param is blank or empty? -

i have form view <%= simple_form_for user.new |f| %> <%= f.input :email %> <%= text_field_tag "user[data[first_name]]" %> <%= f.button :submit %> <% end %> controller#create @user = user.find_or_initialize_by_email(params[:user][:email]) if @user.update_attributes(params[:user]) ... how reject update user hstore date attribute if params(in case first_name ) empty or blank? in opinion taking wrong strategy create action. do @user = user.new(params[:user]) @user.save if want ensure email unique across users, use rails' validation so: class user #... validates_uniqueness_of :email #... end your approach modify existing user same email during create. sounds wrong. for more details, have @ create of scaffolded controller.

sql server - TSQL optimizing code for NOT IN -

i inherit old sql script want optimize after several tests, must admit tests creates huge sql repetitive blocks. know if can propose better code following pattern (see code below). don't want use temporary table (with). simplicity, put 3 levels (table tmp_c, tmp_d , tmp_e) original sql have 8 levels. with tmp_a ( select id, field_x tmp_b as( select distinct id, field_y, case when field_z in ('test_1','test_2') 'categ_1' when field_z in ('test_3','test_4') 'categ_2' when field_z in ('test_5','test_6') 'categ_3' else 'categ_4' end categ b inner join tmp_a on tmp_a.id=tmp_b.id), tmp_c ( select distinct id, categ tmp_b categ='categ_1'), tmp_d ( select distinct id, categ tmp_b categ='categ_2' , id not in (select id tmp_c)), tmp_e ( select distinct id, categ tmp_b categ='categ_3' , id not in (select id tmp_c) , id not in (select id tmp_d)) select * t...

Selenium IDE blocks page content on latest Firefox version -

my team , have been experiencing odd issue selenium ide , latest firefox versions (19, 20) recently. our selenium ide script clicks on button open new page window expected page content missing. if close selenium ide interface (since open during script execution) , click open new page expected content appears. reverted firefox version down 14 , have noticed issue doesn't occur. in other words, having selenium ide interface open during script execution affects content display in pages when using latest firefox browser. so far our research has been futile. has experienced similar problem , found solution?

Starting a batch file using vb and streaming output to variable in real time -

(in program i'm starting batch file this: dim p1 new process dim psi new processstartinfo(appdata & "file.bat") psi.redirectstandarderror = true psi.redirectstandardoutput = true psi.createnowindow = true psi.windowstyle = processwindowstyle.hidden psi.useshellexecute = false p1 = process.start(psi) this batch file outputs 1 or more new lines every second or so. goal read these lines in real time. want have updated data every 0.5-1 second. p1.standardoutput.readtoend() the above doesn't work. every method i've tried far waits batch file finish, moment don't need info anymore. :p there's gotta simple i'm missing, can't seem find it.) edit: using new trick: addhandler p1.outputdatareceived, addressof outputhandler1 addhandler p1.errordatareceived, addressof errorhandler1 miner1.beginoutputreadline() private shared sub outputhandler1(byval sendingprocess object, byval outline datareceivedeventargs) if not string.isnullorem...

sql - Materialized View with Index in Separate Tablespace -

we're attempting perform data migration 1 schema via use of materialized views. process i've setup works follows: create snapshot/materialized view log: create snapshot log on oldschema.table; create materialized view on new schema: create snapshot table select * oldschema.table@olddb refresh materialized view break link, preserving table for historical reasons, indexes kept in separate tablespace , want maintain same structure on new schema (i'm aware there no performance benefit this, we're doing stay consistent). understand can accomplish altering primary key after fact: alter index pk_idx rebuild online tablespace idx_tablespace but possible perform @ time of snapshot creation avoid having move it? i'm hoping additional clause create snapshot command affects primary key gets generated. thanks you have using index tablespace clause in create materiazlized view command.

java - Class instantiation - Abstract class or concrete class for variable -

my question today not problem-solving question, best-practice theory question. getting familiarized joda-time, , read in user guide ( http://joda-time.sourceforge.net/userguide.html#interface_usage ): when working collections interface, such list or map hold variable type of list or map, referencing concrete class when create object. list list = new arraylist(); map map = new hashmap(); this struck me quite odd statement. in programming, i've held concrete class variables unless i'm programming api of sort. have helpful material explain reasons why preferential hold general/abstract class vs concrete class variable type? to illustrate, wrote simple method use whenever need list of objects string separated commas: public static <t> string csv(collection<t> list) { boolean first = true; stringbuilder sb = new stringbuilder(); for(object e : list) { if(first) first = false; else sb.append(", ...

testing - How Can I Check View Code Coverage with CakePHP Tests? -

when testing controllers, can legitimately achieve 100% code coverage, shown here: example of correct report of 100% code coverage controller code <?php app::uses('appcontroller', 'controller'); class userscontroller extends appcontroller { public function example($option = null) { if ($option == 'foo') { $some_var = 'hello'; } elseif ($option == 'bar') { $some_var = 'goodbye'; } $this->set(compact('option', 'some_var')); } } test code <?php app::uses('userscontroller', 'controller'); class userscontrollertest extends controllertestcase { public function testexamplefoo() { $this->testaction('/users/example/foo'); $this->assertequals('hello', $this->vars['some_var']); } public function testexamplebar() { $this->testaction('/users/example/bar...

error handling - PHP: How to first log an exception and then report by mail? -

i handcrafted complex order process go online soon. first time, want informed errors occur, want them logged. answer suggests first log them , mail them more secure since mailing might fail. when catch exception, it's not being logged, , when don't catch it, can't send email. my code: // convert errors exceptions function exception_error_handler($errno, $errstr, $errfile, $errline ) { throw new errorexception($errstr, 0, $errno, $errfile, $errline); } set_error_handler("exception_error_handler"); try { // ... code might cause errors or throw exceptions } catch(exception $e) { log(...); // how can make error being logged here? mail(...); // afterwards send email throw $e; // re-throw way, after mailing it, cause kills process. } sure, write 1 logging routine, guess php in clever way i'd use. another thing great having control makes sure no more x error emails per hour sent out. all in seems pretty common setup, couldn't f...

ios - MPMoviePlayerController audio not playing on device but plays on simulator -

i have mpmovieplayercontroller in ios app streams video amazon s3. video plays fine, seems on device (i tested ios 6, not sure others), audio doesn't play. audio works fine on emulator, not on device. anyone have ideas what's wrong? here's code: // construct video's url nsurl *url = [nsurl urlwithstring:[nsstring stringwithformat:@"http://s3.amazonaws.com/<mybucket>/%d.m4v",videofilenumber]]; vidplayer = [[mpmovieplayercontroller alloc] initwithcontenturl: url]; // set video player [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(movieplaybackdidfinish:) name:mpmovieplayerplaybackdidfinishnotification object:vidplayer]; vidplayer.scalingmode = mpmoviescalingmodeaspectfill; vidplayer.controlstyle = mpmoviecontrolstyledefault; vidplayer.shouldautoplay = yes; [self.view addsubview:vidplayer.vie...

hibernate - How to do a simple table join in Grails -

i'm kind of new grails , i'm having lot of trouble joining 2 existing tables through domain objects have been created off of tables. know how in grails? here tables , example of how need joined table look. in advance help. table1{ field1table1 } table2{ field1table2 field2table2 } i need join these 2 tables field1table1 = field1table2 , resulting table join need this: joinedtable{ field1table1 field2table2 } if domains not have relationship (hasone, hasmany, etc) can use executequery execute hql queries : table1.executequery("select * table1 t1,table2 t2 t1.field1table1 = t2.field2table2") look @ doc hope helps

r - Perform numerical operation in subset of IDs and return the results in the same data frame -

i have large dataset consisting of longitudinal measurements in various subjects (ids) , variables lets say: test.df <- data.frame(id=c(rep("a", 50),rep("b", 50)), x1=rnorm(100), x2=rnorm(100)) i want perform numerical operation on records of each id , return results in same dataset. right doing is: test.df <- data.frame(id=c(rep("a", 50),rep("b", 50)), x1=rnorm(50), x2=rnorm(50)) test.df$mean.of.x1<-na test.df$mean.of.x2<-na for(i in unique(test.df$id)){ test.df$mean.of.x1[test.df$id==i]<-mean(test.df$x1[test.df$id==i]) test.df$mean.of.x2[test.df$id==i]<-mean(test.df$x2[test.df$id==i]) } the example simplistic (and perhaps silly), shows need (in original problem there several function run each id not mean ). there more efficient way this? can *apply function help? transform(test.df, mean.of.x1 = ave(x1, id, fun=mean), mean.of.x2 = ave(x2, id, fun=mean))

scroll - System preference Scrollbar Show Always on OSx -

i have website , want hide scrollbars did css , if in osx computer , have in preference show scrollbars see them there way can hide them?? know within computer preference of showing it.. need hide scrollbars there way can jquery or php or css? try create 2 divs: 1 overflow:hidden , inner 1 position:absolute. , scrolling via js/jquery. did such thing 5 years ago when implementing custom scroll bars.

java - Application only works in Eclipse -

i'm doing college project using java , eclipse. app works in eclipse, when export runnable java file doesn't work. no error shown, , nothing opened. do have tutorial how export correctly? application long post here. however, if need see part of code ask. edit : error returned console exception in thread "main" java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ org.eclipse.jdt.internal.jarinjarloader.jarrsrcloader.main(jarrsrcloa der.java:58) caused by: java.lang.classcastexception: sun.net.www.protocol.jar.jarurlconnecti on$jarurlinputstream cannot cast java.io.bufferedinputstream here 1 article on jar creation , execution http://javarevisited.blogspot.in/2012/03/how-to-create-an...

java - Collections.unmodifiableList wraps already unmodifiable list? -

in collections.unmodifiablelist implementation see wraps given list unmodifiablelist if given list unmodifiablelist... if i'm calling method on , on - huge stack trace, this: @ java.util.collections$unmodifiablecollection.size(collections.java:998) @ java.util.collections$unmodifiablecollection.size(collections.java:998) @ java.util.collections$unmodifiablecollection.size(collections.java:998) @ java.util.collections$unmodifiablecollection.size(collections.java:998) @ java.util.collections$unmodifiablecollection.size(collections.java:998) @ java.util.collections$unmodifiablecollection.size(collections.java:998) @ java.util.collections$unmodifiablecollection.size(collections.java:998) @ java.util.collections$unmodifiablecollection.size(collections.java:998) @ java.util.collections$unmodifiablecollection.size(collections.java:998) @ java.util.collections$unmodifiablecollection.size(collections.java:998) @ java.util.collections$unmodifia...

matlab - ??? Undefined function or method 'det' for input arguments of type 'double' and attributes 'full 3d real -

for j=1:length(idf) dx = xf(1,j)- xv(1); dy = xf(2,j)- xv(2); d2 = dx^2 + dy^2; d = sqrt(d2); z_est(:,j) = [d;atan2(dy,dx)-xv(3)]; s(:,:,j) = hf(:,:,j) * pf(:,:,j) * hf(:,:,j)' + r end v = zf - z_est; %innovation v(2,:) = pi_to_pi(v(2,:)); w= 1; n = 1:size(zf,2) den = 2*pi*sqrt(det(s)); neu = exp(-0.5 * v(:,n)' * inv(s) * v(:,n)); w = w*(neu/den); end my program on computing weight of state particles according particle filtering,at start runs , calculate w,bt after sometime shows error ??? undefined function or method 'det' input arguments of type 'double' , attributes 'full 3d real'' . cant figure out problem. you need give det square matrix not 3d 1 ( s 3d array). assume meant write instead: den = 2*pi*sqrt(det(s(:,:,n)); so @ given loop iteration det of slice of s being calculated.

Should the 'equals' (Object) method be overridden when overriding hashCode() in Java? -

this question has answer here: what issues should considered when overriding equals , hashcode in java? 11 answers should equals (object) method overridden when overriding hashcode() in java? i have read contract overriding equals , should override hashcode . vice versa true? i thinking of scenario don't compare objects, no equals method. yes, should overridden. if think need override hashcode() , need override equals() , vice versa. general contract of hashcode() is: whenever invoked on same object more once during execution of java application, hashcode method must consistently return same integer, provided no information used in equals comparisons on object modified. integer need not remain consistent 1 execution of application execution of same application. if 2 objects equal according equals(object) method, calling hashcode method on each...

mysql - How to get column names of a schema in sqlsoup in python? -

how column names , types in dictionary schema/table using sqlsoup in python? mysqldb can create cursor , use cursor.description. there equivalent sqlsoup? according documentation : a table object can instructed load information corresponding database schema object existing within database. process called reflection. in simple case need specify table name, metadata object, , autoload=true flag. if metadata not persistently bound, add autoload_with argument: >>> messages = table('messages', meta, autoload=true, autoload_with=engine) >>> [c.name c in messages.columns] ['message_id', 'message_name', 'date']

debugging - How Can I turn off this tab toggle in Visual Studio 2010 -

Image
i using ms productivity power tools extension , have tabs aligned vertically. pin files working more frequently, @ top. however, when debug solution there toggle arrow section appears. if not toggle arrow of files not pinned inaccessible , vs behaves sporadic. guessing must have hit key combination turned on. not have issue in of solutions. does know how turn off, google had not yielded useful info far.

python - Parsing configuration file using pyparsing -

i trying use pyparsing parse configuration file of following form x = "/user/test" y = 3 here code snippet parserelement.defaultwhitespacechars = (" \t") end = stringend() nl = lineend().suppress() assignment = literal('=') key_str = charsnotin("=") value_str = group(~assignment + restofline) line = group(key_str + assignment + value_str) lines = zeroormore(line) lines.ignore(nl) text = """ y = 3 x = 2 """ the output parsefile tells me parsing first line only. can please me find out doing wrong? it looks on right track. maybe doing wrong when acutally pass text grammar. adding following line in code print lines.parsestring(text) gives expected output [['y ', '=', [' 3']], ['x ', '=', [' 2']]] as aside, don't want keep whitespace when parsing. tokens thing matters. how parse example: eol = lineend().suppress() eq = literal("=...

c# - Why my method is not updating -

i have 3 tables. have main table called employeemaintable fieldname data type * eid text firsname text surname text second table called employeejobdetailstable fieldname data type * ejobid text eid text jobdescrip text third table called employeeappraisaldetails fieldname datatype eapprid text ejobid text goalsachieved memo relationship employeemaintable can have many employeejobdetailstable , employeejobdetailstable can have many employeeappraisaldetails. i can create, update , delete records employeemaintable i can create, update , delete records employeejobdetailstable i can insert , delete records employeeappraisaldetails unable update. here update method... eappr class public static void aupdate(string goals, string eapprid) { var con = getconnection(); oledbcommand cmd = new oledbcommand(); cmd.commandtype = commandtype.t...