Posts

Showing posts from February, 2011

login - Display logged in user asp.net -

i have made little custom log-in page in asp.net, see code: dim strcon string = configurationmanager.connectionstrings("goed").connectionstring 'create connection string , sql statement dim strselect string = "select count(*) tbl_login gebruiker = @gebruiker , wachtwoord = @wachtwoord" dim con new sqlconnection(strcon) dim cmd new sqlcommand() cmd.connection = con cmd.commandtype = commandtype.text cmd.commandtext = strselect dim gebruiker new sqlparameter("@gebruiker", _ sqldbtype.varchar) gebruiker.value = txtus.text.trim().tostring() cmd.parameters.add(gebruiker) dim wachtwoord new sqlparameter("@wachtwoord", _ sqldbtype.varchar) wachtwoord.value = txtpw.text.trim().tostring() cmd.parameters.add(wachtwoord) con.open()

XMPP connecting to server (Python) -

i following tutorial/getting started on creating google talk bot i have made echobot fails @ runtime following error: file "echobot.py", line 59, in <module> if xmpp.connect(('talk.google.com'), '5222'): file "c:\python31\lib\sleekxmpp\clientxmpp.py", line 143, in connect reattempt=reattempt) file "c:\python31\lib\sleekxmpp\xmlstream\xmlstream.py", line 372, in connect self.address = (host, int(port)) valueerror: invalid literal int() base 10: 'a' i have tried python 3,3 , 3,2 , 3,1 interpreter same result. i can not these lines tutorial compile either of compilers: if sys.version_info < (3, 0): reload(sys) sys.setdefaultencoding('utf8') the code within bot fails follows: if xmpp.connect(('talk.google.com'), '5222'): xmpp.process(block=true) else: print('fekk ikkje kopla til') thanks tips/help! you have written wrong: xmpp.connect(('talk.google.com&#

ios - How to set title with UITabbarsystemitem -

i wanted know how can set title of tab bar item using uitabbarsystemitem ? what did : self.tabbaritem = [[uitabbaritem alloc] initwithtabbarsystemitem:uitabbarsystemitemfeatured tag:0]; so change title default instead of "featured" (because of uitabbarsystemitemfeatured object), wrote : self.tabbaritem.title = @"actu"; so in mind should have "actu" title instead of "featured". but changes nothing, title keeps being "featured" (default title). i tried : [[self.tabbarcontroller.tabbar.items objectatindex:0] settitle:nslocalizedstring(@"actu", @"actu")]; (because tabbaritem @ index 0), nothing changes. or maybe such modification not possible using uitabbarsystemitem objects ? i hope enough explained :/ ps : sorry english , else wrong, 1st post ever… :/ when uitabbaritem initalized using initwithtabbarsystemitem:tag: cannot change image or title properties later on.

javascript - Toggle DIV hide and show -

i trying toggle div(hide , show) when button 'commentdiv' pressed ..but not working far...my html code below. trying here hide/show div block button pressed....i don't know how bind button div....my code able hide div not show again...and think working first commentdiv not others... <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $('.commentdiv').hide(); $('.commentbutton').click(function () { $(this).next('.commentdiv').show(); }); $('.closebutton').click(function () { $(this).next('.commentdiv').hide(); }); }); </script> </head> <body> <div id="

(Problems Using Charts) WPF .net 4.5 -

i have been trying set function plot series of data, , chart control gives errors, , annoying, because there no proper tutorials control. so far have code: using system.windows.controls.datavisualization.charting; public datatable results; public void plot ( chart chr ) { int cols = results.columns.count; int rows = results.rows.count; ( int j = 1 ; j < cols ; j++ ) { //add serie string name = results.columns[j].columnname; //add data serie list<plotvalue> values = new list<plotvalue>( ); ( int = 0 ; < rows ; i++ ) { datetime? x = results.rows[i][0] datetime?; //time double y = double.parse( results.rows[i][j].tostring( ) ); //value values.add( new plotvalue( x , y ) ); } lineseries serie = new lineseries(); serie.legenditems.add( name ); serie.itemssource = values; chr.series.add( serie ); } } "results", datat

ember.js - Use "subcontrollers" in EmberJS -

i'm having trouble designing emberjs layout. have view divided in 2 parts : a content library on left a playlist editor on right currently, 2 elements share same controller. i can't figure how use 2 different controllers 2 sides able re-use content library in other views or having view 2 playlist editors. my root view looks far : <script type="text/x-handlebars" data-template-name="playlists"> <div id="library">{{template library}}</div> <div id="playlisteditor">{{template playlisteditor}}</div> </script> i saw docs {{control}} helper, unstable , i'm not sure i'm looking for. thanks ! okay, found answer, had use {{render}} helper, : <script type="text/x-handlebars" data-template-name="playlists"> <div id="library">{{render "library" library}}</div> <div id="playlisteditor">

php - Select specific column(s) using Propel without aliasing -

i'm having quite bit of trouble rewriting simple query using methods provided propel 1.6. the query follows: select type_id, count(id) `count` visit group type_id; using propel, i've written following: $visitcount = visitquery::create() ->withcolumn('count(id)', 'count') ->groupby('typeid') ->find(); this generates following query: select visit.id, visit.job_id, visit.engineer_id, visit.type_id, visit.visit_date, visit.status, count(id) count `visit` group visit.type_id which works, i need columns type_id , count , tried adding following: $visits = visitquery::create() ->withcolumn('count(id)', 'count') ->select(array('typeid')) ->groupby('typeid') ->find(); this generates following (working) query: select count(id) count, visit.type_id "typeid" `visit` group visi

Google Analytics - Group by custom variable value -

Image
i want track visitors web site. want track them "organization" , "username" in google analytics. want able group users organisation. today have code: _gaq.push(['_setcustomvar', 1, 'organization', theorganization]); _gaq.push(['_setcustomvar', 1, 'username', theuser]); note both variables has same "index or slot" (1), means variables listed under same "key" in google analytics app. seems me 1 of values gets set though , makes me think should use different index/slots/keys. (such great thing when names same throughout service , docs) however, i'm not sure can use data after change slot - cannot find way "group organization" operation. when select "secondary dimension" in reports view cannot find "custom variables" in there.. @ possible? you need use slot per different key: _gaq.push(['_setcustomvar', 1, 'organization', theorganization]); _gaq.pus

button click action to close view with extjs 4 -

i have login form when click connect button want go view , close thhe login view. it souce code: login view ext.define('ext4example.view.login.loginform' ,{ extend: 'ext.form.formpanel', alias : 'widget.login', bodystyle: "background-image:url('resources/images/logo.png')", margin: '100 50 10 450', width:500, height:320, frame: true, initcomponent: function() { this.items= [{ xtype: 'textfield', name : 'id', fieldlabel: 'id', hidden:true }, { xtype: 'textfield', x:100, y:100, cls:'user', emptytext : "votre nom d'utilisateur...", fieldlabel:"nom d'utilisateur", name:'j_username', },{ xtype: 'textfield', x:100, y:100, emptytext : "votre mot de passe...", name:'j_password', fieldlabel:'mot de pass

Delphi can't recognize Russian characters -

i have english version of windows xp operating system installed on computer. if try use russian input language, example, give form caption that's written in russian, thing see unintelligible symbols see when there problem proper character encoding. there way make delphi recognize russian characters? any suggestions highly appreciated. you can change default code-page used programs not provide locale info (control panel > regional setting > advanced) locale (russian). as sql separate question solved sql db settings. p.s. suggest move unicode version of delphi (xe) , sql too.

sql - Optimize MySQL query because it gets time out -

can me optimizing query. can not execute because phpmyadmin connection gets timed out , have no access change time out parameter. here query: insert `goods` (`goods_id`, `price`, `name`) select `sales_goods`.`goods_id`, `sales_goods`.`price`, `sales_goods`.`goods_id` `sales_goods` `sales_goods`.`sales_goods_id` in ( select max(`sales_goods`.`sales_goods_id`) `sales_goods` `sales_goods`.`sales_goods_id` in ( select `sales_goods`.`sales_goods_id` `sales_goods` `sales_goods`.`goods_id` not in (select `goods`.`goods_id` `goods`) ) group `sales_goods`.`goods_id` ) aside ensuring tables propery indexed can replace in subqueries inner join , , not in subqueries left join/is null , should improve performance: insert `goods` (`goods_id`, `price`, `name`) select `sales_goods`.`goods_id`, `sales_goods`.`price`, `sales_goods`.`goods_id` `sales_goods` inner join ( select max(`sales_goods`.`sales_g

How to split a string at a particular character in Rebol -

i haven't figure out how split string in cleaner way. ref: copy/part (find line "#") -15 rest2: copy/part (skip (find line "#") 1) 450 -15 going beginning , 450 go end. it not nice because put value. what proper solution ? a warning front: there many different ways achieve in rebol. you'll quite few different suggestions. for start, let's stick original approach of using find. when use find series, new view onto underlying series data, positioned @ different offset start of series data. let's start example data: >> line: copy "this foo#and here comes long bar" == "this foo#and here comes long bar" let's find # character within line, , refer result pos: >> pos: find line "#" == "#and here comes long bar" as can see, gives second part (what called rest2) of split. you'll have skip past delimiter (and copy resulting string, make independent original line st

expect script to ssh returns invalid command name -

i trying write expect script ssh server, send sudo su, check iptables status , put output in log file on server. below script. 1 #!/usr/bin/expect 2 exp_internal 1 3 log_user 0 4 set timeout 10 5 set password "******" 6 7 spawn /usr/bin/ssh -l subhasish *.*.*.* -p 10022 8 9 expect { 10 -re "password: " {send "$password\r"} 11 -re "$ " {send "sudo su\r"} 12 -re "[sudo] password subhasish:" {send "$password\r"} 13 -re "# " {send "service iptables status\r"} 14 } 15 set output $expect_out(buffer) 16 send "exit\r" 17 puts "$output\r\n" >> output.log but while run in debug mode, getting error this; expect -d testcase expect version 5.44.1.15 argv[0] = expect argv[1] = -d argv[2] = testcase set argc 0 set argv0 "testcase" set argv "" executing commands command file testcase parent: waiting

regex - python reg exp: how to delete a field delimited by [ and ] from a string -

i have file , every line looks this: 2013-04-23 16:04:12.276 bla[16878:950f] 'asdf' : 0, 'asds': 0, 'adf': 0 i need replace part bla[16878:950f] , . note text bla same, text within [ and ] different , can have different length. what need @ end is: 2013-04-23 16:04:12.276, 'asdf' : 0, 'asds': 0, 'adf': 0 any ideas? i'm bad @ regular expressions, think way. thanks >>> import re >>> line = "2013-04-23 16:04:12.276 bla[16878:950f] 'asdf' : 0, 'asds': 0, 'adf': 0" >>> re.sub(r'bla\[[^\]]+\]', ',', line) "2013-04-23 16:04:12.276 , 'asdf' : 0, 'asds': 0, 'adf': 0" i think want replace spacebla[16878:950f] though: add space in if wish

android - images url are not displaying in grid -

i have set gridview image url..i can't able see image in grid.. shows background...and on click grid plays in next screen. what im doing wrong? how implement this? thanks lot in advance my code public class act extends activity { static string uri1="https://i3.ytimg.com/vi/bqawsvqsldy/default.jpg"; static string uri2="https://i4.ytimg.com/vi/cjqcniwqdno/mqdefault.jpg"; static string uri3="https://i1.ytimg.com/vi/d8da4pe5hey/mqdefault.jpg"; public static string[] urls={uri1,uri2,uri3}; public bitmap bitmap; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); gridview grd=(gridview)findviewbyid(r.id.gridview1); grd.setadapter(new imageadapter(this)); grd.setonitemclicklistener(new onitemclicklistener() { public void onitemclick(adapterview<?> parent,view v,int pos,long id) { toast.maketext(getbasecontext(),"pic&

ios - Colour of a substring in a string of text view -

i have text view like: uitextview statictxt = [[uitextview alloc]initwithframe:cgrectmake(10, 80, 300, 400)]; statictxt.backgroundcolor = [uicolor clearcolor]; statictxt.text = @"this textview"; statictxt.textcolor = [uicolor whitecolor]; [self.view addsubview:statictxt]; now want text "textview" should in different colour. how can this? thanks!! you need create attributed text string, described in answer: underline text in uitextview

How to get the JSON response from the Greenhopper REST API in Gadget? -

i not able response greenhopper rest api url http://:2990/jira/rest/greenhopper/1.0/sprints/1 through gadget application. i able following output when try browser, below output. {"sprints":[{"id":1,"name":"sprint 1","closed":false}],"rapidviewid":1} my code snippet retrive sprint details in gadget : args: { key: "sprints", ajaxoptions: function () { return { url: "/rest/greenhopper/1.0/sprints/1", }; } } can sugget me how json response greenhopper rest api jira dashboard. i getting following exception in server: [talledlocalcontainer] @ java.lang.thread.run(thread.java:662) [talledlocalcontainer] 2013-04-25 15:26:58,985 http-2990-11 error admin 926x5323x1 dggnll 172.27.186.82 /rest/greenhopper/1.0/sprints/1 [common.error.jersey.throwableexceptionmapper] uncaught exception thrown rest service [tal

Is it possible to write EXIF data using Python 3 on Windows? -

i have set (hundreds) of jpeg files need equip (write access) exif data. use python3 can batch process files , incorporate in data flow. i have looked @ gexiv2 , haven't found way use in windows. this so question 2009 similar, mine more specific. question : how can write exif data multiple jpeg files using python3 in windows? i prefer not use commercial software.

java - errors/exceptions accumulating design pattern -

a method returns result, making number of "attempts" build it. first attempt succeeds should return. if none of them succeed exception should thrown: class calculator { public string calculate() throws exception { // how design it? } private string attempt1() throws exception { // try calculate , throw if fails } private string attempt2() throws exception { // try calculate , throw if fails } private string attempt3() throws exception { // try calculate , throw if fails } } it's important mention exception thrown calculate should preserve stack traces of other exceptions thrown private methods. how recommend design calculate() method, extendability , maintainability in mind? i use composite , command. interface calculatecommand { public void calculate(calculatecontext context); } now create implementation each attempt want. next create compositecommand -- here outline (you need fill in blanks) public class c

Java Service Wrapper on Raspberry PI -

i'm trying use tanuki java service wrapper. hardware i'm using raspberry pi raspbian wheezy distribution. (see http://www.raspberrypi.org/downloads ) i've tried wrapper 32-bit armel release, problems reading libwrapper.so. info | jvm 1 | 2013/04/24 20:15:34 | wrappermanager: initializing... info | jvm 1 | 2013/04/24 20:15:42 | wrappermanager debug: attempt load native library name: libwrapper.so result: /usr/ihome/lib/libwrapper.so: /usr/ihome/lib/libwrapper.so: cannot open shared object file: no such file or directory i've tried armhf release, since seems "apt-get java-7-openjdk", installed jdk-armhf version, there did "segmentation fault" when starting wrapper. some info: pi@raspberrypi /usr/lib/jvm $ java -version java version "1.7.0_07" openjdk runtime environment (icedtea7 2.3.2) (7u7-2.3.2a-1+rpi1)openjdk 0 vm (build 22.0-b10, mixed mode) pi@raspberrypi /usr/lib/jvm $ ls -altr total 28

How to read file content in a javascript variable? -

i got small script split text inside 'var foo' after every 4 characters. working fine. actual data in text file 'a.txt'. how take entire file text in 'var foo'. , write split output text file? var foo = "this sample text !!!"; var arr = []; (var = 0; < foo.length; i++) { if (i % 4 == 0 && != 0) arr.push(foo.substring(i - 4, i)); if (i == foo.length - 1) arr.push(foo.substring(i - (i % 4), i+1)); } document.write(arr); console.log(arr); to content of file need select file using input tag. <!doctype html> <head> <meta charset="utf-8"> </head> <body> <input id="input" type="file" accept="text/plain"> <script src="script.js"></script> </body> a moment read content of file in change event. const input = document.queryselector("#input"); input.addeventlistener("change&

NodeManager not started in Hadoop Yarn -

i have setup hadoop , yarn in standalone mode now. trying start process in yarn. process started except nodemanager. throwing jvm error everytime. [root@ip-10-100-223-16 hadoop-0.23.7]# sbin/yarn-daemon.sh start nodemanager starting nodemanager, logging /root/hadoop-0.23.7/logs/yarn-root-nodemanager-ip-10-100-223-16.out unrecognized option: -jvm error: not create java virtual machine. error: fatal exception has occurred. program exit. what can issue? appreciated. following link has patch above issue : https://issues.apache.org/jira/browse/mapreduce-3879 in bin/yarn script, need comment following lines. here : '-' : shows removal of lines '+' : shows addition of lines elif [ "$command" = "nodemanager" ] ; classpath=${classpath}:$yarn_conf_dir/nm-config/log4j.properties class='org.apache.hadoop.yarn.server.nodemanager.nodemanager' - if [[ $euid -eq 0 ]]; - yarn_opts="$yarn_opts -jvm server $ya

javascript - Function hoisting in js -

function mymethod(){ alert("global mymethod"); } function mysecondmethod(){ alert("global mysecondmethod"); } function hoisting(){ alert(typeof mymethod); alert(typeof mysecondmethod); mymethod(); // local mymethod mysecondmethod(); // typeerror: undefined not function // mymethod , implementation hoisted function mymethod(){ alert("local mymethod"); } // variable mysecondmethod get's hoisted var mysecondmethod = function() { alert("local mysecondmethod"); }; } hoisting(); i not able understand how hoisting works in case , why alert("local mysecondmethod"); not shown. if can show me sequence helpful inside hoisting function code gets reordered follows: function hoisting(){ var mysecondmethod; function mymethod(){ alert("local mymethod"); } alert(typeof mymethod); alert(typeof mysecondmethod); mymethod(); mysecondmethod(); mysecondmethod

c# - Share common designer code between two pages -

i'm creating 2 version of same page. want create common ancestor i'll need access controls code best way have set of common controls inside shared designer.cs file asp.net recreate each page (due axiomatization) reach asp tags same id on aspx file. there way anyway? exmple (in code alike): common.cs partial class commonclass [...] function x myrepeater common.designer.cs (or other file name) partial class commonclass protected global::system.web.ui.webcontrols.repeater myrepeater; page1.cs page1 : commonclass page1.aspx [...] <asp:repeater id="myrepeater" runat="server" [...] page2.cs page2 : commonclass page2.aspx [...] <asp:repeater id="myrepeater" runat="server" [...] edit: page1 , page2 allow user see table , change it's content (there several other controls). page1 fills table using set of objects. page2 fills table using set of different objects. yet way page1 , page2 fill da

C++/Linux - Drawing to a Window -

i"m taking object oriented programming class, , did project had implement conway's game of life . project specification output lines of text terminal, shows evolution of cells, it's not pretty. thought fun modify program so, instead of sending lines of text terminal, drawing window updated current state of our cells. i'm not looking delve graphics...i'm fine using textual representation of cells original project specified. title of question implies, program written in c++ , made work on linux boxes. what's easiest way me make happen. edit: okay, think i'm pretty close. problem line breaks aren't appearing. in life "tostring" operator i've tried endl , \n , neither seems work. here code... #include <stdio.h> #include <stdlib.h> #include <string.h> #include <x11/xlib.h> #include <sstream> #include "cell.h" #include "life.h" int main (int argc, char *argv[]) { display

c# - LINQ to Entities: Orderby statement involving extension method -

i'm constructing simple search function site. aim allow user find 'swimmers' , add them list via search box, using query "bob staff". the first part of decided tackle allowing user search via group name (in database swimmers part of group). following code have @ moment. [httpget] public jsonresult searchforswimmers(string q) { //designed return [{name='foo',id='bar'}] string[] queryterms = q.split(' '); //all search terms sep. " " var groupresults = _db.swimgroups.where(g => g.name.containsany(queryterms)) .orderbydescending(g => g.name.startswithany(queryterms) ? 1 : 0) .thenby( g => g) .select(g => new { name = g.name, id = g.id }); return json(groupresults,jsonrequestbehavior.allowget); } on line 8, there method invoked called startswithany . extension method defined in following file: public static class stringutils

c# - WPF continouous Text -

which element good, if continouous text com , want display in box,like textbox. i want keep old text add in new line like: com data1: 0xff 14:10 pm com data1: 0xa3 14:10 pm com data1: 0x12 14:11 pm .... if use textbox , txtbox.text = comdata; it replace older text. thx you can do: txtbox.text = txtbox.text + environment.newline + comdata; you can use stringbuilder string concatenation like: stringbuilder sb = new stringbuilder(); public void yourmethod() { sb.append(comdata); sb.append(environment.newline); txtbox.text = sb.tostring(); } (why use stringbuilder see: stringbuilder vs string.concat )

asp.net - IIS7.5 server error 500 when web.config in subdirectory is present -

i have 2 iis7 servers working in nlb cluster, , replicated dfsr service. works. on each 1 have asp.net application. has web.config file. file replicated, it's identical on both servers. there 1 directory not replicated. special directory put data ajax scripts. files inside updated. then i've tried enable cors web.config file put inside special ajax directory. it works on first server, doesn't work on second one. on second 1 error 500 when try access file in ajax directory. i've double checked errors occur web.config content. if web.config file present in directory, web server refuses serve files there. problem not related web.config content. created file manualy, , iis manager. no matter set, if file present, 500, period. there no such problem on first server. accepts valid configurations in web.config. both servers use same configuration. (or @ least should be) clones. i've checked system logs - no trace of 500s. happens? broken or misconfigured,

html - Why is there a faint border around the photo? -

Image
i adding content page: http://rouviere.com/index-new , reason there faint border around inset photo in top section. here html: <div class="illustration"> <img class="promo" src="http://www.rouviere.com/_photos/slides_photos.jpg" alt="we package up" /> </div><!-- end #illustration --> <div class="headline"> <h2>photos</h2> <p id="sub-head">show magic of world fine photos</p> </div> here css: p#sub-head { font-size: 24px; margin: 0 0 10px 35px; color: #000; } img.promo { float: right; margin-right: 20px; z-index: 0; } i tried adding border: none; image didn't make difference. i appreciate guidance towards solution. thanks. the border on image itself.

python - Django template extend issue -

when use {% extends %} tag not pulling through standard html. there missing new django template tags. want add standard,html index.html file resides in templates folder. my index file in template folder: {% extends "standard.html" %} {% block maincontent %} {% block headcontent %} <link rel="stylesheet" type="text/css" href="/media/css/panels.css" /> <link rel="stylesheet" type="text/css" href="/media/css/hostoverview.css" /> {% endblock %} <script> function disat(c,f){ if(c.checked){f.txt1.disabled=false; f.submit.disabled=false; } else{f.txt1.disabled=true; f.submit.disabled=false; } } </script> <style> a:link { color: #39f; text-decoration: none; } a:visited { text-decoration: none; color: #63c; } a:hover { text-decoration: none; color: #ccc; } a:active { text-decoration: none; color: #000; } </style> <div style="display:none&

javascript - Tool for checking JS doc -

is there tool or script can check , compare js code generated documentation. check if parameters or return value types specifed inncorrect? i've generated js doc using grunt. i use webstorm , , checks method calls time jsdoc have written method paramater.

ios - MFMailComposeViewController not working on device , instance printed on console output is <register sp is not available> -

Image
i have created utility class called mailcomposeviewcontroller cllling class other view controller, mail composer working on simulater is crashing on device. this way calling function nslog(@"mail"); mailcomposeviewcontroller *mailcomposer =[[mailcomposeviewcontroller alloc]init]; [mailcomposer showpicker:self andimage:md.img_savedimageaftereffect]; below utility class contains code send mail functionility #import "mailcomposeviewcontroller.h" uiviewcontroller *controller; @implementation mailcomposeviewcontroller -(void)showpicker:(id)viewcontroller andimage:(uiimage*)image; { controller = viewcontroller; class mailclass = (nsclassfromstring(@"mfmailcomposeviewcontroller")); if (mailclass != nil) { // must check whether current device configured sending emails if ([mailclass cansendmail]) { [self displaycompos

jQuery Cycle Questions -

i have following code , whatever reason, end option doesn't seem want call function it's supposed to. ideas? $(document).ready(function() { $('#weareepic').cycle({ fx: 'fade', speed: 1000, timeout: 1500, nowrap: 1, end: function() { $('#bigshots').fadeout(1500); } }); }); much appreciated folks! 'fadeout' should camel cased 'fadeout'. javascript errors in jquerys ajax call can hidden due being caught jquery. recommend using debugger if seems amiss.

php - How to show Factories for when specific User has logged in -

how add factory of logged in users? i'm using tank_auth , made account 'admin' made table called 'factoryusers'. i want add factory specific user using joins. my table structure: users ----- id username email ... ... factories --------- idfactories factoryname adress ... ... factoryusers ------------ idfactoryusers idusers idfactories i tried join these tables , show records factoryusers table. my controller function: $data['userbedrijf'] = $this->bedrijven_model->bedrijvenusers(); (translation english: $data['userfactory'] = $this->factory_model->factoryusers();) my model: function bedrijvenusers() { $this->db->join('bedrijven', 'bedrijfusers.idbedrijven = bedrijven.idbedrijven'); $this->db->join('users', 'bedrijfusers.idusers = users.id'); $result = $this->db->get('bedrijfusers', 1); return $result->result(); } my views: <h4>

php - Use of two dimensional array -

i facing problem while wanting fetch rows following table namely date . id name username app sdate edate === ======= ======== === ===== ====== 1 tanvir tanvir 1 2012 2012 2 ranvir ranvir 1 2011 2013 3 john john 2 2011 2012 4 rakib rakib 1 2011 2012 i use following mysql query: $date = mysql_query("select * `date`"); $date_row = mysql_fetch_array($date); but returning single row. how can put of rows 2 dimensional array? well of course it's returning 1 row, that's mysql_fetch_array does: mysql_fetch_array — fetch a result row associative array, numeric array, or both now, build array of rows, have iterate on them: $all_rows = array(); while($row = mysql_fetch_assoc($date)) $all_rows[] = $row; notice how use mysql_fetch_assoc here. should never use mysql_fet

jquery - Spring: Ajax call to @ResponseBody param encoding fails in IE -

Image
i'm working spring , try make ajax call @responsebody in controller. update okay, added changes got told to ajax settings. param "jtsearchparam" still has same encoding problem in ie. + got other error, 406, response header has wrong content-type. here's new code controller: @requestmapping(method = requestmethod.post, consumes="application/json; charset=utf-8", produces="application/json; charset=utf-8") public @responsebody jsonobject getusers(@requestparam int jtstartindex, @requestparam int jtpagesize, @requestparam string jtsorting, @requestparam string jtsearchparam, httpservletrequest request, httpservletresponse response) throws jsonexception{ gson gson = new gsonbuilder() .setexclusionstrategies(new userexclusionstrategy()) .create(); list<user> users = userservice.findusers(jtstartindex ,jtpagesize, jtsorting, jtsearchparam); type use

javascript - Should I load responsive design via JS or CSS -

i looking make responsive design. curious know how people feel on loading responsive design, should load in new css file , use js define screen size. or should create media queries inside current css file , go there. looking opinion on speed , people feel more optimal approach. putting regarding styles in css files best practice. html => structure css => styles js => logic the more separate concerns, easier code mantain.

java - How do I make my custom camera app the default one? -

if use following code: intent takepictureintent = new intent(mediastore.action_image_capture); startactivityforresult(takepictureintent,1); it start default android camera app right... i've written custom camera app, how let android know it's camera app, , user should given choice camera app use. in other words, if used code above, my app should start, , not default android one. but how let android know it's camera app, , user should given chose camera app use. have <intent-filter> on <activity> action: <intent-filter> <action android:name="android.media.action.image_capture" /> <category android:name="android.intent.category.default" /> </intent-filter> the next time executes above startactivityforresult() call, appear in chooser alongside else supports intent structure.

c# - differentiating primary tile vs app-list wp8 -

i developing app wp8.i want know how find out app coming foreground clicking on app-list or primary tile user created.in way want know how many users creates primary tile. you can add navigation parameter secondary tile : string tileparameter = "param=myparameter"; shelltile tile = checkiftileexist(tileparameter); if (tile == null) { standardtiledata secondarytile = new standardtiledata { title = tileparameter, backgroundimage = new uri("background-secondary.png", urikind.relative), count = 2, backcontent = "secondary tile test" }; shelltile.create(new uri("/mainpage.xaml?" + tileparameter, urikind.relative), secondarytile); } and then, in mainpage's onnavigatedto event, can parameter this: if (this.navigationcontext.querystring.containskey("param&

iphone - How to add curve at two point joint using coreGraphics? -

Image
i'm working on creating sine chart using core-graphics. done thing drawing chart , working need want add curve @ 2 point joint. my chart looks below image: i need draw line in below image don't know how: can me out issue? my drawrect code below - (void)drawrect:(cgrect)rect { [self setclearscontextbeforedrawing: yes]; cgcontextref context = uigraphicsgetcurrentcontext(); cgcolorref backcolorref = [uicolor blackcolor].cgcolor; cgfloat backlinewidth = 2.f; cgfloat backmiterlimit = 0.f; cgcontextsetlinewidth(context, backlinewidth); cgcontextsetmiterlimit(context, backmiterlimit); cgcontextsetshadowwithcolor(context, cgsizemake(3, 5), 8, backcolorref); cgcontextsetlinejoin(context, kcglinejoinround); cgcontextsetlinecap(context, kcglinecapround ); cgcontextsetblendmode(context, kcgblendmodenormal); cgcontextsetstrokecolorwithcolor(context, [uicolor whitecolor].cgcolor); int x = 320 ; int y = 180