Posts

Showing posts from April, 2014

command - How can I run outstanding migrations in laravel4? -

this problem. i have migration 2013_08_25_220444_create_modules_table.php within path : app/modules/user/migrations/ i have created custom artisan command: <?php use illuminate\console\command; use symfony\component\console\input\inputoption; use symfony\component\console\input\inputargument; class usersmodulecommand extends command { /** * console command name. * * @var string */ protected $name = 'users:install'; /** * console command description. * * @var string */ protected $description = 'instala el modulo de usuarios.'; /** * create new command instance. * * @return void */ public function __construct() { parent::__construct(); } /** * execute console command. * * @return void */ public function fire() { echo 'instalando migraciones de usuario...'.php_eol; $this->call('migrate', array('--path' => app_path() . '/modules/user/migrations')); echo 'done.'.php_eol; }...

Error: no receivers for action com.google.android.c2dm.intent.registration -

i using following code in manifest <receiver android:name="com.google.android.gcm.gcmbroadcastreceiver" android:permission="com.google.android.c2dm.permission.send" > <intent-filter> <action android:name="com.google.android.c2dm.intent.receive" /> <action android:name="com.google.android.c2dm.intent.registration" /> <category android:name="com.moosejawford.activities" /> </intent-filter> </receiver> <service android:name=".gcmintentservice" /> it worked before, today getting error, did google changed anything. please me in solving issue. have not found correct answers in google.i likes know why happening this. error report: 08-26 11:30:18.031: e/androidruntime(32283): @ android.app.activitythread.performlaunchactivity(activitythread.java:2180) 08-26 11:30:18.031: e/androidruntime(32283): @ android.app.ac...

jquery - Validation for select box -

i doing form validation using jquery. not getting how validate select list menu. could please me out this. here code , fiddle $.validator.setdefaults({ submithandler: function() { alert("submitted!"); } }); $().ready(function() { // validate comment form when submitted $("#commentform").validate(); // validate signup form on keyup , submit $("#signupform").validate({ rules: { firstname: "required", lastname: "required", email: { required: true, email: true }, topic: { required: "#newsletter:checked", minlength: 2 }, agree: "required" }, messages: { firstname: "please enter firstname", lastname: "please enter lastname", username: { requ...

java - ON/OFF flip button in Swing -

i wish create button same this (from ios5) . in swing, there jtogglebutton can have 2 status. however, if want button of same shape , same visual effect, should implement it.

Why do I get [...] when I append a list to the same list in python? -

the following code tried in python 2.7.1 interpreter. >>> = [1, 2, 3] >>> a.append(a) >>> [1, 2, 3, [...]] >>> == a[-1] true >>> print a[-1] [1, 2, 3, [...]] can please explain python trying here? you have created infinite nested list inside list. can not represented, [...] appears. take @ happens if try print each value: >>> item in a: ... print item ... 1 2 3 [1, 2, 3, [...]] # whole list iterated on :) refer here further reading.

ios - Jump to View Controller after Login using Facebook SDK -

- (void)viewdidload { delegate = (appdelegate*)[[uiapplication sharedapplication]delegate]; birthdaylist=[[birthdaylist alloc]initwithnibname:@"birthdaylist" bundle:nil]; spinner=[[uiactivityindicatorview alloc]initwithactivityindicatorstyle:uiactivityindicatorviewstylegray]; spinner.alpha=1.0; spinner.center=cgpointmake(130, 150); [spinner sethidden:yes]; uibutton *pickfriendsbutton=[[uibutton alloc]init]; [pickfriendsbutton setframe:(cgrectmake(100, 200, 150, 33))]; [pickfriendsbutton setbackgroundimage:[uiimage imagenamed:@"share_bg.png"] forstate:uicontrolstatenormal]; [pickfriendsbutton settitle:@"pick friends" forstate:uicontrolstatenormal]; [pickfriendsbutton settitlecolor:[uicolor whitecolor] forstate:uicontrolstatenormal]; [pickfriendsbutton.titlelabel setfont:[uifont fontwithname:@"politica" size:15]]; [pickfriendsbutton addtarget:self action:@selector(pickfriends:) forcontro...

ubuntu 12.04 - Vagrant Apache2 http/https port forwarding -

i using vagrant manage ubuntu instance testing web application. having trouble setting login page on https. application using apache2+php5+mysql. have setup port forwarding sth access application host machine . config.vm.network :forwarded_port, guest: 80, host: 8080 when try access guest using http://localhost:8080 , redirect https://localhost:8080 seams reasonable ,but 8080 port forwarded http:80 guest port not https:43. url https://localhost:8080 half true half lie . don't know how forward https port guest https port wonder happen of https://localhost:8080 redirect since not valid url should ( think ) sth https://localhost:4343 , if https:4343 forwarded guest:43. application not aware of ports , changes http https (forgive me gibberish ) how setup vagrant network setting access guest apache http:80 , https:43 ports. can assigned static ip guest instance , use pleasantly . regards using: vagrant version 1.1.5 ubuntu precise64.box for use cas...

velocity - Loop through a list of Tags and compare xWiki -

i have xwiki project tag system implemented. trying solve this problem. when click on tag correct output want sort documents according other tags, means need way search multiple tags. have done list of documents tagged first tag use #foreach through each document tags need show. #set ($tag = "$!{request.get('tag')}") #set ($list = $xwiki.tag.getdocumentswithtag($tag)) #foreach($doc in $list) #set ($tags = $xwiki.tag.gettagsfromdocuments($doc)) #foreach($tg in $tags) #if($tg == 'tutorial') {{html}} #displaydocumentlist($doc false $blacklistedspaces){{/html}} #end #end #end the above code looks documents tagged $tag , tutorial . not efficient not looking efficiency @ point of time, need work , above code not , have no idea why. edit:::: i tried different solution. time $list , $list2 $list documents first tag , $list2 docs second tag. compare each document's full name 1 list every document's full ...

ruby - Regex to get ID from link URL -

i have links this: <div class="zg_title"> <a href="http://rads.stackoverflow.com/amzn/click/b000o3gcfu">thermos foogo leak-proof stainless st...</a> </div> and i'm scraping them this: product_asin = product.xpath('//div[@class="zg_title"]/a/@href').first.value the problem takes whole url , want id: b000o3gcfu i think need this: product_asin = product.xpath('//div[@class="zg_title"]/a/@href').first.value[regex_here] what's simplest regex can use in case? edit: strange link url doesn't appear complete: http://www.amazon.com/thermos-foogo-leak-proof-stainless-10-ounce/dp/b000o3gcfu/ref=zg_bs_baby-products_1 use /\w+$/ : p doc.xpath('//div[@class="zg_title"]/a/@href').first.value[/\w+$/] /\w+$/ matches trailing alphabets, digits, _ . require 'nokogiri' s = <<eof <div class="zg_title"> <a href=...

Ipython option not visible in spyder -

i installed macports versions of spyder , ipython onto macbook pro running osx 10.8. there not seem way open ipython console version of spyder. is, there no mention of ipython in interpreters menu, nor in preferences. has come across problem , might know how fix it? many thanks. adrian ( spyder dev here ) according this page latest stable ipython version in macports 1.0, unsupported spyder 2.2.3 (our latest stable release). we working right make compatible our next release (i.e. 2.2.4), available in 2 weeks.

c# - Change EF entity with descendant proxy class -

i have .net 4.0 application use entityframework 5.0 access data ms sql database. i use database first approach. tableas mapped poco entities, has additional properties contains entities recieved web service. database: wh_product (id, nomenklatureid, seriesid, quantity) service have such data: nomenklature (id, name, producer...) series (id, number, date...) poco entity: product (id, nomenklatureid, nomenklature, seriesid, series, quantity) i have problem repository realisation. need implement lazy loading nomenklature , series properties. i make productproxy class implements such loading this: public class productproxy:product { private nomenklature _nomenklature; public override nomenklature nomenklature { { if (_nomenklature==null) { _nomenklature = <code load nomenklature webservice base.nomenklatureid> } return _nomenklature; } } private series _series; public overrid...

.net - How to remove project external dependecy on project build -

to debug , analyze performance in our project use rhino entity profiler. requires add rhino profiler dll project reference. as need feature in debug nice completly remove reference on publishing. it great if there like: #if debug <some dll reference /> #endif is there relativly simple solution achive this? if not use code, can safely remove dependency release build.

jquery - how to move vertical scroll bar on clicking an element to display the content correctly? -

i have multiple sections(sec1, sec2, sec3, ..) on page. page opened clicking navigation tab (which further have sub-tabs sec1, sec2, sec3,.. ). when click on sub-tab, want vertical scroll bar move display corresponding section page. in advance. an id can used create anchor start of element. can use href attribute of a tags in navigation tab link these anchors. here jsbin understand better: http://jsbin.com/ogewifu/1 . css visualize sections better. source: http://www.w3.org/tr/html401/struct/links.html#h-12.2.3

scikit learn - Why is pydot unable to find GraphViz's executables in Windows 8? -

i have graphviz 2.32 installed in windows 8 , have added c:\program files (x86)\graphviz2.32\bin system path variable. still pydot unable find executables. traceback (most recent call last): file "<pyshell#26>", line 1, in <module> graph.write_png('example1_graph.png') file "build\bdist.win32\egg\pydot.py", line 1809, in <lambda> lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog)) file "build\bdist.win32\egg\pydot.py", line 1911, in write dot_fd.write(self.create(prog, format)) file "build\bdist.win32\egg\pydot.py", line 1953, in create 'graphviz\'s executables not found' ) invocationexception: graphviz's executables not found i found https://code.google.com/p/pydot/issues/detail?id=65 unable problem solved. on mac brew install graphviz solved problem me.

security - How can I know my website contains Malicious code -

recently our website got hacked people , reporting below when try open our website reported attack page! this web page @ www.example.com has been reported attack page , has been blocked based on security preferences. attack pages try install programs steal private information, use computer attack others, or damage system.some attack pages intentionally distribute harmful software, many compromised without knowledge or permission of owners. at last came know there malicious code reporting in way... how can know code i say, first, scan own pc ensure infection did not originate there. download site safe location(you may need disable antivirus software while purpose). have backup of original site before infection(or webhosting partner). make compare against infected content , should see difference. if not have backup, scan infected scripts antivirus software determine specific files, need browse through code in these files , scan malicious code manually. worms/trojan...

mysql - List changes of options by week -

we have database table lists option changes way: date | option | value 01/07/08 | optiona | value_a 01/07/08 | optionb | value_b 02/07/08 | optiona | value_a2 we assume before first date has option (primary key date , option) there's no option set. have make every day, each option overrides previous changes afterwards, not backwards. i know how can join table can get, each week, full set of values latest values per option. following: date | option | value 01/07/08 | optiona | value_a 01/07/08 | optionb | value_b 02/07/08 | optiona | value_a2 02/07/08 | optionb | value_b hoping got question right create table test.stack ( date date , option_field varchar(50) , value int(5) ) truncate table test.stack; replace test.stack values ('08/07/01', 'optiona', 5) , ('08/07/01', 'optionb...

c# - Serialization by DataContract -

what attributes must used next class (and/or class members): [datacontract(namespace = "classnamespace")] public class testclass { [datamember(name = "fieldname1")] public string field1; [datamember(name = "fieldname2")] public string field2; [datamember(name = "fieldname3")] public enumtype filed3; } what class serialize next xml: <testclass xmlns:a="classnamespace" xmlns:i="http://www.w3.org/2001/xmlschema-instance" fieldname1="fieldvalue1" fieldname2="filedvalue2" fieldname3="fieldvalue3" /> but not to: <testclass xmlns:a="classnamespace" xmlns:i="http://www.w3.org/2001/xmlschema-instance"><a:fieldname1>fieldvalue1</a:fieldname1><a:fieldname2>fieldvalue2</a:fieldname2><a:fieldname3>fieldvalue3</a:fieldname3></testclass>

ios - Connecting a UIButton to an IBOutlet and IBAction in code -

i have viewdidload: // set register button uibutton *registerbutton = [uibutton buttonwithtype:uibuttontypesystem]; [registerbutton settitle:@"register" forstate:uicontrolstatenormal]; registerbutton.frame = cgrectmake(0.0, 0.0, self.screenwidth / 2.0, 100.0); and this: - (ibaction)buttonpressed:(uibutton *)sender { } i have in .h file: @property (nonatomic, weak) iboutlet uibutton *registerbutton; how connect iboutlets , ibactions buttons create in code? you have set target button this: [registerbutton addtarget:self action:@selector(buttonpressed:) forcontrolevents:uicontroleventtouchupinside];

jquery - How to select img src attribute inside a div? -

what selector need use src value of picture? <div class="rg-image"> <img src="/zenphoto/cache/test2/6244146_460s_595_watermark.jpg"> </div> there might better ways this, without seeing more of markup, recommend using this: var img_src = $( '.rg-image > img' ).attr( 'src' ); this selector match <img> tags within first level of element containing .rc-image class. note: assumes there 1 <img> element contained within 1 .rg-image element. won't able retrieve multiple src attributes in way selector match many elements. you'll need loop on matches , each 1 extract src attribute.

jquery - Primefaces File upload, Drop file outside of p:fileUpload anywhere in the page -

in primefaces file upload, fileupload component drop zone. want create multiple dropzones, example if user drops files on other div or table primefaces file upload component should pick that. i tried trigger drop event manually primefaces upload component not working. please me this. in advance! here tried, $('.otherdropzone').on( 'dragover', function(e) { e.preventdefault(); } ); $('.otherdropzone').on( 'dragenter', function(e) { e.preventdefault(); } ); $(".otherdropzone").on('drop', function(e){ e.preventdefault(); $(".fileupload-content").trigger('drop',e); // primefaces dropzone cssclass }); similar other things changing arguments trigger , drop zone class of primefaces such .files , .ui-fileupload the trick primefaces have developed fileupload functionality based on below plugin.so, started there , got working in primefaces https://github.com/blueimp/jquery-file-upload/w...

java - Pop out two frames side by side -

i want when pressed button on jframe setvisible false existing frame , create 2 other frames.the theme want these 2 frames popped side side not 1 on top of other, clue how can make happen. jframe1.setbounds(x, y, width, height); jframe2.setbounds(x+jframe1.getwidth(), y, width2, height2); width , width2 can same if want, can height height2

is there anyway to release the memory of hardware acceleration,after exit android app. -

Image
after quit app long time,i find "other dev" still costs lot of memory,about 16m. at same time,there lot of "/dev/pvrsrvkm" in /proc/xxx/smaps. all activitys have destroyed,why "/dev/pvrsrvkm" still use memory? how reduce it? in android have seen when close application not close completely, remains in recent application stack, can see long press home button(on devices). android kicked out recent apps when other app needs memory or can force close it.

javascript - Make the previous line of the text shorter than the next -

is there way make previous line of text shorter next if text’s length unknown? somethig this: lorem ipsum dolor sit amet, consectetur adipiscing et libero posuere pellentesque. vivamus quis nulla justo. vel lacinia sapien scelerisque eget. vivamus ut velit elit. donec there paragraph in html. i have tried text-indent or :first-line or playing around padding , width of paragraph none of them working (as expected think...). have tried somehow calculate width of line using calculating text width no result (i'm not in jquery...). i can’t add markup on html (well, not directly, can add scripts if necessary). preferably css can add jquery too. please help. yes, can use selector p , attribute section of there sentence want paragraph end , use line-height adjust leading instance http://jsfiddle.net/ammyr/4/ p { font:14px nor futura, sans-serif; line-height:20px; color:#333; } <p>this first sentence. <br>this ver...

iphone - Change size of MaskedLayer over UIView -

Image
i have 2 uiimageviews occupy whole screen meaning frames : (0,0,320,480) . imageview2 on top of imageview1 . they both have masks applied them using cashapelayer . have made function -(void)addmask:(cgrect)rect toview:(uiimageview*)imageview which follows //function -(void)addmask:(cgrect)rect toview:(uiimageview*)imageview { cashapelayer * shapelayer = [[cashapelayer alloc] init]; cgpathref path = cgpathcreatewithrect(rect, null); shapelayer.path = path; cgpathrelease(path); imageview.layer.mask=shapelayer; imageview.layer.maskstobounds=yes; } i applying masks on uiimageviews in viewdidappear using following cgrects : //in view did appear [self addmask:cgrectmake(0,0,160,480) toview:self.imageview]; [self addmask:cgrectmake(160,0,160,480) toview:self.imageview2]; so result screen half split showing half imageview1 on left side , half imageview2 on right side. i have button hooked ibaction(buttonpressed:) . what want achieve when button pressed mask of ...

Get sum of mysql fields and passing sum to view in codeigniter -

i not able display sum of mysql fields in view. sum-field named urls. instead of displaying sum of urls specific user receive string named 'array'. believe passing problem rather query 1 don't it. thank help. model (users_model): public function get_sum($id){ $this->db->select_sum('urls') ->where('user_id', $id); $query = $this->db->get('user_earnings'); return $query->result(); } controller (users): public function userarea() { $id = $this->session->userdata('id'); $data['sum'] = $this->users_model->get_sum($id); $data['main_content'] = 'userarea_view'; $this->load->view('layout', $data); } view (userarea_view): <li>total urls collected: <br><strong><?php echo $sum; ?></strong></li> try like <?php echo $sum[0]->urls; ?> since returned object .

c# - Entity Framework Code Migrations: Exception has been thrown by the target of an invocation -

i'm using code first entity framework 5 in mvc project. today making changes domain model , updated rest of application work these new changes. naturally, when changes domain model made, you'll need update database. we're using code migrations (manual migration, is). when tried add new migration through package console, i'm getting following exception: exception has been thrown target of invocation. i've tried adding startup project command, didn't work either. of projects build no compiler errors either. edit: also, happens no matter do: update-database or update-database target migration. seem give me same exception. this callstack: pm> add-migration mymigrationname system.reflection.targetinvocationexception: exception has been thrown target of invocation. ---> system.data.entity.migrations.infrastructure.automaticmigrationsdisabledexception: unable update database match current model because there pending changes , automatic migration...

regex - Match a string with regexp -

Image
i having string like -------- agg x y port-16385-info ----------------------------+ i want extract "agg x y port-16385-info ". pattern in not same. can have number of spaces inbetween . help me regexp string. i using regexp regexp {\s+(.*)\-\-*} $a - ouput agg port-16385-info --------------------------- this not want. me regexp. well, i'll assume delimiter @ least 2 - long , seperated via space contents. trivial regex like --\s+(.*?)\s+-- would work. *? quantifier non-greedy matching, terminate possible. if regex works depends on allowed values , exact format of input, have not sufficiently explained. i suprised tagged perl — quite sure code isn't valid perl code. if not want use . character class, can rewrite match non-hyphen characters or single hyphen followed non-hyphen: --\s+((?:[^-]+|-[^-])*)\s+-- you might want disallows newlines along hyphens well.

javascript - How to Collapse the first accordion when the last one is completed? -

i'm using twitter boostrap first time & using collapsible accordion. i wants trigger first accordion open when last 1 completed. working in forward directions. control not working fine me when looking in backward direction. can please on this? just use jquery cookie , make modification accordion script $(document).ready(function() { var last=$.cookie('activeaccordiongroup'); if (last!=null) { //remove default collapse settings $("#accordion2 .collapse").removeclass('in'); //show last visible group $("#"+last).collapse("show"); } }); //when group shown, save active accordion group $("#accordion2").bind('shown', function() { var active=$("#accordion2 .in").attr('id'); $.cookie('activeaccordiongroup', active) });

c++ - Creating autoscroll feature in QGraphicsView -

i have qgraphicsview , qgraphicsscene . depending on user input qgraphicsitem may placed on scene. item both selectable , movable. when scene larger view scrollbars appear (they set show when necessary). when item moved user near edge of view scene width/height stretched accordingly - making scene bigger. the question how force scrollbars scroll scene when item near border of view? feature think common in graphic editor. in mousemoveevent of scene making scene bigger, force sliders move , update visible rectangle accordingly. this not work intended. thought scrolls adjusting new scene size there no smooth movement in view. there better way in doing this? some explanations: itemundercursor = slected qgraphicsitem qgv = qgraphicsview code snippet: // check if item near border qpointf point = itemundercursor->maptoscene(itemundercursor->boundingrect().topleft()); double delta = 0; if(point.x() < visiblerect.left()) { //...

c# - Finding a domain name ending with worldpay.com or rbsworldpay.com from Dns.GetHostEntry -

can 1 please me find domain name ending worldpay.com or rbsworldpay.com iphostentry entry = dns.gethostentry(givenip); var hostname = entry.hostname.tolower(); now want make sure hostname ends worldpay.com or rbsworldpay.com , things else want throw exception. can 1 please help. even regular expression check should do? thanks try code: if(hostname.endswith("worldpay.com")||hostname.endswith("rbsworldpay.com") { throw new exception("wrong host"); } it throw new exception when hostname ends worldpay.com or rbsworldpay.com

php - cakePHP afterFind() Warning (2) -

i have problem in application problem in afterfind() function, here's code: public function afterfind($results, $primary = false){ app::uses('cakesession', 'model/datasource'); $deplacement_id = cakesession::read('id-deplacement'); foreach($results $k=>$valeur){ $results[$k][$this->alias]['checked']='false'; foreach($valeur['realisation'] $v=> $val){ if($val['deplacement_id'] == $deplacement_id){ $results[$k][$this->alias]['checked'] = 'true'; } } } return $results; } the code works fine if test $results variable debug() in model shows me want have problem comes view error: warning (2): invalid argument supplied foreach() [app\model\pointerne.php, line 46] notice (8): undefined index: realisation [app\model\pointerne.php, line 46] i deleted error if may debug() in core file 0 can not use debug function ...

jquery - selector exclusive css in particular situation -

i using : $(".header.nav.nav-user").click(function(){}); but when change css " .header .nav .disable .nav-user ", not want trigger click event. but in situation, $(".header.nav.nav-user") getting triggered when css changed ".header .nav .disable .nav-user" . how can exclude situation? i have tried : $(".header.nav.nav-user :not(.disable)") and $(".header.nav.nav-user").not(".disable"), but both times failed desired result. please tell me ways this. appreciate help! thanks. update : situation is:(i want trigger click event) <div class="header"> <div class="nav"> <dt class="nav-user"> </dt> </div> </div> and is:(i don't want trigger click event) <div class="header"> <div class="nav"> <dl class="disable"> <dt class="nav-user"...

iphone - on scrolling the buttons changes its image in uitableviewcell -

can please tell me how can make buttons in uitableview custom cell different images , action.i have tried this. adding button image , action according values in dictionary,it works first time after scrolling ,the button images changes. - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath{ { static nsstring *cellidentifier = @"mediapickercustomcell"; mediapickercustomcell *customcell = (mediapickercustomcell *)[tableview dequeuereusablecellwithidentifier:cellidentifier forindexpath:indexpath]; if(customcell == nil){ } [customcell._titlelabel setlinebreakmode:uilinebreakmodewordwrap]; [customcell._titlelabel setminimumfontsize:font_size]; [customcell._titlelabel setnumberoflines:0]; [customcell._titlelabel setfont:[uifont systemfontofsize:font_size]]; [customcell._titlelabel settag:1]; nsstring *text = [eventsarray objectatindex:[indexpath row]]; cgsize constraint = ...

javascript - HTML5 Canvas multi-line textboxes -

okay, so, essentially, i'm getting user input <input> tag , shoving canvas. , 1 line, there cases need whole paragraphs of text. aware, not every letter of same width, means can't have multiple <input> tags maxlength attribute. it's jarring have multiple input tags. long story short: there way put paragraph textboxes html5 canvas element? why can't go ahead , use textarea multiline handling? <textarea name="mytextarea" cols="30" rows="5" />

android - Action Bar Sherlock - Odd menu behaviour when hardware menu button is present -

i seeing strange behaviour abs whenever hardware menu present on device. menu items aught on actionbar not appear. pressing menu button open overflow , items expect there appear. the app in question consists of main sherlockfragmentactivity, swaps out various sherlockfragments. of fragments contain fragmentstatepagers host many other sherlockfragments. it's fragments appear in pagers exhibit problem. i create menus in usual manner mainactivity.java @override public boolean oncreateoptionsmenu(menu menu) { menuinflater inflater = getsupportmenuinflater(); inflater.inflate(r.menu.activity_main, menu); return super.oncreateoptionsmenu(menu); } fragment1.java @override public void oncreateoptionsmenu(menu menu, menuinflater inflater) { super.oncreateoptionsmenu(menu, inflater); inflater.inflate(r.menu.menu_fragment_one, menu); } interestingly, whenever navigate away fragment key see missing menu items half second. though on previous fragment. ...

excel - How to preserve a formula's reference to a worksheet when the worksheet is deleted and replaced using C#? -

how keep formulas working after replacing sheet? mean how preserve formula's reference worksheet when worksheet deleted , replaced? in c# using excel = microsoft.office.interop.excel; excel.application excelapp = new excel.applicationclass(); excel.workbook excelworkbook = excelapp.workbooks.open(connection.datasource, 0, false, 5, "", "", false, excel.xlplatform.xlwindows, "", true, false, 0, true, false, false); foreach (excel.worksheet sh in excelworkbook.sheets) { if (sh.name == sheetname || sh.name == "_"+sheetname) { sh.application.displayalerts = false; sh.delete(); } } excelworkbook.save(); excelworkbook.close(true, excelworkbook.fullname, null); excelapp.quit(); later i'm invoking sql command "create table" same name. formulas not working what have is, in sheet contains formulas, firstly convert them away formulas (this stop ex...

ruby on rails 3.2 - Rails3 installing Jquery plugins disables javascript altogether -

i'm running rails 3.2.13 rvm. each time want install new jquery plugin (i tried tablesorter http://tablesorter.com/ ) javascript frozen, , other plugins used work (miraculously, ends doing so, magic...) disabled , when uninstall last culprit , elements, still don't work anymore, sending me stone-age each-time... here application.js: //= require jquery //= require jquery_ujs //= require jquery-ui //= require_tree . //= require jquery.ui.datepicker-fr //= require best_in_place i had managed have date_picker , best_in_place work @ same time. have installed , uninstalled tablesorter, neither of them works anymore... it extremely frustrating. after numerous readings, think has either assets pipeline (which makes absolute mess of public/assets folder...) or rvm caching of assets... have in application.rb: config.assets.enabled = true i set because use heroku in production, need assets compiled there. i read many questions , answers rel...

java help printing * and # into a square -

//the question (my code after that) variable n randomly generated integer. output characters '*' , '#' first row contains stars , last 1 number signs. number of stars decreases in each consecutive row. total number of characters in row n , there n + 1 rows. for example, if n has value 5, program output: ***** ****# ***## **### *#### ##### //my code below! random r = new random(); int n = r.nextint(5) + 10; system.out.println("n: "+n); while(n>0){ for(int star = n; star>0; star--){ system.out.print("*"); } for(int hash = 0; hash<n; hash++){ system.out.print("#"); } system.out.println(""); //new line n--; } //my code output - problem: #'s need increase in size 0 rather decrease *'s **********########## *********######### ********######## *******####### ******###### *****##### ****#### ***### **## *# what need do: print ...

wpf - Is there some language ,framework ,or tool for create "dynamically add layout" -

only windows platform. i had idea when write question, i've seen lot of web-based "dynamically add layout",and more beautiful windows app. think web embed windows app idea ,but i'm limited experience,is there give advice me ? thanks. in wpf can use datatemplates , bind lists of classes gives great code work with. 1 of best areas of wpf, when compared win forms huge pain dynamically generated controls. i learnt wpf dynamic layout functionality has, , love it.

javascript - MeteorJS - variable not defined -

i new meteor. created hello world project using meteor. project structure simple @ moment. root folder abc.css abc.html abc.js in abc.js tried declaring variable this: var lists = new meteor.collection("lists"); if (meteor.isclient) { template.hello.greeting = function () { return "my list."; }; template.hello.events({ 'click input' : function () { if (typeof console !== 'undefined') console.log("you pressed button"); } }); } if (meteor.isserver) { meteor.startup(function () { }); } but when run this, getting following error in browser console: [18:17:32.895] referenceerror: lists not defined i not sure doing wrong. in meteor variables scoped file. if define lists var keyword can't access lists outside abc.js to passed remove var just: lists = new meteor.collection("lists"); then can access in other files console.

tomcat - JAVA jar debugging issue -

i trying debug web application hosted on tomcat. have following execution flow structure. public classa { public void execute(classb query) { .... ..... importedobjectfromjar = query.execute(); .... .... } } i using f6 navigate through code down line , code reach line importedobjectfromjar = query.execute(); eclipse asking me add source files of different 3rd party libraries. ( the jar file has no source attachment ). why? don't want go inside jar file, interested in code. ideas how can fix it? i'd keep stepping until came out other side code. should able deal .class files.

c - Meaning of "." in printf -

i reading classic k&r , encountered following syntax: printf("%.*s",max,s); what meaning of "." here?when don't apply "." here,then whole string printed,but when don't apply "." ,atmost max characters printed.i thankful if explain this. in %.*s , .* limits number of bytes written. if written numeral included, such %.34s , numeral limit. when asterisk used, limit taken corresponding argument printf . from c 2011 (n1570) 7.21.6.1 4, describing conversion specifications fprintf et al : an optional precision gives … maximum number of bytes written s conversions. precision takes form of period ( . ) followed either asterisk * (described later) or optional decimal integer; if period specified, precision taken zero.

Mongodb : thread error -

i following error when follow code found in link : mongodb sample referenceerror: scopedthread not defined (shell):1 meaning should 1 of following or else : a) write own wrapper in python or other prog lang b) use scopedthread or other api (thread or threadpool etc) just clarify : problem in mongo shell , not using mongo driver or other api outside of shell. can on ? tia if still actual.. thread api may depend mongo version installed. tried thread in mongo 2.2 , didn't work. in mongodb version 2.4 threads work. think because new engine v8 introduced there.

sonarqube - Sonar does not shows up Code Coverage after build successful with Jenkins Sonar plugin -

i trying code coverage sonar , jenkins. see jenkins' sonar plugin executes junit test cases , completes build successfully. sonar not show code coverage results (always shows 0.0% code coverage) on project. sonar show "unit test success". i using maven jenkins , sonar. i below message in jenkins logs while executing sonar plugin: project coverage set 0% no jacoco execution data has been dumped: .../sonar/target/jacoco.exec can 1 me how correct code coverage on sonar project. just because sonar invoked surefire correctly (and received "unit test success" message) doesn't mean jacoco instrumented code. try executing jacoco directly. might find out why jacoco failing directly: mvn jacoco:prepare-agent test jacoco:report jacoco place jacoco.exec xml/html reports within target/jacoco . or fail, , you'll have better idea why. one common problem jacoco javaagent not run if you've changed surefire argline @ all, because jacoco:...

javascript - How to clear css rules inside specific div for external js embedded content. I mean make it behave as there was no previous css rules present? -

i want embed zumi.pl map on website. map loaded via js div specific id , dependent on external css. css formating div inside div#content interferes embedded map screwing up. tried to enclose in div contextual css reset it's still displays wrong. way make display (almost) uncheck css rules div in firefox inspector can't figure out how achieve same effect on page. clarity sample copy&paste code generator: <div id="zumimap" class="zumi_creator" style="width:300px; height:300px;"></div> <script src="http://api.zumi.pl/maps/api" type="text/javascript" ></script><script type="text/javascript">(function(){var marker,map=new zumi.maps.map("zumimap", {"apikey": "e48ef8e55a0b3beae0434628ae0a1eea"});map.afterload(function() {document.getelementbyid("zumimap").classname += " zumi_creator";map.addmarker({lat: 52.214679,lng: 21.021101},{l...

singleinstance - Android tablet multiple instances of application -

i using android tablet test application. i press home button put application background. now, if i launch application recent apps, open same screen, on, , not restart application. but, if launch application apps, starts new instance of application. time restarts application splash screen, , when check recent apps, shows 2 instances of app. i want 1 instance of application running, on tablet, @ time. please help...

actionscript 3 - DataGrid - sort a column based on its own values, and secondarily based on another columns values? -

Image
i have advanceddatagrid 2 columns: code (strings), , value (numbers). use same sort function each column. want sort both columns based on value column (numeric data), there no number available, want sorting done alphabetically code column. i have simplified problem facing example represent trying do: the picture shows 2 columns, sorting of both columns based on value column. value nan, want code column values sorted alphabetically. one, two, three, 4 remain same, badc abcd. <mx:application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minwidth="955" minheight="600" initialize="initializehandler(event)"> <mx:script> <![cdata[ import mx.collections.arraycollection; import mx.events.flexevent; import mx.utils.objectutil; [bindable] private var ac:arraycollection; protected function initializehand...

How to get all the versions of a bucket in Simperium -

i'm doing simple app @ http://lfschenone.com/ learn how use simperium. i've gone through basics, content synchronizes between browsers. second step show previous versions of content when user clicks "previous" button (similar simplenote). the documentation of no @ all, i've been looking @ source , found methods load_versions , get_version , seem relevant. played them while , got nothing except errors, falsities , empty arrays. pointers? simple code examples appreciated. can find whole code far @ http://lfschenone.com/tabula.js (it's short!). thanks!! you can read http api docs details, can add /v/ end of request object object version: http://simperium.com/docs/reference/http/

javascript - Are there any instances in which hoisting behavior is beneficial -

i came across topic of hoisting while having casual discussion javascript developers, , told hoisting not mistake, error or poorly written functionality powerful tool developers. can explain how javascript hoisting of variables , functions serves powerful concept in javascript or how helpful while writing code? (or) unintended concept accidentally got discovered developers? this favorite article on topic of hoisting , other javascript scope issues/features, , explains better ever hope to: http://www.adequatelygood.com/javascript-scoping-and-hoisting.html edit: i missed asking when hoisting useful , not does. so, you've read article , know does, here's common snippet makes use of hoisting: js file: var myvar = myvar || {}; myvar.foo = function(){}; //etc... you'll see used @ top of many oop javascript files declare object. reason can write way because of hoisting in javascript. without hoisting have write if(typeof myvar != 'undefined...

c# - When formatting floats in DataGridView to a certain decimal, cannot copy full number -

i'm creating windows form application, more or less acting interface sql db our users. want format floats 1 or 2 decimal places when @ form, want have ability copy datagridview out excel full float if desire. for example, if i'm formatting rows percent 1 decimal place i'll use datagridview1.rows[i].defaultcellstyle.format = "p1"; this looks great in form, when copy datagridview clipboard, copies 1 decimal place, if float datatable i'm using source has more decimal places. i'm having trouble figuring out how copy unformatted data clipboard. i've considered making copy button accesses invisible datagridview unformatted, i'd users able ctrl-c visible, formatted datagridview. any ideas? letting me know i'm out of luck help, i'll give on ctrl-c functionality , create separate copy function. thanks. it impossible allow users copy different being displayed (1-decimal values). workaround want might enabling 2 different "...

Setting a broken git branch to a detached head -

after power loss during commit, 1 of branches in git repository got corrupted. did git fsck --full , deleted empty object files until fsck gave me: checking object directories: 100% (256/256), done. checking objects: 100% (894584/894584), done. error: refs/heads/git-annex not point valid object! checking connectivity: 862549, done. i used git fsck --lost-found find last dangling commit on git-annex branch. checked out. i want replacement git-annex head. tried git checkout -b git-annex got branch exists. tried git branch -d git-annex got error: couldn't commit object 'refs/heads/git-annex' . how can rid of broken git-annex branch in order set commit want? have tried removing .git/refs/heads/git-annex doesn't work. thanks. this works me (after "cheating" insert broken branch, , seeing same error when trying delete it): git branch -f broked head # or other valid point git branch -d broked the second command gripes deletes ...

sas - update a table efficiently using proc sql -

i need update table past missing information using past versions of same table. update needed earlier information not available anymore in recent table. let tablea table @ time0 , tableb table @ time1 , on. i'm interested in last updated table. so far have tried method; create view _tableb select * tablea union select * tableb a.id not in (select id tablea); then proceeded with: create view _tablec select * _tableb union select * tablec a.id not in (select id _tableb); and on till reach final table create table. create table _tablet select * _tables union select * tablet a.id not in (select id _tables); do see better here? p.s: have mention each observations can have many languages. information in way id|lguage1|lguage2|lguage3| and put wide2long using view , this method . id1|lguage1 id1|lguage2 id1|lguage3 id2|lguage1 the informations not sorted id , language. thanks. given couple of assumptions, can simplify greatly: 1. each...

iphone - glScissor(0,0,0,0) hard-crashes Apple iOS devices -

according opengl docs, it's legal: http://www.opengl.org/sdk/docs/man/xhtml/glscissor.xml "and glscissor(0,0,0,0) doesn't allow modification of pixels in window." ...but when on ios 6, triggers dreaded "powervr sgx chip crashed": gpus_returnguiltyforhardwarerestart () on ios 5.x, had no crash (updated: discovered when moving 5 6 changed animation counter start @ 0 rather one, it's possible had same crash on ios 5) - whether that's because ios 6 bug, or because ios 6 changes timing of code, can't tell. in ios 5 never submitted 0,0,0,0, instead submitted 0,0,0,1 first call (the scissor being animated frame frame). update: height can zero, powervr crashes if width 0. x, y, (width==0)? 1 : width, height -- never crashes x, y, width, (height==0 ? 1 : height -- crashes whenever width==0 nb: i've checked, asserted, , used logging prove width , height never less 0 (that first thought!) more info, possibly related (...

Running a public static void main in Groovy Eclipse -

sorry groovy noob here: here groovy class - class myclass { static void main() { println("hello world"); } ... how run classin eclipse sts? want keep main method. not want change script. thanks to initiate method, main must pass in string array (string[] something). use following. public static void main(string[] args) { system.out.println("hello world")! }

java - COnstructor Injection with roboguice enters inifinite loop -

hi come background c#/.net , have learned work bit of android.now wana start build small app fun , tought learn ioc framework.after bit of googeling found roboguice.but can not figure out how integrate it.on . net have worked ninject , unity , , looking create similar form of constructor injection got frameworks. here have far , think have figured out: this class represent app bootstrapper , here register dependency config class: public class iocapplication extends application{ @override public void oncreate(){ super.oncreate(); roboguice.setbaseapplicationinjector(this, roboguice.default_stage, roboguice.newdefaultrobomodule(this), new iocmodule()); } } this dependency config class: public class iocmodule implements module{ @override public void configure(com.google.inject.binder binder) { binder.bind(itest.class).to(test.class); } } in androidmanifest have added this: <application ... android:name="com.e...

ruby on rails - Capistrano error when using git -

i trying setup capistrano , want test config locally before testing on server, when run cap deploy -n keep getting following error relating git /users/josh/.rvm/gems/ruby-1.9.3-p448@wgbh/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/scm/git.rb:234:in `block in query_revision': undefined method `sub' nil:nilclass (nomethoderror) and leading follows: * 2013-08-26 12:12:30 executing `deploy' * 2013-08-26 12:12:30 executing `deploy:update' ** transaction: start * 2013-08-26 12:12:30 executing `deploy:update_code' * executing locally: "git ls-remote git@github.com:git_repo git_branch" *** [deploy:update_code] rolling * executing "rm -rf /u/apps/app_name/releases/20130826161230; true" i have tried trace back, can't seem figure out causing it. deploy.rb looks follows: require "bundler/capistrano" set :application, "app_name" set :deply_to, "/the/server/path" set :user, "server_use...