text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I've got a legacy database with a bunch of idiotically named columns like: ``` some_field_c some_other_field_c a_third_field_c ``` I would very much like to make a Rails ActiveRecord sub-class that automatically aliases these attributes to their name minus the underscore and "c". However, when I tried: ``` attribute...
[ 0.014803880825638771, 0.040045116096735, 0.11015988886356354, 0.05238235369324684, 0.137124702334404, -0.2647460103034973, 0.32401931285858154, 0.04065241292119026, -0.21158352494239807, -0.47662070393562317, 0.07672514021396637, 0.5100493431091309, -0.18080094456672668, 0.1012504473328590...
what's the best way to do it (iterative aliasing or overwriting method missing)? 3. If it's not too much trouble, a very brief code sample of how to do #2 would be awesome. Thanks in advance for any answers this post receives. Your problem is probably that `attributes` is an instance method and you're doing this in th...
[ -0.15237393975257874, 0.03622390702366829, 0.03187749162316322, 0.34400832653045654, -0.1875459998846054, -0.22014033794403076, 0.16662152111530304, 0.16413621604442596, -0.0780261904001236, -0.6723024845123291, 0.2165709137916565, 0.6192334294319153, -0.2742181718349457, -0.32454746961593...
How do I change directory to the directory with my Python script in? So far, I figured out I should use `os.chdir` and `sys.argv[0]`. I'm sure there is a better way then to write my own function to parse argv[0]. ``` os.chdir(os.path.dirname(__file__)) ```
[ -0.09753220528364182, 0.21324920654296875, 0.30756479501724243, -0.34326791763305664, 0.02979525364935398, -0.025876237079501152, 0.23306511342525482, -0.030086718499660492, -0.0758187547326088, -0.8018183708190918, 0.04908139258623123, 0.906226634979248, -0.4180466830730438, 0.13165441155...
I've heard a few debates in the past over which is more mature: RubyCocoa or Obj-C/Cocoa... but I have felt that the answers jet right over the "newbie" that would truly appreciate an answer. So the question is: for a total beginner, with little-to-no programming experience, is it easier to learn Ruby and explore Coco...
[ -0.11878171563148499, 0.11652657389640808, -0.03961721062660217, 0.22429516911506653, -0.1426752358675003, -0.1517973244190216, 0.42082181572914124, 0.15430110692977905, -0.4551711082458496, -0.6067297458648682, -0.029865123331546783, 0.8050147891044617, 0.07612240314483643, -0.39840906858...
would be easier to learn Ruby then tackle Objective-C? **Update**: I apologize, but when I said "learn Ruby and explore Cocoa" I did not mean to learn programming via RubyCocoa, but rather to learn Ruby (and once one feels confident enough) begin to explore Cocoa with the possibility of leveraging their growing skill-...
[ 0.06889048218727112, 0.20397594571113586, -0.14495719969272614, 0.18397656083106995, -0.025309087708592415, -0.14723846316337585, 0.287291020154953, 0.16015666723251343, -0.23627609014511108, -0.6390765905380249, 0.093653604388237, 0.6698464155197144, 0.20773111283779144, -0.18145728111267...
the quirks of RubyCocoa all at the same time. That's a lot of stuff to shove into your head. If you're bound and determined to start with Cocoa, start by learning Objective-C. Otherwise, you could learn Ruby to begin with and then transition to Objective-C once you feel a little more comfortable as a programmer. And o...
[ 0.2980867922306061, 0.16984505951404572, -0.14061203598976135, 0.4144497215747833, 0.00392151577398181, -0.16106390953063965, 0.12440502643585205, 0.31729477643966675, -0.2287033647298813, -0.2192147672176361, 0.05226340517401695, 0.7645056843757629, -0.12705734372138977, -0.09899209439754...
We are making a lab instrument using an ARM9/RTOS system. The client has asked about printing simple reports from the ARM9 system. In this case, we have USB Host support in the RTOS. I'm thinking about printing bitmaps in generic PCL, hoping that will cover the widest range of printers. Is there a better way to approac...
[ 0.4803035259246826, 0.23801706731319427, 0.40726521611213684, 0.226676344871521, 0.4753788411617279, 0.025074824690818787, -0.1417955905199051, -0.06181526929140091, 0.11672455072402954, -0.5735527873039246, 0.3117498457431793, 0.6161210536956787, -0.17879287898540497, -0.08784227073192596...
a USB stick. So that would work, but it's a bit clunky. This will be a C/C++ embedded system Pretending to be a digital camera and interfacing with a PictBridge printer actually sounds pretty clever. It would remove the need to deal with different printer drivers, and if my understanding of the technology is correct, y...
[ 0.5225449800491333, -0.041037384420633316, 0.31682443618774414, 0.5834687948226929, 0.16935203969478607, -0.12260151654481888, -0.24871426820755005, -0.07715604454278946, -0.21410013735294342, -0.5091898441314697, 0.2729903757572174, 0.7868500351905823, -0.1180901899933815, 0.0375962331891...
Print is dead.
[ 0.1186392530798912, 0.35288962721824646, -0.0851074755191803, 0.10561509430408478, 0.23722124099731445, -0.012780330143868923, 0.1642431765794754, 0.3122063875198364, -0.320161372423172, -0.47213828563690186, -0.0749334841966629, 0.313846617937088, -0.2018245905637741, 0.5328080654144287, ...
In Subversion, it is easy to merge a range of changesets/diffs from a branch using "svn merge -r a:b mybranch". But in git, I found it is only possible to cherry-pick a single commit from a branch to apply that patch to my current working branch. So I am wondering if there is a fast way to apply all the commits in one ...
[ 0.513149082660675, -0.53437340259552, 0.05216857045888901, -0.18049149215221405, -0.0515814945101738, -0.10384245961904526, 0.3003154993057251, -0.06630029529333115, -0.3584728240966797, -0.559735894203186, -0.09757627546787262, 0.40484461188316345, -0.5887681245803833, 0.04934501275420189...
commit on top of which the patch series that you want to select is based and that tag B is the commit of the final patch in the series. Also, assume that br is the name of the current branch and the branch where the new patch series should be applied. ``` # Checkout a new temporary branch at the current location git c...
[ 0.3984195590019226, -0.095384381711483, 0.748557448387146, -0.21873748302459717, 0.21807576715946198, -0.02388918213546276, 0.03450535982847214, -0.1694517582654953, -0.3782902956008911, -0.6774913668632507, -0.5654894709587097, 0.4181753695011139, -0.3348003923892975, 0.001834497903473675...
Right now I have a table called Campaigns that has many Hits, if I call say: ``` Campaign.find(30).hits ``` Which takes 4 seconds, or 4213 ms. If I call this instead: ``` campaign = Campaign.find(30) campaign.hits.count ``` Does it still load all of the hits, then count? Or does it see I am counting and avoids l...
[ -0.05601637437939644, 0.33427056670188904, 0.6078824400901794, -0.0664982795715332, -0.4560779333114624, 0.22135213017463684, 0.0422389879822731, -0.3157500624656677, -0.42967489361763, -0.6625823378562927, 0.45221975445747375, 0.532574474811554, -0.22363580763339996, -0.14980098605155945,...
query won't load from the `hits` table, but that is just an example of counting it from a self made query, apposed to Ruby on Rails doing this for me. Would this memcache query be more effecient? (I have it running, but doesn't seem to be any better/faster/slower, just the same speed.) ``` def self.hits Rails.ca...
[ -0.0038435854949057102, 0.11155291646718979, 0.5992303490638733, -0.09863057732582092, -0.3266800045967102, -0.024326978251338005, 0.140166774392128, -0.34345805644989014, -0.10903546214103699, -0.5930484533309937, 0.32137590646743774, 0.7018260955810547, -0.4095211625099182, -0.0535159930...
and hits). ``` belongs_to :campaign, :counter_cache => true ``` You then need a column in the `campaigns` table called `hits_count`. This will avoid hitting `hits` altogether if you're only getting the count. You can check the [API](http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html) for...
[ 0.19904540479183197, 0.03762530907988548, 0.5402295589447021, -0.12238342314958572, -0.19087108969688416, -0.007195383310317993, 0.4585728943347931, -0.42490994930267334, -0.47777581214904785, -0.2992680072784424, -0.0739750862121582, 0.5680447816848755, -0.33048999309539795, -0.0615094117...
Specifically (taking a deep breath): How would you go about finding all the XML name spaces within a C#/.NET `XmlDocument` for which there are no applicable schemas in the instance's `XmlSchemaSet` (`Schemas` property)? My XPath magic is lacking the sophistication to do something like this, but I will keep looking in ...
[ 0.2503831386566162, 0.21944083273410797, 0.29565539956092834, 0.18014879524707794, -0.10829605907201767, -0.4578831195831299, 0.10240881145000458, -0.21251851320266724, 0.03995218500494957, -0.7380729913711548, -0.06616547703742981, 0.4906103312969208, -0.010080455802381039, -0.00931599270...
every element and attribute in the document var allNodes = xmlDoc.SelectNodes("//(*|@*)"); var found = new Dictionary<String, bool>(); // Want a Set<string> really foreach (XmlNode n in allNodes) { found[n.NamespaceURI] = true; } var allNamespaces = found.Keys.OrderBy(s => s); ```
[ 0.02913183532655239, 0.07167845964431763, 0.4122397303581238, 0.032845478504896164, 0.10462059080600739, 0.003157788421958685, 0.1125030592083931, -0.24591991305351257, -0.02489105798304081, -0.6257887482643127, -0.5872024297714233, 0.277339369058609, -0.28590497374534607, -0.1719886958599...
What is the fastest way to execute a method on an ASP.NET website? The scenario is pretty simple: I have a method which should be executed when a web page is hit. Nothing else is happening on the page, the only rendered output is a "done" message. I want the processing to be as fast as possible. Every single hit is u...
[ 0.0465879924595356, -0.12912051379680634, 0.10515857487916946, 0.2051202803850174, -0.3370773494243622, -0.1488608717918396, 0.3334892988204956, 0.03384805843234062, -0.24751465022563934, -0.7173888683319092, 0.12215232104063034, 0.16528794169425964, -0.15364032983779907, -0.18275007605552...
accomplish this than using HttpHandlers? Depending on what you're doing, I wouldn't expect to see a lot of improvement over just using an HttpHandler. I'd start by just writing the HttpHandler and seeing how it performs. If you need it to be faster, try looking more closely at the things you're actually doing while pro...
[ 0.6488930583000183, -0.19302359223365784, 0.05971938371658325, 0.3054637908935547, -0.04305551201105118, -0.1742587685585022, 0.13902431726455688, -0.023099400103092194, -0.42988336086273193, -0.986075222492218, 0.43960291147232056, 0.6705812215805054, 0.05433003976941109, -0.2877346575260...
though, I'd stick with whatever's easiest for you to write. For reference, I've written an ad server in ASP.NET (using HttpHandlers) that can serve an ad (including targeting and logging the impression to a local database) in 0-15ms under load. I thought I was doing quite a bit of processing - but that's a pretty good...
[ 0.3947628438472748, 0.11111868917942047, 0.6619523763656616, 0.01001251395791769, -0.3173123002052307, -0.21722884476184845, 0.49462562799453735, 0.07534162700176239, -0.10510696470737457, -0.9910478591918945, -0.04888744652271271, 0.47474756836891174, -0.09867436438798904, -0.099706791341...
FormsAuthentication * PassportAuthentication * RoleManager * UrlAuthorization * FileAuthorization * AnonymousIdentification * Profile * ErrorHandler * ServiceModel Like I said above, my ad server doesn't use any of these, so I've just done this in that app's web.config: ``` <httpModules> <clear /> </httpModules> ...
[ -0.028182391077280045, -0.06899876147508621, 0.6351794004440308, 0.022877944633364677, -0.029019135981798172, -0.5497257113456726, 0.5472323894500732, -0.48813775181770325, -0.19317470490932465, -0.7735213041305542, -0.24883684515953064, 0.46717020869255066, -0.25877583026885986, -0.255348...
IIS7. Here is [how to clear HTTP Modules in IIS7](https://serverfault.com/questions/72338/iis7-lock-violation-error-http-handlers-modules-and-the-clear-element)
[ -0.4754784107208252, -0.14154364168643951, 0.6589165925979614, -0.16164356470108032, 0.11015583574771881, -0.3241703510284424, 0.6597445011138916, -0.29501858353614807, -0.4501520097255707, -0.5170504450798035, -0.4889756739139557, 0.5284872055053711, -0.1483631283044815, -0.30913433432579...
Say you have an app, that you want to provide users ability to browse the system32 directory and execute programs in (like telnet). What is the best method for supporting this when you need to support XP onwards as a client and 2k onwards for server? *Having written all this up I wonder if it's just too much time/eff...
[ 0.4696597456932068, 0.08070239424705505, 0.32106900215148926, 0.19099080562591553, -0.22295545041561127, -0.032892532646656036, 0.1731622815132141, 0.09566483646631241, -0.43501943349838257, -0.6961557269096375, -0.11130532622337341, 0.3108725845813751, -0.07113100588321686, -0.15667335689...
you to browse/execute 64 bit. Issues are: * only available in Vista/Longhorn, so no support for XP 64 * leads to different path naming, can't use same path on multiple versions. * will be active for whole of windows, not just our app * may not (probably is not) appropriate to do when installing the app * allows to...
[ 0.18110710382461548, 0.02394748479127884, 0.46763432025909424, 0.35436809062957764, 0.12429806590080261, -0.19544550776481628, 0.5851622819900513, 0.04757508262991905, -0.38447877764701843, -0.7218668460845947, -0.38878971338272095, 0.8401380777359009, -0.4414629340171814, 0.01343329902738...
bit - have to mess with GetProcAddress * available only under certain service packs * must individually identify all locations that this should be implemented * user will need to provide seperate information about whether this is a 64 bit app or 32 bit. If anybody had some example code which displayed a Windows Ope...
[ 0.5644598007202148, -0.022044222801923752, 0.4022104740142822, 0.36770862340927124, -0.1022343784570694, -0.20781494677066803, 0.6045987606048584, -0.0026706454809755087, -0.35692790150642395, -0.576524019241333, -0.19461070001125336, 0.7075080871582031, -0.4666473865509033, 0.095772258937...
CreateProcess((wchar_t*)exeName.c_str(), (wchar_t*)cmdLine.c_str(), NULL, NULL, FALSE, CREATE_SEPARATE_WOW_VDM, NULL, workingDir.c_str(), &startupInfo, &processInfo); ``` I've gone with option 2, For those who might be interested; here is my quick hack at a scoped version of managing the disabling of Wow64 redirection...
[ -0.02067088522017002, 0.14760123193264008, 0.4638156294822693, -0.16033333539962769, 0.1833108365535736, -0.11523380875587463, 0.37681853771209717, -0.33862966299057007, -0.09617553651332855, -0.7178264260292053, -0.31314945220947266, 0.8205395340919495, -0.3589261770248413, 0.134734496474...
GetModuleHandle(TEXT("kernel32")),"Wow64DisableWow64FsRedirection"); if( LPFN_Disable ) { LPFN_Disable(&OldValue); } } ~Wow64RedirectOff() { if( LPFN_Disable ) { FN_Wow64RevertWow64FsRedirection LPFN_Revert = (FN_Wow64RevertWow64FsRedirection)GetProcAddress( ...
[ -0.5097207427024841, -0.061442289501428604, 0.8533105254173279, -0.2190323770046234, 0.31713005900382996, -0.15043328702449799, 0.21785487234592438, -0.3497838079929352, -0.17923375964164734, -0.5079343318939209, -0.7179850935935974, 0.9057196974754333, -0.4584294557571411, -0.038454066962...
if( LPFN_Revert ) { LPFN_Revert(OldValue); } } } private: FN_Wow64DisableWow64FsRedirection LPFN_Disable; PVOID OldValue; }; ``` And thus usage would be ``` Wow64RedirectOff scopedRedirect; //CFileOpen //CreateProcess ```
[ -0.05126894265413284, 0.15160775184631348, 0.5990642309188843, -0.30010637640953064, 0.45597177743911743, -0.3038894534111023, 0.1696600615978241, -0.1789475977420807, -0.055577099323272705, -0.3966502845287323, -0.5025876760482788, 0.887470543384552, -0.3521876037120819, 0.182183325290679...
I have the feeling that [Flash](http://en.wikipedia.org/wiki/Adobe_Flash)-based ( or [Silverlight](http://en.wikipedia.org/wiki/Microsoft_Silverlight)-based) websites are generally frowned upon, except when you are creating games or multimedia-content rich applications. Why this is so? Flash is infamous for its poor ac...
[ 0.19338564574718475, 0.3784409463405609, 0.16612327098846436, 0.2589246332645416, -0.15563030540943146, -0.67659991979599, 0.1442086398601532, 0.38353675603866577, -0.1832054704427719, -0.5303667187690735, -0.07507539540529251, 0.4168585538864136, -0.35602155327796936, 0.09232408553361893,...
source code of any website you are in. This way you can use the same programming/design techniques in your website or you can find security flaws in the web application. This is not possible in Flash. In Flash, source code is closed. The big question is, why should you use Flash "except when you are creating games or ...
[ 0.43545910716056824, 0.5374700427055359, 0.09636207669973373, 0.334842711687088, 0.07859665155410767, -0.7589269876480103, 0.15873101353645325, 0.2746872007846832, -0.05668966844677925, -0.6007733941078186, -0.38717347383499146, 0.6581884026527405, -0.3209521472454071, -0.01994950324296951...
Using standard mysql functions is there a way to write a query that will return a list of days between two dates. eg given 2009-01-01 and 2009-01-13 it would return a one column table with the values: ``` 2009-01-01 2009-01-02 2009-01-03 2009-01-04 2009-01-05 2009-01-06 2009-01-07 2009-01-08 2009-01-09 ...
[ -0.045560941100120544, 0.06218444183468819, 0.6290022730827332, 0.029833335429430008, -0.09808323532342911, 0.12812697887420654, 0.2978358566761017, 0.03999745100736618, -0.11309248954057693, -0.3025231659412384, -0.05888422951102257, 0.20520853996276855, -0.2773059606552124, 0.17612186074...
side of some of this join for some days and will handle this). I would use this stored procedure to generate the intervals you need into the temp table named **time\_intervals**, then JOIN and aggregate your data table with the temp **time\_intervals** table. The procedure can generate intervals of all the different t...
[ 0.4246531128883362, -0.27553319931030273, 0.8039190173149109, 0.09069907665252686, 0.2931253910064697, 0.10463877022266388, 0.21048590540885925, -0.35050052404403687, 0.06323819607496262, -0.5391631722450256, 0.14162738621234894, 0.7338384389877319, -0.03438849747180939, 0.0367278493940830...
2009-01-06 00:00:00 2009-01-06 23:59:59 2009-01-07 00:00:00 2009-01-07 23:59:59 2009-01-08 00:00:00 2009-01-08 23:59:59 2009-01-09 00:00:00 2009-01-09 23:59:59 . call make_intervals('2009-01-01 00:00:00','2009-01-01 02:00:00',10,'MINUTE') . select * from time_intervals . interval_start interval_end ...
[ -0.2836630940437317, -0.09032918512821198, 0.8748313188552856, 0.05796227231621742, 0.0740727037191391, 0.5747314691543579, 0.4854874610900879, -0.12206254154443741, 0.029353195801377296, -0.5889220833778381, 0.12448437511920929, 0.784991443157196, -0.005508545786142349, -0.057805713266134...
data timestamps with a "between interval_start and interval_end" type of JOIN. . Code for the proc: . -- drop procedure make_intervals . CREATE PROCEDURE make_intervals(startdate timestamp, enddate timestamp, intval integer, unitval varchar(10)) BEGIN -- *****************************************************************...
[ -0.2446231096982956, -0.27643510699272156, 0.6408953070640564, 0.25761184096336365, 0.22909638285636902, 0.16093012690544128, -0.12252820283174515, -0.2565286457538605, -0.09206478297710419, -0.7678937911987305, -0.15784890949726105, 0.04043809697031975, -0.25345465540885925, -0.1805080026...
-- ************************************************************************* drop temporary table if exists time_intervals; create temporary table if not exists time_intervals ( interval_start timestamp, interval_end timestamp ); -- *****************************************************...
[ -0.5384714603424072, -0.0075101787224411964, 0.8166984915733337, 0.17417873442173004, 0.38389918208122253, 0.18740394711494446, -0.14790059626102448, -0.24350132048130035, -0.4037242829799652, -1.1502597332000732, -0.4210541844367981, 0.04065954312682152, 0.34340226650238037, 0.34151640534...
then timestampadd(MICROSECOND, intval, thisDate) when 'SECOND' then timestampadd(SECOND, intval, thisDate) when 'MINUTE' then timestampadd(MINUTE, intval, thisDate) when 'HOUR' then timestampadd(HOUR, intval, thisDate) when 'DAY' then timestampadd...
[ -0.2880978286266327, -0.18524442613124847, 0.5406811237335205, -0.4764929413795471, -0.12129352986812592, 0.5103611350059509, 0.28305909037590027, -0.3533362150192261, -0.3457741439342499, -1.106675624847412, -0.1103285402059555, 0.02863791026175022, 0.13587906956672668, 0.4627164900302887...
when 'WEEK' then timestampadd(WEEK, intval, thisDate) when 'MONTH' then timestampadd(MONTH, intval, thisDate) when 'QUARTER' then timestampadd(QUARTER, intval, thisDate) when 'YEAR' then timestampadd(YEAR, intval, thisDate) end into nextDate;
[ -0.23994150757789612, 0.015756752341985703, 0.6627294421195984, -0.5042789578437805, -0.2760281264781952, 0.33116817474365234, 0.3343653678894043, -0.08572312444448471, -0.578339695930481, -0.6502569913864136, -0.2641746401786804, -0.1604219526052475, 0.23805449903011322, 0.438267111778259...
insert into time_intervals select thisDate, timestampadd(MICROSECOND, -1, nextDate); set thisDate = nextDate; until thisDate >= enddate end repeat; END; ``` Similar example data scenario at the bottom of [this post](https://stackoverflow.com/questions/373490/insert-dates-in-the-return-from-a-query-where...
[ 0.04080113023519516, -0.45464980602264404, 0.24848097562789917, -0.09402977675199509, 0.5284594893455505, -0.17432387173175812, -0.07295823097229004, -0.05371824651956558, -0.045126285403966904, -0.37707453966140747, -0.10074427723884583, 0.47677600383758545, -0.1380322426557541, 0.0788087...
1. Will using [MVC enabled Telerik controls](http://blogs.telerik.com/AtanasKorchev/Posts/08-11-06/ASP_NET_Ajax_Controls_in_ASP_NET_MVC.aspx) with ASP.NET MVC violate the MVC model? 2. And if not, what kind of performance hit (versus features and development speed) will there be with using Telerik controls over manuall...
[ 0.27066755294799805, 0.050560738891363144, 0.21512748301029205, 0.14390814304351807, -0.16619956493377686, -0.29652416706085205, 0.21941456198692322, -0.5796205401420593, 0.01832962967455387, -0.5930988788604736, -0.021951237693428993, 0.5679118633270264, -0.4458978772163391, -0.0312768183...
grid or populate the menu - but still the code is in the View (ASPX) and is entirely related with the presentation (again this is just my opinion so I might be wrong). I should also mention that there are some limitations indeed - some of the built-in features (that rely on postback) do not work in MVC. However will w...
[ 0.4261278808116913, -0.3852701187133789, 0.2471967339515686, 0.22260771691799164, -0.2630215883255005, -0.2755012512207031, -0.045827168971300125, 0.3544388711452484, -0.2964489758014679, -0.8708599209785461, -0.10257906466722488, 0.5086132287979126, -0.2932901978492737, -0.097071796655654...
I'm trying to compile a simple program, with ``` #include <gtkmm.h> ``` The path to `gtkmm.h` is `/usr/include/gtkmm-2.4/gtkmm.h`. g++ doesn't see this file unless I specifically tell it `-I /usr/include/gtkmm-2.4`. My question is, how can I have g++ automatically look recursively through all the directories in `/...
[ 0.09981121867895126, 0.28363654017448425, 0.21010710299015045, -0.07747578620910645, -0.026473117992281914, -0.14304521679878235, 0.5402694940567017, -0.09736429899930954, -0.017431868240237236, -0.637319028377533, -0.21524479985237122, 0.750847339630127, -0.4313332140445709, -0.0591984093...
$(BINS) program: $(program_OBJS) $(CXX) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@ # this part is actually optional, since it's covered by gmake's implicit rules %.o: %.cc $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ ``` If you're missing `gtkmm-2.4`, this will produce ``` $ make Package gtkmm-2.4 wa...
[ 0.18697892129421234, 0.11965418606996536, 0.5184412598609924, -0.07461759448051453, 0.07663264870643616, -0.18674199283123016, 0.3301420211791992, -0.1430966556072235, -0.21053941547870636, -0.30616575479507446, -0.2816733121871948, 0.678280770778656, -0.5708297491073608, -0.03943868726491...
the output of `pkg-config --cflags --libs gtkmm-2.4`: that's far more than you want to type by hand, ever.)
[ -0.1476302593946457, 0.15064291656017303, 0.34121468663215637, 0.005007433705031872, 0.015323173254728317, -0.015050581656396389, 0.0857963040471077, 0.16068576276302338, -0.02654867433011532, -0.4486490786075592, -0.13854841887950897, 0.6064860224723816, -0.33062314987182617, -0.132335692...
I've been looking at some server logs using `tail -f` recently, and have thought that it'd be much easier to see some things if I could format the output. Really all I'm looking for is a way to perhaps colour certain words (determined by a regex), and perhaps remove certain words (again, determined by a regex). I [kno...
[ 0.18511560559272766, -0.10267060995101929, 0.4787062406539917, -0.08385081589221954, 0.023158185184001923, -0.11813946068286896, 0.24893635511398315, 0.02951166406273842, -0.28280070424079895, -0.6671660542488098, -0.2169879525899887, 0.49437448382377625, -0.4406326711177826, -0.1663400083...
and all quoted strings in bright yellow (color 93): ``` RED=`echo -en '\e[31m'` YELLOW=`echo -en '\e[93m'` RESET=`echo -en '\e[00m'` tail -f file | sed -E "s/([0-9]+)/$RED\1$RESET/g;s/(\"[^\"]*\")/$YELLOW\1$RESET/g" ```
[ -0.16219939291477203, 0.2611587941646576, 0.5014877915382385, -0.32469916343688965, -0.06694351136684418, 0.24357227981090546, 0.18404686450958252, -0.15687787532806396, -0.1786465346813202, -0.0009987254161387682, -0.4969142973423004, 0.4460376501083374, -0.5824951529502869, -0.0508467592...
On e of my current requirements is to take in an Excel spreadsheet that the user updates about once a week and be able to query that document for certain fields. As of right now, I run through and push all the Excel (2007) data into an xml file (just once when they upload the file, then I just use the xml) that then h...
[ 0.23470439016819, 0.2978505790233612, 0.6636633276939392, 0.09271805733442307, 0.2823526859283447, -0.216963529586792, -0.2632138431072235, -0.2157418578863144, -0.09340499341487885, -0.5780810117721558, -0.14472313225269318, 0.6566497087478638, 0.027470918372273445, -0.17754872143268585, ...
querying an XML file with Linq and an Excel file with OledbConnection? Am I just adding another unneccesary step? I suppose the followup question would be, is it worth it for ease of use to keep pushing it to xml. The file has about 1000 rows. For something that is done only once per week I don't see the need to perfo...
[ 0.10961737483739853, 0.08386306464672089, 0.5475441217422485, 0.25421351194381714, -0.08632006496191025, -0.07455407083034515, 0.18980494141578674, -0.1333932727575302, -0.10313951224088669, -0.6154178977012634, 0.300401896238327, 0.48469147086143494, -0.20052897930145264, -0.2141052633523...
Given an absolute URI/URL, I want to get a URI/URL which doesn't contain the leaf portion. For example: given <http://foo.com/bar/baz.html>, I should get <http://foo.com/bar/>. The code which I could come up with seems a bit lengthy, so I'm wondering if there is a better way. ``` static string GetParentUriString(Uri ...
[ 0.20680180191993713, -0.03372662514448166, 0.7926937937736511, -0.20803946256637573, -0.038898833096027374, -0.2365276962518692, 0.13181979954242706, -0.20964281260967255, 0.12559710443019867, -0.4984894096851349, -0.38238945603370667, 0.2997051775455475, -0.38811489939689636, 0.4531824290...
// Appned the '://' after the http, ftp etc. parentName.Append("://"); // Append the host name www.foo.com parentName.Append(uri.Host); // Append each segment except the last one. The last one is the // leaf and we will ignore it. for (int i = 0;
[ 0.056831054389476776, 0.33984729647636414, 0.7606080770492554, -0.2837620973587036, -0.06606768071651459, 0.1441701054573059, 0.2407776415348053, 0.3335862159729004, -0.272622674703598, -0.36268383264541626, -0.2509746551513672, -0.07124542444944382, -0.5468355417251587, 0.4291391670703888...
i < uri.Segments.Length - 1; i++) { parentName.Append(uri.Segments[i]); } return parentName.ToString(); } ``` One would use the function something like this: ``` static void Main(string[] args) { Uri uri = new Uri("http://foo.com/bar/baz.html"); ...
[ 0.1212574690580368, 0.17937803268432617, 0.681976854801178, -0.5693044066429138, -0.13376165926456451, 0.5020168423652649, 0.21829910576343536, -0.0977020189166069, -0.2365439087152481, -0.5680625438690186, -0.19383114576339722, 0.09922872483730316, -0.4226951003074646, 0.9061090350151062,...
string parentName = GetParentUriString(uri); } ``` Thanks, Rohit This is the shortest I can come up with: ``` static string GetParentUriString(Uri uri) { return uri.AbsoluteUri.Remove(uri.AbsoluteUri.Length - uri.Segments.Last().Length); } ``` If you want to use the Last() method, ...
[ -0.062418024986982346, -0.2714933454990387, 0.549841046333313, -0.03277597576379776, 0.3220216631889343, 0.06054118648171425, 0.21417073905467987, 0.052609849721193314, 0.047595083713531494, -0.4151897132396698, -0.05862700566649437, 0.3650175929069519, -0.32326680421829224, 0.511757373809...
Is there an established algorithm for finding redundant edges in a graph? For example, I'd like to find that a->d and a->e are redundant, and then get rid of them, like this: ![alt text](https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Tred-G.png/124px-Tred-G.png) => ![alt text](https://upload.wikimedia.org/...
[ -0.2316216677427292, -0.1431742012500763, 0.3379679024219513, 0.15991351008415222, -0.4988589584827423, 0.031629085540771484, 0.2009115070104599, -0.2812447249889374, -0.40626412630081177, -0.4489130675792694, -0.17996534705162048, 0.1920260637998581, -0.23468613624572754, -0.0672318935394...
I am making a list with a heading and subheadings. My main list, Home1, is followed by a subheading. How can I exactly position the subheading content without affecting another list? ``` <div id="wrapper"> <ul id="testnav"> <li> <a href="#">Home</a> <ul id="subnav"> ...
[ 0.26515477895736694, -0.0038458204362541437, 0.3290689289569855, -0.305062472820282, -0.1153164952993393, 0.1643967479467392, 0.1960955560207367, -0.19946043193340302, -0.07449473440647125, -0.7778082489967346, -0.07372958958148956, 0.13258953392505646, -0.2214546948671341, 0.2211201339960...
<li><a href="#">Sub Heading</a></li> <li><a href="#">Sub Heading</a></li> <li><a href="#">Sub Heading</a></li> </div> <div STYLE="float : left; width :30%; height:900px;">
[ -0.23581144213676453, -0.40164560079574585, 0.5736200213432312, -0.17044761776924133, -0.24343934655189514, 0.22991538047790527, 0.1770399659872055, -0.3574296832084656, -0.22169511020183563, -0.3921934962272644, -0.16903731226921082, 0.22783559560775757, 0.09697624295949936, 0.15185281634...
Sub Heading Content </div> </ul> </li> <li><a href="#">Home2</a></li> <li><a href="#">Home3</a></li> <li><a href="#">Home4</a></li> <li><a href="#">Home5</a></li> </ul> </div> #testnav {
[ -0.13764093816280365, -0.2740943729877472, 0.1145595833659172, 0.24662736058235168, -0.23151275515556335, 0.09724690765142441, 0.21834030747413635, -0.468930721282959, -0.017752934247255325, -0.4620789885520935, -0.1813909411430359, -0.011691509746015072, -0.15733122825622559, 0.1396707147...
list-style: none; padding: 0; marigin: 10px 10px 10px 0; width: 900px; } #subnav { list-style: none; padding: 0; marigin: 10px 10px 10px 0; width: 300px; } ``` If you own a Mac, you can download the iPhone SDK which comes with an iPhone simulator. It works not only for debugging a native ap...
[ -0.14686940610408783, -0.21025951206684113, 0.5078149437904358, 0.08987811952829361, -0.038913313299417496, 0.11020412296056747, 0.5282121896743774, -0.01342100091278553, -0.40984344482421875, -0.5635710954666138, -0.3933752477169037, 0.7216730713844299, -0.28354862332344055, -0.2681824862...
Ok! I'm ready to embark on some .NET development for the first time. I've recently installed Microsoft Visual Studio which included Microsoft SQL Sever 2005. What is the prefered method for programming against a development database? I want to write an ASP.NET application that uses a database and I'm not sure how to...
[ 0.19041970372200012, 0.2362552285194397, 0.20118458569049835, 0.004442723002284765, -0.2869953513145447, -0.1815640777349472, 0.3709082007408142, 0.10431531816720963, -0.3406631648540497, -0.5892468690872192, 0.4224189519882202, 0.6411897540092468, 0.08788977563381195, -0.06419916450977325...
Will I be creating a full fledged SQL Server database or a "flat-file" fake database to program against? Can someone please tell me what is up on creating my first MS SQL Server 2005 database? If you've Visual Studio, just goto server explorer, Add a new database connection to your database, and start off. Or, create...
[ 0.538666307926178, 0.22326187789440155, 0.33420246839523315, 0.11600154638290405, -0.17085742950439453, -0.1471414715051651, -0.029368896037340164, -0.023223716765642166, -0.26980429887771606, -0.658682644367218, 0.24008530378341675, 0.6137473583221436, -0.2273460328578949, -0.022401543334...
:) You might want to watch the videos in ASP.NET website <http://www.asp.net/learn/> Otherwise, consider using Microsoft SQL Server Management Studio (an express edition is also available).
[ 0.29795658588409424, -0.05069592595100403, 0.2816787660121918, 0.4813641905784607, -0.09832486510276794, -0.31511542201042175, 0.011144398711621761, -0.020759396255016327, -0.19719994068145752, -0.6298354864120483, -0.31217581033706665, 0.4887971580028534, 0.15331396460533142, -0.244966804...
Specifically, what am I supposed to do with the view that is now hidden after pushing on a new view controller? In my situation I have a view with animations going on, that continue to execute after the view is off screen. Is there some accepted convention? Do I remove the View Controller and View from memory? D...
[ 0.2370026409626007, 0.06092045083642006, 0.06501427292823792, 0.1176314428448677, 0.3275601267814636, 0.06703827530145645, -0.09980443865060806, 0.08687366545200348, -0.6460736989974976, -0.4273952841758728, -0.053302377462387085, 0.4258929491043091, -0.07497237622737885, 0.072804361581802...
can point me to? Thanks Under low memory conditions, your controller's 'view' property will automatically be set to nil, if it's not on screen. Then the view will automatically load again when it is needed - and viewDidLoad should get called at that time. If your view controller is retaining any subviews of the top-l...
[ 0.12821541726589203, -0.12821297347545624, 0.8791405558586121, -0.045016273856163025, 0.03827133774757385, 0.009157568216323853, 0.2212713360786438, -0.13343973457813263, 0.12573939561843872, -0.73781818151474, -0.37434473633766174, 0.47609663009643555, -0.0988142192363739, 0.4003545343875...
if (view == nil) { // Release other views // self.someView = nil; } } ```
[ 0.1515907645225525, 0.04198390245437622, 0.2508862614631653, -0.13428595662117004, -0.0855880081653595, -0.09732826799154282, 0.10656580328941345, -0.06713925302028656, 0.0724964290857315, -0.43786048889160156, -0.07474427670240402, 0.7736502289772034, -0.16935332119464874, 0.2818315625190...
I've successfully done this for IE7. FF, no dice. any ideas? Thanks! ``` var range= window.getSelection().getRangeAt(0); alert('Current position: '+range.startOffset+' inside '+range.startContainer); range.setStart(newParent, textOffset); range.setEnd(newParent, textOffset); ```
[ -0.008738216944038868, -0.1818641722202301, 0.8654703497886658, -0.22273369133472443, 0.26657214760780334, -0.1945149451494217, 0.8383380770683289, -0.2479422688484192, 0.0012503629550337791, -0.7664136290550232, -0.5553401708602905, 0.7761246562004089, -0.158626988530159, -0.2268941849470...
Say I have an interface `IFoo` and I want all subclasses of `IFoo` to override Object's `ToString` method. Is this possible? Simply adding the method signature to IFoo as such doesn't work: ``` interface IFoo { String ToString(); } ``` since all the subclasses extend `Object` and provide an implementation that...
[ 0.2049047201871872, 0.22082243859767914, 0.3218022286891937, -0.10114219784736633, -0.014971699565649033, -0.3186657428741455, 0.228517085313797, -0.09686645865440369, -0.027032962068915367, -0.610843300819397, 0.07423258572816849, 0.5397460460662842, -0.49021151661872864, 0.28239175677299...
Is there a way of reading one single character from the user input? For instance, they press one key at the terminal and it is returned (sort of like `getch()`). I know there's a function in Windows for it, but I'd like something that is cross-platform. Here's a link to the ActiveState Recipes site that says how you ca...
[ 0.2523985207080841, -0.06445199251174927, 0.038510072976350784, -0.006888002622872591, -0.0883713886141777, 0.1982736587524414, 0.23966200649738312, -0.033332109451293945, -0.10959400981664658, -0.6822567582130432, -0.15116125345230103, 0.472934365272522, -0.22071552276611328, -0.135317668...
try: self.impl = _GetchWindows() except ImportError: self.impl = _GetchUnix() def __call__(self): return self.impl() class _GetchUnix: def __init__(self): import tty, sys def __call__(self): import sys, tty, termios fd = sys.stdin.fileno()
[ -0.22367513179779053, -0.11639406532049179, 0.09849507361650467, -0.15102747082710266, 0.12313027679920197, 0.2700720429420471, 0.49106210470199585, -0.15853522717952728, 0.005686542019248009, -0.5017122626304626, -0.34465888142585754, 0.7899837493896484, -0.4524194300174713, -0.2139374613...
old_settings = termios.tcgetattr(fd) try: tty.setraw(sys.stdin.fileno()) ch = sys.stdin.read(1) finally: termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) return ch class _GetchWindows: def __init__(self): import msvcrt def __call__(self...
[ -0.14706604182720184, -0.03764298930764198, 0.7022074460983276, -0.14613299071788788, 0.2914857268333435, 0.038884058594703674, 0.31303152441978455, -0.2987217903137207, -0.04867718741297722, -0.7011018991470337, -0.31536591053009033, 0.8178661465644836, -0.1268874704837799, 0.328889310359...
return msvcrt.getch() getch = _Getch() ```
[ -0.2085758000612259, 0.06704478710889816, 0.6056156158447266, -0.2227562814950943, 0.2823212444782257, -0.18229179084300995, 0.423439085483551, -0.014807057566940784, -0.12235697358846664, -0.5825356245040894, -0.520933985710144, 0.8355982303619385, -0.4047923684120178, 0.3538708984851837,...
What is the best way to generate random numbers using Objective-C on iOS? If I use `(int)((double) rand() / ((double)(RAND_MAX) + (double) 1) * 5.0)` to generate a number from 0 to 4, every time I start the program on the iPhone it generates the same numbers to start off with. There is a very similar question [here ...
[ -0.02649347484111786, 0.11174485832452774, 0.1459517925977707, -0.006318480242043734, 0.15157653391361237, 0.3191176652908325, 0.09032151848077774, -0.4058725833892822, -0.3985411822795868, -0.2169833481311798, 0.06618515402078629, 0.5539048910140991, -0.33600977063179016, -0.4382872581481...
Is there a built in way to create round-cornered UILabels? If the answer is no, how would one go about creating such an object? iOS 3.0 and later ----------------- iPhone OS 3.0 and later supports the `cornerRadius` property on the `CALayer` class. Every view has a `CALayer` instance that you can manipulate. This mean...
[ 0.10144581645727158, 0.010559847578406334, 0.6312115788459778, 0.05615507438778877, -0.3647976517677307, 0.36147475242614746, -0.281495064496994, 0.09511934965848923, 0.11235251277685165, -0.6575618982315063, 0.34495264291763306, 0.675851583480835, -0.2140183299779892, 0.16133539378643036,...
rounded rectangle, and then make the UILabel or, in my case, UITextView, a subview inside of it. Specifically: 1. Create a `UIView` subclass and name it something like `RoundRectView`. 2. In `RoundRectView`'s `drawRect:` method, draw a path around the bounds of the view using Core Graphics calls like CGContextAddLineT...
[ -0.004911048803478479, -0.18956151604652405, 0.8433193564414978, 0.09600459784269333, -0.6175553798675537, 0.21801190078258514, -0.21535514295101166, -0.3899799883365631, 0.13279961049556732, -0.6943929195404053, 0.08844375610351562, 0.5327122211456299, -0.019365763291716576, 0.08605867624...
Interface Builder if you create a generic UIView and then change its class using the inspector. You won't see the rectangle until you compile and run your app, but at least you'll be able to place the subview and connect it to outlets or actions if needed.
[ 0.2991122305393219, -0.4680938720703125, 0.3244258463382721, 0.3498108386993408, -0.35652029514312744, -0.09076894074678421, 0.4251110851764679, -0.3702216148376465, 0.045315537601709366, -1.1206092834472656, 0.06314385682344437, 0.46821340918540955, -0.23952485620975494, 0.115026056766510...
I want to pass a variable to a UIButton action, for example ``` NSString *string=@"one"; [downbutton addTarget:self action:@selector(action1:string) forControlEvents:UIControlEventTouchUpInside]; ``` and my action function is like: ``` -(void) action1:(NSString *)string{ } ``` However, it returns a syntax er...
[ 0.00755160441622138, -0.13816165924072266, 0.48711341619491577, -0.19211432337760925, 0.03438450023531914, 0.20053942501544952, 0.22163406014442444, -0.4742845296859741, -0.0777132660150528, -0.5026845335960388, -0.41212156414985657, 0.547734797000885, -0.5107612013816833, -0.2023916989564...
I noticed that Eclipse (Flex Builder) generates hundreds of metadata files. Should I check them into my source control? They seem necessary, because if I delete them Flex Builder just opens up an empty workbench... Some of these files plainly do not belong in source control (like .history files and some cache files). ...
[ 0.7022671103477478, 0.11564585566520691, 0.034002047032117844, 0.14920279383659363, -0.12079660594463348, -0.17604663968086243, 0.02081960253417492, -0.2485722005367279, -0.4310014545917511, -0.5298216342926025, -0.00811393279582262, 0.5304206609725952, -0.18337786197662354, 0.220749780535...
if I were to ignore the inefficiency, because Eclipse generates new ones constantly, with different names, which in turn also seem to be crucial for the project to load. Can someone please enlighten me? Don't check in the hundreds of metadata files. If you want to be able to check out the project in a way that it can ...
[ 0.7410793900489807, -0.1563560962677002, 0.043106768280267715, 0.1309412121772766, -0.15184007585048676, -0.3694615066051483, 0.1526331901550293, -0.04211447760462761, -0.42188000679016113, -0.6839631795883179, -0.024139873683452606, 0.511724054813385, -0.09201394766569138, -0.189363345503...
I have a networking Linux application which receives RTP streams from multiple destinations, does very simple packet modification and then forwards the streams to the final destination. How do I decide how many threads I should have to process the data? I suppose, I cannot open a thread for each RTP stream as there co...
[ 0.4131803512573242, 0.12333404272794724, 0.10730645060539246, 0.13755248486995697, 0.04913409426808357, 0.09116672724485397, 0.03676637262105942, 0.014017311856150627, -0.4137709140777588, -0.7862088084220886, 0.16613224148750305, 0.39717236161231995, -0.23374521732330322, 0.24786828458309...
cpu more faster by having more threads but you make it more likely a thread will always appear at within a given period to handle a request. Having a bunch of threads which just move data in parallel is a rather inefficient shot-gun (Creating one thread per request naturally just fails completely). Using the [thread ...
[ 0.1031312644481659, -0.3540239930152893, 0.23718391358852386, 0.503699779510498, -0.23418118059635162, 0.009835436008870602, 0.20101912319660187, -0.07678517699241638, -0.6463760733604431, -1.0090047121047974, 0.030676541849970818, 0.5475209355354309, -0.12372322380542755, -0.0701911896467...
and not increase speed. Think the problem of organizing server threads as akin to organizing a line in a super market. Would you like to have a lot of cashiers who work more slowly or one cashier who works super fast? The problem with the fast cashier isn't speed but rather that one customer with a lot of groceries m...
[ 0.18983131647109985, -0.3812335431575775, -0.007899854332208633, 0.6291092038154602, -0.06577359139919281, 0.22585268318653107, -0.0016958535416051745, 0.2287416011095047, -0.5858962535858154, -0.7814427018165588, 0.2187570482492447, 0.3132988512516022, -0.2008386254310608, -0.049346417188...
many slower cashiers depends on whether your have the same number of groceries or wildly different numbers. Getting back to the basic model, what this means is that you have to play with your thread number to figure what is optimal given the particular characteristics of your traffic, looking at the time taken to proce...
[ 0.24032540619373322, -0.4606668949127197, 0.5052216053009033, 0.5293411612510681, -0.09705452620983124, 0.28875091671943665, 0.2394569218158722, 0.3809885084629059, -0.4005243182182312, -0.8105758428573608, 0.4699113070964813, 0.349056214094162, -0.13355521857738495, -0.12522676587104797, ...
Lets consider that I have a public property called AvatarSize like the following, ``` public class Foo { ... public Size AvatarSize { get { return myAvatarSize; } set { myAvatarSize = value; } } ... } ``` Now if a target class wants to set this property, then they need to do it the following way,...
[ 0.22080296277999878, -0.10226457566022873, 0.5125333666801453, -0.176593616604805, -0.04562090337276459, 0.2719227075576782, 0.038163017481565475, -0.37017127871513367, -0.39422163367271423, -0.875806987285614, 0.005170266143977642, 0.6293754577636719, -0.2643822431564331, 0.05698290467262...
return values. I know why it happens, but I would like it to support the second way also. Please help me with a solution. P.S. Sorry if the title is absurd `Size` is a structure. Being a ValueType it's immutable. If you change it's property like that, it will only modify an object instance in the stack, not the actual...
[ 0.18544335663318634, -0.1239939033985138, 0.5999380946159363, 0.06685791909694672, -0.07957824319601059, -0.03182404115796089, 0.11892856657505035, -0.12769848108291626, -0.39939573407173157, -0.6028790473937988, -0.1873604953289032, 0.4539189338684082, -0.2081146240234375, 0.2542013525962...
I am trying to communicate with Excel from a Java/SWT application. I have been able to open a worksheet, open a file and save it but that's about it. Can anyone point me to some documentation/examples for this? I especially need to know which commands are available. I did try to record macros to inspect. This was usef...
[ 0.18255463242530823, 0.07397150993347168, 0.33178743720054626, -0.09358160942792892, -0.016292713582515717, 0.14963440597057343, 0.40573376417160034, 0.1307869851589203, -0.1919790655374527, -0.7848995923995972, 0.029360990971326828, 0.5528643727302551, -0.5969652533531189, 0.0855882763862...
// Defined
[ 0.437229722738266, 0.14661763608455658, 0.052080124616622925, -0.15999427437782288, 0.04451317712664604, -0.3549555838108063, -0.0920218899846077, -0.020038526505231857, -0.1456863433122635, -0.4696291387081146, -0.0357072576880455, 0.22836804389953613, 0.22310400009155273, 0.0840154811739...
// Workbooks Variant[] arguments = new Variant[1]; arguments[0] = new Variant(fileName); System.out.println("workbooks::\t" + workbooks); IDispatch p1 = workbooks.getDispatch(); int[] rgdispid = workbooks.getAutomation().getIDsOfNames(new String[] { "Open" }); int dispIdMember = rgdispid[0]; ...
[ 0.08978147804737091, -0.41760489344596863, 0.5936886072158813, -0.27673500776290894, 0.3733680844306946, 0.4678236246109009, 0.3009464144706726, -0.25622129440307617, -0.43511226773262024, -0.8045092225074768, -0.4059349596500397, 0.32656654715538025, -0.3504847586154938, 0.131863340735435...
catch (InterruptedException e) { e.printStackTrace(); } int id = workbook.getAutomation().getIDsOfNames(new String[] { "ActiveSheet" })[0]; System.out.println(id); Variant sheet = workbook.getAutomation().getProperty(id); OleAutomation sheetAutomation = sheet.getAutomation(); return (sh...
[ 0.15808190405368805, -0.3476431369781494, 0.46616390347480774, -0.055405959486961365, 0.025528088212013245, 0.13424021005630493, 0.2239939421415329, -0.0906856507062912, -0.41241806745529175, -0.5187147855758667, -0.12237679213285446, 0.3646131455898285, -0.488105446100235, 0.1531540453433...
I have a friefox sidebar extension. If its opened by clicking on the toolbar icon I load it with a webpage ( that I have authored ). Now, if the user clicks on the link on the webpage ( thats loaded into the sidebar ) I want the linked webpage to open up in a new tab of the main window. I tried with this in my webpage ...
[ 0.17522720992565155, 0.3439550995826721, 1.0115910768508911, -0.09066788852214813, -0.3294799327850342, -0.15465855598449707, 0.01973629929125309, -0.013575149700045586, -0.4538435935974121, -0.31598347425460815, -0.1409762054681778, 0.8717459440231323, -0.20410549640655518, 0.087299451231...
in another webpage loaded into the sidebar extension ) onto a new tab in the browser. The only way is to use javascript. That has to execute under privileged conditions ( meaning as part of an extension ) like below: ``` gBrowser.addTab("http://www.google.com/"); ``` EDIT: The above technique of adding a browser ta...
[ -0.08373567461967468, 0.1571565866470337, 0.474667489528656, -0.12592175602912903, -0.21227435767650604, -0.09275506436824799, 0.43752869963645935, -0.11773821711540222, -0.19165576994419098, -0.946956217288971, -0.2562641203403473, 0.40009060502052307, -0.6592966914176941, 0.2295069545507...
I got access to the browser window I accessed gBrowser through the getBrowser function like below: ``` mainWindow.getBrowser().addTab("http://www.google.com/"); ``` The opens up a new tab in the main window browser.
[ 0.12329603731632233, 0.21722443401813507, 0.5411860346794128, -0.07635253667831421, -0.21310439705848694, -0.0659310594201088, 0.35921281576156616, 0.5424903035163879, -0.20482347905635834, -0.6456751823425293, -0.1341167837381363, 0.5150724053382874, -0.2738722264766693, 0.266514539718627...
Is there any way to write a Visual Studio Project file easy or do i have to look at the xml format and write it by hand? Is there any lib for this in .net framework(3.5)? Im using vb.net but c# would also work.. Visual Studio since version 2005 uses the [MSBuild](http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx) ...
[ 0.3974934220314026, -0.1372285634279251, 0.04247968643903732, 0.013303335756063461, -0.21056704223155975, -0.209295392036438, -0.14635999500751495, 0.11203383654356003, -0.16396328806877136, -0.5634676814079285, -0.11803796142339706, 0.5417916774749756, -0.052851494401693344, -0.1593409478...
I use Indy 9 with Delphi 5. In my application I want to communicate with a network device via UDP. So I use UDPServer comp. in a class which is derived from TThread. When I write similar to the following code then CPU usage is 100%. in the thread : ``` while not terminated do begin if GetMessage(Msg, 0, 0, 0) then ...
[ -0.1888912171125412, -0.11259421706199646, 0.7778471112251282, -0.10531917959451675, 0.023453902453184128, -0.06737098842859268, 0.27213823795318604, 0.1535092145204544, -0.1865525245666504, -0.817416787147522, -0.002695119706913829, 0.979669451713562, -0.34208303689956665, -0.174560457468...
Processing the data here except PostThreadMessage(ThreadId, WM_UDPMSG, 0, 0); end; ``` When I use Sleep function in the while-do loop or in OnUDPRead event there is no change. Still the CPU usage is 100%. My thread priority is Normal. How can I solve my problem? The problem you have is because you're receiv...
[ -0.21707981824874878, -0.048772189766168594, 0.6645703315734863, -0.09687837958335876, -0.17658911645412445, -0.01604623906314373, 0.44509899616241455, 0.06946198642253876, -0.5641829967498779, -0.740508496761322, -0.04752343147993088, 0.4670485258102417, -0.27955013513565063, 0.0123775191...
[synapse](http://www.ararat.cz/synapse/doku.php/features). Then it's very easy to just wait for new data to receive in your thread. You could just write: ``` while not Terminated do begin BytesRead := FSocker.RecvBufferEx(@(Buffer[0]), BufferSize, Timeout); if (BytesRead = 0) then begin // continue or exit ...
[ -0.11566843837499619, 0.017022037878632545, 0.526567280292511, -0.06179051473736763, 0.24973013997077942, 0.15384340286254883, 0.32037097215652466, -0.0673687607049942, -0.4710058569908142, -0.5514073371887207, -0.20619158446788788, 0.22750744223594666, -0.36334532499313354, 0.316662430763...
CloseConnection; Exit; end; else CloseConnection; Exit; end; end; // process the data in the buffer end; ```
[ -0.38806647062301636, 0.2581542134284973, 0.5779715776443481, -0.3160354197025299, 0.401971697807312, -0.0003178553597535938, 0.22489173710346222, 0.07987598329782486, 0.07133612781763077, -0.5027510523796082, -0.6582379937171936, -0.0025697422679513693, -0.512924075126648, 0.4429130256175...
When a form is posted back to the server, is it possible to manipulate, change, set the values contained in HTTP Post in the controller action? I would like to remove certain textbox values entered by the user so that these values always have to be re-entered (e.g. password fields). By default Html helpers extract init...
[ 0.3451509475708008, -0.16176410019397736, 0.5383766889572144, -0.06580033898353577, 0.03963444381952286, -0.2892172932624817, 0.18978318572044373, -0.18866370618343353, -0.19101758301258087, -0.4488389194011688, -0.04511934891343117, 0.6222843527793884, -0.4014740586280823, 0.0088085150346...
guess is that your action does need to see the password (or whatever) entered by the user. But if, for example, a different field needs to be re-entered, you don't want to populate the password when you re-display the form. That's a good idea. But in this case, model binders don't even enter in. You simply set the fiel...
[ 0.05847405269742012, -0.4359896183013916, 0.163551926612854, -0.06413546949625015, 0.25038036704063416, -0.05042000114917755, 0.32188981771469116, -0.1462547481060028, -0.2865523099899292, -0.4070438742637634, -0.10186140984296799, 0.7062579989433289, -0.4427722990512848, -0.04674492403864...
Repository.Add(model); } catch (Exception ex) { ViewData["Message"] = ex.Message; model.Password = null; return View(model); } // success! return RedirectToRoute( //...
[ -0.16253142058849335, -0.4195047616958618, 0.34379974007606506, -0.034339021891355515, 0.09964071959257126, 0.17371787130832672, 0.5599366426467896, -0.44757288694381714, -0.38339316844940186, -0.32427000999450684, -0.30317920446395874, 0.6902424693107605, -0.2720814645290375, 0.3525458574...
} ```
[ 0.3354566991329193, 0.5660994052886963, -0.045124202966690063, 0.08949362486600876, 0.36271432042121887, -0.03456072509288788, 0.2035233974456787, 0.4996976852416992, 0.20306141674518585, -0.48415371775627136, -0.1802433431148529, 0.4521971344947815, -0.138974130153656, 0.3154967725276947,...
im writting an actionScript class to handle my web service calls. When i retrieve a result i want to call a setter method in my main mxml application. My problem is that i dont know how to access the methods in the actionScript section of my main mxml class from my actionscript class, any ideas? David is right -- while...
[ 0.45096442103385925, 0.07396876811981201, 0.629571795463562, 0.1691320389509201, -0.3267826735973358, 0.17466430366039276, 0.22124963998794556, -0.22818072140216827, -0.3097606301307678, -0.5519576072692871, 0.08615247905254364, 0.4536668658256531, -0.39909055829048157, 0.02760392241179943...
Flex idiom is generally to extend EventDispatcher and to dispatch events. So for example, your WebService wrapper might look something like this: ``` public class MyWrapperClass extends EventDispatcher { [Event(name="webserviceComplete", type="flash.events.Event")] public function MyWrapperClass(target:IEvent...
[ 0.5316949486732483, -0.5480935573577881, 0.4299544095993042, -0.2657015919685364, 0.04558032006025314, 0.03229862451553345, 0.1036878451704979, -0.3269768953323364, -0.23297202587127686, -0.6501770615577698, -0.26268887519836426, 0.8945956826210022, -0.22072145342826843, -0.066987574100494...
call handleWebServiceLoadComplete()... } } ``` ... and your Main.mxml file like this: ``` <mx:Script> <![CDATA[ private function app_creationComplete(event:Event):void { var myWrapper:MyWrapperClass = new MyWrapperClass(); myWrapper.addEventListener("webservice...
[ 0.2297465056180954, 0.03382246941328049, 0.6612114310264587, -0.35162732005119324, -0.09925932437181473, 0.049256451427936554, 0.37908825278282166, -0.36676687002182007, -0.30952128767967224, -0.4809601306915283, -0.1743602156639099, 0.6996844410896301, -0.2768060266971588, 0.3495279252529...
private function mywrapper_webServiceComplete(event:Event):void { // Do the work you would've otherwise done in the public method } ]]> </mx:Script> ``` In this case, the end result is the same -- completing the web-service load triggers the function in Main.mxml. But notice how `mywr...
[ 0.20891022682189941, -0.05062118545174599, 0.5730780363082886, -0.18852686882019043, -0.012169056572020054, -0.21578671038150787, 0.4274965822696686, -0.17128589749336243, -0.2270502746105194, -0.2776050269603729, -0.4494642913341522, 0.748257040977478, -0.2052745372056961, 0.0659694746136...