Posts

Showing posts from February, 2010

switch statement - PHP: 2 switches don't interact well with each other -

i can't make both switches work, it's either 1 or other. on page list.php, there's table gets members "t_leden". if user clicks on of links, sorts (id, name, address, etc.) it sorting alright until added new switch show men/women/etc. now, can show men , women, can't sort anymore. i'm clueless. this sql: -- phpmyadmin sql dump -- version 3.3.9 -- http://www.phpmyadmin.net -- -- machine: localhost -- genereertijd: 23 feb 2011 om 10:58 -- serverversie: 5.5.8 -- php-versie: 5.3.5 set sql_mode="no_auto_value_on_zero"; -- -- database: `db_school` -- -- -------------------------------------------------------- -- -- tabelstructuur voor tabel `t_leden` -- create table if not exists `t_leden` ( `d_index` int(11) not null auto_increment, `d_naam` varchar(255) not null, `d_voornaam` varchar(255) not null, `d_adres` varchar(255) not null, `d_peter` varchar(255) not null, `d_lid` varchar(255) not null, `d_geslacht` enum('man

Call another URL at the time of one video playing from url on iphone -

in application i'm playing 2 videos array 1 after another.i want hit url @ time of first video begin play without affecting video playing. here code have tried playing 2 videos 1 after another, -(ibaction)playmovie:(id)sender{ i=0; array=[[nsarray alloc] initwithobjects:@"https://s3.amazonaws.com/adplayer/colgate.mp4",@"https://s3.amazonaws.com/ventuno-platform-flv-sep2010/happy_family.mp4",nil]; [self initializplayer]; } the above action event called when user click on button start playing videos. -(void)initializplayer{ if(i<[array count]) +=1; else { = 1; } nslog(@"i value:%@",[array objectatindex:i-1]); nsurl *url1=[nsurl urlwithstring:[array objectatindex:i-1]]; mpmovieplayercontroller *movieplayercontroller = [[mpmovieplayercontroller alloc] initwithcontenturl:url1]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(movieplaybackcomplete:)

javascript - Why forbid cross-domain ajax when script tags work? -

since straightforward use jsonp in script tag fetch data different domain, shouldn't allow xmlhttprequest well? doesn't make sense claim strengthens security when it's possible work around it, albeit more messy semantics. jsonp works if provider allows it. if cross domain ajax worked, 1 of first problems people posting other domains in hope have authenticated account there. csrf. they page authenticated you, take token, , post malicious token (which tells application internal request).

.net - Boxing/unboxing in DataTables and LINQ -

let's i've got memory-based datatable this: datatable dt = new datatable(); dt.columns.add("c1", system.type.gettype("system.double")); dt.columns.add("c2", system.type.gettype("system.double")); ... datarow row = dt.addrow(); row["c1"] = 1; row["c2"] = 2; ... then query table: list<datarow> rows = (from r in table (double)r["c1"] < 2.0 select r).tolist(); and in profiler see creates lot of doubles. assume somehow related comparison. any ideas how rid of needless memory allocation? i use .net 4, vs 2010, c#. the underlying storage here in typed array (in case in doublestorage class), access goes via object , since there no generic api. cannot avoid boxing unless switch class-based model without datatable .

Function running confuse on VxWorks -

we're trying use vxworks' udp multicast. using command line (->), call initialization function parameters , multicast runs successfully. when try run method code, initialization function returns ok (no errors), not initialize multicast udp port. is there catch ? one thing aware of tcp/ip stack gets initialized after roottask completes. the usrappinit function runs in context of root task. if invoking network stack elements in usrappinit, things might not work. make sure invoke networking code task has been spawned lower priority network stack (which runs @ priority 50).

Is wifi connection between iphone and any other electronic device possible -

is possible connect iphone electronic devices through wi-fi, , receive signals it. i'm looking sample app udpecho, mac. for 20$ month 2gb verizon offers creating hotspot. at&t not

javascript - disable textfield until select option from select list -

i have list of option inside select list, have textfield contain option value when selected. make textfield disable default , when i'm selecting 1 of options - textfield enable. can direct me simiar example? thanks here example using plain javascript jsfiddle : html: <select id='myselect'> <option value='none'>none</option> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> </select> <input type='text' value='' name='mytext' id='mytext' disabled /> <button value='add' id='addbtn' name='addbtn'>add</button> we started disabled input textfield. var myselect = document.getelementbyid('myselect'); function createoption() { var currenttext = document.getelementbyid('mytext').value; var objoption = document.createeleme

python - List of all available matplotlib backends -

the current backend name accessible via >>> import matplotlib.pyplot plt >>> plt.get_backend() 'gtkagg' is there way list of backends can used on particular machine? thanks in advance. you can access lists matplotlib.rcsetup.interactive_bk matplotlib.rcsetup.non_interactive_bk matplotlib.rcsetup.all_backends the third being concatenation of former two. if read source code correctly, lists hard-coded though, , don't tell backends usable. there also matplotlib.rcsetup.validate_backend(name) but checks against hard-coded list.

performance - Session optimization in Jetty + Wicket -

is there way swap sessions onto disk jetty if idle n.n. minutes? it under investigation, suspect have many idle users logged in large session size. so, while doing nothing, session pushed onto disk. is there setting or utility or way achieve this? we using wicket+jetty. simply shortening session destroy timeout not option. assuming you're running jetty 7, answer yes. because it's possible configure & run jetty in multiple ways, it's pretty hard give definitive answer how turn on in scenario. the outcome want call "setidlesaveperiod" on "hashsessionmanager" non-zero value (the number of seconds session should idle before pushed disk) if you're running server default jetty.xml you'll need add (untested): <configure class="org.mortbay.jetty.webapp.webappcontext"> . . . <set name="sessionhandler"> <new class="org.mortbay.jetty.servlet.sessionhandler"> &

How to get an Eclipse CDT project to auto-relaod a .c file that has been externally modified -

i'm using ruby script generate .c file based on .c file (for test harness called unity). script runs using pre-build option, updates file, cproject doesn't see upadted file being touched doesn't rebuild it. using f5 updates i'd manually. can't see how make happen. pointers welcome. i had same issue generating c file python script. what ended doing create special builder file. if go project properties, go on builders tab , click new . select program . can fill information there. important part go on refresh tab , select refresh resources upon completion . i found useful unselect stdio ("allocate console" in build options tab) doesn't clear console after build. the drawback of method builder doesn't pick-up dependencies , called time.

python list boundary -

is there boundary on list , dictionary in python? if there is, limit? i think boundary mean whether there upper bound on number of elements in list or dict . python not define limits on them, can big memory available on machine permits.

actionscript 3 - What is the event to know focus out from a datagrid cell (column) without using itemRenderer or itemEditor -

i using editable datagrid , want autosave edited information in editable column. also, since simple text editing don't want use itemeditor/component same. hoping have focusout event dont see focusout event datagrid column(even if editable?). event should using? thanks. i got working using itemrenderer in used text box , handled textbox's focusout property. still wondering how have done directly datagrid's event.

c# - Attribute that displays property value in Visual Studio -

i believe saw somewhere attribute that, when applied class, show value of property in intellisense. i'm not talking xml comments. looked this: [someattribute("name = '{0}', age = '{1}'", name, age)] myclass anyone know attribute i'm talking about? it doesn’t make sense “show value in intellisense”, guess mean in debugger . in case, attribute you’re looking debuggerdisplayattribute : [debuggerdisplay("name = '{name}', age = '{age}'")] public class xyz { public string name; public int age; } of course, can override tostring() method instead. in absense of debuggerdisplayattribute , debugger uses tostring() . should use debuggerdisplayattribute if need implementation of tostring() different (and insufficient debugging).

java - Getting SQL script from Hibernate update -

i'm looking way sql update script when hibernate automatically updates tables. i'm using hibernate.hbm2ddl.auto=update in development environment only, , need sql script updates tables production. i want these sql scripts in txt format revision , potential edit. how can done? advice. there suggestions , general discussion here . in nutshell, can turn on logging (to standard output): hibernate.show_sql=true alternatively, if use log4j, can add log4j.properties file: log4j.logger.org.hibernate.sql=debug both of these approaches going output hibernate's prepared statements parameters (so parameter values not inline). around this, use interceptor p6spy . details on can found here .

api - What's the limit of google transliteration? -

i've used google transliteration api experimentally. it's working fine , i've noticed allows 5 words @ time. there method send more words? , there daily limit? if have 100 words, have send set of 5 , join them? 100k characters per day ver 2. developer console allows apply higher limits (may cost money depending on needs?) https://code.google.com/apis/console/ looks ther method making more jut individual words transliteratable: https://developers.google.com/transliterate/v1/getting_started#maketransliteratable

c++ - Simultaneous abort() in two threads -

i have backtrace haven't seen before. see frame 2 in these threads: thread 31 (process 8752): #0 0x00faa410 in __kernel_vsyscall () #1 0x00b0b139 in sigprocmask () /lib/libc.so.6 #2 0x00b0c7a2 in abort () /lib/libc.so.6 #3 0x00752aa0 in __gnu_cxx::__verbose_terminate_handler () /usr/lib/libstdc++.so.6 #4 0x00750505 in ?? () /usr/lib/libstdc++.so.6 #5 0x00750542 in std::terminate () /usr/lib/libstdc++.so.6 #6 0x00750c65 in __cxa_pure_virtual () /usr/lib/libstdc++.so.6 #7 0x00299c63 in applicationfunction() thread 1 (process 8749): #0 0x00faa410 in __kernel_vsyscall () #1 0x00b0ad80 in raise () /lib/libc.so.6 #2 0x00b0c691 in abort () /lib/libc.so.6 #3 0x00b4324b in __libc_message () /lib/libc.so.6 #4 0x00b495b6 in malloc_consolidate () /lib/libc.so.6 #5 0x00b4b3bd in _int_malloc () /lib/libc.so.6 #6 0x00b4d3ab in malloc () /lib/libc.so.6 #7 0x08147f03 in anotherapplicationfunction () when opening gdb , getting backtrace gives me thread 1. later saw weird sta

silverlight 4.0 - List of objects always empty when passing to Domain Service method -

i'm pretty @ wits end here. don't understand i'm missing. here setup: [datacontract] public partial class class1 { [key()] [datamember] public string id { get; set; } ... [include] [datamember] [composition] [association("fk_class1id", "id", "class1_id")] public list<class2> pierlist { get; set; } } [datacontract] public partial class class2 { // class has 3 values make key [key()] [datamember] public string class1_id { get; set; } [key()] [datamember] public int xid { get; set; } [key()] [datamember] public int yid { get; set; } [datamember] public enumtype type { get; set; } ... } [datacontract] public enum enumtype { [enummember] val1, [enummember] val2, [enummember] val3, [enummember] val4 } in domai

WPF/XAML: Switch style based on custom property -

i have wpf user control following xaml <usercontrol x:class="scheduler.itembox" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:ignorable="d" d:designheight="40" d:designwidth="150" minheight="40" minwidth="75" verticalalignment="top"> <border borderbrush="cornflowerblue" borderthickness="1" cornerradius="5" name="border"> <border.background> <lineargradientbrush endpoint="0.5,1" startpoint="0.5,0"> <gradientstop color="white" offset="0"/> <gradientstop color="

lazy evaluation - org.hibernate.exception.DataException: could not initialize a collection -

when try access collection (list) following way, following error, though within same usertransaction. ::: entityaccessorexception: org.hibernate.exception.dataexception: not initialize collection ::: caused by: org.hibernate.exception.dataexception: not initialize collection: ::: list<brand> brands = fulltextquery.getresultlist(); (brand b : brands) { iterator<brandpromodetails> i2 = b.getbrandpromodetails() .iterator(); while (i2.hasnext()) { brandpromodetails bpd = i2.next(); ==================================================================================== whereas, when change follows, works. database derby , using hibernate jpa provider , using hibernate search. great if can provide explanation of behavior. list<brand> brands = fulltextquery.getresultlist(); (brand b : brands) { @suppresswa

python - Binary Data To Unicode -

among encodings available here http://docs.python.org/library/codecs.html 1 one should use decoding binary data unicode without becoming corrupted when encode string? i've used raw_unicode_data , doesn't work. example: upload picture in post (but not file attachment). django converts post data unicode using utf-8. when converting unicode string (again using utf-8), data becomes corrupted. used raw_unicode_data , same happened (though few bytes time). encoding should use decode , encode steps don't corrupt data. "binary data" not text, therefore converting unicode meaningless. if there text embedded in binary data extract first , decode using encoding given in specification data format.

javascript - jQuery Remove string from string -

i trying remove string string in jquery. here string: username1, username2 , username3 post. i remove username1, list. tried adding list array using .split(', ') got error. i'm assuming error because not every word has comma after it. i want remove fist item list. username1 example username. first item username of logged in user if have liked post. i have tried: var updated_list = $('#post_like_list').html().replace('username1, ', ''); $('#post_like_list').html(updated_list); but didn't update list. update list when using .text() instead of .html() have links inside list need preserve. pretty sure want plain old replace function. use this: mystring.replace('username1',''); i suppose if want remove trailing comma instead: mystring.replace('username1,',''); edit: here site specific code: jquery("#post_like_list-510").text().replace(...)

architecture - exception handling design -

in current project there components / libs designed adapters. example 1 adapter encapsulates io access file system. in actual exception handling design adapter has throw specific exceptions filesystemfilenotfoundexception . adapter specific exceptions have derived adapter base exception. the main reason developer has a relativ way catch adapter specific exception. sometimes base exceptions provide additional information, in case of io adapter source file , target file property holds full path , file name of each file. the main application has 3 own base exception of 3 different scenarios. there several adapter called main application. each adapter need own exception mapping logic in main application. map adapter application exception type, work on additional exception information , on. the following code needed map source target exception var map = new dictionary<type, type>() { typeof(filealreadyexiststechnicalexception) } }; v

jquery - Applying .slider to hidden divs -

this kinda tricky explain,but here goes....i have multiple hidden divs swap 1 when clicking link using $(document).ready(function(){ $('a').click(function () { var divname= this.name; $("#"+divname).show("slow").siblings().hide("slow"); }); }); i have made slider function works great, when div changes slider not work. how can target hidden div when called up? assume variable thing? this slider code $(function() { var scrollpane = $('#info'), scrollableheight = scrollpane.height() - scrollpane.parent().height() || 0; $("#slider-vertical").slider({ orientation: "vertical", range: "max", min: 0, max: scrollableheight, value: scrollableheight, slide: function(event, ui) { scrollpane.css({top: ui.value - scrollableheight}); } }); }); here working example better understand.....please excuse messy code http://www.kerrydean.ca/tizzest.html# thanks in advance

c++ - Overridding QMessageBox::paintEvent() -

i creating custom message box application. object derived qmessagebox, overriding paintevent() method in order change appearance. curiously, although not call base paintevent method in derived method, custom message box still being painted ok button default. here code: class messagewidget : public qmessagebox { q_object public: messagewidget(qwidget* parent = 0); ~messagewidget(); void settitle(const qstring& title); const qstring& title() const; protected: void paintevent(qpaintevent* event); } messagewidget::messagewidget(qwidget* parent) : qmessagebox(parent) { setwindowflags(qt::framelesswindowhint); setautofillbackground(true); } void messagewidget::paintevent(qpaintevent* /*event*/) { qpainter painter(this); qrect boxrect = rect(); qpainterpath path; path.addroundedrect(boxrect, 15, 15); painter.fillpath(path, palette().window()); painter.drawpath(path); qrect titlerect = boxrect; int

recursion - Pascal Triangle Recursive Program optimization in C++ -

i have built recursive function compute pascal's triangle values. is there way optimize it? short reminder pascal's triangle: c(n, k) = c(n-1, k-1) + c(n-1, k) code is: int pascal(int n, int k) { if (k == 0) return 1; if (n == 0) return 0; return pascal(n - 1, k - 1) + pascal(n - 1, k); } the inefficiency see stores values twice. example: c(6,2) = c(5,1) + c(5,2) c(6,2) = c(4,0) + c(4,1) + c(4,1) + c(4,2) call c(4,1) twice any idea how optimize function? thanks the following routine compute n-choose-k, using recursive definition , memoization. routine extremely fast , accurate: inline unsigned long long n_choose_k(const unsigned long long& n, const unsigned long long& k) { if (n < k) return 0; if (0 == n) return 0; if (0 == k) return 1; if (n == k) return 1; if (1 == k) return n; typedef unsigned long long value_type; class n_choose_k_impl { public: n_choose_k_imp

html5 - Textures in CANVAS 2D Context -

just starting experiment filling canvas, , i'm trying apply texture object (the blobs blob example - http://www.blobsallad.se/ ). example using 2d context, , doesn't appear implementing webgl. information on texturing find uses webgl, , wondering how easy accomplish feat. there anyway incorporate texturing features of webgl canvas without rewriting code? summed up, guess question asking whether or not methods available 2d context available webgl context... if suppose change context , apply texture? if i'm thinking wrong or confused conceptually, please let me know. thanks, brandon i've experimented drawing image 2d canvas before using texture webgl canvas. works, performance horrible (it varies browser browser). i'm considering few other options refactoring it. wouldn't recommend more statically drawing image 1 or 2 2d canvases. you can see example of craziness in lanyard/src/render/surfacetilerenderer.js in project at: http://github.com/fintler

c# - MaskedTextBox Focus Method Doesn't Work -

i using extended wpf toolkit in 1 of applications, , using maskedtextbox control. when call focus method on control, doesn't work. focus method works fine on textbox controls, seems maskedtextbox doesn't inherit textbox. know how programmatically give focus control? see if works. had datepicker in silverlight. derive control maskedtextbox , provide following overrides. public override void onapplytemplate() { base.onapplytemplate(); _textbox = (textbox)base.gettemplatechild("textbox"); } public new void focus() { if (_textbox == null) base.focus(); else _textbox.focus(); } private textbox _textbox;

JQuery checkbox fail (why won't it changed "checked" attr?) -

i want toggle disabled/enabled form based on users click of edit checkbox. simple stuff. while disabling component works, checkbox's default checked behavior overriden. tried return attr("checked",true) work no dice. i'm assuming might have markup (placing checkbox in div). can't figure out. $(function(){ $('#target :input').attr('disabled','disabled'); $(':checkbox').toggle( function(){ $(this).attr("checked",true); $('#target :input').attr('disabled',false); }, function(){ $('#target:input').attr('disabled','disabled'); $(this).attr("checked", false); }); }); thanks, brendan as @devbook.co.uk noted, toggle-event [docs] method breaks default behavior of checkbox. one solution use .change() event, along this.checked property of checkbox. example: http://jsfiddle.net/efpr6/ $('#targe

Are Java and C# as "customizable" as Python? -

at time of asking, using python of time, , have not used java or c# much, although have (basic) idea of how work. thinking possibly start use java or c# more, seems little know them aren't "customizable" python, may wrong. by "customizable" (there better phrases use describe mean, can't think of better :-) ), mean things in python like: dynamic object attributes definition (using __getattr__ , etc.) import hooks (so code modules can imported type of media, not files match sets of criteria)(see pep 302 -- new import hooks , , this stackoverflow question ) operator overloading (i think c# , java both have this, example) subclassing of built in types mappings , sequence simulation using __getitem__ , __setitem__ , , __delitem__ , etc., "magic" methods so, wondering if there (at least of) these "customization" kinds of things in java , c#, , if not, there functionally similar or equivalent ways these kinds of things?

git - GitHub vs. BitBucket? -

i want use scm, don't know better. better manage code? neither github nor bitbucket scms -- hosting services built around git , mercurial, underlying scms. if question whether should use git/mercurial scm, people answer "yes", sounds should read on these before diving in, since sounds have quite bit of confusion on topic.

python lambda, filtering out non alpha characters -

i'm trying keep letters in string. trying this: s = '1208uds9f8sdf978qh39h9i#h(&#*h(&h97dgh' s_ = lambda: letter if letter.isalpha(), s this errors out. how working version look? how about re.sub('[^a-za-z]','', s) or "".join([x x in s if x.isalpha()])

asp.net - zed graph x axis labels -

i trying loop through datatable column sdescr , use text in columns labels of x axis, isnt working getting error value of type 'system.collections.generic.list(of string)' cannot converted '1-dimensional array of string'. for integer = 0 mycurve1.points.count - 1 dim pt pointpair = mycurve1.points(i) ' create text label y data value dim text new textobj(pt.y.tostring("f0"), pt.x, pt.y + 0.1, coordtype.axisxyscale, alignh.left, alignv.center) text.zorder = zorder.a_infront text.fontspec.angle = 90 mypane.graphobjlist.add(text) dim labels new list(of string) each row datarow in tablegraph.rows labels = row.item("sdescr") next row mypane.xaxis.scale.textlabels = labels mypane.xaxis.type = axistype.text next you need remove code labels out of next loop creating points. which means this dim labels new list(o

c - Can gcc inline an indirect function call through a constant array of function pointers? -

let's have code: inline int func_2 (int a, int b) { return time() + * b; } int main (void) { int x = (int (*[])(int, int)){func_1, func_2, func_3}[1](6, 7); } can gcc somehow tricked inline indirect calls func_* ? after compiling code -o2 , -o3 , still spot call func_2 instruction in assembly output. i know hairy expression can converted bulky switch statement inlined calls each case, prefer former compactness. if not hurt allocate space in data segment, can try this: static int func_2 (int a, int b) { return time() + * b; } static int (* const ftab[])(int,int) = {func_1, func_2, func_3}; int foo (void) { return ftab[1](6,7); } my gcc 4.4.5 correctly inlines function -o2. the aggregate initializer inside code of function not forward constant expect, don't know wheter it's gcc bug or our misunderstanding of c rule.

Access MySQL field's Comments with PHP -

when creating field in mysql table, there's 'comments' box fill out. how can access data in 'comments' box php? poke around information_schema . select table_comment information_schema.tables table_schema = 'myschema' , table_name = 'mytable'

c# - How can I get elevated permissions (UAC) via impersonation under a non-interactive login? -

i have class library keeps system-wide configuration data in registry (hklm\software\xxx). library used in various applications (services, windows forms, web apps, console apps) on various versions of windows (xp, 2003, 7, 2008 r2). because of this, identity of app not consistent , may not member of machine's administrators group. i've created ad domain admin user , impersonation gain write access registry. works in xp/2003, not in uac-enabled systems (7/2008r2). understanding interactive logins split tokens imply non-interactive logins (service identities, app pool identities, etc.) not. can't find confirm that, working assumption, impersonation i'm doing should work. i wrote wrapper class impersonation using native logonuser (network logontype, default provider) , duplicatetokenex (impersonation, primary token) windowsidentity.impersonate(). reference root key: using (ecr.impersonator imp = new ecr.impersonator("xxx", "xxx", "xxx"

cocoa touch - iPhone - block enumeration -

i have array several objects , want add 90.0 each value. i want using enumerate. create this: [myarray enumerateobjectswithoptions:nsenumerationconcurrent usingblock:^(id obj, nsuinteger idx, bool *stop) { double avalue = [obj doublevalue]; avalue += 90.0; obj = [nsnumber numberwithdouble:avalue]; }]; my question regarding last line. object value, add 90 , have store back. little bit weird, because working on object level, not sure if third line has correct syntax store updated value on object. xcode complains "obj" never used, because thinks assigning number obj intention use it, storing value back. is correct? a better way store amended values new array: nsmutablearray *newarray = [[nsmutablearray alloc] initwithcapacity:[myarray count]]; __block newarray; [myarray enumerateobjectswithoptions:nsenumerationconcurrent usingblock:^(id obj, nsuinteger idx, bool *stop) { double avalue = [obj doublevalue];

C++ Using pointers to template objects -

i have class named abc has class template: template <class t> class abc{} in class trying store of objects abc in list: class cde{ private: list<abc *> some_list; } i intend store objects of abc might have different class template parameters. necessary specify template pointer @ compile time? if container supposed store objects of different type? not possible? is necessary specify template pointer @ compile time ? yes. what if container supposed store objects of different type ? not possible ? it not (directly) possible. there no such thing class abc. there instantiations of abc, such abc<foo> , abc<bar> . these different classes. you can like: template<typename t> class abc : public abc_base { ... } list<abc_base*> some_list; by doing this, of abc instantiations have common base type, , can use base pointer arbitrarily.

licensing - You can sell open source software as long as you provide 'code'. Does that include project files and other metadata? -

so after reading blender (a freely downloadable application) being sold company learned apparently legal because of gnu gpl license allows this. i'm wondering constitutes 'code' in case? need include build scripts or project files? resources (or assets) static logos , images? there's no rule in gpl against (re)selling free/open soure software, slashdot article linked suggests company obscuring fact code gpl'd. gpl states have make license clear, , make easy copy of source. and i'm pretty sure "code" in case means need rebuild project, possibly modifications. however, project or company can trademark name or logo (mozilla famously firefox) no 1 else can call fork same name.

installer - NSIS CreateShortCut: Shortcuts order on Start menu -

i using nsis create installer 1 of apps, , using code create shortcuts on start menu: ;create start-menu items createdirectory "$smprograms\myfolder" createshortcut "$smprograms\myfolder\app.lnk" "$instdir\app.exe" "" "$instdir\app.exe" 0 createshortcut "$smprograms\myfolder\uninstall.lnk" "$instdir\uninstall.exe" "" "$instdir\uninstall.exe" 0 it works, uninstaller shortcut on start menu > myfolder appears before app.exe shortcut. is there way control order of shortcuts? usually installation order ignored, windows arranges them automatically. in older windows versions start menu has context menu option ordering them alphabetically, newer versions order them automatically.

osx - How to ignore environment variables under Mac? -

hope can me. wrote installation shell script python , other libraries. packages installed in selected folder. example "~/desktop/inst" , not under "/usr/local". problem, if there environment variables set, mess installation. somehow possible prevent that? maybe ignore set environment variables. or there maybe other trick? yeah...look loginhook , run script making loginhook mac...that way when ur system logs in , no variables exist, application should run fine there no variables. hope helps. here link knowing how set app loginhook [here]. hope helps http://hints.macworld.com/article.php?story=2006081701162739

class - Need help with Classes in Python -

i'm making program imports custom widget class (it inherits tkinter frame widget). works great until binding. reduce confusion we'll call main application app, module it's importing widget lib, , widget that's being imported app called cwid. basically need somehow reference function in app, may bound widget in lib. the function i'm trying bind widget within cwid element_click (the function element_click in app.): lambda event: element_click(event, elementinfo[3]) so binding in lib (element canvas widget within cwid) element.bind('<buttonrelease-1>', lambda event: element_click(event, elementinfo[3])) the above line wont work seeing element_click in app. tried work around doesn't seem working. import app loc = app.eog element.bind('<buttonrelease-1>', lambda event: loc.element_click( event, elementinfo[3])) when try above following error: typeerror: unbound method element_click() must called eog instance first a

memory management - In Objective-c autoReleased Objects are released if no pointer points to them anymore? -

just curiosity... if alter pointer point other autoreleased instance, previous autoreleased instance pointer pointing to, autoreleased ? example ... nsstring pstr* = [nsstring stringwithstring:@"instance one"]; // sth pstr pstr = [nsstring stringwithstring:@"instance two"]; // sth else pstr are both of instances autoreleased ?? yes. lifecycle of objects doesn't depend on variables point them (unlike environments garbage-collection). that's why it's possible have variable pointing deallocated object or have memory leaks: objects retained forever no references them. lifecycle depends on how objects created , how use retain , release , autorelease methods. it's explained in more details in cocoa memory management guide .

ipad - Could not load NIB in bundle: 'NSBundle' -

what error listed below? 2011-02-23 21:24:12.218 success[7238:207] * terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'could not load nib in bundle: 'nsbundle </users/jimkillen12/library/application support/iphone simulator/4.2/applications/baa5e0e7-af12-4301-a4f8-1b9797c9e82d/success.app> (loaded)' name 'mainwindow-ipad'' one of nib file missing project, add required nib file: in build phases expand copy bundle resources click + @ bottom add required nib file. clean build shift+cmd+k , run. p.s. make sure use exact spelling of nib file while calling initwithnibname:@"viewnamecontroller" probably, have named nib in call lowercase letters or may have included extension .xib not required.

Symfony framework - module name variable in layout.php -

which variable have use in main layout.php current module name? $sf_context http://www.symfony-project.org/gentle-introduction/1_4/en/07-inside-the-view-layer#chapter_07_sub_template_shortcuts

javascript - Jquery addOption Problems -

val1 = "1"; text1 = "the text"; var myoptions = { val1 : text1 } $("#map_element_map_element_folder_id").addoption(myoptions, true); i have script. when run option added select box is text = "the text" <- 1 correct value = 'val1' <- not supposed this, supposed fill "1", because declare val1 = "1" in top of script anyone have idea happen in here? the way defining object, may expect var1 set key value defined var1 variable. dynamic object key assignment, have use bracket style: var myoptions = {}; myoptions[var1] = text1;

mongodb - Best data store w/full text search for lots of small documents? (e.g. a Splunk-like system) -

we specing out system index , store zillions of syslog messages. these text messages, few attributes (system name, date/time, message type, message body), typically 100 1500 bytes each. we generate 2 10 gb of these messages per day, , need retain @ least 30 days of them. the splunk system has great indexing , document compression system. what use? i thought of mongodb, seems inappropriate documents of small size. sql server possibility, seems perhaps not super efficient purpose. text files lucene? -- windows file system doesn't dirs zillions of files suggestions ? thanks! i thought of mongodb, seems inappropriate documents of small size there's company called boxed ice builds server monitoring system using mongodb. argue it's appropriate. these text messages, few attributes (system name, date/time, message type, message body), typically 100 1500 bytes each. from mongodb perspective, storing lots of small documents few attributes.

jsp - <c:import> getting old (probably cached) html content -

i hitting url in jsp thru tag: <'c:import url="${pagecontext.request.scheme}://${pagecontext.request.servername}:${pagecontext.request.serverport}/${pagecontext.request.contextpath}/html/temp.html" var="content" /> i getting html content properly. now, change html content temp.html jsp rendering old html content. instead, if make direct call http://servername.com/html/temp.html , newly modified content. the htmls hosted on akamai servers , i've made sure akamai cache getting refreshed. any clue why happen? there other kind of proxy/server cache retrieving old content? thanks, narain try adding query string random value. e.g. timestamp. <jsp:usebean id="now" class="java.util.date" /> <c:import url="/${pagecontext.request.contextpath}/html/temp.html?${now.time}" var="content" /> note stripped unnecessary noise url .

css - Problem with position absolute in ie7, div moves 10px to the right -

ive got problem on position absolute property on ie7. div moves 10px right. below code. ie8 , 9 works fine. id menu div im referring. <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <style type="text/css"> body{margin: 0 0 0 0; padding: 0 0 0 0;} #holder{width: 400px; height: 500px; margin: 0 auto;} #left{float: left; width: 50px; height: 500px; background-color: red;} #center{float: left; width: 300px; height: 500px; background-color: green;} #right{float: left; width: 50px; height: 500px; background-color: red;} #header{width: 300px; height: 70px; background-color: yellow;} #gal-holder{width: 280px; height: 70px; margin: 0 auto;} #gallery{width: 280px; height: 410px; background-color: orange;} #b

ruby on rails - Trouble on routing Racks -

i using ruby on rails 3 , route urls rack middlewares. is, if user try browse @ http://<my_site_name>.com/api/user/1 system should consider run before rack file , proceed in request. i have rack::api:user located in lib/rack/api/user folder. from ror official documentation discovered this: mount rack-based application used within application. mount somerackapp, :at => "some_route" alternatively: mount(somerackapp => "some_route") mounted applications come routing helpers access them. these named after class specified, above example helper either +some_rack_app_path+ or +some_rack_app_url+. customize helper's name, use +:as+ option: mount(somerackapp => "some_route", :as => "exciting") generate +exciting_path+ , +exciting_url+ helpers can used navigate mounted app. in routers.rb file tryed mount "rack::api::user", :at => "/a

javascript - spell check in text editor -

possible duplicates: add spell check website rich text editor gmail style spell check how spell check in text editor in javascript

Does GWT Layout Panels have to fill the browser width and height? -

does gwt layout panels have fill browser width , height? or there way have instance docklayoutpanel have width of 90%? try this: docklayoutpanel.setwidth("90%"); docklayoutpanel.setheight("90%");

iphone - Multiple UIActionSheets in one View Controller -

how multiple uiactionsheet s added single uiviewcontroller if there single -actionsheet:clickedbuttonatindex: method? set name or tag action sheet , thing this -(void)actionsheet:(uiactionsheet *)actionsheet clickedbuttonatindex:(nsinteger)buttonindex { if(actionsheet==youractionsheet1) { //your logic } if(actionsheet==youractionsheet2) { //your logic } } hope help

How do I implement an ASP.NET cross-session data controller class? -

i creating asp.net application allows users edit , insert data persisted in sql server database. implement controller class handles queries entities, caches results , triggers events when data inserted or updated. need 1 of these controller classes each entity in data model. i'm unsure of how create singleton class of sort different user sessions can access. for example, have employee entity in data model. have employeecontroller class handles retrieving employees database, sends inserts , updates database, keeps cache of employees , triggers events when employee inserted or updated. objects in other user sessions listen , respond these events. so: am on right track? should using asp.net mvc framework accomplish this? how instantiate these controller classes when first user needs them , have subsequent concurrent users access same class? edit: i've been researching idea of controller class anti-pattern since @tomtom's answer. i'm not convinced 1 way

php - Dynamic file names with Apache mod_header and file downloads using Content-Disposition -

i have bad problem on site file downloads getting truncated when use php set content-disposition "attachment" , sending file using readfile() . know of notorious problem since there plenty of discussion on php's readfile() manual page. have tried each of solutions posted there no luck (sending chunked output, disabling gzip compression in both apache/php). here gist of code, without workarounds, you'd find on php manual: $file = '/path/to/ugly.file.name.mp4'; $filename = 'anicefilename.mp4'; header('content-description: file transfer'); header('content-type: video/mp4'); header('content-disposition: attachment; filename='.$filename.'.mp4'); header('content-transfer-encoding: binary'); header('expires: 0'); header('cache-control: must-revalidate, post-check=0, pre-check=0'); header('pragma: public'); header('content-length: ' . filesize($file)); ob_clean(); flush(); readfi

asp.net mvc - Update object in Entity Framework -

public class sqldatacontext : dbcontext { public dbset<message> messages { get; set; } protected override void onmodelcreating(system.data.entity.modelconfiguration.modelbuilder modelbuilder) { base.onmodelcreating(modelbuilder); } } and repository class: public class sqlrepository : irepository { private sqldatacontext _datacontext; public sqlrepository(sqldatacontext datacontext) { _datacontext = datacontext; } public dbset<message> messages { { return _datacontext.messages; } } public void commit() { _datacontext.savechanges(); } } and service class: public class messagesservices : imessagesservices { #region repository private irepository _repository; public usersservices(irepository repository) { _repositor