Posts

Showing posts from January, 2012

sql - Oracle statement hanging -

sql - Oracle statement hanging - i have quite simple sql statement executed on oracle 10g database. moves info 1 schema another: create table target.big_table select * source.big_table (column1, column2) in (select column1, column2 target.help_table); there unique constraint in target.help_table column1 , column2. in source.big_table there combined primary key(column1,column2,column3,column4,column5). there no problem statement since executed several times while testing on similar testing environment. however, @ real environment statement didn't had i/o activity after 3 hours. 8 hours later aborted execution. what can reason behaviour? , can root of problem? don't have clue! try rid off nested loops in explain plan. consider rewrite query using inner join: select /*+ use_hash(a b) */ a.* source.big_table inner bring together (select distinct column1, column2 target.help_table) b on b.column1 = a.column1 , b.column2 = a.column2;

angularjs - Is it possible to have multiple states on a page at once or change the state of a named view? -

angularjs - Is it possible to have multiple states on a page at once or change the state of a named view? - i developing page has news feed on it; when think of logically, feed has several states on (news, settings, favorites, etc.). a feed should able on many types of pages, such product or person or whatnot, way understand feed should have states because parent page can have sorts of other states feed not care about, , vice versa. i can't figure out how accomplish -- @ first thought able accomplish using named view on parent page can't figure out if view can have state, or how code that. how should implementing structure? what looking sounds lot directive: a directive has html template associated it a directive backs html template scope can (and should) independent of page scope, few explicitly defined parameters (values and/or functions) passed it a directive can define specific behaviours , functions, regular page via controller a directive can nonethel

Is there a way to check if a integer contains a certain number in python -

Is there a way to check if a integer contains a certain number in python - i have been trying check if integer has number in not number. far have tried , doesn't work. help? while x == int (10) false or x == int(20) false: but no matter number entered comes out false you want compare x directly, nil fancy: while x != 10 or x != 20: which true , because no matter value x has, 1 of 2 inequalities hold. x cannot 10 , 20 simultaneously. want while x != 10 , x != 20: or equivalent while not (x == 10 or x == 20): python

python - Make calls to Drive API inside of a Google App Engine Cloud Endpoints -

python - Make calls to Drive API inside of a Google App Engine Cloud Endpoints - i trying build own endpoints within of app engine application. there endpoint api needs inquire user "https://www.googleapis.com/auth/drive.readonly" scope. performs list of drive api , scan drive file of user. the problem don't know how create phone call drive api within of endpoint api. i think within of endpoint method, has credentials got user. don't know how receive that. i using python backend language. @drivetosp_test_api.api_class(resource_name='report') class report(remote.service): @endpoints.method(emptymessage, emptymessage, name='generate', path='report/generate', http_method='get' ) def report_generate(self, request): logging.info(endpoints) homecoming emptymessage() you can utilize os.environ access http authorization header, includes access token, granted scopes asked on client side, i

Diffrence between autocomplete and ajax? -

Diffrence between autocomplete and ajax? - what diffrence between ajax , autocomplete function. know autocomplete software function completes words or strings without user needing type them in full. ajax similar + other functions. ajax stands "asynchronous javascript , xml" , offers alternative traditional "request-respond-cicle". with ajax can info server without browser having re-render whole page. autocomplete on other hand side uses ajax possible results on every key nail users. read more ajax here: http://en.wikipedia.org/wiki/ajax_(programming) ajax autocomplete

Is there a fast way in Facebook to know what user liked post if this post contains about 3.500.000 likes? -

Is there a fast way in Facebook to know what user liked post if this post contains about 3.500.000 likes? - post id 100827133412869_362817400547173. can see it's much likes there. i'd know there faster way find out user liked post? when used fql query:"select object_id, post_id, user_id user_id = me()". fql isn't available. i'm trying utilize pagination, limit=25 it's 140.000 requests, , understand how much time take. when utilize limit=100 takes 3-4s(!) 1 request! takes much time. none of users waiting 10-15 mins. can't find way in documentation. ms ios sdk version 3.18, graph api v.2.1.  give thanks much. facebook facebook-graph-api facebook-like

c# - ASP.net WebApi newly registered route says, that request is invalid -

c# - ASP.net WebApi newly registered route says, that request is invalid - i'm setting backend windows phone 8.1 app. i'm using asp.net webapi create restful api accessing info db, set on windows azure. this how routes looks: // web api configuration , services // web api routes config.maphttpattributeroutes(); config.routes.maphttproute( name: "defaultapi", routetemplate: "api/{controller}/{id}", defaults: new { id = routeparameter.optional } ); config.routes.maphttproute( name: "defaultnamedapi", routetemplate: "api/{controller}/{name}", defaults: new { name = routeparameter.optional } ); what i'm trying accomplish accesing info using not integer - want access info using string. code webapi controller: private smokopediacontext db = new smokopediacontext(); // api/images publ

Google Apps Script HTML Service Invalid JSON -

Google Apps Script HTML Service Invalid JSON - i've been trying create google chart web app can shown on google site. there instructions serving web pages here: https://developers.google.com/apps-script/guides/html/ i have followed instructions above letter (i created illustration "code.gs" , "index.html" exact same contents in illustration @ above url. every time deploy script , open link, next error: "error in query: invalid json string." html google-apps-script

ios - NSDateFormatter results different from apple.cn screenshots -

ios - NSDateFormatter results different from apple.cn screenshots - the iphones @ http://apple.com/iphone have 9:41 am in status bar esoteric reasons. i'm trying create localized screenshots app, consulted http://apple.com/cn/iphone, utilize 上午9:41 consistently. however, when set locale zh-hans or zh-hant using -applelanguages flag, nsdateformatter spits out 9:41 上午 . here code i’m using: nsdateformatter *dateformatter = [[nsdateformatter alloc] init]; nsstring *originallocale = dateformatter.locale; dateformatter.locale = [nslocale localewithlocaleidentifier:@"en_us"]; [dateformatter setdateformat:@"h:mm a"]; nsdate *date = [dateformatter datefromstring:@"9:41 am"]; dateformatter.locale = originallocale; nsstring *datestring = [dateformatter stringfromdate:date]; this code produces right format in en_us , wrong 1 in zh-hant . there way localized version of @"h:mm a" , other hardcoding each language? don't set

.net - Runtime errors with User-defined conversion functions accessed via generic methods -

.net - Runtime errors with User-defined conversion functions accessed via generic methods - i trying implement generic function wraps ancient library on c++ side. old code predates templates, , there many functions of form fooint, foodouble, fooobject etc. ideally, function phone call can done single generic function, foo. ran issues trying implement this, , have reproduced issues basic example: ref class bar { public: system::uint32 myint = 0; bar(system::uint32 in){ myint = in; } operator system::uint32() { homecoming myint; } }; generic <typename t> t foo(system::uint32 value) { auto t = %bar(value); homecoming (t) t; } int main() { //=======works======= auto t = %bar(123); system::console::writeline((system::uint32)t); //=======doesn't work :(======= system::console::write(foo<system::uint32>(123)); homecoming 0; } when run, code produce error an unhandled exception of type 'system.invali

PHP inserting image and video into one mysql record -

PHP inserting image and video into one mysql record - i able insert image , video file mysql database, creating 2 records. belief because of "type" field, it's not able create 2 different values same record, created "type" , "type2" thinking solve issue. created same "image/png" value. here form script: <form action="saveimage.php" enctype="multipart/form-data" method="post"> <table style="border-collapse: collapse; font: 12px tahoma;" border="1" cellspacing="5" cellpadding="5"> <tbody> <tr><td>picture:</td><td><input name="rpic" type="file" accept="image/*"></td></tr> <tr><td>video:</td><td><input name="rvideo" type="file" accept="video/*"></td></tr> <tr><td><input name="upload n

node.js - Nodejs Azure storage blob service : getStats not working -

node.js - Nodejs Azure storage blob service : getStats not working - i utilize nodejs 'azure-storage' module (version: 0.3.3) i global stats azure storage blob service. of course, wont query blobs calculate hand total amount of storage used. so think using blobservice.getservicestats help me. method homecoming error. this.blobservice.getservicestats(function(error, result) { if (error) { console.info(error); } else { console.info(result); } }); this result in next error : { [error: value 1 of query parameters specifie requestid:51b156a6-0001-002d-765f-b4ebd5000000 time:2014-10-17t12:40:59.1246311z] code: 'invalidqueryparametervalue', queryparametername: 'comp', queryparametervalue: 'stats', reason: '', statuscode: 400, requestid: '51b156a6-0001-002d-765f-b4ebd5000000' } this query parameter 'comp = stats' seems set sdk : blobservice.js line 156 what's wrong ? think should

sharepoint - the default All Documents view not appearing in 1 library that was deleted by me and added again by add a existing web part -

sharepoint - the default All Documents view not appearing in 1 library that was deleted by me and added again by add a existing web part - i m running sharepoint 2010. lastly day editing document library , unfortunately deleted web part library seek find out in recycle bin doesn't appear there tried add together new web part , selected existing list , selected same library , added view changed , tried documents view available in libraries except 1 , unable add together documents view please help me out. there no alternative add together existing view create new view alternative appearing. sharepoint sharepoint-2010

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? - is there way convert html page styled bootstrap css html email compatible form? see there exclusively different css frameworks, ink, creating email compatible html, there flow creating email doesn't require utilize of different css framework? there html -> pdf -> email html flow? or other flow? no, couple of reasons... first, there no reliable css or html email. clients on place in terms of css back upwards & how render html, structural/semantic problem. isn't converting classes much altering html structure. as explained in this css tricks post, typical solution ol-skool techniques table-based layouts, requiring exclusively restructure existing html. have add together client-specific hacks. second, , more importantly, shouldn't send everything on existing page email. if it's newsletter subscribers, people won't read it. instead, create

Unable to get property 'length' of undefined or null reference in jquery.min.js -

Unable to get property 'length' of undefined or null reference in jquery.min.js - i using arborjs0.92 version.when run ie10 show on unable property 'length' of undefined or null reference in jquery.min.js. how can solve issue. you can utilize if statement. if object null length 0 otherwise length using length property of object. jquery

The fastest algorithm for returning max length of consecutive same value fields of matrix? -

The fastest algorithm for returning max length of consecutive same value fields of matrix? - here given example: we have function takes 1 matrix , it's number of columns , it's number of rows , returns int (this gonna length). example: int function (int** matrix, int n, int m) the question what's fastest algorithm implementing function returns maximum length of consecutive fields same value (doesn't matter if same values in 1 column or in 1 row, in illustration on image it's 5 fields of 1 column value 8)? values can 0-255 (grayscale example). in given illustration function should homecoming 5. if bottleneck , matrix large, first optimization seek create 1 pass on matrix in sequential memory order (row-by-row in c or c++) rather two. because it's expensive traverse 2d array in other direction. cache , paging behavior worst possible. for need row-sized array track number of consecutive values in current run within each column.

css - Bootstrap 3 align button text underneath GlyphIcon -

css - Bootstrap 3 align button text underneath GlyphIcon - i have code creates bootstrap 3 buttons glyphicon , text problem text aligned right of icon. how can align text underneath icon? <div class="btn-group"> <button type="button" class="btn btn-default btn-lg"><span class="glyphicon glyphicon-file"></span>archive</button> <button type="button" class="btn btn-default btn-lg"><span class="glyphicon glyphicon-trash"></span>delete</button> </div> <button type="button" class="btn btn-default btn-lg"><span class="glyphicon glyphicon-share"></span>resend</button> add text-center helper class .btn , , add together <br> after icon, before text. <button type="button" class="btn btn-default btn-lg text-center"><span class="glyphicon glyphicon

sql - Mysql joining three tables getting to a single table -

sql - Mysql joining three tables getting to a single table - i have 3 tables. parent, student, student_parent' parent p_id p_name student s_id s_name student_parent s_id p_id i want form new table reporting functionality, in next format. s_id | s_name | p_name_1 | p_name_2 since 2 records created 1 pupil such mother , father, want both records single table 1 s_id. have table this, p_id | s_id | s_name | p_name 01 | 01 | sam | jack 02 | 01 | sam | jill i want table in next structure. s_id | s_name | p_name_1 | p_name_2 01 | sam | jack | jill i have searched not find proper solution. here curremt sql statement: select s.student_id, s.first_name, s.last_name, c.first_name fsms_student s, fsms_student_parent_guardian b, fsms_parent_guardian c b.student_id = s.student_id , b.parent_guardian_id = c.parent_guardian_id i much obliged if provide me solution. give thanks you. why, have soluti

R release memory by gc in silence -

R release memory by gc in silence - i running r code in ubuntu , want release memory. after remove (rm) variables, phone call gc(). seems works. how can create work in silence(don't study message). tried set "gcinfo(verbose=false)", gc still reports message. thanks > gcinfo(verbose=false) [1] false > gc() used (mb) gc trigger (mb) max used (mb) ncells 256641 13.8 467875 25.0 350000 18.7 vcells 103826620 792.2 287406824 2192.8 560264647 4274.5 the invisible() function useful this. 1 way write little gc() wrapper function of own without arguments returns gc() invisibly. gcquiet <- function(quiet = true, ...) { if(quiet) invisible(gc()) else gc(...) } gcquiet() ## runs gc() invisibly gcquiet(false) # used (mb) gc trigger (mb) max used (mb) # ncells 283808 15.2 531268 28.4 407500 21.8 # vcells 505412 3.9 1031040 7.9 896071 6.9 gcquiet(false, verbose=true) # garbage collecti

Counting That's as two words in c -

Counting That's as two words in c - #include <stdlib.h> #include <ctype.h> #include <stdio.h> int main() { unsigned long c; unsigned long line; unsigned long word; char ch; c = 0; line = 0; word = 0; printf("please come in text:\n"); while((ch = getchar()) != eof) { c ++; if (ch == '\n') { line ++; } if (ch == ' ' || ch == '\n') { word ++; } } printf( "%lu %lu %lu\n", c, word, line ); homecoming 0; } right programme works , counts correctly characters, words, , lines. words that's, programme counts 1 word , want count 2 words. need add together business relationship that? if(ch =='\'' || ch == ' ' || ch == '\n') { word++; } c counting words apostrophe

ruby - Rails console/rake detect in initializer. defined?(Rails::Console) does not working -

ruby - Rails console/rake detect in initializer. defined?(Rails::Console) does not working - i have initializer in rails app don't want started rails console or rake task. i set code initializer: puts "start" if defined?(rails::console) puts "console" elsif file.basename($0) == "rake" puts "rake" end puts "end" when run 'rails console' this: $ rails console start end loading development environment (rails 4.2.0.beta2) [1] pry(main)> but within console: [1] pry(main)> defined?(rails::console) => "constant" however, works rake: $ bundle exec rake routes start rake end why works within console, doesn't in initializer? or there improve way determine console/rake within initializer? ruby-on-rails ruby ruby-on-rails-4 pry

laravel 4.2 pipe basd validation error -

laravel 4.2 pipe basd validation error - getting error on when submit form errorexception (e_unknown) array string conversion below code generate error not validating form $rulesvalida=array( 'txt_name' => 'required|min:3', 'txt_phone_number' => 'required|numeric|min:8', 'txt_street_name' => 'required|min:3', 'txt_house_number' => 'required|min:3', 'txt_floor' => 'required|min:3', 'txt_side' => 'required|min:3', 'txt_post_code' => 'required|min:4', 'txt_post_town' => 'required|min:4', 'txt_country' => 'required', ); homecoming validator::make($data, $rulesvalida, lang::get('validation')); laravel-4 laravel-validation

Will the java process keeps the file open if the Scanner was not closed? -

Will the java process keeps the file open if the Scanner was not closed? - i found out java process throws error: caused by: java.net.socketexception: many open files i understand rectified increasing open file limits in unix, however, want find out why files not beingness closed java process in first place. i checked source-code , found below snippet used read info files. string content = new scanner(new file("../../example/test.txt"), "utf-8").usedelimiter("\\a").next(); i assume here problem scanner not beingness closed after reading? issue? or because scanner object not created, doesn't need closed? i assume here problem scanner not beingness closed after reading? this culprit. scanner can closed implicitly if available garbage collection. however, since impossible predict when garbage collector run, should never rely on this. instead, should explicitly close scanner when finished it. means should follow patte

permissions - Execute icacls in Powershell to grant access to a file share for domain computer -

permissions - Execute icacls in Powershell to grant access to a file share for domain computer - i wonder how uses icacls within powershell script setting permissions on fileshare computeraccount e.g. domain\myserver$ this i'm trying: $computeraccount = "domain\myserver$" $folder = "\\testserver\testshare\folder1" $rule = $computeraccount+':(m),(oi),(ci)' $resicacls = invoke-expression "icacls $folder /grant $rule" got error message: invoke-expression : @ line:1 char:83 + ... ant domain\myserver$:(m),(oi),(ci) + ~~ variable reference not valid. '$' not followed valid variable name character. consider using ${} delimit name. @ c:\binary\testacl.ps1:12 char:26 + $resicacls = invoke-expression "icacls $folder /grant $rule" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo : parsererror: (:) [invoke-expression], parseexception

wordpress - matching only numbers in a regex string for redirect -

wordpress - matching only numbers in a regex string for redirect - i using redirection plugin wordpress advertisement have no experience regex. i have url can have after url, want redirect if numbers appear , nil else, such of next urls lastly 1 match: http://j.net/contact http://j.net/c4t http://j.net/4con http://j.net/4co5 http://j.net/anything/123 * should fail http://j.net/456 * should pass i came this: (\d+)$ to: article/$1 but ended in infinite loop. edit: loop seems come play when navigating to: http://j.net/1289 or: http://j.net/dribble/1289 your solution seems work fine, after escaping / character see example: http://regex101.com/r/cx4bv6/2 ps. i'm not sure language using , whether wordpress back upwards it. regex wordpress

c# - Colletion with derived class parameter -

c# - Colletion with derived class parameter - i have classes , method public class base{ // members;} public class derived : base{// members} mymethod(ienumerable<base> in1); try phone call mymethod : mymethod(ienumerable<derived > in2); and compilation error? how should solve that what you're expecting called covariance. means actual generic type more specific required one. can see covariance not work generic classes: list<derived> should not assignable list<base> , because happen if add together base intances list, list of derived instances? ienumerable covariant , ilist invariant. this concept has been applied collection classes in .net 4.0. when using version of .net < 4, classes invariant. c# inheritance ienumerable

csv - Python new-line character seen in unquoted field -

csv - Python new-line character seen in unquoted field - i have big csv file (~5m) , i'm building social network graph out of it. next error: new-line character seen in unquoted field - need open file in universal-newline mode? i frankly don't understand means. realise there similar questions on site, solutions don't seem work me (at to the lowest degree implementation of these solutions). is there way bypass it? alternatively, think line 1638373 faulty one, maybe it's easier erase line? appreciate it. update: my initial reader: in_file=csv.reader(open('file.csv','rb')) performs analyses (adds nodes , edges) until faulty line (i.e. line 1638373) with dialect: in_file=csv.reader(open('file.csv','rb'), dialect=csv.excel_tab) disregards info in lines, , stops on different line (i.e. 9174) lines in question: 496907337006067712,"2014-08-06 08:35:15","_krantenkoppen",2420112513,"n

NSPopover sample code does not detach window -

NSPopover sample code does not detach window - i have not been able nspopover detach window in own projects, simplify tried apple sample. i downloaded fresh re-create of apple sample project: http://developer.apple.com/library/mac/samplecode/popover/introduction/intro.html it behaves same, can't drag window detach either. the project seems provide right windows , controllers , implements detachablewindowforpopover: delegate method. method never called. does know secret detachable nspopovers? found reply while typing question… mac os x 10.10 yosemite has new delegate method: (bool)popovershoulddetach:(nspopover *)popover the default behavior on yosemite no (should not detach). delegates must implement method in order windows detachable. sample project not implement method, when compiled on yosemite not detach (and produces several deprecation warnings -- maybe should have taken hint needs update). adding: - (bool)popovershoulddetach:(nspopover

windows phone 8 - Append contacts in contact list in WP8 -

windows phone 8 - Append contacts in contact list in WP8 - i want add together more 1 contacts contact list xml file, savecontacttask.show(); added 1 contact contact list, please tell me how resolve issue . this code: private void addcontacts(object sender, routedeventargs e) { using (isolatedstoragefile istf = isolatedstoragefile.getuserstoreforapplication()) { using (isolatedstoragefilestream istfs = istf.openfile("mycontacts.xml",filemode.open)) { xdocument doc = xdocument.load(istfs); var query = d in doc.root.descendants("contacts") select new { firstname = d.element("name").value, mobilephone = d.element("phone").value }; foreach (var po in query) { s

javascript onclick set to variable function name? -

javascript onclick set to variable function name? - is possible utilize javascript set click event variable function name? i want dynamically set each of selected elements functions names declared elsewhere. these functions class methods. don't know if why it's not working. i know funky monkey stuff, it's preferable alternative of using switch, functions have parse through. function name get // lastly part of string var x = strname.split("_"); var y = x[x.length - 1]; this works holder[j].onclick = function(){ini['add']();}; this not, reason holder[j].onclick = function(){ini[y]();}; // checked: y == 'add' in test i found not work. onclick not set function want be, statement ini[y](); as y no longer in scope after setup finish (and if was, there's no saying right y, has different value each iteration), i've had pull out create determine function on fly. using this: holder[j].onclick = functi

NHibernate QueryOver projection on many-to-one -

NHibernate QueryOver projection on many-to-one - i trying queryover working using projection on many-to-one . the class "post" has property many-to-one "creator". using session.queryover(of post). select(projections. property(of post)(function(x) x.creator). withalias(function() postalias.creator)). transformusing(transformers.aliastobean(of post)()). list() works each creator retrieved single query rather using bring together done when not using select/projection. if there 5 posts 5 different creators, 6 queries run 1 list of posts , 5 creators. i tried working using joinalias nil did job. i searched solution, solutions found did utilize linq-provider not fit since actual "field list" passed via parameter. does know if there solution other linq provider? there solution, can utilize projections many-to-one , custom result transformer. disclaimer: can read vb syntax not have plenty courage write... expect can read c

iOS Push UIViewController on slide gesture like Snapchat -

iOS Push UIViewController on slide gesture like Snapchat - i have question ios force navigation controllers. want force view controller on slide gesture. in snapchat application: main view captures images. if slide left right, snapchat messages view smoothly slides (pushes) main window. if slide right left > contacts view. how create kind of navigation? lot! i believe way snapchat through uiviewcontroller containment. essentially, main view controller contains scroll view (paging enabled) 3 kid view controllers (snaps, camera, , contacts). don't utilize navigation controller nowadays , pop view controllers swipe. see documentation on view controller containment: https://developer.apple.com/library/ios/featuredarticles/viewcontrollerpgforiphoneos/creatingcustomcontainerviewcontrollers/creatingcustomcontainerviewcontrollers.html ios uiviewcontroller pushviewcontroller snapchat

javascript - How to get this to work on Google Sites? -

javascript - How to get this to work on Google Sites? - i have html code: <!doctype html> <html> <body> <h1 id="title">general knowledge test</h1> <p> <button type="button" onclick="myfunction()">take test</button> </p> <p id="exp">when click "take test", allowed type onto test.</p> <p id="p1"><b>part 1: fill in blank lines said next quotes</b></p> <p id="q1">1. __ "to be, or not be- question."</p> <p id="q2">2. __ "you have brains in head. have feet in shoes. can steer in direction choose. you're on own, , know know. , guy who'll decide go."</p> <p id="q3">3. __ "if can dream it, can it."</p> <p id="q4">4. __ "no matter people tell you, words , ideas can alter world." <p id="q5">5

javascript - jQuery read all TD's table data -

javascript - jQuery read all TD's table data - with jquery reading table: $('#lc_searchresult > table > tbody > tr').each(function() { var info = $(this).find("td:eq(5)").html(); alert(data); }); it working fine if tr tag has 1 td within like: <tr> <td>654321</td> </tr> but if having 2 td's geting first one: <tr> <td>654321</td> <td>13456</td> </tr> how can of td's tr $(this).find("td:eq(5)").html() $('#lc_searchresult > table > tbody > tr').each(function() { $(this).children('td').each(function(){ var info = $(this).html(); alert(data); }) }); javascript jquery html

c - Using macro in C11 anonymous struct definition -

c - Using macro in C11 anonymous struct definition - the typical c99 way extending stuct like struct base of operations { int x; /* ... */ }; struct derived { struct base of operations base_part; int y; /* ... */ }; then may cast instance of struct derived * struct base of operations * , access x . i want access base of operations elements of struct derived * obj; directly, illustration obj->x , obj->y. c11 provide extended structs, explained here can utilize feature anonymous definitions. how write #define base_body { \ int x; \ } struct base of operations base_body; struct derived { struct base_body; int y; }; then may access base of operations members same it's part of derived without casts or intermediate members. can cast derived pointer base of operations pointer if need do. is acceptable? there pitfalls? there pitfalls. consider: #define base_body { \ double a; \ short b; \ } struc

javascript - Controlling image height in Bootstrap-Lightbox gallery -

javascript - Controlling image height in Bootstrap-Lightbox gallery - i'm working on website of artist, galleries important. i'm using bootstrap website, , lightbox bootstrap plugin galleries. works fine adjusting width of image resolution (i want create responsive possible). but, can observe if click on vertical photo (for example, 1 in sec row, sec column), when opens, it's bigger screen , can't seen without scrolling. so, want rid of problem, adjusting maximum height of image height of screen. can't find way this. ideas doing in simple way? i've uploaded website server can see problem: http://mural.uv.es/ivape2/es/galeria.html thank you. i had similar problem , tinny77's answer thing approached solution. here working snippet of ended class="snippet-code-js lang-js prettyprint-override"> $().ready(function() { $('[data-toggle="lightbox"]').click(function(event) { event.preventdefault();

.net - What is the difference between p.WaitForExit() and p.WaitForExit(Integer.MaxValue) in this specific case? -

.net - What is the difference between p.WaitForExit() and p.WaitForExit(Integer.MaxValue) in this specific case? - basically i'm launching asynchronously process , i'm waiting process exit using task , don't have problems code below, i've found little issue understand... the issue if utilize method process.waitforexit() , seek cancel task (or same, kill process) process never exits sub-thread hangs forever, instead if utilize method process.waitforexit(integer.maxvalue) works perfectlly. why happens that?, difference makes process unable recognize process has exited?. the process instance: ''' <summary> ''' cmd <see cref="system.diagnostics.process"/> instance. ''' </summary> private withevents cmdprocess new process { .enableraisingevents = true, .startinfo = new processstartinfo { .filename = "cmd.exe",

c# - Why PropertyChanged could be null when gets binded? -

c# - Why PropertyChanged could be null when gets binded? - here problem encountering, utilize class names in demo describe problem: i have show on datagrid, view of item . item wrapper class of real info source, dummy . container manager of dummy 's, phone call poll periodically(in demo, 1s) , internally queries remote server decide current value(in demo, flip boolean). , after that, container go through item 's , notify them changes may made. but problem is, if branch in notify called container won't in, since propertychanged null! if alter in datagrid , i.e. dg , double click, event gets subscribed. problem is, how can notify in container ? there way create datagrid subscribe propertychanged time? btw, if utilize debugger in, null too. following demo code: xaml: <window x:class="wpfapplication6.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schem

c# - adding table to wpf application MVS 2010 -

c# - adding table to wpf application MVS 2010 - as saw wpf doesn't sopplie datagridview .. have other alternative ? need creat table show info base of operations . seek datatable no succses. thanks. wpf has datagrids (http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid%28v=vs.110%29.aspx) and listviews (http://msdn.microsoft.com/en-us/library/system.windows.controls.listview%28v=vs.110%29.aspx) c# wpf datagridview

google chrome - Android swipe fragment out of screen -

google chrome - Android swipe fragment out of screen - i quite new android development , know how can realize effect individual fragments can swiped away it's done in android chrome browser's tab overview. need google for? have navigation drawer side-menu , linearlayout main content scrollview inside, multiple little fragments go into. to that, apply gesture detector on view wish swipe. when observe gesture, run animation move view off right or left , create disappear. android google-chrome android-fragments swipe gestures

r - Appending to a text file in a loop -

r - Appending to a text file in a loop - i have info frame called metricsinput looks this: id extractname dimensions metrics first_ind 124 extract1.txt ga:date gs:sessions 1 128 extract1.txt ga:date gs:sessions 0 134 extract1.txt ga:date gs:sessions 0 124 extract2.txt ga:browser ga:users 1 128 extract2.txt ga:browser ga:users 0 134 extract2.txt ga:browser ga:users 0 i'm trying utilize above info frame in loop run series of queries, create 2 text files, extract1.txt , extract2.txt. reason have first_ind field want append column headings on first run through each unique file. here's loop -- issue i'm having info each id not appending -- seem overwriting results, not appending. did go wrong? for(i in seq(from=1, to=nrow(metricsinput), by=1)){ id <- metricsinput[i,1] myresults <- ga$getdata(id,batch = true, start.date="2013-12-01", end.date="2014-01-01", metrics = metricsin

java - Http post get response Android -

java - Http post get response Android - i want retrieve info external web page. when i'm navigating on , click show data, see developer console (under "network") http post phone call been making. if open it, can see info want retrieve android app , want string response. but don't know how "build" http post request. code: httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost("http://portus.puertos.es/portus_rt/portusgwt/rpc"); httppost.addheader("connection", "keep-alive"); httppost.addheader("content-length", "172"); httppost.addheader("x-gwt-module-base", "http://portus.puertos.es/portus_rt/portusgwt/"); httppost.addheader("x-gwt-permutation", "3dede3a69cbbe62d4c3f58bf7278538f"); httppost.addheader("origin", "http://portus.puertos.es"); httppost.addheader("user-agent",

javascript - Checkbox is still showing true when unchecked jQuery -

javascript - Checkbox is still showing true when unchecked jQuery - ok, i'm having issue $.prop('checked') functionality. when unchecking of boxes, , using function read checkboxes, of them still showing true when of them should showing unchecked. part of function checks below, background: i'm using table input values in each td element , due way it's written, i'm having gather info / validate / , check using td.each() function. $("td", ele).each(function(idx){ var before = $('.e_content', this), b_name = $('input:last[type!="hidden"], textarea:last, checkbox:last, select:last', this).attr('name'), b_val = $('input[name="'+b_name+'"], select:last, textarea[name="'+b_name+'"]', this).val(), b_chx = $('input:checkbox[name="'+b_name+'"]', this).prop('checked'),

c# - Get another attribute on the same element by searching another attribute -

c# - Get another attribute on the same element by searching another attribute - this might simplest question appologise. part of xml. want attribute "value" based on attribute "itemoid". ie when itemoid="i_medic_history_indication" value. <formdata formoid="f_neurological_v20" openclinica:version="v2.0" openclinica:status="initial info entry"> <itemgroupdata itemgroupoid="ig_neuro_ungrouped" itemgrouprepeatkey="1" transactiontype="insert"> <itemdata itemoid="i_neuro_neuro_tendonab" value="" /> <itemdata itemoid="i_neuro_neuro_tendon" value="1" /> <itemdata itemoid="i_neuro_neuro_gaitab" value="" /> <itemdata itemoid="i_neuro_neuro_gait" value="1" /> <itemdata itemoid="i_neuro_neuro_coordinateab" value="" /&g

python - what is better approach to do? -

python - what is better approach to do? - i have piece of cake returning none in case exception caught. def getobject(ver): av = none try: av = gettestobject(ver) except exceptions.objectnotfound, err: _log.info("%r not found", obj.fromtestobject(ver)) homecoming av or improve ? def getobject(ver): try: av = gettestobject(ver) except exceptions.objectnotfound, err: _log.info("%r not found", obj.fromtestobject(ver)) else: homecoming av a shorter (more pythonic, imho) equivalent first code snippet follows: def getobject(ver): try: homecoming gettestobject(ver) except exceptions.objectnotfound, err: _log.info("%r not found", obj.fromtestobject(ver)) this works because python functions implicitly homecoming none if command reaches end of function without encountering return (as case if exception caught).

SQL Calculated field selected values -

SQL Calculated field selected values - i have sql view columns idx, date, signal, value have signal1 signal10 want on daily basis computed column calculated follows: compval= signal7*signal8-signal9 other columns retain original values how this? you can create view or add together column view: create view v_view select v.*, (signal7*signal8-signal9) compval first_view v; sql

Solr Suggester only adding first value from multivalued fields to suggest dictionary -

Solr Suggester only adding first value from multivalued fields to suggest dictionary - i'm using solr suggest component homecoming suggestions field stored multivalued. problem: first entry of multivalued field documents added dictionary database. <searchcomponent name="suggest" class="solr.suggestcomponent"> <lst name="suggester"> <str name="name">suggestskill</str> <str name="lookupimpl">org.apache.solr.spelling.suggest.jaspell.jaspelllookupfactory</str> <!-- org.apache.solr.spelling.suggest.fst --> <str name="dictionaryimpl">documentdictionaryfactory</str> <!-- org.apache.solr.spelling.suggest.highfrequencydictionaryfactory --> <str name="field">skills</str> <str name="weightfield">skills</str> <str name="storedir">/usr/share/solr/live/solr/col

mysql - What happens in the following PHP script when several calls come in close together -

mysql - What happens in the following PHP script when several calls come in close together - this going daft question , have googled struggled find clear answer. i have php script on server, actual script insanely simple, sits on top of mysql database. it receives http post messages containing combination of strings , video files. i'm reading info $_post[''] now i'm wondering is: if create phone call server script ran, takes set amount of time. what happens if phone call server made before previous set amount of time completed? understanding script loaded , have 2 running simultaneously. correct? if happens in next example. message 1 comes in data. php script starts running , reads 2 of info bits in message body. message 2 comes in , new php script launched. (so have 2 scripts running, script 1 reading info message 1, , half way though processing data, , script 2 beginning). happens in $_post[''] in first script? g

javascript - Live updater chat script -

javascript - Live updater chat script - so i'm kind of new php, , i'm trying write php live chat web application... stores chat info in mysql database. phone call updatedb() function typed out below every couple seconds refresh chat content shows in div have php code in.(the chat info echoed mysql table in div)... every time calls updatedb() function, if have text input type message focused(selected), blurs , can never type message in, because keeps deselecting it. :( ... have improve codes update content that's in div? appreciate help give... (keep in mind, i'm not pro in php, , don't know much javascript). if need post whole document code, can, if don't know mean... whole thing in php if can, don't know if there's way to. function updatedb() { if (window.xmlhttprequest){ // code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest();}else{ // code ie6, ie5 xmlhttp=new activexobject("microsoft.xmlh

c# - Calling Web API using PostAsJsonAsync -

c# - Calling Web API using PostAsJsonAsync - i newbie trying phone call web api method. i have quadrilateral object: public class quadrilateral { public double sidea { get; private set; } public double sideb { get; private set; } public double sidec { get; private set; } public double sided { get; private set; } public double angleab { get; private set; } public double anglebc { get; private set; } public double anglecd { get; private set; } public double angleda { get; private set; } public virtual string name { { homecoming "generic quadrilateral"; } } public virtual string description { { homecoming "a quadrilateral has no specific name shape"; } } public quadrilateral(double sidea, double sideb, double sidec, double sided, double angleab, double anglebc, double anglecd, double angleda) { sidea = sidea; sideb = sideb; sidec = sidec; sided = side