Posts

Showing posts from February, 2011

security - How do I create a PKCS12 .p12 file in C#? -

this n00b question, don't have experience in area. i need create p12 bundle containing x509 certificate , private key. have 2 objects, x509certificate2, , rsaparameters object contains key information. how combine these p12 file? i cannot find information regarding this. i have rsacryptoserviceprovider object has parameters rsaparameters imported if helps. some additional background. getting certificate verisign registration authority have installed here. done creating pcks#10 certificate request. create certificate object reading in byte array of data ra puts database. rsaprivatecrtkeyparameters keyparams = (rsaprivatecrtkeyparameters)this.keypair.private; rsaparameters rsaparameters = new rsaparameters(); rsaparameters.modulus = keyparams.modulus.tobytearrayunsigned(); rsaparameters.p = keyparams.p.tobytearrayunsigned(); rsaparameters.q = keyparams.q.tobytearrayunsigned(); rsaparameters.dp = keyparams.dp.tobytearrayunsigned(); rsaparameters.dq = keyparams.dq.to...

javascript - Scrolling in jqPlot -

i using jqplot show candlestick chart , data xml . retrieve data xml , put array , jqplot creates candlestick chart that. xml file contains lots of data in chart values overlapping (with fixed width). is possible make graph of lets 10% of data , place scrollbar , on every tick of scrollbar rebuild graph next data or there exists such functionality of scrolling of graph/chart in jqplot . please me resolve this. its better load xml @ once, not give data @ once jqplot chart. make sure passing part of data jqplot . once assign data chart go scrolling of data using jquery or scroller code. whenever scroll on try refresh or regenrate chart selected data.

android - Filtering a cursor the right way? -

at moment need filter cursor/cursoradapter show rows match specific condition in listview. don't want requery db time. want filter cursor got querying db. i have seen question: filter rows cursor don't show in listview but don't understand how filtering overwritting "move" methods in cursorwrapper. example nice. thank much. update: i have rewritten source , employer has made available open source software: https://github.com/clover/android-filteredcursor you don't need override move methods in cursorwrapper, need override bunch though due design of cursor interface. let's pretend want filter out row #2 , #4 of 7 row cursor, make class extends cursorwrapper , override these methods so: private int[] filtermap = new int[] { 0, 1, 3, 5, 6 }; private int mpos = -1; @override public int getcount() { return filtermap.length } @override public boolean movetoposition(int position) { // make sure position isn't past end of cursor ...

java - How to add IntentFilter in an Activity by code? -

i have activity holds 2 intent filters , problem not use activity devices 1.6 , before since wanted them use native contacts. thanks! public class extends activity { public { intentfilter filter = new intentfilter(your_broadcast); filter.addaction(your_broadcast_2); registerreceiver(mreceiver, filter); } private final broadcastreceiver mreceiver = new broadcastreceiver() { @override public void onreceive(context context, intent intent) { // code here } }; } first declare filter - can add multiple actions single filter. need register broadcastreceiver serve upon arrival.

c# - Fine-grained visibility for 'internal' members -

recently reading partitioning code .net assemblies , stumbled upon nice suggestion this post : "reduce number of .net assemblies strict minimum". i couldn't agree more! , 1 of reasons see often, people want isolate piece of code, make types/methods internal , put them separate project. there many other reasons (valid , not) splitting code several assemblies, if want isolate components/apis while still having them located in 1 library, how can that? namespace myassembly.someapiinternals { //methods class should not //be used outside myassembly.someapiinternals internal class foo { internal void boo() { } } } namespace myassembly.anotherpart { public class program { public void test() { var foo = myassembly.someapiinternals.foo(); foo.boo(); //ok, not compiler error red flag @ least } } } how can 1 restrict t...

database - Heroku and DB GUI -

is there anyway use postgresql gui modify database contents without doing db:pull? i want administer database without taking off line... any ideas? thanks nope, can't... but, can use heroku console , rails stuff there, alternative, on production when can't put on hold until pull , push :)

silverlight - VB.NET - Send [Delegate] through the classes to set AddressOf -

how can put addressof, class? i error 'addressof' operand must name of method (without parentheses). " is there eval () function in vb.net? or how 1 this? public shared property e usercontrol public shared sub setbutton(byval button string, byval objekt [delegate]) dim errorbuttom1 button = e.findname("errorbutton1") addhandler errorbuttom1.click, addressof objekt end sub you have have instance of objekt, , method that's delegate must public , match signature of delegate. or, method must public static. i believe work...

ruby on rails - mysql pivot to a postgres pivot table -

i using mysql fine until switched 1 of rails apps heroku , had change over. works expected except have 1 query totally funky. this postgres, under mysql identical except extract dow , group additions, isn't problem, problem used sum days of week listed, sums entire table... , avg off since gets table avg , not days listed. is there way sum of listed days without having select, i'm missing?... avoid doing select ( select ... ) subquery sum of columns. thanks select rooms.name, rooms.id, max(case when (extract(dow availables.bookdate) - extract(dow date '2010-01-20')) = -3 (availables.price*1) else 0 end) day1, max(case when (extract(dow availables.bookdate) - extract(dow date '2010-01-20')) = -2 (availables.price*1) else 0 end) day2, max(case when (extract(dow availables.bookdate) - extract(dow date '2010-01-20')) = -1 (availables.price*1) else 0 end) day3, (avg(availables.price)*1) avg, (sum(availables.price)*1) * 2 sum, max((sign(spots)-1...

Recursive Selecting Similar Objects (LINQ) -

i've got bit of situation similar objects - basically, every object implements collection of base type. ... item1 - list items2 - list items3 public list specials { get; set; } item2 : item1 item3 : item1 special { public int value { get; set; } public string name { get; set; } } now, can go down tree , things - want want of "special" class intances entire object, way down tree - 1 single collection. is possible linq? or have rely on convoluted loops? you can use linq in combination recursive functions: static ienumerable<special> getspecials(item1 item1) { var item2specials = item1.items2.selectmany(item2 => getspecials(item2)); var item3specials = item1.items3.selectmany(item3 => getspecials(item3)); return item1.specials.concat(item2specials).concat(item3specials); } it little difficult me understand notation class structure. i'm assuming meant following c# classes: class item1 { public list<item2...

eclipselink - Can I use JPA 2.0 with Google App Engine? -

can use jpa 2.0(e.g eclipselink) google app engine? the datanucleus plugin google appengine supports both jdo , jpa api access google appengine datastore infrastructure. implementation seems support jpa1 only.

Using an org-mode table in emacs to convert units using calc -

is there way use org-mode table automatic unit conversion? i cannot work. wanted using simple table can input weights in ounces , let emacs convert them gramms. |---------+---------------| | 100oz | ??g | | 50oz | ??g | |---------+---------------| #+tblfm: $2='(calc-eval ?????) i didn't find out put calc-eval, in calc mode conversion entering f.i. 100g, pressing u c "convert unit" , entering g "gramm". thanks much. u c runs calc-convert-units , obtains target unit in peculiar way (i.e. not stack). underlying function math-convert-units , , can use calc-eval convert between strings , calc objects. |---+-------+-----------------| | # | 100oz | 2834.9523125 g | | # | 50oz | 1417.47615625 g | |---+-------+-----------------| #+tblfm: $3='(calc-eval (math-convert-units (calc-eval $2 'raw) (calc-eval "g" 'raw)))

ASP.NET Applications - Development with thunder fast speed -

. dear all, working on asp.net applications development (in different domains). management expecting applications development thunder fast speed. not bothered code quality. so in case, paid/free software/plug-ins/modules can us? if so, please provide elaborate details. many thanks, regards, arti. . you don't need plugins..only software need vs.net , good developers care code quality . else fall in place.

java - J2ME background music -

i play background music in j2me game. how can code function? you have similar question @ playing audio j2me for ease have posted code thread: // loads inputstream sound inputstream inputstream = this.getclass().getresourceasstream( musicfile ); // create standard player musicplayer = manager.createplayer( inputstream, musicencoding ); musicplayer.prefetch(); // add player listener access sound events musicplayer.addplayerlistener( ); if( loopmusic ) { // use loop count method infinite looping musicplayer.setloopcount( -1 ); } // set occurs twice prevent sound spikes @ // beginning of sound. volumecontrol volumecontrol = (volumecontrol) musicplayer.getcontrol( "volumecontrol" ); volumecontrol.setlevel( curvolume ); // start piece of music musicplayer.start(); // set volume once more volumecontrol = (volumecontrol) musicplayer.getcontrol( "volumecontrol" ); volumecontrol.setlevel( curvolume ); // finally, ...

asp.net - set background color of all textboxes (input fields) to transparent -

i upgrading part of old website. 1 of pages own uses controls , dlls not. there 1 dll puts textbox (input field) on page. field concepually label person chose use textbox. anyways, can't change dll. is there way in asp.net page uses dll textboxes on page should have transparent background? this code have access to. changes make have made here. <asp:content id="content1" contentplaceholderid="bodycontent" runat="server"> <style type="text/css"> .heading { color:#007dc3; font-weight:300; font-size:1.5em; line-height:1.22em; margin-bottom:22px; } </style> <cc1:wizard id="wizctl" runat="server"></cc1:wizard> </asp:content> thanks! like this? <div style = "input[type='text']{ border: none; background-color: transparent; } "> <cc1:wizard id="wizctl" runat="server"></cc1:wizard> </div> it doesnt seem wo...

ssh - Eucalyptus: getting private key from key pair through API / or injecting custom public key to instance -

i'm having simple problem, i'm still bit @ wits end. problems related command: euca-run-instances -k mykey emi-104915a8 as know, when starting instance in eucalyptus, either through api (as am) or command above, key pair has created. if have understood right, eucalyptus injects public key of key pair instance. there's method in api (using typica, btw) creating such key pair, believe when using it's not possible private key, needing, since i'd administrative stuff external application. so possible private keys through eucalyptus api? or have managed find solution injecting externally generated key pairs instances? i'm between making own images , either fooling around custom-user parameters, or making general key pair , putting straight image. i'm fooling around eucalyptus, , trying hand of it, since think it's best know cloud concept trying implement on top of :) there not can done in matter using typica. recommend creating keypair ss...

asp.net - My <% %> not working in div. Why? -

i've tried both snippets below. nothing. i've tried <%#, <%=, , <%. nothing. i'm stuck. <div style="background-color:gray; color:white; text-align:center; width:100%;"> <asp:hyperlink id="hyperlink1" target="_blank" navigateurl='<%= server.htmlencode(string.format("~/showhistory.aspx?section={0}&jobnumber={1}", "apqp header", "101244")) %>' runat="server">show updated history</asp:hyperlink>&nbsp;&nbsp; <asp:hyperlink target="_blank" navigateurl="~/showdeletedhistory.aspx" id="hyperlink2" runat="server">show deleted history</asp:hyperlink></div> <br /> <div style="background-color:gray; color:white; text-align:center; width:100%;"> <asp:hyperlink id="hyperlink1" target="_blank" navigateurl='<%...

Determining if a directory already exists using SVN ANT -

i'm looking create directory using svn ant, if directory not exist (using mkdir nested task svn ant appears fail if specify directory exists). is there isexists flag or of ilk can use here? or else can use detect existing directories on svn repository before continue creating directories via ant script? any thoughts on appreciated. cheers, stuart you want use svnexists condition . allows (using ant-contrib) <if> <not><svnexists target="..."/></not> <then> <svn> <mkdir url="..." message="creating directory" /> </svn> </then> </if> note: intermediate directories must exist when using mkdir .

multithreading - Synchronize() hangs up the thread -

i'm writing dll library in delphi multiple threads created it. let me describe problem step step. i'm sorry lengthy description in advance :-(. let's forget library while. created windows application going present views several cameras. created window meant show view single camera , contains timage control. there thread (a tthread descendant) downloads current image camera every couple of milliseconds , assigns timage control of window (using synchronize() method). application creates several instances of window on startup (with separate thread each of them), can see live view several cameras @ once. what's more, viewing windows parented main application window, appear within it. everything worked fine until decided put 2 windows dll library. found necessary reasons, not important now. created new dll library, added existing main window , camera-view window project , exported function creates , returns instance of main window. when main window created, creates s...

c++ - How does this work? copying anything into an array of bytes (chars) -

struct myrect { int x, y, cx, cy; char name[100]; }; int main() { myrect mr; mr.x = 100; mr.y = 150; mr.cx = 600; mr.cy = 50; strcpy(mr.name, "rectangle1"); myrect* ptr; { unsigned char bytes[256]; memcpy(bytes, &mr, 256); ptr = (myrect*)bytes; } printf("x = %d\ny = %d\ncx = %d\ncy = %d\nname = %s\n", ptr->x, ptr->y, ptr->cx, ptr->cy, ptr->name); return 0; } i testing how put struct/class in array of bytes, , suprised when compiled , worked, printf prints values set in mr variable. just little confused "ptr" pointing to? has allocated memory ptr somewhere? ptr still pointing address of bytes . or, once called bytes . though you've put bytes own block , variable semantically inaccessible outside of block, memory sticks around unmodified until function exits. typical implementation technique, undefined standard, don't depe...

sorting - WPF datagrid : how to sort a column programatically? -

how sort column programatically ? i have function such mywpfdatagrid.columns[0].sort(..) madseb use icollectionview itemssource , collectionviewsource generate it. can set sort descriptions there , it'll sort items you.

php - How do you create a "linked list" of Story nodes in Drupal 6? -

i'm trying link number of pages in regular flow in drupal. way i've been doing recently, create new menu , seperately create page each menu item. for example, have menu block links 1 through six. create 6 pages , link 1 node/1, 2 node/2, 3 node/3 , on. this fine, i'm told can create number of story nodes instead, , they'll link @ bottom of page ( http://imgur.com/xctye ) without intervention, linked list of page nodes. how achieve this? i worked out. had enable book module. co-worker explained me after reading question :)

mapping - Entity Framework: Mapped multiple Tables into one Entity -Insert problems -

today have entity framework question. have 2 tables: projects , projects_rights alt text http://www.zaczek.net/ef-stackoverflow.jpg projects contains projects... project_rights contains access rights each identity (=user) each project. table computed triggers/functions. mapping table one entity no challenge: class project { int id; double aufwandges; datetime createdon; ... int currentidentity__implementation__; int currentaccessrights__implementation__; } <entitysetmapping name="projekt"> <entitytypemapping typename="istypeof(model.projekt)"> <mappingfragment storeentityset="projekt"> <scalarproperty name="id" columnname="id" /> <scalarproperty name="aufwandges" columnname="aufwandges" /> <scalarproperty name="changedon" columnname="changedon" /> <scalarproperty name="createdon"...

Rounding float in Ruby -

i'm having problems rounding. have float, want round hundredth of decimal. however, can use .round turns int, meaning 2.34.round # => 2. there simple effect way 2.3465 # => 2.35 when displaying, can use (for example) >> '%.2f' % 2.3465 => "2.35" if want store rounded, can use >> (2.3465*100).round / 100.0 => 2.35

css - fixed image within a container -

what best way make div scroll along page? the exact effect utilized @ http://store.apple.com/ (on checkout summary after product added cart) edit: or this example - alas, it's not smooth i'd =/ in second example, using jquery this. scroll event of window object caught , using animate() function position of div changed dynamically.

audio - Reading *.wav files in Python -

i need analyze sound written in .wav file. need transform file set of numbers (arrays, example). think need use wave package. however, not know how works. example did following: import wave w = wave.open('/usr/share/sounds/ekiga/voicemail.wav', 'r') in range(w.getnframes()): frame = w.readframes(i) print frame as result of code expected see sound pressure function of time. in contrast see lot of strange, mysterious symbols (which not hexadecimal numbers). can anybody, pleas, me that? per the sources , scipy.io.wavfile.read(somefile) returns tuple of 2 items: first sampling rate in samples per second, second numpy array data read file. looks pretty easy use!

performance - Disable deserialzation Database Project Schema -

recently started working database project in visual studio 2010. have added reasonably large database solution , imported objects. warnings have been eliminated builds fine. the 1 thing annoys me when open solution, database project start load database schema takes time (minutes) , uses lot of resources. practically not able start working moment solution loaded. is there way disable or change behavior other removing database project solution or other hardware? answering own question: unload project. way (locally) not load next time open solution. if need work on database project, load it, work on , unload again.

javascript - Observing blur event for select Prototype -

i have <div id="myselect"> <select> <option value="0">1</option> <option value="1">2</option> </select> </div> im trying value of select on blur. so far have: event.observe('#myselect select', 'blur', function(event) { //get value }); please advise! try this $('myselect').down('select').observe('blur', function(e){ alert('blur'); });

compiler construction - Lua crashes when programs are compiled -

i'm working on very, simple lua program, trying teach myself language. here's 3 line program: file = io.open("hello.txt", "w") file:write("hello, world.\n") io.close(file) when use program lua script, works fine. when compile program, works. however, when run compiled program, this: alt text http://profnano.org/andy/misc/img/lua_crash.jpg i'm using lua 5.1.2 on windows xp on pentium 4. uninstalled lua , re-installed it, no effect. i'm compiling script follows: luac -o hello.exe hello.lua am doing wrong, or known bug? i'd able write lua programs run on computers without lua installed. help! (and thanks!) luac doesn't compile system exe file. take lua script, , turn lua bytecode. still have pass resulting file lua execute. so exe file contains garbage os point of view. when exe files don't contain valid exe headers, os reason decides must old style dos .com file , tries execute 16bit dos subsyst...

Dojo form displays different in IE 8 -

for reason, code displays correctly in browsers except ie8. <form dojotype="dijit.form">' <ul class="ul_two_col_form"> <li> <label>name</label> <input dojotype="dijit.form.validationtextbox" invalidmessage="name required." required="true" propercase="true" trim="true" id="contactname" /> <div dojotype="dijit.tooltip" connectid="contactname"> please enter name. </div> </li> <li> <label>email</label> <input dojotype="dijit.form.validationtextbox" invalidmessage="email required." regexp="[a-z0-9._%+-]+@[a-z0-9-]+\.[a-z]{2,4}" required="true" trim="true" id="contactemail" /> <div dojotype="dijit.tooltip" connectid="contactemail"> ...

C# Regex help - retrieving a number from a sentence -

so have text need integer out of. here's examples of text like: as low $99 you can $99 or less i need number out of text, either or without $ sign. can using regex.replace? i use regex.match. can use following regex: ([0-9]+) this assuming don't have commas, or decimals may mess up. if issue, add else inside [] . the match function return object tell if there matches along array of matches, , can found.

grid - wpf gridlines - changing style -

Image
is there way change style of gridlines in wpf grid? need divide grid 4 cells. used rowdefinitions , columndefinitions. need user distinguish cell which, that's why need change color of gridlines. it depends on going for. in wpf, there different ways anything. here couple of easier ones. the easiest way set showgridlines="true": <grid horizontalalignment="stretch" verticalalignment="stretch" margin="5" showgridlines="true"> <grid.columndefinitions> <columndefinition width="*" /> <columndefinition width="*" /> </grid.columndefinitions> <grid.rowdefinitions> <rowdefinition height="*" /> <rowdefinition height="*" /> </grid.rowdefinitions> <textblock grid.column="0" grid...

wpf - Do you have a real world example of AttachedPropertyBrowsableWhenAttributePresentAttribute usage? -

i come across attachedpropertybrowsablewhenattributepresentattribute , can't think of when useful. ideals? browsable means designer, visual studio's wpf designer named cider, shows property in designer. since attached properties not actual property of type , can applied type hard designer know when show or not show property. these attributes way developer let designer know attached property should shown in designer. in other words: browsable. specific attribute lets designer know attached property should browsable on types have specified attribute applied them. the attached property: public class whenattributepresenttestcontrol : grid { public static readonly dependencyproperty showwhencustomattributepresentproperty = dependencyproperty.registerattached( "showwhencustomattributepresent", typeof(int), typeof(whenattributepresenttestcontrol)); public static void setshowwhencustomattributepresent(uielement element, int value)...

boost - Static Compile of Thread Example -

i compiled boost c++ libraries follows: bjam install variant=release link=static threading=multi runtime-link=static no errors. compiled following source: #include <boost/thread/thread.hpp> #include <iostream> #define boost_thread_no_lib void hello() { std::cout << "hello world, i'm thread!" << std::endl; } int main(int argc, char* argv[]) { boost::thread thrd(&hello); thrd.join(); return 0; } using: g++ -lboost_thread thread.cpp the program compiled , ran fine because boost libraries found in /usr/local/lib . when removed /usr/local/lib /etc/ld.so.conf.d/libc.conf ran following error (no surpise): ./a.out: error while loading shared libraries: libboost_thread.so.1.41.0: cannot open shared object file: no such file or directory how compile thread.cpp linking boost statically? tried following: g++ -static -lboost_thread -lpthread thread.cpp i have following boost libraries installed: ldconfig -v | grep bo...

windows - php_ssh2.dll for PHP 5.3.1 on WinXP Pro sp3 -

i had php 5.2.2 installed on previous box (also winxp pro sp3) , had gotten ssh2 extension http://pecl4win.php.net/ext.php/php_ssh2.dll . sadly server seems out of commission ( "the pecl4win build box temporarily out of service. we're preparing new build system." ). old dll doesn't work new php , not have ms visual studio 6 compile it. anyone have idea can file php 5.3.1? or perhaps should roll php 5.2.2? i should mention i'm using xampp 1.7.3 has apache 2.2. need dll's compiled vc6. you can download vc6 version of php_ssh2 here http://www.webvamp.co.uk/uploads/2011/02/php_ssh2-5.3.x-vc6-apache.zip

Loading ruby source from a zip archive? -

i have mod_rails server disk space, oddly enough, @ premium. there way me compress application's source, python's zipimport ? there obvious disadvantages this, should break down , spend nickel on disk space, figured it'd worth shot. oh, neat. check out rubyzip gem: rubyzip features zip/ziprequire.rb module ( source ) allows ruby load ruby modules zip archives. ( update : ziprequire.rb no longer present in rubyzip gem, source link appears contain old content nonetheless.) like so. modified example: require 'rubygems' require 'zip/zipfilesystem' require 'zip/ziprequire' zip::zipfile.open("/tmp/mylib.zip", true) |zip| zip.file.open('mylib/somefile.rb', 'w') |file| file.puts "def foo" file.puts " puts 'foo here'" file.puts "end" end end $:.unshift '/tmp/mylib.zip' require 'mylib/somefile' foo # => foo here you...

c - Is returning zero from main necessary, and how can the return value from main be useful? -

i know it's been convention in c89 return 0 integer value main in c program, this: int main() { /* useful here */ return 0; } this return "successful" result operating system. still consider myself novice (or intermediate programmer @ best) in c, date i've never understood why important. my guess is, useful return result if you're tying output of program input of another, i'm not sure. i've never found useful, or maybe don't understand intention is. my questions: is returning 0 necessary c program? how return value main() useful? when writing scripts (like in bash, or cmd.exe on windows) can chain commands && , || operators. canonically, a && b run b if result of a zero, , a || b run b if a returned nonzero. this useful if wish conditionally run command if previous 1 succeeded. example, delete file if contains word foo. use : grep foo myfile && rm myfile grep returns 0 when ...

xhtml - Restrictions on PHP include() -

hey guys, separating xhtml php putting xhtml separate file , using php's include() function within php script. this works fine, however, users still able access .html file directly if know address. can't it, rather not show. i've seen scripts in past use form of referrer check, add basic ( notice said 'basic' ) restrictions prevent being viewed accessing directly? thanks! clarification : forgot mention want within php, no web-server configuration ( moving files out of document-root, configuring web-server disallow access, etc. ). think logical choice here use define() constant check, that's indeed i've seen in other scripts had forgotten, outlined in post. realize not best solution, given html file can access of no particular value, define() constant should suffice. appreciate responses! if place files (like index.php) in /something/public_html/ want move files /something/ . way users cannot access files. the /public_html/ called...

java - How can I perform multiplication without the '*' operator? -

i going through basic stuff learning c. came upon question multiply number 7 without using * operator. it's this (x << 3) - x; now know basic bit manipulation operations, can't how multiply number other odd number without using * operator? there general algorithm this? think how multiply in decimal using pencil , paper: 12 x 26 ---- 72 24 ---- 312 what multiplication in binary? 0111 x 0101 ------- 0111 0000 0111 ------- 100011 notice anything? unlike multiplication in decimal, need memorize "times table," when multiplying in binary, multiplying 1 of terms either 0 or 1 before writing down in list addends. there's no times table needed. if digit of second term 1, add in first term. if it's 0, don't. note how addends progressively shifted on left. if you're unsure of this, few binary multiplications on paper. when you're done, convert result decimal , see if it's correct. after you...

actionscript - Scrolling 2 lists with 1 scroller Flex 4 -

been trying scroll 2 lists native scrollers disabled 1 scroller added right of them. i tried setting viewport of each list scroller , while works instantiates scroller each of lists rather use 1. essentially i'm trying have them scroll vertically @ same time while dragging 1 scrollbar thumb. i thought interesting question , did little investigation. here came with. <?xml version="1.0" encoding="utf-8"?> <s:application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" initialize="application1_initializehandler(event)" creationcomplete="application1_creationcompletehandler(event)"> <fx:script> <![cdata[ import flashx.textlayout.container.scrollpolicy; import mx.collections.arraycollection; import mx.events.flexevent; ...

jsf - java.lang.IllegalArgumentException at javax.faces.component.UIComponentBase.validateId -

exception java.lang.illegalargumentexception: partidospk.idequipo @ javax.faces.component.uicomponentbase.validateid(uicomponentbase.java:551) @ javax.faces.component.uicomponentbase.setid(uicomponentbase.java:366) @ com.sun.faces.facelets.tag.jsf.componenttaghandlerdelegateimpl.apply (componenttaghandlerdelegateimpl.java:168) @ javax.faces.view.facelets.delegatingmetataghandler.apply(delegatingmetataghandler.java:114) @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:91) @ javax.faces.view.facelets.delegatingmetataghandler.applynexthandler(delegatingmetataghandler.java:120) @ com.sun.faces.facelets.tag.jsf.componenttaghandlerdelegateimpl.apply(componenttaghandlerdelegateimpl.java:204) @ javax.faces.view.facelets.delegatingmetataghandler.apply(delegatingmetataghandler.java:114) @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:91) @ javax.faces.view.facelets.delegatingmetataghandler.applynexthandler(...

database - Many-to-many relationship for many types of entities -

i have 4 tables: disks, folders, files , links. 4 types of entities, , can not merged 1 type (e.g. 1 table) because have different number , types of attributes. , there relationships: disks can contain folders, files , links; folders can contain folders, files , links too; files , links can't contain anything. in addition, entities have order in displayed (e.g. "user defined", not alphabetical or else). simplified example of actual problem, in real there more entities , relationships more complicated. so, proposed structure of tables? thanks answer question i'd go adjacency list model additional checking references: create table inode (type int not null, id int not null, parent int not null, order int not null, primary key (type, id), check (type in (1, 2, 3, 4))) create table disk (type int not null, id int not null primary key, disk_attributes ..., check (type = 1), foreign key (type, id) references inode (type, id)) create table file (t...

asp.net - Adding html to a placeholder control on the fly -

i generic markup load @ runtime froma file follows: <div id="pagewidth" > <div id="header" > head </div> <div id="wrapper" class="clearfix" > <div id="twocols" class="clearfix"> <div id="column2" > main content column </div> <div id="column3" > right column </div> </div> <div id="column1" > left column </div> footer i want add place holder control in asp.net web page. how do it? add html string asp:literal control , add literal control placeholder's control collection.

type conversion - how to convert from char* to char[] in c -

here code sample void something() { char c[100]; scanf("%s",c); char c2[100]=c; } my problem when assignment error says can't assign char * "c" char[] "c2"; how can achieve assignment? you'll have use strcpy() (or similar): ... char c2[100]; strcpy(c2, c); you can't assign arrays using = operator.

c# - How to make a UserControl inert at design time? -

i have usercontrol cool video capture stuff. slapped control on form - , starts working right away, in design time! that's gratifying , see working, it's kind of annoying @ design time, , slows me down. know usercontrol in run-time when it's being used on form/control @ design time, i'd able shut off when it's not in actual running app. what's best way this? put code in control: if(designmode) return; designmode property tells you're running in designer.

ruby on rails - Ajax call made by jQuery .load function -

the problem in difference how browsers implement simple calls. problem occurs while using colorbox extenstion (facebox variant). content loaded colorbox jquery load() function. when call made chrome, accept header set to: accept: text/html, */*, text/javascript in case of firefox, header looks this: accept: text/javascript i tried force accept header setting using: jquery.ajaxsetup({ 'beforesend': function (xhr) {xhr.setrequestheader("accept", "text/javascript")} }); it works while using $.ajax calls, doesn't seem affect .load function. idea how solve issue? even though it's better avoid issue using $.ajax call directly, can create proxy method $.ajax method. helps since $.load in turn calls $.ajax set of default parameters. can therefore intercept $.load s call $.ajax . var org = $.ajax; $.ajax = function(settings){ settings['accepts'] = null; settings['beforesend'] = function(xhr) { ...

Get all webpart properties via PowerShell for each page on a SharePoint site -

i have site in sharepoint 2007 (not mine personally) subsites. each subsite, , each of pages, how can webpart's properties? this using powershell (the server not have visual studio, matter). you have batch programing, iterate sites, pages ... maybe can find solution on these links: automating sharepoint 2007 configurations via stsadm , powershell enumerate page web parts you can write program on machine using c# , execute on sharepoint server.

stdout - Capturing output from WshShell.Exec using Windows Script Host -

i wrote following 2 functions, , call second ("callandwait") javascript running inside windows script host. overall intent call 1 command line program another. is, i'm running initial scripting using cscript, , trying run else (ant) script. function readallfromany(oexec) { if (!oexec.stdout.atendofstream) return oexec.stdout.readline(); if (!oexec.stderr.atendofstream) return "stderr: " + oexec.stderr.readline(); return -1; } // execute command line function.... function callandwait(execstr) { var oexec = wshshell.exec(execstr); while (oexec.status == 0) { wscript.sleep(100); var output; while ( (output = readallfromany(oexec)) != -1) { wscript.stdout.writeline(output); } } } unfortunately, when run program, don't immediate feedback called program doing. instead, output seems come in fits , starts, waiting until original program has finished, , appears have deadlocked. want have spawned proce...

jms - What kind of messaging architectures are used in huge, scalable sites today? -

sites twitter , facebook scale hundreds of thousands of users. of architectural overviews available online talks , slideshows. however, question more oriented towards messaging middleware/layer these sites use. understand different different sites - there common characteristics when using messaging technologies (e.g. jms) on highly scaled sites? more specifically, there use cases cannot handled traditional messaging solutions? twitter switched scala middleware , got huge performance boost. high-scalability best authority on topic of scaling web applications.