Posts

Showing posts from March, 2014

git - Heroku fails to build and push Clojure Project -

i'm getting following errors when i'm trying git push heroku master remote: retrieving ring/ring-jetty-adapter/1.4.0/ring-jetty-adapter-1.4.0.jar clojars remote: not transfer artifact clj-http:clj-http:pom:2.1.0 from/to clojars (https://clojars.org/repo/): error occurred while retrieving remote repository repository[clojars|https://clojars.org/repo/]: not in gzip format remote: not transfer artifact clj-json:clj-json:pom:0.5.3 from/to clojars (https://clojars.org/repo/): error occurred while retrieving remote repository repository[clojars|https://clojars.org/repo/]: not in gzip format remote: not transfer artifact clojure-csv:clojure-csv:pom:2.0.2 from/to clojars (https://clojars.org/repo/): error occurred while retrieving remote repository repository[clojars|https://clojars.org/repo/]: not in gzip format remote: not transfer artifact enlive:enlive:pom:1.1.6 from/to clojars (https://clojars.org/repo/): error occurred while retrieving remote repository repository[clojars|...

Using a Position Function in a Case Function - PostgreSQL -

i'm new sql , postgres , isn't hard figure out of you. i'm trying use position function within case statement, keep getting error "error: syntax error @ or near ""project"". line 2: case when position('(' in "project") >0 then". i've used position function before , worked fine, i'm confused problem here. i've tried table name, such "xyztable.project" , "project" - both without quotation marks. here entire statement: select "project", case when postion('(' in "project") >0 substring("project",position('(' in "project")+1,position(')' in "project")-2) case when postion('('in "project") null "project" end "2015budget"; as haven't gotten past second line of statement, if sees prevent statement running correctly, please feel free point out. new s...

Is Visual Studio the same thing as Visual C++ -

this 1 of questions utterly obvious except uninitiated. so, @ risk of losing "geek card" i'm afraid must bite bullet , ask: is visual studio same thing visual c++? need install visual studio express, example in conjunction wit visual c++? visual c++ provide things need (particular respect assembly programming) don't come visual studio express? the question might seem basic not require answer. alas, that's precisely why feel need ask it, can't find answers online. results "assume" user knows answer question, can't seem find explicitly states 2 applications provide precisely same functionality or not. thank time. visual studio refers microsoft's integrated development envrioment , includes support c++, c#, basic, , several other languages. visual-c++ refers c++ specific component of visual-studio. one can install visual-studio (express, or other version), , install only c++ component. installing "visual-c++" c...

php - Get ID of an element from a loop -

Image
example: i posted yesterday feel if unclear on looking for. have loop generates placeholder input text boxes. each own id , name loop id="$row['number'] name="$row['number'] . when click button, want perform update. $sendname = $db->prepare("update table set name = ? number = ?"); since number looped, can't $number=$_post['number'] so think made more clear , simple post, solution? thanks. you can inputs in form jquery $('#submit').click(function () { $("#formid input").each(function(){ var input = $(this); // input element var name = input.attr("name"); // name of input var id = input.attr("id"); // id of input }); }); and store names in array , pass php ajax.

android - How can I set invisible area in ListView? -

Image
listview image hi. i'm using listview in android app. want set listview above image. app user can see left , center area only. , want set component in right area, area must not visible. how can this? here current layout xml code : <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:padding="8dp" > <!-- left area start (visible) --> <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_marginright="5dp" android:layout_weight="1" android:orientation="vertical" > <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" ...

java - Is it possible to specify a default View for all Jersey resource methods? -

here's situation. i've large codebase using jersey 2.17, jackson 2.6.3, , spring 4.2.0. i have quite few models small subset of properties exposed @jsonproperty. rest excluded default. there many jersey resource methods are not using jsonview annotation. enter me. need write new internal api endpoints expose different subset of internal/confidential model properties. i've annotated these "private" properties @jsonproperty , @jsonview(supersecretandinternal.class) . the original, public, properties i've added @jsonview(publicforeveryone.class) annotation. the problem there many many resource method handlers don't use specify jsonview. result properties (publicforeveryone , supersecretandintenal alike) being exposed. edit. adding example code. // pojo - before @jsonautodetect(gettervisibility = none, isgettervisibility = none, fieldvisibility = none) class person { @jsonproperty string name; @jsonproperty string age...

javascript - Calculate value auto into form field using JS -

Image
i have 6 fields editable in yii2 form widget. want once input integer values editable fields calculate "green leaf net weight" automatically based on given input. coding work perfectly. problem if change input value in fields it'll not update the "green leaf net weight" read field. $(document).ready(function(){ var = $('#a'); var b = $('#b'); var c = $('#c'); var d = $('#d'); var e = $('#e'); e.change(function(e){ var result = ((a.val() - b.val()) * c.val())/100; var result2 = ((a.val() - b.val()) * d.val()) / 100; var final = ((a.val() - b.val()) - result - result2) - e.val(); math.round(final); $('#f').val(final); }) }); my form widget coding (updated code) <?php $form = activeform::begin(); ?> <?= $form->field($model, 'gross_weight',[ 'feedbackicon' => [ 'default' => 'shopping-cart', ...

console - marklogic undefined function error xdmp:server-root -

when run script xdmp:server-root(xdmp:server("http-cvsearch-8200")) in marklogic console, got error: xdmp:server-root() function not defined. ml version 8.0-3.2. i tried function , works well. let $config := admin:get-configuration() return admin:appserver-get-root($config,xdmp:server())

c# - Xamarin android development, scroll view 'scrollchange' event when attached to delegate throws runtime error? -

my team working on xamarin android development. in view have scrollview , using 'scrollchange' event of scrollview detect scroll movement , performing required actions. works fine machine. when used same code on machine, getting run-time error follows: unhandled exception: java.lang.classnotfoundexception: mono.android.view.view_onscrollchangelistenerimplementor after spending couple of hours, make few changes code , working fine. earlier using following code attach delegate. scrollview scrollview1 = (scrollview)findviewbyid(resource.id.scrollview1); scrollview1.scrollchange += scrollview1_scrollchange; private void scrollview1_scrollchange(object sender, eventargs e) { scrollview scrollview = sender scrollview; double scrollingspace = scrollview.getchildat(0).height - scrollview.height; if (scrollingspace <= scrollview.scrolly) // touched bottom { // things want ...

python - register django textarea widget in admin -

i want register standard django textarea widget admin. i'm little confused this, because in documentation have modeladmin.formfield_overrides example, don't want override it, want register it. there simple way of doing registration or should override , make custom widget out of it? models.py: from django.db import models django_countries.fields import countryfield import datetime # create models here. class contactform(models.model): first_name = models.charfield(max_length=150) last_name = models.charfield(max_length=150) email = models.emailfield(max_length=250) mobile = models.charfield(max_length=32, blank=true) timestamp = models.datetimefield(default=datetime.datetime.now) birthday = models.datefield(null=true) move_in_date = models.datefield(null=true) move_out_date = models.datefield(null=true) country = countryfield() def __unicode__(self): """todo: docstring __unicode__. :returns: tod...

ios - UITextField textInputView message sent to deallocated instance -

i have crashes occur when tap on uitextfield. have 2 controllers, let's a , b . when show controller b modally in controller a , , tap on uitextfield ok. dismiss controller b , , present again. time when click on uitextfield crash occurs. when enabled nszombie in scheme, there message of crash - -[uitextfield textinputview]: message sent deallocated instance . i have no uitextfielddelegate set on uitextfield. when tried debug instruments -> zombies, there no source code (unavailable) when double click release/retain history line. my scheme's build configuration debug . xcode version 7.2.1. crashes occur on ios 8. ios 9 fine. ps: when try re-symbolicate app, see there 1 missing system frameworks dyld . press locate button , open dsym file of debug app, error occurs message "the specified path didn't locate dsym of selected libraries." update 1: a controller: #import <uikit/uikit.h> @interface : uiviewcontroller @end #import "...

Delete Array from Multidimensional array stored in local storage using javascript -

this multidimentional array: [ {"leads":"akhil","email":"anand@patel.com","phone":"9999-999-999","referance":"byreferance","nameref":"anand","preftime":"afteroon"}, {"leads":"anand","email":"a@a.com","phone":"9998789333","referance":"email","nameref":"aaa","preftime":"afteroon"} ] i want delete array multidimensional array, onclick event of button {"leads":"akhil","email":"anand@patel.com","phone":"9999-999-999","referance":"byreferance","nameref":"anand","preftime":"afteroon"} ,how possible? suppose value obtained localstorage.getitem("contacts"); var value = json.parse(localstorage.getitem(...

event not fire on jquery click event -

event not fire on jquery click event should want call on click event fire. http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-change change - fired when user selects table row or cell in grid. i guess need save event - fired when data item saved ( http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-save ).

PHP: why does my flood prevention script lag? -

thank reading. i have input field sends contents in xmlhttprequest php script. script queries database post data field , returns results. because xmlhttprequest invoked using onkeyup, typing in lengthy value sends several calls in short period. combat wrote code creates timestamp, loads session, sleeps, rechecks timestamp. if timestamp has increased, means subsequent call made , script should abort. otherwise script executes. here code. $micro = microtime(true); $_session['micro'] = $micro; usleep(500000); // half second if ($micro < floatval($_session['micro'])) { // later call has been made, abort echo 'abort'; exit; } else { // okay execute } the code appears work expected @ first. if add or remove character or 2 input field result appears quickly. however if type 12 characters fast can there large delay, 2 or 3 seconds long. i working on localhost, there no connection issues. query small, grabbing 1 column containing single...

c# - Getting the index of a ComboBox in in a DataGridView -

i have system.windows.forms.datagridview in 1 column has comboboxes. when changes in combobox, need know new item is, , row index of combobox in event took place. latter giving me trouble. have following: class myform : form { private system.windows.forms.datagridview m_gridview; private system.windows.forms.datagridviewcomboboxcolumn m_comboboxcolumn; public myform () { /* ... lots of initialisation stuf...*/ this.m_gridview.columns.addrange(new system.windows.forms.datagridviewcolumn[] { this.m_comboboxcolumn}); } private void m_gridview_editingcontrolshowing(object sender, datagridvieweditingcontrolshowingeventargs e) { combobox combobox = e.control combobox; if (combobox != null) { combobox.selectedindexchanged -= new eventhandler(m_comboboxcolumn_selectedindexchanged); combobox.selectedindexchanged += new eventhandler(m_comboboxcolumn_selectedind...

twitter bootstrap - Resizing Problems of Thumbnail Caption -

i have problem resizing of thumbnail captions in line 3 want "2012" aligned left , "1.preis" aligned right. first thing don't understand seems have 10 columns work with. when try use col-md-offset-10 "1.preis" jumps next line. here bootply code example. http://bootply.com/82887 can see when try resize window (before goes tablet size mode) "1.preis" leave thumbnail border. <div class="row"> <div class="col-md-3"> <div class="thumbnail"> <img src="http://lorempixel.com/400/300/"> <div class="caption"> <p>wohnprojekt eggenberger gürtel</p> <p>graz-gries</p> <div class="row"> <div class="col-md-1"><p>2012</p></div> <div cla...

visual studio - Is there a performance impact by turning on LARGEADDRESSAWARE? -

i keen know how /largeaddressaware switch works , cannot find implementation details. can describe happening when switch used , consequences (aside allowing process access more memory)? i have run simple benchmark using slam++ library on venice , sphere , 100k datasets: dataset | time x86 | time x86 /largeaddressaware | time x64 venice | bad_alloc | 4276.524971 | 300.315826 sec sphere | 2.946498 | 3.605073 | 1.727466 sec 100k | 46.402400 | 50.196711 | 32.774384 sec all times in seconds. there have - performance toll can substantial . doing blas operations, accelerated using sse, , whole thing quite memory bound. note peak memory usage on venice in x86 on 3.5 gb (i believe can 4 gb in x64 system), in x64 bit under 4.3 gb. other datasets use less memory, below 2 gb. in case of x86 /largeaddressaware on venice , t seemed os wants keep of >2 gb in paging file, although memory usage jumped >3...

ms access - Date function in SQL? -

i'm using access database , need write sql queries display information. can't figure out how display need. in english, need query display description expiration date when expiration date less thirty days current date. my knowledge of sql limited. if point me specific resources helpful. in advance. here have: select description, [expiration date] hardware [expiration date] = "(get date()"; you can use functions now() , date() current date. to add days date, use dateadd function. where dateadd(d, 30, [expiration date]) >= date()

Grails 2.3.0 view rendering issue -

i having strange issue grails application. seems it's caching views incorrectly. happening, first time hit path specific action (let's /controller/index ) load correct index view controller. now, when go /anothercontroller/index , correct controller called, still tried serve old index gsp, resulting in obvious *notfound exceptions. this happens views. first 1 get's loaded gets displayed subsequent actions same name. i.e. first show get's called correct, other show domain object tries use old one. any suggestions? code pretty stock standard generate-all versions @ moment. i should say, running in dev mode works 100%. prod war in tomcat 7.0.42 giving issues. i had weird issue few weeks ago, caching information database , not returning correct results. here did: stopped tomcat deleted files in tomcat's temp directory restarted tomcat after that, worked fine. let me know if helps.

javascript - Blog comments that update upon submitting -

i'm going try , clear possible. have code not sure how clone comments , insert new comments inputted text user piece of code. <!doctype html> <!-- comment, above indicates formal document type (like file extension does, part of document) --> <html> <head> <!-- head section things aren't visible on page, title --> <title>da blog</title> <!-- we'll put lots more in here later --> <link rel="stylesheet" type="text/css" href="jquery.css" /> <script src="jquery.js"></script> <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"> </head> <body> <!-- body visible stuff goes --> <br/><br/><br/> <hr> <h1>my uber fake blog</h1> <hr> <p> wall of text uber fake blog!!!! wall of text uber fake blog!!!! wall of ...

route me - IOS: what type of project to take? ARC or NOT ARC -

in app i'm using project route me map , project don't use arc; @ same time should use mkstorekit , version @ 4.0 implement arc model; in situation should do? best solution have in head find old version of mkstorekit. have other solution? thanks don't ever use mrc (non-arc) unless absolutely necessary. xcode great @ converting mrc code arc code (edit->refactor->convert objective-c arc...), use , you'll fine.

Page in WPF losing focus -

i have page in wpf has text box. text box set focused on load. there application running in background takes string value of biometrics scan result , places in text box. 3rd party application, , have been told looks text box name, in application name , if text box focused on, write string in. this works fine, below problem having. we have piece of software custom on screen keyboard. text box can written user can click button bring keyboard start typing. when keyboard comes up, seems lose focus application , doesnt come again. lifecycle of our application running, biometrics doesn't work because doesn't see application 1 in focus. how force application come in focus, when want to. don't want in focus , on top, else custom keyboard never show. i looked application.activated event no joy, , tried following public static extern bool setforegroundwindow(intptr hwnd); getting stuck, have advice? have tried activate() , focus() methods? thread has bunch ...

visual studio - "Always Copy" solution content (DLLs) to executable directory root -

Image
by way of background, i'm trying 1 of emgu cv examples working. motion detection example mentioned in the answer "looking function motion detection on emgucv" to example code working need add references emgu cv dlls project , make sure relevant open cv dlls copied output executable directory of project build. relevant dlls listed on emgu wiki . i'm adding open cv dlls adding them content example project , marking them "copy always" in content properties: i not want these cluttering root level of project have added project folder put these dlls in: however when build project dlls copied same directory hierarchy, i.e. have enclosing folder within execution directory not want: what properties need set ensure dlls copied execution directory root rather in sub directory? ========== edit ========== note cannot add these dlls references project neither .net assemblies nor com components open cv c++ libraries. our group keeps files ...

php - Need some help iterating over this two arrays -

i have 2 arrays: $arr1['product_detail'] = array( "26" => array("blue", "green"), "28" => array("s") ); $arr2['variation'] = array( "pupc" => array("123456", "654321"), "pprice" => array(1, 2), "pqty" => array(10, 11) ); i need build new array containing values based on position, less said: $arr3 = array( array("blue", "s", "123456", 1, 10), array("green", "s", "654321", 2, 11) ); if notice mix position of both original arrays. think in like: foreach ($arr2 $key => $value) { foreach ($value $key1 => $value1) { foreach ($value1 $key2 => $value2) { foreach ($arr1 $key3 => $value3) { echo $key3; } } } } but it's ugly , think better ways this, help? it idea use function ...

Create multi-row tables in PHP using MySQL -

Image
i'm trying create following: but current code has given me: the part in white code below, , part in black when add in 2 more <td> rows. problem can't 3 pieces of data per row created - vertically or horizontally. $result = mysqli_query($con,"select * show_listing"); while($row = mysqli_fetch_array($result)) { echo "<table> <tr> <td>".$row['name']."'</td> </tr> </table>"; } mysqli_close($con); it may simpler think know how this? $c = 0; echo "<table>"; while($row = mysqli_fetch_array($result)) { if ($c%3 == 0) { if ($c) echo "</tr>"; echo "<tr>"; } echo "<td>".$row['name']."</td>"; $c++; } if ($c) echo "</tr>"; echo "</table>";

java - How can I sort variable values, and then print them in order, largest to smallest? -

i sort list of variables, largest smallest, , print out names of variables. have tried arrays, when printing array out, prints out value of variables, not names. printing out variable names lies somewhere between extremely tricky (on order of hunting through .class files , hoping best) , downright impossible . if you, i'd use map instead, can map variable values "names" in code, , can sort keys , print values in order. the problems accessing variable names outlined in answers question linked, basic issue this: if have object no name defined it? if there's more 1 name single object?

osx - How correctly drag and drop GIF from Safari to our app -

i need correctly parse gif file dropped safari. @ chrome or opera quite easy : -(bool)performdragoperation:(id<nsdragginginfo>)sender { if ([types containsobject:@"corepasteboardflavortype 0x75726c20"]) // gif format { nsdata* gifdata = [pb datafortype:@"corepasteboardflavortype 0x75726c20"]; nsstring* somename = [self _sanitizefilenamestring:[[nsurl urlfrompasteboard:pb] absolutestring]]; nsstring* tempstr = [[mssettingsmanager instance] tmpdir]; nsstring* randomfilepath = [nsstring stringwithformat:@"%@/%ld%ld%ld.gif",tempstr,random(),random(),random()]; if (somename) randomfilepath = [nsstring stringwithformat:@"%@/%@ - %d.gif",tempstr,somename,rand()]; [gifdata writetofile:randomfilepath atomically:yes]; } } at safari, incoming types in pasteboard corrupts gif file. nsfilespromisepboardtype - gives me nothing too. if ([[pb types] containsobject:ns...

jsf 2 - Does AOP with AspectJ works with method from Managed Bean called from the view in JSF2? -

i’m facing problem using combination of jsf 2 , aop aspectj annotation. don't know if spring aop playing role here...(i didn't understand difference between spring aop, aspectj, google guice...that's question) i'm trying send e-mail after added values in database via click on form in jsf view. have managedbean addpartipant handled jsf (linked view) add participant via form. want intercept method makes change in database , send email after action. have spring bean sendmailboimpl method send email.(sending works ok) i found using aop way. it's works when trying make works in main...not in complete webapp. read stuffs problem context spring / jsf don't found solution...yet... i know method add data in database via view ok...but mail never sent whereas database modified. somebody has idea ? thanks lot :) addparticipant managedbean : public class addparticipant implements serializable{ //di via spring participantbo participantbo; ...

logging - Combining URI and Refer cobinations from Apache with pig -

i start stating sysadmin trade , pig newbie, please gentle. i attempting use pig parse apache web logs our cdn. 1 application, have 3 distinct call types can gathered uri , 3 different app/version strings (caused inconsistency in app development). need gather them , produce 1 report detailing number of each type of call each app/version. the call types contain on of following: valid, wms, tile app name in useragent field can following: app%20name/0.0 cfnetwork/609.1.4 darwin/13.0.0" android app name 0.0.0 (sch-i605 - android 4.1.2, sdk xx) app name 0.0.0 (iphone os 6.1.3 - iphone, xxx.xx.xxx.xx.xxxx, xxxxxxxx 0.0)" this had working before discovered inconsistency of useragent naming. hack @ best, producing needed. any appreciated. register file:/home/hadoop/lib/pig/piggybank.jar define logloader org.apache.pig.piggybank.storage.apachelog.combinedlogloader(); define dayextractor org.apache.pig.piggybank.evaluation.util.apachelogparser.dateextract...

Java - How to add text in JTextPane using Document -

i want make console(jtextpane) in java application show application doing. had tried lot of times using different method failed...here part of code. mainclass private final form form; println("downloading files..."); public void println(string line) { system.out.println(line); form.getconsole().print(line); } form(gui) private tabconsole console; tabbedpane.addtab("console", console); public tabconsole getconsole() { return console; } tabconsole public void print(final string line) { if (!swingutilities.iseventdispatchthread()) { swingutilities.invokelater(new runnable() { public void run() { tabconsole.this.print(line); } }); return; } document document = this.console.getdocument(); jscrollbar scrollbar = getverticalscrollbar(); boolean shouldscroll = false; if (getviewport().getview() == this.co...

hibernate - Attribute "name" must be declared for element type "mapping" -

i'm getting error: caused by: org.xml.sax.saxparseexception; linenumber: 35; columnnumber: 44; attribute "name" must declared element type "mapping". problem line <mapping name="org.one.dto.userdetails" /> why doesn't find name attribute below hibernate.cfg.xml file content: <?xml version='1.0' encoding='utf-8'?> <!doctype hibernate-configuration public "-//hibernate/hibernate configuration dtd 3.0//en" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- database connection settings --> <property name="connection.driver_class">org.postgresql.driver</property> <property name="connection.url">jdbc:postgresql://localhost:5433/hibernatedb </property> <property name="connection.username"></...

excel - Requesting Special Macro - Replacing constants and formulas -

this might sound dumb, please excuse me that. can me out. situation: have worksheet (not whole workbook) contains constants (assumption values, manually fed in sheet) , formulas (again assumption values, not constants). these assumption values accessed 1000's of cells in whole workbook. problem: other people in other departments, forcibly have open huge excel file add assumptions in, , pcs slow that. goal: goal can take out assumption tab out of huge excel sheet , make separate excel sheet, people other departments can update separate file , own huge excel file pull data in , let other tabs in huge excel file use these user inputted values. what trying is, trying write special macro: 1) searches constants in worksheet (not book), searches dependent cells in whole workbook, , replaces formulas in dependent tabs, refer new assumption sheet want take out of huge excel file. also, dependent cells have formulas refer fixed cell within assumption sheet. formula them ......

php - Magento static blocks disappear on homepage when query parameters present -

i'm quite new magento , i'm trying understand what's happeing static blocks on homepage of 1 of our clients ( http://www.coveops.com ). when query parameters passed (like ?utm_source...), static blocks disappears. see http://www.coveops.com/?asdf vs http://www.coveops.com/ in between slider , bottom tripplet gone. there many things causing this. first step figure out how content being rendered. log in magento admin backend go system->configuration scroll bottom , click advanced->developer in dropdown menu on top-left, select store view loading on homepage expand "debug" section, uncheck "use website", , set "profiler", "template path hints", , "add block names hints" yes now when reload http://www.coveops.com (or dev server instead), should see red highlight around each block displaying information on how block rendered. one piece of information path template file being rendered, example: ...

mysql - PHP Session doesn't work in my edited script -

just edited php sliding jquery panel form , doesn't work, registration works login doesn't. erased code doesn't matter in problem... please ignore these error messages in strange language. <?php error_reporting(0); define('include_check',true); require_once($_server['document_root'] . '/config.php'); session_start(); session_name('avalogin'); session_set_cookie_params(2*7*24*60*60); if($_session['id'] && !isset($_cookie['avaremember']) && !$_session['rememberme']) { $_session = array(); session_destroy(); } if(isset($_get['logoff'])) { $_session = array(); session_destroy(); echo('<script type="text/javascript">window.location = "' . $site_url .'"</script>'); exit; } if($_post['submit']=='zaloguj') { // checking whether login form has been submitted $err = array(); // hold our errors if(!$_post['usernam...

Javascript closure with new and this -

i playing new, this, , javascript , ran across , have no idea why javascript behaves way. wrapping head around great. lets have function: function x() { this.q = function() { console.log(this); }; console.log(this); } this works expect: var x = new x(); => x {q: function} x.q(); => x {q: function} but not act expect: function func(f) { f(); } var x = new x(); => x {q: function} func(x.q); => window {top: window, window: window, location: location, external: object, chrome: object…} // expected return "x {q: function}" // works... func(function() {x.q()}); => x {q: function} i seem misunderstanding javascript because way behaves in case nothing how expect to. because context ( this ) of function set how call it in javascript not where declared other languages. so when call function f() there no context defaults window when call x.q() context x instance. if called function like: obj.somethin...

javascript - Possible requirejs waitSeconds per filepath? -

is possible set waitseconds per filepath? i'd set low cdn requests fallbacks load local file disk. helpful not slow if cdn having trouble or latency cdn high. should allow setup more reliable when using cdns. according jburke, creator of requirejs, not possible , not added: this not possible today, no plans add it. closing, feel free continue discussion here.

php - Database update fails when file was uploaded -

i have script user can attach file record. file stored separately (not in database). when user not attach file , click on "save record" works fine. when user attaches file next steps: file uploads correct script takes db record details using idiorm script updates field "filesize" on record (i tested script without step - same result) script tries save record, , this: pdoexception code: hy000 message: sqlstate[hy000]: general error: 2006 mysql server has gone away file: /home/../includes/idiorm.php line: 1675 how can solved? update: i found out 2 things: script returns "general error: 2006 mysql server has gone away" when uploaded file bigger 20 mb , try update database idiorm_record->save(). script not return "general error: 2006 mysql server has gone away" when uploaded file bigger 20 mb , not try update database. i can upload file bigger 20 mb , run query generated idiorm_record->save() idiorm::raw_exec() , cat...

oracle - Type inacurracy -

i'm trying create entity data model using visual studio 2012 , oracle 10g. i'm getting error: error 1 running transformation: types of properties in dependent role of referential constraint must same corresponding property types in principal role. type of property 'quartal_sec_id' on entity 'model.quartal' not match type of property 'sec_id' on entity 'model.sec' in referential constraint 'fk_quartal_sec_id'. indeed sec_id has number(32) , quartal_sec_id - number(10) in database. can't change there. have changed both types in mapping details in vs12 int32 . doesn't help. possible solve problem in vs12? can force accept different values in foreign keys? i can't map number(10) (ora) decimal(vs) cause additional err: error 2 error 2019: member mapping specified not valid. type 'edm.decimal[nullable=false,defaultvalue=,precision=,scale=]' of member 'quartal_sec_id' in typ...

vba - Access crashed when I set a subform recordset to an ADODB recordset -

so i'm working on proof of concept app going search ad phonebook. can details selected user , can populate combo box users pulled active directory. when created form , added subform display results of ldap query, access goes kaboom! below code i'm using , i'll upload access file , post link... dim objroot variant set objroot = getobject("ldap://rootdse") dim ldapdomainname string ldapdomainname = objroot.get("defaultnamingcontext") dim cn variant set cn = createobject("adodb.connection") cn.open "provider=adsdsoobject;" dim cmd variant set cmd = createobject("adodb.command") cmd.activeconnection = cn dim rs variant 'adodb.recordset set rs = createobject("adodb.recordset") dim selectedfields string selectedfields = "employeeid, displayname, mail, telephonenumber, mobile" dim whereclause string whereclause = " objectcategory='user' , mail = '*@*'" if not isnull(for...

embedded - Chip to chip communication protocol over SPI -

i'm trying design efficient communication protocol between micro-controller on 1 side , arm processor on multi-core ti chip on other side through spi. the requirements needed protocol: 1 - multi-session queuing support, have multiple sending/receiving threads, more 1 application using communication protocol , need protocol handle queuing these requests (i keep holding buffer if transmission queue need protocol manage scheduling queues). 2 - works on spi underlying protocol. 3 - simple error checking. in thread: " simple serial point-to-point communication protocol ", ppp recommended option, see ppp part of job. i found light weight ip (lwip) project featuring ppp on serial (which assume can use on spi), thought possibility of utilizing of upper layers protocols tcp/udp rest of required jobs. fortunately, found ti including lwip part of ethernet sw in starterware package, assume ease porting @ least on ti chip side. so, questions are: 1 - valid use lwip...