Posts

Showing posts from March, 2014

ios - Setting an animation for a toolbar from the beginning -

i have textfield has uidatepicker instead of keyboard. made toolbar not connected datepicker appears when textfield tapped. problem animations. datepicker slides nicely, toolbar appears before animation of datepicker done. makes whole thing horrible. how set animation match datepickers ? have no experience animations , none of other posts did me. edit based on tareks answer able set animation slide doing following. first, setting toolbar bottom of screen pickerbar = [[uitoolbar alloc] initwithframe:cgrectmake(0, 480, 320, 44)]; seconds, changing location of toolbar in animation [uiview animatewithduration:.4 animations:^(void) { cgrect rect = cgrectmake(0, 224-46, 320, 44); [pickerbar setframe:rect]; you can use code below show toolbar: [uiview animatewithduration:2.0 animations:^(void) { toolbar.alpha = 1; }]; edit : toolbar.alpha should 0. for sliding: gonna like: [uiview animatewithduration:2 animations:^{ int newy = ...

android - How can i turn Stringbuilder variable to a long? -

// text file file file = new file(environment.getexternalstoragedirectory() + "/config/gpslistenermintime.cfg"); // read text file stringbuilder gpslistenermintime = new stringbuilder(); try { bufferedreader br = new bufferedreader(new filereader(file)); string line; while ((line = br.readline()) != null) { gpslistenermintime.append(line); gpslistenermintime.append('\n'); } } catch (ioexception e) { // todo you'll need add proper error handling here } i want read number file code , works well, how can use number long value in requestlocationupdates? tried use way not working: lm = (locationmanager) getsystemservice(context.location_service); lm.requestlocationupdates(locationmanager.gps_provider, long.valueof(string.valueof(gpslistenermintime)), 0, this); my file contains number:...

Rails - javascript not reloading divs via remote call -

i trying create timeline user can create events go on timeline. i've had working fine in past, have since updated version of rails 3.2.14, , no longer works. possibly syntactical error if has changed between versions, or have done wrong? the timeline show view renders partials including timeline, , create/edit/destroy form partials events. understand it, form getting submitted, , should calling create.js.erb. what happening when click 'create event', contents of page replaced standard "event created" notice (not 1 create.js.erb), , else disappears. event has been created though. can help? timeline show view: <div id="show-timeline"> <%= render :partial => "show_timeline" %> </div> <div class="content-box timeline-box"> <div id="my-timeline-box"> <%= render :partial => "my_timeline" %> </div> <br /> <button id="new-event-butt...

c# - Unable to install OOB SL5 programatically -

i'm trying install brand new silverlight 5 application using sllauncher.exe. when older sl4 application, works fine, however, new sl5 application different , causing sllauncher fail silently. generate folder in appdata folder, empty. ideas might causing this? way see errors sllauncher throwing? , ideas welcome! (for method of invoking sllauncher, following post: http://timheuer.com/blog/archive/2010/03/25/using-sllauncher-for-silent-install-silverlight-application.aspx ) in case had nothing silverlight 5, turns out issue due out of browser icons had set, being set resource , not content. them show , install using sllauncher.exe work, icon files must set content, otherwise out of browser fail silently when using sllauncher.exe , work fine using right-click context menu install it.

xcode - Retrieve files from iOS app Documents folder via command line -

for project work on, have set performance metrics. way simulator writes csv files known location. retrieve theses files , make graphs out of it. piece of cake. we have these tests running on device. in case, files created in documents directory. while can retrieve these files via organizer, i'd more interested in automating that. how can retrieve files iphone app via command line rather organizer? you can access content of app computer, using https://github.com/phonegap/ios-deploy (originally https://github.com/ghughes/fruitstrap ) . it's simple : ./ios-deploy --download=/documents --bundle_id com.mycompany.myapp -2 dest_dir you can more, listing content of app, debug using lldb etc.

JQuery UI Date Picker - Adding a class to all selected <td> -

i trying add class each <td> between 2 specific dates. here code; http://jsfiddle.net/7q4bt/171/ $(function() { $(".checkin-date__input").attr("placeholder", "mm-dd-yyyy").datepicker({ dateformat: "mm d yy", mindate: +1, showon: "focus", numberofmonths: 2 }).on("change", function(e) { var curdate = $(this).datepicker("getdate"); $(this).datepicker("setdate", curdate); if($('.checkin-date__input').datepicker("getdate")) { $( ".checkout-date__output" ).datepicker( "option", "mindate", $('.checkin-date__input').datepicker("getdate") ); }; }); $(".checkout-date__output").attr("placeholder", "mm-dd-yyyy").datepicker({ dateformat: "mm d yy", mindate: +1, showon: "focus",...

import - Using a C++-function that is exported -

this question has answer here: c++ exporting , using dll function 2 answers i have been googling days now, , cant seem wrap head around problem. i have header, exports functions library. file called test_extern.h, , function looks this: __declspec(dllexport) int afunction(int a, int b); i have 2 other files, 1 .h , .cpp calculates things of exported file. have stripped down versions show want do. a.h file: // include cbasedili_j1939 header file. class : public cbasedili_j1939 { public: int bfunction(int a, int b); } a.cpp file: #include "test_extern.h" #include "a.h" int a::bfunction(int a, int b) { return afunction(a, b); // return value of exported function! } now when run this, "error lnk2019: unresolved external symbol _ imp _afunction". i have read , read there exporting dll's, there knows might doing wro...

c++ - Cmake Regenerate on variable change -

y part: i've got cmake macro runs external program , creates project specific variables. i'd have cmake run script on every build, check if variables have changed, , iff have (to prevent full project rebuild when has not), regenerate configure_file header...i'm not sure how though. (add custom target rebuilds header file every time , can't call macros, same add custom command). x part: so i've written following script pulling hg version information use in c++ project: macro (readprojectrevisionstatus) exec_program(hg ${project_source_dir} args paths output_variable ${project_name}_hgpaths) message(status "${project_name}_hgpaths=${${project_name}_hgpaths}}") if (not(${project_name}_hgpaths strequal "")) string(replace "\n" ";" ${project_name}_hgpaths ${${project_name}_hgpaths}) foreach(hgpath ${${project_name}_hgpaths}) string(substring "${hgpath}" 0 10 hgpathstart) if (hgpathstart matches "default...

Understanding JavaScript Object -

this line @ top of javascript file in project @ school. can tell me does? var tele = { 'forms': {}, 'form': {} }; it followed 3 functions contain more functions exampled below. formsview.js tele.forms.view = new function (){ this.setrequesttitle = function (title) { if (el.length == 0) { settimeout(function () { tele.forms.view.setrequesttitle(title); }, 100); return; } $('#formtitlebarsubmenutext').html(title); document.title = title; }; .... .... }; then there second javascript file formview.js contains this tele.form.view = new function () { this.initialize = function (data) { tele.forms.view.setrequesttitle('approval request'); }; }; i new javascript , scripting in general trying figure out how things work. understand happening inside functions, not tying together. thanks! that line declares variable: var tele; // declare variable identifier tele and ...

asp.net - ASP button reloading page? -

i have code on aspx page: <div id="bloc1"> hey </div> <asp:button id="button2" runat="server" text="button" onclick="button2_click" onclientclick="change_page()" /> <input id="button1" type="button" value="button" onclick="change_page()" /> <div id="bloc2" style="display:none"> hey me </div> <script type="text/javascript"> function change_page() { document.getelementbyid("bloc2").style.display = "block"; document.getelementbyid("bloc1").style.display = "none"; } </script> when click on html button, script works well: bloc1 disappears , bloc2 appears. when click on asp button, bloc1 disappears , bloc2 appears , bloc2 disappears , bloc1 re-appears (so beginning) if page reloaded. behind code something: protected void butt...

command line arguments - R Paste multiple -

i taking in multiple command line parameters within r script such : args<-commandargs(true) arg1 <- as.numeric(args[1]) arg2 <- as.numeric(args[2]) i wanting use these args within paste string below. problem can figure out how use 1 of arguments , not both (arg1, arg2). instead of "xxx" show below in clause (i.e. "columnname1 in (xxx)") how use "arg1" command line parameter in place of "xxx"? i've tried number of different ways , reason can't figure out. should concatenate 2 different strings accomplish or there easier way? sql<-paste( "select * table columnname1 in (xxx) , columnname2 in ('",arg2,"')",sep = "") thanks help! try: sql<-paste( "select * table columnname1 in ('",arg1,"') , columnname2 in ('",arg2,"')",sep = "", collapse="")

perl - WWW::Mechanize::Firefox click button in <div> -

i got big problem. have 12 elements same class - "comment". in every button click. i need know how select (eg. 3 of 12) , click button there. is exist selector or something? please give me advice that. $mech->click can take css selector or xpath query argument. if know button want click always third one, use nth-of-type css selector pinpoint it. edit: example using xpath based on op's comments (i haven't tested this). use qq allow variable interpolation inside xpath statement. note have backslash escape occurrences of @ qq doesn't interpret them arrays: my $author = 'xxx'; $mech->click({ xpath => qq(//div[\@class="com" , \@author="$author"]/button) });

vba - Visual Basic: killing the process of an Application Object -

in visual basic create application object , start it: gapp = new canoe.application gmeasurement = gapp.measurement gapp.open(arrargs(0), false, false) gmeasurement.start() once application finishes processing data 2 possible scenarios may happen: (i) data file corrupt , (in normal circumstances) allert window raised , (ii) data file ok. in (ii) case can quite application gapp.quit() . in case (i) gapp.quit() not work, since program expects input user (although not see window @ all). question 1 : how can quite process corresponding gapp? quiting in way: each p process in process.getprocesses if p.processname = "canoe32" p.kill() end if next in general bad solution since more instances of canoe32 may run (although in particular case 1 process of binary may run on system). question 2 more elegant solution quit gapp in case has child windows? any comments helpful a possible solution problem use s...

.net - kendo ui grid filter case insensitive -

i'm trying enable case insensitive filtering (server side) kendo grid. know way inject tolower (toupper, etc) filter enable case insensitive filtering? background: i dropped kendo grid in consume data controller ( entitysetcontroller , .net 4.5) , seems work well. inline editing, server paging, adding new rows, etc. to enable case insensitive filtering knockout, build filter filter text , field wrapped in tolower (as recommended here ). haven't found way customize filter using kendo elements. controller: public class categoriescontroller : entitysetcontroller<category, int> { public override iqueryable<category> get() { return _repository.find().orderby(c => c.name); } } data source creation: var servicebaseurl = "api/categories", datasource = new kendo.data.datasource({ type: "odata", transport: { read: { url: servicebaseurl, datatype: ...

javascript - D3 Tree Layout - Custom Vertical Layout when children exceed more than a certain number -

Image
i'm trying use d3 tree layout create family tree of sorts , 1 of things noticed when have many children nodes, stretch out horizontally across screen. ideally more vertical layout these nodes people don't have scroll across screen , can keep looking down tree. here see: now might not bad, if had 20 children, span across whole screen , kind of want avoid. i have seen questions this doesn't me because want specific layout , not resize... have large nodes , begin collide 1 if try dynamically resize tree -- shrinking tree not me good. i need different layout situations there more number of children. here kind of envisioning/hoping for. notice root not make format because has 4 children. ideally want if parent has 5 or more children, result in layout below. if root had 5 children, result in layout , layout should stretch out vertically if users wanted see root's grandchildren (the a, b, c... nodes). if necessary can diagram of going: i found semi-similar que...

linux - ./startAgent.sh --udp-port 0 --tcp-port 3450 Permission Denied -

in jmeter plugins, when trying run ./startagent.sh --udp-port 0 --tcp-port 3450 to monitor server, getting permission denied error. per details on plugin page don't need rot/admin access. system still shows error.. i found solution, have run below command avoid permission denied. chmod 744 startagent.sh

javadoc - Where to get downloadable Javasdocs for older JDKs? -

i download of javadocs 1.6 api. oracle has them online, can't seem find way download them computer. ideas? thanks. jdk contains javadoc ( http://docs.oracle.com/javase/6/docs/ ). so, download , install java se 6 jdk, , you'll have needed documentation offline on computer.

linux kernel - How to read return value of mmap -

i'm new topic, have mmaped 3 pages. how can read content of each? know have use page_shift don't know how. unsigned int* address = mmap(...) somethings following... #define page_size 4096 unsigned int * address = mmap(...) unsigned int * page0 = &address[ 0 * page_size / sizeof(int) ]; unsigned int * page1 = &address[ 1 * page_size / sizeof(int) ]; unsigned int * page2 = &address[ 2 * page_size / sizeof(int) ];

view - Objective-c Nested VIewControllers -

Image
i create app whit structure similar native application "phone" of iphone. more precise, phone application have tabbar contains:"favorites" , "recents", "contact", "keypad" , "voice mail". when enter in tab contacts can see navigation bar , tableview. have similar structure i'm questioning myself best , correct way it? i thinking start single view application use view controller create automatically tabbedviewcontroller create subclass of viewcontroller , used navviewcontroller. i have [mytabbar.view addsubview:mynavcontroller]; but how can set instance? once have automatically created viewcontroller , create secondviewcontroller how can set them tabviewcontroller , navviewcontroller ? if you're using storyboards, add tab bar controller storyboard. select 1 of tab bar's child scenes , choose "embed in" - "navigation controller" xcode "editor" menu. if repeat ...

php - Custom wordpress contact form -

i trying make custom wordpress contact form. i've got far: my function contact form itself: <?php if( isset( $_post['submitted'] ) ) { //response generation function $response = ""; //function generate response function my_contact_form_generate_response($type, $message){ global $response; if($type == "success") $response = "<div class='success'>{$message}</div>"; else $response = "<div class='error'>{$message}</div>"; } //response messages $not_human = "human verification incorrect."; $missing_content = "please supply information."; $email_invalid = "email address invalid."; $message_unsent = "message not sent. try again."; $message_sent = "thanks! message has been sent."; //user posted variables $name = $_post['message_name']; $email = $_post['message_email']; ...

java - Why doesn't the index/list of an array begin with 1? -

this question has answer here: why indexing start 0 in 'c'? 12 answers is there special reason? know that's how language has been written, can't change it? , challenges we'd face if index start 1? for historical reasons, , reasons connected how array "made" in memory. in c, array piece of memory (with information @ compiler level on size). have pointer (a reference) first element. go second element can do int array[10]; // array int *p = array; // reference first element of array int *q = p + 1; // reference second element of array int *r = p + 2; // reference third element of array clearly, symmetry: array[0] // reference first element of array array[1] // reference second element of array array[2] // reference third element of array the [x] operator of c in fact compiled array + x . you see? array "base 0...

javascript - Compatibility issues with pidcrypt and openssl_encrypt -

i designing application allows end users take quizzes browsers. part of requirement when quiz start time around, question should displayed every participant @ once. makes serving questions end users server less reasonable because lead sudden burst of request intend serve questions them connect , less 2 hours quiz start time. problem since competition, questions should not seen before start time hence there need encrypt it. i have decided encrypt in 2 stages, first stage of encryption using asymmetric rsa encryption exchange of keys have done. key used encrypt other data that sent between server , client. the problem symmetric encryption part. trying use openssl_encrypt method encrypt on server side , trying decrypt pidcrypt (a javascript encryption/decryption library) on clientside. turns out pidcrypt requires iv (initialization vector) 8 bytes long openssl_encrypt using aes-256-cbc mode doesn't allow 8 bytes instead insisting on 16 bytes. have done lot of permutations , ex...

How to Install Matplotlib Basemap Module on Windows 7 with WinPython (or any Python stack install)? -

i've found basemap (module matplotlib , python) binary installer windows cannot detect python on system when python installed part of stack install, anaconda or winpython. installer exits, rather allow point directory of installation. i have therefore install via source. however, don't know method this. readme.txt , install instructions don't seem help. instruct "install geos-3.3.3 first" - well, how exactly? don't see setup.py in directory. any great. (python 2.7, win 7, 64b) i use windows. , installation failed official guidance, too. installed basemap using following method. although not sure if go right you, offer mine. first of all, must have pip in computer. (it easier install, compared basemap , other things. , can used install many useful packages.) then go great link: http://www.lfd.uci.edu/~gohlke/pythonlibs/ and download file named " basemap‑1.0.8‑cp27‑none‑win_amd64.whl ". remove .whl file directory "...

R: ddply function applied to certain months obtained from date field -

can functions applied month/year combinations of date field in ddply? want figure mean (among other functions) specifying month/year. monthlysummary <- ddply(tempdata, .(date, siteid, substrateid), summarize, monthlymean=mean(temp_c)) not sure mean "only month/year combinations" perhaps subset want, thought might asking summarization month. assuming date field of class date: monthlysummary <- ddply(tempdata, .(format(date, "%m" ), summarize, monthlymean=mean(temp_c)) if it's not date class variable, maybe should make one: tempdata$date2 <- as.date(tempdata$date, "%d/%m/%y") # or format and if wanted site , substrate month then: monthlysummary <- ddply(tempdata, .( format(date, "%m" ), siteid, substrateid), summarize, monthlymean=mean(temp_c)) other date-aggregation options besides format.posixt include functions in package:lubridate , '...

build boost c++ with mingw -

does have specify cxxflags=-std=c++11 when build boost c++ library? using mingw 4.8.0 (x32,posix,dwarf, same provided qt 5.1.0) , boost c++ 1.54.0 (with patches specified in boost download page). for building boost not necessary on system (gcc 4.8.1, x64). used on windows command promt (not msys): bootstrap mingw bjam toolset=gcc link=shared variant=debug,release alternatively may use b2 (reference) . have have boost in include path, though export cflags="-i/path_to_boost/boost_1_54_0" export cxxflags="-i/path_to_boost/boost_1_54_0" for compiling programs should use c++11 features, need it; independent if boost used.

formatting - Excel integer to boolean condition -

Image
creating spreadsheet has bunch of test cases , @ end says pass or fail. all values right either "pass" or "fail". need able have conditional can type in number. if above 5 need return pass. if below 5 need return false. solutions guys? the following might way go: where enter value in b1, used condition on. it's easier , more transparent have column contains conditioned value separate original data. another option might conditional formatting. in case, condition on value in cell. here i've formatted cells display green/yellow/red dot (traffic sign) depending on value in cell.: with output resembling another option change formatting of cell specific "custom" formatting: read more how create custom number format on microsoft's page. a final option (that bit more intricate) requires set multiple, mutually exclusive, conditional formatting of cells separate "custom" cell formatting: note cell entry ...

c# - How to get attribute values inside an XmlElement? -

i have xmlelement containing data: <message from="smithfamily@conference.hp63008-y57/admin" to="admin@hp63008-y57/jabber.net" type="groupchat" id="e83dn-53" xmlns="jabber:client"> <body>:d</body> <x xmlns="jabber:x:event"> <offline /> <delivered /> <displayed /> <composing /> </x> <delay stamp="2013-08-07t16:53:32.693z" xmlns="urn:xmpp:delay" from="admin@hp63008-y57/spark 2.6.3" /> <x stamp="20130807t16:53:32" xmlns="jabber:x:delay" from="admin@hp63008-y57/spark 2.6.3" /> </message> i attributes values stamp , from inside delay element. have tried several xpaths don't know how use or if have declare namespace. use xelement instead. save lot of time , effort. xelement xmlroot = xelement.load("somefile.xml...

ajax - asp.net page wait others server side / asynchrone page -

i created asp.net page waiting ajax. have 1 page creating takes 30 seconds. on every step change session value. i have page ajax, returning session value showing percentage of creation. but, dont know why, ajax page awaits end of creation of first page. 100% @ end. maybe it's because use vs development server , not iis server. if problem, can change settings of development server asynchrone execution? or else? webforms not ideal asynchronous operations. add signalr project , use hub push status data page update current state of process running asynchronously. an example of technique perform type of asynchronous notification covered in blog post titled " a guide using asp.net signalr radnotifications "

Why does my c++ object gets deleted as soon as i create it? -

i have created class make possible render multiple objects on screen, called "entity", here code 3 constructors: entity::entity() { x = y = z = 0; std::cout<<"init model"<<std::endl; model = model(); model.loadmodel2("huis_0.txt"); } entity::entity(float xval,float yval,float zval,std::string source) { std::cout<<"init model2"<<std::endl; x = xval; y = yval; z = zval; model = model(); model.loadmodel2(source); } entity::entity(std::string source) { x = y = z = 0; std::cout<<"init model3"<<std::endl; model = model(); model.loadmodel2(source); } the deconstructor simple prints out "deleting entity". load entity in main file using second method. model class loads vertices , indices file. during run output get: init2 ++loading model+++ ++done loading model++ deleting entity //other prints deleting entity then after close window...

javascript - jQuery: remove a cookie when closing the browser (session cookie) -

it sounds simple , think should simple, somehow don't work... i want set cookie using javascript , cookie should removed when user quits browser. setting cookie , getting value not problem. when quit browser , reopen it, cookie still there (firefox). i use jquery , cookie-plugin . here test code: $(document).ready(function(){ $('#output').append( '<li>initialize...</li>' ); var $cookieval = $.cookie('testcookie'); $('#output').append( '<li>check cookie...</li>' ); if(!$cookieval) { $('#output').append( '<li>set cookie...</li>' ); $.cookie('testcookie', 'eat cookies', { path: '/' }); //console.log( $.cookie() ); } else { $('#output').append( '<li>cookie set...</li>' ); $('#output').append( '<li>cookie value: '+$.cookie('testcookie')+'</li>' ); } }); please find ...

global variables - Android with a Globally accessible class in all activities -

i having trouble sharing globalvaribale class: here class: public class globalobjects extends application { private context context; public globalobjects(context context) { this.context = context; } // variables private network network; // getters , setters public context getcontext() { return context; } public void setcontext(context context) { this.context = context; } public network getnetwork() { return network; } public void setnetwork(network network) { this.network = network; } } and here android manifest file: <application android:name="globalobjects" android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > i have added global object existing application tag. when run class gives errors: 08-07 21:19:58.867: e/androidruntime(3588): fatal exception: main 08-07 21:19:58.867: e/androidr...

Iteration on a Ruby hash, unexpected behavior -

r = {} r[0] = [1, 2] r[2] = [1, 2, 4] r[4] = [1, 2, 5] r[6] = [1, 2] count = 0 r.each |x| count += x.length end puts count #output 8 expected value 10 why behavior? how achieve expected behavior (getting sum of length) each converts receiver hash array , iterates on it. each element of iteration consists of array of 2 elements: key , corresponding value. since have 4 key-value pairs, adds eight. to acheive 10 , can do: r.each |x| count += x.last.length end or r.each |_, v| count += v.length end or r.values.flatten.length

ajax - passing array from javascript to controller MVC 4 -

i using razor , i'm having hard time passing array controller. array contains objects made , trying this: $.ajax({ type: "post", url: "homepage/handleoperations", data: json.stringify(operationcollection), success: function (data) { alert("sucess");}, datatype: "json", contenttype: "application/json" }); and controller is: public void handleoperations(list<string> operationcollection) { } i not required use ajax not sure how else done. in controller shows "operationcollection" contains elements null. client side: $.ajax({ type: "post", url: "homepage/handleoperations", data: {operations: operationcollection}, success: function (data) { alert("success"); } }); and declare class server side this: public class operation { public int index; public string source; public string target; public int addordel;...

javascript - Filter non-Alpha characters for multiple languages -

i want write regex remove non alpha characters, follows: björn -> björn barry's -> barrys who? -> cibé? -> cibé i'd -> id ice-cream -> icecream no!!! -> no [{brackets}] -> brackets ~inv3rse -> invrse and convert characters lowercase versions. how do languages or @ least european languages using latin script? str.tolowercase().replace(/[^a-z]/gi,''); this convert lowercase, replace isn't alphabetic character (a-z) empty string, removing them. in order keep other characters (like e accent mark) add symbol regex.

java - GWT: Using i18n in UiBinder and dynamically -

i want ask question related i18n in gwt. i have web application uses uibinding, followed online instructions , made uibinder i18n. property generated gwt compiler put directory of: src/main/java/com/google/gwt/i18n/client/localizableresource_en.properties src/main/java/com/google/gwt/i18n/client/localizableresource_de.properties src/main/java/com/google/gwt/i18n/client/localizableresource_es.properties i can therefore in web app switch language specifying "&locale=de" in query string of url. here problem. have other string cannot fit uibinder. decided @ runtime , therefore needs read dynamically. example, given file, need workout file type , display file type in proper language , display like: mytextfile.txt -> "text" the word "text" needs change depends on language. because file server , file, cannot statically bind "text" translation key. question 1: how can in uibinder? i understand can without using uibinder. can us...

javascript - Getting the HTML of a DIV with another element -

i have bunch of thumbnails. of these know link in jquery script - however, need html .caption , , can't make that. i've tried following things $('a.thumbnail').click(function() { $(this).closest('.caption').html() $(this).find('.caption').html() $(this).children('.caption').html() }); here's html: <div class="thumbnail"> <a href="#" class="thumbnail"> <img src="{{ url::asset($item->image) }}" alt=""> </a> <div class="caption" align="center"> {{ $item->name }} </div> </div> this work, since .caption sibling of a : $('a.thumbnail').click(function() { $(this).siblings('.caption').html(); }); why yours don't work: $(this).closest('.caption').html() // .caption not ancestor of $(this).find('.caption').html() // .caption...

c# - Read int from process memory -

i'm reading data memory using base adress , offsets: public static int readint(long address) { byte[] buffer = new byte[sizeof(int)]; readprocessmemory(phandle, (uintptr)address, buffer, (uintptr)4, intptr.zero); return bitconverter.toint32(buffer, 0); } i add offsets this: var 1 = memoryhandler.readint((long)memoryhandler.base_adress + (long)0x0945bb0c); var 2 = memoryhandler.readint(one + (long)0x28); var 3 = memoryhandler.readint(two + (long)0x214); var 4 = memoryhandler.readint(three + (long)0x38); var 5 = memoryhandler.readint(four + (long)0x7ec); var 6 = memoryhandler.readint(five + (long)0x230); where six contains value need. i tried make overload same thing. problem it's not giving me same value. know why: public static int readint(long address, int[] offsets) { long prev = 0; (int = 0; < offsets.length; i++) { address = prev > 0 ? readint(prev + (long)offsets[i...

sql server - File access using microsoft.sqlserver.smo.dll? -

i'm using c# application backup , restore dbs on remote server using microsoft.sqlserver.smo.dll. testing local machine, can browse backup files select backup use. can done through code remote sql server using sql credentials similar way mssms it? my backups saved naming convention (ie. "ebuy_full_2013_8_7_h13_m40.bak") , able show these in application decision backup file restore can made. thanks, rick solved: based on comment question ran sql profiler determine functions mssms using, found using master.dbo.xp_dirtree, able duplicate in app.

c# - DataTable.Columns[0].Container returning null -

i'm trying bind datagridviewcomboboxcolumn object column in datatable binded datagridview . column placed separate datagridview . section of code happens: //create material datatable materialtable = new datatable(); materialtable.columns.add("material", typeof(string)); datagridviewmaterials.datasource = materialtable; //create material combobox column materialcolumn = new datagridviewcomboboxcolumn(); materialcolumn.datapropertyname = "material"; materialcolumn.name = "material"; materialcolumn.datasource = materialtable.columns[0].container; materialtable.columns[0].container; returns null no matter how populated materialtable is. other methods such materialtable.rows[0]["material"].tostring() works expected. how can work? the columns collection represent constituent structure of datatable (aka schema). doesn't contains data. datatable , rows collection contains data. in case should write //create material combo...

linux - Easy tool to convert data to different format -

i'm studying statistics , programming on own. kind of c or python program solve following problem in linux? i have text (maybe csv) file of form pcb138 pcb180 pcb52 pcb118 pcb 1,46 ,738 ,532 ,72 19,9959 ,64 ,664 ,03 ,236 6,0996 3,29 1,15 ,134 1,54 24,9655 3,94 1,33 ,466 1,94 37,4436 ... 32,3 31,5 1,8 8,49 318,7461 now convert format program understands. namely, text file of form pcb138=[1.46,0.64,3.94,...,32.3] pcb180=[0.738,0.664, 1.15,1.33,...,31.5] pbc52=[0.532, 0.03, 0.134, 0.466, ...,1.8] pbc118=[0.72, 0.236, 0.154, 1.94, ...,8.49] pbc=[19.9959, 6.0996, 24.9655, 37.4436, ...,318.7461] write c program using 2 dimensional array , strtok() parsing http://www.cplusplus.com/reference/cstring/strtok/ /* strtok example */ #include <stdio.h> #include <string.h> int main () { char str[] ="- this, sample string."; char * pch; printf ("splitting string \"%s\" tokens:\n...

jquery table replace partial table content inside html -

i have table: html <div class="bbclass1 bbclass2"> <table> <tr> <td><b>name:</b> value1</td> <td>value2</td> <td>value3</td> <td>value4</td> </tr> </table> <div> i need replace 'name:' to 'hello:' how do this? i have tried $("td :contains('name:')").text("hello:"); for reason replaces entire table name1. this not work either: $("div:contains('name:')").html("hello"); any other suggestions? you using wrong selector. there should no space between `"td :contains"` ^------- remove space supposed $("td:contains('name:')").text("hello:"); you can try $("td b:contains('name:')").text("hello:"); check fiddle

Parsing json string for multiple stock quotes -

this data returned request "jnj" , "adp" stock information. var quote = new object(); quote['jnj'] = { ticker: 'jnj', valoren: 943981, exchangecode: 321, exchange: 'ny', exchangename: 'new york stock exchange', exchangeshortname: 'nyse', tradetime: 1375906505, volume: 9052146, last: 93.66, open: 93.60, high: 94.03, low: 93.47, prevclose: 93.81, change: -0.15, changepercent: -0.1599, bid: 93.66, ask: 93.68, bidsize: 2500, asksize: 800, name: 'johnson & johnson', shortname: 'johnson', isin: 'us4781601046', sharesoutstanding: 2818073863 }; quote['adp'] = { ticker: 'adp', valoren: 910042, exchangecode: 537, exchange: 'nq', exchangename: 'nasdaq stock market', exchangeshortname: 'nasdaq', tradetime: 1375905600, ...

Load multidimensional VBA Array from disk -

Image
i'm trying save , load multi-dimensional vba array to/from disk. according msdn website , number of dimensions saved descriptor in file, can't figure out how access/load them. example below works, because have hard coded array dimensions. commented out line works in dynamic sense, array's dimensions lost in process. here's sample code: sub writearray() dim file_name string dim file_length long dim fnum integer dim values() boolean redim values(1 5, 1 10, 1 20) dim integer 'populate simple array = 1 20 values(1, 1, i) = true next ' delete existing file (if any). file_name = "array.to.file.vba.bin" on error resume next kill file_name on error goto 0 ' save file. fnum = freefile open file_name binary #fnum put #fnum, 1, values close fnum end sub sub readarray() dim file_name string dim file_length long dim fnum integer dim newarray() boolean file_name = "array.to.file.vba.bin" 'txtfile.text" fnum = freefile ...

c# - Code Analysis CA1811 not working inside a form about "uncalled private coode" -

in visual studio 2012 update 3, have uncalled private code inside winforms codes, not inside myform.designer.cs, in myform.cs, ca fails report ca1811. if have uncalled private code in other classed, check ok. tried vs 2012 in 2 workstations, result consistent. is known bug? or workaround or fix?

javascript - Why can I not select both input elements? -

this question has answer here: jquery id selector works first element 6 answers i'm trying set value input element(s) match id. but jquery.each picking first/one input element. i'm trying perform ajax post , need both these id have same value. html @html.hiddenfor(u => u.transid) //<input id="transid" name="transid" type="hidden" value="0"> @html.dropdownlistfor(u => u.transid, model.transmodes) //<input id="transid" name="transid" value="0"> script $("#transid").each(function () { $(this).val("2") alert($(this).val()); }); cheers an id must unique in html. if want name several elements same use class instead. <input class="transid" name="transid1" type="hidden" value="0"...

post - Java sending request multipart/form data -

i'm trying send http request web using post, want mimic behavior of form , resulting html code. <form action="http://www.myweb.com/index.php?route=account/login" method="post" enctype="multipart/form-data"> <div class="content"> <p>ya soy cliente</p> <b>dirección e-mail:</b><br> <input type="text" name="email" value=""> <br> <br> <b>contraseña:</b><br> <input type="password" name="password" value=""> <br> <a href="http://www.myweb.com/index.php?route=account/forgotten">contraseña olvidada</a><br> <br> <input type="submit" value="entrar" class="button"> </div> </form> so far, i've used httpclient apache, doesn't...