Posts

Showing posts from May, 2010

ios - How to overlay two images in ios6 with transparency -

Image
i trying overlay 2 images , put text on top in view have. have working in ios7. here screen shot of results right gradient image on top of other image seen here in layout this works great except when test on phone ios6. goes nuts seen here. *i've deleted gradient layer , ran app again , background image remains same size (about half of should be). as can see, background image half of should be, , second image not overlaying. i've been @ 5 hours , can't seem find solution works. here code sets background image -(void) setdetails { if(_curinfo) { _lbltopname.text = _curinfo.company_name; if(!_curinfo.img) { showactivity(self); dispatch_queue_t aqueue1 = dispatch_get_global_queue(dispatch_queue_priority_default, 0); dispatch_async(aqueue1, ^{ _curinfo.img = getimagefromurl([nsstring stringwithformat:@"%@%@", g_serverurl, _curinfo.imgpath]); dispatch_async(dispatch_get_main_queue(), ^{

How can I programatically determine my Active Directory domain using just my User Principal Name in C? -

my current c program authenticates across multiple active directory domains using samaccountname/domain. uses config file map domain correct vip (virtual ip) server bind , query to. modifying use userprincipalname, email address. domain portion of userprincipalname not same domain maps vip servers. using account, able bind 1 of vip servers, since not active directory member on server, unable query. right now, have iterate through each server until find 1 member of. not ideal approach. my question is, there way retrieve active directory domain member of using userprincipalname? have read there may way achieve accessing global catalog. correct approach, , if how done using openldap ldap api? if isn't correct approach, there way query first vip server i'm bound to ask active directory domain is? any appreciated. you can use system.secutiry principal , name returned in domain\usename format first bit being domain , dont need go ad mystring= system.secu

html5 - failed: Invalid UTF-8 sequence in header value, Tomcat server8 -

i using tomcat 8.0 server websocket application. when try establish connection ws = new websocket(.....); throws following error: failed: invalid utf-8 sequence in header value anybody has come around or knows how fix ?? ps using eclipse platform , chrome 33.0+ <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>face detection</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> </head> <body> <div> <video id="live" width="320" height="240" autoplay="autoplay" style="display: inline;"></video> <canvas width="320" id="canvas" height="240" style="display: inline;"></canvas> </div> <div> <img id="target" style="

android - When click status bar Notification (Phonegap PushPlugin) The application is launched but does not detect coldstart state -

i developing android application in eclipse , have installed phonegap pushplugin, works perfectly, notifications received , launched in status bar , open application when touched. the problem comes when application off (meaning coldstate) , application launched not run action inside "if ( e.coldstart )" i wrote code based on following example published in official documentation of plugin: function onnotificationgcm(e) { $("#app-status-ul").append('<li>event -> received:' + e.event + '</li>'); switch (e.event) { case 'registered': if (e.regid.length > 0) { $("#app-status-ul").append('<li>registered -> regid:' + e.regid + "</li>"); // gcm push server needs know regid before can push device // here might want send regid later use. console.log("regid = " + e.regid); } break; case

java - How to delete elements from an array? -

how delete integer @ given index , how compress myints ? this got keep getting error. public void deleteint(int index) { int[] newints = arrays.copyof(myints, myints.length); if (myints[index] != 0) { myints[index] = 0; (int : myints) { if (myints[i] != 0) { newints[i] = myints[i]; } } } myints = newints; currentint++; } this error get: exception in thread "main" java.lang.arrayindexoutofboundsexception: 11 this code doesn't use enhanced loop properly: (int : myints) { if (myints[i] != 0) { newints[i] = myints[i]; } } it tries read element myints, content of element, not index. so, element contains value > array's length the outofbounds exception. public void deleteint(int index) { // can 1 element shorter going erase 1 element // also, copying contents of original array in waste of time // create it

Wordpress Inner Pages throw 404 on Laravel Site -

i installed wordpress on laravel site , everythign working fine on laravel pages,wp dashboard , wp home page except on wp inner pages giving me 404 error. i installed wordpress inside laravel directory called public/blogs. here's htaccess on public/ <ifmodule mod_rewrite.c> <ifmodule mod_negotiation.c> options -multiviews </ifmodule> rewriteengine on # redirect trailing slashes... rewriterule ^(.*)/$ /$1 [l,r=301] # handle front controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l] </ifmodule> and here's htaccess on public/blogs wp installation # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase /blogs/ rewritecond %{request_filename} -f [or] rewritecond %{request_filename} -d rewriterule ^.*$ - [s=35] </ifmodule> # end wordpress and have code filters 404 page on laravel filer file. appreciated. thank you

Elasticsearch case-insensitive query_string query with wildcards -

in es mapping have 'uri' field set not_analysed , i'm not allowed change mapping.i wanted search uri parts query_string query (this es query autogenerated, why bit complicated let's focus on query_string part) { "sort": [{"updated": {"order": "desc"}}], "query": { "bool": { "must":[{ "query_string": { "query":"*w3\\.org\\/2014\\/01\\/a*", "lowercase_expanded_terms": true, "default_field": "uri" } }], "minimum_number_should_match": 1 } }, "size": 50} now working, i've following url stored (fictional url): http://w3.org/2014/01/abc.html , query not bring because of a-a difference. setting expanded terms false not solves this. should query case insensitive? thanks in advance. from docs, seems need new analyzer

php - mysql alter table order by not working -

i have searched on net lot. understand thing has been faced many people before me , has been filed mysql bugs. couldn't find solution this. problem can't command working- alter table areas order area_name; i warning - order ignored there user-defined clustered index in table 'areas' i want sort table on basis of ' area_name ', is, names of areas. add, trying in database of laravel app . if db engine innodb , can't this. from doc: order not make sense innodb tables because innodb orders table rows according clustered index.

php - Update item inside a mongodb object -

i'm trying save() record inside object. problem mongocursor()-errors or unexpected 'array' (t_array) . instance: this mongodb-collection: [ { "id": "dfk15ale12", "keys": { "gcm_key": "abc", "app_secret": "123" } } ] i want update gcm_key inside keys , php code: $db->apps->save( array("_id" => $update['_id']) array("$push" => 'keys.gcm_android' => $gcm_android); ); this gives me following error: parse error: syntax error, unexpected 'array' (t_array) in c:\xampp\htdocs\api\update.php on line 3 i have googled , looked here on stack find answers, , i've found nothing. maybe i've missed something. don't know, correct mongodb cursor , easiest way save() gcm_key ? the operation seem want update $db->apps->update( array('_id' => $update['_id'])

android - "adb devices" command returns no devices -

i getting started in android development, , trying eclipse (running on windows 7) recognise phone can use debugging. however, phone not seem recongised eclipse or running "adb devices" command line. here's i've tried: i've tried both mtp (media device) , ptp (camera) transfer modes (similar questions on stack overflow have been resolved using ptp). i've ensured usb debugging turned on in phone's settings. i've manually installed driver in device manager, choosing "update driver software" , selecting .inf file in sdk\extras\google\usb_driver (which had modify hand include device). i've tried nexus 4 phone, nexus 7 tablet, , motorola moto g phone. behaviour identical 3 devices. i've tried "universal adb driver", in case behaves differently google driver, doesn't behave differently. i've rebooted, i've reinstalled drivers, i've tried adb kill-server followed adb start-server, etc. no matter comb

magento - Add a product to the cart with custom option file or image -

already try following code, stuck when try add option type of file $product = mage::getmodel('catalog/product')->load(611); $cart = mage::getmodel('checkout/cart'); $cart->init(); //the file stored in http://domain/img1.png $image= 'img1.png'; $params = array( 'product' => $product->getid(), // $product->getid() 'qty' => 1, 'options' => array( 2 => "text field here", 1 => array( 'quote_path' => mage::getbasedir() . $image, 'secret_key' => substr(md5(file_get_contents(mage::getbasedir() . $image)), 0, 20) ), ), 'options_1_file_action'=>'save_new', ); try { $cart->addproduct($product, new varien_object($params)); mage::getsingleton('checkout/session')->setcartwasupdated(true); $cart->save(); echo 'success'; } catch (exception $ex)

android - Prevent views from overflowing -

i have radiogroup 8 radiobutton s , horizontal orientation. screen can accommodate 7 radiobutton s without congestion. 8th radiobutton , half of displayed. how make appear in next line instead? create custom radio button using selector. widthofbutton = screenwidth/noofradiobutton visit link how can set width of radio buttons change regards screen size? (android) hopefully problem short out.

php - WAMP setup to send mails locally -

i want script able send emails wamp mail services such yahoo,gmail etc.i heard gmail has smtp that, dont know how setup wamp that.below files html sample code file : http://pastebin.com/e50wt0u0 sendmail.php: http://pastebin.com/8itga04y you can send mail localhost sendmail package , sendmail package provided xampp default. if using xampp can send mail localhost. for example can configure c:\xampp\php\php.ini , c:\xampp\sendmail\sendmail.ini gmail send mail. in c:\xampp\php\php.ini find extension=php_openssl.dll , remove semicolon beginning of line make ssl working gmail localhost. in php.ini file find [mail function] , change smtp=smtp.gmail.com smtp_port=587 sendmail_from = my-gmail-id@gmail.com sendmail_path = "\"c:\xampp\sendmail\sendmail.exe\" -t" now open c:\xampp\sendmail\sendmail.ini. replace existing code in sendmail.ini following code [sendmail] smtp_server=smtp.gmail.com smtp_port=587 error_logfile=error.log debug_logfile=de

php - How to load assets from a folder other than the web default folder? -

Image
this architecture folders : i load picture using asset() in twig template located in sites/sf2.local/views/index.html.twig and picture in sites/sf2.local/assets/img/logo_om.gif so in config.yml have added line : assetic: read_from: %kernel.root_dir%/../sites/sf2.local/assets/ but doesn't work, can't load picture using : <img src="{{ asset('img/logo_om.gif') }}" alt="img" /> in twig template.. how can ? first, think have mistaken assets assetic . twig function asset nothing more making assets absolute. not affect assets read from. described in docs: linking assets on other hand, assetic describes compiled (and optionally filtered, merged, uglified, etc...) resources read from. applies js , css . possible solution: open terminal, navigate web symlink directory: cd /.../sf2/web ln -s ../sites/sf2.local/assets/img ln -s ../sites/sf2.local/assets/js ln -s ../sites/sf2.local/assets/css no

c# - Showing 0 as index for output -

in following, shows 0 index values.format of output must like: 2352:0.45678 9878:0.23423 .......... but after running, result like: 0:0.45678 0:0.23423 ......... after showing above result runs again , shows 0:0 0:0 var results = new list<float>(1143600); (int z = 0; z < 1143600; z++) { results.add(dotproduct(useridseq, z));//for multiply 2 vectors } var sb1 = new stringbuilder(); foreach (var resultwithindex in results.select((r, index) => new { result = r, index = index }).orderbydescending(r => r.result).take(n)) { int indexx = resultwithindex.index; (int yyyy = 0; yyyy <itemori.length; yyyy++) { lineitemori5 = fileitemori.readline(); if (!string.isnullorempty(lineitemori5))

datetime - Should I Calculate Time Values or Declare Them At The Start of My Code? -

tl;dr: whats better? cookie_expires = time()+( (60*60*24)*31 ) vs. cookie_expires = seconds_month to save time , typing, years have been declaring useful time values @ start of apps. seconds_hour = 3600 seconds_day = 86400 seconds_week = 604800 seconds_month = 2678400 seconds_year = 31557600 i wondering gurus here think. should not waste effort , calculate needed? in opinion readability goes first: "one_week_in_seconds" way better 60*60*24*7!

javascript - Website is really slow and not sure what is slowing it down -

my site: http://www.acuity-sports.com/ after abut 20-30 seconds after page loads of mouseovers start lag bad. i've been trying kill think overkill of js. server causing or code? any advice helpful. you can't expect site fast when loading on 40 stylesheets , jqueries. i'm surprised not conflicting each other. not mention must have million css elements running duplicated. i senior developer pennsylvania state welfare website, government website , run off 2 css declarations (minified) , maybe 6 css files in root directory. you have shrink man. don't need that. once load theme gaining lot of unnecessary code, start adding many widgets can making worse. big no-no. if wan add something, build small possible , add solution. not become developer in time, site run needed code. good luck

javascript - two set interval function in single PHP file is not working -

function updatechatajax1() { var ajaxrequest; // variable makes ajax possible! ajaxrequest = new xmlhttprequest(); // create function receive data sent server ajaxrequest.onreadystatechange = function(){ if(ajaxrequest.readystate == 4){ //the response document.getelementbyid('content1').innerhtml = ajaxrequest.responsetext; } } ajaxrequest.open("get", "open_ajax.php?mode=ref", true); ajaxrequest.send(null); } $(function(){ setinterval(function () { updatechatajax1(); // javascript function request ajax file. }, 2000); }); $(function(){ setinterval(function () { updatechatajax(); // javascript function request ajax file. }, 2000); }); when page loaded both functions updatechatajax() , updatechatajax1() working together. want call 1 function @ time of time interval. when loading execute both operations together. updatechatajax();

C++ program runs in linux but not windows -

i writing program college , keep having problems it. wrote in using codeblocks in ubuntu , runs fine no errors or anything. when run in windows on codeblocks crashes , keep getting same error "terminate called after throwing instance of 'std::bad_alloc' what<>: std::badalloc' stops working. appreciated! thankyou ron main.cpp #include <iostream> #include "set.h" using namespace std; int main() { set set1; list list1; list1.header(); int choice = 0; int value = 0; cout<<"press 1 use list or press 2 set"<<endl; cin>>choice; if(choice == 1) //list { while(choice != 4) { value = 0; list1.menu(); cin>>choice; switch(choice) { case 1:cout<<"please enter value"<<endl; cin>>value; list1.set_value(value); break; case 2

Parsing list of list haskell -

hello have function given list returns subset of permutations of it. want make function given list of list produces list of lists using first function. more clear: delete x [] = [] delete x (y:xs) = if (x==y) (delete x xs) else (y:delete x xs) insert x n [] = [] insert x n xs = take (length xs - n) xs ++ [x] ++ drop (length xs - n) xs insert_and_delete x n xs= [insert x n (delete x xs)] my_permutation x 0 list = insert_and_delete x 0 list my_permutation x n list = insert_and_delete x n list ++ my_permutation x (n-1) list --n lenght of list my_permuation 5 4 [5,1,1,1] [[5,1,1,1],[5,1,1,1],[1,5,1,1],[1,1,5,1],[1,1,1,5]] my_permutation 3 3 [3,1,1] [[3,1,1],[1,3,1],[1,1,3]] now want make function given list of lists eg [[5,1,1,1] , [3,1,1]] return list containing results above : [[5,1,1,1],[5,1,1,1],[1,5,1,1],[1,1,5,1],[1,1,1,5],[3,1,1],[1,3,1],[1,1,3]] my try far: generate_permutations2 [xs:list] = my_permutation xs (length(xs:list))

javascript - AngularJS : ng-controller on directive does not work on transcluded elements within directive -

here script: angular.module('myapp',[]) .directive('mysalutation',function(){ return { restrict:'e', scope:true, replace:true, transclude:true, template:'<div>hello<div ng-transclude></div></div>', link:function($scope,$element,$attrs){ } }; }) .controller('salutationcontroller',['$scope',function($scope){ $scope.target = "stackoverflow"; }]) and html: <body ng-app="myapp"> <my-salutation ng-controller="salutationcontroller"> <strong>{{target}}</strong> </my-salutation> </body> the problem , when salutationcontroller applied on my-salutation directive, $scope.target is not visible transcluded element.but if put ng-controller on <body> or on <strong> element, works. docs says, ng-controller creates new scope. who can explain

PHP call function with default arguments -

in many languages can this: function f(a = 0, b = 0, c = 0) { // } f(b=3, c=4); can in php? thank indeed! no, unfortunately can't "step over" arguments in php, default values possible @ end of list. so can write this: function foo($a=0, $b=0) {} foo(42); here $b have default value $a won't, provided 1 value input. however there's no way of providing value $b without providing 1 $a - have provide value $b second parameter, , php has no keyword can use in place of first parameter "use default". there talk of adding named parameters future version of php, similar non-php example. you can simulate bit changes code, though; couple of ideas: treat null meaning "use default", , write $a = is_null($a) ? 42 : $a make functions take associative array parameter, , take values though keys parameter names

c++ - How to render multiple textures? -

i'm trying understand how render multiple textures different objects in opengl. decided try it, far i'm aware glactivate used select right texture, doesn't work expected it. in code, 2 objects shown (in turns) have same texture. texture initialization part of code: bool (some args, unsigned int textureunit, bool wrap) { // code opengl->glactivetexture (gl_texture0 + textureunit); glgentextures (1, &textureid); glbindtexture (gl_texture_2d, textureid); glteximage2d (gl_texture_2d, 0, gl_rgba, width, height, 0, gl_bgra, gl_unsigned_byte, targaimage); if (wrap) { gltexparameteri (gl_texture_2d, gl_texture_wrap_s, gl_repeat); gltexparameteri (gl_texture_2d, gl_texture_wrap_t, gl_repeat); } else { gltexparameteri (gl_texture_2d, gl_texture_wrap_s, gl_clamp); gltexparameteri (gl_texture_2d, gl_texture_wrap_t, gl_clamp); } gltexparameteri (gl_texture_2d, gl_texture_mag_filter, gl_linear);

memory - Small C++ container -

short story: need container can store unlimited number of elements, no dynamic memory allocation small number of elements. long story: need store couple of integers, number of not bounded, more 2 or three. tried using vector<int> or list<int> , performance compared simple array worse factor of @ least 50 in release mode, , 500 in debug mode. example, measured creating vector , calling push_back 3 times, , destroying again. takes around 250ns. calling reserve(3) upfront helps bit, time goes down 100ns. using array instead takes 3ns, cannot use fixed-size array because number of elements unbounded. need store lot of things, part of larger objects. so guess i'm asking container uses sort of small vector optimization: long number of elements small stored within object itself, , when grows beyond limit allocates memory on heap. such thing exist? as side node, basic_string known have sort of optimization, tried basic_string<int> . indeed, size of 3

lucene - Stopwords not getting removed - solr -

i new using solr , have defined following schema: <schema name="example" version="1.5"> <fields> <field name="nodeid" type="string" indexed="true" stored="true" /> <field name="_root_" type="string" indexed="true" stored="false" /> <field name="datetime" type="string" indexed="true" stored="true" multivalued="true" /> <field name="epochsecs" type="string" indexed="true" stored="true" multivalued="true" /> <field name="subject" type="text_general" indexed="true" stored="true" /> <field name="body" type="text_general" indexed="true" stored="true" /> <field name="emailid" type=

Converting cubic cm to litres in python -

i want write function when input dimensions of truncated cone (a cup) , amount of liquid in litres returns how many of these cups can filled amount of liquid. def number_of_cups(bottom_radius, top_radius, height, litres_of_liquid): volume = math.pi / 3 * height * (bottom_radius**2 + top_radius * bottom_radius + top_radius**2) return int(filled_cup) this far have got, don't understand how convert volume in cm^3 litres using python. how incorporate conversion of 1l = 1000 code i running python 3 clear version confusion. any obliged. there 1000 cubic centimeters in liter , divide 1000.

ruby on rails - ApplicationController Method with Equal Sign -

in rails 4 i'm trying this: class applicationcontroller < actioncontroller::base # not work def x=(value) session[:x] = value end # have instead def set_x(value) session[:x] = value end end when try call x = 1 child controller, don't error, session variable doesn't set. running set_x 1 works expected though. i think problem of scope, instead of calling x = 1 , try call self.x = 1 .

sql - trying to create a group of users from a flat file every has to be done using the package -

this main problem try sql loader execute inside package. procedure addgroup num number; name1 varchar2(20); load varchar2(200); begin load := 'host sqlldr kevonia_workspace/pass123 control = c:\users\kevonia\desktop\dba\usernames.ctl log = c:\users\kevonia\desktop\dba\usernames.log'; execute immediate(load); num in 1..10 loop select username name1 loaded userid=num; dba_package.newuser(name1); dbms_output.put_line(name1|| ': added' ); end loop; end addgroup; ora-00900: invalid sql statement you have several options create external table . can manipulate table normal table. best option. if don`t have privileges create table , insist on using host commands @ this (but really, don't it). same above using dbms_scheduler executable job.

r - Normalizing a multivalued column in a large table -

i'm having issue converting vba code seen in this post r-script. the problem follows, have column (from source database, not choice) contains multiple values attribute. i'd normalize table , retain order in each value occurs in each cell. an example dataset: dat <- data.frame( id = c(1:3), multi = c("val1 val2 val3","val2 val3","val3 val1") ,stringsasfactors=false) id multi 1 1 val1 val2 val3 2 2 val2 val3 3 3 val2 val3 val1 the pseudocode like: loop on each row split string multi space separator for each splitted string, append new row in separate data.frame id, order within total string , value. the result like: id order multi 1 1 1 val1 2 1 2 val2 3 1 3 val3 4 2 1 val2 5 2 2 val3 6 3 1 val2 7 3 2 val3 8 3 3 val1 i'm looking @ doing data.frame, i'm thinking

What are the differences between abstract classes and interfaces in Java 8? -

in java there used subtle important difference between abstract classes , interfaces: default implementations . abstract classes have them, interfaces not. java 8 though introduces default implementations interfaces, meaning no longer critical difference between interface , abstract class. so is? as best can tell, remaining difference (besides perhaps under hood efficiency stuff) abstract classes follow traditional java single-inheritance, whereas interfaces can have multiple-inheritance (or multiple-implementation if will). leads me question - how new java 8 interfaces avoid diamond problem ? interfaces cannot have state associated them. abstract classes can have state associated them. furthermore, default methods in interfaces need not implemented. in way, not break existing code, while interface receive update, implementing class not need implement it. result may suboptimal code, if want have more optimal code, job override default implementation. and lastl

git - Composer: Multiple Packages in one Repo -

i have 1 git-repo modules inside. want use composer include them different projects. there way have them in 1 git repo or need create own git-repo each module? it question of how conveniently easy want deal single modules. if able introduce release process grabbing single module shared repository, create zip file it, put zip it's needed composer.json meta data somewhere, host zip via http(s), , make packagist (or local satis repository want use) aware of release... might use 1 single repository. in other cases, 1 repository per composer package way go. note can of course "maxinet/random-collection-of-modules" package. , @ later time, if care enough, move parts of module pack out single repository, , re-include in pack composer. the process of splitting git repository described here: detach (move) subdirectory separate git repository

linux - Go binary failed to run in openshift -

i have developed basic go rest webservice in go 1.2. working expected in local linux box. when scp'ed generated binary openshift , try execute, terminates instantaneously without listening port. here application code : https://gist.github.com/anidotnet/9720936 i tried both binary compiled @ openshift server , binary compiled @ local linux box, result same. tried executing using nohup ./app $ but still terminates. no panic log there well. going wrong here? missing something? i not go expert, here things check in program: make sure binding port 8080 serve application make sure binding openshift ip address (not 127.0.0.1, localhost, or 0.0.0.0 defaults) here openshift go cartridge can try (check out code in template directory) hints on how bind correctly: https://github.com/smarterclayton/openshift-go-cart the environment variables need can found sshing gear , running following commands: env | grep ip env | grep port these named according type of web

python - How to delete a print command in certain results -

how delete command in result: pass1 = input("what password: ") pass2 = input("rewrite password: ") if len(pass1) > 5: print ("") else: print ("your password must @ least 5 characters long") print ("*******************") print ("loading...") print ("*******************") time.sleep(1) if pass1 == pass2: print ("all right, password is: " + pass1) else: print ("sorry, passwords don't match") basically when run , type in password not 5 characters long still shows password is. what trying when password not 5 characters long want make not show up. if pass1 == pass2: print ("all right, password is: " + pass1) else: print ("sorry, passwords don't match") just move relevant code inside if branch: pass1 = input("what password: ") pass2 = input("rewrite password: ") if len(pass1) > 5: print ("")

Is there a way to use module/2 in ECLiPSe Prolog? -

in swi-prolog, using code such @ beginning of module text file: :- module(foo, [bar/2]). :- use_module(library(jack)). i don't want change code . how can neverthelss use eclipse prolog (*). there library defines module/2 directive in eclipse prolog? best regards (*) http://eclipseclp.org/ the following code defines macro maps module/2 module/3 directives: :- export macro((:-)/1, translate_directive/2, [top_only]). translate_directive( (:- module(module, exports)), (:- module(module, exports, [swi])) ). compile (or import) before compiling module written swi. note 3rd argument of module/3 must contain language module , corresponding dialect module written in. have used swi here, other choices quintus , iso or eclipse's native eclipse_language .

php - Symfony2 Add multiples images to an entity. The clean way -

my question more architecture question real problem. model at moment have 1 entity , collection of images (image entity) attached them (@manytomany). view actually have stable code running on production it's nightmare maintain. i'm using js , ajax. js listening fake multiple input , sending images symfony. @ point symfony2 creating fake temporarily folder , adding inside images (huge piece of code). i don't think can't run without ajax , js (remember can't change input file value) , using layout box if user want drag ad drop images instead of adding manually. controller after real form submitted, controller checking files inside temporarily folder , adding images collection of entity (i don't think right approach) , moving images temp folder s3 box. question any idea manage problem in different way? avoiding storing images in temp folder or/and using symfony2 forms , doctrine listeners / postupdate-postpersist. i

Inserting image into ImageView using Javafx -

i have frame controller class reading values form(which created using javafx scene builder) , inserting information after controlling validity. want know how insert image imageview element on stage. public class framecontroller { @fxml private imageview img_view; .... @fxml public void buttonclicked() { ... img_view = new imageview(); image img = new image("../img/img.jpg"); img_view.setimage(img); ... } } this not work. runs debugger after clicked button bound buttonclicked() function. missing something? how can insert image imageview element on scene? appreciate help. something fix: the relative path reference ../ not resolve url can loaded jar protocol (which standard protocol used loading resources in packaged javafx apps). don't use relative reference ..\ in it. instead use absolute reference, example: /com/mycompany/myapp/myproject/img/img.jpg some things check (assuming have made change above):

adding a delay before item reverts - draggable jquery -

i trying add delay between when user drags , drops div, , when div reverts back. so upon mouse up, when revert action begins have short delay. here jquery: $( "#draggable" ).draggable({ revert: true , revertduration: 1000 }); and here fiddle http://jsfiddle.net/yxbp9/54/ you can custom revert function return true revert item in revert option $( "#draggable" ).draggable({ revert: function(){$(this).delay(1000);return true;} , revertduration: 1000 }); hope help, here fiddle, http://jsfiddle.net/yxbp9/73/

android - Perform a method continuously when button is in pressed state -

i trying perform method long button pressed. public void onclick(view view) { method(); } the above code performs method once if press , hold button trying perform method continuously long button in pressed state. <?xml version="1.0" encoding="utf-8"?> <button xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/button_send" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/button_send" android:onclick="onclick" /> you can write while loop in method() want execute. while exit when action_up received. work: boolean pressed = true; private void method() { while(pressed) { //code } } set boolean pressed false when action_up .

python - Sync data with Local Computer Architecture -

the scenario is i have multiple local computers running python application. these on separate networks waiting data sent them web server. these computers on networks without static ip , behind firewall , proxy. on other hand have web server gets updates user through form , send update correct local computer. question what options have enable this. sending csv files on ftp achieve not real time. the application built on python , using django web part. appreciate help use rest api. can post information django app on http, using authentication key if necessary. http://www.django-rest-framework.org/ should started quickly

Get median value of a time period in SQL Server 2005, 2008 server -

i have table count used licenses every minute. cron task checks session panel , counts number of session every minute. fills session_counts table. session_counts : create table [dbo].[session_counts]( [id] [int] identity(1,1) not null, [license_count] [int] not null, [created_at] [datetime] not null, [updated_at] [datetime] not null, primary key clustered ( [id] asc ) example values (i have 525600 rows year in real data table): id license_count created_at updated_at 1 879 2014-12-30 15:58:42.000 2014-12-30 16:10:50.000 2 55 2014-05-28 12:20:00.000 2014-05-28 12:26:45.000 3 40 2014-03-15 15:51:26.000 2014-03-15 16:02:29.000 4 979 2014-04-25 09:09:49.000 2014-04-25 09:24:03.000 5 614 2014-12-27 11:17:53.000 2014-12-27 11:19:36.000 6 721 2014-09-02 15:20:40.000 2014-09-02 15:32:47.000 7 625 2014-02-27 11:17:42.000 2014-02-27 11:23:26.000 8 1576 2014-12-30 17:18:32.000 2014-12-30 17:36:55.000 9

php - sending email to all subscribed users, selecting from sql DB and sending, not working -

i have html input form user can subscribe newsletter. enter first name, last name , email , added table in sql database. i have created second html form "admin" can enter subject , message in body textbox , click send. now supposed happen when click send is, subject/body sent users in sql database, not working! please? code below: <?php $user = "example"; $password = "example"; $host = "example"; $dbase = "example"; $table = "example"; $from= 'example';//specify here address want email sent $subject= $_post['subject']; $body= $_post['body']; // connection dbase $dbc= mysqli_connect($host,$user,$password, $dbase) or die("unable select database"); $query= "select * $table"; $result= mysqli_query ($dbc, $query) or die ('error querying database.'); while ($row = mysqli_fetch_array($result)) { $firstname= $row['firstname']; $lastname= $row['

linux - Check if a directory exists and is accessible -

i want check if directory exists , has access rights; if does, perform tasks. code wrote, might not have proper syntax. can me correct it? dir_test=/data/abc/xyz if (test -d $dir_test & test –x $dir_test -eq 0); cd $dir_test fi i believe can written this. dir_test=/data/abc/xyz test -d $dir_test if [ $? -eq 0 ]; test –x $dir_test if [ $? -eq 0 ]; cd $dir_test fi fi how can write more efficiently? the best way write original test -based solution be if test -d "$dir_test" && test –x "$dir_test"; cd $dir_test fi although if test fails , don't change directories? remainder of script not work expected. you can shorten using [ synonym test : if [ -d "$dir_test" ] && [ -x "$dir_test" ]; or can use conditional command provided bash : if [[ -d "$dir_test" && -x "$dir_test" ]]; the best solution, since going change directories if tests succeed, try it, , abort

java - File Not Found for File with Turkish Characters -

i have problem using file , fileinputstream. have web application allows users attach files (that store on server filesystem) , stream them when want download them. a file has been attached has turkish characters , spaces in name. error has same name file on linux file system a: java.io.filenotfoundexception, no such file or directory. file upload correctly , renamed current name part of attaching process. files without turkish character work fine. i know sounds turkish character why able renamed turkish name in first place. this customer (in turkey) have screen shots showing error message , directory of file system , names seem match. does know problem be. thanks paul edit: the copy process involves creating new file object (attachment object has details of filename used) new file(attachmentdir + separator + attachment.getid()+(stringutils.isblank(attachment.getissuekey())?"":"_"+attachment.getfilename())); and moving temporary directory

listener - AngularJS - Refresh all instances of the app on $emit -

i've angularjs app. i've page following template , controller: <div ng-controller="parentctrl"> <p>{{food}}</p> <div ng-controller="childctrl"> <button ng-click="onbtnclk()">{{buttontitle}}</button> </div> </div> the 2 controllers: app.controller('parentctrl', parentctrl); parentctrl.$inject = ['$scope','$rootscope']; function parentctrl($scope,$rootscope) { $rootscope.food = "hi" $rootscope.$on("update_parent", function(event,msg) { $rootscope.food = msg; console.log("witnessed") }); } app.controller('childctrl', childctrl); childctrl.$inject = ['$scope','$rootscope']; function childctrl($scope,$rootscope) { $scope.buttontitle="update parent" $scope.onbtnclk = function() { $rootscope.$emit("update_parent","updatedyy");

swing - Java keeps adding buttons! - JFrames - -

alright, so, trying make game using jframe that, when click button, adds money, , show update text(a jlabel ). you see, should update windows.money variable , display new variable on screen, but, adds more buttons. please note: money part works fine. it's java doesn't want replace, add. code: package dev.bobdabiulder.classic.main; import javax.swing.jlabel; public class bucket extends window{ private static final long serialversionuid = 1l; public bucket() throws interruptedexception { for(int = 0; !window.paused; ) { window.money += 2; this.wait(1000); } window.buckets++; window.bucketcounter = new jlabel("you have: " + window.buckets + " buckets!"); } } in windows class... package dev.bobdabiulder.classic.main; import java.awt.button; import java.awt.component; import java.awt.toolkit; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jbutto