Posts

Showing posts from January, 2013

user interface - Is there a mature GUI library for D2 which does not rely on any DLLs (for windows only) -

i have small firmware update program written in d works great command line give gui. need progress bar, few dialogs , status bar. deployed on windows (xp current) , have few dependencies possible. there gui library considered ready production code can statically linked 1 small exe? or should use naked windows api? yes, there several, dfl matches best description. more dfl: http://www.dprogramming.com/dfl.php .

Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection -

resolved april 15, 2013. in windows 7 (64bit) windows explorer when right clicked python file , selected "edit idle" editor opens when run (or f5) python 3.3.1 program, fails "idle's subprocess didn't make connection. either idle can't start subprocess or personal firewall software blocking connection." error message. other methods of starting idle running python 3.3.1 programs worked perfectly. "send to" method worked unacceptably clunky. i've spend 4 days (so far) researching , trying various things including reinstalling python many times. , no it's not firewall blocking it. i've tried totally turning firewall off , had no effect. here's important clue: in beginning installed , configured python 3.3 64 bit , everything worked including running "edit idle" when needed library available in python 2 installed python 2.7.4 , point on stated problem began. @ 1 point removed traces of both versions , reins

Have an issue completely removing from "Products.qPloneDropDownMenu.browser" from Plone -

i getting following error when trying uses product in plone. uninstall below production , rebuilt plone without it. appears there left on when installed. ideas on how remove package completely? this no longer installed "products.qplonedropdownmenu.browser" request url http://x.x.x.x:8080/site2/xxx/portal_cache_settings/cache_tool_config traceback (innermost last): module zpublisher.publish, line 125, in publish module zope2.app.startup, line 238, in commit module transaction._manager, line 96, in commit module transaction._transaction, line 395, in commit module transaction._transaction, line 495, in _commitresources module zodb.connection, line 510, in commit module zodb.connection, line 555, in _commit module zodb.connection, line 582, in _store_objects module zodb.serialize, line 407, in serialize module zodb.serialize, line 416, in _dump picklingerror: can't pickle <class 'products.qplonedropdownmenu.brows

c# - cant figure out how to create a get set statement -

i try make get set statement doesn't work. have no idea why. have form named form1 contains combo-box names , button. the button opens new form form2 has text box. want able add text in text box combo box in form1 . searched web bit , found in order need create get , set statement instead of playing privacy of controls. the set , get statement doesn't work. says assignment call increment decrement , new object can used statement. much appreciate help. public string guidenamefunc(){ { return guidename.text; } set { guidename.text = value; } } just remove () code. public string guidenamefunc{ { return guidename.text; } set { guidename.text = value; } }

r - Adding a proper title to ggplot -

i've been trying morning , still can't find solution after reading related post on stackoverflow i have following code: names <- colnames(df[17:length(df)]) counter = 17l (i in 1:length(names)) { df.tax <- subset(df, df[,c(counter)] != 0) counter = counter + 1l meta <- subset(df.tax, select=c(1:16)) meltmeta <- melt(meta, id=c("collector", "year","week","cities","provinces")) ppv <- ggplot(meltmeta, aes(title = paste(names[i]), factor(provinces), value)) ppv + geom_boxplot() + geom_boxplot(aes(fill=collector), alpha=i(0.5)) + geom_point(aes(color=collector), size=1) +facet_wrap(~variable, scale="free") ggsave(file = paste(names[i], sep=".","provinces_vs_climate.pdf"), width=16, height=8) } my issue is, can't add proper title ggplot. @ every iteration of loop, generating new dataframe called df.tax subsetting parts of df. melt df , trying generate plot usi

Python Matplotlib and MySQL and Ginput -

i'm looking using python mysqldb , matplotlib. i'm looking use values of query within matplotlib scatter plot based on ginput plot. have following working: import matplotlib.pyplot plt import matplotlib.image mpimg import numpy np pylab import * import random import mysqldb mdb import sys collections import defaultdict ##### start query #### db = mdb.connect('localhost', 'root', 'password', 'xbee') start = raw_input("enter start date: ") part_1 = "select xbee_address_al, xbee_temperature xbeereadings date='" part_2 = start part_3 = "'" query_1 = part_1 + part_2 + part_3 cur = db.cursor() cur.execute(query_1) s = cur.fetchall() print s d = defaultdict(list) k, v in s: d[k].append(v) = 0 temp = [item[i] item in d.values()] figure(figsize=(15, 8)) img = mpimg.imread('floor.png') imgplot = plt.imshow(img, cmap=cm.hot) print "left click plot sensors point on image - middle click remove

html - align text to the top of the div -

hi on page here: http://www.gamingonlinux.com/sales/ want align text in added, price, savings , provider top, how go that? here html columns: <div class="row"> <div class="left"> {:screenshot} {:info} </div> <div class="date-column"> {:date} </div> <div class="price-column"> {:price} </div> <div class="middle"> {:savings} </div> <div class="right"> {:provider} </div> </div> and css: .left { display: table-cell; padding: 14px; } .price-column { display: table-cell; padding: 14px; width: 150px; } .date-column { display: table-cell; padding: 14px; width: 150px; } .middle { display: table-cell; width: 75px; padding: 14px; } .right { display: table-cell; width: 155px; padding: 14px; } inside "left"

javascript - How to operate on object based on string -

js noob here. if have string, how can call attribute object has same name string? var carrot = { 'vitamina': 150, 'vitaminc': 100 }; var cucumber = { 'vitamina': 10, 'vitaminc': 12 }; var vegetable = 'cucumber' alert(vegetable.vitaminc) // doesn't work note: simplified version of problem i'm working on, can't alert(cucumber.vitaminc) -- have operate on object based on string you can have like: window[vegetable].vitaminc but highly suggest containing these guys in object not global object window : var vegetables = { cucumber : { vitamina: 10, vitaminc: 12 }, carrot : { vitamina: 150, vitaminc: 100 } }; var vegetable = 'cucumber'; alert(vegetables[vegetable].vitaminc);

connection string - ASP.NET Invalid value for key 'attachdbfilename' -

the next error pops when initialize sqlconnection object: invalid value key 'attachdbfilename'. i have tried solve issue hours (also tried of advices find on so), no success. this connection string: data source=(localdb)\v11.0;attachdbfilename=|datadirectory|users.mdf;integrated security=true users.mdf located in app_data folder. i using visual studio 2012 ultimate, .net ver 4.5, sql server 2012. issue started after formatted main driver, , installed software mentioned above. thanks, guy that seems connection string sql server express edition. do have express edition installed on dev machine? i faced same issue , workaround create database named users in non-express edition of sql server. assuming have non-express edition installed, need attach existing users.mdf sql server database. http://www.sqlservercentral.com/forums/topic590254-360-1.aspx connection string: server=localhost;database=newdatabasename;user id=myusername;password=mypass

mvvm - Exposing an unbindable property to the ViewModel -

i have view longlistmultiselector . viewmodel needs access selecteditems property not available binding. without exposing view viewmodel, how expose it? this other question trying accomplish same thing has solution.

c# - How do I draw a rectangle onto an image with transparency and text -

this first graphics based project , begin need able draw rectangle onto bitmap transparency , text. i'm not sure begin this. i've done little research can't seem find article allow me add semi transparent rectangle image. what have image stream need able manipulate. can please point me in right direction this? a site source great have never done gdi work before. you can try this: // load image (probably stream) image image = image.fromfile( imagepath ); using (graphics g = graphics.fromimage(image)) { // modify image using g here... // create brush alpha value , use g.fillrectangle function } image.save( imagenewpath ); edit: code create semi transparency gray brush color customcolor = color.fromargb(50, color.gray); solidbrush shadowbrush = new solidbrush(customcolor); g.fillrectangles(shadowbrush, new rectanglef[]{rectftofill});

c++ - Can remote connections to MySQL be secured? -

i've written program in c++ stores data local mysql database every 5 seconds. need store data on webhosted mysql database remote (the webhosting provides remote access). think easy rewrite program connect remote server, have different problem. can make connection secure (encrypted)? i'm afraid password can sniffed. must server support special make possible? i thought of allowing remote connections database 1 specific ip address (my public static ip), prevent else connecting database (unless hack wifi , sniff password). wouldn't have worry if sniffed password? what solution recommend me? one solution kind of problem use ssh tunnel remote host. don't have specific formula, ssh client such putty can set listen on local port , connect remote port local other end of connection. you log in remote host ssh, open mysql connection local port, have effect of opening local connection on other end of ssh conneciton.

c# - multi lingual url's with encoding issues -

i have asp.net mvc 4 web application multi lingual. seo purposes, url's localized language of site. this has caused issues, in particular cyrillic. url's end weird encoding in address bar , in markup. url's generated action links have such encoding. any way prevent , ensure url's continue text non encoded , mean more end user?

c++ - Deleteing from memory after reference has returned -

i have question deleting things memory in c++, , , not exist longer. if create queue in c++ (standard library), add 2 elements it, call front(), store in regular variable (no pointer). call pop() on queue. variable stored still exist right? happens if edits memory address pointer in queue used live? mean local variable stored earlier no longer valid since created reference? thanks clarifications. i'll try answer in code: #include <queue> #include <iostream> int main() { // "q: if create queue in c++..." std::queue<int> q; // "...add 2 elements it..." q.push(42); q.push(1729); // "...then call front(), store in regular variable (no pointer)..." int = q.front(); // "...then call pop() on queue..." q.pop(); // ...the variable stored still exist right?" // a: "yes, of course! , retained value:" std::cout << << std::endl; } mo

Why does not work short names when I create custom form elements in Zend Framework 2? -

i create custom element here: zf2docs: advanced use of forms 1.create customelement class in application/form/element/customelement.php 2.add module.php function public function getformelementconfig() { return array( 'invokables' => array( 'custom' => 'application\form\element\customelement', ), ); } if use fqcn works fine: $form->add(array( 'type' => 'application\form\element\customelement', 'name' => 'mycustomelement' )); but if use short name: $form->add(array( 'type' => 'custom', 'name' => 'mycustomelement' )); throws exception: zend\servicemanager\servicemanager::get unable fetch or create instance custom problem the error due how instantiating $form object. if use new zend\form\form expression or similar form not set correct service locator. $form = new \zend\form\form; $form->a

java - subtracting longs goes wrong -

long freesize = ((main.maxspace-main.usedspace)*1000*1000); maxspace = 20000 usedspace = 8 --> freesize = -1482836480 why result negative? change type of maxspace , usedspace int long . if can't change code long freesize = 1000l*1000*(main.maxspace - main.usedspace); so result calculated long , not int . now calculated main.maxspace-main.usedspace -> 19992 (main.maxspace-main.usedspace)*1000 -> 19992000 (main.maxspace-main.usedspace)*1000*1000l -> 19992000000 problem here operating on integers, result must integer, max value of integer 2147483647 19992000000 out of range so java take last 32 bits of result , change integer 10010100111100111011011011000000000 -> 19992000000 10100111100111011011011000000000 -> -1482836480

php - Create a toggle close button -

can remove fancy below script , create event of toggle close button on it. script using on website in listings, wanna create toggle for multiple id's $("a.fmailto").click(function(event){ var nr = jquery(this).attr("id").substr(6); var arr = nr.split("_"); var user_id = arr[0]; var listing_id = arr[1]; $.fancybox({ 'width' : 630, 'height' : 600, 'transitionin' : 'none', 'transitionout' : 'none', 'margin' : '0', 'padding' : '0', 'titleshow' : false, 'type' : 'iframe', 'href' : '{/literal}{$live_site}{literal}/mailto.php?id='+user_id+'&amp;ad_id='+listing_id }); }); <div>toggle me</div> <a onclick="$('div').toggle();"></a> or literaly: $(function(){ $('a').on('click',function(){ $('div').toggle(); })

objective c - NSTextField click-through? -

i have static nstextfield overlays large error message in os x app. i'm trying allow user click controls beneath it. in ib i've unchecked "enabled" , i've checked "refuses first responder" i've done in code because wasn't working: [largeerrortext setenabled:no]; [largeerrortext setrefusesfirstresponder:yes]; still, getting in way of interacting objects below it. ideas else might be? the way have found make object transparent click subclass object (in case nstextfield) , override hittest method returning nil. way nstextfield not respond click nsview below respond click. - (nsview*)hittest:(nspoint)apoint { return nil; }

vaadin - Use GridLayout to make a smart layout that responds to the window being resized? -

Image
when user resizes window in vaadin 6 or 7 web app, want have various areas of layout resize larger or smaller take best advantage of usable space. gridlayout seems way that. getting started gridlayout can tricky. read gridlayout api page , book of vaadin ( gridlayout page , layout formatting page ). an example showing gridlayout in action helpful. vaadin 7 i created example vaadin 7 web app showing 2 usages of gridlayout . both usages place table dummy data in each of 4 corners of layout. when window resized larger or smaller, 4 tables change size accordingly. one usage simple grid of 4 cells, 2 columns , 2 rows. other usage includes nested layout buttons in middle column , middle row, in gridlayout 3 columns , 3 rows total of 9 cells, 3 of go empty. screen shots of each usage… here 2 important classes, each subclass of gridlayout. first simpler, more complicated one. /** * */ package com.example.quadrantgridlayout; import com.vaadin.server.sizeabl

git subtree - Detach (move) subdirectory into separate Git repository -

i have git repository contains number of subdirectories. have found 1 of subdirectories unrelated other , should detached separate repository. how can while keeping history of files within subdirectory? i guess make clone , remove unwanted parts of each clone, suppose give me complete tree when checking out older revision etc. might acceptable, prefer able pretend 2 repositories doesn't have shared history. just make clear, have following structure: xyz/ .git/ xy1/ abc/ xy2/ but instead: xyz/ .git/ xy1/ xy2/ abc/ .git/ abc/ update : process common, git team made simpler new tool, git subtree . see here: detach (move) subdirectory separate git repository you want clone repository , use git filter-branch mark subdirectory want in new repo garbage-collected. to clone local repository: git clone /xyz /abc (note: repository cloned using hard-links, not problem since hard-linked files not modified in - new ones cre

c++ - Full screen in openGL -

i trying render opengl window in fullscreen , using nehe tutorials learn how this. have reached point using exact same code in both example code given , own code, when reaches line: if (changedisplaysettings(&dmscreensettings,cds_fullscreen)!=disp_change_successful) this doesn't evaluate true in code, though in example code given. more confusing while de-bugging same point. is there simple i'm missing such in project properties, or if not, advise me on other ways of creating full screen window. nehe tutorial using: http://nehe.gamedev.net/tutorial/creating_an_opengl_window_%28win32%29/13001/ if you're learning, try using glut. can create window in few lines, , can mess opengl code, until you're comfortable enough try out platform specific apis doing such winapi. you'll need install freeglut (implementation of outdated glut), , glew (for ease of using opengl 1.1+ functions because microsoft's gl.h hasn't been updated since then)

delphi - In which thread is TIdThreadComponent OnTerminate and OnStopped executed? -

really simple important question concerning tidthreadcomponent : in thread onterminate , onstopped executed - main thread or worker thread? can safely assume in main thread when in these events (and call vcl properties , methods)? update: figured might use debugger , after trying that, looks onstopped within worker thread , onterminate inside main thread. additional benefit debugger can determining other related functions starting/stopping/controlling thread executed , reduce possible bugs. your observation correct. onstopped triggered in context of worker thread. onterminated triggered in context of main thread.

android - AlertDialog.Builder is undefined -

thought had working error! i'm still new android , can't seem fix issue no matter what. know it's using "new builder(this);". don't know else use, appreciated! changeday.setonclicklistener(new onclicklistener(){ public void onclick(view v){ alertdialog.builder b = new builder(this); b.settitle("select day"); string[] types = {"1", "2", "3"}; b.setitems(types, new dialoginterface.onclicklistener(){ public void onclick(dialoginterface dialog, int which){ dialog.dismiss(); switch(which){ case 0: day = "1"; break; case 1: day = "2"; break; } } }); } }); your problem in string[] array

Cocos2d-iphone 2.0 set AutoRotate for landscape,but the view position is wrong when first loaded -

the app set landscape. in project->target->summary->supported interface orientations, enabled 2 landscape icons (both left , right). and in appdelegate.m, below code written: - (bool)shouldautorotatetointerfaceorientation: (uiinterfaceorientation)interfaceorientation { return uiinterfaceorientationislandscape(interfaceorientation); } when app running on device, view showed @ beginning after default cocos2d icon, positions wrong moved right-down side. when rotate screen, goes right, in right position. what's wrong? i tried method below: disable icons in in project->target->summary->supported interface orientations. code in appdelegate still in use. view @ beginning ok screen can rotated protrait. .... any 1 can help? also put these 2 ios6 orientation, in appdelegate. -(nsuinteger)supportedinterfaceorientations { return uiinterfaceorientationmasklandscape; } - (nsuinteger)application:(uiapplication*)application supportedint

sql server - SQL - How to check for multiple values of one column while only returning one row? -

sorry if question worded weird. i'm writing report , have table has fields this.... applicationid statusid statuscreationdate 123 1 3-18-2013 123 2 3-27-2013 124 1 3-29-2013 125 1 4-1-2013 125 2 4-3-2013 and want return rows statusid of 1 want check if statusid of 2 exists each applicationid. desired query on above table produce: 123 3-18-2013 125 4-1-2013 any appreciated. if more information needed, let me know. wanted keep short , simple possible while including necessary amount of information. thanks time. edit: corrected desired results part try select * tablename t statusid = 1 , exists(select * tablename applicationid = t.applicationid , statusid = 2)

entity framework - EF 6 - many-to-many - Join table without duplicates -

i'm using ef6 have confusion on seeding many many relationship. i have following: a user has many saved chartqueries (that can execute chart). chartquery typically belongs 1 user, there several "shared" chartquery s every user can execute. result set many many relationship using join table userchartquery . tables in database fine @ 1-to-many on each side of join table. however, i'm not quite understanding how seed or use relationship. don't want end several duplicates of "shared" chartquery s (a duplicate each user ). instead, there should single row each "shared" chartquery part of each user 's savedchartqueries collection (along other, non-shared chartquery s belong user only). it seems i'm forced duplicate each user: var sharedchartquery = new chartquery { ... }; var nonsharedchartquery = new chartquery { ... }; var useronechartqueryone = new userchartquery { user = userone, chartquery = sharedchartque

ios6 - Trying to Get Current Location integrated with iOS project -

so i'm attempting integrate user's current location ios project - i'm using third part code build out map pinpoints - have these frameworks integrated: #import <uikit/uikit.h> #import <corelocation/corelocation.h> #import <quartzcore/quartzcore.h> #import <mapkit/mapkit.h> here's code pinpoints - appreciated: #import "asymap.h" @implementation asymap @synthesize currentannotation,mapannotations,map,prompt,mapfromlink,selectedannotationid,selectedannotationindex,showothers,usecustomtitle,customtitle; /** * class constructor */ -(id)init{ self = [super init]; if(self){ usecustomtitle = false; mapfromlink = false; showothers = false; map = [[asymapobject alloc] init]; [map addonview:self.view]; } return self; } /** * overwrite set page method in * order show selected annotation * link */ -(void)setpage:(nsdictionary *)page{ nsdictionary *metas = [page valuefo

c# - Parameters dictionary contains a null entry for parameter -

i having 2 view pages using same controller , model way change page layout having trouble displaying second page. error message: the parameters dictionary contains null entry parameter id of non-nullable type method system.web.mvc.actionaresult listview(int32) in usercontroller not sure causing problem used same code first view page(working) except changing view layout. first view <div> <a href="/roster/listview">click here list view</a> </div> <section id="users" data-bind="foreach: users"> <div id="nameimage"> <figure id="content"> <img width="158" height="158" alt="gravatar" data-bind="attr:{src: gravatarurl}"/> <figcaption> <a title="email" id="emailicon" class="icon-envelope icon-white" data-bind="attr:{'href':'mailto:' + e

C call back function from assembly (x86) and process switching -

this code undergraduate os course. trying call function on same stack of new_sp , return whatever new_sp doing. not working , i'm not sure how de-bug it. suggestions or solution great. tried through if there left out please let me know. notes: part of special os (xinu) using class. function called within c code. reference using: http://www.unixwiz.net/techtips/win32-callconv-asm.html this part of code saves process stack before switched out. stack pointed new_sp saved way well. .text .globl callsw /*--------------------------------------------------------------------- * callsw - call callsw(&old_sp, &new_sp, &call_back) *---------------------------------------------------------------------*/ callsw: /*keep of old contex switch instructions work cxtsw*/ pushl %ebp /* push ebp onto stack */ movl %esp,%ebp /* record current sp in ebp */ pushfl /* record flags

c# - "An unsecured or incorrectly secured fault was received from the other party" -

Image
i'm getting: "an unsecured or incorrectly secured fault received other party. see inner fault exception fault code , detail." i've done on client side , i've done same in console application, error came may conflict. i've checked app.config well. code is: <client> <endpoint address="net.tcp://localhost:5054/player" binding="nettcpbinding" bindingconfiguration="nettcpbinding_iplayerservice" contract="playerservice.iplayerservice" name="nettcpbinding_iplayerservice"> <identity> <dns value="pident.cloudapp.net"/> </identity> </endpoint> <endpoint address="net.tcp://localhost:5049/public" binding="nettcpbinding" bindingconfiguration="nettcpbinding_ipublicservice" contract="public service.ipublicservice" name="nettcpbinding_ipublicservice"/> <endpoint address="net.t

mysql - get all records matching the query string and display like in google suggest by google -

what want is, similar google suggest. client page submit search text through ajax server. server grab text , query records matching string , return client page. e.g. text_frm_client = "ba". query show records beginning "ba" the raw sql query achieve problem **select * table_name column1 "ba%" or column2 "ba%"** now want port query django model. found somewhat similar. https://docs.djangoproject.com/en/dev/ref/models/querysets/#std:fieldlookup-contains but 1 field. how can accomplish sql query django model. you can use q data = mymodel.objects.filter( q(column1__contains="ba") | q(column2__contains="ba") )

python - Editing the x-axis tick labels of a stacked bar graph in matplotlib -

Image
i have written code produce stacked bar graph plots 192 bars of data. data spans on 4 days, , each bar represents 30 minute time period. the graph produces 192 tick labels overlap each other undesirable appearance-wise. to fix this, have added following lines code: myfmt = mdates.dateformatter('%d') ax.xaxis.set_major_formatter(myfmt) i want have 1 tick label each day, matplotlib automatically generates unwanted, tick labels when graph spans on 4 days or less. problem doesn't happen when there 5 or more days. there way can force graph have 1 tick each day? you need use proper locator: ax.xaxis.set_major_locator(matplotlib.dates.daylocator()) (doc)

.net 4.0 - How can I implement a secure websocket (wss://) implementation in C# vss 2010 or less? -

how can implement secure websocket (wss://) implementation in c# vss 2010 or less? because in .net 4.5 has implementation of websockets. i guess talking websockets .net 4.0 , c#? in case know of xsockets.net ( http://xsockets.net ) or super websocket (on codeplex think) support certificates. might others on .net 4 regards uffe

python - Load a class in a field of the same module - OpenErp -

i need load data class, field of class in same module. i need show tree of data in xml view. class certificados(osv.osv): _name = 'certificados.certificados' _description="certificados de no produccion" _inherit = ['mail.thread', 'ir.needaction_mixin'] _columns = { 'item' : fields.integer('item'), 'registro_numero' : fields.integer('registro numero'), 'fecha_de_emision': fields.date('fecha de emision', required=true, select=true), 'fecha_de_solicitud': fields.date('fecha de solicitud', required=true, select=true), 'fecha_del_documento': fields.date('fecha del documento', required=true, select=true), 'vigencia' : fields.integer('vigencia'), 'cert_ids' : fields.one2many('certificados.line','requisicion_id','items del certificado',states={'done': [('

Is there an #ifdef stripping C/C++ utility -

this question has answer here: is there c pre-processor eliminates #ifdef blocks based on values defined/undefined? 5 answers is there utility can strip out #ifdef pro_version ... #endif code? please don't tell me visual studio compiler flag or xcode's view post-processed source. can't automate conveniently like, say, console application. what looking here find existing utility if exists. if not ... guess i'll have reinvent wheel. unifdef might you're looking for. from its manual : the unifdef utility acts on #if, #ifdef, #ifndef, #elif, #else, , #endif lines. directive processed if symbols specified on command line sufficient allow unifdef definite value control expression. if result false, directive , following lines under control removed. if result true, directive removed. #ifdef or

Add the text in between two text using php file handling -

my question have file handling in php.in file handling have create file,write file , update file.if create text file using php file handling , write file hello guys , close file.i want update file time while update file want add text in between hello , guys.for example hello hii guys.or guys word overwrtten speed.hello speed. thanks please me you can append text @ last using below link or other option http://php.net/manual/en/function.file-put-contents.php

objective c - Not able to align button text in UIActionSheet for iphone5 -

how align button text in uiactionsheet iphone5? using way,you can set frame,change font alignment of button text on actionsheet. cgrect oldframe = [(uilabel*)[[sheet subviews] objectatindex:0] frame]; uilabel *newtitle = [[[uilabel alloc] initwithframe:oldframe] autorelease]; newtitle.font = [uifont boldsystemfontofsize:17]; newtitle.textalignment = uitextalignmentcenter; newtitle.backgroundcolor = [uicolor clearcolor]; newtitle.textcolor = [uicolor whitecolor]; newtitle.text = @"your title"; [sheet addsubview:newtitle]; [sheet release];

c# - How to store additional fields from Google/Facebook using SimpleMembership & mvc4 -

the mvc4 internet template have following code oauthwebsecurity.createorupdateaccount(result.provider, result.provideruserid, user.identity.name); is there support persisting other attributes such country, last/first names etc. or roll own using ef/other orm ? you can't add additional fields membership db through existing api. can use provideruserid map own entity 1 in membership database.

objective c - Detect rootcontroller in iphone sdk -

i have using 2 types of controller in application i.e. navigationcontroller , presentviewcontroller . how can detect base controller @ instance through code i.e using navigation or presentviewcontroller transist 1 viewcontroller viewcontroller ? try take rootviewcontroller of navigation: uiviewcontroller *topviewcontroller = [self.navigationcontroller topviewcontroller];

asp.net mvc - Datatables for Visual Studio 2012 MVC project -

i have datatable build in jquery. declaration looks like: otable = $('#rules-datatable').datatable({ "aocolumns": [ { "mdataprop": [0], "swidth": "10%" }, { "mdataprop": [1], "swidth": "10%" }, { "mdataprop": [2], "swidth": "10%" }, { "mdataprop": [3], "swidth": "10%" }, { "mdataprop": [4], "swidth": "10%" }, { "mdataprop": [5], "swidth": "10%" }, { "mdataprop": [6], "swidth": "10%" }, { "mdataprop": [7], "swidth": "10%" }, { "mdataprop": [8], "swidth": "10%" }, { "mdataprop": [9], "swidth": "10%" } ], "bautowidth": true, "bfilter": false, "

asp.net - conversion to DateTime -

i have following tags select date first day,second month , third year <select id="d" class="styledselect-day" tabindex="6"> <option value="">dd</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11"

java - How to stop the timer after certain time? -

i have android application has timer run task: time2.scheduleatfixedrate(new timertask() { @override public void run() { sendsamples(); } }, sampling_interval, sending_interval); lets sampling_interval 2000 , sending_interval 4000. so in application send reading values sensor server. want stop sending after 10000 (10 seconds). what should do? try time2.scheduleatfixedrate(new timertask() { long t0 = system.currenttimemillis(); @override public void run() { if (system.currenttimemillis() - t0 > 10 * 1000) { cancel(); } else { sendsamples(); } } ...

sql server - Use .MDF file in c# -

i have .mdf file. want use in c# in desktop application. this connection string : string cwd = system.io.directory.getcurrentdirectory(); string constring = @"data source=.\sqlexpress; attachdbfilename=" + cwd + "\\salaryprogram.mdf;integrated security=true;user instance=true"; how can use .mdf file in c# ? i getting error : an attempt attach auto-named database file d:\naresh backup\salaryprogram\latest work\salaryprogram\salaryprogram\bin\debug\salaryprogram.mdf failed. database same name exists, or specified file cannot opened, or located on unc share. thanks in advance. check following 3 things: make sure mdf file created same or older version of sql server 1 installed on target machine. make sure sql server on target machine doesn't have database same name. always prefer path.combine() on direct concatenation of folder path , file name. function returns ending backslash character part of path, other times doesn't. di

php - How do I render validation errors in controller through twig template -

how render validation errors in controller through twig template. not able access validation errors in controller. i found way $validator = $this->get('validator'); $errors = $validator->validate($entity); $content = $this->renderview('yourbundle:yourentity:template.html.twig',array('errors'=>$errors)); {% if errors %} {% error in errors %} <li>{{ error.message }}</li> {% endfor %} {% endif %} how field name has error out here $validator = $this->get('validator'); $errors = $validator->validate($entity); $content = $this->renderview('yourbundle:yourentity:template.html.twig',array('errors'=>$errors)); {% if errors %} {% error in errors %} <li>{{ error.message }}</li> <li>{{ error.propertypath }}</li> {% endfor %} {% endif %}

DatePicker in XPages: disable onblur event when handwritten -

is possible disable opening of datepicker when write date hand in datepicker field? it's noisy because in scenario, when leave field after typing date, datepicker opened again, , close need click again on field , click out thanks andrea you try js magic. hook event on keydown in entry field. when entry made unlink event triggers date picker, if field empty relink it. firebug sessions should able figure out fine-print

.net - Best deployment tool for windows application with custom requirements? -

i looking tool deploy windows application. requirement should able control creation of files , folders in program files. need add custom actions , execute them before installation starts. in setup deployment tool visual studio, application first gets installed , custom actions run. need able control these steps. i researching wix toolset . can please let me know whether wix can solution. if yes, need add own steps installation. yes. wix best solution you. has installer sequence install ui sequence , install execute sequence . write custom actions , schedule in sequence per requirement. if schedule before install initialize action, run before start installation. e.g. schedule custom action run before installation starts. <customaction id="installaspnet" binarykey="wixca" dllentry="caquietexec" execute="deferred" return="check" impersonate="no" /> <installexecutesequence> <custom action=&

kineticjs - shift shapes in groupS -

i've got little problem. kinetic stage this: stage -> layer0 -> group0 -> shapes layer1 -> group1 -> shapes layer2 -> group2 -> shapes i need move group1 , group2 both when group0 event called (dragstart, dragmove etc). tried this: group0.draggable = true; group0.on('dragstart', function(){ var = #save first mouse position point }) group0.on('dragmove', function(){ #ref group1 , group2 store in group0 , debugged in chrome, object recognize group1.setposition(my new positions x, y) group2.setposition(...) }) in other words. need connected groups different layers , treat them in 1 group nested 3 others groups. code doesnt work, bug or forgot something? how achieve this? there no error in console, doesnt work, can shift group0 group1 , group2 setposition function doesnt change despite seem call properly. thank you i can speculate because don't have code in front of me. but first thing check re

How to change the date format of datepicker using jquery? -

i using datepicker in jqgrid. here, want date in format of dd-mm-yy , want save date on database in format of yyyy-mm-dd hh:mm:ss. , whenever retrieve date database in format of dd-mm-yy. how should make using jquery? update <script> datepick=function(element) { $(element).datepicker( { buttonimage: "calendar.gif", buttonimageonly: true, mindate: 0, showbuttonpanel: true , closetext: "close", changemonth: true, changeyear: true } ).attr('readonly','true'); }; function callme() { $( "#datepicker" ).datepicker( "option", &