Posts

Showing posts from September, 2011

c# - Application hangs when calling external constructor -- troubleshooting steps? -

this may long shot i'm out of ideas. i've got vs c# solution 3 projects in it. there's class library project , 2 application projects depend on class library. class library in turn depends on few other dlls including avalonedit dll sharpdevelop project. one of applications building , running fine, including use of own control wraps avalonedit control. other application failing run , seems failing @ point when avalonedit control initialised via xaml in wrapping control. the problem don't see errors in debug output @ all, see dll loaded message , nothing. if step constructor of control step never completes. debugger says app running, apparently spinning somewhere in avalonedit dll when underlying edit control constructed xaml side. i have assume there's issue difference in environment between 2 projects i'm kind of stumped how proceed in tracking problem down. going have somehow arrange matters can put break in avalonedit source? edit: if pause/break

c - signed two's complement arithmetic -

i thinking on data types ranges, question arises. know signed char's range -128 127. got how 127 comes, i.e. 0111111 = +127 but not how -128 comes? if on sign bit 11111111, how equal -128 ? most of time, computers use what's called 2's complement represent signed integers. the way 2's complement works possible values in huge loop, 0, max_value, min_value, zero, , on. so minimum value maximum value +1 - 01111111 = 127 , , 10000000 = -128 . this has nice property of behaving same unsigned arithmetic - if want -2 + 1 , have 11111110 + 00000001 = 11111111 = -1 , using same hardware unsigned addition. the reason there's value on low end choose have numbers high-bit set negative, means 0 takes value away positive side.

flash - Actionscript block until request completes -

i want make synchronous request server. want entire program stop processing until request complete , server has responded; proper way of doing this? you don't want entire program stop processing until server responds, because runs risk swf trigger "script has executed 15 seconds" modal dialog warning appear in front of user, @ point might consider action lost cause. considered "crash" , "not idea." what you're trying accomplish believe halting execution (including rendering) achieve? if really want make application non-responsive user activity during request, might able away setting mousechildren = mouseenabled = false on application's root movieclip. if need stop timeline animations, you'll have come way globally find / stop them yourself. obviously, enter_frame events you're listening for, or timers you're running should stop when make request. you might able away setting swf's framerate 0fps in code (

math - Finding the angle between two lines -

possible duplicate: calculating angle between 2 lines without having calculate slope? (java) i need find angle between 3 points. have point , point c being 2 points of ray , have point b being central point points , c extend from. if create line between points b , a, , create line between points b , c, can find angle between 2 lines. take line direction vector a(a,a',a") , line b direction vector b(b,b',b"). a.b = ||a||.||b||.cos(t) a.b cos(t) = -------------- ||a||.||b|| take a(1,2,3) ; b(4,5,6) ; c(3,2,0) calculate angle between lines ab , ac. line ab has direction numbers (3,3,3) , line ac has direction numbers (2,0,-3). hence 6 + 0 - 9 cos(t) = ----------------- sqrt(27) .sqrt(13) update: use arccos(cos(t)) obtain angle. convert radians degrees multiply 180/π convert degrees radians multiply π/180

android - NDK call in a GLSurfaceView class -

i trying render opengl es surface ndk, got halted in work. have setup similar 3d example in ndk. have class inheriting glsurface view , 1 inheriting glsurfaceview.renderer. in .c file, have simple method nothing. void function nothing in it. can call function in class inherit activity oncreate method. private static native void nativesetup(); @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); mglview = new graphglsurfaceview(this); setcontentview(mglview); nativesetup(); } the program works fine. however, if put call (and declaration) in 1 of glsurfaceview classes, program fails (nativesetup call in question). have verified working fine without native call (a colored surface drawn). have ideas why cannot call native code glsurface classes? my c file: #include <string.h> #include <jni.h> void java_com_test_intro_nativesetup( jnienv* env ){} my jav

iphone - Is there any way to resize the UIPickerView so that I can see completely it in center of my application? -

hello trying resize uipickerview below dimension given, not working @ want visible. here datepicker uipickerview declared , synthesized too, should do? datepicker = [[uipickerview alloc] initwithframe:cgrectmake(100, 200, 100, 150)]; datepicker.delegate = self; datepicker.showsselectionindicator = yes; [self.view addsubview:datepicker]; if not getting mean, can ask me again,,, cgaffinetransform s0 = cgaffinetransformmakescale(scalefactor, scalefactor); cgaffinetransform t1 = cgaffinetransformmaketranslation(x,y); mypickerview.transform = cgaffinetransformconcat(s0, t1); you can use 0.5 scalefactor resize pickerview 50%, , change x , y appropriate values make pickerview appear in desired position. note: import quartzcore framework.

python - Django: How to set DateField to only accept Today & Future dates -

i have been looking ways set django form accept dates today or days in future. have jquery datepicker on frontend, here form field modelform. thanks help, appreciated. date = forms.datefield( label=_("what day?"), widget=forms.textinput(), required=true) you add clean() method in form ensure date not in past. import datetime class myform(forms.form): date = forms.datefield(...) def clean_date(self): date = self.cleaned_data['date'] if date < datetime.date.today(): raise forms.validationerror("the date cannot in past!") return date see http://docs.djangoproject.com/en/dev/ref/forms/validation/#cleaning-a-specific-field-attribute

select - Matching at least one of each value in MySQL -

i've got 2 tables, want select entries 1 table, there entries in second table list of items. for example: entry id=1 requirements=(1,2,3) id=2 requirements=(1,3,5) submission id=1 entry=1 requirement=1 id=2 entry=2 requirement=2 id=3 entry=3 requirement=3 would select entry id=1 , not entry id=2 (so where in doesn't job) *edit actual datasets: insert submission ( entry_id , requirement_id , submission_id ) values (17, 1, 1), (43, 1, 2), (57, 0, 3), (57, 0, 4), (1, 1, 5), (26, 1, 6), (40, 1, 7), (40, 1, 8), (40, 1, 9), (40, 1, 10), (85, 1, 11), (94, 1, 12), (114, 0, 13), (32, 1, 14), (34, 0, 15); insert entry ( entry_id , category_id ) values (1, 2), (2, 1), (3, 1), (4, 1), (5, 2), (6, 1), (7, 1), (8, 1), (9, 1), (10, 1), (11, 1), (12, 1), (13, 1), (14, 1), (15, 1); insert category ( category_id , requirement ) values (1, '1,2,3'), (2, '1,2,4,5,6'), (3, '1,2,4,5,6'); find rows in table 1 there 3 matching rows in t

getting started with making event-driven applications in Dev C++ -

i newb developing a windows c/c++ program in dev c++ logs system activity when link down. want acquainted developing event-driven applications. to learn, making simpler program 1-- ping_a_server() periodically , knows state of link 2--a nothing in normal state 2--b appends file "serialno,time" periodically long link down 2--c sends file when link up i newb, unfamiliar real-life programs. please tell me how implement above components 1 , 2 (threads, maybe?) , point me resources learn them. you should start resources listed on wiki: http://en.wikipedia.org/wiki/event-driven_programming

javascript - Having jQuery inside of an iframe modify the parent window -

i have page has iframe. in iframe, want jquery remove element patent page, i'm trying: parent.$('#attachment-134').remove(); but doesn't work. ideas? thanks should be: $(parent.document).find('#attachment-134').remove(); this of course remains true, if iframe , parent have identical domain . otherwise sop (same origin policy) deny access. example: http://jsbin.com/eqise5

javascript - How can apply 4 different tooltip onto a single image -

can me how can apply 4 different type of tooltips onto single image? when mouse on over image @ top bottom left , right, @ time 4 different tooltip should displayed. here, have put example need. it's in flash want without flash. http://www.lavasa.com/high/ if have idea regarding same please share me. i think have 3 options. doing work , displaying tooltip 'manually', i.e. floating div using javascript or something, there bunch of libraries doing this. split image four, , provide title (which displayed tooltiop of mouse hovering) each. do old school <map> . an example using <map> : <img src="trees.gif" usemap="#green" border="0"> <map name="green"> <area title="save" shape="polygon" coords="19,44,45,11,87,37,82,76,49,98" href="http://www.trees.com/save.html"> <area title="furniture" shape="rect" coords="128,1

Android EditText Link to Button -

not sure how should implemented. have activity edit text , button (a text field specify search parameters, , button execute search). right user has enter text in field , press search button. how can make button default action, or configure edit text field click button when user presses enter? currently default behavior, when select edit text field, there no return key shown on virtual keyboard. any ideas? found documentation item shortly after posting question. <edittext android:id="@+id/edtinput" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" android:inputtype="textshortmessage|textautocorrect|textcapsentences|textmultiline" android:imeoptions="actionsend|flagnoenteraction" android:maxlines="4" android:maxlength="2000" android:hint="@string/compose_hint"/>

graniteds - lazy loading in granite ds -

how load entities in flex application using lazy loading .i have deep object graph graniteds , data management framework, lets transparently load uninitiated associations: see documentation here . so, basically, don't have special in order initialize lazy collections/proxies, need access 1 of them on client side (asking size of collection example) , trigger call server , fetch uninitialized data. if don't want or can't use transparent lazy-loading, need write specific initialization method must have access entitymanager, receive entity parameter, initialize required association , send entity client.

c# - Using enum in ConverterParameter -

i building application can used many users. each user classified 1 of next authentication levels: public enum authenticationenum { user, technitian, administrator, developer } some controls (such buttons) exposed levels of users. have property holds authentication level of current user: public authenticationenum currentauthenticationlevel { get; set; } i want bind property 'visibilty' property of controls , pass parameter converter method, telling lowest authentication level able see control. example: <button visibility="{binding path=currentauthenticationlevel, converter={staticresource authenticationtovisibility}, converterparameter="administrator"}"/> means 'administrator' , 'developer' can see button. unfortunately, above code passes "administrator" string. of course can user switch-case inside converter method , convert string authenticationenum. ugly , prone maintenance errors (each t

ruby on rails - Searching tags with metawhere -

i'm trying perform multi-column search on model , it's associated tags. i'm using metawhere , acts-as-taggable-on this. have model title , body has amount of tags names. i've been trying set query metawhere never returns results when try join model's tags. have variable named "str" that's being used search post model following... post.where(:title.matches % '#{str}%' | :body.matches % '#{str}%' | {:tags => [:name.matches % '#{str}%']}).joins(:tags) which generates following sql... => "select `posts`.* `posts` inner join `taggings` on `posts`.`id` = `taggings`.`taggable_id` , `taggings`.`taggable_type` = 'post' inner join `tags` on 'taggings.tagger_id null , taggings.context = \\'tags\\'' (((`posts`.`title` '\#{str}%' or `posts`.`body` '\#{str}%') or `tags`.`name` '\#{str}%'))" can point me in right direction this? appreciated. try: (assumin

ios4 - vpn client for iphone/ipad -

i want implement vpn client applcation iphone , ipad. requirement develope application enter vpn details , show network traffic , connection. can please me in this, how implement vpn client on ios. looks vpn api not exposed in apple ios. http://blog.michael.kuron-germany.de/2010/09/ios-4-1-undocumented-vpn-api-used-by-cisco-anyconnect/

ruby on rails - default for serialized column in activerecord migration -

so have serialized column :dimensions, , in migration, set field default hash. i have tried... create_table :shipping_profiles |t| t.string :dimensions_in, :default => {:width => 0, :height => 0, :depth => 0} and just t.string :dimensions_in, :default => hash.new() but fields end null. how can set default serialized object field on creation, or @ least make sure serialize attribute hash? when rails serializes hash save in db, convert yaml can stored string. work in migration, need convert hash yaml... t.string :dimensions_in, :default => {:width => 0, :height => 0, :depth => 0}.to_yaml or, alternatively, set in model after initialization... class shippingprofile < activerecord::base after_initialize :set_default_dimensions private def set_default_dimensions self.dimensions_in ||= {:width => 0, :height => 0, :depth => 0} end end

Paypal - allowing customer to enter value on buy now button -

my question - there way create paypal button allows customer enter value of amount wish pay. not wish use 'donate' button because not donation situation - sale of product. example: have ethically produced environmentally friendly product. base price $10.00 (for example), ask , allow people pay/contribute more if wanted in support of ethical/environmental aspect of product. so 1 customer might want pay $11 while might want pay $13. is possible allow happen type of paypal button - excluding donate button. thanks r yes, possible, you'd need have system enter price on website (and can check it's >=$10) , once they've entered price, create button code using price they've specified.

Android emulator is crashing frequently -

after getting latest update honeycomb , seems android emulator crashing , not responding quite frequently. also observed starting emulator avd has snapshot stored earlier causing emulator freezing . any workaround ?

Is appearance of PHP file names used in AJAX when viewing source insecure or not? -

all names of phpfiles use ajax functions appear when 'view source' clicked. ok or insecure? if insecure, ways correct them? no, exposing .php extension in ajax call (or in other url) not security problem in itself.

.net - GUI freeze while loading data in BackgroundWorker -

i have listview control receiving data backgroundworker through reportprogress . worker dumps hundred rows in quick succession. each chunk of data fires progresschanged event , gui thread adds new item listview . as data retrieval operations run on separate thread, gui supposed update on every change. reason doesn't happen - interface remains frozen until worker completed. any ideas? also, tests done on fast machine, don't think computer performance issue. it's winforms application. put in bgw worker loop, after reportprogress call: system.threading.thread.sleep(15); odds see listview updating. what's going on here ui thread getting flooded delegate invoke requests. dispatched before paint notification. if next invoke request arrives before previous 1 has finished running never gets around doing normal housekeeping tasks. painting , responding input. items added list view, can't see being done. call reportprogress less often. do

iphone - Can use AVCaptureVideoDataOutput and AVCaptureMovieFileOutput at the same time? -

i want record video , grab frames @ same time code. i using avcapturevideodataoutput grab frames , avcapturemoviefileoutput video recording. can't work , error code -12780 while working @ same time individual. i searched problem no answer. did have same experience or explain? it's bother me while time. thanks. i can't answer specific question put, i've been recording video , grabbing frames @ same time using: avcapturesession , avcapturevideodataoutput route frames own code avassetwriter , avassetwriterinput , avassetwriterinputpixelbufferadaptor write frames out h.264 encoded movie file that's without investigating audio. end getting cmsamplebuffers capture session , pushing them pixel buffer adaptor. edit: code looks more or less like, bits you're having no problems skimmed on , ignoring issues of scope: /* ensure i'm given incoming cmsamplebuffers */ avcapturesession *capturesession = alloc , init, set preferred pres

iphone - I Need to display the content on label with multi line -

i displaying data on uilabel iphone multi-line. problem need display specific content , display dot... on label if content not display in 2 line after content for multi-line label use uitextview or set label multi-line: label.linebreakmode = uilinebreakmodewordwrap; label.numberoflines = 5; //or whatever want

asp.net mvc 2 - reduce number of round trips - linq-to-sql -

is possible reduce number of round trips database during execution of asp.net mvc 2 action following specific case , in general? i'm using linq-to-sql. following code results in 60 selects, take 60 round trips database. how can reduce number of round trips ? if more of code needed, post it. my view model : public class articlescontainerviewmodel { public articlescontainerviewmodel() { } public article categoryarticle { get; set; } public ilist<articlesnode> categorynodes { get; set; } } public class articlesnode { public article nodearticle { get; set; } public iqueryable<article> nodeitems { get; set; } } the view: <ul class="tabs"> <% foreach (var category in model) { %> <li><a href="#" class="s"> <%= html.encode(category.categoryarticle.abbreviatedtitle) %></a></li> <% } %> </ul> <!

serialization - How do I process a serialized string in ASP.NET MVC? -

i haven't worded title of question particularly in slightest. i'm bit of newbie when comes lot of json bits , pieces , currently, have nested sortable plugin produces following serialized string: list[1]=root&list[2]=root&list[3]=2&list[4]=2&list[5]=2&list[6]=2&list[7]=root&list[8]=root&list[9]=root&list[10]=root&list[11]=10&list[12]=10&list[13]=10&list[14]=10&list[15]=root&list[16]=root which , good, i've not clue how process in controller. i've had google , couldn't find specific, think search terms poorly worded question title. can point me in right direction please? thanks in advance. this how in mvc 2. edit: use json2.js script mentioned in haacked article part of html: <ul class="sortlist"> <% foreach(var item in model){ %> <li id="item_<%= item.id %>"> the jquery: $(".sortlist").sortable( {

actionscript 3 - Flash 10.1 AS3 - Applying realtime effects to Microphone - stutter problems -

i'm trying write flash application takes microphone stream , applies realtime effects , outputs speakers. i'm finding i'm having problems stuttering when taking output mic, copying bytearray amd using seperate sound = new sound(); sound.addeventlistener(sampledataevent.sample_data, processsound); sound.play(); to read bytearray , play sound. i have noticed input mic's bytesavailable changes, , 2 events (the mic's sample_data , sound's sample_data) aren't firing b b b b needed more random. am right in thinking mic.sample_data event fires @ different intervals different amounts of data , working implementation need read available data in , buffer input sound sampledataevent have play avoid stuffering? i found solution thought i'd post on here incase else had similar problems (many google searches turned nothing me). it seem input mic fed through inconsistently, , bytes sent through needed in order process sound. ke

windows installer - Close application before InstallValidate -

i have msi pops out prompt if application running. how can close application on running uninstall, before installvalidate? simple wm_close trick. i added switch app closing running instances, , tried adding customaction run switch, fails because, quote, "it must between installinitialize , installfinalize".

Run linux command in ruby -

i'm trying following.. if "ps | grep -e file" true; else false; what need make string n if statement execute linux command listed? simply use system("command") . it'll return true if command executed. edit read question again, , believe you're looking this: if `ps | grep -e file`.empty? # no matches true else false end

c# - Why don't WinForms/WPF controls use Invoke internally? -

i understand why gui controls have thread affinity. but why don't controls use invoke internally in methods , properties? now have stuff update textbox value: this.invoke(new methodinvoker(delegate() { textbox.text = "newvalue"; } while using textbox.text = "newvalue"; enough represent same logic. all have done change textbox.text logic (pseudocode): public string text { set { if(!this.invokerequired) // change logic else throw new badthreadexception(); } } to this: public string text { set { if(!this.invokerequired) // change logic else this.invoke(new methodinvoker(delegate() { // change logic } } } the same goes getters , methods. i'm not proposing remove invoke / begininvoke , i'm asking why controls don't necessary thread switch instead of throwing exception. i thi

javascript - jQuery Datepicker - Half Day? -

has come across method of being able choose half day using jquery datepicker? basically, i'd users able select monday pm friday am, if know mean. try jquery plugin jquery ui timepicker

ajax - which is a more modern way to create web widgets? -

i want create new web widget, , wondering best practice it. should develop normal page using php/ruby/python , use iframe make widget code? or should develop ajax based application? or there better method both? what pros , cons each? thanks there many opportunities it: client side programming language javascript (pure js, jquery, ...), vba (not common), ... server side php, ror, python, coldfusion, asp.net, .. you can load per iframes , on (but should not use iframes because not seo , not nice solution . and on ... most cms use same language (in written) - use server side programming language. in php observer pattern , hooks-concept common ways "connect" plugins/addons/widget/gadget website ...

iphone - Repeating NSTimer, weak reference, owning reference or iVar? -

i thought put out here separate question previous retaining-repeating-nstimer-for-later-access discussion has moved forward making new question clearer yet edit: the scenario object creates repeating nstimer, lets in viewdidload, once created nstimer needs stay around can accessed other methods. nstimer *ti = [nstimer scheduledtimerwithtimeinterval:1 target:self selector:@selector(updatedisplay:) userinfo:nil repeats:yes]; i understand when created runloop takes ownership of nstimer , stops, removes , releases nstimer when [ti invalidate]; called. by virtue of fact need access nstimer in more 1 method need way hold reference future use, revised question is: // (1) should nstimer held using owning reference (i.e.) @property(nonatomic, retain) nstimer *walktimer; [self setwalktimer: ti];

php - What code is this? -

please consider following code snippet: from php-5.3.1/ext/session/session.c: phpapi char *php_session_create_id(ps_create_sid_args) … gettimeofday(&tv, null); … /* maximum 15+19+19+10 bytes */ spprintf(&buf, 0, "%.15s%ld%ld%0.8f", remote_addr ? remote_addr : "", tv.tv_sec, (long int)tv.tv_usec, php_combined_lcg(tsrmls_c) * 10); … return buf; } i have found on internet. can't understand code this. guess implementation of php function in c++. if yes, please explain me how php calles c++ function in it? the shocking truth php written in c. looking @ source of php itself, or need explain question further.

php - Can someone explain Magentos Indexing feature in detail? -

i kind of how indexing in magento works, haven't seen documentation on this. kind of know following. how works what purpose why important what details should know it anything else can understand indexing , how used in magento i think having information of great use others in boat don't indexing process. update: after comment on question , ankur's answer, thinking missing in knowledge of normal database indexing. magento's version of handling indexing , better me answer in terms of database indexing in general, such link here how database indexing work? magento's indexing similar database-level indexing in spirit. anton states, process of denormalization allow faster operation of site. let me try explain of thoughts behind magento database structure , why makes indexing necessary operate @ speed. in more "typical" mysql database, table storing catalog products structured this: product: product_id int sku varchar

performance - How to find more information about a given MySQL process? -

i have slow query built orm , i'm curios how find out exact query being executed. i cannot monitor mysql-slow.log because never finishes execution (as in don't have eternity wait it, more hour in still waiting). also cannot query orm, after execution. , way think of getting process list. show processlist \g but problem of query trimmed of, before from keyword. this question has been asked before no answer https://stackoverflow.com/questions/3741356/find-queries-from-process-id-mysql-5-1-x any suggestions? if query formatted in multiple lines, mysql clients display first line. see full output run show full processlist; query in mysql console.

Android Facebook SDK configuration on Eclipse -

i downloaded android's facebook sdk far couldn't configure properly. eclipse doesn't recognize facebook sdk project. does got problem? you should use git plugin import facebook project github eclipse workspace. it's configured android library. , in android project in want use library. right click on project , choose properties. click on android tab, , @ bottom should section libraries, detailed instructions here . click add, , facebook sdk should appear. check facebook sdk , available in app.

php - Exhausting Memory - Tried Fixing Loops, Still Does Not Work -

i'm experiencing memory usage issue - cannot figure out where. i've tried replacing of foreach loops loops or issuing query db, still gettting same error - "fatal error: allowed memory size of 134217728 bytes exhausted (tried allocate 72 bytes) in on line 109". can provide insight may causing issue? thank you! code after @patrick 's answer: $participating_swimmers = array(); $event_standings = array(); $qualifying_times = array(); $events = array(); $current_event = ''; $select_times_sql = "select event, time, name, year, team, time_standard, date_swum demo_times_table sex = 'm' , (time_standard = 'a' or time_standard = 'b') order event, time asc"; $select_times_query = mysql_query($select_times_sql); //create array current line's swimmer's info while ($swimmer_inf

iphone - UITableView cells with buttons -

i want have uibutton in each uitableviewcell allow me perform selector on object corresponding row. way got working create separate uitableviewcell each row (no reuse), add new uibutton tagged row. when button gets tapped, resulting selector checks tag of sender determine object change. is there better way of doing this? one, not reusing cells unfortunate, , using uiview.tag seems hacky. you can use same tag number on of uibuttons. to extract row number has been clicked, implement code in selector: - (void)buttonclicked:(id)sender { uitableviewcell * clickedcell = (uitableviewcell *)[[sender superview] superview]; nsindexpath * clickedbuttonpath = [self.tableview indexpathforcell:clickedcell]; int rownumber = clickedbuttonpath.row; }

java - JTwain doesnt work in jsp using servlet -

i have downloaded jtwain api , created/tested java class connect scanner, open scanner ui , scan image java without problems. i tried create jsp in tomcat form action connects servlet dopost method, calls jtwain method. the problem im getting instead of getting kodak scanner window asking me press scan webpage freezes. put system.outs check freezes , stops @ 2 if kodak scanner dialog displaying , waiting me press scan button. public static image initscan(){ try { source source = sourcemanager.instance().getdefaultsource(); system.out.println(1); source.open(); system.out.println(2); image image = source.acquireimage(); system.out.println(3); return image; }catch(exception e) { e.printstacktrace(); return null; }finally{ sourcemanager.closesourcemanager(); } } i assumed work file open dialogue not, suggestions? i don't know jtwain, jsp executed on server, no

php - Jquery getJSON throws: "Failed to load resource: cancelled" in Safari -

i've found few posts (here , across web) on issue , tried proposed solutions no success, there differences in original issue. example seems straightforward, i'd love input on this. here's code: theuri = "https:// <?= $_server['http_host'] ?> /validate.php"; thedata = { 'validationtype' : 'login', 'ident' : document.getelementbyid("login_ident").value, 'password' : document.getelementbyid("login_pw").value, 'logintries' : <?= $logintries ?> } $.getjson(theuri, thedata, function() {alert('success!')}); the "success!" alert shows fine error " failed load resource: cancelled " flashes through error console. "validate.php" follows (some of server code has been omitted clarity), assume variables valid values: <?php echo '{'; echo '"result" : "' . $login_success . '",'; echo '

Clearcase remote client 7.0.1 file "download" problem on Windows 7 -

i want create view of folder server using remote client 7.0.1. when view created can see folders, not single file. tried update view several times , didn’t help. can see files in left pane (’ clearcase navigator ’) of remote client not locally on disk. it turned out, permission/group membership problem. not registered in group has access files want.

Is Entity Framework good for bigger Database? -

i used entity framework database having around 50 tables , worked fine. but see happens larger database in terms of number of tables/entities tried implement entity framework database had around 100+ tables. once selected tables , clicked on finish button on entity framework wizard hanged vs 2010 not results. my questions below; 1.if have larger database in terms of table/entites described above, idea use entity framework? 2.what better approch using entity framework work database? 3.should create multiple datacontext or edmx files lesser entites in it? 4.how these different datacontext interact each other? 5.is there recommended no of tables should used while working entity framework? @will correct limitation you're seeing in designer, it's not one, code-first doesn't fix problem. if designer seems slow, it's inconvenient, not end of world. runtime performance considerations thing altogether. performance-critical tasks , tuning, you'll

Wireshark Related : Option to take packet and modify contents -

is there option capture packet eg(http) , modify certains aspects of (checksum-validate false true ) , resend using wireshark ? ettercap ng filters can such job properly, here example on link

http - Web Browser Parallel Downloads vs Pipelining -

i knew web browsers parallel downloads. other day heard pipelining. thought pipelining name parallel downloads, found out firefox has pipelining disabled default. difference between these things , how work together? i think this mdc article explains http pipelining pretty darn well. what http pipelining? normally, http requests issued sequentially, next request being issued after response current request has been received. depending on network latencies , bandwidth limitations, can result in significant delay before next request seen server. http/1.1 allows multiple http requests written out socket without waiting corresponding responses. requestor waits responses arrive in order in requested. act of pipelining requests can result in dramatic improvement in page loading times, on high latency connections. pipelining can dramatically reduce number of tcp/ip packets. typical mss (maximum segment size) in range of 536 1460 bytes, possible pack several

jsf - How to call a dialog box from a javascript function -

i'm using primefaces create web service , ran snag while trying show() dialog box using javascript function instead of onclick="__.show();" command. what is: function displaypopup(){ statusdialog.show(); } and if like a href=”#” onclick=”statusdialog.show()” then works fine (but not work flow require). this primefaces code: <p:dialog modal="true" widgetvar="statusdialog" header="your request in progress..." draggable="false" closable="false" resizable="false"> <img alt="banner right" src="#/images/ajaxloadingbar.gif" border="0"/> </p:dialog> this generated code: jquery(function() {statusdialog = new primefaces.widget.dialog('j_idt41',{autoopen:false,minheight:0,draggable: false,modal: true,resizable:false,closable:false});}); i haven't seen show() before, can generate alert alert() function, or alert "yes" ,

c# - Hashtable A equals HashtAble B control -

hallo in c# got 2 hashtable object of key/value pair same , want check if 2 hashtable key/value pairs equal.. i tried hashtable's equal method not worked should check items foreach? thanks what want take set union , see if size same count. set difference you'd have both ways. these can done linq extension methods, since you're using hashtable have use cast() ienumerable: var table1 = new hashtable {{"a", 1}, {"b", 2}, {"c", 3}}; var table2 = new hashtable {{"b", 2}, {"a", 1}, {"c", 3}}; bool same = table1.cast<dictionaryentry>().union(table2.cast<dictionaryentry>()).count() == table1.count; console.writeline("same = " + same); i typically recommend dictionary on hashtable type safety, cast<>() lets use linq stuff find old hashtable.

Getting data from a sql table -

hye there.. got 3 tables looking this: create table users ( userid int identity, username varchar(50) not null, useraddress varchar(100) not null, userzipcode int not null, usertown varchar(50) not null, userphone int not null, comments varchar(max), primary key (userid) ) create table groups ( groupid int identity, groupname varchar(50) not null, groupdiscription varchar(max), primary key (groupid) ) create table usergroups ( userid int not null, groupid int not null, ) the last 1 table links between user , group made. need user data user in selected group.. can anyon me ? you mean this? select users.userid, users.username, users.useraddress, users.userzipcode, users.usertown, users.userphone, users.comments users inner join usergroups on users.userid = usergroups.userid usergroups.groupid = @suppliedgroupid

Android : Any open source Android twitter client application? -

i want easy open source android twitter client application. thank you take @ twimight https://code.google.com/p/twimight/ it's functional open source twitter client originating academic research project.

Zend Route Overwriting each other -

edit, slight problem caused fix in respond below: now these rules clash: $router->addroute('view-category', new zend_controller_router_route(':id/category/:page', array('module' => 'default', 'controller' => 'category', 'action' => 'view', 'page' => null))); $router->addroute('management/category', new zend_controller_router_route('management/category/', array('module' => 'management', 'controller' => 'category', 'action' => 'index'))); so /management/category/reset gets captured view-category rule, if switch there order. never used issue. ideally if caught /management or /administration ignore :name/category rule. possible make /management , /administration ignore previous rules , route controller action there no specific rules otherwise in areas. old question: $router->addroute('v

What should I use for simple cron jobs management in PHP project? -

i want simple cron-like management in php project there things have: php job worker plain script placed in subdir inside project directory there subtree /cron/daily, /cron/monthly ... etc in project root contains workers there no need mess crontab every worker added. all scripts run run-parts corresponding frequency, , respective output logged separate files /var/log/projectname/cron/daily/somescript.log would great have /cron/daemon dir containing scripts should run forever (minutely) no more 1 instance i've had experience kind of scheduling system in 1 project , loved it. provides number of neat things: jobs project scripts , reside in project dir, tracked git. no need crontab messing. logs sorted out. daemons easy build. i use /bin/run-parts on project /cron subdirs, didn't manage split logs wanted. , splitted logging nice feature have. so, thought kind of systems created many times before, there ready use solution php project? it's more smart ru

c# - StructureMap 'conditional singleton' for Lucene.Net IndexReader -

i have threadsafe object expensive create , needs available through application (a lucene.net indexreader). the object can become invalid, @ point need recreate (indexreader.iscurrent false, need new instance using indexreader.reopen). i'd able use ioc container (structuremap) manage creation of object, can't work out if scenario possible. feels kind of "conditional singleton" lifecycle. does structuremap provide such feature? alternative suggestions? i use scope of perrequest , not return indexreader directly. instead, i'd return abstraction of indexreader perform check on static reference held on class level. then, when property on shim/proxy/abstraction accessed, check static reference (you make thread-safe, of course) , re-get indexreader if needed before delivering user.

abstract class - Pure virtual methods in C#? -

i've been told make class abstract: public abstract class airplane_abstract and make method called move virtual public virtual void move() { //use property ensure there valid position object double radians = planeposition.direction * (math.pi / 180.0); // change x location x vector of speed planeposition.x_coordinate += (int)(planeposition.speed * math.cos(radians)); // change y location y vector of speed planeposition.y_coordinate += (int)(planeposition.speed * math.sin(radians)); } and 4 other methods should "pure virtual methods." exactly? they right now: public virtual void turnright() { // turn right relative airplane if (planeposition.direction >= 0 && planeposition.direction < position.max_compass_direction) planeposition.direction += 1; else planeposition.direction = position.min_compass_direction; //due north }

vb.net - Google Closure Compiler returns no compiled code? -

in question here @ stack overflow, came across helpful code snippet send code google closure compiler, can minify javascript files pretty good. the problem i'm facing returns no compiled code in cases don't expect so. code: this works, i.e. returns minified code: dim script = "function test(name) {alert(name);}test('new user');" this one, on other hand, not return anything. statistics sent, no compiled data...: dim script = "function test(name) {alert(name);}" rest of code work: dim data = string.format(closurewebservicepostdata, httputility.urlencode(script)) _result = new stringbuilder _httpwebrequest = directcast(webrequest.create(closurewebserviceurl), httpwebrequest) _httpwebrequest.method = "post" _httpwebrequest.contenttype = "application/x-www-form-urlencoded" '//set content length length of data. might need change if you're using characters take more 256 bytes

c# - how Marshal.FreeHGlobal() works? -

i have c# based ui uses c++ based dll. requirement pass big chunk of memory c# dll. dll write memory buffer , pass c#. have used intptr & global memory functions this. works fine. the question is, how verify if marshal.freehglobal() has cleaned memory? using big chunk of memory, in terms of mbs. want make sure memory cleaned instantly. if pass valid handle marshal.freehglobal , will freed. since method doesn't return value, can't sure whether cleaned up. if have doubt whether you're passing right thing freehglobal , suggest code isn't clean should be. if want make sure, call localfree windows api function, passing handle have passed freehglobal : [dllimport("kernel32", setlasterror=true)] static extern intptr localfree(intptr mem); // now, free block of memory allocated marshal.allochglobal intptr rslt = localfree(memptr); if (rslt == intptr.zero) { // success! } else { int err = marshal.getlastwin32error(); // error. }

.net - How can I fix my code to correctly print "Hello World!" -

i have code need fix print "hello world!". reason prints letters scrambled. sub main() dim s string = "hello world!" parallel.for(0, s.length, sub(i) console.write(s(i)) end sub) console.read() end sub any suggestions? sub main() console.write("hello world!") end sub if must print 1 character @ time, write: sub main() dim s string = "hello world!" dim integer i=0 s.length-1 console.write(s(i)) end end sub

android - Need help with onClick and intents -

i'm working , app based on notepad tutorial...in tutorial click on note in listview , taken edit corresponding information shown, make changes select confirm..and taken main. i added second activity app "contact" when click on note in listview , taken contact corresponding information shown including button............ click button , taken edit.........and problem pops ugly head. when ckick button blank screen , forced close popup........ here code main taking contact....this works information shown protected void onlistitemclick(listview l, view v, int position, long id) { super.onlistitemclick(l, v, position, id); intent = new intent(this, contact.class); i.putextra(notesdbadapter.key_rowid, id); startactivityforresult(i, activity_edit); } here code takes contact edit.....this gives me error, i'm sure has "intent.putextra(notesdbadapter.key_rowid, id);" needing recoded work onclick compared onlistitemclick........i'm thinkin