Posts

Showing posts from March, 2013

gwt - Google Eclipse designer button not responding -

Image
i have installed components of google's plugin eclipse button allows create visual classes not respond when click on it. the version of gwt designer included in gpe slimmed down version not include things creating ui classes eclipse menus. if want functionality, need install full gwt designer here: http://dl.google.com/eclipse/inst/d2gwt/latest/4.3 note did verify still allows opening desired ui class creation wizards, have not verified works gwt 2.6. think should work in gwt 2.6.1 cannot guarantee that. i've used gwt 2.5.1. note original title referred swing designer. swing designer has never been part of google plugin eclipse. google donated product open-source community , maintained eclipse. bundled versions of eclipse part of windowbuilder. forum here: https://www.eclipse.org/forums/index.php/f/214/ you can swing designer eclipse 4.3 update site: kepler - http://download.eclipse.org/releases/kepler

c# - How to do CudaMemcpy using CUdeviceptr -

i'm trying wrapper in ะก++ dll cuda, able use in c# (yeah, know there's managedcuda , cudafy, still try this) the thing is, able pass pointer reference c#, cant usual , cuda malloc float*. trying manage cudeviceptr, but, though cudamalloc apparently works (no error given cudagetlasterror), when cudamemcpy using cudevicptr variable breaks , gives "invalid argument" error. extern "c" __declspec(dllexport) void __cdecl allocatedevicememory(float*, cudeviceptr, unsigned int); extern void allocatedevicememory(float* data, cudeviceptr device_pointer, unsigned int numelements){ cudamalloc((void**)&device_pointer,numelements * sizeof(float)); cudaerror_t error = cudagetlasterror(); printf("cudaerror.... 1 %s\n", cudageterrorstring(error)); cudamemcpy((void*)&device_pointer ,data,numelements * sizeof(float), cudamemcpyhosttodevice); error = cudagetlasterror(); printf("cudaerror.... 2 %s\n", cudageterrorstring(error)); } do...

Add subdirectory of remote repo with git-subtree -

is there way add subdirectory of remote repository subdirectory of repository git-subtree? suppose have main repository: / dir1 dir2 and library repository: / libdir some-file some-file-to-be-ignored i want import library /libdir main /dir1 looks this: / dir1 some-file dir2 using git-subtree, can specify import dir1 --prefix argument, can specify take contents of specific directory in subtree? the reason using git-subtree can later synchronize 2 repositories. i've been experimenting this, , found partial solutions, though none quite perfect. for these examples, i'll consider merging 4 files contrib/completion/ of https://github.com/git/git.git third_party/git_completion/ of local repository. 1. git diff | git apply this best way i've found. tested one-way merging; haven't tried sending changes upstream repository. # first time: $ git remote add -f -t master --no-tags gitgit https://githu...

c++ - LPT POS printer alternate feed -

i have ancient pos printer axhiohm a470 link . windows 7 64bit doesn't detect printer , drivers don't exist. way print (text mode only) send print job directly lpt. after digging found it's pretty easy. thing have correctly create file lpt1 , write it. #include <iostream> #include <conio.h> #include <windows.h> int main(int argc, char* argv[]) { handle hcomm = createfilea("lpt1", generic_read | generic_write, 0, 0, open_existing, file_attribute_normal, 0); if (hcomm == invalid_handle_value) return 1; char str[] = { " hello printer\n" }; dword byteswritten; unsigned char data; bool nerror = writefile(hcomm, str, sizeof(str), &byteswritten, null); if (nerror) std::cout << "data sent" << std::endl; else std::cout << "failed write data " << getlasterror() << std::endl; _getch(); } now take...

Empty product list on QueryProducts in Delphi XE6 TInappPurchase on Android -

i developing inapp-purchase in delphi xe6. based on embarcadero documentation create inapppurchase component below: finapppurchase := tinapppurchase.create(self); {$ifdef android} finapppurchase.productids.add(license5and); finapppurchase.productids.add(license10and); finapppurchase.productids.add(license20and); finapppurchase.productids.add(license50and); {$endif} {$ifdef ios} finapppurchase.productids.add(license5); finapppurchase.productids.add(license10); finapppurchase.productids.add(license20); finapppurchase.productids.add(license50); {$endif} finapppurchase.onsetupcomplete := inapppurchase1onsetupcomplete; finapppurchase.onconsumecompleted := inapppurchase1consumecompleted; finapppurchase.onerror := inapppurchase1error; finapppurchase.onproductsrequestresponse := inapppurchase1productsrequestresponse; finapppurchase.onpurchasecompleted := inapppurchase1purchasec...

javascript - Can anybody tell me why my Jquery popup plugin isn't working? -

so i'm using magnific pop plug in ( http://dimsemenov.com/plugins/magnific-popup/documentation.html ) this basic html, want button open pop window in page. any sort of appreciated! :) <!doctype html> <html lang="en-us"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> </script>--> <script src="./js/jquery-1.11.1.min.js"></script> <script src="./js/jquery.magnific-popup.js"></script> <title>burn burger</title> <script type="text/javascript" src="js/javascript.js"></script> <link rel="stylesheet" type="text/css" href="normalize.css" media="all"> <link rel="stylesheet" href="style/unsemantic-grid-responsive.css" /> <link rel=...

vb.net - Statement lambdas cannot be converted to expression trees in Workflow Foundation 4.0 -

i've been pulling hair out on awhile. have custom activity accepts inargument such: [requiredargument] public inargument<func<idatareader, t>> projection { get; set; } and later on use projection in select statement on data reader after sql query so: results = reader.select<t>(context.getvalue(this.projection)).tolist(); now, difficult part passing func variable in vb expression. in case, t list of rawtie objects. every time try complicated expression assemble list reader, error: statement lambda functions not supported in context. here example of expression attempted. keeping in mind vb not primary language: function(r idatareader) new list(of rawtie) dim ties new list(of rawtie)() while r.read() 'do ties loop r.close() return ties end function is there information on, @ least, whether vb problem or wwf problem? ask if need more information.

backtracking - Find a boolean circuit with prolog -

the problem following : considering 3 inputs a,b,c, find boolean circuit and,or , not gates such output not(a), not(b), not(c) using @ 2 not gates. i find circuit prolog. idea compute predicate "accessible" takes function , says if exists circuit computes f. i have following predicates : not([],[]). not([h|t],[g|s]) :- g #=# 1-h, not(t,s). or([],[],[]). or([0|t],[0|s],[0|r]) :- or(t,s,r). or([1|t],[0|s],[1|r]) :- or(t,s,r). or([1|t],[1|s],[1|r]) :- or(t,s,r). or([0|t],[1|s],[1|r]) :- or(t,s,r). and([],[],[]). and([1|t],[1|s],[1|r]) :- and(t,s,r). and([0|t],[1|s],[0|r]) :- and(t,s,r). and([1|t],[0|s],[0|r]) :- and(t,s,r). and([0|t],[0|s],[0|r]) :- and(t,s,r). accessible(_,_,0) :- !,fail. accessible([0,1,0,1,0,1,0,1],[12],_) :- !. accessible([0,0,1,1,0,0,1,1],[11],_) :- !. accessible([0,0,0,0,1,1,1,1],[10],_) :- !. accessible(f,l,c) :- cc c-1, or(g,h,f), accessible(g,m,cc), accessible(h,n,cc), l=[0, [m,n]]. accessible(f,l,c) :- cc c-1, and(g,h,f), accessible(g,m,cc...

vb.net - Retrieve value in XML in vb -

i looking more efficient way retrive “f” @agesex in following xml using vb. the following shortened version of our xml structure: <gridrow xmlversion="1.0" columnnames="description|notes|detail question|detail question id"> <row> > ... </row> > ... <row> <nodelevel>0</nodelevel> <rowdata>cancer|@agesex=f;;|cancer - female|2320</rowdata> <rowstyle>|||</rowstyle> </row> </gridrow> here have point. xmldoc.loadxml(topproblemlisttemplate.templatexml) nodelist = xmldoc.selectnodes("/gridrow") each row xmlnode in nodelist each item xmlnode in row.childnodes if item.innertext.contains("@agesex") dim index integer = item.innertext.indexof("@agesex=") + len("@agesex=") ...

asp.net web api - What is the format of a .NET connection string? -

i can find dozens of examples of connectionstring entry in web.config, there appears no comprehensive definition of values in string. following mean: data source -- appears server identity, misinterpretation initial catalog attachdbfilename -- seems file name of db file, how relate initial catalog ? , |datadirectory| mean when included in name? integrated security -- assume "true" means "windows authentication" used vs "sql server authentication", that's guess. userid/password -- used in few odd examples. not clear when these might/might not needed. server -- see in rare examples -- how different data source? database -- ditto. multipleactiveresultsets -- ?? that's documented right here on msdn . datasource : name or network address of instance of sql server connect. intial catalog : name of database in scope when connecting. attachdbfilename : name of primary database file, including full path name of attachable d...

C++ type coercion deduction -

i'm playing around colvin-gibbons trick implementing move semantics in c++03 , i've got following: #include <unistd.h> #include <stdio.h> #include <stdlib.h> template <typename t> class buffer { struct buffer_ref { buffer_ref(t* data) : data_(data) {} t* data_; }; public: buffer() : data_(null) {} //explicit buffer(t* data) : data_(data) {} buffer(size_t size) : data_(new t[size]) {} buffer(buffer_ref other) : data_(other.data_) { other.data_ = null; } buffer(buffer &other) : data_(other.data_) { other.data_ = null; } ~buffer() { delete [] data_; } operator buffer_ref() { buffer_ref ref(data_); data_ = null; return ref; } operator t*() { return data_; } private: t* data_; }; int main() { buffer<float> data(buffer<float>(128)); printf("ptr: %p\n", (float*...

SSH Maverick : Looking for files on the remote machine -

i using maverick ssh library connect remote machine. trying find file or group of files in specific directory based on wild card : abc*.txt i tried use sftpclient ls(string str) method, didn't work : try{ string filename = "/tmp/mydir/abc*.txt"; sftpfile[] files = sftp.ls(filename); if(files != null && files.length > 0) retcode = true; } catch(exception ex){ system.out.println("exception : " + ex); } i getting : no such file exception. is there way find out whether file/group of files exist on remote machine? are using api https://www.sshtools.com/j2ssh-javadocs/com/sshtools/sftp/sftpclient.html ? as javadoc states ls method takes string path directory , not sort of regular expression. you can try programmatically listing each directory in desired path , search array of sftpfile(s) returned if need.

c# - Why won't my code write to SQL? -

i'm writing app store texts sql database, code throws exception saying "the variable name @par1 has been declared", i'm not sure how working , fixing if possible please =] offending code below private void smsgetter() { try { decodedshortmessage[] messages = comm.readmessages(phonemessagestatus.all, phonestoragetype.sim); sqlconnection conn = new sqlconnection("data source=*********;initial catalog=********;user id=**********;password=***********"); sqlcommand com = new sqlcommand(); com.connection = conn; conn.open(); foreach (decodedshortmessage message in messages) { //com.commandtext = ("insert smsarchives(message,blacklist) values ('" + message.data.userdatatext + "', 'yes')"); //com.executenonquery(); com.commandtext = (...

javascript - AngularJS: How to access directive controller's $scope properties in HTML -

i have written angularjs directive displaying tables. used these tables on few pages , wokred awesome, , have page need 2 instances of such table. new angularjs , maybe wasn't best choise in first place far used controllers scope these tables , directives. , when comes having 2 tables, act same table when change page 1 table, other 1 gets page changed either, because share same scope (controller's scope). i added scope property directive declaration accept items (this should common both tables) controller , within directive's controller declared filtereditems (this should not common, each table should have own filtered items list) property of directive's scope. now controller goes like: function ($scope, sgtservice, ...) { sgtservice.getlist(function (data) { $scope.items = data; }); ... } my directive declaration is: abtable: function () { return { restrict: "a", scope: { items: '=' ...

multi-directional infinte sequence - ML -

i want use datatype sequence defined follows: datatype 'a seq = nil | cons of 'a * (unit-> 'a seq); exception emptyseq; fun head(cons(x,_)) = x | head nil = raise emptyseq; fun tail(cons(_,xf)) = xf() | tail nil = raise emptyseq; which has option iterate on functions backward , forward: datatype direction = | forward; datatype 'a bseq = bnil | bcons of 'a * (direction -> 'a bseq); and defined well: fun bhead(bcons(x,_)) = x | bhead bnil = raise emptyseq; fun bforward(bcons(_,xf)) = xf(forward) | bforward bnil = raise emptyseq; fun bback(bcons(_,xf)) = xf(back) | bback bnil = raise emptyseq; now, i'm trying create function "create_seq" gets int "k" , returns infinte sequence can iterated , forth. example: - create_seq 2; val = bcons (2,fn) : int bseq - bforward it; val = bcons (3,fn) : int bseq - bforward it; val = bcons (4,fn) : int bseq - bback it; val = bcons (3,fn) : int bseq - bba...

odata - HOWTO add request header to breeze batch requests -

note not same thing adding header parent request mentioned in other tread: breeze - adding headers request . i'm using breeze webapiodata dataservice & need add specific header value within each request within batch. can add header value parent request (using afore mentioned link), isn't included in child request. in specific instance, need include antiforgery token request. batch requests split out individual requests webapi odata controllers , such, don't see parent request. i'm exploring how tweak server side code in validates anti forgery token, (1) addresses specific challenge , (2) doesn't others may need include header value in request.  i'm using breeze v1.4.12... looking @ source, appears headers being explicitly set (lines 15280-15284 & line 15380)... isn't clear me if possible override , control inner header individual requests within batch @ present time. specifically, i'm controlling inclusion of antiforgery token in request...

php - Renaming an uploaded file -

after uploading file, want rename appending today's date end. here example of putting today's date @ beginning of file: move_uploaded_file($_files['imagefile']['tmp_name'], "docs/".$upload_date.$_files['imagefile']['name']); but if try add end, gets added after file's extension example "testdoc.pdf2014-05-29" but want: "testdoc 2014-05-29.pdf" how insert today's date (or variable) in between filename , extension? try this: //split file name "." $filename = explode(".", $_files['imagefile']['name']); //remove extension file name , save in variable $extension = array_pop($filename); //join array without extension $filename = implode(".", $filename); //get new file name appending upload date , extension $newfilename = $filename . ' ' . $upload_date . '.' . $extension; move_uploaded_file($_files['imagefile']['...

php - Doing multiple joins in a query MySQL -

i new mysql , having trouble figuring out. i have 2 tables called doctors , doctor_tags fields doctors : doctor_id , doctor_name fields doctor_tags : id , doctor_id , tag_name now specific doctor_id need find related doctors. doctors related if have same tag_name . once find relation need doctor_name of these doctors back. i lost i've got far (i sure it's wrong) select doctors.doctor_name, doctors.doctor_id doctors inner join doctors_tags on doctors.doctor_id = doctors_tags.doctor_id ... i konw query pretty useless know need type of join. for whoever kind enough comeup sort of query, very thankful if explain each part of in process. :) edit: part 2 if lets introduce table has n:n relationship between doctor_id , tag_id table fields doctor_tags_joins : doctor_id , tag_id and fields tag table change doctors_tags : tag_id , tag_name , on... how can same thing additional table included mix. you need join tables twice: select distinc...

c++ - openCV 2.4.9 windows: InputArray is undefined -

i'm trying create dll wrapper using opencv in labview. i'm pretty new both of them (opencv & labview). use cvtriangulatepoints labview. i've created hpp file #ifndef __opencv_precomp_h__ #define __opencv_precomp_h__ #include "cvconfig.h" #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/imgproc/imgproc_c.h" #include "opencv2/core/internal.hpp" #include "opencv2/features2d/features2d.hpp" #include <vector> #ifdef have_tegra_optimization #include "opencv2/calib3d/calib3d_tegra.hpp" #else #define get_optimized(func) (func) #endif #endif (this precomp.hpp, it's include in file triangulate.cpp opencv\sources\modules\calib3d\src) own hpp file: #ifdef wrapperopencv_exports #define wrapperopencv_api __declspec(dllexport) #else #define wrapperopencv __declspec(dllimport) #endif #include "precomp.hpp" namespace wrapperopencv { ...

wso2 CEP in-built function - isMatch -

i trying use cep 3.1.0 built in function regexp matching cseeventstream[ismatch('foo\sbar',symbol)] which should match "foo bar" , not "foobar". however, fails error mesage mismatched character '\' expecting ''' i have tried escaping multiple '\'. also, [ismatch('foo bar',symbol)] not work. although, cseeventstream[symbol contains 'foo\sbar'] temporary workaround, inability use '\' severe limitation in regexp matching. well it's looking '\' character. in ismatch documentation? says expecting ' maybe have use '\ ??

ruby on rails - How to test serialize column? -

i have in model this: class mymodel < activerecord::base serialize :my_column, array end how test it? today i'm testing this: it "column serialize array" subject.my_column.is_a?(array).must_equal true end i'm using gem "minitest-rails-shoulda" is there way test this? tanks you can shoulda-matchers . class mymodeltest < activesupport::testcase should serialize(:my_column) end check out code comments , should pretty straightforward. if on rails 5, watch out there an issue .

Curly Braces Notation in PHP -

i reading source of opencart , ran such expression below. explain me: $quote = $this->{'model_shipping_' . $result['code']}->getquote($shipping_address); in statement, there weird code part is $this->{'model_shipping_' . $result['code']} has {} , wonder is? looks object me not sure. curly braces used denote string or variable interpolation in php. allows create 'variable functions', can allow call function without explicitly knowing is. using this, can create property on object array: $property_name = 'foo'; $object->{$property_name} = 'bar'; // same $object->foo = 'bar'; or can call 1 of set of methods, if have sort of rest api class: $allowed_methods = ('get', 'post', 'put', 'delete'); $method = strtolower($_server['request_method']); // eg, 'post' if (in_array($method, $allowed_methods)) { return $this->{$method}(); //...

sql - How to group all conversations in a database by date, conversation thread -

i've got sqllite database has log of received , sent messages. id sender msg timestamp 1 2 9 1-1 201 2 9 2 1-2 202 3 1 9 2-1 203 4 9 2 1-3 204 5 9 1 2-2 205 i can order them timestamp, when conversations overlap example above (between 9, 2, , 1) kills readability. how show them conversation? ie: id sender msg timestamp 1 2 9 1-1 201 2 9 2 1-2 202 4 9 2 1-3 204 3 1 9 2-1 203 5 9 1 2-2 205 in database conversations between 9 , number, example 2 , 1 never have conversation. i've input data sqlfiddle here to conversations in order started , you'll need self join table minimum ...

ruby - Setter doesn't work with -=, +=, etc? -

this question has answer here: why ruby setters need “self.” qualification within class? 3 answers i don't understand why nil error. created setter properly. not accept -=, +=, or behind = operator. why? class test def var; @var || 0; end def var=(value) @var = value end def initialize @var = 2.4 # sample value end def test puts var var -= 1 # <<< crash: undefined method nil class puts var var = var - 1 # <<< crash: undefined method nil class puts var end end = test.new a.test write as def test puts var self.var -= 1 puts var self.var = var - 1 puts var end if don't use self , ruby treat var local variables, rather setter method calls. just remember, in ruby method call can never made without receiver(implicit/explicit). if write var = 1 , ruby treat loca...

Grouping of jobs for assigning permissions possible in Jenkins? -

i hoping able set jenkins have sort of grouping jobs controlling permissions. far can tell, job equivalent project, correct? i'm using active directory authentication along project-based matrix authorization strategy. possible (with plug-ins) have groups of jobs? not asking views or other gui features ( how group jobs in jenkins? ). pointers relevant documentation appreciated. in advance. i think role strategy plugin might you're looking for: can define global or project roles, , control various permissions each. can assign roles users (or groups of users). to define project roles group of projects, plugin can use pattern matching, if consistently naming projects (jobs) can define group e.g. like: [projectname]-.* (matching each job starts project name , hyphen).

datetime - Why %z is not supported by python's strptime? -

>>> datetime.strptime('2014-02-13 11:55:00 -0800', '%y-%m-%d %h:%m:%s %z') traceback (most recent call last): file "<stdin>", line 1, in <module> file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/_strptime.py", line 317, in _strptime (bad_directive, format)) valueerror: 'z' bad directive in format '%y-%m-%d %h:%m:%s %z' i understand it's not supported, don't know why. seems it's not hard support that. , ' offset utc ' not ambiguous timezone abbreviation. until python 3.2, python's datetime module had no timezone() object . supported 3rd-party libraries providing timezones providing datetime.tzinfo() abstract base class , no timezone object included. without timezone object, no support parsing timezone offsets either. as of python 3.2, z supported, because version (and up) added datetime.timezone() type : >>> import datetime...

gcc - Need explanation of ARM Cortex-M3 assembly instruction in CMSIS to __set_PRIMASK -

below code snippet arm cmsis library used set value of primask register. /** * @brief set priority mask value * * @param primask primask * * set priority mask bit in priority mask register */ static __inline void __set_primask(uint32_t primask) { register uint32_t __regprimask __asm("primask"); __regprimask = (primask); } the part don't understand inline assembly instruction __asm("primask"); i haven't read addressing registers name in way. how can have inline assembly without op-code first? assigning __regprimask register location? can point reference document? register uint32_t __regprimask __asm("primask"); ...is declaration of local register variable called __regprimask stored in primask register. in other words, assigning register variable set value of register primask .

r - ggplot2 show separate mean values in box plot for grouped data -

Image
i create box plot grouped data shows mean of each group point in box. using following code, single point 2 groups. df <- data.frame(a=factor(rbinom(100, 1, 0.45), label=c("m","w")), b=factor(rbinom(100, 1, 0.3), label=c("young","old")), c=rnorm(100)) ggplot(aes(y = c, x = b, fill = a), data = df) + geom_boxplot() + stat_summary(fun.y="mean", geom="point", shape=21, size=5, fill="white") part of problem changing fill of point, since fill property determines 2 box plots of different color should drawn, point behaves if there 1 group again. think should give want. ggplot(df, aes(x=b, y=c, fill=a)) + geom_boxplot() + stat_summary(fun.y="mean", geom="point", size=5, position=position_dodge(width=0.75), color="white")

xml - Check if string is empty or not -

how can check if value empty or not xsl? example, if dadosis empty? <hoteis id="1"> <codigo>458</codigo> <morada>porto</morada> <num_quartos>3</num_quartos> <piscina>nรฃo</piscina> <restaurante> <dados></dados> <num_mesas></num_mesas> <num_pessoas></num_pessoas> <hora_abertura></hora_abertura> <hora_fechar></hora_fechar> </restaurante> </hoteis> for example: <td align="center"> <xsl:value-of select= "ns:restaurante" > <xsl:for-each select="/hoteis/restaurante"> <xsl:if teste="dados != ''"> <tr bgcolor="#9acd32"> <td align="center">nยบ pessoas</td> ...

node.js - How to add unique id to sub-document in a document in mongoose -

how add unique id sub-document in document in mongoose. mongoose model sub document not adding object id. try "new objectid()" wherever want unique id. e.g db.news.insert({"name":"political", "group":{"x":new objectid(),"type":"breaking"}}) i tried in mongodb 2.4.8 , working fine.

android - Best way to find and remove hidden textures from memory -

i need find way track positions loaded textures drawn. when of loaded textures overwritten, have delete them memory. i have remote user interface (rui) server sends me lot of small images, assembled , shown on rui client's screen. in scenario, have no clue textures behind other textures, unable delete them. also, overwriting must complete (texture behind must totally hidden). there efficient way achieve tracking , deleting? my use-case this: have menu button images stored on server. whole screen made of fragments (buttons, scrollbars, animations etc.). example, when click on button, server sends me multiple thumbnails of pictures stored in storage, , display them in ,for example, right half of screen. on other button click, list of songs, videos, ebooks or else shown. need remove textures of picture thumbnails memory , show list of songs, example. in way, overwriting disappear, , memory usage reduced. my opengl es 2.0 implementation on android platform, whole job done i...

rebol3 - Is Rebol suited to fill up on-line web forms? -

the title says all. there tools autohotkey , autoit allow 1 send text fill on-line web forms , process the post answer. i know rebol can latter. former? there's script wrote @ web forms, extract various variables, , allow post form, , capture output. test prior figuring out how automate login stackoverflow has since been done.

html - PHP/SQL mysql_num_rows() error -

this question has answer here: mysqli_fetch_array()/mysqli_fetch_assoc()/mysqli_fetch_row() expects parameter 1 resource or mysqli_result, boolean given 33 answers i'm having issues executing code: http://tinyurl.com/m9zoscy sorry had put on google drive stackoverflow being fussy code... annnyway i'm having issues on line 18. ideas? this code: <link rel="stylesheet" type="text/css" href="style.css" /> <link href='http://fonts.googleapis.com/css?family=karla:400,700,700italic,400italic' rel='stylesheet' type='text/css'> <?php $filename = 'install.php'; if (file_exists($filename)) { echo ("<center><font color='red'><b>/install.php still exists<br> after installing please delete install.php</center></font></b>"); } else { ...

mysql - get all values from SQL column using PHP (only returns one value) -

i querying database values in 1 column, putting associative array. db query working, php prints array 1 item. <?php $acc_names = mysqli_query($con,"select acc_name accounts"); #successfully returns values in column in mysql $acc_names = (mysqli_fetch_assoc($acc_names)); print_r($acc_names); #only 1 item in array print_r($acc_names['acc_name']); #that 1 item ?> you should use mysqli_fetch_all($acc_names, mysqli_assoc) instead of mysqli_fetch_assoc .

java - How does JVM handle runtime exception in RMI remote method? -

i have been trying find out how jvm handles runtime exception in rmi remote methods. have remote method contains following 2 methods: dosomething( print "dosomething thread id " + thread.currentthread.getid() ) fail(){ print "fail thread id " + thread.currentthread.getid() throw new runtimeexception } the behavior saw if method fail() invoked, thread on runtime exception thrown still not terminated. sample output is: fail thread id 16 stacktrace ... dosomething thread id 16 dosomething thread id 16 the exception caught. caller serverexception runtimeexception nested in cause. executing thread doesn't die.

Ember.js Controller with computed property not being recomputed -

i'm trying add permissions groups, , have drag , drop set user can pull unselected permissions on selected, or vice versa. unselected permissions computed via removing selected permissions permissions. code functioning properly. first time user brings page, permissions unselected appear in unselected side, , same selected. however, when user chooses group at, selected side correct, while unselected side shows displayed last group. here route , controller: app.groupseditroute = ember.route.extend({ setupcontroller: function(controller, model) { this._super(controller, model); controller.set('allpermissions', this.store.find('permission')); }, actions: { 'update': function(group){ var route = this; group.save().then(function(){ route.transitionto('groups'); }); }, 'cancel': function(group){ group.rollback(); this.transitionto('groups'); }, 'delete...

java ee - Transaction propagation from CDI to EJB -

i want submit form file, , other simple fields. because sending file , saving in filesystem typical web tier, i'm doing in cdi managed bean. cdi managed bean call ejb store other data in database. saving file fail, annotated cdi bean's method @transactional (jee7). i'm expecting rollback ejb's transaction when saving file fail, not happen. normal behavior? how rollback ejb's transaction in case? @named @javax.faces.view.viewscoped public class lecturectrl { @inject lecturesfacade lecturesfacade; @getter @setter uploadedfile paper; @getter @setter lecture lecture; @transactional(rollbackon={filenotfoundexception.class}) public void create(lecture _lecture) throws messagingexception, ioexception { try{ long _lectureid = lecturesfacade.create( _lecture ); //args: file, path, constant filename "abstract" webutils.handlefileupload( this.paper, "conferences/"+lecture.getconferen...

loading posts via ajax and jquery in wordpress -

i'm using jquery , php previous post blog roll. i'm loading 1 post @ time on page , clicking previous post link trigger ajax call. end result similar how medium.com pulls next post article. below code works, somewhat, however, keeps looping , returning null value when come last post. here's jquery part loadnextpost : function( callback ) { $this = this; $.ajax( { type: "post", url: '/wp-admin/admin-ajax.php', data: { action: 'get_prev_post', current_url: location.href, nonce: mediumjs.nonce, } } ) .done( function( post ) { if( '' !== post ) { $this.nextpost = json.parse( post ); } else { $this.nextpost = null; } callback.call( $this ); } ); }, now php function function get_prev_post() { global $post; $thispost = url_to_postid($_post['current_url']); if ( isset($this...

python - Getting exact string from a txt file -

let's trying number of times "the" appears in text file. how word "the" alone : without getting others words ' the ' substring : "there", "them", "their", etc. word = 'the' reg = re.compile(r'\b%s\b' % word, re.i) open('textfile.containing.the','r') fin: print(len(reg.findall(fin.read())) hope helps..

plot - wp8.1 rt graphing libraries -

i display scatter plot windows 8.1 universal app unfortunately libraries on nuget.org give following error when installing phone: could not install package 'oxyplot.core 2014.1.312.1'. trying install package project targets 'windowsphoneapp,version=v8.1', package not contain assembly references are there data-visualization or graphing libraries compatible windows phone 8.1 rt? as far know telerik has compatible libs in public beta. i'm not sure if contain graphs need. http://blogs.telerik.com/windowsphoneteam/posts/14-04-08/telerik-ready-for-microsoft-universal-windows-apps in meanwhile updated beta twice , close public release. regards npadrutt

c - Compiler ignoring if statements -

this simple problem so, hope can point me in right direction. i writing simple io program in c. in middle of program, have if statement never executed. realized when tried put break point within if statement have automatically removed , pushed down past if statement block. diving problem further, c compiler doesn't create assembly code if statement. following code snippet , assembly output. code: void senddata(unsigned int val1 ){ p1out |= 1; if ((val1 & 0x8000 ) == 0x8000) wait(t1h); else wait(t1l); p1out &= ~(1); } *note: yes, have function called wait delays number of cycles. assembly: 13 p1out |= 1; senddata(): c0ae: d3d2 0021 bis.b #1,&port_1_2_p1out 18 p1out &= ~(1); c0b2: c3d2 0021 bic.b #1,&port_1_2_p1out thank help. wait busy loop getting optimized out. believe there example of wait function survive optimization in sample code. see example http...

java - Connection gets closed while uploading file(more than 2 MB) in blacberry rim app -

im trying upload file blackberry app amazon s3. here code private synchronized void uploadfiletoamazon(createfileidbean createfileidbean) throws unsupportedencodingexception, ioexception,connectionnotfoundexception, connectionclosedexception, backupcancelledexception, interruptedexception, backupinterruptedexception { string boundary = "----------v2ymhfg03ehbqgzcako6jy"; string policy = "{\"expiration\": \"2020-12-01t12:00:00.000z\"," + "\"conditions\": [" + "{\"bucket\": \"" + beanfactory.getusercreatebackupidbean().getbucketname() + "\"}," + "{\"x-amz-security-token\": \"" + beanfactory.getusercreatebackupidbean().getamazontoken() + "\"}," + "{\"success_action_status\": \"201\"}," + "[\"starts-w...

Python decorator to check for POST parameters on Django -

i have code read check if post parameters included on request: def login(request): required_params = frozenset(('email', 'password')) if required_params <= frozenset(request.post): # 'email' , 'password' included in post request # continue normal pass else: return httpresponsebadrequest() when list of required post parameters big, code gets messy. like: @required_post_params('email', 'password') def login(request): # 'email' , 'password' here always! pass then i'm confident both 'email' , 'password' post parameters included in request, because if not, request automatically return httpresponsebadrequest() . is there way django allows me this, , if doesn't, how can myself decorator? you need custom decorator, can take require_http_methods base example: def require_post_params(params): def decorator(func): @wra...

Terminal freezing while trying to push local git repo to GitHub -

i'm trying push file local git repository github via terminal. when insert: git remote add origin https://github.com/vbavinicius/git-basics.git git push -u origin master i insert username , when going insert password terminal freezes. anyone knows solution? sorry bad english, i'm non english speaker. maybe not echo password back? try blindly typing , press enter. better, set ssh keys.