Posts

Showing posts from August, 2014

search result from sql error with codeigniter's pagination index -

i have table pagination . first, select data db, , pagination works perfectly. then, started filter data (search data, example : using where in sql). pagination's 1st index working (showing data) when click next index (2nd, 3rd) data going default (the filter ( where , like ) not working). this model used pagination ( i think made mistake here ) : public function get_umat() { $this->db->select('*')->from('msumat')->limit(10, $this->uri->segment(3)); $this->db->join('mskelas', 'msumat.kelas_id = mskelas.kelas_id'); $search = $this->input->post('ddl_search'); $kelas = $this->input->post('ddl_kelas'); $kelas1 = $this->input->post('ddl_kelas1'); $kelas2 = $this->input->post('ddl_kelas2'); $nama = $this->input->post('txt_nama'); $alamat = $this->input->post('txt_alamat'

Json data store in SQLite in Android -

i trying store data in sqlite data base. can not that. give error. code , please me fix this. public class androidjsonparsingactivity extends listactivity { // url make request private static string url = "http://api.androidhive.info/contacts/"; // json node names private static final string tag_contacts = "contacts"; private static final string tag_id = "id"; private static final string tag_name = "name"; private static final string tag_email = "email"; private static final string tag_address = "address"; private static final string tag_gender = "gender"; private static final string tag_phone = "phone"; private static final string tag_phone_mobile = "mobile"; private static final string tag_phone_home = "home"; private static final string tag_phone_office = "office"; // contacts jsonarray jsonarray contacts = null; @override public void oncreate(bundle savedinstances

visual studio 2010 - asp.net MVC 3 solution doesnt work after opening in VS 12 -

i created asp.net mvc 3 application using visual studio 2010. working fine. uploaded hosting has asp.net mvc 3 installed , worked. opened mvc 3 solution in visual studio 2012. @ time, did gradation. created 151marketing.v11.suo upgradelog.html upgradelog.xml , folder named _upgradereport_files , backup folder. when publish on live server, errors of framework. see backup folder wel guess created before conversion vs 12. should use or there other way change current version of code work on hosting because after opened in vs 12, made several changes well. please suggest probably mvc3 project got updated mvc4. replace project type guid old mvc3 ones (in .csproj file): <projecttypeguids>{e53f8fea-eae0-44a6-8774-ffd645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</projecttypeguids> if that's case, careful used referenced libraries (version). if use mvc4, should localcopy assemblies /bin directory. also, might

php - CodeIgniter Shopping Cart Strange Behaviour -

i have strange behaviour of codeigniter's shopping cart class. have set ci_session table in database , have changed sess_use_database true. what happening when add items shopping cart fine: see total items counter going , everything. when go shopping cart page first time see items there, should be. have provided delete item button , empty cart button. strange things happen here: when click remove item, page refreshes (due redirect think) item still there! if manually refresh page of cart, see same item had removed disappear. it's like, when use redirect, cache of page, not actual page fresh information on it. anyway, here links: try add items page: http://www.pantanishoes.it/niko/index.php/store/linea/urban clicking on big dark button on bottom of every item description. then try go carrello on menu on top , try delete of items or svuota(which simple destroy()) , see happens! appreciated! in advice! here code of cart. function add() { $item = $this->sto

broadcastreceiver - Android wait for WiFi scan to finish -

i'm trying wait wifi scan finish in broadcast receiver!. i have 1 activty (chooseactivity extends activity) , 1 class (scan). in activity call scan class scan wifi , return boolean (true) when finish, here code. my purpose separate scan of activity because call scan class in several places. public class chooseactivity extends activity implements onclicklistener{ private int idmap; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.activity_choose); idmap = this.getintent().getextras().getint("id_map"); ((button)this.findviewbyid(r.id.scan_button)).setonclicklistener(this); } @override public void onclick(view v) { // todo auto-generated method stub switch(v.getid()){ case r.id.scan_button: scan scan = new scan(); toast.maketext(getapplicationcontext(), " "+scan.scanhotspots(idmap), toast.len

Song database null pointer -

i'm creating simple music database userinterface.class, song.class, songdatabase.class , playlist.class. song object(artist, name, duration, filesize) input user meant stored in nearest dataslot in songdatabase , i'm receiving null pointer @ user input "filesize" java.lang.nullpointerexception @ songdatabase.addsong(songdatabase.java:27) @ userinterface.userimport(userinterface.java:143) @ userinterface.main(userinterface.java:61) i'm having trouble storing refrence of song object in playlist class's here; http://pastebin.com/k4hm08su if @ great thanks. the songdatabase; public class songdatabase { userinterface intface = new userinterface(); song songdata = new song(); private static song a; private static song b; private static song c; private static song d; public songdatabase() { = null; b = null; c = null; d = null; } public void addsong(string dataartist, string dataname, double dataduration, int datafilesize)

database - Ruby on Rails, datatable. multiple records for one user -

i bit confused creating , inserting data in table. for example, have user-table, users saved. payment-table should save payments made user a. payments not updated. once user registered, fills form types payments , there saved , nothing more. ( know sounds strange database based on statistical analysis of files. once file loaded, analysis done , data analysis (simple numbers) have stored. pro file there 1000 numbers stored , nothing updated). reference key user's id. so, should this: class paymentstable < activerecord::migration def change create_table :payments |t| t.integer :user_id t.float :sum end end end my problem not understand how can save 10 payemnts of user if specified t.float :sum 1 time. thanks in advance you want make entry of each of payments made user , want sum payments current way wrong. you can create table of payments this, class paymentstable < activerecord::migration def change create_table :payment

carrierwave - How to get id of created image in rails -

i have recipe model , recipephoto model. want show thumbnail of scaled image on creating new recipe. upload photo through jquery-file-upload. problem don't know how id of uploaded photo. example: user creating new recipe. loads photo , crops on server , see thumbnail preview before submitting recipe. recipes_controller.rb def new @recipe = recipe.new @recipe_photo = recipephoto.new end recipes/new.html.slim = simple_form_for @recipe, :html => {:class => 'add-recipe-form'} |recipe| .form-inputs = recipe.input :title .form-actions = recipe.submit "create recipe" = form_for @recipe_photo |f| .form-inputs = f.label :image, "upload paintings:" = f.file_field :image, multiple: false recipe_photo.js.coffee (here can filename, not record_id) $ -> $('.new_recipe_photo').fileupload datatype: "script" done: (e, data) -> console.log data.files[0], data.files[0].name

authentication - Email based interaction with rails app -

i need gem allow users interact rails app through email, without need register. example: publish sale, accompanied email, , of controls (crud, , submitting) on email links (delete, update, , on). i'll to, somehow connect devise, opportunity of further registration using same email shopping history. to publish something(services or products) sale user has fill: name, email (validates unique), phone. may or may not used future registration using devise. in same form may be: pictures, description, , other fields of product......... the idea store: id, name, email, phone in user db without password, or somehow pending registration just create own crud controller authorization based on hash add url. store hashes in database , verify if user legitimate perform action. warning : valid url able perform these actions. well, in comment wrote want integrate devise. devise supports login tokens existing users. should somehow virtually register them. easiest approach

Octave - array to number -

i have array a=[0 1 0 1 1 0] , turn content of array number ( a=010110 ). how do that? and to opposite: if have number b=100101 , array a=[1 0 0 1 0 1] thanks help not elegant, go matrix number: a = [1 0 1 1 0 1]; = mat2str(a); % returns '[1,0,1,1,0,1]' = strrep(substr(a, 2, numel(a)-2), ',', ''); % remove ',' , '[' , ']' = str2num(a); % convert number number matrix: a = 110011001; = num2str(a, 1000000)-'0'; where 1000000 precision octave using when converting number string. needs large enough accommodate numbers converting.

Problems with <> via an INNER JOIN query in MySQL -

i'm trying find tag name, if reference doesn't exist in relationship table: select tags.tag_id, tags.tag tags inner join bookmarks_tags on (bookmarks_tags.user_id = tags.user_id) (tags.user_id = '1') , (tags.tag '%jose%') , (bookmarks_tags.tag_id not in (tags.tag_id)) group tags.tag_id i've tried combinations of "!=", "<>", , above, in every permutation can think of, none exclude "jose", should given tag present in "tags" table, , "bookmarks-tags" table, contains reference. any ideas? do left join , exclude rows match: select tags.tag_id, tags.tag tags left join bookmarks_tags on bookmarks_tags.user_id = tags.user_id , bookmarks_tags.tag_id = tags.tag_id tags.user_id = 1 , tags.tag '%jose%' , bookmarks_tags.tag_id null alternatively use subquery: select tag_id, tag tags user_id = 1 , tag '%jose%'

java - JWindow region opacity -

Image
i want implement screenshot functionality in snipping tool. can select rectangle , make screenshot, rectangle full opacity. i wonder if there function in swing or awt can use this: window.setopacityat(rectangle r, 0.5f); i hope got problem! see how create translucent , shaped windows: how implement per-pixel translucency .

php - Getting error404 on Ajax in Codeigniter -

i have problem ajax code. i`m trying increase number inside span on click ajax, keep getting error in console - post localhost/slots/game/lines 404 (not found) . btw, use codeigniter. here code : php (controller) <?php if ( ! defined('basepath')) exit('no direct script access allowed'); class game extends ci_controller { function __construct() { parent::__construct(); } function index(){ } function win() { $this->session->set_userdata( array('win') => $win); $win = $this->input->post('win'); } function lines() { $this->session->set_userdata( array('lines') => $lines); $lines = $this->input->post('lines'); echo $lines++; } function wager(){ $this->session->set_userdata( array('wager') => $wager); $wager = $this->input->post('wager'); } } ?> a

Force Python calculation in double -

this question has answer here: how can force division floating point? division keeps rounding down 0 13 answers why doesn't division work in python? [duplicate] 4 answers python division 10 answers i want print double in python. doesn't work, , don't know why. my code: test = 3000 / (1500 * 2000) print str(test) i 0 , not 0.001 if following: test = 3000 / (1500 * 2000) print '%.10f' % test i 0.000000000 , not 0.001 . how tell python should double? in python 2.x need convert @ least 1 of operands float, integer division results in truncated output in python 2.x: >>> 3000 / (1500 * 2000) 0 >>> 3000.0 / (1500 * 2000) # or use fl

Autofill input type="text" field from an external link -

i have link on 1 page looks this: http://www.domain.com/sample-link#product_id and on other page (sample-link), have input field: <input type="text" name="name" value="name" /> so, when click link first page, want open "sample-link" page, , autofill name field "product_id" text. ideas how can make this? thanks in advance. you'll have add tiny javascript snippet: if (document.location.hash) document.getelementbyid('testbox').value = decodeuricomponent(document.location.hash.substr(1)); for obvious reasons you'll have adjust id of text box. gets bit more complicated in case you'd pass more 1 value. the call decodeuricomponent() optional, required in case you're passing characters spaces or non-alphanumerical stuff (just sure).

c# - Select from two entities with LINQ -

i have issues wrapping head around .include in linq. i'd appreciate lot if show me query achieve this: i have 2 entities, user , validation (which serie of validation codes) . related in ef5 1:*. i'm trying user object , eager load validations collection. at moment, i'm doing (cx being context inside using block): var user = cx.users .where(u => u.userguid.equals(userguid)) .firstordefault(); if (user == null) { return 0; } var validation = cx.validations .where(v => v.code.equals(code)) .where(v => v.userid.equals(user.userid)) .firstordefault(); but how achieve in 1 query can use user.validations.firstordefault(); without getting error , getting validations satisfy validation.code == code test? thanks (i know i'm sounding confused that's because am). did try this: var validation = cx.validations.where(v=>v.code==code &&

asp.net - System.Web.Services : is there password property in Context.User.Identity -

just small query i m using .net web service , created simple login method [webmethod] public bool login(string susername, string spwd) { if (susername == context.user.identity.name && **spwd == "123456"**) { formsauthentication.setauthcookie(susername, true); return true; } else return false; } is there password property "context.user.identity.name" . or other alternative please suggest if missing your approach doesn't make sense. context.user set forms authentication module relies on information forms cookie. you, on other hand, try use information acually issue cookie. this means need cookie issue cookie. won't work. try rethink approach - need external data source, database or something, validate users against. in database have both usernames , passwords stored somehow.

has and belongs to many - Cakephp HABTM: View generating drop down instead of multi value selectbox -

i trying work habtm association between profiles , qualifications tables. model: profile.php app::uses('appmodel', 'model'); class profile extends appmodel { public $hasandbelongstomany = array( 'qualification' => array( 'classname' => 'qualification', 'jointable' => 'profile_qualifications', 'foreignkey' => 'profile_id', 'associationforeignkey' => 'qualification_id', 'unique' => 'keepexisting' ) ); } model: qualification.php app::uses('appmodel', 'model'); class qualification extends appmodel { public $hasandbelongstomany = array( 'profile' => array( 'classname' => 'profile', 'jointable' => 'profile_qualifications', 'foreignkey' => 'qualification_id', 'associationforeignkey' => 'profile_id', 

python - Is there a better way to do csv/namedtuple with urlopen? -

using namedtuple documentation example template in python 3.3, have following code download csv , turn series of namedtuple subclass instances: from collections import namedtuple csv import reader urllib.request import urlopen securitytype = namedtuple('securitytype', 'sector, name') url = 'http://bsym.bloomberg.com/sym/pages/security_type.csv' sec in map(securitytype._make, reader(urlopen(url))): print(sec) this raises following exception: traceback (most recent call last): file "scrap.py", line 9, in <module> sec in map(securitytype._make, reader(urlopen(url))): _csv.error: iterator should return strings, not bytes (did open file in text mode?) i know issue urlopen returning bytes , not strings , need decode output @ point. here's how i'm doing now, using stringio: from collections import namedtuple csv import reader urllib.request import urlopen import io securitytype = namedtuple('securitytype',

asp.net - Avoid application reset when deleting a folder -

i'm having bit of trouble asp.net mvc project. the users can upload images, stored id in database, , files stored in /files/images/id/ upon deleting images again, delete folder /files/images/id (that's id folder being deleted) however when deleting folder under project, application resets, thereby losing session , throwing users off. is there way mark path asp.net doesn't reset upon changes being made path ? it's simple. asp.net application should not performing file write or modify operations within paths of asp.net application. use different path store uploads.

Jquery UI Slider with ajax, php and maybe mysql -

i have slide this: $(function () { /*-------------------------------------------------- plugin: slider --------------------------------------------------*/ /* increment slider */ $( "#incrementslider" ).slider({ range: "min", value:1993, min: 1914, max: 2013, step: 1, slide: function( event, ui ) { $( "#incrementamount" ).text ("birthday: " + ui.value); } }); $( "#incrementamount" ).text ( "birthday: " + $( "#incrementslider" ).slider( "value" )); }); if user select on slider birthday want show infos. for example user takes 1980: infotext 1 belong 1980, infotext 2 belong 1980, birthday belong 1980, infotext 3 belong 1980, infotext 4 belong 1980 i need so, can use free in text, of course must change automatically if user change birthday in slider. it don't must , don't prefer solut

html - mixing CSS formatting in a single line -

how's standard way mix 2 different text formats using css style sheets? trying following <span class="cv-first">university of illinois @ urbana-champaign </span> <span class="cv-first-right">aug. 26<sup>th</sup> 2010</span> where in style sheet put: .cv-first { font-variant:small-caps; font-family: sans-serif; color: #000000; } .cv-first-right { font-variant:small-caps; font-family: sans-serif; color: #000000; text-align:right; font-style: italic; } but doesn't work. update so found if replace text-align:right; by float: right; i looking for. second part on right of page. span inline element : treated part of text aligned in block container div block element: can floated left or right, whereas text contents aligned inline elements have no width, therefore text-align has no sense. may override behavior declaring block element , setting width: .cv-fir

Neo4j REST API - create unique node -

i trying use rest api create unique node. however, getting error requiring key 'uri' (see below). based on documented examples, call creates , indexes newly created node ... there should not 'uri' paramater. request , response below. doing wrong? request: http://www.somemachine.com:7474/db/data/index/node/idxhost?unique=get_or_create { "key": "name", "value": "host", "properties": { "type": "company", "name": "host", "sequence": 1 } } response: state:400, body: { "message" : "missing required key: \"uri\"", "exception" : "badinputexception", "fullname" : "org.neo4j.server.rest.repr.badinputexception", "stacktrace" : [ "org.neo4j.server.rest.repr.formats.jsonformat.readmap(jsonformat.java:92)", "org.neo4j.server.rest

objective c - ios animation, rotating button, button suddenly changes position -

i trying implement animations in application . want try simple rotation of button . button rotated , changes position , rotation angle different 1 want. have added autoresizessubwievs = no; - (ibaction)rotateview:(id)sender { [uiview animatewithduration:0.6f delay:0.1 options:uiviewanimationoptioncurveeaseout animations:^{ self.view.autoresizessubviews = no; [self.buttoner settransform:cgaffinetransformrotate(self.buttoner.transform, 90.0f)]; } completion:nil]; } what doing wrong? can please me? edit: have 2 buttons, when first gets pressed, call above method ... causes move first button , move second button , rotate inappropriate angle. dont understand @ all.. for angle problem, instead of passing 90, should pass radian value of angle m_pi/2 . [self.buttoner settransform:cgaffinetransformrotate(self.buttoner.transform, m_pi/2)];

php - Bootstrap: Trouble using modal for showing dynamic data -

i have list created dinamically using php while($row = $result->fetch_assoc()){ //$row row fetched database <tr> <td><?php echo $row['id']?></td> <td><?php echo $row['name']?></td> <td><?php echo $row['surname']?></td> <td><a href="#modal" <?php echo "id= " . $row['username'] ?> class="btn btn-small btn-info" data-toggle="modal" > vedi</a></td> </tr> } modal this: <div id="modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="modallabel" aria-hidden="true"> <div class="modal-header"> <a class="close" data-dismiss="modal" aria-hidden="true">×</a> <h3 id="mymodallabel">user information</h3> </div>

decNumber C library Visual Studio 2010 Compile error -

i getting errors compiling decnumber c library in visual studio 2010 in windows 7 64 -bit pc. i tried solutions offered @ post: decnumber library - compile issues did not fix problems. these errors getting error c1189: #error : unexpected decpmax value coming line of code in delcommonn.c file: //names simpler testing , default context #if decpmax==7 #define single 1 #define double 0 #define quad 0 #define defcontext dec_init_decimal32 #elif decpmax==16 #define single 0 #define double 1 #define quad 0 #define defcontext dec_init_decimal64 #elif decpmax==34 #define single 0 #define double 0 #define quad 1 #define defcontext dec_init_decimal128 #else #error unexpected decpmax value #endif also getting error: error c1189: #error : decbasic.c must included after deccommon.c from line of code in delbasic.c file: // compile-time flags single, double, , quad set in // deccommon.c #if !defined(quad

python - Deleting a few list items inside of dictionary -

deleting few list items inside of dictionary hi, have dictionary: phone = {"first":100,"second":200,"third":[10,12,5,38],"fourth":400} let' want remove 12 , 5 from "phone" dictionary. there way using "del" function? i know how this, using .remove() phone["third"].remove(12) phone["third"].remove(5) but wondering if possible using del()? thank you. edit: replies concentrating on "del uses index, remove uses exact value", redefining question: i want delete indexes 1 , 2 in list representing third key-value item in "phone" dictionary. how can that? you have index rather value: >>> phone = {"first":100,"second":200,"third":[10,12,5,38],"fourth":400} >>> del(phone["third"][1:3]) >>> phone {'second': 200, 'fourth': 400, 'third': [10, 38], 'first': 100}

GitHub For Windows Login to visualstudio.com -

i using github windows mange clone of 1 of repositories on visualstudio.com (part of tfs hosting git support). github windows prompts me login, ok button remains disabled if type in username , password. there sort of setting need change allow logging in repo? to clarify, not issue github credentials credentials connecting clone of 1 of tfs.visualstudio.com repositories. username email address contains period , @ didn't play nicely with github windows client. fix enable alternate credentials in tfs.visualstudio.com profile , set username without invalid characters. works fine using alternate username connect.

algorithm - Divvying people into rooms by last name? -

i teach large introductory programming classes (400 - 600 students) , when exam time comes around, have split class different rooms in order make sure has seat exam. to keep things logistically simple, break class apart last name. example, might send students last names - h 1 room, last name - l second room, m - s third room, , t - z fourth room. the challenge in doing rooms have wildly different capacities , can hard find way segment class in way causes fit. example, suppose distribution of last names (for simplicity) following: last name starts a: 25 last name starts b: 150 last name starts c: 200 last name starts d: 50 suppose have rooms capacities 350, 50, , 50. greedy algorithm finding room assignment might sort rooms descending order of capacity, try fill in rooms in order. this, unfortunately, doesn't work. example, in case, right option put last name in 1 room of size 50, last names b - c room of size 350, , last name d room of size 50. greedy algorit

css - Magento templates, changing class names -

i'm not sure if best forum ask in, need style magento theme , i'm wondering how dependent javascript on class names? for example, have in template file (inside theme file, overriding base) <form action="<?php echo $this->getformactionurl() ?>" method="post" id="newsletter-validate-detail"> <div class="block-content"> <div class="form-subscribe-header"> if say, leave ids alone, change class names else (i.e. remove "block content" or "form-subscribe-header") break javascript in magento? also, there easy way tell if i've broken something? console error if piece of javascript coupled css class name? search javascript files class names see if used script. leave classes add new 1 in, this: <div class="form-subscribe-header new-class"> then target class using .new-class and yes, javascript errors appear in console.

r - Not understanding the behavior of ..density -

Image
in dataframe below, expect y axis values density 0.6 , 0.4, yet 1.0. feel there extremely basic missing way using ..density.. brain freezing. how obtain desired behavior using ..density.. appreciated. df <- data.frame(a = c("yes","no","yes","yes","no")) m <- ggplot(df, aes(x = a)) m + geom_histogram(aes(y = ..density..)) thanks, --jt as per @arun's comment: at moment, yes , no belong different groups. make them part of same group set grouping aesthetic: m <- ggplot(df, aes(x = , group = 1)) # 'group = 1' sets group of x 1 m + geom_histogram(aes(y = ..density..))

c# - How do I add an object with the entity framework when it has attribute to store data in utf-8 -

my application has entity in db has 2 fields [id, word] word store urdu words in written in unicode. fields have been created in db such on manually entering data being added when try same thing via entity framework instead of proper words ???? appear . sr stream reading. , word entity. while (!sr.endofstream) { string line = sr.readline(); word w = new word(); w.name=line.trim(); context.words.addobject(w); } context.savechanges(); and entity created in mysql 5.0 create table `word` ( `wordid` int(10) unsigned not null auto_increment, `name` varchar(80) character set utf8 collate utf8_bin not null, primary key (`wordid`) ) engine=innodb auto_increment=15716 default charset=latin1;

ios - Apple store reject my app (based jquery mobile) -

Image
firs time developed app.it contain webview , call website webview.they rejected app.then looked advice developers said "you should ios features" so used objective c..i used ios features.such check network connection,splash,i replaced static form ios form...in app used thing native expect google map....for google map used jquery mobile rejected again...there screenshoot iphone app , performance good screenshot 1:this ios native form screenshot 2 :this ios native form(bind json rest service) screenshot 3: jquery mobile web page.i call ios web view screenshot 4: jquery mobile web page.i call ios web view screenshot 5: ios form this rejected issues , closed communication can not ask them , mail them should do? rejected 2.12: apps not useful, web sites bundled apps, or not provide lasting entertainment value may rejected 10.6: apple , our customers place high value on simple, refined, creative, thought through interfaces. take more work worth it. apple sets high

java - ActionPerformed does not work -

have little problem code. actionperformed method doesn't work. buttons knappstartsalg , knappstartkunde , don't react when push buttons. all should have been imported imported. will thankful help. startmeny class. public class startmeny extends jframe implements actionlistener { public jbutton knappstartsalg, knappstartkunde, knappstartinfo, knappstartstatistikk; public jpanel startmeny() { jpanel startpanel = new jpanel(); startpanel.setlayout(new gridlayout(2, 0, 25, 25) ); startpanel.setcomponentorientation(componentorientation.left_to_right); startpanel.setbackground(color.white); jbutton knappstartsalg = new jbutton(); knappstartsalg.settext("salg"); knappstartsalg.setverticaltextposition(jbutton.bottom); knappstartsalg.sethorizontaltextposition(jbutton.center); knappstartsalg.seticon(new javax.swing.imageicon(getclass().getresource("salg.png"))); knappstartsalg.seticontextgap(6);

java - ObjectInput and Output streams are not being accepted by client/server -

i have 1 program 2 serverside processes. 1 server sends arraylist client. other server first takes string client , finds proper record corresponding id , sends record back. i'm having problems second server process. see println statement below says "gets stuck here". that's program hangs. import java.io.ioexception; import java.io.objectinputstream; import java.io.objectoutputstream; import java.net.serversocket; import java.net.socket; import java.sql.connection; import java.sql.drivermanager; import java.sql.resultset; import java.sql.statement; import java.util.arraylist; public class custserver{ public static void main(string args[]) throws ioexception, classnotfoundexception{ serversocket serversocket1 = null; serversocket serversocket2 = null; arraylist<customer> list = null; string drivername = "sun.jdbc.odbc.jdbcodbcdriver"; string connectionurl = "jdbc:odbc:customer"; connection c

xna - How do I use a image photo as a Windows phone Button -

i created button image , named texture2d btn_play . main menu , want press change currentgamestate . my variables: graphicsdevicemanager graphics; spritebatch spritebatch; texture2d tex_btn_play; rectangle rec_btn_play; enum menu { mainmenu, playing, exit, } menu currentgamestate = menu.mainmenu; and update method: protected override void update(gametime gametime) { // allows game exit if (gamepad.getstate(playerindex.one).buttons.back == buttonstate.pressed) this.exit(); if (rec_btn_play = touchlocationstate.pressed); // todo: add update logic here base.update(gametime); } the if (rec_btn_play = touchlocationstate.pressed); wrong, don't know why. please me solve problem. you need find touch locations , check if rectangle intersects position touchcollection touchcollection = touchpanel.getstate(); foreach (touchlocation tl in touchcollection) { if (tl.state == tou

c# - Windows shortcut vs command line behavior -

i'm encountering strange problem explained differences in running program via command line or shortcut. the application in question command line c# program generates barcodes quickbooks company file. have setup shortcut runs program. if run shortcut, unreproduceable, strange errors within program. errors not external libraries. if run shortcut via command line, or program directly program files correct command line parameters, runs fine. any ideas? can provide more information on errors, have logic of program , not syntax/null pointer/object reference errors. there's 1 thing distinguishs starting process command line or explorer starting shortcut: "working directory". command line or explorer set directory of executable. same in shortcut. in program should not rely on working directory being path of executable (for config file, ressources a.s.o.). instead determine correct path @ runtime.

java - Android: Nested Linearlayouts will not display a grid of buttons, Matching parent -

i have app under construction. in 1 of sub-menus have need generic display of buttons, , therefor want make activity can display given number of needed buttons. i have succesfully made happen, programmatically, want total grid of buttons fill entire parent placed in, happens 3/4 of landscape screen. number of buttons varies 16-38.! i have succesfully made happen other grids of buttons, in xml, weight values, , match_parent values of entries. when assign buttons or rows match_parent value programatically, occupies entire parent layout, not sharing expect do, though have same weight value of 1.0f the relevant code follows below. post images well, have not reputation so. `linearlayout layout = (linearlayout) findviewbyid(r.id.linear_custom_draw); layout.setorientation(linearlayout.vertical); int columns = math.min(6, 4+category); //sets number of buttons per row 4-6 (int = 0; < 4+category; i++) { linearlayout row = new linearlayout(this);

Why jQuery.css does not apply a property if it is not supported and how is this being checked? -

i'm bit confused. expected $.css() method dumbly add css property element no matter what. know, in chrome dev tools, when apply css property element , appears in html. apparently somehow checks if supported. example, if run command: $('#element').css('display','block'); /* returns jquery object) */ $('#element').css('display') /* returns "block" */ but if put like $('#element').css('hurr','durr'); $('#element').css('hurr') /* returns undefined */ so, jquery checks if property appliable? another example. opera not support css filters. or it? well, used method described here , surprisingly returned true 'filter'. tried apply $.css: $('#element').css('filter','blur(5px)'); $('#element').css('filter') /*returns "" (an empty string) * so, not jquery check if element supported checks if value legit. how that? right way che

arrays - Positioning a movieclip onto another movieclip -

i'm creating game if hit zombie zombie dies , head sent in direction hit. have 2 movieclips zombie , zombie head. once zombie hit play dying animation , remove , @ same time zombie head added dying zombie , blown back. have done code hittest , zombie dying , respawning can't seem position , add head dying zombie when hit. how can this. thought this, added in playdeathanimation function in zombie class did not work: for (var i=0; < movieclip(parent).zombies.length; ++i) { var zh = new zombiehead(); zh.x = movieclip(parent).zombies[i].x; zh.y = movieclip(parent).zombies[i].y; zh.rotation = movieclip(parent).zombies[i].rotation; addchild(zh); } i have 4 classes player package { import flash.display.movieclip; import flash.events.event; import flash.events.keyboardevent; import flash.events.mouseevent; import flash.ui.keyboard; import flash.display.graphics; import flash.utils.settimeout; public class player extend