Posts

Showing posts from July, 2013

eclipse - SWTBot doesn't work -

i follow book called eclipse plugin development example: beginner's guide , examples hosted @ github. however, can't run swtbot example. the first time takes long time run, in end pass test cases. when try run same code second time, testui() pass, other 3 have org.eclipse.swtbot.swt.finder.exceptions.widgetnotfoundexception: widget null. somewhere in book said if 1 (shell) not visible, polls (every 500 milliseconds default) until 1 found or default timeout period (5 seconds) ends when widgetnotfoundexception thrown don't see why first time test cases pass not second time. but have not idea why first time work second time won't. i report @ github issue far no 1 response. did interfere desktop while test running? found can (!) cause problems swtbot. also, widgetnotfound exception you'll seeing lot when using framework. might due bugs, unusual underlying ui code. should reproducible in cases, though.

Django MEDIA_URL and MEDIA_ROOT issue with CSS -

i'm having similar problem this question unfortunately none of solutions seem working me. essentially have following, simple directory: ulogin - models.py - tests.py - views.py - media - screen.css - templates - utemplate - index.html in settings.py have following defined: media_root = '../compwebsite/ucode/ulogin/media' media_url = '/media/' and in index.html have following trying reference screen.css <html> <head> <title> yay title </title> <link rel="stylesheet" href="{{ media_url }}screen.css"> <!--and more...--> my urls.py have following: from django.conf.urls import patterns, include, url django.conf import settings django.conf.urls.static import static if settings.debug: # static files (images, css, javascript, etc.) urlpatterns += patterns('', (r'^media/(?p<path>.*)$', 'django.views.static.serve', { ...

html - Ajax GET content from php page -

hi have table trying update call mysql database in separate php page. separate page loops through result set , builds table through series of echos. in main page trying insert echoed content div. this kicked off user selecting option drop down box. this separate php page. (it works fine when manually type in parameters, link between 2 pages doesn't seem work) tablegetter.php <?php $user_name = "rocketeermus_pr"; $password = "zuluhead2"; $database = "rocketeermus_pr"; $server = "pdb1.awardspace.com"; $db_handle = mysql_connect($server, $user_name, $password); $db_found = mysql_select_db($database, $db_handle); echo "bonjour"; if (isset($_get['composer'])){ echo "helloooo"; if ($db_found) { echo "select * catalogue composer = '".mysql_escape_string($_get['composer'])."';"; $sql = "select * catalogue composer = '".mysql_escape_string($...

excel - How to create new row(s) from the value of existing row -

i new site , hoping can me out following problem. learning excel , stata. here problem want figure out using either stata or excel: this how original data like: a1 b1 c1 d1 d2 d3 a2 b2 c2 d1 d2 d4 d5 this how want change above: a1 b1 c1 d1 a1 b1 c1 d2 a1 b1 c1 d3 a2 b2 c2 d1 a2 b2 c2 d2 a2 b2 c2 d4 a2 b2 c2 d5 basically, want create new observations based on d1, d2,.... observations of original data have different number of d's. also, don't know how create new rows of observation @ all!

Qt: cannot find DLLs even if I specify their location -

i cannot understand why qt pro file not work: qt += core qt += gui target = prjname config += qt config += console template = app includepath += c:/qt/4.8.4/include/qt qmake_libdir += c:/qt/4.8.4/bin libs += -lqtcore4 libs += -lqtgui4 sources += ... headers += ... these linker errors: error: cannot find -lqtgui error: cannot find -lqtcore the c:\qt\4.8.4\bin directory exists, , dlls there. thank you. platform: windows 7, mingw, qt 4.8.4, qtcreator 2.8.0

c# - SendKeys to Lightroom 5 is not working properly -

i'm developing little tool shooting review in lightroom of photographic shooting sessions 360 controller. i'm using sendkeys method simulate key input , windowsinputsimulator ( http://inputsimulator.codeplex.com/ ) i got issue shift+arrow shortcut add or remove photo current selection. arrow key working look's shift modifier isn't. i've tried following code : sendkeys.sendwait("+{right}"); inputsimulator.simulatemodifiedkeystroke(virtualkeycode.shift, virtualkeycode.right) inputsimulator.simulatekeydown(virtualkeycode.shift); inputsimulator.simulatekeypress(virtualkeycode.right); inputsimulator.simulatekeyup(virtualkeycode.shift); i've lost few hours on :'( have ideas ?

android - Changing the legend size in AChartEngine -

i change legend size outputting pie chart. i've tried methods can find achartengine, none of them change legend text size. have override ondraw function? if so, how? for setting legend height use: renderer.setlegendheight(height); you can have legend take exact space needs: renderer.setfitlegend(true); to change legend text size: renderer.setlegendtextsize(textsize);

c - Why is fgets() and/or fputs() removing the spaces from my string? -

i trying receive string of user input , write file. no matter do, however, output has spaces removed string. i thought whole purpose of using gets() / puts() read/output of characters in string until encounters newline character. can please tell me doing wrong?? int main (void){ char userinput[100]; char filename[50]; file *cfptr; printf("enter name of file open: "); scanf("%s", &filename); cfptr = fopen(filename, "a+"); printf("enter text add file: \n"); fgets(userinput, 100, stdin); while (strcmp( userinput, "0") != 0) { fputs( userinput, cfptr); fgets(userinput, 100, stdin); } // end while fclose( cfptr ); system("pause"); } // end main can please tell me doing wrong?? first mistake can notice in scanf, string %s using & : scanf("%s", &filename); ^ | remove it, undefine...

Rails landing page routing and devise -

my website should works facebook.com. if user logged , if goes "/" should rendered home controller. if isn't logged should render landing_page controller "/ " && user_signed_in? ---> home controller "/" && user_not_logged ---> landing_page controller i'm using rails 4 , devise applicationcontroller class applicationcontroller < actioncontroller::base before_filter :authenticate_user! end routes.rb get "landing_page/index" root 'home#index', :as => :home how keep "before_filter" in applicationcontrol run in every controllers except "landing_page" controller? update if go "/en/landing_page" render landing_page controller correctly (logged out), if go "/" redirect me "/users/sign_in" class landingpagecontroller < applicationcontroller skip_before_action :authenticate_user! def index end end cl...

kendo ui - KendoUI Grid - ForeignKey column not working in PopUp edit mode -

i've searched on place (understatement) solution case no avail until now. first, i'll explain scenario: i have openaccess model exposed wcf data service (odata v3); i have kendo mvc application; i have view grid, set popup editing, ajax bound; before posting code, let me explain issue/difficulty. have entity these properties: textoid titulo; corpo; tipotextoid; tipotexto; there foreignkey column set tipotextoid property get's correctly populated either in in-line or pop-up mode. when comes changing data, works in-line mode. issue need work in popup, since "corpo" property bound kendoui editor. when in popup, not show correct value on dropdown neither changes when select it. honestly i'm feeling stupid. tried every sample, post, article find no avail , i'm clueless. i hope can me on this. in advance all! so, here's code. view: @model ienumerable<kendomvc.costsimulatorservice.texto> @{ viewbag.title = "...

java - Get value of unknown class field -

i have bunch of unknown classes stored in list / array . how value of fields these classes? what should paste in f.get() ? for(class<?> cl : classlist){ for(field f : cl.getfields()){ try { f.setaccessible(true); writeln(f.get( <what paste here> )); } catch (exception e) { e.printstacktrace(); } } } as far reflection concerned, prefer rely on frameworks more readable api standard java reflection api. i've used two: the first 1 mirror . getting fields values (either static or instance) looks this: getting value of static field: class clazz; object value = new mirror().on(clazz).get().field("fieldname"); getting value of instance field: object target; object value = new mirror().on(target).get().field("fieldname"); you can pass java.lang.reflect.field instead of fieldname string. getting value of static field: field...

debugging - Having problems with changing image javascript -

i'm new javascript , having problems changing image on html document. know in order change images, need change src attribute of img. i have image called "magenta.jpg" want replace "fuschia.jpg" page loads. my html <img src="magenta.jpg" name="photo" id="photo"> my javascript document.getelementbyid("photo").src = "fuschia.jpg"; when try doing this, error says: uncaught typeerror: cannot set property 'src' of null could please me understand going wrong code, , how fix it? it executed before dom loaded. solve can either move <script> bottom of document or inside .js file: ¯¯¯¯¯¯¯¯¯¯¯¯¯¯ window.onload = function(){ document.getelementbyid("photo").src = "fuschia.jpg"; } or if prefer jquery : $(function(){ $("#photo").attr("src", "fuschia.jpg"); });

creating a loop in vba for an excel macro -

i have recorded macro in excel takes data cells in 1 page of spreadsheet , copies them page in different order. each cell individually, , quite long. however 1 row of data in first page. how make single macro loop copies same data each row new page? i haven't included macro code since long can if necessary. thanks you omit code show relevant part, or code mockup macro address , problem. lets imagine problem sub, in case highly omitted: sub omittedsub() ' stuff end sub you can create new sub call many times, new sub 1 calling instead: sub loopomittedsubs() dim integer ' loop call macro routine multiple times = 1 100 omittedsub next end sub in case need pass value, example macro not know row affect , need tell it, can pass loop variable this: sub omittedsub(irow integer) ' stuff row number irow end sub sub loopomittedsubs() dim integer ' loop call macro routine multiple times = 1 100 ...

image processing - Comparing bytes in Ruby -

i have binary blob header of either jpg or mp4 file. trying differentiate between two. when file jpg, first 2 bytes \xff\xd8 . however, when make comparison blob[0] == "\xff" , fails. when know blob[0] in fact \xff what best way this? this encoding issue. comparing string binary encoding (your jpeg blob) utf-8 encoded string ( "\xff" ): foo = "\xff".force_encoding("binary") # blob bar = "\xff" p foo # => "\xff" p bar # => "\xff" p foo == bar # => false there several ways create binary encoded string: str = "\xff\xd8".b # => "\xff\xd8" (ruby 2.x) str.encoding # => #<encoding:ascii-8bit> str = "\xff\xd8".force_encoding("binary") # => "\xff\xd8" str.encoding # => #<encoding:ascii-8bit> str = 0xff.chr + 0xd8.chr ...

SQL Server 2012 "SQL Browser" Service -

as preface, have done checking around on issue found nothing solves question. this question closest found answer did not resolve issue. information configuration: local machine windows 7 visual studio 2012 update 3 , ssdt-bi installed. on server machine have sql server 2012 developer edition installed on windows server 2012 standard. data coming third party database installed on centos5 server. i trying deploy cube analysis services server, getting following error: "a connection cannot made redirector. ensure 'sql browser' service running." i have checked , sql browser service running both on local machine , server machine. well, rather connecting via < server name >\< instance name > have tried connecting ipaddress:port. i'm not sure if relevant, in case is: database using define cube i'm trying deploy on different server , has different authentication sql server 2012 instance. moving data sql server not option. to frankpl: ...

excel - Using trim function on table references -

i'm attempting aggregate imported data source in excel. have 2 combo boxes specify conditions sumifs function (selected using offsets). where struggle data doesn't seem match unless use trim function (i tested on adding column data table). the following formula returns 0 =sumifs(table_externaldata_1[redflag],table_externaldata_1[ragstatus],"=trim("&reconaggregation!$a4&")",table_externaldata_1[clientdescription],"=trim("&offset(lists!$a$1,lists!$b$1,0)&")", table_externaldata_1[agencydescription],"=trim("&offset(lists!$c$1,lists!$d$1,0)&")") when add trims =sumifs(table_externaldata_1[redflag],trim(table_externaldata_1[ragstatus]),"=trim("&reconaggregation!$a4&")",trim(table_externaldata_1[clientdescription]),"=trim("&offset(lists!$a$1,lists!$b$1,0)&")", trim(table_externaldata_1[agencydescription]),"=trim("&offs...

c# - WPF DataGrids for hierarchical information -

i have application contains observablecollection<foo> , , foo in turn contains observablecollection<bar> . pair of datagrids, 1 showing collection of foo objects in application , other showing collection of bar objects in foo that's selected in first datagrid (and want able add, update , delete entries in both datagrids). so far i've got following xaml: <window x:class="test.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.columndefinitions> <columndefinition width="*"/> <columndefinition width="auto"/> <columndefinition width="*"/> </grid.columndefinitions> <datagrid grid.column="0" it...

Github SSH config containing multiple ssh keys capistrano deployment fails saying Repository not found -

~/.ssh/config # user_a host github.com-user_a hostname github.com user git preferredauthentications publickey identityfile ~/.ssh/id_rsa identitiesonly yes # user_b host github.com-user_b hostname github.com user git preferredauthentications publickey identityfile ~/.ssh/id_rsa_user_b identitiesonly yes # http://serverfault.com/questions/400633/capistrano-deploying-to-different-servers-with-different-authentication-methods host example.com identityfile ~/.ssh_keys/example_env.pem forwardagent yes on local machine: $ ssh -t git@github.com hi user_b! you've authenticated, github not provide shell access. on remote machine ~$ ssh remote_user@example.com [remote_user@example ~]$ ssh -t git@github.com hi user_a! you've authenticated, github not provide shell access. note: ssh-add -l shows mentioned keys enlisted deploy.rb contains: set :repository, "git@user_b:<repo_name>" ssh_options[:forward_agent] = true i trying dep...

ruby on rails - Using variables and mixins in Foundation -

i've found lot of similar questions 1 nothing quite solves problem. basically, i'm using foundation 4.x rails 3.x, working fine foundation_and_overrides being included in application.css. can modify variables in foundation_and_overrides , works fine. however, want use $primary-color variable (and bunch of others) in 1 of other scss files (application/global.css.scss). if use @import "foudation_and_overrides" in global css file, works, includes entire foundation css twice in compiled application.css, not ideal. i want use mixins, such @include radius() in global file. works if use @import "foundation/components/global" - ends duplicate css being compiled. want use global vars & functions, not css - surely common thing do? previously (before foundation) put scss functions in helpers file, , imported in other scss files needed it. another quick q while i'm here, class use add little dropdown triangle thing next custom text? thanks! ...

expect - Bash script to wait for gnome-terminal to finish before continuing script, only works for first instance of script -

i have bash script opens new gnome terminal 2 tabs runs more scripts. after scripts in 2 tabs finishes, main script in parent terminal continues run. when run multiple instances of bash script, no longer waits additional gnome-terminals finish before continuing parent terminal script. how fix additional instances of script runs first one? here bash script i'm running. run additional instances of typing sh scriptname.sh in new terminal. gnome-terminal --tab --command="expect launchneuron.exp" --tab --command="expect launchmpj.exp" echo "simulation complete" echo "plotting results" expect -c " set timeout -1 spawn ssh $username@server expect \"password\" send \"$password\r\" expect \"$ \" send \"qsub -i -q abc -a lc_tb -l nodes=1 -l walltime=24:00:00 -d .\r\" expect \"$ \" send \"sh plotgraph.sh\r\" expect \"$ \" send \"exit\r\" " ...

xhtml - Paragraph Styles in a CSS Style Sheet -

i trying make 2 different styles 2 paragraphs in xhtml document using css style sheet. ive tried , searched everywhere nothing has given me straightforward answer. style.css: p.style1 { ... } p.style2 { ... } page.html: <p class="style1">paragraph style1</p> <p class="style2">paragraph style2</p> straightforward enough? :)

Sending an SMTP email in Dart -

i looked through api documentation , language guide, did not see sending emails in dart. checked google groups post , it's quite old dart standards. is possible do? know can use process class invoke external programs, i'd prefer real dart solution if there's any. there's library called mailer , asked for: sends out emails. set dependency in pubspec.yaml , run pub install : dependencies: mailer: i give simple example using gmail on local windows machine: import 'package:mailer/mailer.dart'; main() { var options = new gmailsmtpoptions() ..username = 'kaisellgren@gmail.com' ..password = 'my gmail password'; // if use google app-specific passwords, use 1 of those. // pointed justin in comments, careful store in source code. // careful check public repository. // i'm merely giving simplest example here. // right smtp transport method supported. var transport = new smtptransport(options); // creat...

javascript - User interaction on a page with tipsy -

is there way can trace user on page. want following thing: user opens page, if not click anywhere on page show tooltip (i'm using tipsy) guiding him parts clickable. so far i've tried several stuffs: i have set tipsy show manually: trigger : manual ; i made variable equals false until user clicks clickable items (divs , images) if variable false, show tooltip ( tipsy ). but i'm missing because doesn't work. here code. $(document).ready(function() { var userclick = false; function showtooltips() { $(document).ready(function()) { if(userclick === false) $('.nickname .pseudo-white').tipsy('show'); } settimeout(showtooltips(), 5000); }); try getting rid of call $(document).ready, , pass function name settimeout rather calling () $(document).ready(function() { var userclick = false; function showtooltips() { if(userclick === false) $('.n...

c++ - Virtual Classes in Eclipse -

i'm having problem eclipse's indexing. here's minimal working example. i create header file, parent.h, in define following virtual class: class parent { protected: virtual ~parent() {} public: virtual void overrideme() = 0; }; then, create header file, child.h: #include "parent.h" class child : public parent { }; immediately, eclipse complains "symbol parent not resolved." the problem magically goes away if create source file parent.cpp , in put #include "parent.h". more strangely, not reappear if delete source file. there seems crazy going on eclipse's indexing? people similar problems have recommended doing "index -> rebuild". not work me. any appreciated. in advance.

javascript - In Meteor.js, Why is this.userId == undefined? -

i'm learning meteor following book, , right want insert() userid of user logged in. template.categories.events({ 'keyup #add-category': function(e, t) { if(e.which == 13) { var catval = string(e.target.value || ""); if(catval) { lists.insert({category: catval, owner: this.userid}); console.log(this.userid); session.set('adding_category',false); } } }, however this.userid undefined, insert() didnt work expected. what's missing working? somehow works in code below ( userid defined): lists.allow({ insert: function(userid, doc) { return adminuser(userid); }, update: function(userid, docs, fields, modifier) { return adminuser(userid); }, remove: function(userid, docs) { return adminuser(userid); } }); update why on server-side, this.userid works not meteor.userid() ? meteor.publish("categories...

ios - Custom Cell not resizing UILabel's -

i'm designing custom cell on storyboard , it's not resizing labels according text's size. i'm using code: - (void)awakefromnib { titlelabel.linebreakmode = nslinebreakbywordwrapping; titlelabel.numberoflines = 0; [titlelabel sizetofit]; //[titlelabel setbackgroundcolor:[uicolor graycolor]]; -- put code here sure awake nib working } should implement else? regards! you should call sizetofit in layoutsubviews method.

login - Android Keypad Disturbs View -

i tried creating login page facebook, keypad disturbing editview position , other widgets in ui. how design facebook login page, animation , positioning widget in center. once keypad visible, widget should adjust in screen. need guidance. please me. thanks, bennet. set android:windowsoftinputmode attribute adjustresize in androidmanifest.xml. , make sure layout show centered view in both sizes.

html - How to merge cell or make colspan on jquery-handsontable? -

i using handsontable make excel-like table. want have merged title on table. possible? or there other solution? thx. <div id="example1" style="width: 400px; height: 300px; overflow: scroll"></div> <script> function mergecell(instance, td, row, col, prop, value, cellproperties) { handsontable.textcell.renderer.apply(this, arguments); td.colspan = 2; } var mydata = [ ["", "1", "2", "3", "4", "5", "6"], //i want merge first row using function 'mergecell' ["year", "d", "n", "d", "n", "d", "n", "d", "n", "d", "n", "d", "n"], ["2009", '', -11, 14, 13, 1, 2, 8, 13, -5, 9, 12, 0], ["2010...

How do I create a thread that makes changes to a label in my CLR application? -

i apologize if question comprehensive: i have experience visual c++ , qt , know how in environments sake of team, need make clr application. i have clr application follows: clr application label element. (unable post images due new account). my requirement: i want create thread changes "status here" label display simple string of data. the reason is: have c++ based client application sends data through named pipe application. my goal make separate thread gui form blocking connects , reads client , displays data in tabular form in form. what want know how can modify items in form after receiving data pipe what kind of threads should use, should use clr thread pool or create thread using system::threading follows: threadstart^ ptoperation = gcnew threadstart(startpipe); thread^ pipethread = gcnew thread(ptoperation); pipethread->start(); where startpipe operation going perform functions of creating server pipe, connecting client, doing reads , modifyi...

jsf - Primefaces p:celleditor celledit -

i'm implementing p:datatable component, based on primefaces showcase the code is: <p:datatable id="newdatatable" editable="true" editmode="cell" var="item" value="#{mybean.listnewdatatable}"> <p:ajax event="celledit" listener="#{mybean.newcelleditlistener}" update="@this"/> <p:column width="150" > <p:celleditor> <f:facet name="output"> <h:inputtext value="#{item.description}" readonly="true"/> </f:facet> <f:facet name="input"> <p:selectonemenu value="#{item.id}" style="width: 90%;"> <f:selectitems value="#{mybean.productsmap.entryset()}" var="entry" itemvalue="#{entry.key}" itemlabel="#{entry.value}" /> ...

joomla2.5 - How to edit meta tag in Joomla 2.5 -

i'm using custom component in joomla 2.5. need change meta tag "description" , "keywords" how override meta tag ? thanks answers from joomla docs : $doc =& jfactory::getdocument(); $doc->setmetadata( 'tag-name', 'tag-content' );

php - Find cells with more than one email and separate them into different tables with all of the other information the same -

before id | name | address | email =============================================================================== 1 | bob | 999 bob street, uk | bob@email.com 2 | jimmy | 123 jimmy house, usa | jimmy@email.com jimmy-partner@email.com ok here problem, have 10,000+ rows looking id 1 & 2. of them have 3-6 emails per cell when of them should have one. i need way select rows have 2 or more emails, copy whole row , replace copied row 1 of 2 emails have own separate row. after id | name | address | email =============================================================================== 1 | bob | 999 bob street, uk | bob@email.com 2 | jimmy | 123 jimmy house, usa | jimmy@email.com 3 | jimmy | 123 jimmy house, usa | jimmy-partner@email.com thank suggestions provide useful information can used in future. you can select rows more 1 email finding rows have more 1 @ in email column: select * test_table2 (len...

Android - Google Play Game Service, Could not find method android.view.View.getDisplay -

the sign-in popup windows didnt show up. logcat said not find method android.view.view.getdisplay, referenced method com.google.android.gms.internal.bn$b.b vfy: unable resolve virtual method 3169: landroid/view/view;.getdisplay ()landroid/view/display; vfy: replacing opcode 0x6e @ 0x0009 i tested on real device, samsung s3 android 4.1.2 (api 16). getdisplay() method required api 17. tried "extends fragmentactivity" there no getdisplay() in support-v4 library. gamesclient.builder.setviewforpopups() either not help. google game play service should support since android 2.2 requirement said. all dev tool up-to-date. google-play-lib 3.1.59 (744626-30), sdk 22.0.4. thank much. could post more complete log? there possibility lines not reason sign-in window not show on app ( see other post shows lines in logs , yet able proceed ). other things might helpful you: following instructions type-a-number sample , able run on phone android 4.1.1. the goo...

java - Why is my method returning in the middle? -

the following method executing half-way: public void onlocationchanged(location newlocation) { double lat = newlocation.getlatitude(); double lon = newlocation.getlongitude(); boolean firstgoodfix = (waitingforloc && newlocation.getaccuracy() < 30); // <= execution stops after line if (currentlocation == null || firstgoodfix) { latlng mylocation = new latlng(lat, lon); map.animatecamera(cameraupdatefactory.newlatlng(mylocation)); } currentlocation = newlocation; if (firstgoodfix) { sendmylocation(newlocation); waitingforloc = false; } else { sendmylocation(); } } when step through code, executes until indicated line , jumps closing brace , rest of code never executes. newlocation valid, , waitingforloc (true). newlocation.getaccuracy() should returning around 1000 . currentlocation null. firstgoodfix not appear in list of variables @ end of method leads me believe line not comple...

php - How can i set different custom login redirect for different types of users? -

i've got problem can't solve. partly because can't explain right terms. i'm new sorry clumsy question. below can see overview of goal. in site have 2 types of accounts 1) normal buyer account 2) seller account when normal buyer login should redirect dashboard page & seller should redirect order history page. for tried extension http://www.magentocommerce.com/magento-connect/custom-login-redirect.html but working 1 type of user example gave url seller in normal buyer account defaultly showing "you want become partner please contact admin" how can solve task i using magento ce1.7 may duplicate question sorry forgive me.. any ideas ? you need create own module extends base class mage_customer_accountcontroller of magento , overrides _loginpostredirect function. complete example can found here: redirect customer after login in magento now within above method of _loginpostredirect ,...

magento - add description grid list on theme mobile shoppe -

i try add "short description" on category list of products nothing happend on list.phtml try on: app/design/frontend/base/default/template/catalog/product/list.phtml in lit view there code: (and copy code grid block nothing happend) <div class="desc std"> <h1>test</h1> <?php echo $_helper->productattribute($_product, $_product->getshortdescription(), 'short_description') ?> <a href="<?php echo $_product->getproducturl() ?>" title="<?php echo $_productnamestripped ?>" class="link-learn"><?php echo $this->__('learn more') ?></a> </div> go catalog->attributes->manage attributes , search short_description attribute, edit , set field used in product listing yes . reindex , should work. [edit] or can use this: <?php echo $_product->getshortdescr...

c++ - TCL C API Create and Register new Channel -

i use tcl 8.6(windows) , can't register , use new channels std::ofstream file("1.txt"); tcl_channel kanal = tcl_createchannel(type, "mychann", file, tcl_writable); tcl_registerchannel(interp, kanal); file.close(); and type tcl_channeltype* type = new tcl_channeltype(); type->closeproc = closeproc; type->inputproc = inputproc; type->outputproc = outputproc; type->typename = "my own chann"; type->version = tcl_channel_version_2; functions simply, have std::cout i run interpreter script "chan puts mychan whatever" and nothing happend, no errors interpreter, no output(console, file). dont know how bite this, first goal, create new chanel , use it, second replace tcl_stdout own channel(it can std::ofstream), when run interpreter with "puts whatever" that string go std::ofstream probably did not flush output. this can done with flush mychan you can configure channel flush @ end of line...

php - Add Open Graph Meta Tag After Page is Loaded, for Facebook Share button -

i have assign thumbnail page: <meta property="og:image" content="http://example.com/example.png" /> however, site wordpress site, information of thumbnail loaded when body loaded (it wordpress page). therefore, use following js add tag (inspired question ): <script> $('head').append('<meta property="og:image" content="http://example.com/example.png" />'); </script> the tag added <head> , thumbnail not display after click facebook share button. true facebook button evaluate original source code, instead of modified source code? if yes, can make facebook share button's thumbnail appearing ? fyi, here facebook share button code: <fb:share-button type="button_count" href="http://example.com"></fb:share-button> i don't think possible, since js code not executed. see how facebook sharer select images , other metadata when sharing url? ...

Protect the password when using Mysql in an unattended bash-script -

i writing bash script (for cron job) uses mysql: mysql -uusername -ppassword -e 'something;' i looking way keep password handy use in script, in manner keep information secure other users on system. users use ps -ef , users might read text files... so how can safeguard passwords used in automated script on linux? put settings in option file. can use default ~/.my.cnf file, or can specify alternate file using --defaults-file==filename . see documentation 4.2.3.4. command-line options affect option-file handling the option file contains default settings mysql commands. can put following in it, example. [mysql] user=username password=password database=yourdb make option file readable you, other users can't see password.

html5 - How to retrive the window.localStorage.storedparameters? -

i'm storing values in window.localstorage.storedparameters.when i'm pulling back, have issues. know these data storing in browser ? storing data differ based on browsers ? please advise... you can use chrome browser. just go developer tools pressing f12. , go "resources" tab , go "local storage" option. , see local storage of browser there.

html - ie6 ul list display inline-block expend to full width bug -

Image
working on project these days, run weird problem under ie6, (ie7 , other ok) li element under ul using display:inline-block expend full width. can check img uploaded below. i using zoom:1 *display:inline trigger display:inline-block lte ie8, works fine under ie7, ie6 has problem above. here code <div class="mp-pagnation"> <ul class="mp-pagnation-list clearfix"> <li><a href="">&lt;</a></li> <li><a href="">1</a></li> <li><a href="">2</a></li> <li><a href="">3</a></li> <li><a href="">4</a></li> <li><a href="">5</a></li> <li><a href="">...</a></li> <li>...

Linux kernel: how to force TCP RST to be sent on incoming interface and not making routing decisions? -

i'm working in environment services isolated no routing between them. therefore need send tcp rst message through incoming interface , not make routing decisions @ since no route available dst , rst messages lost. i've added line in linux kernel tcp_v4_send_reset function: arg.bound_dev_if = (skb->dev != dev_net(skb->dev)->loopback_dev) ? skb->dev->ifindex : 0; but can see tcpdumps rst message not sent on incoming interface routing decision made. any help? did miss something? you not need modify kernel achieve this, use ip rule instead. first mark connection coming different interface, , save mark in conntrack table (i'm using eth2/4 example): iptables -t mangle -a routemark -i eth2 -j mark --set-mark 0x100 iptables -t mangle -a routemark -i eth4 -j mark --set-mark 0x200 iptables -t mangle -a routemark -m mark ! --mark 0x0/0xff00 -j connmark --save-mark --mask 0xff00 then create rt_table each interface in /etc/iproute2/rt_tabl...

regex - Match unicode text with Ruby 1.8.7 -

i have regex used matching unicode string , works pretty cool versions of ruby newer 1.8.7: /[\p{l}\p{space}]+/u how can achieved ruby 1.8.7? unicode properties added in ruby version 1.9, in older versions have use posix classes [:space:] or [:alpha:] see posix bracket expressions more details.

java - Generating unique random numbers and check duplicates -

this question has answer here: how generate random integers within specific range in java? 49 answers i generate 3*6 digits, can form array of 3rows*6cols. don't want duplicated found in column. can anywhere, in same row, in each column, there shouldn't duplicate of same number. there algorithm generating ? fill matrix column-wise , use set keep track of numbers have used in current column. can use do-while statement each cell, in pseudo-code: for each column { used = new set each cell in column { { num = generate random number } while (num in used) add num used add num current cell } }

php - Changing date format in mysql_fetch returned array -

i have query this select fname,joined_date employees id=1 currently date format i'm using display returned employee details y-m-d. need convert default mysql format y-m-d d/m/y(in date information display fields). for me it's very difficult go through files date format conversion. so thought of doing thing in database class.i have function in database class function fetch($res){ $row = mysql_fetch_assoc($res); foreach($row $key=>$value){ if(preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/',$value)) $row[$key] = date('d/m/y',strtotime($value)); } return $row; }//end function and i'm using function this $row = $db->fetch($res); or while($row = $db->fetch($res)){...} i'm getting expected output,but error message invalid argument foreach it looks fetch function code executed (total_num_rows + 1) times if use loop instead of foreach, getting undefined offset error currently i'm using thing escap...

php - use dynamic div on animated collapse -

i'm using animated collapse js library here: http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm and i'm trying use dynamic div's it's not toggling. ideas? <head> <script type="text/javascript" src="includes/js/animatedcollapse.js"></script> </head> <body> <?php ($i = 1; $i <= 5; $i++) { ?> <script type="text/javascript"> animatedcollapse.adddiv('location-<?php echo $i; ?>', 'fade=1') </script> <div id="location-<?php echo $i; ?>"> <a href="javascript:animatedcollapse.hide('location-<?php echo $i;?>')">close</a> test </div> <a href="javascript:animatedcollapse.toggle('location-<?php echo $i;?>')">toggle</a> <?php } ?> <script type="text/javascript"> animatedcollapse.ontoggle=function($, divobj, state){} animatedcollapse.init()...

c++ - Qt http bad request on google -

i'm trying create url shortener app using google's url shortener api ( https://developers.google.com/url-shortener/v1/getting_started#shorten ). problem bad request. here error: error: error downloading https://www.googleapis.com/urlshortener/v1/url - server replied: bad request what did wrong? here code: void mainwindow::ppp(qstring longurl) { qnetworkaccessmanager* manager = new qnetworkaccessmanager(this); connect(manager, signal(finished(qnetworkreply *)), this, slot(replyfinished(qnetworkreply *))); qurl url = qurl("https://www.googleapis.com/urlshortener/v1/url"); qnetworkrequest request(url); request.setheader(request.contenttypeheader,"application/json"); qbytearray postdata; postdata.append("longurl"); postdata.append(longurl); manager->post(request,postdata); } void mainwindow::replyfinished(qnetworkreply *reply) { if(reply->error() != qnetworkreply::noerror) { ui-...

oop - C# Get subclass attribute value -

i'm trying make this: class { //attibutes } class b : { public int classbattribute = 5; // other attributes , methods } my question if have instance of class how can instance of b class or access attributes? b b = new b(); application.add(b); //other form a = application.geta(); b b = getbfroma(a);// ??? note: b b = b; does't work tried you cannot -- there no magical way create derived objects base objects in general. to enable such scheme class b need define constructor accepts a argument: public b(a a) { // whatever makes sense create b } which can use as var b = new b(a); of course after a , b different objects; changing 1 not affect other. you should terminology right in order avoid confusion: classbattribute not attribute , field .

ios - How to release GADBannerView on ARC? -

i sounds stupid question, seems cannot release admob gadbannerview. admob documentation says don't call "release" when using arc. needless cannot call release because it's not allowed , generates error. tried this: @property (nonatomic, strong) gadbannerview *admobview; … [admobview removefromsuperview]; admobview.delegate = nil; admobview = nil; but nothing happens. becomes nil still stays on screen. supposed subclassed uiview. @ best can hide still received ads , stays in memory. any ideas? try weak reference @property (nonatomic, weak) gadbannerview *admobview; weak weak similar strong except won't increase reference count 1. not become owner of object holds reference it. if object's reference count drops 0, though may still pointing here, deallocated memory. refer more here

android - View.layout changes to default xml layout -

in app, i'm changing layout location doing this: totalcommentlayout.layout(0, webviewheight - buttombtnsheight - shadowheight, width, webviewheight); the change happening changes layout described in xml file. why happening , how can persist change in location of layout?

rally - Extract data from RallyDev and present them on a screen -

i inverstigating solution on how extract data rallydev , present data on big screen in office organization. information display "burndown chart pr. team" (we have 5 scrum teams); top 5 tasks in progress indiviual teams , iteration status ex "7 days remaning in sprint (22/07/2013 02/08/2013). we have presentation tool our big sceens called "beats" can display pictures network folder , images changed every 7 secound. idea create image information descriped above in 1 slide(image) pr. team. my question have these images can created, of know or have expirences solution this? or recommendation me:) so far have played around ruby extract data excel , created macro in excel created burndown chart , list tasks , iteration status. it's more @ static solution, have stuff manual every day. more looking automated solution windows schduler or somethink else. let me know if have thoughts on solution , taking time read this. you may explore writing ap...

jquery - how to save data by disabled text box? -

in jsp page, 1 checkbox, 2 textbox , 1 submit button. checkbox used enabling , disabling text box. data saved when textbox enable not saved when textbox disable. following code toggle. function togglefields(status){ if (status==false){ $("#textbox1").removeattr("disabled"); $("#textbox2").removeattr("disabled"); } else { $("#textbox1").attr("disabled", "disabled"); $("#textbox2").attr("disabled", "disabled"); } } please me in this. you can use readonly instead of disabled . $("#textbox1").attr("readonly", true); your code be function togglefields(status){ if (status==false){ $("#textbox1").attr("readonly", false); $("#textbox2").attr("readonly", false); } else { $("#textbox1").attr(...

c# - Creating report in asp.net with many web pages -

i have problem report creation. have asp.net web application gridview contains results. each result can press link redirect me page gridview more details. want download pages , populate gridviews in html format without redirected webpages. is there way it? thanks.

github - How to get interesting commits from my git repo's forks into my repo? -

let's github repo x has lot of forks, , of them have new features (=commits). afaik without pull/merge request fork's owner it's not possible "get" commits repo (but not want. want pick stuff need, not getting requests other users). so question is: how commits from repo's forks repo ? the fact these commits aren't in pull requests don't prevent apply them fork. can add these fork remotes repo, , cherry-pick/rebase/merge (choose right one) commits them. it's just: git remote add nice-fork https://github.com/author/repo git fetch nice-fork #then remote branches , commits imported in repo. if commits want in pull requests, you can them .