Posts

Showing posts from February, 2011

git - Version and deploy cakephp in shared hosting -

i have cakephp project deployed in shared hosting, it's unversioned. version using git or mercurial, , deploy changes easily. steps have take? should install git first in shared hosting first , make clone in local environment? should have separate folder repos in shared hosting , deploy changes utility? thanks the subversion server should different production server. can create account on github , host there private project. on production server, pull latest changes when want make update (or use continuous integration server - jenkins, teamcity, bamboo etc) on local, push/pull changes same subversion server.

c# - Handmade POCO with Entity Framework 6? -

i'm looking using ef 6 upcoming small project doing @ large organization. having poco business objects essential me, of options can find how poco ef seem rely on auto-generating tools try map entire database structure poco objects. have many databases, hundreds of tables, , hundreds of views, , i'm looking use few of these tables time being (and 1 project hope use small subset of them). additionally don't want map out many foreign properties or of normal properties these tables store. i'd make these poco objects hand , connect them ef , let mapping - i'd still able use edmx file , not have make own objectcontext, if possible. i feel though has dead simple, can't find resources on it! if can point me in right direction helpful. entity framework has code first aspect can map existing tables well. allows use pocos represent tables. can create mapping classes allow separate pocos database mapping logic. you can specify if there different naming of

typescript - I can't see my script files in chrome developer? -

i'm writing typescripts in visual studio , build/compile run fine- when open chrome developer tools can see 1 of files, there three... how can chrome developer show files? are sure including files in page via script tags? chrome dev tools should show of scripts included in pages. assuming generating .js.map files, should show both js , ts files.

python - pygame wont load images -

bck = "c:\python27\lib\site-packages\back.jpg" mse = "c:\python27\lib\site-packages\mouse.jpg" import pygame, sys pygame.locals import * pygame.init() screen=pygame.display.set_mode((600,344),0,32) background=pygame.image.load(bck).convert() mouse_c=pygame.image.load(mse).convert_alpha() while true: event in pygame.event.get(): if event.type == quit: pygame.quit() sys.exit() screen.blit(background, (0,0)) x,y = pygame.mouse.get_pos() x -= mouse_c.get_width()/2 y -= mouse_c.get_height()/2 screen.blit(mouse_c,(x,y)) pygame.display.update() i error when using double slash program, images don't show: file "c:\python27\lib\site-packages\game.py", line 12, in background=pygame.image.load(bck).convert() error: couldn't open c:\python27\lib\site-packagesack.jpg it doesn't seem able find images when use double slash or forwards slash runs fine doesn't displ

node.js - Unable to install phonegap on my office machine -

Image
since i'm behind corporate proxy couldn't use regular way of installing phonegap on office computer ("npm install -g phonegap"). thus, trying through using cntlm proxy. i've configured npm pass through cntlm proxy instead. [npm config set proxy http://localhost:3128 npm config set https-proxy https://localhost:3128 npm config set registry "http://registry.npmjs.org/"] but, i'm still missing phonegap installation proceeds extent , fails. has faced similar situation before?

php - Looking for a specific word in a line of text on submit -

so have code: if type specific word show up, example, if ($_post['text'] word smile , convert other text $out_smile . method works when comes adding text in between text "i love smile" won’t recognize "smile" recognize "i love smile" . intuitively know reason that. there way add string? if ($_post['text'] == "smile") { $out_smile = 'my code here <img src="url">'; } i want this. possible this? if (found in entire $text if there word == "smile") { $out_smile = 'my code here <img src="url">'; } or $auto_detect_left = "extra text in left hand"; //i dont know how gonna $auto_detect_right = "extra text in right hand"; //i dont know how gonna $out_result = ".$auto_detect_left.$text.$auto_detect_right; if ($_post['text'] == "$out_result") { $out_smile = 'my code here <img src="url"&

c++ - Sort a vector in which the n first elements have been already sorted? -

Image
consider std::vector v of n elements, , consider n first elements have been sorted with n < n , (n-n)/n small: is there clever way using stl algorithms sort vector more rapidly complete std::sort(std::begin(v), std::end(v)) ? edit: clarification: (n-n) unsorted elements should inserted @ right position within n first elements sorted. edit2: bonus question: , how find n ? (which corresponds first unsorted element) void foo( std::vector<int> & tab, int n ) { std::sort( begin(tab)+n, end(tab)); std::inplace_merge(begin(tab), begin(tab)+n, end(tab)); } for edit 2 auto = std::adjacent_find(begin(tab), end(tab), std::greater<int>() ); if (it!=end(tab)) { it++; std::sort( it, end(tab)); std::inplace_merge(begin(tab), it, end(tab)); }

Embed a website in a div with Jquery -

i'm trying embed website website div, problem i'm having website i'm embedding isn't filling whole div. the code have right now: $("#rectangle").html('<object data="http://dmatthams.co.uk/thing/gwd/">'); (relevant jsfiddle) http://jsfiddle.net/j997k/ as can see, website embedded isn't filling whole div. ideas on how fix that? (and also, need use jquery) you had set <object> to object { height: 100%; width: 100%; } also had 2 id same name, not work! ;) jsfiddle: http://jsfiddle.net/j997k/1/

html - Unable to capture error message - selenium java junit -

i need capture error messages displayed, tried many methods every method throws exception --unable find element, pls code. these methods tried.also, there no id, div element. this... <div id="webformerrors" class="text" name="errorcontent"> <div> there 4 errors: <ul> <li> did not enter value for: <b>first name</b> </li> <li> did not enter value for: <b>last name</b> </li> <li> <li> //string errormsg; ![enter image description here][1]errormsg = hcd.findelement(by.xpath("//div[@id=webformerrors']/text()")).gettext(); // webelement divelement = hcd.findelement(by.classname("errorcontent")); // hcd.findelement(by.name("there 4 errors:")).isdisplayed(); **string pstring = hcd.findelement(by.id("webformerrors")).gettext(); system.out.println(pstring); you have given classname , name wrong. classname "text"

Hayageek jQuery file upload plugin pass extra data to PHP -

i using excellent hayageek file upload plugin , progress bar. the plugin allows 1 specify url of php file processes uploaded file(s), this: var uploadobj = $("#fileuploader").uploadfile({ url: "uploader.php", method: "post", allowedtypes:"jpg", //,png,gif,doc,pdf,zip filename: "myfile", multiple: false, autosubmit: true, showstatusaftersuccess:false, onsuccess:function(files,data,xhr) { alert( data ); }, }); i wish send (to php side) item id along uploaded file. advanced tab on ravi's website (click advanced manually) shows possible send information php upload processor file using either: formdata: {"name":"ravi","age":31}, or, dynamic info: dynamicformdata: function() { var data ={ location:"india"} return data; }, i not clear on difference between 2 (how use differently) -- not able send dynamic data via ordinary formdat

io - Does java 6 support reading from and writing to the same file at once? -

this branches 2 questions: i know it's possible create filereader , filewriter same file @ once. filereader , filewriter play each other, i.e., newly written content guaranteed visible reader while both still open? there guaranteed behavior way interact each other? is possible create 1 entity can read, write, , seek within file? example, equivalent python's open(filename, "r+") . if such entity exists, there 1 in java.io or third party? you can use randomaccessfile

nullpointerexception - NPE when trying to load a json file in Java -

i working processing 2.1, language built on top of java allows creation of visualizations. experimenting reading in geojson files , displaying information on map. i coding within ide provided processing.org website. primitive in sense not have ability debug code. return errors cannot go code find out problems. i getting error: nullpointerexception that's it, told of nothing else bar line occurs at. list<feature> counties = geojsonreader.loaddata(this, "ireland.geo.json"); i not understand why getting it. file trying read exists. please me issue? below complete code: unfoldingmap map; list<marker>countymarkers; list<marker>countymarkers2; color c1 = color(204, 153, 0); void setup() { size(800, 600); smooth(); //map map = new unfoldingmap(this); maputils.createdefaulteventdispatcher(this, map); list<feature> counties = geojsonreader.loaddata(this, "ireland.geo.json"); countymarkers = maputils.createsi

if statement - knockout.js If condition is not working -

i've tried below scenarios, if condition not working properly. <div data-bind="foreach: controlconfig" class=""> <!-- ko if: $data.title.tolowercase() == $root.prodversion.tolowercase() --> <span data-bind="text: $data.title" /> <div data-bind="text: $root.prodversion" /> <!--/ko--> </div> or <div data-bind="foreach: controlconfig" class=""> <!-- ko if: $data.title == $root.prodversion --> <span data-bind="text: $data.title" /> <div data-bind="text: $root.prodversion" /> <!--/ko--> </div> idea? if title observable, need unwrap if you're using in expression: $data.title().tolowercase() , $data.title()==... .

ruby on rails - What is the best way to implement categories and sub categories similar to Kijiji? -

i know there acts_as_taggable_on great, if want sub-categories on kijiji. i'm wondering best way this? there gem this? the gem actsastree extends activerecord add support organizing items parent–children relationships, allow create categories , sub-categories. it's compatible rails 3.00 , forward.

HTML Notepad++ File Directory -

i'm writing code in notepad++. have <a href=new3.html>mylink</a>. i'm trying move piece of code folder, no longer work because assume automatic directory program files\notepad++. can change directory goes to? or wrong issue? thanks. yes can change directory long have main.html inside folder put images. cheers!

android - Side menu not working in inner fragments -

i have drawerlayout in application. file structure follows: class extends actionbaractivity class contains code required implementing navigation drawer. have done based on link . side menu contain list of other options. default show fragment in activity not part of side menu. particular fragment contains set of buttons , on click of each load other fragments. my issue is: in these inner fragments side menu not opening. should need add settings work? looking reply. in advance. i solved issue. problem was not referring same content frame layout in inner fragments.

linux - No number on a partition in server and can't mount -

on parted /dev/sda2 when use print free output is partition table: gpt| number start end size file system name flags 17.4kb 2198gb 2198gb free space there no number written on it. and how mount without number? right? how mount raw partition? should create filesystem mkfs.[fsname] mkfs.xfs , mount filesystem , not partition.

php - Getting error while uploading some selected images -

i have following php code uploading images on website. //codes global $objdb; global $path_to_image_directory ; global $path_to_thumbs_directory ; $final_width_of_image = 500; $path_to_image_directory = 'uploads/fullsized/'; $path_to_thumbs_directory = 'uploads/thumbs/'; $imagetitle=""; $mysqli = $objdb->connection; if(isset($_files['uploaded']['name'])) { if(preg_match('/[.](jpg)|(gif)|(png)$/', $_files['uploaded']['name'])) { $filename = $_files['uploaded']['name']; $source = $_files['uploaded']['tmp_name']; $target = $path_to_image_directory . $filename; move_uploaded_file($source, $target); createthumbnail($filename); $sql="insert gallery(image)values('$filename')"; $result=$objdb->query($sql); if($result==1) { header("location:gallery.php?s_msg=image added gallery");

web services - deploying axis 2 in tomcat -

i have web service deployed (as aar) file axis2 , not able deploy axis 2 in tomcat not able check if webservices working. copied axis 2 folder along aar files in tomcat directory. don't understand should make configuration changes (like setting axis2 path). when checked list of services url : (ip address of application): 8080/axis2/services/listservices , got network error (that means axis 2 not deployed in tomcat).it not standalone application. developed project. please help. thanks, please check below blog on how deploy axis2 in tomcat , write/test sample services. http://jayalalk.blogspot.com/2014/01/writing-axis2-services-and-deploying-in.html

php - Problems inserting strings in MySQL -

well, ill try explain please, apologize english. i have script dumps entire database sql file , script splits lines , execute them drop, create , insert data. problem strings "trimmed". insert string until reach first special character, example: for string: "pantalon azul marino de poliéster con cinta blanca bordada con el nombre de la institución en uno de sus costados." it insert: "pantalon azul marino de poli" no error thrown. happens using script, when run queries manually , importing sql file in phpmyadmin works. set utf8 way. i'm out of ideas, appreciated. include ('../core/connection.inc.php'); $conn = dbconnect('admin'); $conn->query("set names 'utf8'"); $conn->set_charset("utf8"); $type = 0; // temporary variable, used store current query $templine = ''; // read in entire file $lines = file('db-backup.sql'); // loop

c# - Get a list of all Access ACE.OLEDB drivers installed on the system -

using following code can enumerate oledb providers registered on system static void displaydata() { var reader = oledbenumerator.getrootenumerator(); var list = new list<string>(); while (reader.read()) { (var = 0; < reader.fieldcount; i++) { if (reader.getname(i) == "sources_name") { list.add(reader.getvalue(i).tostring()); } } console.writeline("{0} = {1}", reader.getname(0), reader.getvalue(0)); } reader.close(); } it returns list of drivers (we interested in access drivers) 1 caveat.. against .net 4.5 contains: sources_name = microsoft.ace.oledb.15.0 but when project built against .net 4.0 output is: sources_name = microsoft.ace.oledb.12.0 the machine testing on has 32 bit office 2013 installed (which has microsoft.ace.oledb.15.0) , have installed 64 bit version of access database driver (which has microsoft.ace.oledb.12.0). project running set anycpu, using windows 8.1.

objective c - Show a view on main screen while the app is in background in ios -

Image
thanks in advance. possible show capture screen assistive touch view in ios when click on application icon.means want show ipad screen , top on transparent background view need display. i want create app after clicking app icon want screen on main screen , can able customize , capture selected area. possible that. , there api that. i don't think allowed capture home screen in public api. question had similar request. how can take screenshot of iphone home screen programmatically uigetscreenimage() mentioned in answer useful, if targeting jailbroken phones. however, found open source library called "record screen", claim can record display on non-jailbroken iphones. i didn't test that, since believe apple somehow find , pull app off (that happened several apps before). if interested in it, maybe can learn library. hope helps you.

My Libgdx game slow when integrated Admob -

i new game developing libgdx. have problem admob ads. when call "adview.loadad(adrequest);" game slowl, when start game, fps ~ 60 , when call adview.loadad(adrequest) game fps ~ 30. here public class mainactivity extends androidapplication implements iactivityrequesthandler { protected adview adview; adrequest adrequest; private final int show_ads = 1; private final int hide_ads = 0; protected handler handler = new handler() { @override public void handlemessage(message msg) { switch (msg.what) { case show_ads: { system.out.println("show adview"); adview.setvisibility(view.visible); break; } case hide_ads: { adview.setvisibility(view.gone); break; } } } }; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // create layout relativelayout l

Comparison of String vb.NET -

i trying compare compare string values. dim tod string = "04/02/2016_01:20" dim dbookto string = "08/02/2014_01:30" if tod = dbookto 'do if tod<dbookto 'do if tod>dbookto 'dosomething endif ideally want here 3rd condition executed because "08/02/2014_01:30" smaller "04/02/2016_01:20". 2nd condition being executed. please me here. that's because you're performing string comparison, means input compared char char, until first difference found. first difference on second character, between 4 , 8 . , because 4 lower 8 that's makes tod lower dbookto . to make work , compare values, not string representation have use proper type, in case datetime : dim tod datetime = new datetime(2016, 2, 4, 1, 20, 0) dim dbookto datetime = new datetime(2014, 2, 8, 1, 30, 0) you can datetime instance string using datetime.parseexact method: dim todstring string = "04/02/2016_01:20" d

javascript - json encode not working in ajax -

im trying send array php javascript using ajax. array consists of fields retrieved database. tried using json_encode sending array returns null value. read on internet , found problem content-type. content type has set text/json. using text/xml in php code assume necessary ajax call in javascript.(i tried replacing text/xml text/json xmlhttpobject became null) here php code: <?php header('content-type: text/xml'); echo '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>'; echo '<response>'; require 'connect.inc.php'; $sub=$_get['sub']; $no=$_get['no']; $query="select * ".$sub." id='".$no."'"; if($query_run=mysql_query($query)) { if($query_row=mysql_fetch_assoc($query_run)) { $ques=$query_row['question']; $op1=$query_row['op1']; $op2=$query_row['op2']; $op3=$query_row['op3'];

c - Bits operations implementations -

i have return 1 if bit in x set, 0 otherwise in is_set function. got stuck here. have no idea next...any ideas?? appreciated.... #include <string.h> #include <stdio.h> const char *to_binary(unsigned int x) { static char bits[17]; bits[0] = '\0'; unsigned int z; (z = 1 << 15; z > 0; z >>= 1) { strcat(bits, (x & z) ? "1" : "0"); } return bits; short is_set(unsigned short x, int bit) { return x & (1 << bit) ? 1 : 0; } alternatively, short is_set(unsigned short x, int bit) { return (x >> bit) & 1; }

sql - cakephp mysql ,autoincrement id or varchar as primary key -

i building web application cakephp 2.4 , have firstly designed users table integer auto-incrementing id, since urls structured : http://mywebsite/users/view/username realized instead of using integer auto-increment, may better performance use username(varchar 100) primary key.now curious how approach affect site performance when database grows. as per other answers, use integer pk. pick correct int size depending on how many records you're expecting. not using integer pk cake might cause problems. if you're using framework, stick it's conventions - that's advantage of framework! do not generate unique route every user dynamically in routes.php. goes against entire point of having generic routing. 1 route should account this, , deal in relevant controller. for example, if specify of real controllers/actions: router::connect('/:controller', array('controller' => 'user|anothercontroller|etc')); router::connect('/:action&#

ASP.NET MVC post method parameter is always nothing (null) -

i'm sending json asp.net mvc sencha touch: ext.ajax.request({ url: 'http://localhost:52771/api/login', method: 'post', headers: { 'content-type': 'application/json' }, params: { post: json.stringify({ user: username, pwd: password }) }, }, success: function (response) { var loginresponse = ext.json.decode(response.responsetext); if (loginresponse === true) { // server send token can used throughout app confirm user authenticated. me.sessiontoken = loginresponse.sessiontoken; me.signinsuccess(); //just simulating success. } else { me.signinfailure(loginresponse.message); } }, failure: function (response) { me.sessiontoken = null; me.signinfailure('login failed. please try again later.'); } });

php - what does name="data[user][pass] in input tag means? -

i found inside input tag of website: ... name="data[user][pass]" ... what mean? how can make php in tag attribute? , how can read this? if present in <input> tag , when corresponding form gets submitted php script can accessed like: $_get['data']['user']['pass']; // or $_post['data']['user']['pass']; depending on request method.

javascript - Videogular - How do i get started with Videogular -

i'm beginner of html5. want use videogular my questions: how started videogular? how configure (or) implement in html page? is specification need implement videogular?. i referred videogular api still, in blank.

c# - Using Generics to Multiply Integers -

i have class called genericitem (first time using generics), suppose wanted multiply 2 items if of type integer, can see trying in method returncountermultiply , not allow me multiply them although trying convert them , checking if of type integer. namespace components { public class genericitem<t> { private t data; private t counter; public t data { { return data; } set { data = value; } } public genericitem(){} public genericitem(t _data) { data = _data; } public t returncountermultiply(t value) { int c = 0; int d = 0; if (counter.gettype() == typeof(int) && value.gettype() == typeof(int)) { //cant multiply 2 of type t, why if converting int?. return (t)convert.changetype(counter, typeof(int32)) * (t)convert.changetype(value, typeof(int32)); }

javascript - Click Event and option value -

here come 2 question 1 on onload listbox hide depend of radio button listbox had show/hide listbox not working here , other 1 have check if listbox option value contain null value or empty space if means have remove it. thats not working there mistake in code 1 on . <script> if ($('input[name=b]:checked').val() == "city") { $("#country,#zone,#state,#areamanager,#outlet").val(''); $("#country_value,#zone_value,#state_value,#areamanager_value,#outlet_value").val(''); $("#city").show(); $("#country,#zone,#state,#areamanager,#outlet").hide(); } $.each(main, function (i, val) { if (val == "null value" || val == "") { val = null; } }); </script> refer link had @ fiddle provided fiddle http://jsfiddle.net/varinder/thxn3/1/ it considered bad practice inline js event calls. usualy ind

parallel processing - Reshape an outer layer of a 3D array to 1D array -

i have 3d array, msh(0:m+1,0:n+1,0:l+1) representative of cartesian mesh grid. reshape outer layer 1d array. best way (efficient memory point of view)? currently reshape plane plane starting -z,+z,: array(1:m*n)=reshape(msh(1:m,1:n,0),m*n) array(m*n+1:2*m*n)=reshape(msh(1:m,1:n,l+1),m*n) my first question weather reshaping being done in memory efficient way! or there other way using loop faster , more memory efficient (the size of arrays huge). secondly, if have several of these arrays in different processors best way gather these outer layers in master node (e.g. rank=0 ) using mpi . it's o(2*m*n+2*l*m+2*l*n) problem way it, one option series of loops: allocate(array(2*m*n+2*l*m+2*l*n)) h = 1 j=1,n i=1,m array(h) = msh(i,j,0) array(h+m*n+1) = msh(i,j,l+1) h = h+1 enddo enddo k=1,l i=1,m array(h) = msh(i,0,k) array(h+m*l+1) = msh(i,n+1,k) h = h + 1 enddo enddo k=1,l j=1,n array(h) = msh(0,j,k)

eclipse - Can't Delete item in Android listView more than one time -

when select item in listview , use longclick, i want remove listview after delete one i can't delete other item need help. what did wrong ?? :: think files[i] in if condition in onitemlongclick but have no idea @ all.. public class screen2 extends activity implements adapterview.onitemlongclicklistener { listview listview1; private arrayadapter<string> adapter1; private file[] files; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.screen2); setupgui(); adapter1 = new arrayadapter<string>(this,android.r.layout.simple_list_item_1); file f = new file("/sdcard/"); files = f.listfiles(); for(file ff:files){ if(ff.isfile() ==true){ adapter1.add("file " + ff.getname()); } else if(ff.isdirectory() == true){ adapter1.add("

Getting 'root" permission for Android App -

i know how can root permission android app? there app out there in android market? i tried out below line of code list out files nothing happened process process = runtime.getruntime().exec(new string[] { "su", "-", "root"}); i tried give test_factory permission in manifest file got error "permitted system app" how can make app system app? i want started these stuff (make app if possible root permission) on appreciated. in advance :) first: note can execute shell commands using su (= can use shell commands root, not java code). second: not sure if applies su apps out there, message of su on phone: usage: su [options] [--] [-] [login] [--] [args...] options: --daemon start su daemon agent -c, --command command pass command invoked shell -h, --help display message , exit -, -l, --login pretend shell login shell -m, -p, --preserve-envi

c# - How to get only list of Folder name in FTP? -

how list of folder name of ftp not files names of folder,suppose have 4 folder (a,b,c,d) want 4 folder name not files ? working in c#. i have seen code gives list of files . i have tried code , giving me files name folder name, need folders name only. regards haider try this string htmlresult = string.empty; console.writeline("starting listing of files...."); ftpwebrequest request = (ftpwebrequest)webrequest.create(properties.settings.default.ftpurl); request.credentials = new networkcredential(properties.settings.default.ftpusername, properties.settings.default.ftppassword); request.usepassive = false; request.method = webrequestmethods.ftp.listdirectorydetails; ftpwebresponse response = (ftpwebresponse)request.getresponse(); using (stream responsestream = response.getresponsestream()) { using (streamreader reader = new streamreader(responsestream)) { string _line = reader.readline(); while (_line != null && _line != strin

PHP cronjob variables -

i have complete old project uses php cronjob. within cronjob have check variable this defined('_cronjob') or die; this constant can take different values indicate job do: switch(_cronjob){ //...more code } how can set variable when calling cronjob. in advance. since you'll use cron launch script, can use cli parameters , pass value script. handle parameters can use simple way, like: define('_cronjob', $_server['argv'][1]); //equal 1-st parameter in case launch like: /path/to/bin/php /path/to/script.php foo and _cronjob equal foo alternative , more advanced way use getopt() , grab named parameter. more readable , you'll able not rely on parameter order (i.e. first exactly). recommend use way.

c++ - glReadPixels is reading from the wrong location -

i trying read color of rectangle drawn on screen, when try read coord, appears reads offset offset not consistent. (i using sdl2 library in case helps) have found inverting coordinates e.g. if y 0 y_max. i need know how can read pixel correct coord, not care method use faster 1 optimal. i not understand of code being thrown in here, i'm pretty new images know cast project matrix here, glenable(gl_texture_2d); gluint texture; glgentextures(1, &texture); glbindtexture(gl_texture_2d, texture); gltexparameteri(gl_texture_2d, gl_texture_min_filter, gl_nearest); gltexparameteri(gl_texture_2d, gl_texture_mag_filter, gl_nearest); glteximage2d(gl_texture_2d, 0, image->format->bytesperpixel, image->w, image->h, 0, gl_rgb, gl_unsigned_byte, image->pixels); glortho(0.0f, 640.0f, 480.0f, 0.0f, -1.0f, 1.0f); and here drawing rectangle. glcolor3f(chrome[0], chrome[1], chrome[2]); gltranslatef(0, 0, 0.0f); glbindtexture(gl_texture_

Zend\Uuid why does exist in zend framwork2 -

i want use zend\uuid , found here but when check local zend doest exist how should use application ? it not exist. wiki page linked proposal component, , 1 never made framework.

c++ - How to test if a variable is initialized? -

how test if variable has been initialized using if statement. thanks everybody. wasn't needing test if initialized. received solution , information uninitialized variables well. generally cannot , bad practice use uninitialized variables. you may use this: int x = -1; .... rest of code .... if( x == -1 ) { } in above example assumed under program execution x never set -1 . if -1 uninitialized.

vba - Microsoft Common Controls missing -

i got strange issue new pc, running windows 7 x64 , ms office 2013 x64: on other notebook (windows 8.1 x64/office 2013 x64) i've created ms access db, uses microsoft treeview control active-x. cannot find control on pc , therefore not open db on pc on notebook. mscomctl.ocx missing on pc, copied notebook, placed in syswow64 folder , registered regsvr32 (both 32 , 64 bit) still no treeview (same listview or other vb6 active-x control). i've searched net clues , found info, nothing helped (including object library not registered when adding windows common controls 6.0 ). when manually add mscomctl.ocx reference new access db (by opening vba editor ==> extras ==> references), "ms windows common control 6.0 (sp6)" appears in reference list, still no treeview control available. i don't know else do... any info appreciated! you have use 32 bit version of access. there no x64 bit version of common controls.

How to change the color of an array index in android? -

this question has answer here: how change color of array element in android? [closed] 2 answers i want change color of particular array index , have following array -: string [] all={"1","2","3","4","5","6","7","8","9","10"}; gridview gridview = (gridview) findviewbyid(r.id.gridview); arrayadapter<string> adapter = new arrayadapter<string>(this, android.r.layout.simple_list_item_1, all); gridview.setadapter(adapter); new arrayadapter<string>(this, r.layout.item_layout); gridview.setchoicemode(1); gridview.setitemchecked(6, true); xml code -: item_layout.xml <?xml version="1.0" encoding="utf-8"?> <textview xmlns:android="http://schemas.android.co

java - Create web service proxy dynamically and call its methods -

i have requirement call 52 web services 1 java project , number increase time. using netbeans 7.3 development tool. 1 way right click project , add web service reference each service. not feasible because every new web service have add new reference , redeploy code. these 52 web services calling each other have enter references each web service in every other service if go approach. i hope have explained scenario. ask question. if have url wsdl file e.g. http://webservices.oorsprong.org/websamples.countryinfo/countryinfoservice.wso?wsdl , know method in web service need call, there way parse wsdl dynamically create proxy client , after call specific method in web service? have come accross javaxt api http://www.javaxt.com/javaxt-core/web_services intends same not working properly. to sum question - if have wsdl url , don't want create compile time stubs know methods in url take inputs , return values, can it? the javaxt-core library should work. there release pu

asp.net mvc - How to render ascx control in mvc controller class -

Ä° have hybrid project. web forms project before convert mvc project , old pages web forms , new ones mvc. i have control named pickimage.ascx normally can load control using following code. controls_imagepicker imagepicker = (controls_imagepicker)loadcontrol("~/controls/imagepicker.ascx"); imagepicker.fileclass = fileclass.course_icon; imagepicker.randomifempty = false; imagepicker.fileid = iconid; but want same thing in mvc controller page. how can this? i have create instance of page , loaded control. page aspx = new page(); controls_imagepicker imagepicker = (controls_imagepicker)aspx.loadcontrol("~/controls/imagepicker.ascx");

file - log4j:ERROR setFile(null,true) call failed.java.io.FileNotFoundException: -

i'm getting below error while compiling application log4j:error setfile(null,true) call failed.java.io.filenotfoundexception:\gel\ms\ex\ms.log (the system cannot find path specified) below log4j config file: #root log level log4j.rootcategory=debug, r log4j.logger.java.sql=debug log4j.logger.com.ibatis=debug # first type of log, output file log4j.appender.r=org.apache.log4j.rollingfileappender log4j.appender.r.file=/gel/ms/ex/ms.log log4j.appender.r.maxfilesize=5000kb log4j.appender.r.maxbackupindex=3 log4j.appender.r.layout=org.apache.log4j.patternlayout log4j.appender.r.layout.conversionpattern=%d [%40c] %5p - %m%n and project folder hierachy ms(project name) java resource webcontext 2.a -meta-inf 2.b -web-inf please advise. thanks for quick solution, set absolute path.

javascript - Write a regexp parsing URL -

i trying write regex following if have url example.com?mask=33&filter=23423&mode=12 it match substring filter=23423 i need consider url can be example.com?filter=23423 thanks in advance. you may not consider [\?&] in regexp , put /filter=[0-9]*/ if sure there not params other_filter=987 in url. if may have such use substr on resulted regexp url.match(/[\?&]filter=[0-9]*/)[0].substr(1)

jquery triggering not working in firefox extension -

steps reproduce: i created hai.html , using pagemod injected scripts that, here code , hai.html https://github.com/suneeshtr/trigger-test.git actual results: injection of scripts , works fine except triggering. when tried append file works.. here part of code: alert("content"); $(document).ready(function() { var values = [{val:'santiagotactivos', meta:'santiago montero'}, {val:'johnnyhalife', meta:'johnny halife'}, {val:'arielflesler', meta:'ariel flesler'}, {val:'rbajales', meta:'raul bajales'}]; var customitemtemplate = "<div><span />&nbsp;<small /></div>"; function elementfactory(element, e) { var template = $(customitemtemplate).find('span') .text('@' + e.val).end() .find('small') .text("(" + e.meta + ")").end(); element.append(template); }; alert(json.stringify($("textarea"))); // here how use $('te

c# - Change in string some part, but without one part - where are numbers -

for example have such string: ex250-r-ninja-08-10r_ how change such string? ex250 r ninja 08-10r_ as can see change - space, didn't change have xx-xx part... how such string replacement in c# ? (also string different length) i - string correctstring = errstring.replace("-", " "); but how left - number pattern xx-xx ? you can use regular expressions perform substitutions in cases. in case, want perform substitution if either side of dash non-digit. that's not quite simple might be, can use: string replacesomehyphens(string input) { string result = regex.replace(input, @"(\d)-", "${1} "); result = regex.replace(result, @"-(\d)", " ${1}"); return result; } it's possible there's more cunning way in single regular expression, suspect more complicated :)

perl - Print pipe per character instead of newline -

in perl now: while (<$pipe>) { print $_; } but gives me output linewise. how can make print lets say, each character, or split \r instead of \n . pipe feeds me data on newline. (i want print output process, , process using \r print process progress, ends simple line 100% me..) perl has concept of “input record separator” $/ set separate lines. can read full documentation here . whenever read line/record filehandle, data read until end of file, or until current string inside $/ variable has been read. for example: given input bytes aabaa , , $/ = "b" , my @records = <$fh> produce ('aab', 'aa') . note separator included, can removed chomp (regardless of separator has been set to). when reading file, $/ has set before lines read, so: local $/ = "\r"; # "local" avoids overriding value everywhere while(my $line = <$pipe>) { chomp $line; ... } there few special values $/ : the empty s

sqlite - Flash Flex Builder 4.6 Mobile Autocomplete -

how can autocomplete in flash flex builder 4.6 mobile app sqlite contents. trying lot , searched lot in internet couldn't able find out valid answer. i have done desktop , web app not able autocomplete mobile app. i able create combo box want live search capability mobile app. want develop auto search mobile app using sqlite , flash flex builder 4.6. please me out !!! in advance .... i have completed text input suggestion component flex web project! hope can reference http://www.mediafire.com/view/9fzqlwv9b5y5i39/textinputsuggesstion.mxml

javascript - Cascading Select Boxes with Backbone.js -

i'm found useful link http://blog.shinetech.com/2011/07/25/cascading-select-boxes-with-backbone-js/ how populate these restful response continent select tag: {"_count":6,"data":[{"id":"6","continent":"north america","code":"na","sort_order":"6","published":"1","date_created":"2014-02-02 13:16:54","createdbypk":"1","date_modified":"2014-02-02 21:17:10","modifiedbypk":"1"},{"id":"1","continent":"asia","code":"as","sort_order":"1","published":"1","date_created":"2014-02-02 12:31:42","createdbypk":"1","date_modified":"2014-02-02 21:16:31","modifiedbypk":"1"}]} here js code: $(function () { var c

python - Why can't the contents in these three entries change simultaneously? -

firstly let's @ program: def entry_simutaneously_change(): tkinter import * root=tk() text_in_entry.set(0) entry(root, width=30, textvariable= text_in_entry).pack() entry(root, width=30, textvariable= text_in_entry).pack() entry(root, width=30, textvariable= text_in_entry).pack() root.mainloop() the contents in these 3 entries can change simultaneously. if change value of of them, other 2 change @ same time. however, following program: def entry_simutaneously_change(): tkinter import * root=tk() text_in_entry_list=[intvar() in range(0,3)] text_in_entry_list[0].set(0) text_in_entry_list[1].set(text_in_entry_list[0].get() ** 2) text_in_entry_list[2].set(text_in_entry_list[0].get() ** 3) entry(root, width=30, textvariable= text_in_entry_list[0]).pack() entry(root, width=30, textvariable= text_in_entry_list[1]).pack() entry(root, width=30, textv

php - suggesting friends that are not already a friend with the user -

i want suggest friends user. need validate if friend suggesting not friend user have 2 tables called user, friendship i try code can't proceed coz have no more idea $sql=“select user.fullname,user.userid users user. userid not in( select * friendship userid = '$userid') “; i'm using php , mysql try friendship.userid $sql = "select user.fullname,user.userid users user. userid not in( select friendship.userid friendship userid = '$userid')"; you need check userids friends of user

kerberos - Purpose of mapuser in ktpass -

i want find out purpose of mapping user service using ktpass is. example on windows , run ktpass this ktpass -out <keytab location> -princ <host/domain.com> -mapuser useraccount@domain.com -mapop add ......... when map user -princ mean "useraccount" can authenticate service? , how use -add , -set option? difference.? my issue this: have many users wanting use service have, , authenticate through kerberos (jass krb5loginmodule) don't want specify many user principal names in jaas.config file. thinking of using spn instead, , mapping users. cheers option -mapuser useraccount@domain.com tells ktpass store 'principal' in attribute userprincipalname of user in active directory, active directory able find it, when clients ask kerberosserviceticket 'principal' , issue such ticket. -mapuser specifies name of user, represents service in active directory. using ktpass you're doing 2 things: generating keytab service (so

c# - Execute stored procedure w/parameters in Dapper -

i'm using dapper (thanks sam , great project.) micro orm dal , reason i'm not able execute stored procedures input parameters. in service i've got this: public void getsomething(int somethingid) { irepository<something, somethingenum> repository = unitofwork.getrepository<something, somethingenum>(); var param = new dynamicparameters(); param.add("@somethingid", dbtype: dbtype.int32, value:somethingid, direction: parameterdirection.input); var result = repository.exec<something>(somethingenum.spmystoredprocedure, param); ... } when execution of stored procedure happens sqlexception thrown stating need provide 'somethingid' procedure or function 'spmystoredprocedure' expects parameter '@somethingid', not supplied. my dal similar based on github project of pencroff. am missing here? update: passing commandtype via somethingenum: public class somethingenum : enumbase<som

How to export PDF/CSV files using Javascript? -

is there way create pdf/csv files using javascript supports both desktop , device browsers? have tried using jspdf , has support desktop browsers , not working on mobile browsers. there libraries have support on both desktop , mobile browsers? thanks in advance.

ios - Is Bolts framework[Parse+Facebook] need to use parse webservice? -

i post question how use bolts framework[facebook+parse] i've question, must use parse webservice if want use bolts-framework? they provide sample code below related( saveasync: ) parse webservice. i've seen in line "using these libraries not require using parse services. nor require having parse or facebook developer account" in boltss' github [[object saveasync:obj] continuewithblock:^id(bftask *task) { if (task.iscancelled) { // save cancelled. } else if (task.error) { // save failed. } else { // object saved successfully. saveresult *saveresult = task.result; } return nil; }]; now confusion, is bolts framework need use parse webservice? note: don't ask want use bolts-framework. see first line of question. surely doesn't need parse webservice. i've same difficulty in implementing own task , i'm studying framework. take @ boltstest code : can find useful code. i'm trying experiments in sampl

jquery - PHP $_SESSION not working with Fancybox AJAX cal -

i'm having real battle here , hoping out. late last night trying every solution google offered still not had success. my site has list on ingredients i'd add recipe. to process is: click "add recipe". opens fancybox iframe containing jquery ui tabbed content allows users enter measurement in grams. from here user clicks "add" , fancybox content makes ajax call (having built data string created fine).. the php file called ajax cast value passed int (of food id , weight) , stores in the: $_session['recipe'][] = array('id' => $id , 'weight' => $weight); once complete fancybox closes , div on starting page (step one) contains calorie information recipe should reload , update. all steps seem work except 3. whenever try vardump session it's empty. i've started session on each page, i.e. step 1, the fancybox page, ajax called page. i'm @ total loss. my ajax call @ step 3 is: $(document).o

java - JAXB eclipse error: There's no JAXB 2.2 API in the classpath -

i trying generate java classes xsd. added library following 2 files: com.sun.xml.bind_2.2.0.v201004141950.jar , com.sun.tools.xjc_2.2.0.jar , still gives me error exception in thread "main" java.lang.classnotfoundexception: there's no jaxb 2.2 api in classpath @ com.sun.tools.xjc.classloaderbuilder.createprotectiveclassloader(classloaderbuilder.java:82) @ com.sun.tools.xjc.xjcfacade.main(xjcfacade.java:65) what can problem? when created project chose jaxb 2.1 jre target runtime. need include make run? make sure include jaxb-impl.jar library in project. can download 1 example here: http://repo1.maven.org/maven2/com/sun/xml/bind/jaxb-impl/2.2.4/jaxb-impl-2.2.4.jar if you're using maven, can include dependency, otherwise download file , add library in project. if need different version of library, move 1 directory in link added above, can find other versions there well. if want automate class generation, since you're changing schema on regular

jquery - How do I make a file field required using javascript? -

i'm trying make form attachment field(file). want validate field. know how php, i'd rather use javascript it. know way this? searched around internet couldn't find solution.. this file field: <input type="file" name="image" id="image" accept="image/*" /> you can try with: <input type="file" name="image" id="image" accept="image/*" required /> and check js: if ( $('#image').is(':empty') ) { // empty }

jquery - Simpledialog2 Open partial view inside it -

i working on asp.net mvc3 application. want render site on mobile . function openpopup() { $('#registerform').simpledialog2({ mode: 'blank', headertext: 'some stuff', headerclose: true, blankcontent : "<ul data-role='listview'><li>some</li><li>list</li><li>items</li></ul>"+ "<a rel='close' data-role='button' href='#'>close</a>" }) } now want open partial view inside simpledialog2 . how can open it? partial view is @html.partial("_loginpopup", model) any help?