Posts

Showing posts from January, 2012

android - EditText with long default text on a single line -

i have edittext trying set long, unbreaking text value (a url), following xml declaration, text breaking second line. <edittext android:id="@+id/address" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="1" android:maxlines="1" android:hint="enter url" android:text="http://www.example.com/news/2010-07-15/this-is-the-story-title-here.html"> </edittext> i've tried solutions here (adding android:ellipsize="end" ), made no difference. reducing text in length no more length of edittext worked... realistic url edittext . any suggestions? thanks, paul set android:scrollhorizontally="true"

2 Binary Equal php files, one works while the other emits White Screen of Death -

i edited <title> in php file (myfile.php) re-uploaded server; changed. now navigating page/file doesn't work. php's white screen of death (view-source blank too). i renamed file locally , reuploaded myfile2.php . tada. works. i've restarted server , original file still won't work. turns out while myfile.php file binary equal myfile2.php got messed on server. deleting original myfile.php , reuploading fixed it.

jnlp - Java Web Start: How to make the system download the file every time the file changes -

i've implemented java web start application, , noticed 1 problem during programming process: if distribute version , use jnlp file download it, cannot let system download files again unless add/delete files or clear task java cache. means if modify files system not download new file: use old ones. i know can forbid system cache files, there better way solve more elegantly? also note official guide : if offline-allowed specified, java web start check see if update available. however, if application downloaded check timeout after few seconds, in case cached application launched instead. given reasonable fast server connection, lastest version of application run, not guaranteed. application, however, can run offline. does means situation in latest version not run occur quite in practice if web slow? i.e., how fast "reasonably fast"? thanks inputs! you should use update element: <jnlp> ... <update check="always" policy="alway...

asp.net - url rewriter does not work on host -

i following simple implementation: http://www.codeproject.com/kb/aspnet/urlrewriter.aspx it works fine when test on localhost. for example: http://localhost/city/newyork/1 => http://localhost/city/default.aspx?city=newyork&id=1 but after uploading host, when enter: http://domain.com/city/newyork/1 got: not found requested document not found on server. could please give me hint this? thanks in advance.

try catch - Two different ways of "catching" two different kinds of exceptions in C#. Is one better than another? -

i've never had need catch more 1 exception @ time before. here's scenario. want "try" copy file. if destination doesn't exist, don't want bothered it. still want catch other type of exception. unauthorizedaccessexception example. below 2 things i've tried, i've seen both examples used on web. 1 better coding another. or completly wrong on both? thanks. catch (directorynotfoundexception) { // nothing } catch (exception ex) { messagebox.show(ex.message); } or catch (exception ex) { if (ex directorynotfoundexception) { // nothing return; } else { messagebox.show(ex.message); } } imho, having multiple catch reduce code-readability. suggest. if (directory.exists(dirpath)) { try { ...

javascript - Popup with parent window notification -

i have web app opens new popup window javascript , after user authenticate inside popup window want close (which window.close() ) , reload window opened popup window. how that? js-popup-code: var w = window.open("url", "title", "width=990,height=500,resizable=yes"); w.focus(); opener.refresh() before close window.

python - Error Importing GTK -

i'm running python 2.7, latest version of gtk installed. i'm trying import gtk following line of code: import gtk it throwing following error: traceback (most recent call last): file "c:\gtktutorial\tutorial.py", line 3, in import gtk file "c:\python27\lib\site-packages\gtk-2.0\gtk__init__.py", line 40, in gtk import _gtk importerror: dll load failed: specified procedure not found. how fix this? import pygtk working, , have glade 3.8.0 installed. where did pygtk installer from? try using one: http://ftp.gnome.org/pub/gnome/binaries/win32/pygtk/2.22/pygtk-all-in-one-2.22.6.win32-py2.7.msi

html - CSS Drop Down Menu -> Cross Browser -

can of wonderful developers link or provide me link menu cross browser having issues mine , loading within firefox fine in chrome. my div stays in correct position menu drops down below div. my html dynamically generated , current structure is: <nav id="mainmenu"> <ul> <li class="first"> <a href="#">single item</a> </li> </ul> <ul> <li class=""> <a href="#">drop down menu</a> <ul> <li class="first"> <a href="#">item 1</a> </li> <li class="last"> <a href="#">item 2</a> </li> </ul> </li> </ul> my current css is: #mainmenu{ height:50px; margin:0 auto 15px auto; background-color:...

Xpath getting node without node child contents -

hey guys coudln't around this. have html structured follow: <div class="review-text"> <div id="reviewerprofile"> <div id="revimg"></div> <div id="reviewr">marc</div> <div id="revdate">2011-07-06</div> </div> awesome review </div> what trying text "this awesome review" everytyme query node other content in childs. using ".//div[@class='review-text']" how text only? tank much you're there! add /text() @ end of xpath text node.

c# - How do I create a ProgressBar which is hidden when the Value is 0? -

the following doesn't quite work (progressvalue value set in datacontext.) <statusbaritem grid.column="1"> <statusbaritem.resources> <style targettype="progressbar"> <style.triggers> <datatrigger binding="{binding progressvalue}" value="0"> <setter property="visibility" value="hidden"/> </datatrigger> </style.triggers> </style> </statusbaritem.resources> <progressbar value="{binding progressvalue}" grid.column="1" width="80" height="13"> </progressbar> </statusbaritem> try specifying minimum (and maximum) value. after setting seems work version of code. with xaml: <statusbaritem x:name="feedback" grid.row="1"> <statusbaritem.resources> ...

wysiwyg - How to install 'Ckeditor' for 'Active Admin' with 'Rails 3.1' -

i looking how install ckeditor active_admin i installed ckeditor , have put line in 'initializers/active_admin.rb' file. # load javascript file: config.register_javascript 'ckeditor/config.js' and line config.autoload_paths += %w(#{config.root}/app/models/ckeditor) in 'config/application.rb' in begining 'config.js' file wasn't loaded because when install ckeditor gem creates folder named ckeditor in public/javascripts rails 3.1, had move folder assets/javascripts... that's i've done. now file "config.js' loaded. but don't know have next rails 3.2 activeadmin-0.4.3 in 'initializers/active_admin.rb' file. config.register_javascript 'ckeditor/ckeditor.js' config.register_javascript 'ckeditor/init.js' in form = f.cktext_area :text

python - A loop within tkinter - HELP! -

this first time using forum, hopefully, can quick response detailed explanation. running: python 3.2 tkinter 8.5 & windows7 x64 my code: from tkinter import * import tkinter.messagebox class application(frame): def __init__(self, master): super(application, self).__init__(master) self.grid() self.lvl_one_att = 4 self.bttn_clicks = 2 self.bttn_clicks2 = 2 self.bttn_clicks3 = 1 self.bttn_clicks4 = 2 self.bttn_clicks5 = 1 self.bttn_clicks6 = 2 self.bttn_clicks7 = 1 self.bttn_clicks8 = 2 self.bttn_clicks9 = 2 self.level_one() def level_one(self): self.lbl1 = label(self, text = "you must flip boxes show same colour!") self.lbl1.grid(row = 0, column = 0, columnspan = 3) self.levellbl = label(self, text = "level 1") self.levellbl.grid(row = 4, column = 1, sticky = w, columnspan = 2) self.rulesbttn = button(self,...

debugging - Cannot set watchpoint in GDB -

i doing debugging , wanted check place value of variable changes .for tried setting watch point saying watch 'structure->somefunc.getvalue()' not simple variable (probably portion of bigger structure invoking function ) .when gdb says no symbol 'structure->somefunc..' in current context .when grep in same directory 3-4 instances of same expression.am missing out something? am missing out something? yes, appear missing @ least couple of things: the expression structure->somefunc.getvalue() doesn't make sense. meant some_variable->some_field.getvalue() for expression valid, must in context some_variable exists. fact some_variable shows in grep output doesn't mean gdb can currently evaluate it. may able evaluate when stop program in correct context. it makes no sense (and impossible) set watchpoint on return value of getvalue() . watchpoints make sense if can specify memory location want watch. if (as likely) getvalue() ...

database - MS Access 2010: Deleting duplicates without primary key -

i working client gets data in excel spreadsheets wants import data access table. fields data records are: -invoicenum -invoicedate -customer -shipdate -quantity -item -priceeach he receives data twice per month, , each time receives data, wants able import data table in access. there 2 issues causing me problem: 1) there no primary key data (the closest field primary key "invoicenum", unfortunately multiple records can have same string field); 2) duplicate records possible, "duplicate records" mean 2 records have same values each field. the problem not want duplicate records in data table. i don't know best way handle this. hoping suggestions concerning following: a) should store records in excel spreadsheet linked access table? thinking if this, can append each new set of data spreadsheet (including duplicates), write macro in excel remove duplicates (i noticed can using "remove duplicates" command on "data" tab). or b...

xml - Javascript Auto-fresh XMLHttpRequest problem -

i'm writing desktop gadget should refresh every 10 minutes or (it's ten seconds here). i've determined every time execute settimeout, xml doesn't load again. i don't know kind of problem is. made sure objects set null, don't re-initialize , i'm left blank xml object. settimeout("bg_load();getxml()",10000); function getxml() { stat = readsetting(); url = "http://www.weather.gov/xml/current_obs/" + stat[0] + ".xml" rssobj = new xmlhttprequest(); rssobj.open("get", url, false); rssobj.onreadystatechange = function() { if (rssobj.readystate === 4) { if (rssobj.status === 200) { document.getelementbyid("gadgetcontent").innerhtml = ""; rssxml = rssobj.responsexml; } else { var chkconn; document.getelementbyid("gadgetcontent").innerhtml = "unable connect..."; ...

class - Odd behaviour with simple tree implementation in python -

class node: children = {} sequence = [1,2,3,4,5] tree = node() node = tree item in sequence: if item not in node.children: node.children[item] = node() node = node.children[item] print tree.children.keys() i want above code output [1] , outputs [1, 2, 3, 4, 5] . why this, , how go fixing it? node.children class attribute. make instance attribute instead. class node: def __init__(self): self.children = {}

objective c - using CLLocation objects as keys in dictionary -

is possible use cllocation objects keys in dictionary? when try this, [dictionary objectforkey: cllocationobj] returns nil when there cllocation keys inserted same latitude , longitude. doing wrong? (location *location in somearray) { cllocation *locationkey = [[cllocation alloc] initwithlatitude:[location.latitude doublevalue] longitude:[location.longtitude doublevalue]]; locationannotation *annotationatlocation = [self.uniquelocations objectforkey:locationkey]; if (annotationatlocation == nil) nslog(@"this nil"); } i know debugging there multiple objects of location same latitude , longitude in somearray. cllocation not seem override isequal perform actual content comparison, instead compares equality based on object identity. therefore not wise use key in dictionary, unless accessing using exact same object. the solution have described in comment quite workaround many situa...

extjs3 - Extjs - How to adjust position of siblings when an item inside a Compositefield grows/resized -

i have composite field 2 textfield items. first textfield's grow property set true. when first textfield's width autoresize, overlaps field right. succeeding items adjust/move it's position right preceeding field grows. e.g new ext.form.compositefield({ autoheight: true , autowidth: true , items:[{ xtype:'textfield' , flex: 1 , growmax: 125 , growmin: 80 , width: 80 , grow: true , listeners: { 'autosize': function () { // should here?? tried accessing // ownerct syncsize() didn't work } }} , { xtype:'textfield' , flex: 1 , width: 80 }] }); thank in advance. this seem bug of extjs. however, 've found workaround: 'autosize': function () { if (this.width == this.el.dom.offs...

c# - How Can i move item collection in Winform Listbox1 to Listbox2? -

i doing student attendance project college in win form mysql(c#). i ask hidden column in listbox got solution that. updated query - string myconstring = configurationmanager.connectionstrings["college_management_system.properties.settings.cmsconnectionstring"].connectionstring; mysqlconnection connection = new mysqlconnection(myconstring); string cnd1 = "select name,admin_no student_admision_master course='" + course_code + "' , year='" + year_code + "' , sem='" + semester_code + "' , batch='" + batch_code + "'"; mysqldataadapter da = new mysqldataadapter(cnd1, connection); connection.open(); dataset ds = new dataset(); mysqlcommand command = connection.createcommand(); da.fill(ds, "student_admision_master"); //datagridview1.datasource = ds.tables[f...

wpf - Can XamlReader load xaml that contains types defined in external assemblies? -

the xamlreader loading xaml using types defined within local assembly , wpf assemblies without problems. if include types defined within external assemblies xamlparseexception following message thrown. cannot create unknown type '{clr-namespace:telerik.windows.controls;assembly=telerik.windows.controls.charting}seriesmapping'.' line number '13' , line position '18'. is possible load types external assemblies using technique? yes possible. trick load external assemblies appdomain before making call xamlreader.parse. if assemblies referenced assembly making call simplest means of doing declare variable using type external assembly. note not necessary instantiate type. alternatively, assembly.load method can used load non referenced assemblies.

Is there any C API in openssl to derive a key from given string -

i need c api in openssl library deriving key given string. can sample source code this? a standard algorithm pbkdf2 (an acronym password-based key derivation function version 2 ). there implementation of pbkdf2 in openssl, declared in openssl/evp.h : int pkcs5_pbkdf2_hmac_sha1(const char *pass, int passlen, unsigned char *salt, int saltlen, int iter, int keylen, unsigned char *out); when generating new key should use rand_bytes() openssl/rand.h create salt. iter iteration count, should large intended application can tolerate - @ least 20,000.

lotus notes - Is showResult a global function name in SSJS? -

i used showresult function name in script library , when it's called, error [typeerror] error calling method showresult(string) on object of type 'object[javascript object]' occurred. if function defined in xpage or renamed showresult2, ok. no. reference tab in script editor allows see global functions. if showresult function, it's defined elsewhere (e.g. in script library).

import - wxPython.wx.AboutDialogInfo() has no attribute AboutDialogInfo() -

so, had problem wxpython, managed track down importing of wx shown here: pyinstaller activex attribute error wxpython thanks @mike-driscoll's answer, removed horrid stuff, , replaced with import wxpython (import wx didn't work...) now, whenever call class or method wxpython, append @ start of it: wxpython.wx. this worked fine wxframe, wxapp, wxsize, wxmenubar, etc. but. when try aboutdialoginfo; traceback (most recent call last): file "c:\users\judge\desktop\lulzapp\lulz.py", line 101, in aboutapp info = wxpython.aboutdialoginfo() attributeerror: 'module' object has no attribute 'aboutdialoginfo' what can done solve this? what version of wxpython using? syntax "import wxpython" deprecated years ago. if "import wx" isn't working, there's wrong wxpython installation , should reinstall it. guess have multiple wx installs , maybe that's confusing python. once can "import wx", use ...

html - About replicating/generating a lot of div css -

for project need as efficiently possible make world map out of little square divs of approximately 20x20px. however because need div sizes scale browser using div's width of 1% , height of 2%, on 16:10 screen looks square. i have div called "world" filled lots of little divs like: <div id="world1" onclick="">&nbsp;</div> each of these divs paired css follows: #world1 { background: url(/images/1.png) 0 0 no-repeat; float: left; width: 1%; height: 2%; position: absolute; top: 79%; left: 91%; z-index: -1; margin-top: -10px; margin-left: -10px; } #world1:hover { background-position: 0 -20px; cursor: pointer; } i figured easiest way make map generate code divs , corresponding css divs names "world1" through "world20000" placed @ positions ranging top:1%; left: 1%; to top:100%; left: 100%; and go through hand , delete divs covering oceans on map crea...

c++ - Xcode 4 mach-o error -

i coded osx application (not iphone) on top of another, changed name (i asked if wanted rename instances of original name, , did). compiles when not producing executable, when later, fails because looking target named previous name of application. the actual faulty section of compile process goes this: ... build previousname.xcodeproj .... what have change xcode(4) stops looking project original name of application? i had same problem while ago. restarting xcode needed do.

API for RTF in JAVA -

starting scratch want create rich text format file in java, database. there , famous api, reliability , documentation. regards, xappy if recall used itext several years back.

asp.net - Error in export gridview to excel -

i tring export gridview excel.for wrote code in content page.but got error.when writting attribute[runat]="server";so searched on net wrote this. public override void verifyrenderinginserverform(control control) { /* confirms htmlform control rendered specified asp.net server control @ run time. */ } .but remove code page.but when running page display on login page.i want remove sentence coming @ run time. i have 1 master page , remaining content page.the login page not content page, simple aspx page.in master page there form tag.in 1 of content page,i added code export gridview. htmlform frm = new htmlform(); frm.attributes["runat"] = "server"; so got error.i searched on net error ,ppl saying use method ,so wrote method. public override void verifyrenderinginserverform(control control) { /* confirms htmlform control rendered specified asp.net server control @ run time. */ } but problem when running project code display on l...

php - PHPExcel Writter Excel2007 -

i using phpexcel lib generating excel file of table of mysql database. m getting fatal error when call function excel generation. error comming given below. fatal error: uncaught exception 'exception' message 'could not close zip file dfeefxmevtunsbkoeptpydyiysengrqi.xlsx.' in /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/core/lib/phpexcel/writer/excel2007.php:337 stack trace: #0 /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/core/lib/class.iexportmodule.php(81): phpexcel_writer_excel2007->save('dfeefxmevtunsbk...') #1 /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/core/lib/class.exportmodule_lang.php(59): iexportmodule->_download_excel2007() #2 /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/controllers/export.get.create.php(12): exportmodule_lang->export() #3 /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/export.php(1...

mysql - Column not found error in Criteria -

i'm working on symfony project , need query many many relationship, made criteria based function query database: //create criteria object $c1 = new criteria(); //selecting rows in link table matches table1 id (parameter) $c1->add(linktablepeer::tbl1_codigo,$parameter,criteria::equal); //selecting rows in table2 matched last query $c1->addjoin(linktablepeer::tbl2_codigo,table2peer::tbl2_codigo); $list = linktablepeer::doselect($c1); but throws me strange error [wrapped: sqlstate[42s22]: column not found: 1054 unknown column 'link_table.id' in 'field list'] is strange because have no column named id in table. why happening? how can fix it? the question in other words: is there option php symfony propel:build-model command prevents generating "id" column tables don't have primary key? thank time ;) i've found problem the dump command task trying export view in mysql database . when defi...

asp.net - Ext.net grid: how to align column content? -

this seems stupid question, can't align column content in ext.net gridpanel ! use : <ext:column dataindex="category1" header="category" align="left" width="80" /> but column header aligned, not content ! thanks to give different alignments column header , content, should assign columnid attribute ext:column . , then, able give 1 alignment header (by css columnid in class name) , 1 content align attribute. for example, align header center , content left, code that: <style type="text/css"> .x-grid3-hd-category1 { text-align: center; } </style> <ext:column columnid="category1" dataindex="category1" header="category" align="left" width="80" />

sql server 2008 - How to replace clustered index scan with a non-clustered index seek or clustered index seek? -

Image
below create table script:- create table [dbo].[patientcharts]( [patientchartid] [uniqueidentifier] rowguidcol not null, [facilityid] [uniqueidentifier] not null, [visitnumber] [varchar](200) not null, [mrnnumber] [varchar](100) null, [timein] [time](7) null, [timeout] [time](7) null, [dateofservice] [date] null, [dateout] [date] null), i have 1 clustered index on patientchartid , 2 non-clustered index on visitnumber , mrnnumber. table has millions of records. the following query doing clustered index scan:- select * dbo.patientcharts inner join ( select facilityid facilities remoteclientdb in ( select siteid remoteclient ( nolock ) code = 'in-esxi-edisc14' ) ) filter on dbo.patientcharts.facilityid = filter.facilityid this clustered index scan taking lot of time in production because of data volu...

PyGTK Hotkey Toggle Pin/Unpin -

i'm still learning pygtk, , i'm trying figure out how can tell window pin/unpin (aka toggle on top) each time press f1 key. this got far. #!/usr/bin/env python import gtk class app(gtk.window): def pinning(self, widget, event) : if event.keyval == gtk.keysyms.f1 : self.set_keep_above(true) def __init__(self): super(app, self).__init__() self.set_position(gtk.win_pos_center) self.set_title("testapp") self.set_default_size(320, 200) self.connect("destroy", gtk.main_quit) self.connect("key-press-event", self.pinning) self.show_all() app() gtk.main() unfortunately, there no get_keep_above() method. have connect window's window-state-event signal; in event parameter, read new_window_state field see if sticky flag set or not, keep track of yourself, example in self.is_kept_above . then can do if self.is_kept_above: self.set_keep_above(false) else: self.set_keep_above(true) ...

Eclipse freezes on android related autocomplete -

i've got vanilla eclipse, installed adt , started following tutorials. works fine. build project fine, launch emulator , run compiled android app, can edit xml, , portions of java files, once autocomplete box pops up, that's it. eclipse freezes totally. cpu usage of eclipse drops 0% , nothing happens. i've waited couple of minutes, 0% cpu don't see point. , 10 seconds wait when typing makes unusable. i have found references downloading source , putting platforms/android-x/sources , i've done that, problem has not gone away. (admittedly i've downloaded froyo sources , put in android-8 - hoping wouldn't have every version of android - have directories 7, 9 , 10 in /platforms/ ). i using ubuntu natty (11.04) guess possible new window manager (unity) might having problem, i've searched http://launchpad.net , not found there. i have no other plugins installed apart adt (and it's dependencies). version of eclipse galileo (3.5.2) ubuntu natty ...

c++ - Precise mode in Boehm Garbage Collector -

i've read on webpage of mono using boehm gc in precise mode. use boehm gc c++, however, have found nothing in documentation or headers indicate precise mode, less how turn on. any information whether has precise mode default , how turn on, or kind of modification mono developers? the file doc/gcinterface.html garbage collector ( archive here ) states: void * gc_malloc_atomic(size_t nbytes) allocates nbytes of storage. requires (amortized) time proportional nbytes. resulting object automatically deallocated when unreferenced. client promises resulting object never contain pointers. memory not cleared. preferred way allocate strings, floating point arrays, bitmaps, etc. more precise information pointer locations can communicated collector using interface in gc_typed.h in distribution. it looks there "precise" interface can used.

c# - Implementing a geographic coordinate class: equality comparison -

i 'm integrating geographic coordinate class codeplex personal "toolbox" library. class uses float fields store latitude , longitude. since class geocoordinate implements iequatable<geocoordinate> , habitually wrote equals method so: public bool equals(geocoordinate other) { if (other == null) { return false; } return this.latitude == other.latitude && this.longitude == other.longitude; } at point stopped , considered 'm comparing floating point variables equality, no-no. thought process went follows: i can imagine setting latitude , longitude properties once, means there no errors being accumulated mess comparisons. on other hand, it's possible (albeit pointless) write var geo1 = new geocoordinate(1.2, 1.2); var geo2 = new geocoordinate(1.2, 1.2); // geo1.equals(geo2) true, but: geo2.latitude *= 10; geo2.latitude /= 10; // think bets off of course not can imagine doing, if public interface of class allo...

SharePoint 2010: Setting SafeControl "SafeAgainstScript" property on web part installation -

is there way set safeagainstscript property of safecontrol entry in web.config file true upon installation / upgrade of web part? (it defaults false) the safecontrol entry should appear follows: <safecontrol assembly="microsoft.sharepoint, ..." namespace="microsoft.sharepoint" typename="*" safe="true" safeagainstscript="true" /> i installing third party web part , not have go , edit config file each time web part re-installed or upgraded. well guess theres no "easy" way it. you can edit web.config using spwebconfigurationmodification class http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebconfigmodification.aspx http://msdn.microsoft.com/en-us/library/bb861909.aspx however, can tricky , not recommendeded - safecontrol entries meant put in manually or using .wsp's manifest.xml file so open .wsp winrar or 7zip, extract manifest.xml, make change safecontrol ent...

jquery - Cloning, appending and modifying (frogs) -

in jquery example below, before showing cloned segment of html, how change text "remove frog" "remove frog #99" , add id called "frog99", 99 sequencing number? <div id='imagebox'> </div> <div class="hidden" id='template'> <span class='alignright'><a href='#' class='deletefrog'>remove frog</a></span> <span class='alignright'><a href='#' class='addfrog'>add frog</a></span> <img src="img/frog.jpg"> </div> script: var frogcount = 0; $(document).ready(function() { // listener: add "live" listener link $("#addfrog").live('click', function() { // clone hidden template myclone = $("#template").clone(); // before showing cloned object, change text "remove frog" "remove f...

Django InlineAdmin.template not being overriden -

i'm using django 1.3 , trying customize appearance of tabulatinline admin model in django admin site. i'm trying override 'admin/edit_inline/tabular.html' template own. per documentation following: from django.contrib import admin myapp.models import mychildmodel, myparentmodel class mychildmodelinlineadmin(admin.tabularinline): model = mychildmodel template = 'mytabular.html' ... class myparentmodeladmin(admin.modeladmin): model = myparentmodel inlines = [mychildmodelinlineadmin,] admin.site.register(myparentmodel, myparentmodeladmin) let's have application called myapp , code above in admin.py module of app , template mytabular.html in templates directory of app. the thing no matter settings (e.g. template dirs) other templates work fine views.py, admin site seems ignore template option of mychildmodelinlineadmin. if debug code in eclipse , comment line template = 'mytabular.html' , mychildmodelinlineadmin ...

asp.net - How to remove more DataTable Columns using C#.Net? -

i have 1 datatable may have more columns. "netamount", "totalamount", "destination" datatable columns present in datatable. here want remove 3 columns such "netamount", "totalamount" , "destination" datatable , take other column values in datatable. i tried below , desired output. dtattribute.columns.remove("netamount"); //dtattribute main datatable dtattribute.columns.remove("totalamount"); dtattribute.columns.remove("destination"); datatable dtitem = dtattribute.copy(); but looks childish , lengthy. there other method do? please give suggestions. there's nothing wrong code (except copying table after removing columns -- sure want?). if want more abstract (instead of repeating same line again , again), might consider removing columns in loop: var dtitem = dtattribute.copy(); // if want keep copy of original table var toremove = new string[] {"n...

SQL to Hibernate query conversion -

i came across problem , can not move forward because cannot converted sql hsql. de sql: select * live_information i, live_matches_away ma, live_matches_home mh, live_matches m left join live_periods lp on lp.match_id=m.id left join live_results r on r.match_id=m.id left join live_scorers s on s.match_id=m.id i.match_id=m.id , ma.match_id=m.id , mh.match_id=m.id , day=20 , month=07 , year=2011 i converted hibernate, getting error, , don't understand how left join can without on? this hsql: from livematches m, liveinformation i, livematchesaway ma, livematcheshome mh left join liveperiods lp on lp.livematches.id=m.id left join liveresults r on r.livematches.id=m.id left join livescorers s on s.livematches.id=m.id i.livematches.id=m.id , ma.livematches.id=m.id , mh.livematches.id=m.id , lp.livematches.id=m.id , r.livematches.id=m.id , s.livematches.id=m.id , m.day=" + day + " , m.month=" + month + " , m.year=" + year; this error: org.sp...

oop - In perl,is there a module that automatically generates set/get accessor methods? -

anyone knows such module? write myself tedious.. class::accessor pretty standard, non-moose perl.

appcelerator titanium tabgroup order -

i creating iphone application using appcelerator titanium, created tabgroup has 7 tabs. want record tabs order when user edits it, , use preference. possible definitely. save order of tabs using ti.app.properties api . give persistent, user based storage of settings. then, when app starts up, add tabs tab group in order specified user.

system.reactive - Managing async service calls using Silverlight and Reactive Extensions -

so i'm reading on rx , having difficult time grokking it. have silverlight app needs make 6 calls specific service asynchronously. in old days, we'd handle making calls , querying userstate/token match response request since they're not guaranteed return in order called them. however, suspect rx handles in far more elegant manner. can't work. here's have far... mycollection.add(new myobject(1)); mycollection.add(new myobject(2)); mycollection.add(new myobject(3)); mycollection.add(new myobject(4)); mycollection.add(new myobject(5)); mycollection.add(new myobject(6)); foreach (var myitem in mycollection) { var myobservable = observable.fromeventpattern<myservicemethodcompletedeventargs> ( f => myserviceclient.myservicemethodcompleted += f, f => myserviceclient.myservicemethodcompleted -= f ).take(1).observeon(synchronizationcontext.current); myobservable.subscribe ( s => { if (s.eventargs.erro...

Android ListView layout param set -

i have listview in xml. structure of that: <listview android:id="@+id/seriescastlistitemview" android:paddingtop="10dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:divider="#ffffff" android:dividerheight="1px"/> now want set height listview java code. tried following code. listview castlistitemview = (listview) findviewbyid(r.id.seriescastlistitemview); castlistitemview.setadapter(new castadapter(this, castdescriptionarr)); castlistitemview.setlayoutparams(new listview.layoutparams(layoutparams.fill_parent, 500)); but giving java.lang.classcastexception: android.widget.abslistview$layoutparams . problem in code? you should using layoutparams of parent view contains listview. in case, placed listview in frame layout, , used code. if placed listview in linearlayout use linearlayout.layoutparams. listview castlistitemview = (listview) fin...

Search Array PHP -

i have following situation i have 2 arrys following answers array array ( [0] => array ( [id] => 4e28258263d2c4 [answer] => study accounting [question_id_fk] => 4e28258262d100 [correct] => 0 [result_text] => thats right answer [order] => 1 ) [1] => array ( [id] => 4e28258266d896 [answer] => new york [question_id_fk] => 4e28258265b752 [correct] => 0 [score] => 0.00 [result_text] => [order] => 1 ) [2] => array ( [id] => 4e282582683870 [answer] => yes [question_id_fk] => 4e282582674ba0 [correct] => 0 [score] => 0.00 [hot_answer] => 0 [hot_email] => [ordering] => 1 [result_text] => [order] => 1 ) [3] => array ( [id] => 4e282582698c23 [answer] =...

SharePoint Designer 2007 : Remove seconds fields from the email -

the email notification sent out sharepoint designer 2007 workflows includes seconds date/time field. example "this confirmation registered attend demo @ 10:00:00 am". how can remove seconds field email message. the sharepoint list date/time field displays fine (without seconds) thanks one option - create calculated column show formatted version of date , include column in email. for example if you've got field called "my date" can create calculated column called "my formatted date" (or whatever makes sense) using following formula. =text([my date]","mmm yyyy") will display date in format jul 2011 =text([my date]","dd/mm/yyyy") will show 21/7/2011.

eclipse - project directory structure related issue -

Image
i posted 1 question earlier project directory structure problem in eclipse couldn't satisfactory answer. posting question again image , making myself more clear i trying import maven project in eclipse.. can 1 please help regarding aarons comment m2eclipse: check checkout projects option when checking out project (use checkout maven project svn repositories view): it simple, long root pom references modules.

Crossplatform iphone / Android 2D game engine -

i want write 2d game iphone , android. thing is, it's not typical arcade game more of app background services / push notifications / google maps interactions / contact list reading. there crossplatform engine let me use features without trapping me in framework ? game not cpu-intensive , doesn't require opengl ( it's more sprite , tweens based ). http://www.anscamobile.com/corona/ i haven't tried can take @ it.

java - AbstractMethodError on calling Exception.printStackTrace -

inside catch clause want print strack trace of exception: try { ... } catch (exception exc) { exc.printstacktrace(); ... } but in cases don't stack trace , instead see this: exception in thread "pool-1-thread-2" java.lang.abstractmethoderror: java.lang.exception.printstacktrace()v ... usually, exception should occur if library has not same version @ runtime @ compile time, in case work class java library. printstacktrace implemented in throwable, method can't abstract in exception or derived class. further, abstractmethoderror isn't thrown, there other exceptions @ specific catch clause (program flow depends on data file , current time, other stuff happens arrayindexoutofboundsexceptions or illegalstateexceptions thrown in own code , expect instead of strange error). so, question is: how possible particular abstractmethoderror occur? ps: using eclipse helios on linux , use jdk 1.6.0_24 runtime environment launch application. edit:...

java - Stateful EJB not being passivated when the client VM is abruptly terminated -

i have stateful session bean deployed on jboss 4.3 following config on jboss.xml: <cache-config> <idle-timeout-seconds>7200</idle-timeout-seconds> <remove-timeout-seconds>8000</remove-timeout-seconds> </cache-config> ie: the bean should passivated after 2 hours of idle , removed after 2 hours , 15 minutes. the problem is: when client vm abruptly terminated bean neither passivated nor removed. is there way avoid this? a container may passivate stateful session bean instance when instance not in transaction. a container must not passivate stateful session bean extended persistence context unless following conditions met: all entities in persistence context serializable. the entitymanager serializable. any interceptor classes associated stateful session bean must serializable. the references can possibly restrict bean getting passivated.

how does stack growing work on windows and linux? -

i read windows programs call _alloca on function entry grow stack if need more 4k on stack. guss every time guard page hit windows allocates new page stack, therefore _alloca accesses stack in 4k steps allocate space. i read applies windows. how linux (or other oses) solve problem if don't need _alloca ? linux relies on heavily optimized page fault handling, happens program pushes things on stack , page fault handler extend stack on fly.

java - converting string to string literal -

possible duplicate: how convert string java string literal? is there library function takes string , converts corresponding string literal? example: please say\ask "what?" 3 times! -> "please say\\ask \"what?\" 3 times!" i think commons lang stringutils that http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/stringescapeutils.html

geocode - google maps geocoder to return state -

i using google maps geocoder geocode zipcode , want return state zipcode located in , store in variable "local". getting error indicating local undefined. why? see code below: var address=document.getelementbyid("address").value; var radius=document.getelementbyid("radius").value; var latitude=40; var longitude=0; var local; geocoder.geocode( { 'address': address}, function(results, status){ if (status==google.maps.geocoderstatus.ok){ latlng=(results[0].geometry.location); latitude=latlng.lat(); longitude=latlng.lng(); //store state abbreviation in variable local local=results[0].address_components.types.adminstrative_area_level_1; } else{ alert("geocode not successful following reason: " + status); } }); i think issue address_components have more 1 component, , order isn't same zip codes. have iterate through results find correct one. <html xmlns="http://www.w3.org/1999/xhtml"> <script t...

.net - Are there any alternatives to Common.Logging? -

edit: common.logging 2.1.1 released on june 9, 2012 , github page active, author commenting on health of project . we're looking @ using common.logging in new .net project i'm bit concerned project seems have become inactive. homepage last updated in 2009 , latest version available on sourceforge created in 2010. i've found incompatibility nlog 2 , i'm concerned may become bigger problem on time. have noticed enterprise library 5.0 isn't listed being compatible i've not tried it. are there other alternatives provide similar common interface? i have been using common.logging 4 years, , i'm able use nlog2. answer question thoroughly, need take closer @ common.logging first. common.logging gives 2 benefits: since 1.x, common.logging let write application independent of logging framework. can change 1 logging framework without recompiling application. particular useful development of common library, may used various applications use diff...

c# - Reload SWF Object using Javascript (or JQuery) without re-loading whole page (after Ajax call) -

the onreadstatechanged event fires ok after c# page on server completes database update. asp.net page needs re-load embedded swf object without re-loading whole page. googling wondering if advise? okay, put swf on ajax panel. on onreadystatechange 4/200 post panel , re-load asmx creates config on demand db.

Can you extend the val() function in jQuery? -

is there way extend val() function in jquery. basically, want set class variable if there content being dynamically entered input. whick like var thisval = 'hello world'; $('#myinput').val(thisval).addclass('dark'); it nice tell val() function add class 'dark' input if there value, , remove if empty. possible? try $.fn.xval = function () { return this.toggleclass(arguments.length).val.apply(this, arguments); }; demo: http://jsfiddle.net/mattball/v9yfu/

c - How to initialize pointers properly -

i have following code calls function uint32_pack. program compiles no errors in dev-c++ not produce correct result when 'tag' number. in visual studio program compiles produces errors , i'm guessing these errors why don't correct output when 'tag' even. i'm still trying head around pointers , i'm not sure went wrong when declaring them. help. here code errors come from: 1 int uint32_pack (uint8_t *fieldnumber, uint32_t value, uint8_t *out); 2 int main(){ 3 uint32_t initvalue = 2; 4 int return_rv; 5 uint8_t *tag = (uint8_t *) malloc(sizeof(uint8_t)); 6 *tag = 38; 7 uint8_t *tempout= (uint8_t *) malloc(30); 8 return_rv = uint32_pack (tag, initvalue, tempout); 9 free(tempout); 10 free(tag); 11 } and errors vs follows: error c2143: syntax error : missing ';' before 'type' (on line 7) error c2065: 'tempout' : undeclared identifier (on line 8) warning c4047: 'function' : 'unsigned ch...

php - Remove duplicate values from Array -

i can not "remove" double values ​​from array if use function array_unique! <?php $tags_array = array() ; $query_tags = $mysql->query("select words kw users ") ; /**** * * query return array([1] => php,asp,net [2] => ruby,jquery,php,asp_net [3] => php,asp,visualbasic,c# [4] => [5] =>) * *****/ while($fetch_tags = $mysql->fetch($query_tags)) { foreach(explode(',',$fetch_tags['kw']) $kw => $value) { if(empty($value)) ; else { $value = ucwords(strtolower($value)) ; $tags_array[] = $value ; } } } $tags_array = array_values(array_unique($tags_array, sort_string)) ; print_r($tags_array) ; /****** * * print_r show somethings array([1] => asp [2] => php [3] => php [4] => ruby [5] => jquery [6] => php [7] => asp_net [8] = >c# [9] => asp) * * it's e...

FAST For SharePoint Web Crawler Meta Tag Extraction -

i using fast sharepoint crawl non shareppoint website. website crawled no error, can results of keyword. i want create refiner on result page html page meta tags. there must 2 level refiner; category , sub category. if user clicks category, refiner panel must show related sub categories. the meta tags this: <meta name="category" content="products"/> <meta name="subcategory" content="electronic"/> how can extract meta tags crawled html page(s) fast sharepoint webcrawler? i tried add meta tag names fast search administration > managed properties , configured refiner panel meta tags, not result. not work. thank you! if want use custom managed property, need first bind them crawled property. crawled properties created automatically during crawl, or can create them in powershell, see following link: http://msdn.microsoft.com/en-us/subscriptions/ff393776(v=office.14).aspx if understand well, trying getting inf...