Posts

Showing posts from July, 2010

css - Remove Gaps Between Links In Unordered List -

this has ridiculously simple, i'm not seeing it, , appreciate bit of advice. i applied css make different images appear when mouse hovers on different links. 1 of images there default, being part of background jpg image. other images appear when mouse hovers on corresponding link. problem: when slide cursor left , right along row of links, or top , bottom vertically, there gaps between links, approximately 4px or so. when cursor on gap, links ineffective, no image appears on top, , background image revealed, creating sort of flicker. question: how can remove gaps between links, keeping background image visible when cursor hovers on link, else? thank in advance! the reason of little gap because if have line break or multiple spaces between 2 elements, browser collapse 1 space. space seeing. what need following (i know markup looks ugly): <div id="hero-links-container"> <ul> <li> <a href="" id="hero...

.net - C# projects: objects cross-usage -

have 2 projects: myserver & myclient in 1 solution. want use object of message class in both projects (messageserver & messageclient respectively). added reference of client server project, cannot opposite because error "...would cause circular dependency" . have using testmyclient; namespace testmyserver { public class messageserver { on server side , use in code = new xmlserializer(typeof(testmyclient.messageclient)); i want have same, on client side. sadly cannot input testmyserver using namespace , cannot reference messageserver class... how cross-use these classes ? your question isn't clear - it's not obvious why you'd want have 2 different types @ - answer have one type in namespace both server , client projects refer to. server client \ / \ / common no circular dependencies, one shared type, everyone's happy. if need 2 message types (one requests , 1 responses, example) defi...

jquery - FadeIn WITHOUT .hide() function? -

i want make fadein effect don't want hide because screws margins when object literally hidden document. need ideally animate opacity 0, i'm having trouble getting work. ideas? thanks! $(document).ready(function(){ $("#item").css("opacity", 0).delay(13000).fadein(2000); }); as using opacity , should use fadeto method instead of fadein . $("#item").css("opacity", 0).delay(13000).fadeto(2000, 1);

php - Table formatting for xml returned via CURL from API -

i using company's api retrieve information database, being returned me in xml format. i'm trying accomplish 2 things - having couple issues. 1st format raw xml data table format, easier view via browser. 2nd data receiving ids/usernames/passwords/emails. able import data db each userid row inserted db (i can db work, can't figure out how process each user individually ) the api formatting <api> <message> <user> <id> </id> <login> </login> <password> </password> <message> </message> </api> there hundreds of user's instead of one. whenever print of $array, data big blob intended. however, when use updated code, (below) receive error user not valid index. receive looks start of table, without data in (only borders). if me figure out why table not receiving data (or give me advice on better way it) appreciate it. extra points can me figure out number two. error notice: undefined ind...

Django create custom form renderer like .as_ul or .as_p -

i know there questions how custom form renderer django, , know 1 of best ways creating form_snippet template things need. but problem want back-end side, need create custom form renderer wich can {{ form.as_bootstrap }} in template. someone knows way it? you create method as_bootstrap in form, highly recommend own templatetag . in other side, question open, have tried? please extends question, otherwis, comunity close it.

How to set class weights for OneVsRestClassifier in scikit-learn? -

i need svm working multilabel classifier, decided use onevsrestclassifier wrapper. problem arises training set becomes highly unbalanced: given class there more negative examples positive. solved class_weight parameter, if use in classifier wrapped in onevsrestclassifier, error: from sklearn.svm import linearsvc sklearn.multiclass import onevsrestclassifier weights = {'ham': 1, 'eggs': 2} svm = onevsrestclassifier(linearsvc(class_weight=weights)) x = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 0]] y = [['ham'], [], ['eggs', 'spam'], ['spam'], ['eggs']] svm.fit(x, y) traceback (most recent call last): file "", line 1, in file "/usr/local/lib/python2.7/site-packages/sklearn/multiclass.py", line 197, in fit n_jobs=self.n_jobs) file "/usr/local/lib/python2.7/site-packages/sklearn/multiclass.py", line 87, in fit_ovr in range(y.shape[1])) file "/usr/local/lib/python2.7/site-package...

svn - composer removes diectories in web/bundles -

i'm new symfony2 , composer. manage project code in svn, either committing framework code svn or using linked repositories. understand symfony bundles use git revision control. i'm having odd issue happening when installing new bundles composer. example install fosuserbundle, add composer.json: "friendsofsymfony/user-bundle": "*" then run php composer.phar update friendsofsymfony/user-bundle this works fine, removes folders web/bundles, example ~ web/bundles/framework ~ web/bundles/sensiodistribution is configuration problem in composer or sort of incompatibility svn? it normal these folders regenerated during update. part of post-update/-install scripts. the recommended .gitignore-file contains web/bundles, guess should add folder .svnignore well. alternatively yould remove post post-update/-install hooks composer.json. since assets copied bundles resources/public/ web/ folder in order them accessible, have alias the...

actionscript 3 - How do you detect multiple objects going offscreen? -

i making game in as3, , want have "health bar". when 1 of "alien" objects hits earth, health go down. not know how make stage register object gone offscreen, or "hit ground". great! var aliens = [new alien(), new alien(), new alien()]; var health = 10; // check position of aliens on each frame this.addeventlistener(event.enter_frame, enterframehandler); function enterframehandler(event:event):void { (var i:int = 0; < aliens.length; ++) { // if alien's y position equal or greater // stage height, he's hit deck if (aliens[i].y <= this.stage.stageheight) { health --; } } }

web services - Could not retrieve the WSDL file error using Rational Application Developer -

i'm trying generate web service open source wsdl file hosted on 52north: https://svn.52north.org/svn/swe/main/sos/georefimagesos/trunk/52nsos-t/src/org/n52/sos_t/sos.wsdl i created dynamic web project , import wsdl file. when use web service tool generate client, "operation timed out - not retrieve wsdl file" error occurred. suspect it's import takes long load schema. could 1 try generate web service above wsdl file? or maybe provide suggestion on how set parameters? thank much, william download wsdl local machine, , use wsdl2java command generate stub.

ios - Why is my app crashing on iPhone 4S because of Core Data request execute? -

Image
i have app works fine on simulator 6.1, works fine on iphone5 , ipad3 on ios6.1 when run on iphone4s crashes in method exc bad access: -(void)parseplistintocd{ self.managedobjectcontext = [[sdcoredatacontroller sharedinstance] backgroundmanagedobjectcontext]; // 3: put plistdictionary cd...create managedobjectcontext nsmanagedobjectcontext *context = self.managedobjectcontext; nserror *error; //create request & set entity request nsfetchrequest *holidayrequest = [[nsfetchrequest alloc] init]; nsentitydescription *topicentitydescription = [nsentitydescription entityforname:@"holiday" inmanagedobjectcontext:context]; [holidayrequest setentity:topicentitydescription]; //create new nsmanagedobject //holiday *holidayobjecttoseed = nil; holiday *newholiday = nil; //execute fetch make sure? nsarray *holidayfetchedarray = [context executefetchrequest:holidayrequest error:&error]; **if (error) nslog(@"error e...

android - JAR register BroadcastReceiver -

my broadcastreceiver class name net.push.myreceiver and mainfest in jar: <receiver android:name="net.push.myreceiver" > <intent-filter> <action android:name="myreceiver_action" /> </intent-filter> </receiver> and register broadcastreceiver,receiver can not receive broadcast. if change mainfest below: <receiver android:name="net.push.myreceiver" > <intent-filter> <action android:name="myreceiver_action" /> </intent-filter> </receiver> then can receive broadcast. i wonder how can receive broadcast while register mainfest in jar. androidmanifest.xml specified application not jar. so, if want receiver work, need put declaration in application manifest should located in root of application project folder. every application must have androidmanifest.xml file (with ...

Kivy-Python with a database -

i want build app kivy/python, don't know how connection between kivy , mysql. python? sorry, if question inappropriate. it's regular python. kivy framework building user interfaces. it's how interact database in app. consider using mvc model, have nice separation of logic. think using sqlalchemy database abstraction layer. hope helps.

How to inherit from the Grids class in Delphi 7? -

here's class inherit tstringgrid class. want create grid populated data database. simple class stub: unit clstcustomstringgrid; interface uses grids, dialogs; type tcustomstringgrid = class (tstringgrid) public procedure sayhello (); end; implementation procedure tcustomstringgrid.sayhello (); begin showmessage('hello world!'); // procedure body end; end. this have in main form: uses ... ... tcustomstringgrid; // here compilation stops ... ... ... procedure tmyform.formshow (sender: tobject); var mysg: tcustomstringgrid; begin mysg := tcustomstringgrid.create(self); mysg.left := 100; mysg.top := 40; mysg.parent := self; mysg.sayhello(); end; the error get: file not found: 'tcustomstringgrid.dcu' please, me figure out doing wrong. your class declared in unit clstcustomstri...

javascript - How do I update each dependency in package.json to the latest version? -

i copied package.json project , want bump of dependencies latest versions since fresh project , don't mind fixing if breaks. what's easiest way this? the best way know of run npm info express version update package.json manually each one. there must better way. { "name": "myproject", "description": "my node project", "version": "1.0.0", "engines": { "node": "0.8.4", "npm": "1.1.65" }, "private": true, "dependencies": { "express": "~3.0.3", // how these bumped latest? "mongodb": "~1.2.5", "underscore": "~1.4.2", "rjs": "~2.9.0", "jade": "~0.27.2", "async": "~0.1.22" } } i collaborator on npm-check-updates , great solution problem. i have been actively maintaining npm-...

ios - Code working on iPhone 5, not on iPod touch 4 -

i'm testing application on different devices. app works fine on iphone 5, however, when test on ipod touch 4g, eror: *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '*** [__nsarrayminsertobject:atindex:]: object cannot nil' *** first throw call stack: (0x33f252a3 0x3bba397f 0x33e6f8d9 0x51e25 0x35e180c5 0x35e1814d 0x35e180c5 0x35e18077 0x35e18055 0x35e1790b 0x35e17e01 0x35d405f1 0x35d2d801 0x35d2d11b 0x37a1f5a3 0x37a1f1d3 0x33efa173 0x33efa117 0x33ef8f99 0x33e6bebd 0x33e6bd49 0x37a1e2eb 0x35d81301 0x4fc8d 0x3bfdab20) libc++abi.dylib: terminate called throwing exception the code that's crashing one: /********/ nsmutablearray *tituloscampotextarray = [[nsmutablearray alloc] init]; (int = 0; < campos.count; i++) { signupcell *cell = (signupcell*)[self.tableview cellforrowatindexpath:[nsindexpath indexpathforrow:i insection:0]]; [tituloscampotextarray addobject:cell.textfield.text]; } /*****...

android - onPageSelected doesn't work for first page -

my pager adapter ( extends pageradepter ) has textview in it. , update textview mainactivity's onpageselected . update textview position > 0 , start page (position 0) doesn't update on startup. when swipe forward swipe back; sets value position 0 couldnt set value on start. how can set value star page ? public void onpageselected(int position) { switch (position) { case 0: pageradapter.tv.settext("value"); // => doesnt work on start break; default: pageradapter.tv.settext("value"); break; } } full code: public class quizstart extends slidingfragmentactivity { @override protected void oncreate(final bundle savedinstancestate) { super.oncreate(savedinstancestate); this.setcontentview(r.layout.activity_main); mpager = (vie...

winforms - DataBind in C# - selectedvalue of ComboBox to Object property of a class -

i'm facing problem databinding in c# windows form project. used .net framework 4 client profile. , ide visual studio 2010 express edition c#. have class below. public myclass() { name = string.empty; datatype = datatypes.bool; //property enum created me islist = false; filtervalue = new object(); } then have profile.csv file. in 1 of form, have combobox , datasource datatable include data csv file. private void form_load() { combobox combobox = new combobox(); this.controls.add(combobox); combobox.name = attribute.name.replace(" ", string.empty); combobox.displaymember = attribute.name; combobox.datasource = attributevaluedatasource.tables[tablename].defaultview; combobox.selectedindex = 0; } then data binding on combo box class. data binding in method different above , combo box created dynamically, found combo box it's name in below method. private void method_1 { control = this.controls.find(attrname, tru...

android - Out of memory exception on SQLite database operation -

i have custom listview each list item has 5 entries , these entries come sqlite database. there such 8 list-items in listview. code custom adapter is: public class vaccinlistadapter extends baseadapter { private context context; private list<vaccininfopojo> vaccininfo; public vaccinlistadapter(context c,list<vaccininfopojo> list) { context=c; vaccininfo=list; } @override public int getcount() { return vaccininfo.size(); } @override public object getitem(int pos) { return vaccininfo.get(pos); } @override public long getitemid(int i) { return i; } @override public view getview(int position, view convertview, viewgroup viewgroup) { viewholder holder; vaccininfopojo entry=vaccininfo.get(position); if (convertview == null) { ...

Python Tkinter button callback -

i trying print out button number when click each buttons created loop. following have tried. import tkinter tk root=tk.tk() def myfunction(a): print in range(10): tk.button(root,text='button'+str(i),command=lambda:myfunction(i)).place(x=10,y=(10+(25*i))) root.mainloop() but instead of printing out each button number, giving me last button number everytime. there can when click button 1, print 1,2 2 ,and on? blender's answer clever solution in case thrown off function abstraction, here possible way it. creates mapping, saved in buttons , button widgets proper numbers. import tkinter tk root = tk.tk() def myfunction(event): print buttons[event.widget] buttons = {} in range(10): b = tk.button(root, text='button' + str(i)) buttons[b] = # save button, index key-value pair b.bind("<button-1>", myfunction) b.place(x=10,y=(10+(25*i))) root.mainloop()

Configuring Neo4j on Rails to Deploy with Warbler -

how configure neo4j on rails app deploy warbler? stands, every time deploy app, previous production instance of neo4j gets destroyed, because neo4j embedded. hoping there kind of configuration production, either through warbler or through neo4j, once neo4j instance created on server not replaced next deployment. i guess place neo4j database somewhere persistent outside volatile codebase , open neo4j against e.g. /var/database ? in case there existing files, neo4j not replace them.

Convert code from Google Map Android API v1 to Google Map Android API v2? -

this code google map android api v1 . don't know convert api v2 . me, please! flatback.java public class flatback extends mapactivity { private mapview mapview; private mylocationoverlay mylocationoverlay; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.map); mapview = (mapview) findviewbyid(r.id.mapview); mapview.setbuiltinzoomcontrols(true); mylocationoverlay = new fixlocation(this, mapview); mapview.getoverlays().add(mylocationoverlay); mapview.postinvalidate(); zoomtomylocation(); } @override public boolean oncreateoptionsmenu(menu menu) { menuinflater inflater = getmenuinflater(); inflater.inflate(r.menu.map_toggle, menu); return true; } public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { case r.id.map: if (mapview.issatellite() == true) { mapview.setsatellite(false); mapview.s...

Processing multiple files in Python, and matching on fields -

i have number of csv files need compare 1 'master list', , determine, based on unique id, if these other files contain entries key. what easiest way in python be? i.e kind of structures suggest read data into, , how suggest iterate through it? here example of data , output looking for. **master list** unique id : file name : file version : responsible party j578221 : expander : 1.23 : joe bloggs kk89821 : top : 0.9 : mike smith **location x** region : file name : unique id usa : acme expander : j578221 usa : acme tail : mk33431 **location z** reqion : file name : unique id : date added china : expander : j578221 : 03-04-2012 hk : acme top : kk89821 : 06-07-2012 **output:** unique id : file name : file version : responsible party : in location x : in location z j578221 : expander : 1.23 : joe bloggs : yes : yes kk89821 : top : 0.9 : mike smith : no : yes the easiest way might using regular expressions ( see documentation here ) retrieve key of ...

add on - Implemet ICEPush 0.5.5 in Vaadin 7 -

i trying add icepush add-on vaadin 7 project. but, couldn't find correct way implement it. i added web.xml file. <servlet> <servlet-name>icepush portlets</servlet-name> <servlet-class>org.vaadin.artur.icepush.icepushservlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>icepush portlets</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> the class org.vaadin.artur.icepush.icepushservlet seems unavailable. changed org.icepush.servlet.icepushservlet . i use vaadin 7.0.4 , icepush 0.5.5. can guide me how implement icepush in vaadin 7. have add maven/ivy dependency , repository? maven: <dependency> <groupid>org.vaadin.addons</groupid> <artifactid>icepush</artifactid> <version>0.5.5</version> </dependency> <repository> <id>vaad...

Canvas-lms update rails 2.3.5 to 3.2.12 -

i going work on open source canvas-lms. using rails 2.3.5 familar rails 3.2.12. how upgrade rails 2.3.5 rails 3.2.12. what challenges. what best way it. include in gemfile: gem 'rails', '3.2.12' then run command bundle update rails i think best way it.

Android Tab Help. How to set 2nd tab as default when app opens? -

i have created app 3 tabs. app works fine want 2nd tab selected , loaded when app opens. how can set that? here code : public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); tabhost tabhost = gettabhost(); // tab home tabspec homespec = tabhost.newtabspec("home"); // setting title , icon tab homespec.setindicator("home",getresources().getdrawable(r.drawable.icons_home_tab)); intent photosintent = new intent(this, homeactivity.class); homespec.setcontent(photosintent); // tab child tabspec childspec = tabhost.newtabspec("child"); childspec.setindicator("child",getresources().getdrawable(r.drawable.icons_child_tab)); intent homeintent = new intent(this, childactivity.class); childspec.setcontent(homeintent); // tab account tabspec accspec = tabhos...

jquery - Lightbox not working after new images load -

initialize lightbox: <script type="text/javascript" src="<?=site_template_path?>/js/slimbox2.js"></script> i have static images on page: <a class="itogdetimg" href="" rel="lightbox" title=""> <img width="83px" src="/img.png" border="0"/> </a> and have link id="knav1" on click load new images jquery script: $("#knav1").click(function(){ $("#navldesc").load('/api.php?nvl=y&komplektn=Комплит2'); }); links type same above, lightbox them no longer works. think because of not have them on page. how can fix problem? for slimbox2 should work: $("#knav1").click(function(){ $("#navldesc").load('/api.php?nvl=y&komplektn=Комплит2',function() { $("#navldesc").find("[rel='lightbox']").slimbox(/*if have custom option...

java - is there is any configuration tool for active MQ? -

instead of manually changing xml configuration of active mq server (i.e, port number, queue & topics, user name, password, groups, jetty server credientials etc..) there gui tool avail make changes easily? thanks in advance.... there web based administration tool integrated activemq binary distribution: http://activemq.apache.org/web-console.html

c++ - Error: Initial value of reference to non-const must be an lvalue -

getting error string class. intellisense not let me use strcmp compare object self-invoking object (i.e. *this). i tried making own operator conversion function this, still giving me error. what have change in code make work?? //overloaded comparison operators bool &string::operator<(const string & obj) { return strcmp(*this, obj) < 0 ? true : false; } //operator conversion function string::operator char const * () const { return mstr; } you returning reference local variable. return value. can simplify return expression, , make method const , since comparing 2 objects should not change either of them: bool string::operator<(const string & obj) const { return strcmp(*this, obj) < 0; } although not sure strcmp can deal 2 string s, passing it. judgning previous question, need return strcmp(mstr, obj.mstr) < 0;

vba - Insert values from two different tables into another different table with concatenate -

i have button uses 2 separate queries pull data 2 tables , insert table: dim lngid long dim lngidcallout long dim strsql1 string lngid = calloutattendance_multiselect.value lngidcallout = forms![callouts].[calloutid].value strsql1 = "insert members_callouts(memberid) select memberid members memberid=" & lngid strsql2 = "insert members_callouts(calloutid) select calloutid callouts calloutid=" & lngidcallout currentdb.execute strsql1 currentdb.execute strsql2 calloutattendance_multiselect.requery and whilst want do, inserts the 2 values 2 separate new records, whereas i'd insert 1 new record. i've had go, either syntax errors, or in case below, got 3067 runtime error "query input must contain @ least 1 table or query" strsql1 = "insert members_callouts(memberid, calloutid) select (select memberid members memberid=" & lngid & "), (select calloutid callouts calloutid=" & lngid...

Simple SELECT mysql query very slow (using intersect) -

a query used work fine on production server has started becoming extremely slow (in matter of hours). this it: select * news_articles published = '1' , news_category_id = '4' order date_edited desc limit 1; this takes 20-30 seconds execute (the table has ~200.000 rows) this output of explain : +----+-------------+---------------+-------------+----------------------------+----------------------------+---------+------+------+--------------------------------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | | +----+-------------+---------------+-------------+----------------------------+----------------------------+---------+------+------+--------------------------------------------------------------------------+ | 1 | simple | news_articles | index_merge | news...

android - Sparse array as single choice ListView -

i have following data retrieved server: [ {id: 8, name: "item1"}, {id: 14, name: "item2"}, {id: 30, name: "item3", active: true}, {id: 42, name: "item4"} ] i want put data single choice listview (in dialog, using setsinglechoiceitems() ) , after user makes choice, send item id server. how that? solution figured out use helper array keeps mapping between list items (which afaik has go in sequence) , item ids (which pretty random). tried using adapters, didn't figure out how. make own custom listview , override getview show whatever want in each row. need viewholder class extract custom row list views have made. have @ this: single choice listview custom row layout

c# - How do i disable a tab, so that the user cannot change to it? -

Image
i want make quiz, goes through questions, keeping in mind while question 1 being used, others disabled. once next button clicked should change directly q2, disabling q1 , on. how make disable previous tab , keep current 1 enabled after next button clicked? a tab can accessed index, so: tabcontrol.tabpages[0] so, you're starting on tab 1 (index = 0), want disable other tabs. // can done manually in designer well. foreach(tabpage tab in tabcontrol.tabpages) { tab.enabled = false; } (tabcontrol.tabpages[0] tabpage).enabled = true; now, when press next button, want disable current tab, enable next one, , go next one. remember check if tab exists! if(tabcontrol.tabcount - 1 == tabcontrol.selectedindex) return; // no more tabs show! tabcontrol.selectedtab.enabled = false; var nexttab = tabcontrol.tabpages[tabcontrol.selectedindex+1] tabpage; nexttab.enabled = true; tabcontrol.selectedtab = nexttab; disclaimer: not tested, should along these lines. y...

c# - Using Sql data after binding to repeater -

i wish use data database after binding query repeater. i'm not sure how supposted this. here code: sqlconnection conn = new sqlconnection(configurationmanager.connectionstrings["connectionstring"].tostring()); sqlcommand cmd = new sqlcommand("select * kontakt", conn); conn.open(); sqldatareader reader = cmd.executereader(); repeater_beskeder.datasource = reader; repeater_beskeder.databind(); foreach (repeateritem row in repeater_beskeder.items) { if (reader.read()) { panel vis_panel = (panel)row.findcontrol("panel_vis_besked"); if (request.querystring["id"].tostring() == reader["id"]) { vis_panel.visible = true; } } } conn.close(); my reader wont work it's allready been binded repeater, i'm quite lost. hope of have solution problem. itemdatabound event occurs after item in repeater control data-bound before ...

dojox.grid.datagrid - Dojo data grid row color change when a cell gets edited -

i need change color of rows in dojo data grid whenever editing. tried dojo.connect , works first time after whenever hover on other cells automatically changing colors of other row. does know solution issue? you need following 1)css changes .yellowishrow .dojoxgridcell { background-color: #f3f781; } in javascript dojo.connect(dijit.byid("grid"),"onstylerow",this,function(row){ var item = dijit.byid("grid").getitem(row.index); if (item) { var type = store.getvalue(item, editmode, null); if (type == "1") { row.customclasses += ' regstartedrow'; } dijit.byid("grid").focus.stylerow(row); dijit.byid("grid").edit.stylerow(row); });

mysql - Sorting result with absolute placement -

http://sqlfiddle.com/#!2/1840d/1 i have table of ids , places, possible rows set @ specified places? to get id place 5 (null) 3 2 4 (null) 6 4 2 (null) 1 (null) instead of id place 6 4 5 (null) 4 (null) 3 2 2 (null) 1 (null) for data means have row place = 2 second row in result , row place = 4 fourth in result, while other rows cover them in original order. answer select * records order field(id, 5,3,4,6,2,1) is nice , funny, wrong. select case when nullid null id else nullid end id, tofilltable.place ( select case when id null @placeholder := @placeholder + 1 else null end placeholder , r.* ( select @row := @row + 1 row records t1, (select @row := 0) t2 ) s inner join (select @placeholder := 0) t12 left outer join records r on s.row = r.place order row ) tofilltable left outer join ...

Which Visual Studio project type to choose for windows 8 app not running in full-screen -

i have idea windows 8 application want develop using vs2012 express windows 8. application have simple ui , interaction minimal. app have kind of "widget" appearance, don't know if can accomplished windows 8 app or need type of project. question if can done in vs2012 express windows 8 simple blank app project type?

How to make icons and images for Android app? -

i think might not trouble iphone app since screen size sort of same. but android has many devices different screen size. how images fit different screen sizes? i mean, app have stock same icon many versions different width , height install different screen-size smart phone. or, ( don't think ) images , icons scaled propotionally on phone suit looking on phone? this has been documented thoroughly in android developers icon design guidelines. different density devices load assets different folders if available. res/... drawable-ldpi/... finished_asset.png drawable-mdpi/... finished_asset.png drawable-hdpi/... finished_asset.png drawable-xhdpi/... finished_asset.png you should use mdpi baseline. ldpi = 120 dpi (low density screen) mdpi = 160 dpi (medium density screen) hdpi = 240 dpi (high density screen) xhdpi = 320 dpi (extra-high density screen) ldpi mdpi hdpi ...

mysql - Many JOINs in a long SQL call -

there 4 tables, each tuple id(int),name(varchar) (the id autoincrementing). there table meal (cheeseburger, hamburger, meat feast, blt, tomato soup), class (burger, pizza, sandwich, soup), characteristics (spicy, vegtarian, gluten free), , sides(salad, fries, bread). three more tables exist make tuples meal.id,class.id , meal.id,characteristics.id , meal.id,sides.id meal can in more 1 class, have more 1 characteristic, , come more 1 side, , vice versa. i had following lazy loading fine, know that's not good. want name of meal, it's characteristics, sides , alternative meals same class. this call worked fine: select group_concat(distinct m2.meal_name separator ',') alternates, group_concat(distinct c.characteristic_desc separator ',') characteristics meal m inner join mealclass mc on m.meal_id = mc.meal_id left join (select meal_id, class_id drugingred...

php - Order list by specific value within in list item -

i order unordered list specific value inside list items. generate list loop. my looped list item looks this. value <?php echo $nyslutdatum; ?> 1 wish list ordered (displayed twice because 2 cases of loop conditions) <li> <div id="kursprogram-kurstillfalle-kurs"> <?php the_title(); ?> </div> <div id="kursprogram-kurstillfalle-ort"> <?php the_sub_field('ort'); ?> </div> <div id="kursprogram-kurstillfalle-datum"> <?php if(get_sub_field('startdatum') != '') { ?> <?php echo $nystartdatum; ?> - <?php echo $nyslutdatum; ?> <?php } else { ?> <?php echo $nyslutdatum; ?> <?php } ?> <?php if(get_sub_field('slutdatum_2') != '') { ?> <br /> <?php echo $nystartdatum_2; ?> - <?php echo $nys...

AngularJS: Link with hash gets urlencoded -

i have link http://localhost:8000/#?4047=27.20#4047 if paste in , reload page, works fine. if make link like <a href="{{ location.$$absurl }}" target="_blank">same</a> it works fine. if paste link email or notes software, link looks fine. but, when click it, gets urlencoded , fails with http://localhost:8000/#?4047=27.20%234047 so, $location.hash() empty. i'm working chrome. safari similar worse. paste in http://localhost/#/?9189=668.00&7010=128.00#7010,9189 , gets changed http://localhost/#/?9189=668.00&7010=128.00%237010,9189 , app breaks. firefox seems not encode # , handle how wanted. hrm. i prefer put somewhere in configuration, maybe. but, purposes, can "correct" url, if needed, on in controller. // aint nobody got time fo dat $location.url($location.url().replace('%23', '#'));

c# - custom conversion from T to a MultilingualValue<T> in JSON.Net -

i have lot of entities used have properties of type example string . need change these custom type - multilingualvalue<t> , t in case string . can convert string custom type. possible configure json.net such everywhere encounters conversion type, multilingualvalue<t> , custom code called rather it's native conversion? sample code public class productbefore { public int id { get; set; } public string name { get; set; } } public class productafter { public int id { get; set; } public multilingualvalue<string> name { get; set; } } i able deserialize stored productbefore , productafter automatically. multilingualvalue<string> can initialised string parameter in constructor, it's relatively easy create original string . it possible through adding custom converter . these can added per below: private void createjsonserializer() { jsonserializersettings settingsserialize = new jsonserializersettings...

security - Kerberos on Hadoop -

i have apache hadoop (1.0.4) cluster running. i'm trying implement security on cluster adding kerberos it. have kerberos kdc running independently. there sort of documentation can use link two? you can refer cdh4 security guide detailed steps.

java - how to split the string and store it in array -

i have tried following example gives following out put output[] . have pass string "1.0" function calculatepayout() , want store 1 in s[0] , 0 in s[1] import java.util.arrays; public class aps { public void calculatepayout(string amount) { string[] s = amount.split("."); system.out.println("output"+arrays.tostring(s)); } public static void main(string args[]) { new aps().calculatepayout("1.0"); } } method split() accepts regular expression. character . in regular expressions means "everything". split string . have escape it, i.e. split("\\.") . second slash needed because first 1 escapes dot regular expression, second escapes slash java compiler.

java - Why doesn't my program call my methods? -

java methods statithing can't seem while statement on line 56 call methods properly. there i'm doing wrong? new java sort of appreciated! in advance! here code: import java.util.*; import javax.swing.*; import java.io.*; public class gradecalculator { static string fileinput; static double totalgrade; static int scorecount= 0; static double classaverage; static double score; static double testscore; static double averagescore; static int numberofstudents = 0; static char lettergrade; static string fileoutput; static string nameofstudent; static int numbercount; static int numbercalculatedstudents; static double average = 0; public static void main (string[] args) throws filenotfoundexception { //welcome joptionpane.showmessagedialog(null,"welcome grade calculator! program will\n" + " calculate average percentage of 5 test scores tha...

JSF MySQL Enum type -

i have mysql database table, in table have enum column looks this: enum('mmol/l','pmol/l','g/l','mmol/mol','cm','kg','st','l','mg/l','mg/mmol', 'micromol/l','ml/min','poäng','%','mm hg','jdf enheter','ak-index') i have textfield there user write in 1 of values above , can insert , take out data column out problem if user write string right. but it's no guarantee user know enum values can write in field, anyway take out enum values can write database, or need hardcode it?

Rails how to serve .pde asset files -

i have in .html file: <%= javascript_include_tag "processing-1.4.1.min" %> <canvas data-processing-sources="/assets/pjs/my.pde"></canvas> and asset lies there: app/assets/pjs/my.pde . i error in server: served asset /pjs/my.pde - 404 not found (10ms) and error in javascript: uncaught processing.js: unable load pjs sketch files: /assets/pjs/my.pde ==> invalid xhr status 404 my application.rb says: config.assets.enabled = true might stupid mistake don't it. i'd appreciate if can tell me how solve this. use erb extension view file, use asset_path 'my.pde' . when using asset pipeline can't link directly path because files have fingerprints added them.

class - Regarding classes in python -

i have basic question python classes. access class member defined in 1 python file across different files. here code: i have 1 python file class_a.py : class a: def hello(self): self.a=12 print "printing value class_1",self.a here code of class_b.py file import class_a def func_b(): instance = class_a.a() instance.hello() func_b() when execute, shows: typeerror: hello() takes no arguments (1 given). basically i'm trying accessing class members defined in class_a.py creating instance class inside function func_b defined in python file class_b.py . right? i think problem indentation in class a : class a: def hello(self): self.a = 12 print "printing value class_1", self.a aside: take pep8 style guide.

spring mvc - Java Reflection - How to exclude interface when loading the class dynamically -

i use spring framework find class , methods , arguments dynamically. these methods use : public list<class> findmytypes(string basepackage) throws ioexception, classnotfoundexception { resourcepatternresolver resourcepatternresolver = new pathmatchingresourcepatternresolver(); metadatareaderfactory metadatareaderfactory = new cachingmetadatareaderfactory(resourcepatternresolver); list<class> candidates = new arraylist<class>(); string packagesearchpath = resourcepatternresolver.classpath_all_url_prefix + resolvebasepackage(basepackage) + "/" + "**/*.class"; resource[] resources = resourcepatternresolver.getresources(packagesearchpath); (resource resource : resources) { if (resource.isreadable()) { metadatareader metadatareader = metadatareaderfactory.getmetadatareader(resource); if (iscandidate(metadatareader))...

c# - MethodInvoker lost? -

this code: private void taskgestionecartelle() { task.factory.startnew(() => generalistacartelle()) .continuewith(t => generalistacartellecompletata() , cancellationtoken.none , taskcontinuationoptions.none , taskscheduler.fromcurrentsynchronizationcontext()); } private void generalistacartelle() { // ... code } private void generalistacartellecompletata() { task.factory.startnew(() => copiacartelle()) .continuewith(t => copiacartellecompletato() , cancellationtoken.none , taskcontinuationoptions.none , taskscheduler.fromcurrentsynchronizationcontext()); } private void copiacartelle() { if (txtlog.invokerequired) { txtlog.begininvoke(new methodinvoker(delegate { txtlog.appendtext("copio cartelle in corso..." + environment.newline); })); } } it start thread. when finish, start thread (from continue with) , try write somethings in control on ui. in fact nothing...

c# - After fileStream.CopyTo(memoryStream), memoryStream is null -

so, have function, gets bitmapimage , need save iso storage , convert base64 (for sending server). however, copying filestream memorystream not successful. public void setimage(bitmapimage bitmap) { if (isofiles.fileexists(settings.file_avatar_jpg)) isofiles.deletefile(settings.file_avatar_jpg); var filestream = isofiles.createfile(settings.file_avatar_jpg); var wb = new writeablebitmap(bitmap); wb.savejpeg(filestream, 120, 120, 0, 85); // file saved var memorystream = new memorystream(); filestream.copyto(memorystream); // here, memorystream null byte[] result = memorystream.toarray(); filestream.close(); var base64 = convert.tobase64string(result); } stream.copyto copies current position of filestream has been changed savejpeg() need reset it; var memorystream = new memorystream(); filestream.position = 0; filestream.copyto(memorystream);

Vaadin 6 : Window.open(FileResource) ; how do I monitor download? -

i building portlet using vaadin 6. in portlet let end user download result of searches/operations he's done. doing here generate, on fly, zip file download , serve download using getmainwindow().open(resource); where resource fileresource. since search quite complex, have little chance able reuse results and, in order make things nice,i delete zip file server once it's been "consumed" download process. is there chance can monitor somehow when download has been completed ? tia if concern keeping server clean, should enough use tmp-dir of machine. way, os handles deletion you. or write own clean process either cron or sheduler/timer services.

javascript - What is the difference between writing jquery.fn.colorbox and jQuery.colorbox -

when write jquery.fn.colorbox() gives me same results jquery.colorbox(); want understand significance of fn in jquery. last time looked, fn alias prototype in jquery. take @ this stackexchange answer , may give clarity.

c# - How to concatenate two strings in a <img> src tag? -

here want concatenate 2 strings inside <img> tag. how this?? <img src=" "/partners" + @item.adpath" alt="" id="adimg" title="@item.adname" width:"50px" height="50px"/> any suggestion? you should able this: <img src="/partners+@(item.adpath)" alt="" id="adimg" title="@item.adname" width:"50px" height="50px"/> the razor engine replace @item.adpath actual value, giving src="/partners+[value]" . since razor expression thing that's parsed, don't have try , work string concatenation logic tag - drop in razor expression want value appear. edit: or, if don't want plus sign (not clear comments): <img src="/partners@(item.adpath)" alt="" id="adimg" title="@item.adname" width:"50px" height="50px"/> alternatively, try string...

html - JavaScript Change default button prob with firefox -

following problem: i have list buttons, , after textbox button add new entry. in both, list buttons, , add button javascript routines confirm action. now have problem, that, when user presses enter in textbox, first button if list invoked instead of add button. have added javascript in "onkeydown" event of button, use "return false;" avoid first button invoked after have checked return button pressed. works following line: onkeydown="if (event.which == 13) { return false; }" add javascript code before "return false;" (i need confirm message there , other javascript routines), firefox browser invoke first button , javascript code in onkeydown event... behavior not seem occur on internet explorer. i have tried hours find solution, can't find 1 , can't find right hint on internet. glad if me on problem? i have tried build code sample, can reproduce wrong behavior. in last input control have added onkeydown event. please tell ...