Posts

Showing posts from March, 2010

validate email with password in php -

i'm involved in product development, user register company. once becomes user of our product, need send announcements,newsletters etc. users on behalf company. for purpose company email , password, need validate email valid , he's given correct password email id or not. i'am thinking 2 methods validate email , password, send test mail smtp authetication try open inbox. i feel first 1 better later. because if user given wrong passwords, there chances considered attack. any 1 can tell me there better way validate given email password. answers appreciated, thanks! just connect imap_open() , test if connection successful. $resource = sprintf("{%s:%s/imap/ssl/novalidate-cert/notls/norsh}inbox","imap.host",993); $imap = imap_open($resource, "user", "password", op_readonly, 1); if($imap) echo "it works";

android - How to keep fragments in memory on orientation change -

i'm creating tablet optimised application using fragments. have thin navigation fragment down left hand side buttons controls fragments loaded 2 viewgroup containers take rest of screen. for example, if button in navigation fragment pressed, 1st container loaded item list fragment (eg settings, customers etc) , second container loaded fragment show item details. since want retain fragments in memory (so, when navigating settings customers , settings, previous settings fragments should there user doesn't lose to) - have created fragments instance variables activity settingslistfragment settingslistfragment; settingsdetailfragment settingsdetailfragment; customerlistfragment customerlistfragment; customerdetailfragment customerdetailfragment; i create these fragments when neccessary , replace containers fragments needed. eg. fragmentmanager fragmentmanager = getfragmentmanager(); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); if(settin...

javascript - Loading CSS and JS files from another domain and serving resources from consistent URL -

i have website grown large , built on super-restrictive platform (sbi). there have follow file structure , put in appropriate folder , upload each , every file through interface manually. have cool html5 template , javascript lot of little files , images way easier upload stuff other domain hosted hostgator using filezilla , refer css , js files sbi site location @ hostgator's domain. are there potential issues method? the reason asking because yesterday came across google's article on serving resourcing consistent url: https://developers.google.com/speed/docs/best-practices/payload#duplicate_resources however, might misunderstanding means. when put actual url test @ google's page speed insights here https://developers.google.com/speed/pagespeed/insights advises me serve resources consistent url, in details doesn't complain css , js files, complains facebook only, this: suggestions page: following resources have identical contents, served different urls. ser...

java - Methods using private members or public accessors -

i realize cannot answered , i'm looking whether there sort of guidance whether use private members directly or public accessors inside class methods. for example, consider following code (in java, similar in c++): public class matrix { // private members private int[][] e; private int numrows; private int numcols; // accessors public int rows(){ return this.numrows; } public int cols(){ return this.numcols; } // class methods // ... public void printdimensions() { // [a] using private members system.out.format("matrix[%d*%d]\n", this.numrows, this.numcols); // [b] using accessors system.out.format("matrix[%d*%d]\n", this.rows(), this.cols()); } the printdimensions() function illustrates 2 ways same information, [a] using private members ( this.numrows, this.numcols ) or [b] via accessors ( this.rows(), this.cols() ). on 1 hand, may prefer using accessors since there...

php - Does ORDER BY apply before or after DISTINCT? -

in mysql query, when using distinct option, order by apply after duplicates removed? if not, there way make so? think it's causing issues code. edit : here's more information what's causing problem. understand that, @ first glance, order not important, since dealing duplicate rows. however, not entirely case, since using inner join sort rows. say have table of forum threads, containing data: +----+--------+-------------+ | id | userid | title | +----+--------+-------------+ | 1 | 1 | information | | 2 | 1 | faq | | 3 | 2 | support | +----+--------+-------------+ i have set of posts in table this: +----+----------+--------+---------+ | id | threadid | userid | content | +----+----------+--------+---------+ | 1 | 1 | 1 | lorem | | 2 | 1 | 2 | ipsum | | 3 | 2 | 2 | test | | 4 | 3 | 1 | foo | | 5 | 2 | 3 | bar | | 6 | 3 | 5 | bob ...

php - Adding anchor tag to javascript URL -

i have php system , use popup lay processing, ie upload image. no problems here , on completing insert , upload go page call underlying page , refresh it: $callpage="jobsheet_build.php?id=".$_get['id']; echo("<script language=\"javascript\">"); echo("top.location.href = \" ").$callpage.("\";"); echo("</script>"); ok works fine, in ideal world put reference #images in $callpage end with $callpage="jobsheet_build.php?id=".$_get['id']."#images"; but javascript hangs no matter do. any ideas appreciated! @jim have tried set anchor tag echo("top.location.href = \" ").$callpage.("#images\";"); instead of set anchor tag inside variable ?

how to get number of commit each day from xml subversion log file with javascript, php, shell script? -

having xml subversion commits log: <?xml version="1.0"?> <log> <logentry revision="2"> <author>20070299</author> <date>2012-06-06t05:23:21.999470z</date> <msg>add part</msg> </logentry> <logentry revision="1"> <author>20070299</author> <date>2012-05-22t08:35:55.663875z</date> <msg></msg> </logentry> </log> and want result array grouped date , numbers of commit each day on site php-javascript. similar one: date[0]=2012-05-22 value[0]=1 date[1]=2012-05-23 value[1]=0 ... date[15]=2012-06-06 value[15]=1 is there solution it? i consulted link but don't work, non result non error log (apache, php), , don't know how send $number[] php code javascript code you can play xpath : $ xmllint --shell foo.xml / > cat //log/*[@revision]/@revision ------- revision="2" ------- revision="1" / ...

mysql - SQL select distinct rows and ignore row if blank -

i using sql query fetch rows table. want select rows distinct values , if there no value entered row, row should not there. select distinct meta_value `wp_postmeta` meta_key = "aaa"; this query using, getting distinct rows query getting blank row. simple solution: select distinct meta_value `wp_postmeta` meta_key = "aaa" , meta_value != "";

php - Iterating through an associative array -

i trying twitter followers specific user api call https://api.twitter.com/1/users/lookup.json?screen_name=twitterapi,twitter&include_entities=true and there sample output there: https://dev.twitter.com/docs/api/1/get/users/lookup i trying screen name of user doing following: $json2=file_get_contents('http://api.twitter.com/1/users/lookup.json?user_id='.$post.'') ; $accounts2 = json_decode($json2); while( $element = each( $accounts2 ) ) { echo $element[ 'screen_name' ]; echo '<br />'; } where $post ids (around 100) concatenated together. the above fail with: notice: trying property of non-object any please? replace line: $accounts2 = json_decode($json2); with this: $accounts2 = json_decode($json2, true); it converts associative array. because user_id unique, don't have loop through results, can this: echo $accounts2[0]['screen_name'] . '<br />';

cocoa - How to solve --ImageKit Error: error reading pixels: 506? -

my cocoa (os x) application displaying images in ikimagebrowserview on (snow leopard)10.6 not displaying images ( ikimagebrowserview ) on (lion)10.7.4 , throwing error on console --imagekit error: error before reading pixels: 506 and --imagekit error: error after reading pixels: 506 is changes require in ikimagebrowserview on 10.7.4 (lion). please me on come problem. in advance... now displaying images - reason behind "not displayed" images improper path getting same error in console...

Android GUI Layouts in Eclipse -

i new android development , having trouble. creating xml file using eclipse, both graphical layout feature i'm having trouble with. also, working in android 2.3 compatibility reasons. i wondering if there layout enables me place buttons or text fields or attribute want put them. may sound stupid, seems every layout has sort of order in lets add attributes, , whenever try drag them elsewhere on layout things very messy. if want absolutelayout, has been deprecated since android 2 (iirc). can try using relativelayout, let position freely widgets. else, if use linearlayout, yes widget positioned in strict way.

java - Access added values through jQuery UI widget inside ui:repeat in JSF -

i have added ui:repeat within ul-list produce unordered list through jquery tag-it widget list get´s nicely editable (unfortunately primefaces doen't have similar component yet) when saving form can't access new created values (only values of other primefaces components) xhtml <ul id="keywordlist"> <ui:repeat value="#{bean.selectedobject.keywords}" var="keyword"> <li><h:outputtext value="#{keyword.name}" /></li> </ui:repeat> </ul> bean public class bean implements serializable { private myobject selectedobject; } model public list<string> getkeywords() { return keywords; } public void setkeywords(list<string> keywords) { this.keywords = keywords; } any idea, how can access values added ul-list? thanks! edit : bean session scoped according documentation , demos jquery tag-it plugin autocreates hidden input element (configureable)...

How to invoke HTTP POST method over SSL in ruby? -

so here's request using curl: curl -xpost -h content-type:application/json -d "{\"credentials\":{\"username\":\"username\",\"key\":\"key\"}}" https://auth.api.rackspacecloud.com/v1.1/auth i've been trying make same request using ruby, can't seem work. i tried couple of libraries also, can't work. here's have far: uri = uri.parse("https://auth.api.rackspacecloud.com") http = net::http.new(uri.host, uri.port) http.use_ssl = true http.verify_mode = openssl::ssl::verify_none request = net::http::post.new("/v1.1/auth") request.set_form_data({'credentials' => {'username' => 'username', 'key' => 'key'}}) response = http.request(request) i 415 unsupported media type error. you close, not quite there. try instead: uri = uri.parse("https://auth.api.rackspacecloud.com") http = net::http.new(uri.host, uri.port) http...

javascript - Why this loop backwards is much slower than going forward? -

Image
i have answer guy question here how count string occurrence in string? playing algorithms here , , after benchmarking functions wondering why backwards loop slower forward. benchmark test here note: code below not work supposed be, there others work (thats not point of question), aware before copying>pasting it forward function occurrences(string, substring) { var n = 0; var c = 0; var l = substring.length; (var = 0, len = string.length; < len; i++) { if (string.charat(i) == substring.charat(c)) { c++; } else { c = 0; } if (c == l) { c = 0; n++; } } return n; } backwards function occurrences(string, substring) { var n = 0; var l = substring.length - 1; var c = l; (i = string.length; > 1; i--) { if (string.charat(i) == substring.charat(c)) { c--; } else { c = l; } if (c < 0) { c = l; n++; } } return n; } i think backwar...

Swapping two elements in an array in MIPS assembly -

i'm trying learns mips isa. if want function in mips: a[2*i]=a[2*k+j]; how go this? appreciate other content can read, i.e links can read on how solve kind of problem. we can break down 2 parts: calculate addresses of a[2*i] , a[2*k+j] assign value @ second address memory @ first address i'm going address (ahem) #1. to calculate address of array element, need know 3 things: the address of start of array the index of element want the size of array elements i assume know how compute, or know, #1 & #3. leaves #2, involves simple arithmetic. (since haven't indicated how i, j & k represented, can't there). the final step, then, multiply index size of array element; gives offset of desired element start of array. add address of start of array, , have element's address. p.s. code you're translating doesn't swap 2 elements; copies 1 on other.

objective c - NSString length not correct when checked? -

i have problem function : - (bool) test : (nsstring *) chaine { nslog(@"%i",[chaine length]); if([chaine length] == 19) nslog(@"test"); } i correctly have 19 in log, not "test". know what's wrong ? thanks lot i tried this - (void)testfunction{ nsstring * astrfunc= @"stackoverflow"; nslog(@"%d",[astrfunc length]); nslog(@"%@",[astrfunc length]==13?@"test right":@"test not right"); }

codeigniter set_value on corresponding page -

i building header search function posting listings view page contains "advanced search" bit. set value input field called name in "advanced search" bit on listing page original value of search before loads new view. so summarise: i have search function appears on every page(this in template header bit). capture search value , set value on listing page's advanced search bit. the functions works follows: it posts search function within site controller (site/search). in turn sends search results listing view (site/listing). any advise on how achieve little bit of coding appreciated. regards, well either redirect('site/listing?q='.$this->input->post('search')) or $this->load->helper('url'); $this->load->library('session'); // need configuration $this->session->set_userdata('search', $this->input->post('search')); redirect('site/listing'); and read of s...

Google Maps widget does not show up on some Android devices -

i have android application google maps widged built in. linked widget conditionally, code loading widget looks this: public class starter extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.starter); try { class.forname("com.google.android.maps.mapview"); intent = new intent(); i.setclass(this, googlemapsactivity.class); startactivity(i); finish(); } catch(classnotfoundexception e) { textview tv = (textview)findviewbyid(r.id.google_maps_start); tv.settext(r.string.not_found); } } } and androidmanifest contains line: <uses-library android:name="com.google.android.maps" android:required="false" /> the widget works in emulator , in real devices, there device, see "google maps not found" message, initiated classnotfoundexception handler. nevertheless, same device...

android - Proguard doesn't work when export with Eclipse ADT plugin R19 -

when export application through export > export android application or through android tools > export signed application package , cannot proguard work. all know how enable proguard uncomment line proguard.config=${sdk.dir}\tools\proguard\proguard-android.txt:proguard-project.txt in project.properties . and tried putting configuration file there, too. won't work either. the classes.dex file in exported package contains name of class private methods such onconfirmbuttonclicked . there's more 99% chance proguard didn't work. after put random characters in proguard-project.txt file, didn't error. verbose output of build didn't refer proguard @ all. i wonder what's wrong there. proguard work when export project .apk file, , should put configuration need in file (.cfg) , point file in project.properties proguard.config=${dir}\yourconfigfile.cfg and in config file should tell proguard keep crucial elements in project. exemple : ...

node.js - How to upload a one terabyte file to Amazon S3 via webapp? -

i know how upload large files amazon s3 (> 1 terabyte) ideally web-app upload mechanism should have: real time progress bar upload speed stats pause / resume support upload directly computer amazon s3 memory efficient, large file can sent via web browser. i have tried uploadify s3 via django . although looks can not handle large files well. does know existing demo app on github or documentation using of following languages? rails django php java recently, have goggled knox s3 library , nodejs , although haven't found demo app uploading. try resumable.js , it's javascript library supports chunking, in chrome , firefox.

How to read and save an html text using Selenium RC? -

in website i'm testing, create new customer. once customer created new id assigned customer, not stored form field in customer webpage rather on top page pure text (customer 601619 - name1) i have html tag <h1> customer 601619 - name1 </h1> my question how retrieve customer id using java selenium rc thanks in advance use following code string str = seleniumobj.gettext("//h1"); system.out.println(str); the above code prints customer 601619 - name1 in console

php - updating the lastlogin column value in mysql -

i want update lastlogin column value .i wrote code ,but column nt updated .i wrote code in main.js inserting query.here didnt wrote code updating lastlogin column value in main.js. updating lastlogin column wrote updatelogin function in dbfunc.php below. function updatelogin($lastlogin) { alert("hi"); $query="update users set last_login='$lastlogin' email='".$email."'"; $queryresult= mysql_query($query); $count=mysql_num_rows($queryresult); if($count>0) { return 1; } else { return 0; } } function register($details_arr) { $emailcheck=db_func::checkemail($details_arr['email']); if($emailcheck == 0){ //print_r($details_arr); $regemail=$details_arr['email']; $regpwd=$details_arr['password...

java - Why does JavaFX 2 create more TableRows than required? -

in javafx 2's tableview , there api add rowfactory . factory used create tablerow s; use cases developer wants features (like tooltip) span entire row. now, working feature, noticed rowfactory called not called once per visible row, instead once more. if execute this piece of code , you'll notice ui shows 16 rows in ui, counter on console counts 17th line. what's curious extraneous line appears @ beginning , filled data, not maybe invisible line @ end. i'd think header, in javafx code , not that's case. can explain observation?

Resource mange external nodes in Jenkins for tests -

my problem have code need rebooted node. have many long running jenkins test jobs needs executed on rebooted nodes. my existing solution define multiple "proxy" machines in jenkins same label (testlable) , 1 executor per machine. bind test jobs label (testlable). in test execution script detect jenkins machine (jenkins env. node_name) , use know physical physical machine tests should use. do know of better solution? the above works need define high number of “nodes/machines” may not needed. plugin able grant token jenkins job. way job not executed before jenkins executor , token free. token should string test jobs use know external node use. we have written our own scheduler allocates stuff before starting jenkins nodes. there may better solution - works mostly. i've yet come across off-the-shelf scheduler can deal complicated allocation of different hardware resources. have n box types, allocated n build types. some build types have not compatibl...

matlab - pass handle from one m file to other m file -

from "main" window have button opens window "list". in list window have 2 listboxes 1 on left has names on , on 1 on right add names it. unable pass added names list "main" window once click ''ok" button on "list" window. function done_button_callback(hobject, eventdata, handles) selectedfaults = get(handles.selectedfaults_listbox,'string'); set(main, handle.faults_listbox,'string',selectedfaults) close(insert_fault) the error i'm getting is: ??? no appropriate method, property, or field faults_listbox class handle. error in ==> insert_fault>done_button_callback @ 380 set(main, handle.faults_listbox,'string',selectedfaults) error in ==> gui_mainfcn @ 96 feval(varargin{:}); error in ==> insert_fault @ 42 gui_mainfcn(gui_state, varargin{:}); ??? error while evaluating uicontrol callback both m files in same directory. i'm stuck. thank help you...

css - jquery mobile and MVC - have 3 lists next to each other without ui-grid or tables -

i have problem in setting 3 lists go side side each other in jquery mobile. can't use ui-grid unfortunately because have script hides them , based on number 0-3 (this list), same number of lists appear (i have lists dynamically centered). also, can't use data-role="fieldcontain" because each list should have round edges according boss (the middle list has sharp edges). here code: <div class="centerplease"> <div id="a1"> @html.dropdownlistfor(x => x.childage_a1, childage, new { data_mini = "true", data_inline = "true", data_icon = "false"})</div> <div id="a2"> @html.dropdownlistfor(x => x.childage_a2, childage, new { data_mini = "true", data_inline = "true", data_icon = "false"})</div> <div id="a3"> @html.dropdownlistfor(x => x.childage_a3, childage, new { data_mini = "true", data_i...

c++ - initialize 1000 map elements -

just can initialize vectors as: vector<int> var1(2000,1); is possible initialize map; map<int, int>var2; for 2000 variables...the reason why want initialize two: in case access element in future e.g. map[100]..i want map[100]=0 the second reason using minimum priority queue comparison uses second value of map i.e. value stored in map[0]...map[100]. i don't want use vectors indices skewed , leads lot of wasted space...i.e. indices map[0], map[30], map[56],map[100],map[120],map[190], etc. is there way can initialize map 1000 variables...i open using other data structure. also conventional way of initializing map i.e. map<int, int> m = map_list_of (1,2) (3,4) (5,6) (7,8); the above way not work in case...is there other way out.please help edit: can not use loop as: this way key remains fixed don't want since distribution of keys skewed. in essence applying loop in way same of vector , don't want you can using surro...

c - How do I view implementation source of printf? -

i want see how printf (and many other functions) works. i wrote #include <windows.h> #include <stdio.h> int main() { printf(""); return 0; } in main.c code , go definition in right click menu but shows like _check_return_opt_ _crtimp int __cdecl printf(_in_z_ _printf_format_string_ const char * _format, ...); #if __stdc_want_secure_lib__ _check_return_opt_ _crtimp int __cdecl printf_s(_in_z_ _printf_format_string_ const char * _format, ...); #endif i can't find hints on how printf works. anyone let me know how learn standard library implementation? here go: http://sourceware.org/git/?p=glibc.git;a=blob;f=stdio-common/vfprintf.c;h=d5690342536bc8cf948c786f663bb63f73f91f3a;hb=head . this gnu c library implementation (glibc).

sql server - Purpose of nested transactions -

i have never understood nested transaction for. committing nested transaction commits nothing - decreases @@trancount . , rollback rollbacks everything. begin transaction //do update begin transaction //do insert commit transaction commit transaction what difference this: begin transaction //do update //do insert commit transaction please give me example why should nested transactions used , how make difference. regards, petar nested transactions allows code call other code (sps instance) uses transactions without committing your transaction when they commit. that said, can use safepoints roll inside of transaction. there's codeproject article dedicated that.

align controls left to right on a modal pop up in asp.net -

i cant text boxes align left right in modal pop up. here code in . should change. <asp:updatepanel runat="server" id="modalpanel1" updatemode="conditional"> <contenttemplate> <!-- shadow container --> <div class="shadowcontainer"> <h1><asp:label runat="server" id="xyz" text="make" /></h1> <tr style="width:1000px;"> <td colspan = "2" style="width:100px;"> <div>name1</div> <asp:textbox runat="server" id="name1" maxlength="40"/> <span id="span1" style="color:red;"> ...

scripting - PHP strstr difference issue -

so have problem. have snippet of code see if phrase present in phrase: if(strstr($matches[1], $query)) so example if: $matches[1] = "arctic white" $query = "arctic" in case above, code detect phrase "arctic" in phrase "arctic white" although, want detect if inside words , not phrases. for example if: $matches[1] = "antarctica" $query = "arctic" in case script not detect word "arctic" in "antarctica" although is. wondering, how can edit if(strstr($matches[1], $query)) detect words have $query content in it? please help! you can use preg_match() better result. preg_match doesn't encompass regular expressions only. can need. i.e.: if (preg_match("/arctic/i", "antarctica")) { // there } else { // not there else } btw, small "i" means case sensitivity, check php manual more examples: http://php.net/manual/en/function.preg-match.php

javascript - draggable without jQuery ui -

how make element draggable without using jquery ui? i have code: <script type="text/javascript"> function show_coords(event) { var x=event.clientx; var y=event.clienty; var drag=document.getelementbyid('drag'); drag.style.left=x; drag.style.top=y } </script> <body style="height:100%;width:100%" onmousemove="show_coords(event)"> <p id="drag" style="position:absolute">drag me</p> </body> the problem want drag while user pressing mouse button. tried onmousedown results negative. it quite easy concept. function enabledragging(ele) { var dragging = dragging || false, //setup bunch of variables x, y, ox, oy, enabledragging.z = enabledragging.z || 1, current; ele.onmousedown = function(ev) { //when mouse down current = ev.target; dragging = true; ...

How to resize particles already exist in a particle system of Cocos2d -

i'm new cocos2d , game development. use particle system in cocos2d , want dynamically resize particles exist on screen. tried change startsize, endsize , other value, influence particles emitted. how achieve effect want. everything inherits ccnode has scale property. when add particle scene can change scale then ccparticlesystemquad *jewelxplodeparticle = [ccparticlesystemquad particlewithfile:@"bam.plist"]; jewelxplodeparticle.position = ccp(100,100); jewelxplodeparticle.autoremoveonfinish = true; [self addchild:jewelxplodeparticle z:1 tag:1]; jewelxplodeparticle.scale = 3.0f or particle have added following. ccparticlesystemquad *jewelxplodeparticle = (ccparticlesystemquad*)[self getchildbytag:1]; jewelxplodeparticle.scale = 3.0f scale works same ccsprite.

Dependency Injection framework for Windows 8 metro apps -

i can't seem find dependency injection framework windows 8 metro apps. is there framework win8 metro apps? ninject not yet support win8 metro. have suggestion? (castle, spring, ...) here source ninject winrt: https://github.com/remogloor/ninject not yet released.

android - How to get the Address of the function call dynamically from the process -

i looking way address of function call programatically: public abstract void onkey (int primarycode, int[] keycodes) keyboardview.onkeyboardactionlistener interface. are address of these functions static? i.e loaded in same memory. i'm trying achieve tamper protection key loggers. your question fundamentally doesn't make sense, because asking how take function pointer when, in fact, java not have equivalent of function pointers (you see references functions in dynamic dispatch through object). addresses of functions may static or may not exist @ all, transparent you, code run in virtual machine. if instead asking @ ndk level, can surely take address of function using simple & in c. however, @ java level not possible. you not clarify, however, why prevent keyloggers.

Make jQuery ajax calls in order -

i want make stack of ajax calls in way: call(n) starts after call(n-1) finished... i cannot use async:false many reasons: some requests maybe jsonp (the relevant) i have other ajax requests may work meanwhile.. the browser got blocked i cannot chain requests way: $.post('server.php', {param:'param1'}, function(data){ //process data $.post('server.php', {param:'param2'}, function(data){ //process data }); }); because number , params of requests dynamically created user input. a small example illustrates problem. you see server response order random, want achieve have in order response arg1 response arg2 response arg3 response arg4 response arg5 response arg6 any appreciated, thanks. ok, jquery ajax returns deferred object , can achieve this. here how it: var args = ['arg1','arg2','arg3','arg4','arg5','arg6']; deferredpost(0, 5); function de...

php - Disable inputs with jquery by default -

i want disable default inputs, , have check box allows enable them; code of checkbox : function togglestatus() { if ($('#toggleelement').is(':checked')) { $('#elementstooperateon :input').attr('disabled', true); } else { $('#elementstooperateon :input').removeattr('disabled'); } } and it's called in input onchange="togglestatus()"; default status of inputs enabled , don't want add disabled="disabled" each input, how can jquery? , how can make work existing onchange? $(function(){ $('#elementstooperateon :input').prop('disabled', true); }); disable inputs when dom ready. o.k. after update , answer simpler, trigger onchange event: either with: togglestatus(); or with $('#toggleelement').change();

visual c++ - Adding controls on CFrameWnd MFC -

how can add control(like listctrl , cbuttons) on cframewnd? thanks your best bet create cdialogbar , stick controls on that.

android - TextView wrap causes adjacent ImageView to disappear -

i'm puzzled simple-looking issue can't figure out. got display button includes image (flag), text, , image (caret). these 3 in layout container, assigned weight since there's button next it. here's how layout container looks: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/countryselect" android:orientation="horizontal" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".88" android:gravity="center_vertical" android:clickable="true" android:onclick="clickhandler" > <imageview android:id="@+id/countryflag" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingright="8dp" android:src="@drawable/flag_argentina...

asp.net - The exception message is: Could not load file or assembly 'App_Code' or one of its dependencies. The system cannot find the file specified -

i trying visit wcf service endpoint xxx.svc. , got error: the exception message is: not load file or assembly 'app_code' or 1 of dependencies. system cannot find file specified i turned on fusion log , got this: === pre-bind state information === log: user = xxx\xxx log: displayname = app_code (partial) log: appbase = file:///d:/myservice/ log: initial privatepath = d:\myservice\bin calling assembly : (unknown). === log: bind starts in default load context. log: using application configuration file: d:\myservice\web.config log: using host configuration file: c:\windows\microsoft.net\framework64\v2.0.50727\aspnet.config log: using machine configuration file c:\windows\microsoft.net\framework64\v2.0.50727\config\machine.config. log: policy not being applied reference @ time (private, custom, partial, or location-based assembly bind). log: same bind seen before, , failed hr = 0x80070002. i don't have app_code folder in web application. why app_code??? thanks! ...

android - layering within an HTML inside a webview -

Image
i have html assets show webview in android. current browsers shown well, older browsers such android 2.1 goes see in images. put code in case wants see. html <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>documento sin título</title> <script> function show(divactual,textactual) { if(document.getelementbyid(divactual).style.display == "block"){ document.getelementbyid(divactual).style.display = "none"; document.getelementbyid(textactual).innerhtml = "show details..."; } else if(document.getelementbyid(divactual).style.display == "none"){ document.getelementbyid(divactual).style.display = "block"...

.net - NHibernate vs. EF 4.1+ -

i trying decide pros , cons of 2 orm in area. compatibility sql server 2008 r2 & 2012. this important don't have resources debug poor support of existing ms technology stack. also planning ahead since 2012 pretty out , plans migrate in place. support .net 4.0 , 4.5 (upcoming) again important pretty same reason above. transaction handling , table hints eg. forcescan forceseek, read uncomitted. a lot of times query optimizer job well, other times want flexibility tell do. support conversation, self tracking attach & detach this fundamental. hate keep session open prolonged period. in distributed computing/web farm environment. ability handle code first development, create , update schema without destroying data. ef 4.1 seems wanting in regard, although 4.3 leap , bound better. liking data annotation better seperate mapping classes in nh. reason being want able send in class , there able create persistence model without widening method mapping classes. s...

html5 - Deprecated HTML elements still work -

w3c has announced several elements have become deprecated, such <font> , <frameset> , <strong> , of can replaced css. change said brought in html 5, however, if put html 5 doctype on document these elements still seem work. unknowingly not applying hmtl 5 doctype, or misinterpreting w3c's notice? the doctype not determine elements supported. if browser supports element, element 'work'. browsers support elements deprecated, because have work when used view old sites. as thought experiment, think code do? bluefire { display: block; padding: 1em; border: 2px solid black; } <bluefire> hello world! </bluefire> the definition of whether or not elements 'work' not clear cut.

gwt - How to Distinguish Events.OnClick and Events.OnDoubleClick in GXT -

i using ext gwt 2.2.4. in our application binding onclick event on grid , making server call fetch data on of click. display result on dialog box. the problem is, if user clicks on cell more 1 time, repeated data on same dialog box. have put "getliststore().removeall()" statement clear model , re-populate show fresh data in dialog box. ps. have tried binding events.ondoubleclick event well, doesn't solve problem because double click calls "click - click" 2 times. would appreciate help. have been searching forum solution, there similar posts didn't not find solution. here code: grid.addlistener(events.onclick, new listener<gridevent<modeldata>>() { public void handleevent(gridevent<modeldata> be) { performaction(be); } }); private void performaction (gridevent<modeldata> be) { appevent event = new appevent(events.onclick); dispatcher.dispatch(event); }

How to set the x position of views in android -

i creating number of imageviews , textviews on runtime depending on objects in webservice. i'm creating linearlayout horizontal , adding imageviews , textviews layout, issue text against images, , images of different width want set x position of textviews align how can done, i tried absolutelayout(warning deprecated) , setx(no method showed) you can use resized image on runtime based on pannel height , width resizing image on runtime view stack overflow thread resizing image java getscaledinstance

Django models and Python properties -

i've tried set django model python property, so: class post(models.model): _summary = models.textfield(blank=true) body = models.textfield() @property def summary(self): if self._summary: return self._summary else: return self.body @summary.setter def summary(self, value): self._summary = value @summary.deleter def summary(self): self._summary = '' so far good, , in console can interact summary property fine. when try django-y this, post(title="foo", summary="bar") , throws fit. there way django play nice python properties? unfortunately, django models don't play nice python properties. way works, orm recognizes names of field instances in queryset filters. you won't able refer summary in filters, instead you'll have use _summary . gets messy real quick, example refer field in multi-table query, you'd have use like user.objects...

Modification date of a keychain item in iOS 4.x -

in app, storing set of credentials in keychain offline access. when logs in while device offline, retrieve keychain item, check ksecattrmodificationdate, , compare value app has determine whether credentials have expired or not. that , in ios 5.x. in ios 4.x ksecattrmodificationdate not exist in keychain item data dictionary.i checked doc , says available since ios 2.0. , if skip modification date check, item retrieved correctly keychain. is aware of 4.x vs 5.x differences in area? searched apple dev forums , google , couldn't find useful. found answer. ksecattrmodificationdate exists default ios 5+, not ios 4.x. has added manually.

sql server - How can we overcome double authentication for sp_linkedserver? (Already set up through DB authentication) -

Image
so we've set sp_linkedserver on sql server connect remote access database. assume path database w:/breakfast/pancakes/secretpancakes/pancakedb.accdb we know username , password actual database password: ally0urpancakearebelongtous! the problem is, there authentication "secretpancakes" directory. this authentication is username: superchef password: ilovesf00d here code making sp_linkedserver... /****** object: linkedserver [pancakedb] script date: 06/13/2012 10:08:21 ******/ exec master.dbo.sp_addlinkedserver @server = n'pancakedb', @srvproduct=n'access 2007', @provider=n'microsoft.ace.oledb.12.0', @datasrc=n'w:/breakfast/pancakes/secretpancakes/pancakedb.accdb ', @provstr=n';pwd=ally0urpancakearebelongtous' /* security reasons linked server remote logins password changed ######## */ exec master.dbo.sp_addlinkedsrvlogin @rmtsrvname=n'pancakedb',@useself=n'false',@locallogin=null,@rmtuser=null,@...

c# - Html table on Html page - NO XML -

i'm trying grab data html table on website. no xml involved. <table id="e-cal-table" class="e-cal-table" width="100%"> <tr> <th>date</th> <th>time</th> <th>currency</th> <th>event</th> <th>importance</th> <th>actual</th> <th>forecast</th> <th>previous</th> <th>notes</th> </tr> the following results in "object reference not set instance of object." htmlagilitypack.htmldocument doc = new htmlagilitypack.htmldocument(); doc.loadhtml("http://www.example.com"); string table = doc.documentnode.selectsinglenode("//table[@id='e-cal-table']").innertext; i'm @ loss how identify table future parsing. unfortunately, examples i've been able find have xml. your code works if load doc string . if want load url use doc.load(url)...

Django ajax passing variable to the views -

i'm new django + ajax. problem can't value ajax post request. i'm using jquery post . my task sort draggable list item. drag , drop not problem. getting values post request problem. returns multivaluedictkeyerror "key 'ages' not found in <querydict: {u'action': [u'updaterecords'], u'ages[]': [u'80', u'81', u'79', u'82', u'83', u'84', u'85', u'86']}>" here ajax: $(function() { var url = ""; /* won't place it*/ $("ul#ages").sortable({ opacity: 0.6, cursor: 'move', update: function() { var order = $(this).sortable("serialize") + '&action=updaterecords'; $.post(url, order, function(theresponse){ alert('success'); }); } }); }); here views: if request.is_ajax(): if request.post['action'] == "update...

asp.net - I am unable to use FileUpload which is in Gridview in the UpdatePanel, have also used trigger, how can i solve this? -

i want use updatepanel gridview , fileupload in gridview doesn't work if added trigger... because cant find fileupload button , whats solution? <asp:templatefield headertext="upload kundli"> <itemtemplate> <asp:fileupload id="fileupload1" runat="server" /><br /> <asp:button id="btnupload" runat="server" text="upload" onclick="btnupload_click" /> </itemtemplate> <itemstyle horizontalalign="center" /> <headerstyle horizontalalign="center" /> </asp:templatefield> </columns> </asp:gridview> </contenttemplate> <triggers> <asp:postbacktrigger controlid="btnupload" /> </triggers> </asp:updatepanel> here way via code behind, dummy mockup give idea: aspx code: <form id="form1" runat="server"> <asp:scriptmanager id="script...

c# - Setting and Getting SignalR Caller properties in vb.net -

in signalr chat sample , caller properties set using code; caller.name = newuser.name; then later on, property read; string name = caller.name; i have own signalr project, 1 vb.net, , when same setting , getting of caller properties, doesn't work public sub setcaller() caller.name = "tim" end sub public sub getcaller() dim name string = caller.name end sub getcaller() throws error of "conversion type 'task(of object)' type 'string' not valid." the exact same code, in c# works fine; public void setcaller(){ caller.name = "tim"; } public void getcaller(){ string name = caller.name; } is code wrong in vb.net? no, you're not doing wrong syntactically in vb.net. thing can think of off top of head check, using ide, type caller , caller.name. in vb.net, not case sensitive , many namespaces may automatically imported without listing them @ top of file, it's quite possible that, in vb, i...

delphi - Firemonkey alternative to VCL ShortCut() function -

what firemonkey alternative vcl shortcut() function vcl.menus? didn't find neither in fmx.menus or fmx.platform. there no alternative in fmx.menus can borrow shortcut function vcl.menus unit , add code.

mysql - SQL query - Selecting records based on count condition -

the title may not seem clear - not sure how explain problem in 1 line. i have 3 tables topic video topic_video a topic can have 1 or 2 videos. videos either sample videos or not. sample data in tables relevant column names topic topic_id | name | course_id 1 | excel - add/subtract | 1 2 | excel - sort | 1 3 | excel - filter | 1 4 | excel - formulas | 1 video video_id | video_url 10 | www.youtube.com?v=123 12 | www.youtube.com?v=345 13 | www.youtube.com?v=567 14 | www.youtube.com?v=879 15 | www.youtube.com?v=443 topic_video topic_video_id | topic_id | video_id | is_sample 1 | 1 | 10 | y 2 | 2 | 12 | n 3 | 3 | 13 | n 4 | 3 | 14 | y 5 | 4 | 15 | n so trying given course select topics , corresponding videos. i...

iphone - Keyboard won't appear in modal view controller -

i have uiwebview in modal view controller (using svmodalviewcontroller ). in ios 4.2, when tap on input text field, keyboard not appear. view animation page scrolls make room keyboard still happens, nothing appears. works fine in ios 5. i calling [self.window makekeyandvisible] in application delegate, not issue. any guidance appreciated! solution: needed make view controller containing uiwebview first responder, , after that, worked!

CSS,HTML or Jquery - Scrollbar style -

Image
how create scrollbar this? you're going want use css. http://beautifulpixels.com/goodies/create-custom-webkit-scrollbar/

How to read php socket connection response? -

following socket connection request , response order. $socket = socket_create(af_inet, sock_stream, 0); $connection = socket_connect($socket, $host, $port); $md5checksum = md5($msg); $willwait = 'soap '. $md5checksum. ' will_wait'."\n"; socket_write($socket,$willwait); socket_write($socket,$msg); socket_write($socket, soapsender::$term_char); sleep(1); $buf = socket_read($socket, 2048); //socket_write($socket,"&\r\n"); echo "$buf\n"; please tell me how read response receive after last socket_write request. have been searching answer day have not been able find through google. thanks lot time. two functions should used: stream_set_blocking($socket, true); and stream_get_contents($socket); setting block on stream requires return of data before application continue execution of script. if not set stream block, latency cause php script think there no response, causing not receive data...

mysql - SELECT ... FOR UPDATE locking trouble when applied on date range -

i'm having following table structure. reservation: (innodb) ------------------------------------------ id int, date date, item_id int, slot varchar(50); primary key(id), unique key(item_id,date). now i'm trying use select.....for update on reservation table inside transaction lock specific rows within date range(eg:2012-06-15 2012-06-16) of particular item_id. select availability reservation item_id={$item_id} , (date>='{$to_date}' , date<='{$from_date}') update now when use above statement, blocking rows of particular item_id beyond date range.i'm using unique key(item_id,date). how lock particular date range of specific item_id? regards, ravi. added: | ===================================== 120615 20:14:13 innodb monitor output ===================================== per second averages calculated last 24 seconds ---------- semaphores ---------- os wait array info: reservation count 12, signal count 12 mutex sp...

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

i have created website using vbulletin have installed cms , blog modules in in admin default setting forums when enter homepage url redirecting me http://www.demo.com/content/ content cms page please help for vbulletin versions < 4.2. need modify forum index page located in top level of vbulletin directory. based on url in question it's file: http://www.demo.com/index.php here contents of file, can choose whether cms or forum default home page. /** * can choose default script here. uncomment appropriate line * set default script. note: uncomment 1 of these, must * add // comment out script(s) not want use * default script. * * can choose default script if not plan move * file root of website. */ /** * use cms default script: */ require('content.php'); /** * use forum default script: */ // require('forum.php'); for vbulletin versions >= 4.2. there's new "navigation manager". you'll find control settin...