Posts

Showing posts from February, 2014

debugging - Visual studio 2010 debugger don't stop at Breakpoint? -

i've problem using visual studio 2010 on computer (windows 7 64-bits) i'm doing c# add-in outlook. add on outlook, try it, couldn't debug because debugger don't stop @ breakpoints. search on google , here, found nothing me. someone have solution ? have attached visual studio outlook process? attach existing process open debug->attach process... then should able debug own code. edit: have @ this . there seem 2 ways resolved: change project start action start project instead of start external app there's link in article pointing another post . in quite lot of stuff, @ bottom there's descriped vs can't debug multiple frameworks @ same time (like 2.0 , 4.0). there descriptions @ how work around this.

tsql - Return BIT constant from SQL Stored Procedure -

ok, i'm trying return bit constant stored procedure. the way i've managed compile using cast: cast(0 bit) mybool is there more efficient way write without cast? some people prefer following declare @true bit,@false bit set @true = 1 set @false = 0 and use @true or @false remainder of query. i imagine post compilation difference in efficiency between 2 methods vanishingly small can safely write in whatever style prefer.

uibutton - iPhone: How to avoid background color coming up when button is selected? -

Image
i have button curved image set foreground image. looks like: now when button on pressed state, shows this: notice grey rectangular color coming around edges. there easy way avoid grey background coming on rectangle ? you need set property shows touch on highlight enabled. programmatically can with: [button setshowstouchwhenhighlighted:yes];

c# - WPF Tab Control Prevent Tab Change -

i'm trying develop system maintenance screen application in have several tabs each representing different maintenance option i.e. maintain system users et cetera. once user clicks on edit/new change existing record want prevent navigating away current tab until user either clicks save or cancel. after googling i've found link http://joshsmithonwpf.wordpress.com/2009/09/04/how-to-prevent-a-tabitem-from-being-selected/ seemed solve problem, or thought. i've tried implementing this, event never seems fire. below xaml. <tabcontrol name="tabcontrol"> <tabitem header="users"> <dockpanel> <groupbox header="existing users" name="groupbox1" dockpanel.dock="top" height="50"> <stackpanel orientation="horizontal"> <label margin="3,3,0,0">user:</label> <combobox width="

javascript - JQuery append() DIV HTML without <img> -

been trying find answer can't seem head around it: var newlayout = '<div id="blog-left"></div>' ; // creates layout content moved newlayout += '<div id="blog-right" class="nivoslider"></div>' ; newlayout += '<div style="clear:both;"></div>' ; newlayout += '<div id="img-temp" style="display:none;"></div>' ; $('.blog').append(newlayout); // add new layout $('#blog-left').append( $('.blog p') ); // <p>'s being added new layout $('#blog-right').append( $('.blog img') ); // <img>'s being added new layout this work well, problem have instead of appending <p> #blog-left want append contained html minus <img> tags. html goes #blog-left , <img> 's go #blog-right. i've tried using .html() works point #blog-left & #blog-right in conta

Magento - custom form -

i have form, @ moment simple html based one, doesn't anything. what i'm looking though, able send email once form has been submitted , save data database. the problem comes, email sending. in form, there drop down menu. menu items items in suppliers model/module, have name , email address. so, when select supplier a, form passes validation, needs send supplier email , save details (this shouldn't hard). i'm not sure how i'd email address. would need pass kind of parameter custom sendemail() method? all appreciated. thanks update: ok, before email part, i'd store data in table, named test drive. i've created module in admin , form submit data on frontend end. but cannot seem data insert. all welcome thanks for sending email see mage_contacts_indexcontroller::postaction() action or mage_sales_model_order::sendneworderemail() if created module model, can instance of model, insert data , save or can create resourcemodel

.net - Custom CreateUserWizard adding 2 fields -

i attempting customise createuserwizard following in book, when come reference them in code behind error saying 'fieldname not declared' each field i'm adding, present in page correct id's, doing wrong? i trying add firstname , lastname field bottom of createuserwizard , remove need security question. markup: <asp:createuserwizard id="createuserwizard1" runat="server" oncreateduser="createuserwizard1_createduser"> <wizardsteps> <asp:createuserwizardstep id="createuserwizardstep1" runat="server"> <contenttemplate> <table> <tr> <td align="center" colspan="2"> sign new account</td> </tr> <tr> <td align="right"&

Stop and then start a process in powershell -

i stop/kill process , start again after done doing have do. this have. clear-host $processes = get-process devenv $processes.count if($processes.count -gt 1) { $i = 0 write-host "there multiple processes devenv." foreach($process in $processes) { $i++ $i.tostring() + '. ' + $process.mainwindowtitle } $in = read-host "give number of process kill: " write-host write-host "killing , restarting: " + $processes[$in-1].mainwindowtitle $processes[$in-1].kill() $processes[$in-1].waitforexit() $processes[$in-1].start() } else { write-host "something else" } but start needs parameter thought process. i'm not sure know give it. the $processes[$in-1].start() not work. need capture processinfo killing , start same app again. can process binary , commandline information using win32_process wmi class. for example, clear-host $processes = get-process notepad $p

symfony1 - symfony generate URL without route? -

i want generate url. for example: üäö ssd when urlencode, gives me: %e3%bc%e3%a4%e3%b6+ssd but when submit form, symfony generates url this: üäö+ssd you should consider using doctrine_inflector::urlize() generate urls without special characters in them. remove non-ascii character , spaces if remember correctly.

xcode - iPhone SDK: Stopping a Video -

how can stop video once navigate away view , make video play again when original view again? here code play video in original view: - (void)viewdidload { nsbundle *bundle=[nsbundle mainbundle]; nsstring *moviepath = [bundle pathforresource:@"video" oftype:@"mp4"]; nsurl *movieurl=[[nsurl fileurlwithpath:moviepath] retain]; mpmovieplayercontroller *themovie = [[mpmovieplayercontroller alloc] initwithcontenturl:movieurl]; themovie.scalingmode = mpmoviescalingmodeaspectfill; themovie.view.frame = cgrectmake(104.0, 134.0, 200.0, 250.0); [self.view addsubview:themovie.view]; [themovie play]; [super viewdidload]; self.view.backgroundcolor = [uicolor viewflipsidebackgroundcolor]; } make themovie instance var stop playing in -(void) viewwilldisappear:(bool)animated and should start playing when navigate view. or move code -(void) viewdidappear:(bool)animated

assembly - why the assembler does not report error on this? -

consider following 2 statements out of simple assembly language program: data1 db +200 data2 db -130 when try assemble it, assembler gives error on no 2 statement, should since byte can hold beyond -128 decimal. why assembler didn't give error on no 1 statement? afterall, byte can hold max 127 positive signed integer.. instead assemlber put value c8 in byte. any number converted array of bits when assembled executable. -1, example, 0xff, -2 0xfe, etc. difference between -1 , 255 how used in code. assembler doesn't care, wants store data use.

Should my open source CMS support multiple database platforms? -

i developing open source cms , have been deciding whether or not offer support multiple database platforms. views , opinions on matter? should stick , optimize single platform or offer support more? thanks in advance input. it depends on plans. if want cms became popular (i meant open source) make flexible possible high database abstraction. can tell leading php - based cms "drupal" went through path form mysql leading dbs including nosql.

security - Running a windows command in a wcf rest service -

i have wcf rest service running code below: string command = @"c:\test.exe"; system.diagnostics.processstartinfo procstartinfo = new system.diagnostics.processstartinfo("cmd", "/c " + command); logger.write(string.format("1"), logtype.error); procstartinfo.redirectstandardoutput = true; procstartinfo.useshellexecute = false; procstartinfo.createnowindow = true; logger.write(string.format("2"), logtype.error); system.diagnostics.process proc = new system.diagnostics.process(); proc.startinfo = procstartinfo; logger.write(string.format("3"), logtype.error); proc.start(); logger.write(string.format("4"), logtype.error); string result = proc.standardoutput.readtoend(); logger.write(string.format("5"), log

asp.net - CSS for mobile sometimes reverts back to original -

so of time stylesheets appear properly. standard/original 1 works flawlessly, seems mobile 1 disregarded when looked @ mobile device i have them designated follows: <link href="customstylesheets/standard.css" rel="stylesheet" type="text/css" /> <link href="customstylesheets/mobile.css" rel="stylesheet" type="text/css" media="only screen , (max-device-width: 799px)" /> i'm using droid x view page, in portrait mode, device width shouldn't exceeding max-width specified above, sometimes, randomly, still reverts original css page. any way keep doing so? make sure standard.css isn't affecting cascade of expect see mobile.css. looks though mobile device load standard.css first mobile.css - styles in both stylesheets affecting display. wrap stylesheet link elements in logic displays mobile stylesheet mobile device - not both stylesheets @ same time. also, don't forget inclu

sql - How can I see where data in a column comes from? -

i don't know if can me. in job, inherited undocumented database (oracle 11). far, i've managed map of tables , determine what's going on where. however, there few columns haven't been able decipher. is there way of finding out how data in column built? not manual input. seems point data being result of entry in different column in different table. it might impossible task, , suggestions more welcome. thanks! c perhaps data being inserted in mystery columns via trigger? try looking in pl/sql source table in dictionary: select owner, name, type, line dba_source upper(text) '%mystery_column_name%' , type = 'trigger'; -- use or omit desired. this pointed in possible places look. good luck!

visual studio 2008 - Expand/Collapse all Regions doesn't work. never did -

as far can tell, never did work advertised or expected. referring accepted answer on previous posting , ctrl + m + l not expand all, in fact, i've tried of outlining menu options , none of them expand all, @ least me using vs 2008 in vb project. must resort sort of macro?

windows - How to export only last changes from SVN repository? -

i want export changes (files , folders - tree) between head , previous revisions using svn export command. possible? how under windows (command-line)? svn diff -rprev:head --summarize will give list of files modified. should able iterate on list whatever scripting languages have available , create necessary directories followed svn cat commands contents of each file. this quite easy in bash, maybe else can tell go here in windows.

Horizontal scroll bar problem in silverlight data grid -

Image
i'm using silverlight 4 datagrid. have datagridtextcolumn , datagrid template column, them i'm specifying column in '*', 'sizetoheader'. everything works fine if have 20 records in datagrid, if grid have more 30 records, it's behaving odd. it's column headers , columns not aligned, due improper alignment, horizontal appears unnecessarily, if click of column header, ok. alignment of column header columns. this happening me. in case, moment set template rows, this: <style targettype="sdk:datagridrow"> <setter property="istabstop" value="true" /> <setter property="template"> <setter.value> <controltemplate targettype="sdk:datagridrow"> <localprimitives:datagridfrozengrid name="root"> <vsm:visualstatemanager.visualstategroups>

How to get the List of Installed Applications in Android? -

this source code... public class getapplist extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); try { list<packageinfo> applistinfo = this.getpackagemanager() .getinstalledpackages(0); jsonarray ja = new jsonarray(); (packageinfo p : applistinfo) { if (p.applicationinfo.uid > 10000) { jsonobject jo = new jsonobject(); jo.put("label", p.applicationinfo.name); jo.put("packagename", p.applicationinfo.packagename); ja.put(jo); } } system.out.println(ja); } catch (exception e) { // todo: handle exception } } } this result~ [{"packagename":"com.android.soundrecorder"},{"packagename":"com.android.alarmclock"},{"packagename":"co

mvvm - Problem Binding Commands to TreeViewItem using MVVMLight -

i'm trying use mvvmlight bind treeviewitem selected event command. the treeviewitem's defined in hierarchicaldatatemplate cannot add interaction.triggers (as shown below) <hierarchicaldatatemplate x:key="treeviewitemtemplate" itemssource="{binding childreportviewmodels}"> <i:interaction.triggers> <i:eventtrigger eventname="selected"> <mvvmlight_command:eventtocommand command="{binding loadreportcommand, mode=oneway}" /> </i:eventtrigger> </i:interaction.triggers> </hierarchicaldatatemplate> how else can add eventtrigger each treeviewitem? thanks. i forgot question. for future ref, here's solution used... instead of trying bind eventtocommand selected event of treeview, bound mouseleftbuttonupevent of textblock declared in hierarchicaldatatemplate treeviewitems. <hi

c# - 150K rows for scatter plot graph loading forever? -

i have 150k records of x , y columns , trying draw chart finanicalformula. taking time create chart ever. not throwing error also. chart1.datasource = dtchart ' data bind selected data source chart1.databind() chart1.chartareas(0).recalculateaxesscale() chart1.datamanipulator.financialformula(financialformula.forecasting, "linear,,false,false", chart1.series("series1"), chart1.series("linear")) chart1.datamanipulator.financialformula(financialformula.forecasting, "exponential,,false,false", chart1.series("series2"), chart1.series("exponential")) chart1.datamanipulator.financialformula(financialformula.forecasting, "islogarithmic,,false,false", chart1.series("series3")

Sending/Streaming large files in an automated fashion via http (and avoiding the firewall) -

i've created vbscript collects event data windows machine , stores in csv file. i want upload data via http our office server, file sizes quite large. looked @ multipart/streaming solutions, im told if initiate these file uploads programmatically, http proxies or firewalls block/deny requests? can confirm if indeed true, , way around that? need have programmed solution in place upload files, , cant rely on end-user manually invoke upload (as understand around firewall/http proxy issue) can or advise on matter? i found previous answer, wasnt sure if applies me? solution programmatically imitating browser file upload request, or ask user 'pick file'? upload files httpwebrequest (multipart/form-data) to know if blocked have try it, if have code tried errors encounter. general advise: compress csv before sending, gains impressive. try use synchronising service dropbox, passes firewalls if configured. if security not big issue , ftp port open in fire

Copy class name in javascript -

i need way copy class name 1 object another. for example <div id="obj1" class"test"></div> <div id="obj2"></div> *run code* <div id="obj1" class"test"></div> <div id="obj2" class"test"></div> i'm betting pretty simple question, i'm relatively new javascript. any appreciated. var obj1 = document.getelementbyid('obj1'), obj2 = document.getelementbyid('obj2'); obj2.classname = obj1.classname; just make sure code not run before dom ready. simple way place script before </body> tag.

interop - C# - How can I get a text range from WordPad by sending the EM_GETTEXTRANGE message? -

i'm having trouble getting text range running instance of wordpad. have gotten following windows messages work wordpad without problem: wm_gettext, wm_gettextlength, em_replacesel, em_getsel, , em_setsel. i'm not having luck em_gettextrange message though. in c# test app have code runs @ startup looks running instance of wordpad, searches it's child windows window class name richedit50w. window send messages to. again, of messages have sent window work fine except em_gettextrange. after sending em_gettextrange, marshal.getlastwin32error returns 5, msdn says error_access_denied. below of interop code. can please me solve problem? thanks! const uint wm_user = 0x0400; const uint em_gettextrange = wm_user + 75; [structlayout(layoutkind.sequential)] struct charrange { public int min; public int max; } [structlayout(layoutkind.sequential, charset = charset.unicode)] struct textrange { public charrange charrange; [marshalas(unmanagedtype.lpwstr)

Ruby on Rails new installation on Ubuntu , problem getting a new app to work (TypeError) ! -

just installed ror on ubuntu 10.10 , created new app, welcome page, when create simple index page typeerror. here have done: following instructions available @ https://help.ubuntu.com/community/rubyonrails eveything looks fine no error during installation. opted out built in web server keep things simple. i created new app using: /var/www/$ rails new mynewapp and started webserver in terminal: /var/www/mynewapp/script$ rails server => booting webrick => rails 3.0.3 application starting in development on http://0.0.0.0:3000 => call -d detach => ctrl-c shutdown server [2011-02-22 17:14:09] info webrick 1.3.1 [2011-02-22 17:14:09] info ruby 1.8.7 (2010-06-23) [i686-linux] [2011-02-22 17:14:24] info webrick::httpserver#start: pid=10120 port=3000 i welcome page right. followed tutorial @ (http://guides.rubyonrails.org/getting_started.html) , created index page: /var/www/mynewapp$ rails generate controller home index then edited newlly created mynewapp/v

c# 3.0 - Strange error when using "Double.NaN" and "double.MaxValue" in c# -

i have function in code (c#, net 3.5, visual studio 2008): public double function calculatesomething() { ... double = double.nan; // or double.maxvalue, same behaviour ... } this function called main class, this: ... double res = o.calculatesomething(); ... although looks incredible (for me, is) , only on computers (only in 2 computers 60) without special (winxp sp3), if use "alias" (double.nan or double.maxvalue) program broken without kind of error screen when program calls "calculatesomething", whereas if assign particular value, works perfectly. i mean: public double function calculatesomething() { ... double = double.nan; // faaaail!!!! double b = -99999; // ok... ... } although change made, program can run on computers, have curiosity. know may happening?. thank you. ok, found problem: i installed net 4.0, program needed net 3.5. installed net 3.5 , worked. really, rarest thing, have ever seen. thank re

objective c - How to trigger Finder's Move File Dialog programatically? -

i'm working on small cocoa utility lets user drag files onto window , moves different folder. instead of moving dragged file myself (via [[nsworkspace sharedworkspace] performfileoperation:nsworkspacemoveoperation...] ), trigger finder's "move file dialog". give user visual feedback (progress bar) , take care of error handling (e.g. file @ target exists). i've thought using apple script, maybe there's easier way bring dialog? thanks! mark. maybe should check nsfilemanager. http://developer.apple.com/library/mac/#documentation/cocoa/reference/foundation/classes/nsfilemanager_class/reference/reference.html

php - PHP5- instanceof/is_a failure? -

i've got code in php5 <?php function debug_log($log) { echo $log; } // supporting classes class tag { private $id; private $name; private $tagname; private $extras; public function __construct($tag) { $this->id = 0; // set non-zero if want id $this->name = ''; // set non-empty name $this->tagname = $tag; // tag, e.g. select/html/head $this->extras = ''; // if need isn't covered } protected function opentag() { debug_log('tag::opentag()'); $html = '<' . $this->tagname; if ($this->id != 0) { $html .= 'id = ' . $this->id; } if ($this->name != '') { $html .= 'name = ' . $this->name; } if ($this->extras != '') { $html .= ' ' . $this->extra; } $html .= '>'; echo $html; } pr

android - "resolveUri failed on bad bitmap uri" when putting image on ListView -

hey, i'm new android , have slight problem. i'm trying put listview images loaded through url. works far, images wont show up. logcat says this: 02-23 19:20:48.447: info/system.out(833): resolveuri failed on bad bitmap uri: android.graphics.drawable.bitmapdrawable@405359b0 its not finding image, have no idea why. using r.drawable.icon works though. can me out? heres source: public class main extends activity { private listview lv_main; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); lv_main = (listview) findviewbyid(r.id.listviewmain); arraylist<hashmap<string, string>> listitem = new arraylist<hashmap<string, string>>(); hashmap<string,string> map; map = new hashmap<string, string>(); map.put("title", "a title goes here"); map.put("details",

MATLAB difference between numerical integration functions -

i need integrate expression using matlab. difference between these functions? quad , quad8 , quadl , dblquad if @ material provided form matlab site you'll see these explanations: quad : numerically evaluate integral, adaptive simpson quadrature quadl : numerically evaluate integral, adaptive lobatto quadrature dblquad : numerically evaluate double integral on rectangle i didn't quad8 wasn't readily available, i'm sure you'll able find here. each of link provide greater detail how work exactly.

.net - Need help re-creating Subsonic 2.2 / SubCommander generated table and column names -

i writing code generation templates work hand-in-hand subsonic 2.2 / subcommander generated classes / assembly. problem having subsonic using beautiful magic normalize table , column names, singluarize them, pull out extraneous characters etc.. my generated classes (must) pulling table , column names directly database schema , can imagine not match subsonic's generated "pretty" names. have tried use several combinations of subsonic.utilites classes, singularize, toproper, etc... cannot seem find right combination match subcommander outputting. i able copy of subcommander 2.0 source code , took through there did not have luck in fiding normalization of names happening. me find right combination of utility methods subcommander uses generate table , column names? if makes difference not using special "switches" subsonic in app.config on subcommander side except fixpluralclassnames="true". take @ tableschema.cs, interested in following 2

animation - jQuery function on initial home page load only -

i know apple had done on homepage beatles.. well, @ least think did. but, have animation happening header , navigation links on webpage want animate on load of home page only. now, know can add js home page there way limit animation work when visitor first visits site in 1 session? you can record visits in cookie, interrogate cookie

python - MySQL server has gone away -

i've moved local web.py/apache setup shared host , i'm trying match home configuration. 1 issue popping operationalerror "mysql server has gone away". searching around internet, people come across error tended inactive space of hours. happens me between seconds. i've confirmed using mod_wsgi's application() function example in fact running in daemon mode. 1 issue though, concerns me if spit out web.ctx.orm error log, appears new object each request. shouldn't sqlalchemy session object same between page requests? here's python code , portion of apache setup. there cause problems on new machine hadn't had before on home machine? def load_sqla(handler): web.ctx.orm = scoped_session(sessionmaker(bind=engine)) try: try: return handler() except web.httperror: web.ctx.orm.commit() raise except: web.ctx.orm.rollback() raise finally: web.c

Scala: function/method application and tuples -

i stumbled across pretty interesting behavior in scala. scala> def foo(t: (int, int, int)): int = t._1 foo: (t: (int, int, int))int scala> foo(1,2,3) res23: int = 1 scala> foo((1,2,3)) res24: int = 1 this works other way round: scala> some(1,2,3,4,5) res31: some[(int, int, int, int, int)] = some((1,2,3,4,5)) while sugar extremely useful did not find documentation concerning this. question basically: documented in scala language specification, , other implications have if any. regards, raichoo it known automatic tupling. lodged bug against language specification, silent on matter. here's relevant part of compiler source code.

encryption - How to hash/encrypt a string to protect private information but still make the string comparable -

given string how create unique identifier / hash string 1 can track occurence of string without logging original string. for example url "www.mylittlesecret.com" should show "xyz123" (hascode string). url translates xyz123 xyz123 1 can't determine url. sorry if wrong terms. happy read more "hashing" if provide me right keywords. if use hash algorithm sha1 desired behavior. not able reconstruct url hash, can compare hashes , see if urls same or not. but if wants find out urls have subjected dictionary attacks, users takes list of known web sites , sees if hashes matches. might watch out for.

.net - LINQ GroupBy, convert a one-to-one list to a one-to-many -

this can done in million ways ... problem. have list of servers belongs country. countries have many servers, 2 way navigation( think called ) now have list of servers there country set , want group country can opposite list. list of countries there servers attached icollection of country ( servers ) var groupby = list.groupby(x => x.country, x => x, (c, s) => new {c, s}); foreach (var country in groupby) { } this give me result want, have 2 anon types. c country , s list of servers. how can attach list of servers country object's collection. classes this... simplified. public class server { public short sid { get; set; } public country country { get; set; } } public class country { public byte cid { get; set; } public icollection<server> servers { get; set; } } i guess 1 create new country information , put list of servers in constructor ... that's kind of overkill think. well ... odd simple i'm lost here. update

Android: Where can I find the code of the native browser app? -

i view source code of native browser. can find it? thanks floating around in here, somewhere. or, here, more specifically.

replacing the superfluous 'innerHTML' with something else. Javascript -

im looking replacement .innerhtml.. can clear div , replace string of code have.. problem innerhtml forces me use superfluous code (anyone know why?) // , can't seem break '<br> more once in line.. ive tried search answer cant find any. appreciated. use jquery. $('#mydiv').replacewith(whatever); that replace entirety of dom element whatever put in it's place.. $('#mydiv').html(whatever); that retain dom element while replacing of contents of div in same way innerhtml does. $('#mydiv').append(whatever); that retain dom element , it's content , add content onto of element. $('#mydiv').prepend(whatever); that retain dom element , it's content , add content onto front of element.

jquery - Best way to pass parameters from server objects to JavaScript -

i render view table in it. each row of table object edited. so, last column of table has bunch of "edit" buttons. when 1 of these edit buttons clicked, javascript function must pick id of object represented current row. ultimately, end clean html: no "onclick", "onmouseover" attributes , no custom made-up attributes. below have 2 examples i'm not thrilled with. ideas? example 1: view.aspx <td> <input type="button" value="edit" onclick="jsfunction(<%: objectid %>)" /> </td> javascript function jsfunction(id) { //some code whatever id } example 2: view.aspx <td> <input type="button" value="edit" customattribute="<%: objectid %>" /> </td> javascript $('input[type=button]').click(function() { var id = this.attr('customattribute'); //some code whatever id }); p.s. if come better question

php - Is there a simple, universal outbound click tracking method for web pages? -

i'm looking way of tracking outbound clicks web page without modifying of existing page code. solution must work frames, iframes, content different domains, ajax etc. i posted javascript / jquery soluction , unfortunately same origin policy means javascript won't work. this not possible. cannot done server-side because http stateless protocol , don't have control on iframed content different domains. have done client-side , figured out not possible. bottom line if want know sort of thing, have have control on content, including access put page code on iframed content, , page code have modified

iphone - NSManagedObject - NSSet gets removed? -

i have nsmanagedobject nsmanagedobject contains nsset. the data nsset get's lost when call release on nsmanagedobject retain count of 2. wouldn't retaining nsmanagedobject retain it's properties?? - (id)initviewwithmanagedobject :(nsmanagedobject)obj { if (self = [super init]) { self.managedobject = obj; } return self; } - (void)dealloc { self.managedobject = nil; //here when nsset data gets removed [super dealloc]; } below describes how property created @interface mymanagedobject :nsmanagedobject @property (nonatomic, retain) nsset *myset; @end @implementation mymanagedobject @dynamic myset; @end why calling [self.managedobject release] ? should never call -release on results of calling getter. appropriate code here [managedobject release] (assuming managedobject name of backing ivar). furthermore, once release object, why inspecting properties?

php - Best way to approach large MySQL Database organisation? -

i have question relating general approach pretty large mysql database. i've made php code interact database. i'm trying analyse hefty-ish set of data (~130k rows, 200 columns), , have been toying different methods so. i've been learning great deal along way, , feel though close getting setup really speedy, still bit stuck. i began being firmly in 'excel' mindset. continually added more , more columns dataset, trying select various bits , pieces out purpose of statistical analysis. of php/mysql scripts had made took hours. then, @ least basics working, learned joins. bit of revelation guess, resulted in me re-writing joins play nice data. net result massive increase in performance - took hours before takes 15 seconds now. after chatting few people, came conclusion still make faster. way had set different samples of data each contained in different table. each table had it's data summarised in further table used part of joins - general info particular d

iphone - ios uitextfield like notes -

i wish uitextfield seems notes of iphone, yellow lines.. what's best way this? in advance! you mean uitextview right? ... not uitextfield. however, clear background on uitextview. self.textview.backgroundcolor = [uicolor clearcolor]; then create imageview u put subview textview. backgroundimage = [[uiimageview alloc] initwithframe: cgrectmake(0, -14,textview.frame.size.width, textview.fram.size.height)]; set pattern image backgroundcolor. lines. create on or 2 lines . should repeat itself. backgroundimage.backgroundcolor = [uicolor colorwithpatternimage:[uiimage imagenamed:@"lines.png"]; then add subview textview. [self.textview addsubview:backgroundimage]; good luck!

html - fix for a gap in IE for an image -

i have read answers posted issue , tried them all, still have gap. see link site working on http://www.poolboy.ca/ . it's gap between top of pool , menu bar. please help! there's easy fix here. your doctype (first line) this: <!doctype html public "-//w3c//dtd html 4.01 transitional//en"> that doctype triggers quirks mode in ie. if change doctype this: <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> ie in standards mode instead, , gap magically disappear. you instead use html5 doctype, shorter: <!doctype html>

How can I prevent endless recursion with Drupal's node_load()? -

i'm using ubercart product , product_kit modules. great @ linking relevant product kit products included, want link individual product kits may part of. i figured database search on sku/model number (got part done easily), , use node_load($nid) related kit. i have far: function amh_shop_nodeapi(&$node, $op, $a3 = null, $a4 = null) { if ($node->type == 'product') { if ($op == 'load') { error_log("product::load"); $bundles = array(); $results = db_query('select distinct n.nid {node} n right join {uc_products} on up.nid = n.nid up.model "%s /%" or up.model "%/ %s /%" or up.model "%/ %s"', $node->model, $node->model, $node->model); while ($bundle = db_fetch_object($results)) { error_log("bundle::load"); $bundles[] = node_load($bundle->nid); } } } } but, because produ

postgresql - postgres equivilent of oracle sqlplus "set echo on" -

is there equivalent in postgresql of oracle sqlplus "set echo on" can batch input statements echoed in output? i have large file input statements in has few errors when run it. having difficulty finding statement produced error because psql reporting error - not statement generated error. you need pass -a (or --echo-all ) argument psql . it's described @ https://www.postgresql.org/docs/current/static/app-psql.html under options.

java - Most effective way to go from Eclipse Project to Hudson Build -

we want use hudson/jenkins build our project realized entirely in eclipse. can tell, there various ways go b, or e h, were: export ant script, export maven script, export runnable jar while creating ant script that, etc. all of above seem have in common between "this runs in eclipse" , "hudson produces runs" there multiple steps independent, example, can change project, commit svn , trigger hudson build, unless remember "export ant script" in between, fail. is there "one in all" solution ? i'm not worried amount of clicks, instead various steps in between that, make matters worse, needed sometimes. in short: looking goes "i can click on 'run' button , works" "hudson produces works" without every developer having remember every optional step in between. ideas ? edit: of answers far seem suffer same issue: it's parallel development. have eclipse run configuration, , have maven/ant/whatever build. if c

php - CakePHP, how it should be used to create this(inside) app? -

what have following db structure(tables): lists[name,id] list_items[title,list_id,content] i've created needed files , code(the mvc) needed manage first table( lists ). added hasmany model class. @ point stuck. need solution managing each item (basic crud, assume complex management advanced crud find out how myself). specific: since it's content have no place (but admin) used itself, should - create full mvc structure it? (can or should implement somehow[how?] in lists package? if not, how can attach tables? (since use dropped in version 2) would element(cake concept/context) appropriate way create view such situation? any insight appreciated. if undertant correctly, want create crud part of tables yourself, without bake. you need write mvc estrucure , carefull naming combention of cakephp http://cakebaker.42dh.com/2006/02/18/cakephp-conventions/ you need model app/models , a controller app/controllers (remember naming combentions) , each model

Retrieving own cell number in Windows Phone 7 in C# -

how can retrieve own cell phone number , imei in c# windows phone 7? thanks this not accessible information. for list of device information have access to, check link: http://msdn.microsoft.com/en-us/library/ff941122(v=vs.92).aspx

ruby on rails 3 - Display partial unless content_for was defined? -

what want is, show default sidebar content unless current view has else display in sidebar. how this? (rails3) content_for?(:sidebar) ? yield(:sidebar) : render(:partial => "shared/default_sidebar")

multithreading - ConcurrentModificationException Program in java HashMap -

code: map<integer,dealcountupdater> dealcountmap=new hashmap<integer,dealcountupdater>(); public void update(){ for(map.entry<integer, dealcountupdater> e:new hashmap<integer,dealcountupdater>(dealcountmap).entryset()){//line:58 system.out.println(e.hashcode()); } } when run code,get below exception: java.util.concurrentmodificationexception @ java.util.hashmap$hashiterator.nextentry(hashmap.java:793) @ java.util.hashmap$entryiterator.next(hashmap.java:834) @ java.util.hashmap$entryiterator.next(hashmap.java:832) @ java.util.hashmap.putallforcreate(hashmap.java:435) @ java.util.hashmap.<init>(hashmap.java:225) @ org.my.tuan.count.countupdater.update(countupdater.java:58) @ org.my.tuan._maintainer.run(tuansched.java:110) this line countupdater.java:58 : for(map.entry<integer, dealcountupdater> e:new hashmap<integer,dealcountupdater>(dealcountmap).entryset()){

freebsd - How do I switch from Portupgrade to Portmaster? -

i've given freebsd run webserver , use portmaster, it's been installed portupgrade. is there problem if start using portmaster? portupgrade , portmaster interchangeable. can safely use them on 1 box, since separated ports database.

Can I write a dynamic tree structure in C++? -

i need tree n branches in c++, best way code this? or can find implementation? this 1 option, this another, , this .

jquery - Flot Pie Chart with PHP -

i tried add load pie chart dynamically using flot chart , php/mysql. this javascript code <script id="source" language="javascript" type="text/javascript"> function fetchdata() { $.ajax({ url: "test.php", method: "get", datatype: "json", success: function(series) { var data = [ series ]; $.plot($("#graph1"), data, { pie: { show: true, showlabel: true }, legend: { show: false } }); } }); settimeout(fetchdata, 1000); } $(function () { $("#btn").click(function(){ fetchdata(); }); }); this php code <?php include("db.php"); $return_arr = array(); $sql = mysql_query("select item, count(target) counter type='video' , date between '2011-02-21